Commit b82fc895 LN

通信修改

1 个父辈 5237de7b
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
......
...@@ -78,7 +78,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -78,7 +78,14 @@ namespace OnlineStore.DeviceLibrary
public RFIDData(int num, int t) public RFIDData(int num, int t)
{ {
this.RFType = (char)t; if (t < 65)
{
RFType = '0';
}
else
{
this.RFType = (char)t;
}
this.Num = num; this.Num = num;
} }
...@@ -88,7 +95,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,7 +95,14 @@ namespace OnlineStore.DeviceLibrary
{ {
if (data != null && data.Length > 2) if (data != null && data.Length > 2)
{ {
RFType = (char)data[1]; if (data[1] < 65)
{
RFType = '0';
}
else
{
RFType = (char)data[1];
}
Num = (int)(data[2]); Num = (int)(data[2]);
} }
} }
......
...@@ -468,20 +468,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -468,20 +468,33 @@ namespace OnlineStore.DeviceLibrary
} }
isInProcess = false; isInProcess = false;
} }
private static string GetAddr(string addr, Dictionary<string, string> paramsMap)
{
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
if (server.EndsWith("/"))
{
server = server.Substring(0, server.Length - 1);
}
string path = server + addr.Trim() + "?";
foreach (string paramName in paramsMap.Keys)
{
string par = System.Web.HttpUtility.UrlEncode(paramsMap[paramName], System.Text.Encoding.UTF8);
path += paramName + "=" + par + "&";
}
path = path.Substring(0, path.Length - 1);
return path;
}
private string http_server = ConfigAppSettings.GetValue(Setting_Init.http_server); private string http_server = ConfigAppSettings.GetValue(Setting_Init.http_server);
private string api_communication = "service/store/qisda/vmiRfid?rfid="; //流水线状态通信接口 private string api_communication = "service/store/qisda/vmiRfid"; //流水线状态通信接口
private string lastLog = ""; private string lastLog = "";
public bool SendVmiRfid(string rfid) public bool SendVmiRfid(string rfid)
{ {
try try
{ {
if (http_server.EndsWith("/")) Dictionary<string, string> paramMap = new Dictionary<string, string>();
{ paramMap.Add("rfid", rfid);
http_server = http_server.Substring(0, http_server.Length - 1); string addr = GetAddr(api_communication, paramMap ) ;
}
string addr = http_server + api_communication + rfid;
string resultStr = HttpHelper.Post(addr, ""); string resultStr = HttpHelper.Post(addr, "");
string log = "vmiRfid 【" + addr + "】【" + resultStr + "】"; string log = "vmiRfid 【" + addr + "】【" + resultStr + "】";
if (lastLog.Equals(log).Equals(false)) if (lastLog.Equals(log).Equals(false))
...@@ -491,7 +504,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -491,7 +504,6 @@ namespace OnlineStore.DeviceLibrary
} }
if (resultStr.Equals("move")) if (resultStr.Equals("move"))
{ {
return true; return true;
} }
} }
......
...@@ -125,7 +125,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -125,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
public string GetRunInfo() public string GetRunInfo()
{ {
return "料流水线:入库料架 ["+LastInShelfId+"] 出口料架 ["+LastOutShelfId+"]"; return "料流水线:入库料架 ["+LastInShelfId+"] 出口料架 ["+LastOutShelfId+"]";
} }
#endregion #endregion
} }
......
...@@ -151,7 +151,6 @@ ...@@ -151,7 +151,6 @@
this.lblInfo.Size = new System.Drawing.Size(56, 17); this.lblInfo.Size = new System.Drawing.Size(56, 17);
this.lblInfo.TabIndex = 273; this.lblInfo.TabIndex = 273;
this.lblInfo.Text = "运行信息"; this.lblInfo.Text = "运行信息";
this.lblInfo.Visible = false;
// //
// btnVmiExit // btnVmiExit
// //
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!