Esempio n. 1
0
        private void CheckData()
        {
            if (_previousAckBytes == null)
            {
                _currentAckBytes = _runtimeDevice.DeviceMomento.State
                                   .DataTable[DeviceStringKeys.DeviceTableTagKeys.ACKNOWLEDGE_VALUE]
                                   .Value as byte[];
                if (_currentAckBytes == null)
                {
                    return;
                }
                MakeBytesEqual();
            }
            else
            {
                if (!IsBytesEquals(_previousAckBytes, _runtimeDevice.DeviceMomento.State
                                   .DataTable[DeviceStringKeys.DeviceTableTagKeys.ACKNOWLEDGE_VALUE]
                                   .Value as byte[]))
                {
                    _currentAckBytes = _runtimeDevice.DeviceMomento.State
                                       .DataTable[DeviceStringKeys.DeviceTableTagKeys.ACKNOWLEDGE_VALUE]
                                       .Value as byte[];

                    if (!_runtimeDevice.DefectState.HasAnyDefect)
                    {
                        if (_isFailAcknowledged)
                        {
                            MakeBytesEqual();
                        }
                        if (_applicationSettingsService.AcknowledgeEnabled)
                        {
                            MakeBytesEqual();
                        }
                    }
                    _isFailAcknowledged = false;
                }
                else
                {
                    if (_applicationSettingsService.AcknowledgeEnabled)
                    {
                        _currentAckBytes = _runtimeDevice.DeviceMomento.State
                                           .DataTable[DeviceStringKeys.DeviceTableTagKeys.ACKNOWLEDGE_VALUE]
                                           .Value as byte[];
                    }
                }
                AcknowledgeValueChanged?.Invoke();
            }
        }
Esempio n. 2
0
 public void AcknowledgeFail()
 {
     MakeBytesEqual();
     _isFailAcknowledged = true;
     AcknowledgeValueChanged?.Invoke();
 }