@@ -76,46 +76,46 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvToLineOneLoadRoller(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId =robotJobId ;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
// string newBody = String.Join(",\r\n", bodyData.Split(','));//格式处理,看需求 | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId =robotJobId ;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
//// string newBody = String.Join(",\r\n", bodyData.Split(','));//格式处理,看需求 | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -124,45 +124,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvToLineTwoLoadRoller(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data= HttpRequest(url, head, body); | |||
object objData= JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -171,45 +171,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvToLineThreeLoadRoller(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -218,45 +218,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvLeaveFryPotOne(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -265,45 +265,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvLeaveFryPotTwo(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -312,45 +312,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvLeaveFryPotThree(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -359,45 +359,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvLeaveFryPotFour(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -406,45 +406,45 @@ namespace BPASmartClient.AGV | |||
/// <returns></returns> | |||
public string AgvLeaveFryPotFive(string robotJobId) | |||
{ | |||
string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
//请求报文头 | |||
HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
//请求报文体 | |||
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
//详细任务数据 | |||
//点到点 | |||
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//货位到货位 | |||
//AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
//AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
//string url = AGVRequestUrl.GetInstance.TaskSendUrl; | |||
////请求报文头 | |||
//HttpRequestHeaderModel.GetInstance.appKey = ""; | |||
//HttpRequestHeaderModel.GetInstance.appSecret = ""; | |||
//HttpRequestHeaderModel.GetInstance.requestId = ""; | |||
//HttpRequestHeaderModel.GetInstance.timestamp = ""; | |||
//HttpRequestHeaderModel.GetInstance.version = "2.8"; | |||
//string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance); | |||
////请求报文体 | |||
//AGVModel.GetInstance.robotJobId = robotJobId;//上游提供 | |||
//AGVModel.GetInstance.warehouseId = 123; //仓库编号 | |||
//AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级 | |||
//AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行 | |||
//AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE | |||
////详细任务数据 | |||
////点到点 | |||
//AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位 | |||
//AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位 | |||
//AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互 | |||
//AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
//AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互 | |||
//AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance; | |||
//string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
string data = HttpRequest(url, head, body); | |||
object objData = JsonConvert.DeserializeObject(data); | |||
if (objData != null && objData is HttpResponseModel response) | |||
{ | |||
return response.Body?.code; | |||
} | |||
////货位到货位 | |||
////AGV_SlotRollerJobData.GetInstance.startSlotCode = "";//起点槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.endSlotCode = "";//目的槽位编号 | |||
////AGV_SlotRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOLoad=true;//上料交互方式 false:接口交互 true:光电交互 | |||
////AGV_SlotRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料 | |||
////AGV_SlotRollerJobData.GetInstance.enableIOUnload=true;//下料交互方式 false:接口交互 true:光电交互 | |||
////AGVModel.GetInstance.jobData = AGV_SlotRollerJobData.GetInstance; | |||
////string body = JsonConvert.SerializeObject(AGVModel.GetInstance); | |||
//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> | |||
@@ -0,0 +1,12 @@ | |||
{ | |||
"version": 1, | |||
"isRoot": true, | |||
"tools": { | |||
"dotnet-ef": { | |||
"version": "6.0.6", | |||
"commands": [ | |||
"dotnet-ef" | |||
] | |||
} | |||
} | |||
} |
@@ -4,12 +4,10 @@ using BPASmartClient.Model; | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
using System.Collections.ObjectModel; | |||
using System.Windows; | |||
namespace BPASmartClient.CustomResource.Pages.Model | |||
@@ -39,7 +37,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
{ | |||
bool value = Convert.ToBoolean(Alarm.GetType().GetProperty(item.Name)?.GetValue(Alarm)); | |||
EdgeAlarm(value, AlarmModel.AlarmInfo, 1, AlarmModel.AlarmLevel, AlarmModel.AlarmType); | |||
} | |||
} | |||
} | |||
} | |||
Thread.Sleep(100); | |||
@@ -59,7 +57,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
if (!delays.ContainsKey(text)) delays.TryAdd(text, Delay.GetInstance(text)); | |||
if (edgeType == AlarmTriggerType.Rising ? delays[text].Start(Trigger, delay) : delays[text].Start(!Trigger, delay)) | |||
{ | |||
if (edgeType == AlarmTriggerType.Rising ? !flagbit[text] : flagbit[text]) | |||
if (edgeType == AlarmTriggerType.Rising ? !flagbit[text] :flagbit[text]) | |||
{ | |||
AddAlarm(Trigger, text, alarmLevel); | |||
flagbit[text] = edgeType == AlarmTriggerType.Rising ? true : false; | |||
@@ -0,0 +1,56 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.CustomResource.Pages.Model | |||
{ | |||
public class AlarmInfo | |||
{ | |||
public AlarmInfo() | |||
{ | |||
} | |||
/// <summary> | |||
/// 1 号滚筒线故障 | |||
/// </summary> | |||
[Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort LOneRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 2 号滚筒线故障 | |||
/// </summary> | |||
[Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort LTwoRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 3 号滚筒线故障 | |||
/// </summary> | |||
[Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort LThreeRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 1 号炒锅滚筒运行故障 | |||
/// </summary> | |||
[Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort FryPotOneRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 2 号炒锅滚筒运行故障 | |||
/// </summary> | |||
[Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort FryPotTwoRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 3 号炒锅滚筒运行故障 | |||
/// </summary> | |||
[Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort FryPotThreeRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 4 号炒锅滚筒运行故障 | |||
/// </summary> | |||
[Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort FryPotFourRollerTrouble { get; set; } | |||
/// <summary> | |||
/// 5 号炒锅滚筒运行故障 | |||
/// </summary> | |||
[Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)] | |||
public ushort FryPotFiveRollerTrouble { get; set; } | |||
} | |||
} |
@@ -12,7 +12,10 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
public class MessageLog | |||
{ | |||
private volatile static MessageLog _Instance; | |||
public static MessageLog GetInstance => _Instance ?? (_Instance = new MessageLog()); | |||
public static MessageLog GetInstance => _Instance ??= new MessageLog(); | |||
public static readonly object runLock = new object(); | |||
public static readonly object userlock = new object(); | |||
private MessageLog() { } | |||
public Action<string> UserLog { get; set; } | |||
@@ -37,30 +40,36 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||
public void ShowUserLog(string info) | |||
{ | |||
UserLog userLog = new UserLog() | |||
lock (userlock) | |||
{ | |||
Date = DateTime.Now.ToString("yyyy-MM-dd"), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
Permission = Global.userInfo.permission.ToString(), | |||
UserName = Global.userInfo.UserName, | |||
LogInfo = info | |||
}; | |||
Sqlite<UserLog>.GetInstance.Base.Add(userLog); | |||
Application.Current.Dispatcher.Invoke(new Action(() => { userLogs.Insert(0, userLog); })); | |||
UserLog?.Invoke(info); | |||
UserLog userLog = new UserLog() | |||
{ | |||
Date = DateTime.Now.ToString("yyyy-MM-dd"), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
Permission = Global.userInfo.permission.ToString(), | |||
UserName = Global.userInfo.UserName, | |||
LogInfo = info | |||
}; | |||
Sqlite<UserLog>.GetInstance.Base.Add(userLog); | |||
Application.Current.Dispatcher.Invoke(new Action(() => { userLogs.Insert(0, userLog); })); | |||
UserLog?.Invoke(info); | |||
} | |||
} | |||
public void ShowRunLog(string info) | |||
{ | |||
RunLog runLog = new RunLog() | |||
lock (runLock) | |||
{ | |||
Date = DateTime.Now.ToString("yyyy-MM-dd"), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
RunLogInfo = info | |||
}; | |||
Sqlite<RunLog>.GetInstance.Base.Add(runLog); | |||
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); | |||
RunLog?.Invoke(info); | |||
RunLog runLog = new RunLog() | |||
{ | |||
Date = DateTime.Now.ToString("yyyy-MM-dd"), | |||
Time = DateTime.Now.ToString("HH:mm:ss"), | |||
RunLogInfo = info | |||
}; | |||
Sqlite<RunLog>.GetInstance.Base.Add(runLog); | |||
Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); | |||
RunLog?.Invoke(info); | |||
} | |||
} | |||
@@ -9,8 +9,8 @@ using System.Collections.ObjectModel; | |||
using System.Windows; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.Model; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.Model; | |||
namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
{ | |||
@@ -26,7 +26,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
} | |||
if (ControlButText == "开始查询") | |||
{ | |||
var lists = Sqlite<Alarm>.GetInstance.GetData(); | |||
var lists = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.GetData(); | |||
var res = lists.Where(p => Convert.ToDateTime(p.Date) >= StartDateTime && Convert.ToDateTime(p.Date) <= EndDateTime).ToList(); | |||
if (res != null) | |||
{ | |||
@@ -64,13 +64,13 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
} | |||
}); | |||
//AlarmInfos = AlarmHelper<tt>.Alarms; | |||
//AlarmHelper<tt>.Init(); | |||
AlarmInfos = AlarmHelper<AlarmInfo>.Alarms; | |||
} | |||
private void GetHistoryAlarm() | |||
{ | |||
var data = Sqlite<Alarm>.GetInstance.GetData(); | |||
var data = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.GetData(); | |||
if (data != null) | |||
{ | |||
HistoryAlarm.Clear(); | |||
@@ -131,7 +131,6 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||
public ObservableCollection<Alarm> AlarmInfos { get; set; } | |||
public ObservableCollection<Alarm> HistoryAlarm { get; set; } = new ObservableCollection<Alarm>(); | |||
@@ -451,7 +451,7 @@ | |||
<Style x:Key="border碗" TargetType="Border"> | |||
<Style.Setters> | |||
<Setter Property="Height" Value="50"/> | |||
<Setter Property="Height" Value="34"/> | |||
<Setter Property="Width" Value="40"/> | |||
<Setter Property="VerticalAlignment" Value="Bottom"/> | |||
<Setter Property="Background"> | |||
@@ -464,9 +464,9 @@ | |||
<Style x:Key="border菜" TargetType="Border"> | |||
<Style.Setters> | |||
<Setter Property="Margin" Value="0,3,0,0"/> | |||
<Setter Property="Height" Value="25"/> | |||
<Setter Property="Width" Value="33"/> | |||
<Setter Property="Margin" Value="0,-7,0,0"/> | |||
<Setter Property="Height" Value="20"/> | |||
<Setter Property="Width" Value="28"/> | |||
<Setter Property="VerticalAlignment" Value="Top"/> | |||
<Setter Property="Background"> | |||
<Setter.Value> | |||
@@ -142,6 +142,22 @@ namespace BPASmartClient.Modbus | |||
return LwAddress; | |||
} | |||
} | |||
else if (address.ToUpper().Contains("D") && address.Length == 5) | |||
{ | |||
try | |||
{ | |||
string head = "4"+(Convert.ToInt32(address.Substring(1, 1)) - 1).ToString(); | |||
string tail = address.Substring(2, 3); | |||
address = head + tail; | |||
return Convert.ToInt32(address); | |||
} | |||
catch (Exception) | |||
{ | |||
//打印日志 | |||
} | |||
} | |||
} | |||
return -1; | |||
} | |||
@@ -171,7 +187,7 @@ namespace BPASmartClient.Modbus | |||
commandType = CommandType.Coils; | |||
return master.ReadCoils(slaveAddress, startAddress, len); | |||
} | |||
else if (address.ToUpper().Contains("VW") || address.ToUpper().Contains("LW")) | |||
else if (address.ToUpper().Contains("VW") || address.ToUpper().Contains("LW")|| address.ToUpper().Contains("D")) | |||
{ | |||
commandType = CommandType.HoldingRegisters; | |||
return master.ReadHoldingRegisters(slaveAddress, startAddress, len); | |||
@@ -181,6 +197,7 @@ namespace BPASmartClient.Modbus | |||
commandType = CommandType.Inputs; | |||
return master.ReadInputs(slaveAddress, startAddress, len); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -199,14 +216,15 @@ namespace BPASmartClient.Modbus | |||
{ | |||
try | |||
{ | |||
string head = (Convert.ToInt32(address.Substring(1, 1)) - 1).ToString(); | |||
string head = "4"+(Convert.ToInt32(address.Substring(1, 1)) - 1).ToString(); | |||
string tail = address.Substring(2, 3); | |||
address = head + tail; | |||
address = head + tail; | |||
return Convert.ToInt32(address); | |||
} | |||
catch (Exception) | |||
{ | |||
//打印日志 | |||
return -1; | |||
} | |||
} | |||
@@ -276,7 +294,7 @@ namespace BPASmartClient.Modbus | |||
else if (value is bool[] boolsValue) | |||
master.WriteMultipleCoils(slaveAddress, startAddress, boolsValue); | |||
} | |||
else if (address.ToUpper().Contains("VW") || address.ToUpper().Contains("LW")) | |||
else if (address.ToUpper().Contains("VW") || address.ToUpper().Contains("LW")|| address.ToUpper().Contains("D")) | |||
{ | |||
commandType = CommandType.HoldingRegisters; | |||
if (value is ushort ushortValue) | |||
@@ -0,0 +1,73 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace FryPot_DosingSystem.AGV | |||
{ | |||
/// <summary> | |||
/// 控制车辆型号 | |||
/// </summary> | |||
public enum WhichCart | |||
{ | |||
一号车, | |||
二号车, | |||
三号车, | |||
四号车, | |||
} | |||
/// <summary> | |||
/// 控制车辆运动方式 | |||
/// </summary> | |||
public enum CartMotionTrajectory | |||
{ | |||
Stop,//停止 | |||
qc_1,//取菜品 1号流水线取菜 | |||
qc_2,//取菜品 2号流水线取菜 | |||
qc_3,//取菜品 3号流水线取菜 | |||
yc_1_1,//运输菜品 1号流水线-1号炒锅 | |||
yc_1_2,//运输菜品 1号流水线-2号炒锅 | |||
yc_1_3,//运输菜品 1号流水线-3号炒锅 | |||
yc_1_4,//运输菜品 1号流水线-4号炒锅 | |||
yc_1_5,//运输菜品 1号流水线-5号炒锅 | |||
yc_2_1,//运输菜品 2号流水线-1号炒锅 | |||
yc_2_2,//运输菜品 2号流水线-2号炒锅 | |||
yc_2_3,//运输菜品 2号流水线-3号炒锅 | |||
yc_2_4,//运输菜品 2号流水线-4号炒锅 | |||
yc_2_5,//运输菜品 2号流水线-5号炒锅 | |||
yc_3_1,//运输菜品 3号流水线-1号炒锅 | |||
yc_3_2,//运输菜品 3号流水线-2号炒锅 | |||
yc_3_3,//运输菜品 3号流水线-3号炒锅 | |||
yc_3_4,//运输菜品 3号流水线-4号炒锅 | |||
yc_3_5,//运输菜品 3号流水线-5号炒锅 | |||
hs_1,//1号炒锅-运输空碗到-空碗流水线 | |||
hs_2,//2号炒锅-运输空碗到-空碗流水线 | |||
hs_3,//3号炒锅-运输空碗到-空碗流水线 | |||
hs_4,//4号炒锅-运输空碗到-空碗流水线 | |||
hj,//空碗流水线-回到充电桩或者停车桩 | |||
} | |||
/// <summary> | |||
/// 是否 | |||
/// </summary> | |||
public enum IsBool | |||
{ | |||
Yes, | |||
No | |||
} | |||
/// <summary> | |||
/// 是否运行 | |||
/// </summary> | |||
public enum IsRun | |||
{ | |||
Start, | |||
Stop | |||
} | |||
} |
@@ -15,6 +15,7 @@ using System.Data; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using AlarmInfo = BPASmartClient.CustomResource.Pages.Model.AlarmInfo; | |||
namespace FryPot_DosingSystem | |||
{ | |||
@@ -37,23 +38,25 @@ namespace FryPot_DosingSystem | |||
mv.Show(); | |||
DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 | |||
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | |||
HubHelper.GetInstance.Connect("192.168.1.130", 8089); | |||
AlarmHelper<AlarmInfo>.Init(); | |||
} | |||
else | |||
mv.Close(); | |||
HubHelper.GetInstance.Report = new Action<object>((o) => | |||
{ | |||
var res = JsonConvert.DeserializeObject<AGVToUpSystem>(o.ToString()); | |||
}); | |||
//HubHelper.GetInstance.Report = new Action<object>((o) => | |||
//{ | |||
// var res = JsonConvert.DeserializeObject<AGVToUpSystem>(o.ToString()); | |||
//}); | |||
HubHelper.GetInstance.Upstreamrequest = new Action<object>((o) => | |||
{ | |||
var res = JsonConvert.DeserializeObject<Upstreamrequest>(o.ToString()); | |||
}); | |||
HubHelper.GetInstance.Connect("192.168.1.99", 8089); | |||
//HubHelper.GetInstance.Upstreamrequest = new Action<object>((o) => | |||
//{ | |||
// var res = JsonConvert.DeserializeObject<Upstreamrequest>(o.ToString()); | |||
//}); | |||
//本地服务连接 | |||
} | |||
protected override void OnExit(ExitEventArgs e) | |||
{ | |||
@@ -171,7 +174,7 @@ namespace FryPot_DosingSystem | |||
SubMenuName = "用户登录", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||
AssemblyName = "BPASmartClient.CustomResource", | |||
ToggleWindowPath = "Pages.View.LoginView" | |||
ToggleWindowPath = "Pages.View.SubPagLoginView" | |||
}); | |||
UserManager.Add(new SubMenumodel() | |||
@@ -192,6 +195,23 @@ namespace FryPot_DosingSystem | |||
subMenumodels = UserManager, | |||
}); | |||
#endregion | |||
ObservableCollection<SubMenumodel> DebugManage = new ObservableCollection<SubMenumodel>(); | |||
DebugManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "单一流程调试", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "FryPot_DosingSystem", | |||
ToggleWindowPath = "View.DebugView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
MainMenuName = "调试界面", | |||
Alias = "Debug Management", | |||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||
subMenumodels = DebugManage, | |||
}); | |||
} | |||
private void LoginDataInite() | |||
{ | |||
@@ -20,7 +20,7 @@ namespace FryPot_DosingSystem.Control | |||
ModbusTcp modbus = new ModbusTcp(); | |||
private string Ip { get; set; } | |||
private string Port { get; set; } | |||
private bool Connected { get; set; } | |||
public bool Connected { get; set; } | |||
private string DeviceName { get; set; } | |||
@@ -78,7 +78,7 @@ namespace FryPot_DosingSystem.Control | |||
{ | |||
foreach (var item in Variables) | |||
{ | |||
var res = modbus.Read(item.Address, item.Length, "180项目"); | |||
var res = modbus.Read(item.Address, item.Length); | |||
if (Data.ContainsKey(item.Address)) | |||
{ | |||
Data[item.Address] = res; | |||
@@ -95,8 +95,11 @@ namespace FryPot_DosingSystem.Control | |||
}),$"设备【{DeviceName}】PLC实时数据读取线程"); | |||
} | |||
public void WritePlcData(string address,ushort value) | |||
{ | |||
modbus.Write(address, value,"180项目"); | |||
{ | |||
lock (this) | |||
{ | |||
modbus.Write(address, value); | |||
} | |||
} | |||
public ConcurrentDictionary<string, object> GetAllData() | |||
{ | |||
@@ -11,6 +11,8 @@ namespace FryPot_DosingSystem.Control | |||
/// </summary> | |||
internal class GlobalVariable | |||
{ | |||
/// <summary> | |||
/// 滚筒线1 | |||
/// </summary> | |||
@@ -61,17 +63,57 @@ namespace FryPot_DosingSystem.Control | |||
/// </summary> | |||
public bool ExitMainTask { get; set; } | |||
/// <summary> | |||
/// 允许AGV去线体装桶条件 | |||
/// 允许AGV去线体1装桶条件 | |||
/// </summary> | |||
public bool AllowAgvToLineLoadRoller { get; set; } = true; | |||
/// <summary> | |||
/// 允许AGV去线体2装桶条件 | |||
/// </summary> | |||
public bool AllowAgvToLineTwoLoadRoller { get; set; } = true; | |||
/// <summary> | |||
/// 允许AGV去线体3装桶条件 | |||
/// </summary> | |||
public bool AllowAgvToLineThreeLoadRoller { get; set; } = true; | |||
/// <summary> | |||
/// 配方唯一ID | |||
/// </summary> | |||
public string RecipeId { get; set; } | |||
/// <summary> | |||
/// 进桶出桶互锁 | |||
/// 线体1对应的进桶出桶互锁 | |||
/// </summary> | |||
public bool InOrOutputLock { get; set; } | |||
/// <summary> | |||
/// 线体2对应的进桶出桶互锁 | |||
/// </summary> | |||
public bool LTwoInOrOutputLock { get; set; } | |||
/// <summary> | |||
/// 线体3对应的进桶出桶互锁 | |||
/// </summary> | |||
public bool LThreeInOrOutputLock { get; set; } | |||
/// <summary> | |||
/// 线体1任务执行锁 | |||
/// </summary> | |||
public bool LOneTaskLock { get; set; } | |||
/// <summary> | |||
/// 线体2任务执行锁 | |||
/// </summary> | |||
public bool LTwoTaskLock { get; set; } | |||
/// <summary> | |||
/// 线体3任务执行锁 | |||
/// </summary> | |||
public bool LThreeTaskLock { get; set; } | |||
/// <summary> | |||
/// 线体1当前正在制作的配方名称 | |||
/// </summary> | |||
public string LOneCurrentRecipeName { get; set; } = string.Empty; | |||
/// <summary> | |||
/// 线体2当前正在制作的配方名称 | |||
/// </summary> | |||
public string LTwoCurrentRecipeName { get; set; } = string.Empty; | |||
/// <summary> | |||
/// 线体3当前正在制作的配方名称 | |||
/// </summary> | |||
public string LThreeCurrentRecipeName { get; set; } = string.Empty; | |||
#endregion | |||
} | |||
@@ -0,0 +1,17 @@ | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace FryPot_DosingSystem.Model | |||
{ | |||
public class MaterialNames:ObservableObject | |||
{ | |||
private static MaterialNames _instance; | |||
public static MaterialNames GetInstance=>_instance ?? (_instance = new MaterialNames()); | |||
public ObservableCollection<string> Names { get; set; }=new ObservableCollection<string>(); | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using FryPot_DosingSystem.ViewModel; | |||
using FryPot_DosingSystem.AGV; | |||
using FryPot_DosingSystem.ViewModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
@@ -30,38 +31,42 @@ namespace FryPot_DosingSystem.View | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
AnimationByPath(yunshuche,qc_1); | |||
// AgvViewModel.GetInstance().cartModel_1.cartMotionTrajectory = CartMotionTrajectory.Stop; | |||
AgvViewModel.GetInstance().ParkingPileModel_1.isBool = IsBool.No; | |||
AgvViewModel.GetInstance().cartModel_1.isBool=IsBool.No; | |||
AgvViewModel.GetInstance().cartModel_1.cartMotionTrajectory = CartMotionTrajectory.qc_1; | |||
} | |||
/// <summary> | |||
/// 路径动画 | |||
/// </summary> | |||
/// <param name="cvs">画板</param> | |||
/// <param name="path">路径</param> | |||
/// <param name="target">动画对象</param> | |||
/// <param name="duration">时间</param> | |||
private void AnimationByPath(TextBox target, Path path, int duration = 5) | |||
private void Button_Click_1(object sender, RoutedEventArgs e) | |||
{ | |||
target.RenderTransformOrigin = new Point(0.5, 0.5); | |||
AgvViewModel.GetInstance().RollerLines_1.isRun = IsRun.Start; | |||
} | |||
MatrixTransform matrix = new MatrixTransform(); | |||
TransformGroup groups = new TransformGroup(); | |||
groups.Children.Add(matrix); | |||
target.RenderTransform = groups; | |||
string registname = "matrix" + Guid.NewGuid().ToString().Replace("-", ""); | |||
this.RegisterName(registname, matrix); | |||
MatrixAnimationUsingPath matrixAnimation = new MatrixAnimationUsingPath(); | |||
matrixAnimation.PathGeometry = PathGeometry.CreateFromGeometry(Geometry.Parse(path.Data.ToString())); | |||
matrixAnimation.Duration = new Duration(TimeSpan.FromSeconds(duration)); | |||
matrixAnimation.DoesRotateWithTangent = true;//跟随路径旋转 | |||
matrixAnimation.RepeatBehavior = RepeatBehavior.Forever;//循环 | |||
Storyboard story = new Storyboard(); | |||
story.Children.Add(matrixAnimation); | |||
Storyboard.SetTargetName(matrixAnimation, registname); | |||
Storyboard.SetTargetProperty(matrixAnimation, new PropertyPath(MatrixTransform.MatrixProperty)); | |||
private void StopButton_Click(object sender, RoutedEventArgs e) | |||
{ | |||
AgvViewModel.GetInstance().RollerLines_1.isRun = IsRun.Stop; | |||
AgvViewModel.GetInstance().cartModel_1.isBool = IsBool.Yes; | |||
AgvViewModel.GetInstance().cartModel_1.cartMotionTrajectory = CartMotionTrajectory.yc_1_1; | |||
} | |||
private void Button_Click_2(object sender, RoutedEventArgs e) | |||
{ | |||
AgvViewModel.GetInstance().cartModel_1.isBool = IsBool.No; | |||
AgvViewModel.GetInstance().cartModel_1.cartMotionTrajectory = CartMotionTrajectory.hs_1; | |||
} | |||
story.FillBehavior = FillBehavior.Stop; | |||
story.Begin(target, true); | |||
} | |||
private void Button_Click_3(object sender, RoutedEventArgs e) | |||
{ | |||
AgvViewModel.GetInstance().cartModel_1.cartMotionTrajectory = CartMotionTrajectory.hj; | |||
AgvViewModel.GetInstance().ParkingPileModel_1.isBool = IsBool.Yes; | |||
} | |||
private void Button_Click_4(object sender, RoutedEventArgs e) | |||
{ | |||
AgvViewModel.GetInstance().cartModel_1.cartMotionTrajectory = CartMotionTrajectory.Stop; | |||
} | |||
} | |||
} |
@@ -0,0 +1,96 @@ | |||
<UserControl x:Class="FryPot_DosingSystem.View.DebugView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:FryPot_DosingSystem.View" | |||
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800"> | |||
<UserControl.DataContext> | |||
<vm:DebugViewModel/> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<Style x:Key="buttonStyle" TargetType="Button"> | |||
<Setter Property="Width" Value="100"></Setter> | |||
<Setter Property="Height" Value="30"/> | |||
<Setter Property="Background" Value="Transparent"></Setter> | |||
<Setter Property="BorderThickness" Value="2"/> | |||
<Setter Property="BorderBrush" Value="Orange"/> | |||
<Setter Property="HorizontalContentAlignment" Value="Center"/> | |||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||
<Setter Property="Margin" Value="3,3"/> | |||
<Setter Property="Foreground" Value="SkyBlue"/> | |||
<Setter Property="FontSize" Value="13"/> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<UniformGrid Columns="2"> | |||
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineRunning}"></Button> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding LineOneRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotEmptyRollerArrive}"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体1上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLOneArrive}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotDownArrive}"> | |||
</Button> | |||
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotUpArrive}"/> | |||
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotGetEmptyRoller}"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
<UniformGrid Columns="2" Grid.Row="1"> | |||
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineTwoRunning}"></Button> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged_1" ItemsSource="{Binding LineTwoRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoEmptyRollerArrive}"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体2上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLTwoArrive}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotTwoDownArrive}"> | |||
</Button> | |||
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotTwoUpArrive}"/> | |||
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotTwoGetEmptyRoller}"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
<UniformGrid Columns="2" Grid.Row="2"> | |||
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="滚筒线运行信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding RollerLineThreeRunning}"></Button> | |||
<!--<Button Content="工位号8桶号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EightWorkLoc}"></Button>--> | |||
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> | |||
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/> | |||
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua"> | |||
<WrapPanel Orientation="Horizontal"> | |||
<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/> | |||
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}"> | |||
</Button> | |||
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotThreeUpArrive}"/> | |||
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotThreeGetEmptyRoller}"/> | |||
</WrapPanel> | |||
</GroupBox> | |||
</UniformGrid> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,62 @@ | |||
using BPASmartClient.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using System.Windows.Controls; | |||
using System.Windows.Data; | |||
using System.Windows.Documents; | |||
using System.Windows.Input; | |||
using System.Windows.Media; | |||
using System.Windows.Media.Imaging; | |||
using System.Windows.Navigation; | |||
using System.Windows.Shapes; | |||
namespace FryPot_DosingSystem.View | |||
{ | |||
/// <summary> | |||
/// DebugView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class DebugView : UserControl | |||
{ | |||
public DebugView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | |||
{ | |||
if (sender is ComboBox cbo) | |||
{ | |||
if (cbo.SelectedValue != null) | |||
{ | |||
ActionManage.GetInstance.Send("EightWorkLoc",cbo.SelectedValue); | |||
} | |||
} | |||
} | |||
private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e) | |||
{ | |||
if (sender is ComboBox cbo) | |||
{ | |||
if (cbo.SelectedValue != null) | |||
{ | |||
ActionManage.GetInstance.Send("TwoEightWorkLoc", cbo.SelectedValue); | |||
} | |||
} | |||
} | |||
private void ComboBox_SelectionChanged_2(object sender, SelectionChangedEventArgs e) | |||
{ | |||
if (sender is ComboBox cbo) | |||
{ | |||
if (cbo.SelectedValue != null) | |||
{ | |||
ActionManage.GetInstance.Send("ThreeEightWorkLoc", cbo.SelectedValue); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -18,20 +18,20 @@ | |||
</ResourceDictionary.MergedDictionaries> | |||
</ResourceDictionary> | |||
</UserControl.Resources> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50"/> | |||
<RowDefinition Height="20"/> | |||
<RowDefinition Height="55"/> | |||
<RowDefinition Height="10"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | |||
<Button Width="150" Height="35" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0" Content="添加设备" Command="{Binding AddDeviceCommand}"></Button> | |||
<Button Content="保存设置" Width="150" Height="35" Margin="0,0,20,0" Command="{Binding SaveDeviceConfig}"></Button> | |||
<Button Width="150" Height="35" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,13,10,0" Content="添加设备" Command="{Binding AddDeviceCommand}"></Button> | |||
<Button Content="保存设置" Width="150" Height="35" Margin="0,13,10,0" Command="{Binding SaveDeviceConfig}"></Button> | |||
</StackPanel> | |||
<Line Grid.Row="1" X1="0" Y1="10" X2="1300" Y2="10" Stroke="Aqua" StrokeThickness="1"></Line> | |||
<Line Grid.Row="1" X1="0" Y1="10" X2="1920" Y2="10" Stroke="Aqua" StrokeThickness="1" VerticalAlignment="Center"></Line> | |||
<Viewbox Grid.Row="2" VerticalAlignment="Top" > | |||
<ItemsControl ItemsSource="{Binding devices}"> | |||
<ItemsControl ItemsSource="{Binding devices}" Padding="0,5,0,0"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<StackPanel></StackPanel> | |||
@@ -190,17 +190,26 @@ | |||
<Grid > | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50"></RowDefinition> | |||
<RowDefinition Height="60"></RowDefinition> | |||
<RowDefinition Height="80"></RowDefinition> | |||
<RowDefinition Height="40"></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<TextBlock Text="配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="25" Margin="0,10"></TextBlock> | |||
<UniformGrid Grid.Row="1" Columns="2"> | |||
<StackPanel Orientation="Horizontal"> | |||
<TextBlock Text="请输入配方名称:" Foreground="Aqua" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBox Style="{DynamicResource TextBoxStyle}" Text="{Binding RecipeName}" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange" | |||
<StackPanel Orientation="Vertical"> | |||
<StackPanel Orientation="Horizontal" Margin="0,8"> | |||
<TextBlock Text="请输入配方名称:" Foreground="Aqua" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBox Style="{DynamicResource TextBoxStyle}" Text="{Binding RecipeName}" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange" | |||
VerticalContentAlignment="Center" | |||
BorderBrush="Aqua" VerticalAlignment="Center" FontSize="16" ></TextBox> | |||
</StackPanel> | |||
<StackPanel Orientation="Horizontal"> | |||
<TextBlock Text="请输入桶的数量:" Foreground="Aqua" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock> | |||
<TextBox Style="{DynamicResource TextBoxStyle}" Text="{Binding RecipeRollerNum}" InputMethod.IsInputMethodEnabled="False" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange" | |||
VerticalContentAlignment="Center" | |||
BorderBrush="Aqua" VerticalAlignment="Center" FontSize="16" TextChanged="TextBox_TextChanged"></TextBox> | |||
</StackPanel> | |||
</StackPanel> | |||
<StackPanel Orientation="Horizontal"> | |||
<Button Content="添加原料" Width="150" Margin="10" Height="30" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Cursor="Hand" Command="{Binding AddRecipe}" ></Button> | |||
@@ -208,7 +217,22 @@ | |||
<Button Click="Button_Click" Content="取消" Height="30" FontSize="20" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Width="100" Margin="8,10" Cursor="Hand"></Button> | |||
</StackPanel> | |||
</UniformGrid> | |||
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Hidden"> | |||
<Grid Grid.Row="2" Background="Cyan" Margin="0,0,0,10"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="210"/> | |||
<ColumnDefinition Width="225"/> | |||
<ColumnDefinition Width="225"/> | |||
<ColumnDefinition/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="原料名称" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Tomato"/> | |||
<GridSplitter></GridSplitter> | |||
<TextBlock Grid.Column="1" Text="原料桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Tomato"/> | |||
<GridSplitter Grid.Column="1"></GridSplitter> | |||
<TextBlock Grid.Column="2" Text="原料重量" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Tomato"></TextBlock> | |||
<GridSplitter Grid.Column="2"></GridSplitter> | |||
<TextBlock Grid.Column="3" Text="操作" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Tomato"/> | |||
</Grid> | |||
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding materials}"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -228,8 +252,8 @@ | |||
<ColumnDefinition Width="225"></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
</Grid.ColumnDefinitions> | |||
<ComboBox ItemsSource="{Binding DataContext.materialNames,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" Text="{Binding MaterialName}" Margin="10,0,0,10" Width="190" FontSize="14" Style="{StaticResource ComboBoxStyle1}"> | |||
<ComboBox.ItemContainerStyle> | |||
<ComboBox ItemsSource="{Binding DataContext.materialNames,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" Text="{Binding MaterialName}" Margin="10,0,0,10" Width="190" FontSize="14" KeyUp="ComboBox_KeyUp" LostFocus="ComboBox_LostFocus" Style="{StaticResource ComboBoxStyle1}"> | |||
<ComboBox.ItemContainerStyle> | |||
<Style TargetType="{x:Type ComboBoxItem}"> | |||
<Setter Property="Background" Value="White" /> | |||
<Setter Property="Foreground" Value="#e69519"/> | |||
@@ -252,7 +276,7 @@ | |||
Content="删除" | |||
Width="94" | |||
FontSize="14" | |||
Margin="0,0,10,10" | |||
Margin="0,0,20,10" | |||
Background="Transparent" | |||
BorderBrush="#e69519" Foreground="LightGray" HorizontalAlignment="Right" | |||
Command="{Binding DataContext.RemoveRecipe,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" | |||
@@ -1,8 +1,10 @@ | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Model; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Text.RegularExpressions; | |||
using System.Threading.Tasks; | |||
using System.Windows; | |||
using System.Windows.Controls; | |||
@@ -32,5 +34,56 @@ namespace FryPot_DosingSystem.View | |||
{ | |||
this.Close(); | |||
} | |||
private void ComboBox_KeyUp(object sender, KeyEventArgs e) | |||
{ | |||
var res = sender as ComboBox; | |||
Json<MaterialNames>.Read(); | |||
if (res.Text != null) | |||
{ | |||
var datas = Json<MaterialNames>.Data.Names.Where(s => s.Contains(res.Text.Trim())); | |||
// var datas = Json<MaterialNames>.Data.Names.ToList().FindAll(s => s.Contains(res.Text.Trim())); | |||
if (datas.Count() > 0) | |||
{ | |||
res.ItemsSource = datas; | |||
res.IsDropDownOpen = true; | |||
} | |||
else | |||
{ | |||
res.IsDropDownOpen = false; | |||
} | |||
} | |||
} | |||
private void ComboBox_LostFocus(object sender, RoutedEventArgs e) | |||
{ | |||
var res = sender as ComboBox; | |||
if (res.Text != null) | |||
{ | |||
if (!MaterialNames.GetInstance.Names.Contains(res.Text.Trim()))//判断是否存在原料 | |||
{ | |||
MaterialNames.GetInstance.Names.Add(res.Text.Trim()); | |||
Json<MaterialNames>.Data = MaterialNames.GetInstance; | |||
Json<MaterialNames>.Save(); | |||
} | |||
} | |||
} | |||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) | |||
{ | |||
if (sender is TextBox txt) | |||
{ | |||
if (new Regex("^[1-8]$").IsMatch(txt.Text))//全匹配 | |||
{ | |||
} | |||
else | |||
{ | |||
txt.Text=string.Empty; | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -44,15 +44,15 @@ | |||
</UserControl.Resources> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50"></RowDefinition> | |||
<RowDefinition Height="20"></RowDefinition> | |||
<RowDefinition Height="55"></RowDefinition> | |||
<RowDefinition Height="30"></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<UniformGrid Columns="2"> | |||
<Image Source="../hbl.ico" HorizontalAlignment="Left"></Image> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2"> | |||
<pry:IcoButton Content="新建配方" | |||
Margin="80,5,15,5" | |||
Margin="80,15,10,0" | |||
Width="150" | |||
FontSize="16" | |||
Foreground="Aqua" | |||
@@ -62,7 +62,7 @@ | |||
Command="{Binding NewRecipe}"> | |||
</pry:IcoButton> | |||
<pry:IcoButton | |||
Content="保存配方" Margin="5,5" | |||
Content="保存配方" Margin="5,15,10,0" | |||
Width="150" | |||
FontSize="16" | |||
Foreground="Aqua" | |||
@@ -75,8 +75,22 @@ | |||
</StackPanel> | |||
</UniformGrid> | |||
<!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>--> | |||
<Line Grid.Row="1" X1="0" Y1="10" X2="1000" Y2="10" Stroke="Aqua"></Line> | |||
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<!--<Line Grid.Row="1" X1="0" Y1="5" X2="1920" Y2="10" Stroke="Aqua" VerticalAlignment="Center"></Line>--> | |||
<Grid Grid.Row="1" Background="Cyan" Margin="0,5,0,0"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.3*"/> | |||
<ColumnDefinition Width="0.3*"/> | |||
<ColumnDefinition Width="0.3*"/> | |||
<!--<ColumnDefinition/>--> | |||
</Grid.ColumnDefinitions> | |||
<!--<TextBlock Text="编号" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>--> | |||
<TextBlock Grid.Column="0" Text="配方名称" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
<GridSplitter BorderThickness="0.5" BorderBrush="CadetBlue"/> | |||
<TextBlock Grid.Column="1" Text="编辑配方" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
<GridSplitter Grid.Column="1" BorderThickness="0.5" BorderBrush="CadetBlue"></GridSplitter> | |||
<TextBlock Grid.Column="2" Text="删除配方" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
</Grid> | |||
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Padding="0,5,0,0"> | |||
<ItemsControl ItemsSource="{Binding recipeModels}"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -90,26 +104,26 @@ | |||
<ControlTemplate> | |||
<Grid x:Name="gr"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition Width="0.25*"></ColumnDefinition> | |||
<ColumnDefinition Width="0.25*"></ColumnDefinition> | |||
<ColumnDefinition Width="0.25*"></ColumnDefinition> | |||
<!--<ColumnDefinition Width="0.25*"></ColumnDefinition>--> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" | |||
<!--<TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Margin="5,0,0,5"></TextBlock> | |||
<TextBlock Text="{Binding RecipeName}" Grid.Column="1" Margin="5,0,0,5" | |||
Margin="5,0,0,5"></TextBlock>--> | |||
<TextBlock Text="{Binding RecipeName}" Grid.Column="0" Margin="5,0,0,5" | |||
HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="16"></TextBlock> | |||
<Grid Grid.Column="3"> | |||
<Button FontSize="16" | |||
Margin="5,0,0,5" Content="编辑配方" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" | |||
<Button FontSize="16" Grid.Column="1" | |||
Margin="5,0,0,5" Content="编辑" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" | |||
CommandParameter="{Binding RecipeId}"></Button> | |||
</Grid> | |||
<Grid Grid.Column="4"> | |||
<Button Margin="5,0,0,5" FontSize="16" Content="删除配方" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.DeleteRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}"> | |||
<Button Margin="5,0,0,5" FontSize="16" Grid.Column="2" Content="删除" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.DeleteRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}"> | |||
</Button> | |||
</Grid> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
@@ -1,4 +1,5 @@ | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using FryPot_DosingSystem.AGV; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
@@ -17,11 +18,479 @@ namespace FryPot_DosingSystem.ViewModel | |||
public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel()); | |||
public AgvViewModel() | |||
{ | |||
Init(); | |||
} | |||
#endregion | |||
#region 私有函数 | |||
public void Init() | |||
{ | |||
//初始化车辆控制 | |||
cartModel_1 = new CartModel(); | |||
cartModel_2 = new CartModel(); | |||
cartModel_3 = new CartModel(); | |||
cartModel_4 = new CartModel(); | |||
RollerLines_1 = new RollerLinesModel(); | |||
RollerLines_2 = new RollerLinesModel(); | |||
RollerLines_3 = new RollerLinesModel(); | |||
RollerLines_4 = new RollerLinesModel(); | |||
ParkingPileModel_1 = new ParkingPileModel { isBool = IsBool.Yes }; | |||
ParkingPileModel_2 = new ParkingPileModel { isBool = IsBool.Yes }; | |||
ParkingPileModel_3 = new ParkingPileModel { isBool = IsBool.Yes }; | |||
ParkingPileModel_4 = new ParkingPileModel { isBool = IsBool.Yes }; | |||
ParkingPileModel_5 = new ParkingPileModel { isBool = IsBool.No }; | |||
ParkingPileModel_6 = new ParkingPileModel { isBool = IsBool.No }; | |||
RollerLines_2.DishesNum = "3"; | |||
} | |||
#endregion | |||
#region 公共函数 | |||
#endregion | |||
#region 4个滚筒线控制 | |||
/// <summary> | |||
/// 一号滚筒线 | |||
/// </summary> | |||
private RollerLinesModel _RollerLines_1; | |||
public RollerLinesModel RollerLines_1 | |||
{ | |||
get | |||
{ | |||
return _RollerLines_1; | |||
} | |||
set | |||
{ | |||
if (_RollerLines_1 == value) | |||
return; | |||
_RollerLines_1 = value; | |||
OnPropertyChanged("RollerLines_1"); | |||
} | |||
} | |||
/// <summary> | |||
/// 二号滚筒线 | |||
/// </summary> | |||
private RollerLinesModel _RollerLines_2; | |||
public RollerLinesModel RollerLines_2 | |||
{ | |||
get | |||
{ | |||
return _RollerLines_2; | |||
} | |||
set | |||
{ | |||
if (_RollerLines_2 == value) | |||
return; | |||
_RollerLines_2 = value; | |||
OnPropertyChanged("RollerLines_2"); | |||
} | |||
} | |||
/// <summary> | |||
/// 三号滚筒线 | |||
/// </summary> | |||
private RollerLinesModel _RollerLines_3; | |||
public RollerLinesModel RollerLines_3 | |||
{ | |||
get | |||
{ | |||
return _RollerLines_3; | |||
} | |||
set | |||
{ | |||
if (_RollerLines_3 == value) | |||
return; | |||
_RollerLines_3 = value; | |||
OnPropertyChanged("RollerLines_3"); | |||
} | |||
} | |||
/// <summary> | |||
/// 四号滚筒线 | |||
/// </summary> | |||
private RollerLinesModel _RollerLines_4; | |||
public RollerLinesModel RollerLines_4 | |||
{ | |||
get | |||
{ | |||
return _RollerLines_4; | |||
} | |||
set | |||
{ | |||
if (_RollerLines_4 == value) | |||
return; | |||
_RollerLines_4 = value; | |||
OnPropertyChanged("RollerLines_4"); | |||
} | |||
} | |||
#endregion | |||
//public ObservableCollection<ActionMenu> menus { get; set; } = new ObservableCollection<ActionMenu>(); | |||
#region 4个运动小车控制 | |||
/// <summary> | |||
/// 一号车控制 | |||
/// </summary> | |||
private CartModel _cartModel_1; | |||
public CartModel cartModel_1 | |||
{ | |||
get | |||
{ | |||
return _cartModel_1; | |||
} | |||
set | |||
{ | |||
if (_cartModel_1 == value) | |||
return; | |||
_cartModel_1 = value; | |||
OnPropertyChanged("cartModel_1"); | |||
} | |||
} | |||
/// <summary> | |||
/// 二号车控制 | |||
/// </summary> | |||
private CartModel _cartModel_2; | |||
public CartModel cartModel_2 | |||
{ | |||
get | |||
{ | |||
return _cartModel_2; | |||
} | |||
set | |||
{ | |||
if (_cartModel_2 == value) | |||
return; | |||
_cartModel_2 = value; | |||
OnPropertyChanged("cartModel_2"); | |||
} | |||
} | |||
/// <summary> | |||
/// 三号车控制 | |||
/// </summary> | |||
private CartModel _cartModel_3; | |||
public CartModel cartModel_3 | |||
{ | |||
get | |||
{ | |||
return _cartModel_3; | |||
} | |||
set | |||
{ | |||
if (_cartModel_3 == value) | |||
return; | |||
_cartModel_3 = value; | |||
OnPropertyChanged("cartModel_3"); | |||
} | |||
} | |||
/// <summary> | |||
/// 四号车控制 | |||
/// </summary> | |||
private CartModel _cartModel_4; | |||
public CartModel cartModel_4 | |||
{ | |||
get | |||
{ | |||
return _cartModel_4; | |||
} | |||
set | |||
{ | |||
if (_cartModel_4 == value) | |||
return; | |||
_cartModel_4 = value; | |||
OnPropertyChanged("cartModel_4"); | |||
} | |||
} | |||
#endregion | |||
#region 6个停车桩控制 | |||
/// <summary> | |||
/// 一号停车装 | |||
/// </summary> | |||
private ParkingPileModel _ParkingPileModel_1; | |||
public ParkingPileModel ParkingPileModel_1 | |||
{ | |||
get | |||
{ | |||
return _ParkingPileModel_1; | |||
} | |||
set | |||
{ | |||
if (_ParkingPileModel_1 == value) | |||
return; | |||
_ParkingPileModel_1 = value; | |||
OnPropertyChanged("ParkingPileModel_1"); | |||
} | |||
} | |||
/// <summary> | |||
/// 二号停车装 | |||
/// </summary> | |||
private ParkingPileModel _ParkingPileModel_2; | |||
public ParkingPileModel ParkingPileModel_2 | |||
{ | |||
get | |||
{ | |||
return _ParkingPileModel_2; | |||
} | |||
set | |||
{ | |||
if (_ParkingPileModel_2 == value) | |||
return; | |||
_ParkingPileModel_2 = value; | |||
OnPropertyChanged("ParkingPileModel_2"); | |||
} | |||
} | |||
/// <summary> | |||
/// 三号停车装 | |||
/// </summary> | |||
private ParkingPileModel _ParkingPileModel_3; | |||
public ParkingPileModel ParkingPileModel_3 | |||
{ | |||
get | |||
{ | |||
return _ParkingPileModel_3; | |||
} | |||
set | |||
{ | |||
if (_ParkingPileModel_3 == value) | |||
return; | |||
_ParkingPileModel_3 = value; | |||
OnPropertyChanged("ParkingPileModel_3"); | |||
} | |||
} | |||
/// <summary> | |||
/// 四号停车装 | |||
/// </summary> | |||
private ParkingPileModel _ParkingPileModel_4; | |||
public ParkingPileModel ParkingPileModel_4 | |||
{ | |||
get | |||
{ | |||
return _ParkingPileModel_4; | |||
} | |||
set | |||
{ | |||
if (_ParkingPileModel_4 == value) | |||
return; | |||
_ParkingPileModel_4 = value; | |||
OnPropertyChanged("ParkingPileModel_4"); | |||
} | |||
} | |||
/// <summary> | |||
/// 五号停车装 | |||
/// </summary> | |||
private ParkingPileModel _ParkingPileModel_5; | |||
public ParkingPileModel ParkingPileModel_5 | |||
{ | |||
get | |||
{ | |||
return _ParkingPileModel_5; | |||
} | |||
set | |||
{ | |||
if (_ParkingPileModel_5 == value) | |||
return; | |||
_ParkingPileModel_5 = value; | |||
OnPropertyChanged("ParkingPileModel_5"); | |||
} | |||
} | |||
/// <summary> | |||
/// 六号停车装 | |||
/// </summary> | |||
private ParkingPileModel _ParkingPileModel_6; | |||
public ParkingPileModel ParkingPileModel_6 | |||
{ | |||
get | |||
{ | |||
return _ParkingPileModel_6; | |||
} | |||
set | |||
{ | |||
if (_ParkingPileModel_6 == value) | |||
return; | |||
_ParkingPileModel_6 = value; | |||
OnPropertyChanged("ParkingPileModel_6"); | |||
} | |||
} | |||
#endregion | |||
} | |||
/// <summary> | |||
/// 小车控制Model | |||
/// </summary> | |||
public class CartModel : ObservableObject | |||
{ | |||
/// <summary> | |||
/// 车上是否有物品 | |||
/// </summary> | |||
private IsBool _isBool = IsBool.No; | |||
public IsBool isBool | |||
{ | |||
get | |||
{ | |||
return _isBool; | |||
} | |||
set | |||
{ | |||
_isBool = value; | |||
Text= _isBool.ToString(); | |||
OnPropertyChanged("isBool"); | |||
} | |||
} | |||
/// <summary> | |||
/// 车运动轨迹方式 | |||
/// </summary> | |||
private CartMotionTrajectory _cartMotionTrajectory = CartMotionTrajectory.Stop; | |||
public CartMotionTrajectory cartMotionTrajectory | |||
{ | |||
get | |||
{ | |||
return _cartMotionTrajectory; | |||
} | |||
set | |||
{ | |||
_cartMotionTrajectory = value; | |||
Tag= _cartMotionTrajectory.ToString(); | |||
OnPropertyChanged("cartMotionTrajectory"); | |||
} | |||
} | |||
private string _Text = IsBool.No.ToString(); | |||
public string Text | |||
{ | |||
get | |||
{ | |||
return _Text; | |||
} | |||
set | |||
{ | |||
_Text = value; | |||
OnPropertyChanged("Text"); | |||
} | |||
} | |||
private string _Tag = CartMotionTrajectory.Stop.ToString(); | |||
public string Tag | |||
{ | |||
get | |||
{ | |||
return _Tag; | |||
} | |||
set | |||
{ | |||
_Tag = value; | |||
OnPropertyChanged("Tag"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 停车装控制 | |||
/// </summary> | |||
public class ParkingPileModel : ObservableObject | |||
{ | |||
/// <summary> | |||
/// 是否有小车 | |||
/// </summary> | |||
private IsBool _isBool = IsBool.No; | |||
public IsBool isBool | |||
{ | |||
get | |||
{ | |||
return _isBool; | |||
} | |||
set | |||
{ | |||
_isBool = value; | |||
Text = _isBool.ToString(); | |||
OnPropertyChanged("isBool"); | |||
} | |||
} | |||
private string _Text = IsBool.No.ToString(); | |||
public string Text | |||
{ | |||
get | |||
{ | |||
return _Text; | |||
} | |||
set | |||
{ | |||
_Text = value; | |||
OnPropertyChanged("Text"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 滚筒线控制 | |||
/// </summary> | |||
public class RollerLinesModel : ObservableObject | |||
{ | |||
/// <summary> | |||
/// 是否运行 | |||
/// </summary> | |||
private IsRun _isRun = IsRun.Stop; | |||
public IsRun isRun | |||
{ | |||
get | |||
{ | |||
return _isRun; | |||
} | |||
set | |||
{ | |||
_isRun = value; | |||
Text= _isRun.ToString(); | |||
OnPropertyChanged("isBool"); | |||
} | |||
} | |||
/// <summary> | |||
/// 滚筒线上面的数量 | |||
/// </summary> | |||
private string _DishesNum = "8"; | |||
public string DishesNum | |||
{ | |||
get | |||
{ | |||
return _DishesNum; | |||
} | |||
set | |||
{ | |||
_DishesNum = value; | |||
if (!string.IsNullOrEmpty(_DishesNum)) | |||
{ | |||
int count = 1; | |||
try | |||
{ | |||
count = int.Parse(_DishesNum); | |||
if (count > 0 && count <= 8) | |||
{ | |||
_DishesNum = count.ToString(); | |||
} | |||
else | |||
_DishesNum = 8.ToString(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
_DishesNum = 8.ToString(); | |||
} | |||
} | |||
OnPropertyChanged("DishesNum"); | |||
} | |||
} | |||
private string _Text = IsRun.Stop.ToString(); | |||
public string Text | |||
{ | |||
get | |||
{ | |||
return _Text; | |||
} | |||
set | |||
{ | |||
_Text = value; | |||
OnPropertyChanged("Text"); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,165 @@ | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Control; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
internal class DebugViewModel : ObservableObject | |||
{ | |||
public ObservableCollection<ushort> LineOneRollerCode { get; set; } = new ObservableCollection<ushort>() { 101,102,103,104,105,106,107,108,401,402,403,404,405,406,407,408}; | |||
public ObservableCollection<ushort> LineTwoRollerCode { get; set; } = new ObservableCollection<ushort>() {201,202,203,204,205,206,207,208,501,502,503,504,505,506,507,508 }; | |||
public ObservableCollection<ushort> LineThreeRollerCode { get; set; } = new ObservableCollection<ushort>() { 301,302,303,304,305,306,307,308}; | |||
//滚筒线1绑定命令 | |||
public RelayCommand RollerLineRunning { get; set; } | |||
public RelayCommand EightWorkLoc { get; set; } | |||
public RelayCommand FryPotInputArrive { get; set; } | |||
public RelayCommand FryPotEmptyRollerArrive { get; set; } | |||
public RelayCommand AGVLOneArrive { get; set; } | |||
public RelayCommand AGVFryPotDownArrive { get; set; } | |||
public RelayCommand AGVFryPotUpArrive { get; set; } | |||
public RelayCommand AGVFryPotGetEmptyRoller { get; set; } | |||
//滚筒线2绑定命令 | |||
public RelayCommand RollerLineTwoRunning { get; set; } | |||
//public RelayCommand EightWorkLoc { get; set; } | |||
public RelayCommand FryPotTwoInputArrive { get; set; } | |||
public RelayCommand FryPotTwoEmptyRollerArrive { get; set; } | |||
public RelayCommand AGVLTwoArrive { get; set; } | |||
public RelayCommand AGVFryPotTwoDownArrive { get; set; } | |||
public RelayCommand AGVFryPotTwoUpArrive { get; set; } | |||
public RelayCommand AGVFryPotTwoGetEmptyRoller { get; set; } | |||
//滚筒线3绑定命令 | |||
public RelayCommand RollerLineThreeRunning { get; set; } | |||
//public RelayCommand EightWorkLoc { get; set; } | |||
public RelayCommand FryPotThreeInputArrive { get; set; } | |||
public RelayCommand FryPotThreeEmptyRollerArrive { get; set; } | |||
public RelayCommand AGVLThreeArrive { get; set; } | |||
public RelayCommand AGVFryPotThreeDownArrive { get; set; } | |||
public RelayCommand AGVFryPotThreeUpArrive { get; set; } | |||
public RelayCommand AGVFryPotThreeGetEmptyRoller { get; set; } | |||
public DebugViewModel() | |||
{ | |||
RollerLineRunning = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("RollerLineRunning"); | |||
})); | |||
FryPotInputArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("FryPotInputArrive"); | |||
})); | |||
FryPotEmptyRollerArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("FryPotEmptyRollerArrive"); | |||
})); | |||
AGVLOneArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVLOneArrive"); | |||
})); | |||
AGVFryPotDownArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotDownArrive"); | |||
})); | |||
AGVFryPotUpArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotUpArrive"); | |||
})); | |||
AGVFryPotGetEmptyRoller = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotGetEmptyRoller"); | |||
})); | |||
//滚筒线2 | |||
RollerLineTwoRunning = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("RollerLineTwoRunning"); | |||
})); | |||
FryPotTwoInputArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("FryPotTwoInputArrive"); | |||
})); | |||
FryPotTwoEmptyRollerArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("FryPotTwoEmptyRollerArrive"); | |||
})); | |||
AGVLTwoArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVLTwoArrive"); | |||
})); | |||
AGVFryPotTwoDownArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotTwoDownArrive"); | |||
})); | |||
AGVFryPotTwoUpArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotTwoUpArrive"); | |||
})); | |||
AGVFryPotTwoGetEmptyRoller = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotTwoGetEmptyRoller"); | |||
})); | |||
//滚筒线3 | |||
RollerLineThreeRunning = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("RollerLineThreeRunning"); | |||
})); | |||
FryPotThreeInputArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("FryPotThreeInputArrive"); | |||
})); | |||
FryPotThreeEmptyRollerArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("FryPotThreeEmptyRollerArrive"); | |||
})); | |||
AGVLThreeArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVLThreeArrive"); | |||
})); | |||
AGVFryPotThreeDownArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotThreeDownArrive"); | |||
})); | |||
AGVFryPotThreeUpArrive = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotThreeUpArrive"); | |||
})); | |||
AGVFryPotThreeGetEmptyRoller = new RelayCommand(new Action(() => | |||
{ | |||
ActionManage.GetInstance.Send("AGVFryPotThreeGetEmptyRoller"); | |||
})); | |||
} | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.Helper; | |||
using FryPot_DosingSystem.Model; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
@@ -18,27 +19,38 @@ namespace FryPot_DosingSystem.ViewModel | |||
/// </summary> | |||
public string recipeId { get; set; } | |||
/// <summary> | |||
/// 配料名称 | |||
/// 配方名称 | |||
/// </summary> | |||
private string _recipeName; | |||
public string RecipeName { get { return _recipeName; } set { _recipeName = value; OnPropertyChanged(); } } | |||
private int _recipeRollerNum; | |||
/// <summary> | |||
/// 配方中桶数 | |||
/// </summary> | |||
public int RecipeRollerNum { get { return _recipeRollerNum; } set { _recipeRollerNum = value; OnPropertyChanged(); } } | |||
public ObservableCollection<MaterialType> materials { get; set; } = new ObservableCollection<MaterialType>(); | |||
public ObservableCollection<string> materialNames { get; set; } = new ObservableCollection<string>() { "肉","葱","蒜"}; | |||
public ObservableCollection<string> materialNames { get; set; } = new ObservableCollection<string>(); | |||
public RelayCommand AddRecipe { get; set; } | |||
public RelayCommand<string> RemoveRecipe { get; set; } | |||
public RelayCommand Comfirm { get; set; } | |||
public NewRecipeViewModel() | |||
{ | |||
ActionManage.GetInstance.Register(new Action<object>(Id => { | |||
Json<MaterialNames>.Read(); | |||
MaterialNames.GetInstance.Names = Json<MaterialNames>.Data.Names; | |||
materialNames = Json<MaterialNames>.Data.Names; | |||
ActionManage.GetInstance.Register(new Action<object>(Id => | |||
{ | |||
if (Id != null && Id is string strId) | |||
{ | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == strId); | |||
if (res != null && res is NewRecipeModel rom) | |||
{ | |||
RecipeName = rom.RecipeName; | |||
RecipeRollerNum = rom.materialCollection.Count; | |||
foreach (var item in rom.materialCollection) | |||
{ | |||
materials.Add(item); | |||
@@ -46,20 +58,24 @@ namespace FryPot_DosingSystem.ViewModel | |||
recipeId = strId; | |||
} | |||
} | |||
}),"EditRecipe"); | |||
}), "EditRecipe"); | |||
AddRecipe = new RelayCommand(() => | |||
{ | |||
pr: | |||
string materialCode = Guid.NewGuid().ToString();//原料唯一ID ,后期需要根据实际要求更改 | |||
var res = materials.FirstOrDefault(p => p.MaterialCode == materialCode); | |||
if (res == null) | |||
{ | |||
materials.Add(new MaterialType() { MaterialCode = materialCode }); | |||
} | |||
else | |||
{ | |||
goto pr; | |||
} | |||
for (int i = 0; i < RecipeRollerNum; i++) | |||
{ | |||
pr1: | |||
string materialCode = Guid.NewGuid().ToString();//原料唯一ID ,后期需要根据实际要求更改 | |||
var res = materials.FirstOrDefault(p => p.MaterialCode == materialCode); | |||
if (res == null) | |||
{ | |||
materials.Add(new MaterialType() { MaterialCode = materialCode }); | |||
} | |||
else | |||
{ | |||
goto pr1; | |||
} | |||
} | |||
}); | |||
RemoveRecipe = new RelayCommand<string>(code => | |||
{ | |||
@@ -72,27 +88,35 @@ namespace FryPot_DosingSystem.ViewModel | |||
var bom = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeId); | |||
if (bom == null)//新配方 | |||
{ | |||
prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改 | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); | |||
if (res == null) | |||
if (RecipeRollerNum != 0) | |||
{ | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, materialCollection = materials });//配方添加 | |||
prop: string recipeID = Guid.NewGuid().ToString();//配方唯一ID,后期根据实际要求更改 | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); | |||
if (res == null) | |||
{ | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, materialCollection = materials });//配方添加 | |||
} | |||
else | |||
{ | |||
goto prop; | |||
} | |||
MessageLog.GetInstance.ShowUserLog("新建配方成功"); | |||
} | |||
else | |||
{ | |||
goto prop; | |||
MessageLog.GetInstance.ShowUserLog("新建配方无效【配方中没有添加原料】"); | |||
} | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
} | |||
else //已有配方,用于编辑 | |||
{ | |||
bom.materialCollection= materials; | |||
bom.materialCollection = materials; | |||
bom.RecipeName = RecipeName; | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
} | |||
}); | |||
} | |||
} | |||
} |
@@ -14,7 +14,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
internal class RecipeSetDownViewModel : ObservableObject | |||
{ | |||
/// <summary> | |||
/// 配方下发 | |||
@@ -36,18 +36,19 @@ namespace FryPot_DosingSystem.ViewModel | |||
var res = Recipes.FirstOrDefault(p => p.RecipeId == strId); | |||
if (res != null) | |||
{ | |||
RecipeSetDown(res); | |||
RecipeSetDown(new NewRecipeModel[] { res }); | |||
} | |||
} | |||
}); | |||
AllRecipeSetDownCommand = new RelayCommand(() => | |||
{ | |||
if (Recipes!=null) | |||
if (Recipes != null) | |||
{ | |||
foreach (var recipeModel in Recipes) | |||
{ | |||
RecipeSetDown(recipeModel); | |||
} | |||
//foreach (var recipeModel in Recipes) | |||
//{ | |||
// RecipeSetDown(recipeModel); | |||
//} | |||
RecipeSetDown(Recipes.ToArray()); | |||
} | |||
}); | |||
@@ -55,9 +56,9 @@ namespace FryPot_DosingSystem.ViewModel | |||
/// <summary> | |||
/// 数据下发方法 | |||
/// </summary> | |||
public void RecipeSetDown(NewRecipeModel recipeModel) | |||
public void RecipeSetDown(NewRecipeModel[] recipes) | |||
{ | |||
ActionManage.GetInstance.Send("RecipeSetDown",recipeModel); | |||
ActionManage.GetInstance.Send("RecipeSetDown", recipes); | |||
} | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
| |||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio Version 17 | |||
# Blend for Visual Studio Version 17 | |||
VisualStudioVersion = 17.0.32002.185 | |||
MinimumVisualStudioVersion = 10.0.40219.1 | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DRCoffee", "BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj", "{31E9DC70-5889-4BA5-A5BA-FFDE66AFF314}" | |||
@@ -16,7 +16,7 @@ namespace TestDemo | |||
{ | |||
AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); | |||
string value = JsonConvert.SerializeObject(aGVToUpSystem); | |||
string url = $"http://192.168.1.99:8089/apicallback/quicktron/robotjob/report?sign={value}"; | |||
string url = $"http://192.168.1.130:8089/apicallback/quicktron/robotjob/report?sign={value}"; | |||
var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); | |||
} | |||
@@ -25,7 +25,7 @@ namespace TestDemo | |||
Upstreamrequest aGVToUpSystem = new Upstreamrequest(); | |||
string value = JsonConvert.SerializeObject(aGVToUpSystem); | |||
string url = $"http://192.168.1.99:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}"; | |||
string url = $"http://192.168.1.130:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}"; | |||
var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); | |||
} | |||
} |