Commit b82fc895 LN

通信修改

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