예제 #1
0
        public static void Idn(this ILambdaProtocol lambdaProtocol, string identifier, byte address)
        {
            var response = lambdaProtocol.Idn();

            if (!response.Response.Equals(identifier))
            {
                throw new LambdaFailureException(string.Format(Properties.Resources.NotFoundPowerSourceWithResponse,
                                                               identifier, address, response.Response), response.Error);
            }
        }
예제 #2
0
        public override void PowerOn(ILambdaWorker worker)
        {
            try
            {
                _unit.Available(false);
                _protocol.Adr(_unit.ExpectedIdentifier, _unit.Address, _unit.Address);
                _unit.Available(true);

                _protocol.OutOn(_unit.ExpectedIdentifier, _unit.Address, _unit.Voltage);

                _protocol.Idn(_unit.ExpectedIdentifier, _unit.Address);

                worker.Goto(worker.StateReadInit);
            }
            catch (Exception)
            {
                worker.Goto(worker.StateFailure);
                throw;
            }
        }