public void SetScreen(int id) { // Stop screen update screenTimer.Stop(); // Dispose of old elements if (activeScreen != null) { activeScreen.destroy(); } // Destroy old screen activeScreen = null; // Get Screen Helper.setForm(this); activeScreen = MocrScreen.Create(id, this); // If Screen exists: Make Elementes and resize if (activeScreen != null) { screenType = id; activeScreen.resizeForm(); activeScreen.makeElements(); // Set focus to input 0 activeScreen.screenInputs[0].Focus(); // Start the update process screenTimer.Start(); this.Resize += activeScreen.resize; } else { MessageBox.Show("Screen " + id.ToString() + " not found", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } }
public static MocrScreen Create(int id, Screen form) { screenType = id; idstr = id.ToString(); name = ""; MocrScreen scr = null; switch (id) { case 0: scr = new ConnectionScreen(form); name = "HELP"; break; case 1: scr = new AscentScreen(form); name = "OVERVIEW"; break; case 2: scr = new BoosterScreen(form); name = "BOOSTER"; break; case 3: scr = new ResourcesScreen(form); name = "CONSUMABLES"; break; case 4: scr = new OrbitView(form); name = "SPACECRAFT ORBIT (INCLINATION NOW INCLUDED!)"; break; case 5: scr = new SingleOrbit(form); name = "ORBITAL DATA"; break; case 6: scr = new Electrical(form); name = "ELECTRICAL SYSTEMS"; break; case 7: scr = new Temperature(form); name = "TEMPERATURE / ABLATORS / RADIATORS"; break; case 8: scr = new MapScreen(form); name = "MAP"; break; case 9: Console.WriteLine("MAKING TEST"); scr = new TestScreen(form); name = "TEST"; break; case 11: scr = new StreamsScreen(form); name = "CURRENT STREAMS FROM KRPC"; break; case 12: scr = new DataStorageScreen(form); name = "CURRENT DATA IN DATA-STORAGE (PySSSMQ)"; break; case 13: scr = new FutureOrbits(form); name = "FUTURE ORBITS"; break; case 14: scr = new NodesCRT(form); name = "NODES"; break; case 40: scr = new FDO(form); name = "FIDO"; break; case 50: scr = new Terrain(form); name = ""; break; case 51: scr = new AltVel(form); name = ""; break; case 52: scr = new Attitude(form); name = ""; break; case 53: scr = new TApoVel(form); name = ""; break; case 54: scr = new AltRange(form); name = ""; break; case 55: scr = new HvsHdot(form); name = ""; break; case 56: scr = new FpaVel(form); name = ""; break; case 57: scr = new GeeVel(form); name = ""; break; case 58: scr = new ApoPeriAlt(form); name = ""; break; case 60: scr = new FIDO_P5(form); name = "FIDO - EVENT INDICATOR #1"; break; case 61: scr = new FIDO_P3(form); name = "FIDO - PHASE CONTROL KEYBORAD"; break; case 70: scr = new EventPanelEECOM1(form); name = "Event Indicator - EECOM #1"; break; case 91: scr = new CrtTest(form, 1); name = "CRT TEST SCREEN - FONT SIZE 1"; break; case 92: scr = new CrtTest(form, 2); name = "CRT TEST SCREEN - FONT SIZE 2"; break; case 93: scr = new CrtTest(form, 3); name = "CRT TEST SCREEN - FONT SIZE 3"; break; case 94: scr = new CrtTest(form, 4); name = "CRT TEST SCREEN - FONT SIZE 4"; break; case 95: scr = new CrtTest(form, 5); name = "CRT TEST SCREEN - FONT SIZE 5"; break; case 98: scr = new Debug(form); name = "DEBUG"; break; case 99: scr = new CrtTest2(form, 5); name = "CRT TEST SCREEN #2"; break; /*case 100: * scr = new Pilot1(form); * name = ""; * break;*/ case 101: scr = new FDAIScreen(form); name = "FDAI"; break; case 102: scr = new DSKYScreen(form); name = "DSKY/AGC"; break; case 110: scr = new Nodes(form); name = ""; break; case 201: scr = new StatusReport(form, "BOOSTER"); name = ""; break; case 202: scr = new StatusReport(form, "RETRO"); name = ""; break; case 203: scr = new StatusReport(form, "FIDO"); name = ""; break; case 204: scr = new StatusReport(form, "GUIDO"); name = ""; break; case 205: scr = new StatusReport(form, "SURGEON"); name = ""; break; case 206: scr = new StatusReport(form, "CAPCOM"); name = ""; break; case 207: scr = new StatusReport(form, "EECOM"); name = ""; break; case 208: scr = new StatusReport(form, "GNC"); name = ""; break; case 209: scr = new StatusReport(form, "TELMU"); name = ""; break; case 210: scr = new StatusReport(form, "CONTROL"); name = ""; break; case 211: scr = new StatusReport(form, "INCO"); name = ""; break; case 212: scr = new StatusReport(form, "O&P"); name = ""; break; case 213: scr = new StatusReport(form, "AFLIGHT"); name = ""; break; case 214: scr = new StatusReport(form, "FAO"); name = ""; break; case 215: scr = new StatusReport(form, "NETWORK"); name = ""; break; case 220: scr = new StatusPanel(form); name = ""; break; } if (name != "") { form.Text = idstr + " - " + name; } else { form.Text = idstr; } form.Icon = form.form.Icon; if (scr != null) { return(scr); } return(null); }