Beispiel #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();
        }
Beispiel #2
0
        public static async Task Main(string[] args)
        {
            DatabaseConfig config = JsonConvert.DeserializeObject <DatabaseConfig>(File.ReadAllText("config.json"));

            Client     = new MongoClient($"mongodb://{config.username}:{config.password}@{config.address}:{config.port}");
            Database   = Client.GetDatabase("bus-dev");
            Collection = Database.GetCollection <VehiclePosition>("positions3");
            Console.WriteLine("Starting");

            Syncromatics = new SyncromaticsAPI.SyncromaticsAPI("https://usfbullrunner.com", 3000);
            Syncromatics.NewVehicleDownloaded += Syncromatics_NewVehicleDownloadedAsync;
            await Syncromatics.GetRoutesAsync();

            Syncromatics.Start();

            await Task.Delay(-1);
        }
Beispiel #3
0
 public VehicleManager(string url, int rate, SyncromaticsAPI api)
 {
     BackendURL = url;
     PollRate   = rate;
     MainAPI    = api;
 }