|
|
@@ -288,7 +288,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
return;
|
|
|
}
|
|
|
//先请求服务名下的所有节点数据
|
|
|
- reverseBackParam = Operate.Request((int)RequestMethod.ReqGetALLItemsOfOPC, new ReqGetALLItemsOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(RequestMethod.ReqGetALLItemsOfOPC, new ReqGetALLItemsOfOPC.Request() { opcname = ServerName });
|
|
|
MessageOut(reverseBackParam.Message);
|
|
|
if (reverseBackParam.State)
|
|
|
{
|
|
|
@@ -305,7 +305,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
}
|
|
|
if (itemlists.Count > 0)
|
|
|
{
|
|
|
- reverseBackParam = Operate.Request((int)RequestMethod.ReqAddItemsOfGroup, new ReqAddItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName, itemlist = itemlists });
|
|
|
+ reverseBackParam = Operate.Request(RequestMethod.ReqAddItemsOfGroup, new ReqAddItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName, itemlist = itemlists });
|
|
|
MessageOut(reverseBackParam.Message);
|
|
|
}
|
|
|
else
|
|
|
@@ -332,7 +332,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
switch (requestMethod)
|
|
|
{
|
|
|
case RequestMethod.ReqOPCServerNameList:
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod);
|
|
|
+ reverseBackParam = Operate.Request(requestMethod);
|
|
|
if (reverseBackParam.State)
|
|
|
{
|
|
|
ReqOPCServerNameList.Response response = reverseBackParam.RData as ReqOPCServerNameList.Response;
|
|
|
@@ -349,7 +349,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqConnectToOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqConnectToOPC.Request() { opcname = ServerName });
|
|
|
break;
|
|
|
case RequestMethod.ReqGetALLItemsOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName))
|
|
|
@@ -358,7 +358,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqGetALLItemsOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqGetALLItemsOfOPC.Request() { opcname = ServerName });
|
|
|
break;
|
|
|
case RequestMethod.ReqReConnectOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName))
|
|
|
@@ -367,7 +367,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqReConnectOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqReConnectOfOPC.Request() { opcname = ServerName });
|
|
|
break;
|
|
|
case RequestMethod.ReqDisConnectOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName))
|
|
|
@@ -376,7 +376,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqDisConnectOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqDisConnectOfOPC.Request() { opcname = ServerName });
|
|
|
break;
|
|
|
case RequestMethod.ReqDeleteConnectOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName))
|
|
|
@@ -385,7 +385,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqDeleteConnectOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqDeleteConnectOfOPC.Request() { opcname = ServerName });
|
|
|
break;
|
|
|
case RequestMethod.ReqAddGroupOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName) || string.IsNullOrEmpty(GroupName))
|
|
|
@@ -394,7 +394,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqAddGroupOfOPC.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqAddGroupOfOPC.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
break;
|
|
|
case RequestMethod.ReqDelGroupOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName) || string.IsNullOrEmpty(GroupName))
|
|
|
@@ -403,7 +403,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqDelGroupOfOPC.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqDelGroupOfOPC.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
break;
|
|
|
case RequestMethod.ReqGetGroupsOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName))
|
|
|
@@ -412,7 +412,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqGetGroupsOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqGetGroupsOfOPC.Request() { opcname = ServerName });
|
|
|
if (reverseBackParam.State)
|
|
|
{
|
|
|
ReqGetGroupsOfOPC.Response response = reverseBackParam.RData as ReqGetGroupsOfOPC.Response;
|
|
|
@@ -429,7 +429,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqAddItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName, itemlist = new List<ReqAddItemsOfGroup.Request._itemlist>() { new ReqAddItemsOfGroup.Request._itemlist() { itemname = NodeName } } });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqAddItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName, itemlist = new List<ReqAddItemsOfGroup.Request._itemlist>() { new ReqAddItemsOfGroup.Request._itemlist() { itemname = NodeName } } });
|
|
|
break;
|
|
|
case RequestMethod.ReqGetItemsOfGroup:
|
|
|
if (string.IsNullOrEmpty(ServerName) || string.IsNullOrEmpty(GroupName))
|
|
|
@@ -438,7 +438,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqGetItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqGetItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
break;
|
|
|
case RequestMethod.ReqDelItemsOfGroup:
|
|
|
if (string.IsNullOrEmpty(ServerName) || string.IsNullOrEmpty(GroupName) || string.IsNullOrEmpty(NodeName))
|
|
|
@@ -447,7 +447,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqDelItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName, itemlist = new List<ReqDelItemsOfGroup.Request._itemlist>() { new ReqDelItemsOfGroup.Request._itemlist() { itemname = NodeName } } });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqDelItemsOfGroup.Request() { opcname = ServerName, groupname = GroupName, itemlist = new List<ReqDelItemsOfGroup.Request._itemlist>() { new ReqDelItemsOfGroup.Request._itemlist() { itemname = NodeName } } });
|
|
|
break;
|
|
|
case RequestMethod.ReqReadItemsValueOfGroup:
|
|
|
if (string.IsNullOrEmpty(ServerName) || string.IsNullOrEmpty(GroupName))
|
|
|
@@ -456,7 +456,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqReadItemsValueOfGroup.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqReadItemsValueOfGroup.Request() { opcname = ServerName, groupname = GroupName });
|
|
|
break;
|
|
|
case RequestMethod.ReqGetConnectStatusOfOPC:
|
|
|
if (string.IsNullOrEmpty(ServerName))
|
|
|
@@ -465,7 +465,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqGetConnectStatusOfOPC.Request() { opcname = ServerName });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqGetConnectStatusOfOPC.Request() { opcname = ServerName });
|
|
|
break;
|
|
|
case RequestMethod.ReqWriteItemValue:
|
|
|
if (string.IsNullOrEmpty(ServerName) || string.IsNullOrEmpty(GroupName) || string.IsNullOrEmpty(NodeName) || string.IsNullOrEmpty(NodeValue))
|
|
|
@@ -474,7 +474,7 @@ namespace YSAI.Tool.Core.opc.da.http
|
|
|
RequestIsEnabled = true;
|
|
|
return;
|
|
|
}
|
|
|
- reverseBackParam = Operate.Request((int)requestMethod, new ReqWriteItemValue.Request() { opcname = ServerName, groupname = GroupName, itemname = NodeName, itemvalue = NodeValue });
|
|
|
+ reverseBackParam = Operate.Request(requestMethod, new ReqWriteItemValue.Request() { opcname = ServerName, groupname = GroupName, itemname = NodeName, itemvalue = NodeValue });
|
|
|
break;
|
|
|
}
|
|
|
MessageOut($"{reverseBackParam.Message},用时:{reverseBackParam.RunTime} ms");
|