forked from badvectors/SimulatorPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulatorWindow.cs
More file actions
81 lines (74 loc) · 2.91 KB
/
Copy pathSimulatorWindow.cs
File metadata and controls
81 lines (74 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using vatsys;
namespace Simulator.Plugin
{
public partial class SimulatorWindow : BaseForm
{
public SimulatorWindow()
{
InitializeComponent();
BackColor = Colours.GetColour(Colours.Identities.WindowBackground);
ForeColor = Colours.GetColour(Colours.Identities.InteractiveText);
buttonPause.BackColor = Colours.GetColour(Colours.Identities.WindowBackground);
buttonPause.ForeColor = Colours.GetColour(Colours.Identities.InteractiveText);
buttonPause.FlatAppearance.BorderColor = Colours.GetColour(Colours.Identities.InteractiveText);
}
private void ComboBoxDisplay_SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBoxDisplay.Text)
{
case "Vatpac SweatBox-1":
SimulatorPlugin._server = "https://sweatbox01-training.vatpac.org";
break;
case "Vatpac SweatBox-2":
SimulatorPlugin._server = "https://sweatbox02-training.vatpac.org";
break;
case "Vatmex SweatBox":
SimulatorPlugin._server = "https://sweatbox.vatmex.com.mx";
break;
default:
SimulatorPlugin._server = string.Empty;
break;
}
}
private void SimulatorWindow_Load(object sender, EventArgs e)
{
switch (SimulatorPlugin._server)
{
case "https://sweatbox01-training.vatpac.org":
comboBoxDisplay.Text = "Vatpac SweatBox-1";
break;
case "https://sweatbox02-training.vatpac.org":
comboBoxDisplay.Text = "Vatpac SweatBox-2";
break;
case "https://sweatbox.vatmex.com.mx":
comboBoxDisplay.Text = "Vatmex SweatBox";
break;
default:
comboBoxDisplay.Text = "";
break;
}
UpdatePauseButton();
}
private void ButtonPause_Click(object sender, EventArgs e)
{
SimulatorPlugin.TogglePause();
UpdatePauseButton();
}
private void UpdatePauseButton()
{
if (SimulationClock.IsPaused)
{
buttonPause.Text = "RESUME";
buttonPause.BackColor = Colours.GetColour(Colours.Identities.InteractiveText);
buttonPause.ForeColor = Colours.GetColour(Colours.Identities.WindowBackground);
}
else
{
buttonPause.Text = "PAUSE";
buttonPause.BackColor = Colours.GetColour(Colours.Identities.WindowBackground);
buttonPause.ForeColor = Colours.GetColour(Colours.Identities.InteractiveText);
}
}
}
}