private void LoadDevice() { try { DeviceBlocks = new List<DeviceBlock>(); foreach (BlockSettings blockSettings in Params.BlockList) { DeviceBlock block; if (Params.Protocol.Type == ProtocolSettings.ProtocolType.Modbus) block = new DeviceBlock_Modbus(this, blockSettings, Params.Protocol); else if (Params.Protocol.Type == ProtocolSettings.ProtocolType.Phoenixtec) block = new DeviceBlock_Phoenixtec(this, blockSettings, Params.Protocol); else block = new DeviceBlock_RequestResponse(this, blockSettings, Params.Protocol); DeviceBlocks.Add(block); } } catch (Exception e) { FaultDetected = true; LogMessage("Device.LoadDevice - Loading DeviceBlocks - Exception: " + e.Message, LogEntryType.ErrorMessage); } try { Algorithms = new List<AlgorithmAction>(); foreach (ActionSettings settings in Params.AlgorithmList) { AlgorithmAction algorithm = new Algorithm(this, settings); Algorithms.Add(algorithm); } } catch (Exception e) { FaultDetected = true; LogMessage("Device.LoadDevice - Loading Algorithms - Exception: " + e.Message, LogEntryType.ErrorMessage); } }
public AlgorithmAction_RepeatCountTimes(DeviceAlgorithm device, Algorithm algorithm, ActionSettings actionSettings) : base(device, algorithm, actionSettings) { CommonConstruction(); }
public AlgorithmAction_SendBlock(DeviceAlgorithm device, Algorithm algorithm, ActionSettings actionSettings) : base(device, algorithm, actionSettings) { CommonConstruction(); }
public AlgorithmAction_LogError(DeviceAlgorithm device, Algorithm algorithm, ActionSettings actionSettings) : base(device, algorithm, actionSettings) { CommonConstruction(); }