//Vision for major planets public void updateVision() { string[] planets = { "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune" }; ObjectDataRecords[] planetData = new ObjectDataRecords[7]; for (int i = 0; i < planets.Length - 1; i++) { var loc = database.search(planets[i].ToUpper()); planetData[i] = database.data[loc]; calc.DirectionFinder(planetData[i]); } for (int i = 0; i < planets.Length - 1; i++) { if (planetData[i].El > 0) { var x = ExtensionMethods.Map(planetData[i].Az, 0, 360, 0, 77); var y = ExtensionMethods.Map(planetData[i].El, 0, 90, 0, 7); w_vision.text((i + 1).ToString(), (byte)x, (byte)(7 - y)); } } }
public Term(StarDatabase database, Remote remote) { VT4100 = new Comms("VT4100", 19200, System.IO.Ports.Parity.Even, 7); logger = new Logger("TERMINA", Logger.Level.INFO); this.database = database; this.remote = remote; VT4100.Send(clear); VT4100.Send("CZGZZ DEATHCOM - LEWIS HAMILTON 2020 - https://czgzz.space"); Thread.Sleep(1000); logger.log(Logger.Level.DEBUG, "Input event created"); Thread.Sleep(100); VT4100.ClearBuffer(); loadingScreen(); database.load(this); var earthLoc = database.search("EARTH"); calc = new OrbitCalculator(database.data[earthLoc], 151, -33); }
public Test() { var db = new StarDatabase(); ObjectDataRecords currentObject; while (true) { Console.Write("Enter command: "); var res = Console.ReadLine(); switch (res) { case "loaddb": db.load(null); break; case "find": Console.Write("Enter planet name: "); res = Console.ReadLine(); var planet = db.search(res.ToUpper()); Console.WriteLine("Found planet at: {0}", planet); break; case "calc": Console.Write("Enter object name: "); res = Console.ReadLine(); try { currentObject = db.data[db.search(res)]; } catch (Exception) { currentObject = null; break; } currentObject.Calculations = OrbitCalculator.DirectionFinder(currentObject, db.data[db.search("EARTH")], 151, -33); Console.WriteLine(currentObject.ToString()); Console.WriteLine("AZ EL >> ", +currentObject.Calculations.Az + " " + currentObject.Calculations.El); break; case "remote simple": Remote remoteTemp = new Remote(); Console.WriteLine("Current read from Deathbox: "); while (true) { string s = string.Format("CAz: {0}\n\rCEl: {1}\n\rDAz: {2}\n\rDEl: {3}\n\rSAz: {4}\n\rSEl: {5}\n\rMoving? {6}\n\rVolts: {7}\n\rLights: {8}\n\rConnect: {9}\n\r", remoteTemp.data.rxCurrentAzEl.Az.ToString(), remoteTemp.data.rxCurrentAzEl.El.ToString(), remoteTemp.data.rxDesiredAzEl.Az.ToString(), remoteTemp.data.rxDesiredAzEl.El.ToString(), remoteTemp.data.txAzEl.Az.ToString(), remoteTemp.data.txAzEl.El.ToString(), remoteTemp.data.moving.ToString(), remoteTemp.data.volts.ToString(), remoteTemp.data.lights.ToString(), remoteTemp.data.connect.ToString()); Console.WriteLine(s); } break; default: Console.WriteLine("Unknown command: res"); break; } } }