Esempio n. 1
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var options    = new ControllerOptions();
            var controller = new Core.Controller(options);

            controller.RunAsync(taskInstance);
        }
Esempio n. 2
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var hostname = global::System.Net.Dns.GetHostName();

            Type configurationType;

            if (hostname == "HA4IoT-Main")
            {
                configurationType = typeof(Main.Configuration);
            }
            else if (hostname == "HA4IoT-Cellar")
            {
                configurationType = typeof(Cellar.Configuration);
            }
            else
            {
                return;
            }

            var options = new ControllerOptions
            {
                ConfigurationType = configurationType
            };

            var controller = new Core.Controller(options);

            controller.RunAsync(taskInstance);
        }
Esempio n. 3
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var options = new ControllerOptions
            {
                StatusLedNumber = LedGpio
            };

            var controller = new Core.Controller(options);
            controller.RunAsync(taskInstance);
        }
Esempio n. 4
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var options = new ControllerOptions
            {
                StatusLedNumber = LedGpio
            };

            var controller = new Core.Controller(options);

            controller.RunAsync(taskInstance);
        }
Esempio n. 5
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var options = new ControllerOptions
            {
                StatusLedGpio     = 22, // Replace this with a port which contains a LED for status indication (optional).
                ConfigurationType = typeof(Configuration)
            };

            var controller = new Core.Controller(options);

            controller.RunAsync(taskInstance);
        }
Esempio n. 6
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            //var configurationType = typeof(Cellar.Configuration);
            var configurationType = typeof(Main.Configuration);

            var options = new ControllerOptions
            {
                StatusLedGpio     = 22,
                ConfigurationType = configurationType
            };

            var controller = new Core.Controller(options);

            controller.RunAsync(taskInstance);
        }
Esempio n. 7
0
        public MainPage()
        {
            InitializeComponent();

            Log.LogEntryPublished += (s, e) =>
            {
                string message =
                    $"[{e.LogEntry.Id}] [{e.LogEntry.Timestamp}] [{e.LogEntry.Source}] [{e.LogEntry.ThreadId}] [{e.LogEntry.Severity}]: {e.LogEntry.Message}";
                if (!string.IsNullOrEmpty(e.LogEntry.Exception))
                {
                    message += Environment.NewLine;
                    message += e.LogEntry.Exception;
                }

                LogTextBox.Dispatcher.RunAsync(
                    CoreDispatcherPriority.Normal,
                    () =>
                {
                    LogTextBox.Text += message + Environment.NewLine;
                }).AsTask().Wait();
            };

            var options = new ControllerOptions
            {
                ConfigurationType     = typeof(Configuration),
                ContainerConfigurator = new ContainerConfigurator(this),
                HttpServerPort        = 1025
            };

            var controller = new Core.Controller(options);

            // The app is only available from other machines. https://msdn.microsoft.com/en-us/library/windows/apps/Hh780593.aspx
            StoragePathTextBox.Text       = StoragePath.StorageRoot;
            AppPathTextBox.Text           = StoragePath.AppRoot;
            ManagementAppPathTextBox.Text = StoragePath.ManagementAppRoot;

            controller.RunAsync();
        }
Esempio n. 8
0
        private void StartController(object sender, RoutedEventArgs e)
        {
            StartControllerButton.IsEnabled = false;

            _controller.RunAsync();
        }