private void menuItemGPSenabled_Click(object sender, EventArgs e) { menuItemGPSenabled.Checked = !menuItemGPSenabled.Checked; if (!menuItemGPSenabled.Checked) { if (gps.Opened) { gps.Close(); SetOffGPSPower(); } count = 0; countReal = 0; Total = 0; { TimeUTC = null; Lat = null; Lng = null; Delta = 0; } lock (Satellites) { Satellites.Clear(); Satellites.TrimExcess(); } if (Controls.Contains(pageGps)) { pageGps.panelSignals.Invalidate(); } TryCommitData(); gpsPos.Pen.Color = Color.Blue; } else // start tracking { gpsPos.Pen.Color = Color.Red; gpsPos.IsVisible = true; if (!gps.Opened) { gps.Open(); SetOnGPSPower(); } } }
public GpsConnector(Form1 parentForm) { //signed parent to gpsConnector this.parentForm = parentForm; //initialize gps hardware handler _gps = Hardware.Hardware.GetGpsHandler(); //initialize list to contain position info _tmpPositionList = new List <GpsPosition>(); //initialize satelliteView to contain satellite info satView = new SatelliteView(); //if gps hardware exist and gpsIntermediateDriver exist //initialize gps connection and events if (_gps.hasGPS) { gps = new Gps(); gpsEvents = new GpsEvents(this); if (!gps.Opened) { gps.Open(); gpsEvents.newLocationReceived += new EventHandler <LocationChangedEventArgs>(gpsEvents.Form1_NewLocationReceived); gps.LocationChanged += new LocationChangedEventHandler(gpsEvents.gps_LocationChanged); } } }
private void btnStart_Click(object sender, EventArgs e) { if (gps != null && !gps.Opened) { gps.Open(); } btnNewTrack_Click(null, null); }
//open gps public void openGps() { if (!gps.Opened) { gps.Open(); } parentForm.gpsStatus = Form1.GpsStatus.GPS_OPEN; }
private void startGpsMenuItem_Click(object sender, EventArgs e) { if (!gps.Opened) { gps.Open(); } startGpsMenuItem.Enabled = false; stopGpsMenuItem.Enabled = true; }
private void StartGPS() { if (!gps.Opened) { gps.Open(); status.Text += "StartGPS()...\r\n"; } mnuGPSStart.Enabled = false; mnuGPSStop.Enabled = true; }
private void miOnGPS_Click(object sender, EventArgs e) { if (!gps.Opened) { gps.Open(); } miOnGPS.Enabled = false; miOffGPS.Enabled = true; miGetLoc.Enabled = true; }
private void GpsOpen() { if (_gps.Opened) { PrintLn("GPS already opened"); } else { _gps.Open(); PrintLn("Opened GPS"); } }
private void menuItemGPS_Click(object sender, EventArgs e) { statusBar1.Visible = true; statusBar1.Text = "Procurando Satélites, aguarde"; if (!gps.Opened) { gps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged); gps.Open(); } else { gps.LocationChanged -= gps_LocationChanged; gps.Close(); } }
private void GPSMenuItem_Click(object sender, EventArgs e) { if (!gps.Opened) { updateDataHandler = new EventHandler(UpdateData); gps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged); // location changed is an event gps.Open(); GPSMenuItem.Text = "Turn Gps Off"; } else { gps.LocationChanged -= gps_LocationChanged; gps.Close(); GPSMenuItem.Text = " Turn Gps On"; Reminder_Occurs = false; } }