public void Fake() { try { sconnInput zone = new sconnInput(); zone.Fake(); Inputs.Add(zone); } catch (Exception e) { _logger.Error(e, e.Message); } }
public void Deserialize(byte[] buffer) { try { byte relays = buffer[ipcDefines.DeviceMaxInputs]; for (byte i = 0; i < relays; i++) { byte[] relayCfg = new byte[ipcDefines.mAdrInputMemSize]; for (byte j = 0; j < ipcDefines.mAdrInputMemSize; j++) { relayCfg[j] = buffer[ipcDefines.mAdrInput + i * ipcDefines.mAdrInputMemSize + j]; } sconnInput relay = new sconnInput(relayCfg); relay.Id = i; Inputs.Add(relay); } } catch (Exception e) { _logger.Error(e, e.Message); } }
private void LoadInputsFromConfig() { try { InputNo = _memCFG[ipcDefines.mAdrInputsNO]; Inputs = new List <sconnInput>(); for (int i = 0; i < InputNo; i++) { byte[] inputBytes = new byte[ipcDefines.mAdrInputMemSize]; for (int j = 0; j < ipcDefines.mAdrInputMemSize; j++) { inputBytes[j] = _memCFG[ipcDefines.mAdrInput + i * ipcDefines.mAdrInputMemSize + j]; } sconnInput input = new sconnInput(inputBytes); input.Id = (byte)i; Inputs.Add(input); } } catch (Exception e) { _logger.Error(e, e.Message); } }