Example #1
0
 public CommandHandlersFactory(IOutboundEventBus outboundEventBus, IDiagnosticService diagnosticService,
                               WindowsManagingService windowsManagingService)
 {
     _mappings = new Hashtable
     {
         //Add here all command factories
         { nameof(PingCommand), new PingCommandHandler(outboundEventBus) },
         { nameof(SendDiagnosticDataCommand), new SendDiagnosticDataCommandHandler(outboundEventBus, diagnosticService) },
         { nameof(OpenWindowCommand), new OpenWindowCommandHandler(outboundEventBus, windowsManagingService) },
         { nameof(CloseWindowCommand), new CloseWindowCommandHandler(outboundEventBus, windowsManagingService) }
     };
 }
Example #2
0
        public ServiceFactory InitWindowsManagingService()
        {
            //Reset actuator state

            _windowsManagingService = new WindowsManagingService(_driversFactory.Window1Actuator,
                                                                 _driversFactory.Window2Actuator, _driversFactory.Window1ReedSwitch, _driversFactory.Window2ReedSwitch,
                                                                 _driversFactory.Window1ControlSwitch, _driversFactory.Window2ControlSwitch,
                                                                 _mqttOutboundEventBus);

            _windowsManagingService.Start();

            Logger.Log(() => $"Free memory after init windows managing service {GC.Run(false)}");

            return(this);
        }
 public OpenWindowCommandHandler(IOutboundEventBus outboundEventBus,
                                 WindowsManagingService windowsManagingService)
 {
     _outboundEventBus       = outboundEventBus;
     _windowsManagingService = windowsManagingService;
 }