Dreamine.IO.Fastech.Ethernet 1.0.1
Dreamine.IO.Fastech.Ethernet 산업 자동화 및 I/O 기능을 제공합니다.
로딩중...
검색중...
일치하는것 없음
FastechEthernetIoOptions.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.IO.Abstractions.Enums;
2using Dreamine.IO.Abstractions.Options;
3
5
14public sealed class FastechEthernetIoOptions
15{
24 public string Host { get; set; } = "127.0.0.1";
25
34 public int Port { get; set; } = 3001;
35
44 public int LocalPort { get; set; }
45
55
64 public int DeviceIndex { get; set; }
65
74 public int ConnectTimeoutMs { get; set; } = 3000;
75
84 public int ReceiveTimeoutMs { get; set; } = 3000;
85
94 public int RetryCount { get; set; } = 1;
95
104 public int ExpectedResponseLength { get; set; }
105
114 public IDictionary<string, string> Properties { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
115
132 public IoConnectionOptions ToIoConnectionOptions()
133 {
134 var options = new IoConnectionOptions
135 {
136 Provider = IoProvider.Fastech,
138 Name = Host
139 };
140
141 options.Properties["Host"] = Host;
142 options.Properties["Port"] = Port.ToString();
143 options.Properties["LocalPort"] = LocalPort.ToString();
144 options.Properties["ConnectTimeoutMs"] = ConnectTimeoutMs.ToString();
145 options.Properties["ReceiveTimeoutMs"] = ReceiveTimeoutMs.ToString();
146 options.Properties["RetryCount"] = RetryCount.ToString();
147
148 foreach (var property in Properties)
149 {
150 options.Properties[property.Key] = property.Value;
151 }
152
153 return options;
154 }
155}