Пример #1
0
        public static async Task Main(string[] args)
        {
            Console.WriteLine("Starting Emulator..");

            //TODO: Set your IoT Hub iothubowner connection string in appsettings.json
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .AddEnvironmentVariables()
                                .AddDotenvFile()
                                .AddCommandLine(args)
                                .Build();

            var host = new TypeEdgeHost(configuration);

            //TODO: Register your TypeEdge Modules here
            host.RegisterModule <ITypeEdgeModule1, Modules.TypeEdgeModule1>();
            host.RegisterModule <ITypeEdgeModule2, Modules.TypeEdgeModule2>();
            host.RegisterModule <ITypeEdgeModule3, Modules.TypeEdgeModule3>();

            //TODO: Define all cross-module subscriptions
            host.Upstream.Subscribe(host.GetProxy <ITypeEdgeModule3>().Output);

            host.Build();

            await host.RunAsync();

            Console.WriteLine("Press <ENTER> to exit..");
            Console.ReadLine();
        }
Пример #2
0
        private static async Task Main(string[] args)
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .AddEnvironmentVariables()
                                .AddDotenvFile()
                                .AddCommandLine(args)
                                .Build();

            var host = new TypeEdgeHost(configuration);

            host.RegisterModule <ITemperatureSensor, TemperatureSensor>();
            host.RegisterModule <IOrchestrator, Orchestrator>();
            host.RegisterModule <IModelTraining, ModelTraining>();
            host.RegisterModule <IVisualization, Visualization>();
            host.RegisterModule <IAnomalyDetection, AnomalyDetection>();

            host.Upstream.Subscribe(host.GetProxy <IAnomalyDetection>().Anomaly);

            var manifest = host.Build();

            File.WriteAllText("../../../manifest.json", manifest);

            await host.RunAsync();

            Console.WriteLine("Press <ENTER> to exit..");
            Console.ReadLine();
        }
Пример #3
0
        public static async Task Main(string[] args)
        {
            //TODO: Set your IoT Hub iothubowner connection string in appsettings.json
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .AddEnvironmentVariables()
                                .AddCommandLine(args)
                                .Build();

            var host = new TypeEdgeHost(configuration);

            //TODO: Register your TypeEdge Modules here
            //host.RegisterModule<ITemperatureModule, TemperatureModule>();

            //TODO: Define all cross-module subscriptions
            //host.Upstream.Subscribe(host.GetProxy<INormalizeTemperatureModule>().NormalizedTemperature);

            host.Build();

            await host.RunAsync();

            Console.WriteLine("Press <ENTER> to exit..");
            Console.ReadLine();
        }