public void Flush(Database db) { foreach (Message m in db.gpsList) { GpsMessage gpsMess = m as GpsMessage; //this.gpsUtm.WriteLine(gpsMess.time + "\t" + gpsMess.pos.getUtmX() + "\t" + gpsMess.pos.getUtmY() + "\t" + gpsMess.gndSpeed + "\t" + gpsMess.trackAngle); //this.gpsGeo.WriteLine(gpsMess.time + "\t" + gpsMess.pos.getLatitude() + "\t" + gpsMess.pos.getLongitude() + "\t" + gpsMess.gndSpeed + "\t" + gpsMess.trackAngle); } foreach (Message m in db.imuEulerList) { ImuEulerMessage imuMess = m as ImuEulerMessage; this.imuEuler.WriteLine(imuMess.time + "\t" + imuMess.roll.V + "\t" + imuMess.pitch.V + "\t" + imuMess.yaw.V + "\t" + imuMess.accelX.V + "\t" + imuMess.accelY.V + "\t" + imuMess.accelZ.V); } foreach (Message m in db.imuRawList) { //ImuRawMessage imuMess = m as ImuRawMessage; //this.imuRaw.WriteLine(imuMess.time + "\t" + imuMess.accelX + "\t" + imuMess.accelY + "\t" + imuMess.accelZ + "\t" + imuMess.magnetomX + "\t" + imuMess.magnetomY + "\t" + imuMess.magnetomZ); } foreach (Message m in db.adcList) { AdcMessage adcMess = m as AdcMessage; this.adc.WriteLine(adcMess.time + "\t" + adcMess.barometer.V + "\t" + adcMess.thermometer.V + "\t" + adcMess.pitot.V + "\t" + adcMess.tas + "\t" + adcMess.altitude); } this.imuEuler.Flush(); //this.imuRaw.Flush(); //this.gpsUtm.Flush(); //this.gpsGeo.Flush(); this.adc.Flush(); this.pwm.Flush(); db.Initialize(); }
/// <summary> /// Gets the instance. /// </summary> /// <returns> /// The instance. /// </returns> public static Database GetInstance() { if (instance == null) instance = new Database(); return instance; }