Example #1
0
        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);

                }
            }
        }
Example #2
0
        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);
                }
            }
        }