@@ -27,133 +27,7 @@ public class MenuBar
2727 public readonly IList < DMIButton > Buttons = new List < DMIButton > ( ) ;
2828 public MenuBar ( DriverMachineInterface dmi )
2929 {
30- /* Default menus disabled. Interface with TCS to be defined in the future
31- var main = new DMITextButton("Main", "Main", true, () =>
32- {
33- var buts = new List<DMIButton>();
34- buts.Add(new DMITextButton("Start", "Start", true, null, 153, 50, dmi));
35- var driverid = new DMITextButton("Driver ID", "Driver ID", true, () =>
36- {
37- var fields = new List<DMIDataEntryValue>();
38- var val = new DMIDataEntryValue();
39- val.Name = "Level";
40- val.Keyboard = new DMIKeyboard(DMIKeyboard.KeyboardType.Alphanumeric);
41- fields.Add(val);
42- var idwnd = new DataEntryWindow(new DMIDataEntryDefinition("Driver ID", fields, false, null, null), dmi);
43- dmi.ShowSubwindow(idwnd);
44- }, 153, 50, dmi);
45- driverid.Enabled = true;
46- buts.Add(driverid);
47- var traindata = new DMITextButton("Train data", "Train data", true, () =>
48- {
49- var fields = new List<DMIDataEntryValue>();
50- var val = new DMIDataEntryValue();
51- val.Name = "Train category";
52- List<string> keys = new List<string>();
53- val.Keyboard = new DMIKeyboard(keys);
54- keys.Add("PASS 1");
55- keys.Add("PASS 2");
56- keys.Add("PASS 3");
57- keys.Add("TILT 1");
58- keys.Add("TILT 2");
59- keys.Add("TILT 3");
60- keys.Add("TILT 4");
61- keys.Add("TILT 5");
62- keys.Add("TILT 6");
63- keys.Add("TILT 7");
64- keys.Add("FP 1");
65- keys.Add("FP 2");
66- keys.Add("FP 3");
67- keys.Add("FP 4");
68- keys.Add("FG 1");
69- keys.Add("FG 2");
70- keys.Add("FG 3");
71- keys.Add("FG 4");
72- fields.Add(val);
73- val.Name = "Length (m)";
74- val.Keyboard = new DMIKeyboard(DMIKeyboard.KeyboardType.Numeric);
75- fields.Add(val);
76- val.Name = "Brake percentage";
77- val.Keyboard = new DMIKeyboard(DMIKeyboard.KeyboardType.Numeric);
78- fields.Add(val);
79- val.Name = "Maximum speed (km/h)";
80- val.Keyboard = new DMIKeyboard(DMIKeyboard.KeyboardType.Numeric);
81- fields.Add(val);
82- val.Name = "Airtight";
83- keys = new List<string>();
84- keys.Add("Yes");
85- keys.Add("No");
86- val.Keyboard = new DMIKeyboard(keys);
87- fields.Add(val);
88- val.Name = "Loading gauge";
89- keys = new List<string>();
90- keys.Add("G1");
91- keys.Add("GA");
92- keys.Add("GB");
93- keys.Add("GC");
94- keys.Add("Out of GC");
95- val.Keyboard = new DMIKeyboard(keys);
96- fields.Add(val);
97- var datawnd = new DataEntryWindow(new DMIDataEntryDefinition("Train data", fields, true, null, null), dmi);
98- dmi.ShowSubwindow(datawnd);
99- }, 153, 50, dmi);
100- traindata.Enabled = true;
101- buts.Add(traindata);
102- buts.Add(null);
103- var level = new DMITextButton("Level", "Level", true, () =>
104- {
105- var fields = new List<DMIDataEntryValue>();
106- var val = new DMIDataEntryValue();
107- val.Name = "Level";
108- List<string> keys = new List<string>();
109- keys.Add("Level 0");
110- keys.Add("Level 1");
111- keys.Add("Level 2");
112- keys.Add("Level 3");
113- keys.Add("SCMT");
114- keys.Add("LZB");
115- val.Keyboard = new DMIKeyboard(keys);
116- fields.Add(val);
117- var levwnd = new DataEntryWindow(new DMIDataEntryDefinition("Level", fields, false, null, null), dmi);
118- dmi.ShowSubwindow(levwnd);
119- }, 153, 50, dmi);
120- level.Enabled = true;
121- buts.Add(level);
122- var trn = new DMITextButton("Train running n.", "Train running number", true, () =>
123- {
124- var fields = new List<DMIDataEntryValue>();
125- var val = new DMIDataEntryValue();
126- val.Name = "Train running number";
127- val.Keyboard = new DMIKeyboard(DMIKeyboard.KeyboardType.Numeric);
128- fields.Add(val);
129- var trnwnd = new DataEntryWindow(new DMIDataEntryDefinition("Train running number", fields, false, null, null), dmi);
130- dmi.ShowSubwindow(trnwnd);
131- }, 153, 50, dmi);
132- trn.Enabled = true;
133- buts.Add(trn);
134- var shunt = new DMITextButton("Shunting", "Shunting", true, null, 153, 50, dmi);
135- shunt.DelayType = true;
136- buts.Add(shunt);
137- buts.Add(new DMITextButton("Non Leading", "Non Leading", true, null, 153, 50, dmi));
138- buts.Add(new DMITextButton("Maintain Shunt.", "Maintain Shunting", true, null, 153, 50, dmi));
139- buts.Add(new DMITextButton("Radio data", "Radio data", true, null, 153, 50, dmi));
140- var wnd = new MenuWindow("Main", buts, dmi);
141- dmi.ShowSubwindow(wnd);
142- }, 60, 50, dmi);
143- main.Enabled = true;
144- Buttons.Add(main);
145- var ov = new DMITextButton("Over-\nride", "Override", true, () =>
146- {
147- var buts = new List<DMIButtonDefinition>();
148- buts.Add(new DMIButtonDefinition("EoA", false));
149- var wnd = new MenuWindow(new DMIMenuWindowDefinition("Override", buts), dmi);
150- dmi.ShowSubwindow(wnd);
151- }, 60, 50, dmi);
152- ov.Enabled = true;
153- Buttons.Add(ov);
154- Buttons.Add(new DMITextButton("Data\nview", "Data view", true, null, 60, 50, dmi));
155- Buttons.Add(new DMITextButton("Spec", "Special", true, null, 60, 50, dmi));
156- Buttons.Add(new DMIIconButton("SE_04.bmp", "SE_04.bmp", "Settings", true, null, 60, 50, dmi));*/
30+ // Interface with TCS to be defined in the future
15731 }
15832 }
15933 public class MenuWindow : DMISubwindow
@@ -200,15 +74,7 @@ public MenuWindow(string title, List<DMIButton> buttons, DriverMachineInterface
20074 public override void PrepareFrame ( ETCSStatus status )
20175 {
20276 base . PrepareFrame ( status ) ;
203- /* TODO: TCS menu interface to be defined
204- if (status.ActiveSubwindow is DMIMenuWindowDefinition && status.ActiveSubwindow.WindowTitle == WindowTitle)
205- {
206- DMIMenuWindowDefinition menu = (DMIMenuWindowDefinition)status.ActiveSubwindow;
207- for (int i=0; i<menu.Buttons.Count && i<Buttons.Count; i++)
208- {
209- Buttons[i].Enabled = menu.Buttons[i].Enabled;
210- }
211- }*/
77+ // TODO: TCS menu interface to be defined
21278 }
21379 }
21480}
0 commit comments