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(); }
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); }
public VehicleManager(string url, int rate, SyncromaticsAPI api) { BackendURL = url; PollRate = rate; MainAPI = api; }