Exemplo n.º 1
0
        public AndroidApplicationContext(BaseScreen baseActivity, Settings settings, Action loadComplete)
        {
            ApplicationBackground += () => { };
            ApplicationRestore    += () => { };

            GlobalVariables = new Dictionary <string, object>();

            _baseActivity = baseActivity;
            _settings     = settings;
            _loadComplete = loadComplete;

            LocationProvider          = new GpsProvider(_baseActivity);
            LocationTracker           = new GpsTracker(_baseActivity);
            GalleryProvider           = new GalleryProvider(_baseActivity, this);
            CameraProvider            = new CameraProvider(_baseActivity, this);
            DialogProvider            = new DialogProvider(_baseActivity, this);
            DisplayProvider           = new DisplayProvider();
            ClipboardProvider         = new ClipboardProvider(_baseActivity);
            EmailProvider             = new EmailProvider(_settings, _baseActivity);
            JokeProviderInternal      = new JokeProvider(_baseActivity);
            LocalNotificationProvider = new LocalNotificationProvider(_baseActivity);
            WebProvider = new WebProvider(_baseActivity);

            var builder = new SolutionBuilder(this);

            builder.Build();

            _commonData = ValueStackContext.Current.CreateCommonData("Android");
        }
        public CacheList()
        {
            _appState      = AppState.GetInstance();
            _geolocator    = new GpsTracker();
            _searchService = new GeocacheSearchService();

            this.InitializeComponent();
        }
Exemplo n.º 3
0
        public async Task TestMethod1()
        {
            GpsTracker tracker = new GpsTracker();
            var        pos     = await tracker.GetCoordinates();

            geoposition = pos.Coordinate.Point.Position;
            var    bboxRightCoord = GeoUtils.DestinationPoint(geoposition, 5000, 45.0);
            var    bboxLeftCoord  = GeoUtils.DestinationPoint(geoposition, 5000, -135.0);
            String uri            = String.Format("{0}{1},{2},{3},{4}", _serviceUrl, bboxLeftCoord.Longitude, bboxLeftCoord.Latitude, bboxRightCoord.Longitude, bboxRightCoord.Latitude);

            Debug.WriteLine(uri);
        }
        public SerialPort(GpsTracker gpsTracker, int iIndex, uint iCOMPort, uint iBaudRate, byte byByteSize, byte byParity, byte byStopBits, uint iFlowControl)
        {
            m_iIndex       = iIndex;
            m_iCOMPort     = iCOMPort;
            m_iBaudRate    = iBaudRate;         //BuadRate
            m_byByteSize   = byByteSize;        //ByteSize
            m_byParity     = byParity;          //	0 -> no parity,  1 -> odd parity, 2 -> even parity,  3 -> mark parity , 4 -> space parity
            m_byStopBits   = byStopBits;        //	0 -> 1, 1 -> 1.5, 2 -> 2
            m_iFlowControl = iFlowControl;      //0=none, 1=hardware, 2=xonxoff

            m_ThreadRx   = null;
            m_hCOMPort   = INVALID_HANDLE_VALUE;
            m_bClose     = true;
            m_GpsTracker = gpsTracker;

            IsOpen = false;
        }
Exemplo n.º 5
0
        public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Required;

            _compass = Compass.GetDefault();
            if (_compass != null)
            {
                uint minReportingInterval = _compass.MinimumReportInterval;
                _desiredReportInterval = minReportingInterval > 15 ? minReportingInterval : 15;
                EnableCompass();
            }

            _geolocator      = new GpsTracker();
            _searchService   = new GeocacheSearchService();
            _runtimeSettings = AppState.GetInstance();

            Application.Current.Resuming += CurrentOnResuming;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Основной поток сервера
        /// </summary>
        private void ListenForClients()
        {
            Logger.InfoFormat("Прослушивание {0}:{1}", IPAddress.Parse(((IPEndPoint)TcpListener.LocalEndpoint).Address.ToString()), ((IPEndPoint)TcpListener.LocalEndpoint).Port);

            try
            {
                // Запуск прослушивания
                TcpListener.Start();

                // Выполнение цикла пока не поступит сигнал
                while (!StopEvent.WaitOne(0))
                {
                    // Если никто не хочет подрубится то ждем некторое время
                    if (TcpListener.Pending() != true)
                    {
                        Thread.Sleep(500);
                        continue;
                    }

                    // Данная команда вернет результат только при подключении клиента
                    TcpClient client = TcpListener.AcceptTcpClient();
                    Logger.InfoFormat("Новое подключение по TCP, адрес клиента: {0}", client.Client.RemoteEndPoint);

                    try
                    {
                        var gpsTracker = new GpsTracker(client);
                        TrackerList.Add(gpsTracker);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("Не удалось создать трекер", ex);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Во время прослушивания TCP порта произошла ошибка", ex);
            }
        }
Exemplo n.º 7
0
 public GpsTrackerNMEA(GpsTracker gpsTracker)
 {
     m_GpsTracker = gpsTracker;
     m_CSVParser  = new CSVReader();
 }
Exemplo n.º 8
0
 public GpsTrackerUDPTCP(GpsTracker gpsTracker)
 {
     m_GpsTracker = gpsTracker;
 }
Exemplo n.º 9
0
 public GpsBabel(GpsTracker gpsTracker)
 {
     m_GpsTracker = gpsTracker;
     //Ensure we load the GpsBabelLoader dll from the correct place
     LoadLibrary(GpsTrackerPlugin.m_sPluginDirectory + "\\GpsBabel\\GpsBabelLoader.gpstracker");
 }
Exemplo n.º 10
0
 public GpsTrackerFile(GpsTracker gpsTracker)
 {
     m_GpsTracker = gpsTracker;
     m_GpsBabel   = new GpsBabel(gpsTracker);
 }
Exemplo n.º 11
0
 public GpsTrackerAPRS(GpsTracker gpsTracker)
 {
     m_GpsTracker = gpsTracker;
     //Ensure we load the APRS parser dll from the correct place
     LoadLibrary(GpsTrackerPlugin.m_sPluginDirectory + "\\APRS\\APRSParserDLL.GPSTracker");
 }