Exemple #1
0
        private DeviceControllerOptions BuildDeviceOptions(IContext arg)
        {
            var options = new DeviceControllerOptions
            {
                HomeAzimuth             = Default.HomeSensorAzimuth,
                MaximumShutterCloseTime =
                    TimeSpan.FromSeconds((double)Default.ShutterOpenCloseTimeSeconds),
                MaximumFullRotationTime = TimeSpan.FromSeconds((double)Default.FullRotationTimeSeconds),
                ShutterTickTimeout      = Default.ShutterTickTimeout,
                RotatorTickTimeout      = Default.RotatorTickTimeout,
                RotatorMaximumSpeed     = Default.RotatorMaximumSpeed,
                RotatorRampTime         = TimeSpan.FromMilliseconds(Default.RotatorRampTimeMilliseconds),
                ShutterMaximumSpeed     = Default.ShutterMaximumSpeed,
                ShutterRampTime         =
                    TimeSpan.FromMilliseconds(Default.ShutterAccelerationRampTimeMilliseconds),
                ParkAzimuth = Default.ParkAzimuth,
                TimeToWaitForShutterOnConnect         = Default.OnConnectWaitForShutterOnline,
                ShutterIsInstalled                    = Default.ShutterIsInstalled,
                ShutterLowBatteryThresholdVolts       = Default.ShutterLowVoltsThreshold,
                ShutterLowVoltsNotificationTimeToLive = Default.ShutterLowVoltsNotificationTimeToLive,
                EnableAutoCloseOnLowBattery           = Default.ShutterAutoCloseOnLowBattery
            };

            return(options);
        }
 public DeviceController(ICommunicationChannel channel, ControllerStatusFactory factory,
                         ControllerStateMachine machine, DeviceControllerOptions configuration)
 {
     this.channel       = channel;
     statusFactory      = factory;
     stateMachine       = machine;
     this.configuration = configuration;
 }
Exemple #3
0
 public ControllerStateMachine(IControllerActions controllerActions, DeviceControllerOptions options,
                               IClock clock)
 {
     ControllerActions = controllerActions;
     Options           = options;
     Clock             = clock;
     CurrentState      = new Uninitialized();
 }
 public ControllerStateMachine(
     IControllerActions controllerActions,
     DeviceControllerOptions options,
     IClock clock)
 {
     ControllerActions = controllerActions;
     Options           = options;
     Clock             = clock;
 }
 public ControllerStateMachine(
     IControllerActions controllerActions,
     DeviceControllerOptions options,
     IClock clock, ILog logger)
 {
     Logger            = logger;
     ControllerActions = controllerActions;
     Options           = options;
     Clock             = clock;
 }
 public DeviceController(
     ICommunicationChannel channel,
     ControllerStatusFactory factory,
     ControllerStateMachine machine,
     DeviceControllerOptions configuration,
     ITransactionProcessor processor)
 {
     this.channel       = channel;
     statusFactory      = factory;
     stateMachine       = machine;
     this.configuration = configuration;
     this.processor     = processor;
 }
Exemple #7
0
        private DeviceControllerOptions BuildDeviceOptions(IContext arg)
        {
            var options = new DeviceControllerOptions
            {
                PerformShutterRecovery        = Settings.Default.PerformShutterRecovery,
                MaximumShutterCloseTime       = TimeSpan.FromSeconds((double)Settings.Default.ShutterOpenCloseTimeSeconds),
                MaximumFullRotationTime       = TimeSpan.FromSeconds((double)Settings.Default.FullRotationTimeSeconds),
                KeepAliveTimerInterval        = Settings.Default.KeepAliveTimerPeriod,
                CurrentDrawDetectionThreshold = Settings.Default.CurrentDrawDetectionThreshold,
                IgnoreHardwareShutterSensor   = Settings.Default.IgnoreHardwareShutterSensor,
                ShutterTickTimeout            = Settings.Default.ShutterTickTimeout
            };

            return(options);
        }