Commit ab2d5cda LN

arriveRobotLocation增加barcode参数

1 个父辈 6c4d7bb7
......@@ -284,6 +284,9 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
IO_Value增加None的定义,防止误操作
20200311
扫码获取图片方式修改。
料盘到达接驳台后,给服务器发送条码信息,arriveRobotLocation增加barcode参数
......
......@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Security;
using System.Reflection;
using System.Text;
......@@ -48,6 +49,29 @@ namespace OnlineStore.Common
}
public class HttpHelper
{
public static bool PingURLIP(string url, int ms = 100)
{
string[] urlArray = url.Split('/');
if (urlArray.Length > 3)
{
string ip = urlArray[2];
Ping pingSender = new Ping();
PingReply reply = pingSender.Send(ip, ms);//第一个参数为ip地址,第二个参数为ping的时间
if (reply.Status == IPStatus.Success)
{
//通
return true;
}
else
{
LogUtil.error("Ping IP " + ip + " : false");
//不通
return false;
}
}
return true;
}
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static string Post(string url, string paramData)
{
......@@ -56,6 +80,10 @@ namespace OnlineStore.Common
private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string Post(string url, string paramData, Encoding encoding)
{
if (PingURLIP(url, 100).Equals(false))
{
return "";
}
if (isLog == 1)
{
LOGGER.Info("给服务器发送数据【" + paramData + "】 ");
......
......@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil.info(hengyiName + "出口有料,转动接驳台皮带线2000 , 收到SeparateDevice_Check信号,调用arriveRobotLocation=" + robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
}
else
{
......@@ -341,7 +341,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台有料盘,等待2000,调用arriveRobotLocation=" + robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
}
else
{
......
......@@ -334,7 +334,7 @@ namespace OnlineStore.DeviceLibrary
//> 返回:
//>>``
private static string Addr_arriveRobotLocation = "/rest/api/qisda/device/arriveRobotLocation";
public static string arriveRobotLocation(string deviceName, int robotIndex)
public static string arriveRobotLocation(string deviceName, int robotIndex,string barcode)
{
string msg = "";
try
......@@ -346,6 +346,7 @@ namespace OnlineStore.DeviceLibrary
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("robotIndex", robotIndex.ToString());//rfid
paramMap.Add("barcode", barcode);
string server = GetAddr(Addr_arriveRobotLocation, paramMap);
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName + "arriveRobotLocation 【" + server + "】【" + resultStr + "】");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!