Esempio n. 1
0
        public async Task <bool> ControlsPowerStata(bool Open, ICommunicationProtocol _communicationProtocol, CancellationToken token)
        {
            if (Open)
            {
                if (await _communicationProtocol.GetPowerStata())
                {
                    return(true);
                }
                else
                {
                    await _communicationProtocol.SetTestPra(TestKind.Start, 2, token);

                    await Task.Delay(7000, token);

                    return(await _communicationProtocol.GetPowerStata());
                }
            }
            else
            {
                if (await _communicationProtocol.GetPowerStata())
                {
                    return(await _communicationProtocol.SetTestPra(TestKind.Stop, 2, token));
                }
                else
                {
                    return(true);
                }
            }
        }
Esempio n. 2
0
 public async Task DownAndClosePower(ICommunicationProtocol _communicationProtocolk, Xmldata.IXmlconfig _xmlconfig, CancellationToken token)
 {
     if (await _communicationProtocolk.GetPowerStata() && (await _communicationProtocolk.ReadStataThree(token)).AVolate > 10)
     {
         await DownVolateZero(_communicationProtocolk, _xmlconfig, token);
         await ControlsPowerStata(false, _communicationProtocolk, token);
     }
     else
     {
         await ControlsPowerStata(false, _communicationProtocolk, token);
     }
     await ControlsPowerStata(false, _communicationProtocolk, token);
 }