Exemplo n.º 1
0
        public EmployeeManager(ILedControl ledControl, IParamConfig paramConfig, ILogService logService)
        {
            _ledControl  = ledControl;
            _paramConfig = paramConfig;
            _logService  = logService;
            Thresholds thresholds = _paramConfig.ReadThresholds();

            ManagerSensors.Add(ESensorType.PressureSensor, new SensorStatus(thresholds.PsLow, thresholds.PsHigh));
            ManagerSensors.Add(ESensorType.DistanceMeter1, new SensorStatus(thresholds.Dm1Low, thresholds.Dm1High));
            ManagerSensors.Add(ESensorType.DistanceMeter2, new SensorStatus(thresholds.Dm2Low, thresholds.Dm2High));
            ManagerSensors.Add(ESensorType.EmployeeCardReader, new SensorStatus(0, 0));
            _lastExitTime = lastEntryTime = lastWashTime = DateTime.Now; // init time references
            //  _logService.SerializeObjectAndSendToDb(new ManInTheRoom());
        }
Exemplo n.º 2
0
        public RoomWashManager2ProxSensors(ILedControl ledControl, IParamConfig paramConfig)
        {
            _ledControl  = ledControl;
            _paramConfig = paramConfig;
            _ledControl.Connect();
            _ledControl.TurnOn();
            _ledControl.ChangeColor(69, 69, 69);
            Thresholds thresholds = _paramConfig.ReadThresholds();

            ManagerSensors.Add(ESensorType.PressureSensor, new SensorStatus(thresholds.PsLow, thresholds.PsHigh));
            ManagerSensors.Add(ESensorType.DistanceMeter1, new SensorStatus(thresholds.Dm1Low, thresholds.Dm1High));
            ManagerSensors.Add(ESensorType.DistanceMeter2, new SensorStatus(thresholds.Dm2Low, thresholds.Dm2High));
            ManagerSensors.Add(ESensorType.EmployeeCardReader, new SensorStatus(0, 0));
            _lastExitTime = lastEntryTime = lastWashTime = DateTime.Now; // init time references
        }
 public ToiletFlusherStateMachine(
     IFlushService flusherMotor,
     IManDetectionService manDetection,
     ILedControl ledControl,
     IIoBrokerDotNet ioBroker)
 {
     _ioBroker     = ioBroker;
     mFlusherMotor = flusherMotor;
     mManDetection = manDetection;
     mLedControl   = ledControl;
     mStatus       = new ToiletStateMachineStatus();
     mManDetection.SomeoneDetectedChanged += SomeoneDetectedChangedHandler;
     mManDetection.SomeoneIsPeeingChanged += SomeoneIsPeeingChangedHandler;
     ConfigureStateMachine();
     _ioBroker.ConnectAsync(TimeSpan.FromSeconds(5));
 }
 public LedController(ILedControl ledControl)
 {
     mLedControl = ledControl;
 }