コード例 #1
0
        public ArduinoCommunicationService(ILoggingService loggingService)
        {
            try
            {
                HttpClient client = new HttpClient();
                client.BaseAddress = new Uri(Settings.ArduinoAddress);

                Sensors = new SensorController(client);
                Lights  = new LightController(client);
                Buzzers = new BuzzerController(client);
            }
            catch (Exception e)
            {
                loggingService.Log(ELogType.Neutral, ELogLevel.Error, e, Settings.ArduinoAddress);
            }
        }
コード例 #2
0
        public override async Task RunTaskAsync(CancellationToken cancelToken)
        {
            using (var buzzer = new BuzzerController())
            {
                buzzer.ActivateBuzzer(cancelToken);
            }

            StepDropSlotController.Instance.DropStep(this);

            UIMessager.Instance.ShowMessage($"{Type}",
                                            $"{Title} should be added now. The amount to add: {Amount}.",
                                            UIMessageButtons.OK,
                                            UIMessageType.Information);

            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                          () =>
            {
                ProgressPercent = 100;
                Finished        = true;
            });
        }