Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 protected RuntimeDeviceBase(IApplicationSettingsService applicationSettingsService,
                             IRuntimeModeDriversService runtimeModeDriversService,
                             ApplicationConnectionService.ApplicationConnectionService applicationConnectionService,
                             IDeviceTimerInterrogationService timerInterrigationService, IDefectState defectState,
                             IDeviceDataCache deviceDataCache, IAnalogData analogData, IResistorFactory resistorFactory,
                             ICustomItemsFactory customItemsFactory, ConnectionLogger connectionLogger)
 {
     _applicationSettingsService   = applicationSettingsService;
     _runtimeModeDriversService    = runtimeModeDriversService;
     _applicationConnectionService = applicationConnectionService;
     _timerInterrigationService    = timerInterrigationService;
     _resistorFactory    = resistorFactory;
     _customItemsFactory = customItemsFactory;
     _connectionLogger   = connectionLogger;
     this._starterToLighttingModeDictionary = new Dictionary <int, LightingModeEnum>();
     this._starterToLighttingModeDictionary.Add(1, LightingModeEnum.UNDEFINED);
     this._starterToLighttingModeDictionary.Add(2, LightingModeEnum.UNDEFINED);
     this._starterToLighttingModeDictionary.Add(3, LightingModeEnum.UNDEFINED);
     _timerInterrigationService.SetDeviceForInterrogation(this);
     _timerInterrigationService.InterrogationCycleComplete += () =>
     {
         DeviceValuesUpdated?.Invoke();
     };
     DefectState       = defectState;
     DeviceDataCache   = deviceDataCache;
     AnalogData        = analogData;
     ResistorsOnDevice = new List <IResistor>();
     StartersOnDevice  = new List <IStarter>();
 }
Exemplo n.º 2
0
        public override async Task UpdateSignature()
        {
            if (!TcpDeviceConnection.LastTransactionSucceed)
            {
                return;
            }
            if (ConnectionModuleId == 0)
            {
                return;
            }
            var signBytes = await TcpDeviceConnection.ExecuteFunction12Async((byte)ConnectionModuleId, "Get Picon Signature", 0xF0);

            if (signBytes == null)
            {
                signBytes = await TcpDeviceConnection.ExecuteFunction12Async((byte)ConnectionModuleId, "Get Picon Signature", 0xF0);
            }
            string signature = Encoding.UTF8.GetString(signBytes);

            DeviceSignature = signature;
            DeviceValuesUpdated?.Invoke();
        }
Exemplo n.º 3
0
        public override async Task UpdateSignal()
        {
            if (!TcpDeviceConnection.LastTransactionSucceed)
            {
                return;
            }
            if (ConnectionModuleId == 0)
            {
                return;
            }
            var signalLevelBytes = await TcpDeviceConnection.ExecuteFunction12Async((byte)ConnectionModuleId, "Get Picon SignalLevel", 0x60);

            if (signalLevelBytes == null)
            {
                signalLevelBytes = await TcpDeviceConnection.ExecuteFunction12Async((byte)ConnectionModuleId, "Get Picon SignalLevel", 0x60);
            }
            if (signalLevelBytes != null)
            {
                AnalogData.SignalLevel = signalLevelBytes[0];
                AnalogData.AnalogDataUpdated?.Invoke();
                DeviceValuesUpdated?.Invoke();
            }
        }