public void GetPointPropertiesTest() { SunRizModbusTcpDriver.ModbusDriverServer server = new ModbusDriverServer(588); server.Start(); SunRizDriver.SunRizDriverClient client = new SunRizDriver.SunRizDriverClient("127.0.0.1", 588); var result = client.GetPointProperties(); server.Stop(); }
/// <summary> /// 设置数据连接相关的属性输入框 /// </summary> void setPointPropertyInput() { //获取通讯网关 _container.Cursor = Cursors.Hand; Helper.Remote.Invoke <CommunicationDriver>("GetDriver", (gateway, err) => { _container.Cursor = null; if (err != null) { MessageBox.Show(MainWindow.Instance, err); } else { gatewayClient = new SunRizDriver.SunRizDriverClient(gateway.Address, gateway.Port.GetValueOrDefault()); var serverInfo = gatewayClient.GetServerInfo(); string[] properties = gatewayClient.GetPointProperties(); bool isNew = false; if (_PointJsonDict == null) { _PointJsonDict = new Dictionary <string, string>(); isNew = true; } for (int i = 0; i < properties.Length; i++) { var item = properties[i]; string strProperty = item; if (strProperty.Contains("{")) { strProperty = strProperty.Substring(0, strProperty.IndexOf("{")); } if (isNew) { _PointJsonDict[strProperty] = ""; } addPropertyItem(strProperty, i == 0 && serverInfo.SupportEnumPoints); } } }, Device.DriverID); }