TimeProportionedPidController(float windowSize, IOnOff relay, TimeSpan samplingRate, Func <float> readProcess, Func <float> readOutput, Func <float> readSetPoint, float proportionalGain, float integralGain, float derivativeGain, ControllerDirection controllerDirection = ControllerDirection.Direct, ControllerMode controllerMode = ControllerMode.Automatic) { _windowSize = windowSize; _relay = relay; if (readProcess == null) { throw new ArgumentNullException(nameof(readProcess), "Read process must not be null."); } if (readOutput == null) { throw new ArgumentNullException(nameof(readOutput), "Read output must not be null."); } if (readSetPoint == null) { throw new ArgumentNullException(nameof(readSetPoint), "Read set-point must not be null."); } SamplingRate = samplingRate; SetOutputLimits(0, _windowSize); _readProcess = readProcess; _readOutput = readOutput; _writeOutput = writeOutput; _readSetPoint = readSetPoint; ProportionalGain = proportionalGain; IntegralGain = integralGain; DerivativeGain = derivativeGain; ControllerDirection = controllerDirection; ControllerMode = controllerMode; }
public void Undo(IDataCommand dataCommand) { IOnOff onOff = dataCommand.GetDevice() as IOnOff; if (onOff != null) { onOff.On(); } }
public void Execute(IDataCommand dataCommand) { IOnOff onOff = dataCommand.GetDevice() as IOnOff; if (onOff != null) { onOff.Off(); } }
public void OnOffDvd() { if (State == StateOnOff.On) { IOnOff onOff = GetDvd(); if (onOff != null) { if (onOff.State == StateOnOff.On) { onOff.Off(); } else { onOff.On(); } } } else { throw new Exception("Нужно сначала включить домашний кинотеатр"); } }
public Facade(Kitty kitty, IOnOff light, IOnOff music) { _kitty = kitty; _light = light; _music = music; }
public MySwitch(string id, IOnOff outlet) : this(id, new IOnOff[] { outlet }) { }