| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using SHJX.Service.Control.Common.Assets;
- namespace SHJX.Service.Control.PortArgs.Interface
- {
- public abstract class IPortArg
- {
- protected object _writeData;
- private Dictionary<string, byte> _nodeIDs;
- protected Dictionary<string, byte> NodeIDs
- {
- get
- {
- if (_nodeIDs is null)
- {
- _nodeIDs = ConfigInstance.GetPortNodeIDs();
- }
- return _nodeIDs;
- }
- }
- protected byte GetPortId(string nodeName)
- {
- byte nodeId = 0;
- if (NodeIDs.TryGetValue(nodeName, out var value))
- {
- nodeId = value;
- }
- return nodeId;
- }
- public IPortArg SetValue(object value)
- {
- _writeData = value;
- return this;
- }
- public abstract PortEventArgs Init(string name);
- }
- }
|