예제 #1
0
 static void testDatabase(Database database)
 {
     Console.WriteLine("-----------------Database Test----------------");
     foreach (Decoded insert in insertions)
     {
         database.onRealTimeEvent(insert);
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            var jsonParser = new JsonParser() { CamelizeProperties = false };
            dynamic config = jsonParser.Parse(System.IO.File.ReadAllText("config.txt"));
            Dispatcher dispatcher = new Dispatcher();
            Database database = new Database(dispatcher, config);
            Decoder decoder = new Decoder(dispatcher);
            Receiver receiver = new Receiver("450052", "VR2C-69", dispatcher);
            Encoder encoder = new Encoder("*450052.0#16,", config);
            ConsoleLogger consoleLogger = new ConsoleLogger(dispatcher);
            dispatcher.addModule(database);
            dispatcher.addModule(decoder);
            dispatcher.addModule(consoleLogger);
            dispatcher.run();

            testUnparsedMessages(dispatcher, receiver, config);
            //testEncoder(encoder);
            //testDecoder(decoder);
            //testDatabase(database);
        }