public static void OutOff(this ILambdaProtocol lambdaProtocol, string identifier, byte address, float voltage) { var response = lambdaProtocol.OutOff(); if (response.Error != null) { throw new LambdaFailureException(string.Format(Properties.Resources.NotFoundPowerSource, identifier, address, VoltageRound(voltage)), response.Error); } }
public bool Process() { if (_unit.IsSettedVoltage() && _unit.IsSettedCurrent()) { _protocol.OutOff(_unit.ExpectedIdentifier, _unit.Address, _unit.Voltage); } else { if (!_unit.IsSettedVoltage()) { _protocol.Pv(_unit.ExpectedIdentifier, _unit.Address, _unit.Voltage); } if (!_unit.IsSettedCurrent()) { _protocol.Pc(_unit.ExpectedIdentifier, _unit.Address, _unit.Voltage, _unit.Current); } return(true); } return(false); }