예제 #1
0
        public AVLProcessingService(DatabaseService database, WebsocketService websockets)
        {
            Database   = database;
            Websockets = websockets;

            Syncromatics = new SyncromaticsAPI.SyncromaticsAPI("http://usfbullrunner.com", 3000);
            Routes       = new Dictionary <int, Route>();

            RouteProcessor = new RouteProcessor();
            Routes         = RouteProcessor.ProcessRoutes(Syncromatics.GetRoutesAsync().Result).Result;

            VehicleProcessor = new VehicleProcessor(this, Routes);
            //VehicleProcessor.Start();
        }
예제 #2
0
        public VehicleProcessor(AVLProcessingService service, Dictionary <int, Route> routes)
        {
            AVLProcessing = service;
            Database      = service.GetDatabase();

            RouteProcessor           processor  = new RouteProcessor();
            List <SyncromaticsRoute> syncRoutes = Database.GetHistoricalCollections().GetRoutes().Result;

            Routes = new ConcurrentDictionary <int, Route>(processor.ProcessRoutes(syncRoutes).Result);

            VehicleStates       = new ConcurrentDictionary <int, VehicleState>();
            InProgressHistories = new ConcurrentDictionary <int, TripHistory>();

            VehicleProcessingQueues = new ConcurrentDictionary <int, BlockingCollection <SyncromaticsVehicle> >();
            VehicleWorkers          = new List <Task>();
        }