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

            controller.RunAsync(taskInstance);
        }
Exemplo 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);
        }
Exemplo n.º 3
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var options = new ControllerOptions
            {
                StatusLedNumber = LedGpio
            };

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

            var controller = new Core.Controller(options);

            controller.RunAsync(taskInstance);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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();
        }
Exemplo n.º 8
0
        private void StartController(object sender, RoutedEventArgs e)
        {
            StartControllerButton.IsEnabled = false;

            _controller.RunAsync();
        }