Example #1
0
        //TBD to send to Azure Event Hubs
        //static readonly string EventHubName = Properties.Settings.Default.EventHubName;

        public static void SendEventDirectToServiceFabricMicroservice(GPSCoordinatesEvent gpsCoordVehicleEvent)
        {
            GPSCoordinates coordinates = new GPSCoordinates();

            coordinates.Latitude  = gpsCoordVehicleEvent.Latitude;
            coordinates.Longitude = gpsCoordVehicleEvent.Longitude;

            //Call Http Service to update GPS coordinates
            UpdateGPSCoordinates(gpsCoordVehicleEvent.VehicleId, coordinates);
        }
Example #2
0
        private void Initialize()
        {
            _GPSCoordinatesTimerCount = 0;
            _accelTimerCount          = 0;
            _carCrashTimerCount       = 0;

            SessionStatus = SessionStatus.Stopped;

            if (CurrentDriver == null)
            {
                CurrentDriver = new Driver {
                    Image = "/Assets/user_unknow.png"
                };
            }

            GPSCoordinatesEvent = new GPSCoordinatesEvent
            {
                VehicleId = "0",
                Latitude  = 00.000000,
                Longitude = 00.000000,
            };

            //CompassEvent = new CompassEvent
            //{
            //    HeadingDegrees = 0
            //};

            //AccelerometerEvent = new AccelerometerEvent
            //{
            //    X = 0000.00,
            //    Z = 0000.00,
            //    Y = 0000.00,
            //};

            AvailableDrivers = new ObservableCollection <Driver>
            {
                new Driver {
                    Id = 1, LicensePlate = "AJX-6940", Image = "/Assets/Drivers/1.jpg"
                },
                new Driver {
                    Id = 2, LicensePlate = "SLV-4335", Image = "/Assets/Drivers/2.jpg"
                },
                new Driver {
                    Id = 3, LicensePlate = "MAX-9876", Image = "/Assets/Drivers/3.jpg"
                },
                new Driver {
                    Id = 4, LicensePlate = "CCC-1432", Image = "/Assets/Drivers/4.jpg"
                },
                new Driver {
                    Id = 5, LicensePlate = "JNV-9876", Image = "/Assets/Drivers/5.jpg"
                },
                new Driver {
                    Id = 6, LicensePlate = "CUA-1456", Image = "/Assets/Drivers/6.jpg"
                },
                new Driver {
                    Id = 7, LicensePlate = "JOP-9876", Image = "/Assets/Drivers/7.jpg"
                },
                new Driver {
                    Id = 8, LicensePlate = "HTY-1243", Image = "/Assets/Drivers/8.jpg"
                },
                new Driver {
                    Id = 9, LicensePlate = "VVV-4444", Image = "/Assets/Drivers/9.jpg"
                },
                new Driver {
                    Id = 10, LicensePlate = "ERT-1256", Image = "/Assets/Drivers/10.jpg"
                }
            };
        }