Close() публичный Метод

Closes the gps device.
public Close ( ) : void
Результат void
Пример #1
0
        /// <summary>
        /// Almacena ruta del archivo RUTAS.txt
        /// </summary>
        /// <param name="args">recibe datos desde takeData</param>
        /// <param name="main">recibe instancia de MainWindows</param>
        public NoAcces(Form1 main, params String[] args)
        {
            InitializeComponent();

            this.main = main;
            //codigo,actual,n_medidor,verificador
            this.tCodeService.Text = args[0];

            this.tReadActual.Text = args[1];

            this.tN_medidor.Text = args[2];

            this.tVerificador.Text = args[3];

            this.tCodeService.Focus();

            this._date_hour = new Date_hour();

            #region comprueba que los codigos de servicio o rutas esten cargados

            if (this.main.cod_service_auto.Count < 1)
            {

                MessageBoxButtons buttons = MessageBoxButtons.YesNo;

                DialogResult dr = MessageBox.Show("No se cargo las rutas\n¿Desea cargarlas ahora?.", "", buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

                if (dr == DialogResult.Yes)
                {
                    if (this.main.cargarRutas() > 0)
                    {
                        this.list_input_data = cid.read_file(this.main.filename);
                    }
                    /*else
                    {
                        this.list_input_data = new List<Input_data>();
                        Input_data _ID = new Input_data("00001", "2", "000000004521", "000061869", "005", "0000194", "1.00376");
                        list_input_data.Add(_ID);

                    }*/
                }

            }
            else
            {
                this.list_input_data = cid.read_file(this.main.filename);
               /* this.list_input_data = new List<Input_data>();
                Input_data _ID = new Input_data("00001", "2", "000000004521", "000061869", "005", "0000194", "1.00376");
                list_input_data.Add(_ID);*/
            }

            #endregion

            #region configuracio y activacion gps

            objGps = this.main.objGps;// new Gps();

            objGps.Close();

            if (!objGps.Opened)
            {

                // objgps.DeviceStateChanged += new DeviceStateChangedEventHandler(gps_DeviceStateChange);

                objGps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged);

                objGps.Open();
            }

            #endregion
        }
Пример #2
0
 /// <summary>Stops GPS</summary>
 public override void Stop()
 {
     gps.Close();
     OnStateChanged(State);
 }
Пример #3
0
        /// <summary>
        /// TakeData(main)
        /// </summary>
        /// <param name="main">recibe instancia de MainWindows</param>
        public TakeData(Form1 main)
        {
            InitializeComponent();

            this.main = main;

            this._date_hour = new Date_hour();

            this.tCodServ.Focus();

            #region configuraciones visuales

            int anchoPanel = Convert.ToInt32(this.Width * 0.5);

            this.panel1.Width = anchoPanel;

            this.panel2.Width = anchoPanel;

            this.panel3.Width = anchoPanel;

            this.panel4.Width = anchoPanel;

            this.panel5.Width = anchoPanel;

            this.pSave.Width = anchoPanel;
            #endregion

            #region comprueba que existan los codigos de servicio o no

            if (this.main.cod_service_auto.Count < 1)
            {
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;

                DialogResult dr = MessageBox.Show("Debe cargar las ahora.", "", buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

                if (dr == DialogResult.Yes)
                {

                    if (this.main.cargarRutas() > 0)
                    {

                        this.list_input_data = cid.read_file(this.main.filename);

                    }
                    /*else
                    {
                        this.list_input_data = new List<Input_data>();
                        Input_data _ID = new Input_data("00001", "2", "000000004521", "000061869", "005", "0000194", "1.00376");
                        list_input_data.Add(_ID);

                    }*/
                }
            }
            else {
                this.list_input_data = cid.read_file(this.main.filename);
                /*
                this.list_input_data = new List<Input_data>();
                Input_data _ID = new Input_data("00001", "2", "000000004521", "000061869", "005", "0000194", "1.00376");
                list_input_data.Add(_ID);*/
            }
            #endregion

            #region configura y habilita gps
            objGps = this.main.objGps;//new Gps();
            objGps.Close();
            if (!objGps.Opened)
            {
                objGps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged);
                objGps.Open();
            }
            #endregion
        }
Пример #4
0
        public void pollGPS()
        {
            gps = new Gps();
            gps.Open();

            gpsPosition = gps.GetPosition();

            //while (!gpsPosition.LatitudeValid || !gpsPosition.LatitudeValid)
                //Thread.Sleep(500);

            gps.Close();

            latitude = gpsPosition.Latitude;
            longitude = gpsPosition.Longitude;
        }