private void Form1_Load(object sender, EventArgs e) { KeyPreview = true; Dictionary <string, string> dbConnInfo = LoadDBInfo(); InitializeConnection(dbConnInfo["host"], dbConnInfo["uid"], dbConnInfo["password"], dbConnInfo["database"]); plotTemp = new PointControl(cTemp.Series[0]); plotPress = new PointControl(cPress.Series[0]); plotSpeed = new PointControl(cSpeed.Series[0]); plotHeight = new PointControl(cHeight.Series[0]); plotVolt = new PointControl(cVoltage.Series[0]); plotHum = new PointControl(cHum.Series[0]); plotCO = new PointControl(cGas.Series[0]); plotNH = new PointControl(cGas.Series[2]); plotNO = new PointControl(cGas.Series[1]); getFlyID(out flyIDCurrent, out flyName, out flyStart); tbFlyID.Text = flyIDCurrent.ToString(); tbFlyName.Text = flyName; tbFlyStart.Text = flyStart; lastTime = 0; flyTime = 0; receivedPackets = new ConcurrentBag <Packet>(); allPackets = new List <Packet>(); ListeningInitAndStart(); UpdateInfo(); mapWindow = new wfMap(); flyIDLastChecked = flyIDCurrent; }
private void ShowMap() { if (mapWindow == null || mapWindow.IsDisposed) { mapWindow = new wfMap(); if (lastPosition != null) { mapWindow.SatellitePosition = new MapCoordinates((double)lastPosition.CoordinateX, (double)lastPosition.CoordinateY); } else { mapWindow.SatellitePosition = new MapCoordinates(0, 0); } } mapWindow.Show(); }
private void ResetEverything() { ListeningStop(); ResetPlots(); tbGPSX.Clear(); tbGPSY.Clear(); tbGPSZ.Clear(); analogClock1.Date = new DateTime(0); lastTime = 0; flyTime = 0; ClearReceivedPackets(); tbUTCTime.Text = ""; allPackets.Clear(); if (mapWindow != null) { mapWindow.Dispose(); mapWindow = null; } }