@@ -33,18 +33,20 @@ namespace BPASmartClient.AGV | |||
} | |||
public string PostData(string url, string head, string body) | |||
{ | |||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); | |||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(url)); | |||
request.Method = "POST"; | |||
request.Headers["header"] = head; | |||
request.Proxy = null; | |||
byte[] bytes = Encoding.UTF8.GetBytes(body); | |||
request.ContentType = "application/json; charset=UTF-8"; //窗体数据被编码为名称/值对形式 | |||
request.ContentType = "application/json"; //窗体数据被编码为名称/值对形式 | |||
//request.ContentType = "application/json"; | |||
request.ContentLength = bytes.Length; | |||
request.ServicePoint.Expect100Continue = false; | |||
Stream myResponseStream = request.GetRequestStream(); | |||
myResponseStream.Write(bytes, 0, bytes.Length); | |||
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | |||
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);//解码 | |||
Stream stream = response.GetResponseStream(); | |||
StreamReader myStreamReader = new StreamReader(stream);//解码 | |||
string retString = myStreamReader.ReadToEnd(); | |||
myStreamReader.Close(); | |||
myResponseStream.Close(); | |||
@@ -52,7 +54,7 @@ namespace BPASmartClient.AGV | |||
if (response != null) | |||
{ | |||
response.Close(); | |||
} | |||
} | |||
if (request != null) | |||
{ | |||
request.Abort(); | |||
@@ -91,7 +93,7 @@ namespace BPASmartClient.AGV | |||
return Id; | |||
} | |||
/// <summary> | |||
/// AGV去1号线体装桶 | |||
/// AGV去1号线体装桶到炒锅1 | |||
/// </summary> | |||
/// <returns></returns> | |||
public string AgvToLineOneLoadRoller(string robotJobId) | |||
@@ -117,14 +119,18 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["LineOnePoint"].Value;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["FryPotOnePoint"].Value; ;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value); //是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); ;//上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); ;//是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 1; | |||
httpJobData.unloadEquipmentId = 5; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
// string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求 | |||
//货位到货位 | |||
@@ -139,16 +145,82 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
/// <summary> | |||
/// AGV去1号线体装桶到炒锅4 | |||
/// </summary> | |||
/// <returns></returns> | |||
public string AgvFromLineOneToFryFourLoadRoller(string robotJobId) | |||
{ | |||
//bool b = Convert.ToBoolean(config.AppSettings.Settings["appKey"].Value);//配置文件信息读取 | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; | |||
httpHeader.appSecret = config.AppSettings.Settings["appSecret"].Value; | |||
httpHeader.requestId = ResquestIdGenerate(); | |||
httpHeader.timestamp = DateTime.Now.ToString();//时间戳 | |||
httpHeader.version = config.AppSettings.Settings["version"].Value; | |||
string head = JsonConvert.SerializeObject(httpHeader); | |||
//请求报文体 | |||
AGVModel httpModel = new AGVModel(); | |||
httpModel.robotJobId = robotJobId;//上游提供 | |||
httpModel.warehouseId = long.Parse(config.AppSettings.Settings["warehouseId"].Value); //仓库编号 | |||
httpModel.jobPriority = Convert.ToInt32(config.AppSettings.Settings["jobPriority"].Value);//任务执行的优先级 | |||
httpModel.jobPriorityType = Convert.ToInt32(config.AppSettings.Settings["jobPriorityType"].Value);//0:根据优先级来执行,1:强制执行 | |||
httpModel.jobType = config.AppSettings.Settings["jobType"].Value; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = config.AppSettings.Settings["LineOnePoint"].Value; ;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["FryPotFourPoint"].Value; ;//目的点位 | |||
//httpJobData.startPoint = config.AppSettings.Settings["FryPotFivePoint"].Value;//起点点位 | |||
//httpJobData.endPoint = config.AppSettings.Settings["FryPotFourPoint"].Value; ;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value); //是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); ;//上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); ;//是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 1; | |||
httpJobData.unloadEquipmentId = 8; | |||
httpModel.jobData = httpJobData; | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
// string newBody = String.Join(",\r\n", body.Split(','));//格式处理,看需求 | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
//httpSlotJobData.endSlotCode = "";//目的槽位编号 | |||
//httpSlotJobData.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//httpSlotJobData.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//httpSlotJobData.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//httpSlotJobData.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//httpModel.jobData = httpSlotJobData; | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
var objData = JsonConvert.DeserializeObject<HttpResponseBodyModel>(data); | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
/// <summary> | |||
/// AGV去2号线体装桶 | |||
/// AGV去2号线体装桶到炒锅2 | |||
/// </summary> | |||
/// <returns></returns> | |||
public string AgvToLineTwoLoadRoller(string robotJobId) | |||
@@ -172,14 +244,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["LineTwoPoint"].Value;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["FryPotTwoPoint"].Value; ;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 2; | |||
httpJobData.unloadEquipmentId = 6; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -192,11 +266,66 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
/// <summary> | |||
/// AGV去2号线体装桶到炒锅5 | |||
/// </summary> | |||
/// <returns></returns> | |||
public string AgvFromLineTwoToFryFiveLoadRoller(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; ; | |||
httpHeader.appSecret = config.AppSettings.Settings["appSecret"].Value; | |||
httpHeader.requestId = ResquestIdGenerate(); | |||
httpHeader.timestamp = DateTime.Now.ToString(); | |||
httpHeader.version = config.AppSettings.Settings["version"].Value; | |||
string head = JsonConvert.SerializeObject(httpHeader); | |||
//请求报文体 | |||
AGVModel httpModel = new AGVModel(); | |||
httpModel.robotJobId = robotJobId;//上游提供 | |||
httpModel.warehouseId = long.Parse(config.AppSettings.Settings["warehouseId"].Value); //仓库编号 | |||
httpModel.jobPriority = Convert.ToInt32(config.AppSettings.Settings["jobPriority"].Value);//任务执行的优先级 | |||
httpModel.jobPriorityType = Convert.ToInt32(config.AppSettings.Settings["jobPriorityType"].Value); ;//0:根据优先级来执行,1:强制执行 | |||
httpModel.jobType = config.AppSettings.Settings["jobType"].Value; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = config.AppSettings.Settings["LineTwoPoint"].Value; ;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["FryPotFivePoint"].Value; ;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 2; | |||
httpJobData.unloadEquipmentId = 9; | |||
httpModel.jobData = httpJobData; | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
//httpSlotJobData.endSlotCode = "";//目的槽位编号 | |||
//httpSlotJobData.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//httpSlotJobData.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//httpSlotJobData.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//httpSlotJobData.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//httpModel.jobData = httpSlotJobData; | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -225,14 +354,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["LineThreePoint"].Value;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["FryPotThreePoint"].Value;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 3; | |||
httpJobData.unloadEquipmentId = 7; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData=new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -245,11 +376,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -278,14 +409,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["CleanPoint"].Value; ;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value; ;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 10; | |||
httpJobData.unloadEquipmentId = 44; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -298,7 +431,7 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
@@ -331,14 +464,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["FryPotOnePoint"].Value; ;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value; ;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 5; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -351,11 +486,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -384,14 +519,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["FryPotTwoPoint"].Value; //起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 6; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -404,11 +541,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -437,14 +574,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["FryPotThreePoint"].Value;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 7; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -457,11 +596,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -490,14 +629,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["FryPotFourPoint"].Value;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 8; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -510,11 +651,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -543,14 +684,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["FryPotFivePoint"].Value;//起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value;//目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 9; | |||
httpJobData.unloadEquipmentId = 4; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -563,11 +706,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -597,14 +740,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["LineOnePoint"].Value; //起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["CleanPoint"].Value; //目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 11; | |||
httpJobData.unloadEquipmentId = 10; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -617,11 +762,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -650,14 +795,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["LineTwoPoint"].Value; //起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["CleanPoint"].Value; //目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 22; | |||
httpJobData.unloadEquipmentId = 10; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -670,11 +817,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -703,14 +850,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["LineThreePoint"].Value; //起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["CleanPoint"].Value; //目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 33; | |||
httpJobData.unloadEquipmentId = 10; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -723,11 +872,11 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -740,7 +889,7 @@ namespace BPASmartClient.AGV | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; ; | |||
httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; | |||
httpHeader.appSecret = config.AppSettings.Settings["appSecret"].Value; | |||
httpHeader.requestId = ResquestIdGenerate(); | |||
httpHeader.timestamp = DateTime.Now.ToString(); | |||
@@ -756,14 +905,16 @@ namespace BPASmartClient.AGV | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData httpJobData = new AGV_PointRollerJobData(); | |||
httpJobData.startPoint = "";//起点点位 | |||
httpJobData.endPoint = "";//目的点位 | |||
httpJobData.startPoint = config.AppSettings.Settings["CleanPoint"].Value; //起点点位 | |||
httpJobData.endPoint = config.AppSettings.Settings["LineFourPoint"].Value; //目的点位 | |||
httpJobData.autoLoad = Convert.ToBoolean(config.AppSettings.Settings["autoLoad"].Value);//是否自动上料 true:自动上料 false:人工上料 | |||
httpJobData.enableIOLoad = Convert.ToBoolean(config.AppSettings.Settings["enableIOLoad"].Value); //上料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 | |||
httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 | |||
httpJobData.loadEquipmentId = 10; | |||
httpJobData.unloadEquipmentId = 44; | |||
httpModel.jobData = httpJobData; | |||
string body = JsonConvert.SerializeObject(httpModel); | |||
string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; | |||
//货位到货位 | |||
//AGV_SlotRollerJobData httpSlotJobData = new AGV_SlotRollerJobData(); | |||
//httpSlotJobData.startSlotCode = "";//起点槽位编号 | |||
@@ -776,44 +927,44 @@ namespace BPASmartClient.AGV | |||
//string body = JsonConvert.SerializeObject(httpModel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
/// <summary> | |||
/// 任务取消 | |||
/// </summary> | |||
/// <param name="robotJobId">上游系统任务号,全局唯一</param> | |||
public string CancelJobTask(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskCancelUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
httpHeader.appKey = ""; | |||
httpHeader.appSecret = ""; | |||
httpHeader.requestId = ""; | |||
httpHeader.timestamp = ""; | |||
httpHeader.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(httpHeader); | |||
//请求报文体 | |||
AGVTaskCancelModel cancel = new AGVTaskCancelModel(); | |||
cancel.robotJobId = robotJobId; | |||
cancel.warehouseId = 123;//仓库编号 | |||
string body = JsonConvert.SerializeObject(cancel); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
///// <summary> | |||
///// 任务取消 | |||
///// </summary> | |||
///// <param name="robotJobId">上游系统任务号,全局唯一</param> | |||
//public string CancelJobTask(string robotJobId) | |||
//{ | |||
// string url = AGVRequestUrl.GetInstance.TaskCancelUrl; | |||
// //请求报文头 | |||
// HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
// httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; | |||
// httpHeader.appSecret = config.AppSettings.Settings["appSecret"].Value; | |||
// httpHeader.requestId = ResquestIdGenerate(); | |||
// httpHeader.timestamp = DateTime.Now.ToString(); | |||
// httpHeader.version = config.AppSettings.Settings["version"].Value; | |||
// string head = JsonConvert.SerializeObject(httpHeader); | |||
// //请求报文体 | |||
// AGVTaskCancelModel cancel = new AGVTaskCancelModel(); | |||
// cancel.robotJobId = robotJobId; | |||
// cancel.warehouseId = long.Parse(config.AppSettings.Settings["warehouseId"].Value);//仓库编号 | |||
// string body = JsonConvert.SerializeObject(cancel); | |||
// //启用签名 | |||
// //url = url + "?sign=" + MD5Deal(body); | |||
// string data = HttpRequest(url, head, body); | |||
// object objData = JsonConvert.DeserializeObject(data); | |||
// if (objData != null && objData is HttpResponseBodyModel response) | |||
// { | |||
// return response.code; | |||
// } | |||
// return "Analysis Error"; | |||
//} | |||
/// <summary> | |||
/// 实操任务完成通知 | |||
/// </summary> | |||
@@ -823,24 +974,24 @@ namespace BPASmartClient.AGV | |||
string url = AGVRequestUrl.GetInstance.TaskCompleteUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
httpHeader.appKey = ""; | |||
httpHeader.appSecret = ""; | |||
httpHeader.requestId = ""; | |||
httpHeader.timestamp = ""; | |||
httpHeader.version = "2.8"; | |||
httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; | |||
httpHeader.appSecret = config.AppSettings.Settings["appSecret"].Value; | |||
httpHeader.requestId = ResquestIdGenerate(); | |||
httpHeader.timestamp = DateTime.Now.ToString(); | |||
httpHeader.version = config.AppSettings.Settings["version"].Value; | |||
string head = JsonConvert.SerializeObject(httpHeader); | |||
//请求报文体 | |||
AGVTaskCompleteNotifyModel notify = new AGVTaskCompleteNotifyModel(); | |||
notify.robotJobId = robotJobId; | |||
notify.warehouseId = 123;//仓库编号 | |||
notify.warehouseId = long.Parse(config.AppSettings.Settings["warehouseId"].Value);//仓库编号 | |||
string body = JsonConvert.SerializeObject(notify); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
string data = HttpRequest(url, head, body).Replace('[', ' ').Replace(']', ' '); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -851,30 +1002,31 @@ namespace BPASmartClient.AGV | |||
/// <param name="jobId">任务编号</param> | |||
/// <param name="msgId">消息编号</param> | |||
/// <returns></returns> | |||
public string UpDownFeedBack(string agvCode, string jobId, string msgId) | |||
public string UpDownFeedBack(string agvCode, string jobId, string msgId,bool complete=true) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskCompleteUrl; | |||
string url = AGVRequestUrl.GetInstance.AGVInteracteUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel httpHeader = new HttpRequestHeaderModel(); | |||
httpHeader.appKey = ""; | |||
httpHeader.appSecret = ""; | |||
httpHeader.requestId = ""; | |||
httpHeader.timestamp = ""; | |||
httpHeader.version = "2.8"; | |||
httpHeader.appKey = config.AppSettings.Settings["appKey"].Value; | |||
httpHeader.appSecret = config.AppSettings.Settings["appSecret"].Value; | |||
httpHeader.requestId = ResquestIdGenerate(); | |||
httpHeader.timestamp = DateTime.Now.ToString(); | |||
httpHeader.version = config.AppSettings.Settings["version"].Value; | |||
string head = JsonConvert.SerializeObject(httpHeader); | |||
//请求报文体 | |||
AGVLoadInteracteModel load = new AGVLoadInteracteModel(); | |||
load.agvCode = agvCode; | |||
load.jobId = jobId; | |||
load.msgId = msgId; | |||
load.complete = true; | |||
string body = JsonConvert.SerializeObject(load); | |||
//启用签名 | |||
//url = url + "?sign=" + MD5Deal(body); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
if (objData != null && objData is HttpResponseBodyModel response) | |||
{ | |||
return response.Body.code; | |||
return response.code; | |||
} | |||
return "Analysis Error"; | |||
} | |||
@@ -22,8 +22,8 @@ namespace BPASmartClient.AGV | |||
/// 必填项 | |||
/// </summary> | |||
public long warehouseId { get; set; } | |||
public string? robotJobGroupId { get; set; } | |||
public int? sequence { get; set; } | |||
//public string? robotJobGroupId { get; set; } | |||
//public int? sequence { get; set; } | |||
/// <summary> | |||
/// 必填项 | |||
/// </summary> | |||
@@ -32,13 +32,13 @@ namespace BPASmartClient.AGV | |||
/// 必填项 | |||
/// </summary> | |||
public int jobPriorityType { get; set; } | |||
public string? deadline { get; set; } | |||
public string? agvType { get; set; } | |||
public string? agvEndPoint { get; set; } | |||
public bool? needOperation { get; set; } | |||
public string? agvCode { get; set; } | |||
public int? taskCountDown { get; set; } | |||
public string? businessType { get; set; } | |||
//public string? deadline { get; set; } | |||
//public string? agvType { get; set; } | |||
//public string? agvEndPoint { get; set; } | |||
//public bool? needOperation { get; set; } | |||
//public string? agvCode { get; set; } | |||
//public int? taskCountDown { get; set; } | |||
//public string? businessType { get; set; } | |||
/// <summary> | |||
/// 必填项 | |||
/// </summary> | |||
@@ -6,7 +6,7 @@ | |||
public static AGVRequestUrl GetInstance => _instance ??= new AGVRequestUrl(); | |||
public AGVRequestUrl() | |||
{ | |||
string IpAddress = ""; | |||
string IpAddress = "172.16.12.200"; | |||
TaskSendUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.robot.job.submit"; | |||
TaskCancelUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.robot.job.cancel"; | |||
TaskCompleteUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.operation.notice"; | |||
@@ -13,7 +13,7 @@ namespace BPASmartClient.AGV | |||
{ | |||
//private static AGV_PointRollerJobData _instance; | |||
//public static AGV_PointRollerJobData GetInstance => _instance ??= new AGV_PointRollerJobData(); | |||
public string? containerCode { get; set; } | |||
// public string? containerCode { get; set; } | |||
public string startPoint { get; set; } | |||
public string endPoint { get; set; } | |||
public bool autoLoad { get; set; } | |||
@@ -22,8 +22,8 @@ namespace BPASmartClient.AGV | |||
public bool enableIOUnload { get; set; } | |||
public long? loadEquipmentId { get; set; } = null; | |||
public long? unloadEquipmentId { get; set; } = null; | |||
public bool? loadInteractive { get; set; } | |||
public int? loadHeight { get; set; } | |||
public int? unloadHeight { get; set; } | |||
//public bool? loadInteractive { get; set; } | |||
//public int? loadHeight { get; set; } | |||
//public int? unloadHeight { get; set; } | |||
} | |||
} |
@@ -8,34 +8,21 @@ namespace BPASmartClient.AGV.Feedback | |||
{ | |||
public class AGVToUpSystem | |||
{ | |||
/// <summary> | |||
/// 上游系统任务号,全局唯一 | |||
/// </summary> | |||
public string robotJobId { get; set; } | |||
/// <summary> | |||
/// 仓库编号 | |||
/// </summary> | |||
public int warehouseId { get; set; } | |||
/// <summary> | |||
/// 任务快仓系统编号 | |||
/// </summary> | |||
public string jobId { get; set; } | |||
/// <summary> | |||
/// 任务状态 | |||
/// </summary> | |||
public string state { get; set; } | |||
/// <summary> | |||
/// 内部任务类型 | |||
/// </summary> | |||
public string jobType { get; set; } | |||
/// <summary> | |||
/// 数据字段 | |||
/// </summary> | |||
public JobData jobData { get; set; } = new JobData(); | |||
public TaskEventData @event { get; set; } | |||
public string id { get; set;} | |||
public string type { get; set; } | |||
public string ts { get; set; } | |||
public long warehouseId { get; set; } | |||
public string zoneCode { get; set; } | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV.Feedback | |||
{ | |||
public class EventData | |||
{ | |||
/// <summary> | |||
/// AGV编号 | |||
/// </summary> | |||
public string agvCode { get; set; } | |||
/// <summary> | |||
/// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 | |||
/// </summary> | |||
public string containerCode { get; set; } | |||
/// <summary> | |||
/// 上游设备ID 本字段适用于只有一个辊筒设备的时候使用 | |||
/// </summary> | |||
public long equipmentId { get; set; } | |||
///// <summary> | |||
///// 上游设备ID,多个用英文逗号分隔 本字段适用于多辊筒同时上下料的时候使用 | |||
///// </summary> | |||
//public string equipmentIds { get; set; } | |||
/// <summary> | |||
/// 快仓任务编号 | |||
/// </summary> | |||
public string jobId { get; set; } | |||
/// <summary> | |||
/// 消息ID | |||
/// </summary> | |||
public string msgId { get; set; } | |||
/// <summary> | |||
/// 交互阶段 | |||
/// LOAD:上料阶段 | |||
/// UNLOAD:下料阶段 | |||
/// </summary> | |||
public string command { get; set; } | |||
///// <summary> | |||
///// 上游任务号 | |||
///// </summary> | |||
//public string robotJobId { get; set; } | |||
} | |||
} |
@@ -18,29 +18,22 @@ namespace BPASmartClient.AGV.Feedback | |||
/// </summary> | |||
public string containerCode { get; set; } | |||
public string pointCode { get; set; } | |||
/// <summary> | |||
/// 上料点位 | |||
/// </summary> | |||
public string startPointCode { get; set; } | |||
/// <summary> | |||
/// 上料货位编号 | |||
/// </summary> | |||
public string startSlotCode { get; set; } | |||
/// <summary> | |||
/// 下料点位 | |||
/// </summary> | |||
public string targetPointCode { get; set; } | |||
/// <summary> | |||
/// 下料货位编号 | |||
/// </summary> | |||
public string targetSlotCode { get; set; } | |||
/// <summary> | |||
/// 是否需要上料交互 | |||
/// </summary> | |||
public bool loadInteractive { get; set; } | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV.Feedback | |||
{ | |||
public class LoadRequest | |||
{ | |||
public HttpResponseHeaderModel header { get; set; } | |||
public Upstreamrequest body { get; set; } | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV.Feedback | |||
{ | |||
public class TaskData | |||
{ | |||
public HttpResponseHeaderModel header { get; set; } | |||
public AGVToUpSystem body { get; set; } | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV.Feedback | |||
{ | |||
public class TaskEventData | |||
{ | |||
public JobData jobData { get; set; } | |||
public string jobId { get; set; } | |||
public string jobType { get; set; } | |||
public string robotJobId{get;set;} | |||
public string state { get; set;} | |||
public long warehouseId { get; set; } | |||
} | |||
} |
@@ -8,46 +8,55 @@ namespace BPASmartClient.AGV.Feedback | |||
{ | |||
public class Upstreamrequest | |||
{ | |||
/// <summary> | |||
/// AGV编号 | |||
/// </summary> | |||
public string agvCode { get; set; } | |||
/// <summary> | |||
/// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 | |||
/// </summary> | |||
public string containerCode { get; set; } | |||
/// <summary> | |||
/// 上游设备ID 本字段适用于只有一个辊筒设备的时候使用 | |||
/// </summary> | |||
public long equipmentId { get; set; } | |||
/// <summary> | |||
/// 上游设备ID,多个用英文逗号分隔 本字段适用于多辊筒同时上下料的时候使用 | |||
/// </summary> | |||
public string equipmentIds { get; set; } | |||
/// <summary> | |||
/// 快仓任务编号 | |||
/// </summary> | |||
public string jobId { get; set; } | |||
/// <summary> | |||
/// 消息ID | |||
/// </summary> | |||
public string msgId { get; set; } | |||
/// <summary> | |||
/// 交互阶段 | |||
/// LOAD:上料阶段 | |||
/// UNLOAD:下料阶段 | |||
/// </summary> | |||
public string command { get; set; } | |||
/// <summary> | |||
/// 上游任务号 | |||
/// </summary> | |||
public string robotJobId { get; set; } | |||
public EventData @event { get; set; } | |||
public string ts { get; set; } | |||
public string type { get; set; } | |||
public string zoneCode { get; set; } | |||
public long warehouseId { get; set; } | |||
///// <summary> | |||
///// AGV编号 | |||
///// </summary> | |||
//public string agvCode { get; set; } | |||
///// <summary> | |||
///// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 | |||
///// </summary> | |||
//public string containerCode { get; set; } | |||
///// <summary> | |||
///// 上游设备ID 本字段适用于只有一个辊筒设备的时候使用 | |||
///// </summary> | |||
//public long equipmentId { get; set; } | |||
///// <summary> | |||
///// 上游设备ID,多个用英文逗号分隔 本字段适用于多辊筒同时上下料的时候使用 | |||
///// </summary> | |||
//public string equipmentIds { get; set; } | |||
///// <summary> | |||
///// 快仓任务编号 | |||
///// </summary> | |||
//public string jobId { get; set; } | |||
///// <summary> | |||
///// 消息ID | |||
///// </summary> | |||
//public string msgId { get; set; } | |||
///// <summary> | |||
///// 交互阶段 | |||
///// LOAD:上料阶段 | |||
///// UNLOAD:下料阶段 | |||
///// </summary> | |||
//public string command { get; set; } | |||
///// <summary> | |||
///// 上游任务号 | |||
///// </summary> | |||
//public string robotJobId { get; set; } | |||
} | |||
} |
@@ -6,7 +6,7 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV | |||
{ | |||
internal class HttpResponseBodyModel | |||
public class HttpResponseBodyModel | |||
{ | |||
public string code { get; set; } | |||
public string message { get; set; } | |||
@@ -6,10 +6,10 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV | |||
{ | |||
internal class HttpResponseData | |||
public class HttpResponseData | |||
{ | |||
public string code { get; set; } | |||
public bool message { get; set; } | |||
public string message { get; set; } | |||
public string robotJobId { get; set; } | |||
} | |||
} |
@@ -6,7 +6,7 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV | |||
{ | |||
internal class HttpResponseHeaderModel | |||
public class HttpResponseHeaderModel | |||
{ | |||
public string? requestId { get; set; } | |||
public string? timestamp { get; set; } | |||
@@ -6,9 +6,9 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.AGV | |||
{ | |||
internal class HttpResponseModel | |||
public class HttpResponseModel | |||
{ | |||
public HttpResponseHeaderModel? Header { get; set; } | |||
public HttpResponseBodyModel? Body { get; set; } | |||
public HttpResponseHeaderModel? header { get; set; } | |||
public HttpResponseBodyModel? body { get; set; } | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.AGV.Feedback; | |||
using BPASmartClient.AGV; | |||
using BPASmartClient.AGV.Feedback; | |||
using Microsoft.AspNetCore.Mvc; | |||
using Microsoft.AspNetCore.SignalR; | |||
using Newtonsoft.Json; | |||
@@ -28,28 +29,32 @@ namespace BPASmartClient.AgvApi.Controllers | |||
{ | |||
string body = await reader.ReadToEndAsync(); | |||
AGVToUpSystem s = JsonConvert.DeserializeObject<AGVToUpSystem>(body); | |||
if (s != null) | |||
var res = JsonConvert.DeserializeObject<TaskData>(body); | |||
var r = res.body.@event; | |||
if (r != null) | |||
{ | |||
await Factory.GetInstance.SendReport(s); | |||
return "SUCCESS"; | |||
await Factory.GetInstance.SendReport(r); | |||
return "Report SUCCESS"; | |||
} | |||
} | |||
//var res = JsonConvert.DeserializeObject<AGVToUpSystem>(sign); | |||
//if (res != null) | |||
//{ | |||
// Factory.GetInstance.SendReport(res); | |||
// return "SUCCESS"; | |||
//} | |||
} | |||
catch (Exception ex) | |||
{ | |||
return ex.ToString(); | |||
} | |||
//var res = JsonConvert.DeserializeObject<AGVToUpSystem>(sign); | |||
// if (res != null) | |||
// { | |||
// Factory.GetInstance.SendReport(res); | |||
// return "SUCCESS"; | |||
// } | |||
//} | |||
// } | |||
//} | |||
return "Error"; | |||
} | |||
/// <summary> | |||
@@ -67,21 +72,32 @@ namespace BPASmartClient.AgvApi.Controllers | |||
using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8)) | |||
{ | |||
string body = await reader.ReadToEndAsync(); | |||
var res = JsonConvert.DeserializeObject<Upstreamrequest>(body); | |||
if (res != null) | |||
var res = JsonConvert.DeserializeObject<LoadRequest>(body); | |||
var r = res.body.@event; | |||
if (r != null) | |||
{ | |||
await Factory.GetInstance.SendUpstreamrequest(res); | |||
return "SUCCESS"; | |||
await Factory.GetInstance.SendUpstreamrequest(r); | |||
//return "UpStream SUCCESS"; | |||
return JsonConvert.SerializeObject(new HttpResponseModel() { header = new HttpResponseHeaderModel { requestId = res.header.requestId,timestamp=DateTime.Now.ToString(),version="2.7" } ,body = new HttpResponseBodyModel() { success = true, code = "SUCCESS", message = "", data = null } }); | |||
} | |||
} | |||
//var res = JsonConvert.DeserializeObject<Upstreamrequest>(sign); | |||
//if (res != null) | |||
//{ | |||
// Factory.GetInstance.SendUpstreamrequest(res); | |||
// return "SUCCESS"; | |||
//} | |||
} | |||
catch (Exception ex) | |||
{ | |||
return ex.ToString(); | |||
} | |||
// } | |||
//} | |||
return "Error"; | |||
} | |||
} | |||
@@ -1,4 +1,6 @@ | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
@@ -85,7 +85,6 @@ namespace BPASmartClient.Modbus | |||
try | |||
{ | |||
tcpClient = new TcpClient(IPAdress, Port); | |||
//mre.Reset(); | |||
//tcpClient.BeginConnect(IPAdress, Port, (res) => { mre.Set(); }, null); | |||
//if (!mre.WaitOne(1500, false)) break; | |||
@@ -117,6 +116,7 @@ namespace BPASmartClient.Modbus | |||
if (address == null) return -1; | |||
if (address.Length > 0) | |||
{ | |||
address = address.Trim(); | |||
if (address.ToUpper().Contains("M") && address.Length >= 4) | |||
{ | |||
var res = address.Substring(1).Split('.'); | |||
@@ -5,15 +5,25 @@ | |||
<!--请求报文头--> | |||
<add key="appKey" value="0123456789abcdef"/> | |||
<add key="appSecret" value="0123456789abcdef"/> | |||
<add key ="version" value="2.9"/> | |||
<add key="warehouseId" value=""/> | |||
<add key="jobPriority" value=""/> | |||
<add key="jobPriorityType" value=""/> | |||
<add key ="version" value="2.7"/> | |||
<add key="warehouseId" value="1"/> | |||
<add key="jobPriority" value="1"/> | |||
<add key="jobPriorityType" value="1"/> | |||
<add key="jobType" value="POINT_ROLLER_MOVE"/> | |||
<add key="autoLoad" value="true"/> | |||
<add key="enableIOLoad" value="false"/> | |||
<add key="autoUnload" value="true"/> | |||
<add key="enableIOUnload" value="false"/> | |||
<add key="LineOnePoint" value="sTEwzw"/> | |||
<add key="LineTwoPoint" value="PChS6R"/> | |||
<add key="LineThreePoint" value="HHif8Z"/> | |||
<add key="LineFourPoint" value="w2jZhM"/> | |||
<add key="FryPotOnePoint" value="DXDnMJ"/> | |||
<add key="FryPotTwoPoint" value="CDPGde"/> | |||
<add key="FryPotThreePoint" value="biZG87"/> | |||
<add key="FryPotFourPoint" value="naFssQ"/> | |||
<add key="FryPotFivePoint" value="sxSX88"/> | |||
<add key="CleanPoint" value="TitRYC"/> | |||
</appSettings> | |||
<!--请求报文体--> | |||
</configuration> |
@@ -14,6 +14,7 @@ using System.Configuration; | |||
using System.Data; | |||
using System.IO; | |||
using System.Linq; | |||
using System.Net.Sockets; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
@@ -31,7 +32,6 @@ namespace FryPot_DosingSystem | |||
SystemHelper.GetInstance.CreateDesktopShortcut(); | |||
MenuInite(); | |||
LoginDataInite(); | |||
MainView mv = new MainView(); | |||
LoginView lv = new LoginView(); | |||
var res = lv.ShowDialog(); | |||
@@ -39,11 +39,17 @@ namespace FryPot_DosingSystem | |||
{ | |||
mv.Show(); | |||
MessageLog.GetInstance.ShowUserLog("用户登录"); | |||
await Task.Run(()=> { DeviceOperate deviceOperate = DeviceOperate.GetInstance; });//开启实时PLC数据读取 | |||
try | |||
{ | |||
await Task.Run(() => { DeviceOperate deviceOperate = DeviceOperate.GetInstance; }); | |||
} | |||
catch (Exception) | |||
{ | |||
MessageLog.GetInstance.ShowRunLog("下位机PLC连接失败,请检查无误后重启上位机"); | |||
} | |||
//开启实时PLC数据读取 | |||
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | |||
HubHelper.GetInstance.Connect("192.168.1.20", 8089); | |||
HubHelper.GetInstance.Connect("172.16.12.100", 8089); | |||
AlarmHelper<AlarmInfo>.Init();//报警实时监控 | |||
} | |||
else | |||
@@ -73,7 +79,7 @@ namespace FryPot_DosingSystem | |||
} | |||
private void MenuInite() | |||
{ | |||
NfcServer.GetInstance.Init(); | |||
// NfcServer.GetInstance.Init(); //NFC刷卡 | |||
#region 配方管理菜单 | |||
ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>(); | |||
RecipeManage.Add(new SubMenumodel() | |||
@@ -181,11 +181,11 @@ namespace FryPot_DosingSystem.Control | |||
switch (DeviceName) | |||
{ | |||
case "滚筒输送线": modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("滚筒线PLC连接成功"); break; | |||
case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break; | |||
case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break; | |||
case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break; | |||
case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); break; | |||
case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); break; | |||
//case "炒锅1": fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("1号炒锅PLC连接成功"); break; | |||
//case "炒锅2": fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("2号炒锅PLC连接成功"); break; | |||
//case "炒锅3": fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("3号炒锅PLC连接成功"); break; | |||
//case "炒锅4": fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("4号炒锅PLC连接成功"); break; | |||
//case "炒锅5": fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); MessageLog.GetInstance.ShowRunLog("5号炒锅PLC连接成功"); break; | |||
} | |||
} | |||
@@ -294,6 +294,8 @@ namespace FryPot_DosingSystem.Control | |||
/// 线体1流程控制互锁信号 | |||
/// </summary> | |||
public bool NextStart { get; set; } | |||
} | |||
/// <summary> | |||
/// 滚筒线2相关变量 | |||
@@ -28,12 +28,12 @@ namespace FryPot_DosingSystem.Model | |||
/// 炒制速度 | |||
/// </summary> | |||
public double FrySpeed { get { return _frySpeed; }set { _frySpeed = value;OnPropertyChanged(); } } | |||
private double _frySpeed; | |||
/// <summary> | |||
/// 炒制重量 | |||
/// </summary> | |||
public double FryWeight { get { return _fryMaterialWeight; }set { _fryMaterialWeight = value;OnPropertyChanged(); } } | |||
private double _fryMaterialWeight; | |||
private double _frySpeed; | |||
///// <summary> | |||
///// 炒制重量 | |||
///// </summary> | |||
//public double FryWeight { get { return _fryMaterialWeight; } set { _fryMaterialWeight = value; OnPropertyChanged(); } } | |||
//private double _fryMaterialWeight; | |||
/// <summary> | |||
/// 炒制温度 | |||
/// </summary> | |||
@@ -43,6 +43,17 @@ namespace FryPot_DosingSystem.Model | |||
/// 炒制时间 | |||
/// </summary> | |||
public double FryPeriodTime { get { return _fryPeriodTime; } set { _fryPeriodTime = value;OnPropertyChanged(); } } | |||
private double _fryPeriodTime; | |||
private double _fryPeriodTime; | |||
/// <summary> | |||
/// 炒制火力 | |||
/// </summary> | |||
public double FryFire { get { return _fryFire; } set { _fryFire = value; OnPropertyChanged(); } } | |||
private double _fryFire; | |||
/// <summary> | |||
/// 火力比例 | |||
/// </summary> | |||
public double FryFirePercent { get { return _fryFirePercent; } set { _fryFirePercent = value; OnPropertyChanged(); } } | |||
private double _fryFirePercent; | |||
} | |||
} |
@@ -42,13 +42,28 @@ | |||
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneRecipeComSignal}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button> | |||
<Button Content="AGV接口调试" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/> | |||
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/> | |||
</WrapPanel> | |||
</WrapPanel> | |||
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> | |||
<Button Content="线体1到炒锅1" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/> | |||
<Button Content="线体1到炒锅4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click"/> | |||
<Button Content="线体2到炒锅2" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_1"/> | |||
<Button Content="线体2到炒锅5" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_2"/> | |||
<Button Content="线体3到炒锅3" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_3"/> | |||
<Button Content="炒锅1到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_4"/> | |||
<Button Content="炒锅2到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_5"/> | |||
<Button Content="炒锅3到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_6"/> | |||
<Button Content="炒锅4到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_7"/> | |||
<Button Content="炒锅5到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_8"/> | |||
<Button Content="线体1到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_9"/> | |||
<Button Content="线体2到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_10"/> | |||
<Button Content="线体3到清洗" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_11"/> | |||
<Button Content="清洗到线体4" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Click="Button_Click_12"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.AGV; | |||
using BPASmartClient.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
@@ -25,7 +26,7 @@ namespace FryPot_DosingSystem.View | |||
{ | |||
InitializeComponent(); | |||
} | |||
string taskId = string.Empty; | |||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | |||
{ | |||
if (sender is ComboBox cbo) | |||
@@ -58,5 +59,74 @@ namespace FryPot_DosingSystem.View | |||
} | |||
} | |||
} | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvFromLineOneToFryFourLoadRoller(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_1(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvToLineTwoLoadRoller(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_2(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvFromLineTwoToFryFiveLoadRoller(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_3(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvToLineThreeLoadRoller(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_4(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveFryPotOne(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_5(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveFryPotTwo(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_6(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveFryPotThree(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_7(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveFryPotFour(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_8(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveFryPotFive(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_9(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveLOneToClean(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_10(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveLTwoToClean(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_11(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvLeaveLThreeToClean(Guid.NewGuid().ToString("D")); | |||
} | |||
private void Button_Click_12(object sender, RoutedEventArgs e) | |||
{ | |||
AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(Guid.NewGuid().ToString("D")); | |||
} | |||
} | |||
} |
@@ -7,7 +7,7 @@ | |||
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" | |||
xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" | |||
mc:Ignorable="d" | |||
Title="FlowProcessView" Height="550" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True"> | |||
Title="FlowProcessView" Height="650" Width="940" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True"> | |||
<Window.DataContext> | |||
<vm:FlowProcessSetViewModel/> | |||
</Window.DataContext> | |||
@@ -414,18 +414,23 @@ | |||
<ColumnDefinition Width="140"/> | |||
<ColumnDefinition Width="140"/> | |||
<ColumnDefinition Width="140"/> | |||
<ColumnDefinition Width="140"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="工艺步骤" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="1" Text="炒制原料/桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="1" Text="原料/桶号设定" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="1" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="2" Text="炒制速度" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="2" Text="速度设定" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<!--<GridSplitter Grid.Column="2" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="3" Text="重量设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"></TextBlock>--> | |||
<GridSplitter Grid.Column="2" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="3" Text="炒制重量" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"></TextBlock> | |||
<TextBlock Grid.Column="3" Text="温度设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="3" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="4" Text="炒制温度" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="4" Text="时间设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="4" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="5" Text="炒制时间" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<TextBlock Grid.Column="5" Text="火力设定" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
<GridSplitter Grid.Column="5" BorderThickness="0.2" BorderBrush="White"></GridSplitter> | |||
<TextBlock Grid.Column="6" Text="火力比例" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/> | |||
</Grid> | |||
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl x:Name="itemcontrols" AlternationCount="{Binding flowProcessModels.Count}" ItemsSource="{Binding flowProcessModels}" Margin="0,1,0,-1"> | |||
@@ -441,9 +446,27 @@ | |||
RelativeSource TemplatedParent}}" Foreground="SkyBlue" Width="100" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Background="Transparent" BorderBrush="#FF2AB2E7" BorderThickness="1,1,0.5,1"/> | |||
<ComboBox ItemsSource="{Binding DataContext.FlowItems, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" Text="{Binding FryMaterialNum}" Style="{StaticResource BaseComboBoxStyle}" IsReadOnly="True" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/> | |||
<TextBox Text="{Binding FrySpeed}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/> | |||
<TextBox Text="{Binding FryWeight}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/> | |||
<!--<TextBox Text="{Binding FryWeight}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>--> | |||
<TextBox Text="{Binding FryTemperature}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/> | |||
<TextBox Text="{Binding FryPeriodTime}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1"/> | |||
<TextBox Text="{Binding FryFire}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1"/> | |||
<TextBox FontSize="18" > | |||
<TextBox.Template> | |||
<ControlTemplate> | |||
<Border Width="140" Height="40" BorderThickness="0.5,1,1,1" BorderBrush="#FF2AB2E7"> | |||
<StackPanel Orientation="Horizontal"> | |||
<TextBox Width="100" Height="40" VerticalAlignment="Center" BorderThickness="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" Padding="0,0,22,0" BorderBrush="Transparent" HorizontalAlignment="Center" Background="Transparent" Foreground="SkyBlue" Text="{Binding FryFirePercent}"/> | |||
<TextBlock Text="%" HorizontalAlignment="Right" Foreground="SkyBlue" VerticalAlignment="Center"/> | |||
</StackPanel> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</TextBox.Template> | |||
</TextBox> | |||
</StackPanel> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
@@ -1,4 +1,6 @@ | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Model; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
@@ -54,6 +56,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
Json<DeviceManage>.Data.Devices = devices; | |||
Json<DeviceManage>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"IP设置成功!"); | |||
}); | |||
} | |||
@@ -1,4 +1,7 @@ | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Model; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using System; | |||
@@ -7,6 +10,7 @@ using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
@@ -57,12 +61,12 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
foreach (var item in recipe.materialCollection) | |||
{ | |||
if (!FlowItems.Contains(item.MaterialName)) | |||
FlowItems.Insert(0, item.MaterialName);//下拉框 | |||
if (!FlowItems.Contains(item.MaterialLoc.ToString())) | |||
FlowItems.Add(item.MaterialLoc.ToString());//下拉框 | |||
} | |||
foreach (var item in recipe.FlowProcess.fpModels) | |||
{ | |||
flowProcessModels.Add(new FlowProcessModel {FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime }); | |||
flowProcessModels.Add(new FlowProcessModel {FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime ,FryFire=item.FryFire,FryFirePercent=item.FryFirePercent}); | |||
} | |||
// ActionManage.GetInstance.Send("MaterialNum", recipe.materialCollection.Count); | |||
@@ -77,8 +81,8 @@ namespace FryPot_DosingSystem.ViewModel | |||
foreach (var item in name.materialCollection) | |||
{ | |||
if (!FlowItems.Contains(item.MaterialName)) | |||
FlowItems.Insert(0, item.MaterialName);//下拉框 | |||
if (!FlowItems.Contains(item.MaterialLoc.ToString())) | |||
FlowItems.Add( item.MaterialLoc.ToString());//下拉框 | |||
} | |||
ActionManage.GetInstance.Send("MaterialNum", name.materialCollection.Count); | |||
name.FlowProcess.fpModels = flowProcessModels; | |||
@@ -99,21 +103,32 @@ namespace FryPot_DosingSystem.ViewModel | |||
if (name != null) | |||
{ | |||
name.FlowProcess.RecipeName = currentRecipeName.ToString(); | |||
//工艺桶号重复性检测 | |||
foreach (var item in name.materialCollection) | |||
{ | |||
var res = flowProcessModels.Where(p => p.FryMaterialNum == item.MaterialLoc.ToString()); | |||
if (res.Count() > 1) | |||
{ | |||
// NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"保存失败,桶号重复!"); | |||
MessageLog.GetInstance.ShowUserLog("保存失败,桶号重复"); | |||
MessageBox.Show("保存失败,桶号重复","提示",MessageBoxButton.OK,MessageBoxImage.Error); | |||
return; | |||
} | |||
} | |||
// name.FlowProcess.fpModels = flowProcessModels; | |||
name.FlowProcess.fpModels.Clear(); | |||
foreach (var item in flowProcessModels) | |||
{ | |||
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime }); | |||
name.FlowProcess.fpModels.Add(new FlowProcessModel { FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime,FryFire=item.FryFire,FryFirePercent=item.FryFirePercent }); | |||
} | |||
foreach (var item in name.materialCollection) | |||
{ | |||
string s= Json<FlowProcessNames>.Data.Names.FirstOrDefault(p=>p == item.MaterialName); | |||
string s= Json<FlowProcessNames>.Data.Names.FirstOrDefault(p=>p == item.MaterialLoc.ToString()); | |||
Json<FlowProcessNames>.Data.Names.Remove(s); | |||
} | |||
} | |||
Json<RecipeManage>.Save(); | |||
Json<FlowProcessNames>.Save(); | |||
ActionManage.GetInstance.Send("CloseFlowProcessView"); | |||
}); | |||
@@ -34,6 +34,7 @@ | |||
this.button3 = new System.Windows.Forms.Button(); | |||
this.button4 = new System.Windows.Forms.Button(); | |||
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); | |||
this.button5 = new System.Windows.Forms.Button(); | |||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); | |||
this.splitContainer1.SuspendLayout(); | |||
this.SuspendLayout(); | |||
@@ -95,11 +96,22 @@ | |||
this.splitContainer1.SplitterDistance = 45; | |||
this.splitContainer1.TabIndex = 5; | |||
// | |||
// button5 | |||
// | |||
this.button5.Location = new System.Drawing.Point(301, 13); | |||
this.button5.Name = "button5"; | |||
this.button5.Size = new System.Drawing.Size(82, 40); | |||
this.button5.TabIndex = 6; | |||
this.button5.Text = "写文件"; | |||
this.button5.UseVisualStyleBackColor = true; | |||
this.button5.Click += new System.EventHandler(this.button5_Click); | |||
// | |||
// Form1 | |||
// | |||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); | |||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
this.ClientSize = new System.Drawing.Size(641, 298); | |||
this.Controls.Add(this.button5); | |||
this.Controls.Add(this.splitContainer1); | |||
this.Controls.Add(this.button4); | |||
this.Controls.Add(this.button3); | |||
@@ -123,5 +135,6 @@ | |||
private Button button3; | |||
private Button button4; | |||
private SplitContainer splitContainer1; | |||
private Button button5; | |||
} | |||
} |
@@ -14,50 +14,63 @@ namespace TestDemo | |||
{ | |||
InitializeComponent(); | |||
ActionManage.GetInstance.Register(new Action(() => | |||
{ | |||
label1.Text = (count++).ToString(); | |||
}), "加数值"); | |||
//ActionManage.GetInstance.Register(new Action(() => | |||
//{ | |||
// label1.Text = (count++).ToString(); | |||
//}), \"加数值\"); | |||
ActionManage.GetInstance.Register(new Action(() => | |||
{ | |||
Console.WriteLine("开始执行阻塞方法"); | |||
Thread.Sleep(20000); | |||
Console.WriteLine("阻塞方法执行完成"); | |||
}), "阻塞方法"); | |||
//ActionManage.GetInstance.Register(new Action(() => | |||
//{ | |||
// Console.WriteLine(\"开始执行阻塞方法\"); | |||
// Thread.Sleep(20000); | |||
// Console.WriteLine(\"阻塞方法执行完成\"); | |||
//}), \"阻塞方法\"); | |||
} | |||
private void button1_Click(object sender, EventArgs e) | |||
{ | |||
AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); | |||
//AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); | |||
//string value = JsonConvert.SerializeObject(aGVToUpSystem); | |||
//string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/report?sign={value}"; | |||
string url = "http://192.168.1.40:8089/apicallback/quicktron/robotjob/report"; | |||
var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); | |||
////string url = $\"http://172.16.11.118:8089/apicallback/quicktron/robotjob/report?sign={value}\"; | |||
//string url = \"http://172.16.11.118:8089/apicallback/quicktron/robotjob/report\"; | |||
//var res = APIHelper.GetInstance.HttpRequest(url, \"\", aGVToUpSystem, RequestType.POST); | |||
} | |||
private void button2_Click(object sender, EventArgs e) | |||
{ | |||
Upstreamrequest aGVToUpSystem = new Upstreamrequest() { agvCode="123" }; | |||
// string value = JsonConvert.SerializeObject(aGVToUpSystem); | |||
// string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}"; | |||
string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/upstreamrequest"; | |||
var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); | |||
//Upstreamrequest aGVToUpSystem = new Upstreamrequest() { agvCode=\"ZT11\" }; | |||
//string value = JsonConvert.SerializeObject(aGVToUpSystem); | |||
////string url = $\"http://172.16.11.118:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}\"; | |||
//string url = $\"http://172.16.11.118:8089/apicallback/quicktron/robotjob/upstreamrequest\"; | |||
//var res = APIHelper.GetInstance.HttpRequest(url, \"\", aGVToUpSystem, RequestType.POST); | |||
} | |||
private void button3_Click(object sender, EventArgs e) | |||
{ | |||
ActionManage.GetInstance.Send("加数值"); | |||
//ActionManage.GetInstance.Send(\"加数值\"); | |||
} | |||
private void button4_Click(object sender, EventArgs e) | |||
{ | |||
Task.Run(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("阻塞方法"); | |||
// ActionManage.GetInstance.Send(\"阻塞方法\"); | |||
})); | |||
} | |||
private void button5_Click(object sender, EventArgs e) | |||
{ | |||
//string body =\" { \\"header\\":{ \\"requestId\\":\\"05c1124b4ec443329bbf8da7d2aba5f2\\",\\"timestamp\\":\\"2022-10-19 12:27:27\\",\\"version\\":\\"2.7\\"},\\"body\\":{ \\"event\\":{ \\"agvCode\\":\\"ZT11-21\\",\\"command\\":\\"LOAD\\",\\"containerCode\\":\\"24fefca64b65f2a\\",\\"equipmentId\\":0,\\"jobId\\":\\"SIRoller_166615364143003483\\",\\"msgId\\":\\"1666153642429\\"},\\"ts\\":1666153642429,\\"type\\":\\"REQUEST_DEVICE\\",\\"warehouseId\\":1,\\"zoneCode\\":\\"zone\\"} }\"; | |||
string body =" { \"header\":{ \"requestId\":\"471d848e19ed4696858f72c25415f0e8\",\"timestamp\":\"2022-10-19 17:29:27\",\"version\":\"2.7\"},\"body\":{ \"event\":{ \"jobData\":{ \"agvCode\":\"ZT11-24\",\"containerCode\":\"24ff16fcb707a86\",\"pointCode\":\"sxSX88\",\"startPointCode\":\"sxSX88\",\"targetPointCode\":\"naFssQ\"},\"jobId\":\"SIBucket_166617173650007811\",\"jobType\":\"POINT_ROLLER_MOVE\",\"robotJobId\":\"c981a984-91bc-4f94-9685-3a8a36629457\",\"state\":\"ROLLER_LOAD_DOING\",\"warehouseId\":1},\"id\":\"18717ed5-9e79-4f73-a6ea-176e50792696\",\"ts\":1666171767233,\"type\":\"JobReportEvent\",\"warehouseId\":1,\"zoneCode\":\"kckq\"} }"; | |||
var res = JsonConvert.DeserializeObject<TaskData>(body); | |||
var r = res.body.@event; | |||
} | |||
} | |||
} |