static void Main(string[] args) { Console.WriteLine(System.IO.Directory.GetCurrentDirectory()); GHud.GHud hud = new GHud.GHud(); hud.TestMode(); hud.Awake(); for (int i = 0; i < 10000; i++) { hud.Update(); //System.Threading.Thread.Sleep(50); } hud.OnDestroy(); /* * * * * GHud.GHud g = new GHud.GHud(); * GHud.GHud g2 = new GHud.GHud(); * g.TestMode(); * g2.TestMode(); * //g.Awake(); * //g2.Awake(); * g.init_lcd(2); * g2.init_lcd(1); * while (true) * { * g.do_buttons(); * g2.do_buttons(); * * g.Update(); * g2.Update(); * System.Threading.Thread.Sleep(50); * } */ }
static void Main(string[] args) { Console.WriteLine(System.IO.Directory.GetCurrentDirectory()); GHud.GHud hud = new GHud.GHud(); hud.TestMode(); hud.Awake(); for(int i = 0; i < 10000; i++) { hud.Update(); //System.Threading.Thread.Sleep(50); } hud.OnDestroy(); /* GHud.GHud g = new GHud.GHud(); GHud.GHud g2 = new GHud.GHud(); g.TestMode(); g2.TestMode(); //g.Awake(); //g2.Awake(); g.init_lcd(2); g2.init_lcd(1); while (true) { g.do_buttons(); g2.do_buttons(); g.Update(); g2.Update(); System.Threading.Thread.Sleep(50); } */ }
public void Awake() { if (GHudmain != null) { return; } GHudmain = this; UnityEngine.Object.DontDestroyOnLoad(GHudmain); if (!lcd_initialized) { DMcLgLCD.LcdInit(); lcd_initialized = true; } Device bw_dev = new DeviceBW(); Device color_dev = new DeviceQVGA(); if (bw_dev != null && bw_dev.isValid()) { devices.Add(bw_dev); OrbitInfo initialbw = new OrbitInfo(bw_dev, "✈", System.Drawing.Color.Black, System.Drawing.Color.Black); initialbw.Activate(); bw_dev.modules.Add(initialbw); OrbitInfo targetinfo = new OrbitInfo(bw_dev, "+", System.Drawing.Color.Black, System.Drawing.Color.Black); targetinfo.is_target_type_module = true; bw_dev.modules.Add(targetinfo); bw_dev.modules.Add(new OrbitGraph(bw_dev, System.Drawing.Color.Yellow, "✈")); OrbitGraph tgt_orbitgraph = new OrbitGraph(bw_dev, System.Drawing.Color.Yellow, "+"); tgt_orbitgraph.is_target_type_module = true; bw_dev.modules.Add(tgt_orbitgraph); } if (color_dev != null && color_dev.isValid()) { devices.Add(color_dev); VesselInfo initialcolor = new VesselInfo(color_dev); initialcolor.Activate(); color_dev.modules.Add(initialcolor); //color_dev.modules.Add(new OrbitInfo(color_dev, "✈", System.Drawing.Color.FromArgb(0xee, 0xee, 0x00), System.Drawing.Color.FromArgb(0xaa, 0xaa, 0x44))); /* * OrbitInfo col_targetinfo = new OrbitInfo(color_dev, "⊹", System.Drawing.Color.LightBlue, System.Drawing.Color.MediumPurple); * col_targetinfo.is_target_type_module = true; * color_dev.modules.Add(col_targetinfo); */ color_dev.modules.Add(new OrbitGraph(color_dev, System.Drawing.Color.Yellow, "✈")); OrbitGraph tgt_orbitgraph = new OrbitGraph(color_dev, System.Drawing.Color.LightBlue, "+"); tgt_orbitgraph.is_target_type_module = true; color_dev.modules.Add(tgt_orbitgraph); } foreach (Device dev in devices) { dev.ButtonUP += new Device.ButtonHandler(ButtonUp); dev.ButtonDOWN += new Device.ButtonHandler(ButtonDown); dev.ButtonLEFT += new Device.ButtonHandler(ButtonLeft); dev.ButtonRIGHT += new Device.ButtonHandler(ButtonRight); dev.ButtonOK += new Device.ButtonHandler(ButtonOk); dev.ButtonCANCEL += new Device.ButtonHandler(ButtonCancel); dev.ButtonMENU += new Device.ButtonHandler(ButtonMenu); dev.DisplayFrame(); } }