//! Write satellite data to Database /*! * \param Satellite sattellite data to write into DataBase */ public void writeSatellite(Satellite.Satellite sat) { if (!isConnected) { connectDB(); } SQLiteCommand command = new SQLiteCommand(m_dbConnection); int count = 0; command.CommandText = String.Format("SELECT count(*) FROM {0} WHERE noradID='{1}';", Constants.SatDB, sat.getTleData().getNoradID()); count = Convert.ToInt32(command.ExecuteScalar()); if (count == 0) { command.CommandText = String.Format( Constants.insertSat, Constants.SatDB, sat.getName(), sat.getTleData().getNoradID()); command.ExecuteNonQuery(); } }
private void StartSatellite(int pDestX, int pDestY, string satName, string ascent, decimal fuel, decimal power) { Satellite.Satellite s = new Satellite.Satellite(SatellitePositionConstants.INITIAL_X, SatellitePositionConstants.INITIAL_Y, SatellitePositionConstants.ORIGIN_X, SatellitePositionConstants.ORIGIN_Y, pDestX, pDestY, url, satName, millisecondsBetweenClientCalls, false, ascent, fuel, power); Thread client = new Thread(s.DoWork); client.Start(); }