@@ -76,46 +76,46 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvToLineOneLoadRoller(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -124,45 +124,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvToLineTwoLoadRoller(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -171,45 +171,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvToLineThreeLoadRoller(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -218,45 +218,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvLeaveFryPotOne(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -265,45 +265,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvLeaveFryPotTwo(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -312,45 +312,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvLeaveFryPotThree(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -359,45 +359,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvLeaveFryPotFour(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -406,45 +406,45 @@ namespace BPASmartClient.AGV | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public string AgvLeaveFryPotFive(string robotJobId) | 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 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"; | return "Analysis Error"; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -0,0 +1,12 @@ | |||||
{ | |||||
"version": 1, | |||||
"isRoot": true, | |||||
"tools": { | |||||
"dotnet-ef": { | |||||
"version": "6.0.6", | |||||
"commands": [ | |||||
"dotnet-ef" | |||||
] | |||||
} | |||||
} | |||||
} |
@@ -84,7 +84,7 @@ namespace BPASmartClient.Business | |||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()); | IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()); | ||||
configurationBuilder.AddApolloConfiguration(p => | configurationBuilder.AddApolloConfiguration(p => | ||||
{ | { | ||||
p.AppId = "HostComputer"; | |||||
p.AppId = apoid; | |||||
p.MetaServer = apolloUri; | p.MetaServer = apolloUri; | ||||
p.Namespaces = new List<string>() { "application", namespa }; | p.Namespaces = new List<string>() { "application", namespa }; | ||||
}); | }); | ||||
@@ -4,12 +4,10 @@ using BPASmartClient.Model; | |||||
using System; | using System; | ||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Collections.ObjectModel; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Reflection; | using System.Reflection; | ||||
using System.Text; | |||||
using System.Threading; | using System.Threading; | ||||
using System.Threading.Tasks; | |||||
using System.Collections.ObjectModel; | |||||
using System.Windows; | using System.Windows; | ||||
namespace BPASmartClient.CustomResource.Pages.Model | 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)); | bool value = Convert.ToBoolean(Alarm.GetType().GetProperty(item.Name)?.GetValue(Alarm)); | ||||
EdgeAlarm(value, AlarmModel.AlarmInfo, 1, AlarmModel.AlarmLevel, AlarmModel.AlarmType); | EdgeAlarm(value, AlarmModel.AlarmInfo, 1, AlarmModel.AlarmLevel, AlarmModel.AlarmType); | ||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
Thread.Sleep(100); | Thread.Sleep(100); | ||||
@@ -59,7 +57,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
if (!delays.ContainsKey(text)) delays.TryAdd(text, Delay.GetInstance(text)); | 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 ? 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); | AddAlarm(Trigger, text, alarmLevel); | ||||
flagbit[text] = edgeType == AlarmTriggerType.Rising ? true : false; | 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 | public class MessageLog | ||||
{ | { | ||||
private volatile static MessageLog _Instance; | 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() { } | private MessageLog() { } | ||||
public Action<string> UserLog { get; set; } | public Action<string> UserLog { get; set; } | ||||
@@ -37,30 +40,36 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
public void ShowUserLog(string info) | 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) | 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); | |||||
} | |||||
} | } | ||||
@@ -21,7 +21,7 @@ | |||||
</Window.DataContext> | </Window.DataContext> | ||||
<Window.Resources> | <Window.Resources> | ||||
<!--#region 静态资源--> | <!--#region 静态资源--> | ||||
<ImageBrush x:Key="leftImage" ImageSource="../../Image/leftImage.png" /> | <ImageBrush x:Key="leftImage" ImageSource="../../Image/leftImage.png" /> | ||||
@@ -511,7 +511,7 @@ | |||||
</Grid.Background> | </Grid.Background> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
<RowDefinition Height="60" /> | |||||
<RowDefinition Height="80" /> | |||||
<RowDefinition /> | <RowDefinition /> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | ||||
@@ -9,8 +9,8 @@ using System.Collections.ObjectModel; | |||||
using System.Windows; | using System.Windows; | ||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
using Microsoft.Toolkit.Mvvm.Input; | using Microsoft.Toolkit.Mvvm.Input; | ||||
using BPASmartClient.Model; | |||||
using BPASmartClient.CustomResource.Pages.Model; | using BPASmartClient.CustomResource.Pages.Model; | ||||
using BPASmartClient.Model; | |||||
namespace BPASmartClient.CustomResource.Pages.ViewModel | namespace BPASmartClient.CustomResource.Pages.ViewModel | ||||
{ | { | ||||
@@ -26,7 +26,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
} | } | ||||
if (ControlButText == "开始查询") | 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(); | var res = lists.Where(p => Convert.ToDateTime(p.Date) >= StartDateTime && Convert.ToDateTime(p.Date) <= EndDateTime).ToList(); | ||||
if (res != null) | 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() | private void GetHistoryAlarm() | ||||
{ | { | ||||
var data = Sqlite<Alarm>.GetInstance.GetData(); | |||||
var data = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.GetData(); | |||||
if (data != null) | if (data != null) | ||||
{ | { | ||||
HistoryAlarm.Clear(); | HistoryAlarm.Clear(); | ||||
@@ -131,7 +131,6 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
public ObservableCollection<Alarm> AlarmInfos { get; set; } | public ObservableCollection<Alarm> AlarmInfos { get; set; } | ||||
public ObservableCollection<Alarm> HistoryAlarm { get; set; } = new ObservableCollection<Alarm>(); | public ObservableCollection<Alarm> HistoryAlarm { get; set; } = new ObservableCollection<Alarm>(); | ||||
@@ -33,10 +33,10 @@ | |||||
</ControlTemplate.Triggers> | </ControlTemplate.Triggers> | ||||
</ControlTemplate> | </ControlTemplate> | ||||
<Style x:Key="NewButtonStyle" TargetType="local:IcoButton"> | |||||
<Style x:Key="IcoButtonStyle" TargetType="local:IcoButton"> | |||||
<Setter Property="FontFamily" Value="../Fonts/#iconfont" /> | <Setter Property="FontFamily" Value="../Fonts/#iconfont" /> | ||||
<Setter Property="FontSize" Value="14" /> | <Setter Property="FontSize" Value="14" /> | ||||
<Setter Property="Background" Value="Transparent" /> | |||||
<Setter Property="Background" Value="#2219b7ec" /> | |||||
<Setter Property="BorderBrush" Value="#ff19b7ec" /> | <Setter Property="BorderBrush" Value="#ff19b7ec" /> | ||||
<Setter Property="BorderThickness" Value="2" /> | <Setter Property="BorderThickness" Value="2" /> | ||||
<Setter Property="EnterBackground" Value="#2219b7ec" /> | <Setter Property="EnterBackground" Value="#2219b7ec" /> | ||||
@@ -451,7 +451,7 @@ | |||||
<Style x:Key="border碗" TargetType="Border"> | <Style x:Key="border碗" TargetType="Border"> | ||||
<Style.Setters> | <Style.Setters> | ||||
<Setter Property="Height" Value="50"/> | |||||
<Setter Property="Height" Value="34"/> | |||||
<Setter Property="Width" Value="40"/> | <Setter Property="Width" Value="40"/> | ||||
<Setter Property="VerticalAlignment" Value="Bottom"/> | <Setter Property="VerticalAlignment" Value="Bottom"/> | ||||
<Setter Property="Background"> | <Setter Property="Background"> | ||||
@@ -464,9 +464,9 @@ | |||||
<Style x:Key="border菜" TargetType="Border"> | <Style x:Key="border菜" TargetType="Border"> | ||||
<Style.Setters> | <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="VerticalAlignment" Value="Top"/> | ||||
<Setter Property="Background"> | <Setter Property="Background"> | ||||
<Setter.Value> | <Setter.Value> | ||||
@@ -0,0 +1,28 @@ | |||||
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 BPASmartClient.CustomResource.UserControls | |||||
{ | |||||
/// <summary> | |||||
/// DosingSystem.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class DosingSystem : UserControl | |||||
{ | |||||
public DosingSystem() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -5,7 +5,7 @@ using BPASmartClient.Peripheral; | |||||
using BPASmartClient.SerialPort; | using BPASmartClient.SerialPort; | ||||
using static BPASmartClient.EventBus.EventBus; | using static BPASmartClient.EventBus.EventBus; | ||||
namespace BPASmartClient.Icemoker | |||||
namespace BPASmartClient.IceMaker | |||||
{ | { | ||||
public class IceMakerMachine : BasePeripheral | public class IceMakerMachine : BasePeripheral | ||||
{ | { | ||||
@@ -1,17 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.IceMaker | |||||
{ | |||||
public enum IceMakerStatus | |||||
{ | |||||
关机状态=0x01, | |||||
制冰状态=0x02, | |||||
电机故障=0x04, | |||||
缺水=0x08, | |||||
冰满=0x16 | |||||
} | |||||
} |
@@ -142,6 +142,22 @@ namespace BPASmartClient.Modbus | |||||
return LwAddress; | 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; | return -1; | ||||
} | } | ||||
@@ -171,7 +187,7 @@ namespace BPASmartClient.Modbus | |||||
commandType = CommandType.Coils; | commandType = CommandType.Coils; | ||||
return master.ReadCoils(slaveAddress, startAddress, len); | 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; | commandType = CommandType.HoldingRegisters; | ||||
return master.ReadHoldingRegisters(slaveAddress, startAddress, len); | return master.ReadHoldingRegisters(slaveAddress, startAddress, len); | ||||
@@ -181,6 +197,7 @@ namespace BPASmartClient.Modbus | |||||
commandType = CommandType.Inputs; | commandType = CommandType.Inputs; | ||||
return master.ReadInputs(slaveAddress, startAddress, len); | return master.ReadInputs(slaveAddress, startAddress, len); | ||||
} | } | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -199,14 +216,15 @@ namespace BPASmartClient.Modbus | |||||
{ | { | ||||
try | 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); | string tail = address.Substring(2, 3); | ||||
address = head + tail; | |||||
address = head + tail; | |||||
return Convert.ToInt32(address); | |||||
} | } | ||||
catch (Exception) | catch (Exception) | ||||
{ | { | ||||
//打印日志 | //打印日志 | ||||
return -1; | |||||
} | } | ||||
} | } | ||||
@@ -276,7 +294,7 @@ namespace BPASmartClient.Modbus | |||||
else if (value is bool[] boolsValue) | else if (value is bool[] boolsValue) | ||||
master.WriteMultipleCoils(slaveAddress, startAddress, 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; | commandType = CommandType.HoldingRegisters; | ||||
if (value is ushort ushortValue) | if (value is ushort ushortValue) | ||||
@@ -522,11 +522,8 @@ namespace BPASmartClient.MorkF | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | |||||
} | |||||
}); | }); | ||||
} | } | ||||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | ||||
@@ -1,4 +1,5 @@ | |||||
using System; | |||||
using BPASmartClient.MorkS.Model; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
@@ -24,5 +25,6 @@ namespace BPASmartClient.MorkS.View | |||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -62,7 +62,7 @@ | |||||
Content="保存配置" | Content="保存配置" | ||||
FontSize="16" | FontSize="16" | ||||
IcoText="" | IcoText="" | ||||
Style="{StaticResource NewButtonStyle}"> | |||||
Style="{StaticResource IcoButtonStyle}"> | |||||
<pry:IcoButton.Foreground> | <pry:IcoButton.Foreground> | ||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | ||||
<GradientStop Color="#FFBB662A" /> | <GradientStop Color="#FFBB662A" /> | ||||
@@ -7,8 +7,6 @@ using BPASmartClient.Device; | |||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
using BPASmartClient.LebaiRobot; | using BPASmartClient.LebaiRobot; | ||||
using BPASmartClient.DRCoffee; | using BPASmartClient.DRCoffee; | ||||
using BPASmartClient.IceMaker; | |||||
namespace BPASmartClient.MorkT_BarCounter | namespace BPASmartClient.MorkT_BarCounter | ||||
{ | { | ||||
public class GVL_MorkT : IStatus | public class GVL_MorkT : IStatus | ||||
@@ -198,7 +198,7 @@ namespace BPASmartClient.MorkT_Container | |||||
bFirstTrig_Coffee = true; | bFirstTrig_Coffee = true; | ||||
delayTimeOut_Coffee = DateTime.Now; | delayTimeOut_Coffee = DateTime.Now; | ||||
} | } | ||||
else if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 18 && bFirstTrig_Coffee == true) | |||||
else if (DateTime.Now.Subtract(delayTimeOut_Coffee).TotalSeconds > 180 && bFirstTrig_Coffee == true) | |||||
{ | { | ||||
DeviceProcessLogShow("接咖啡超时,接咖啡结束,等待取咖啡"); | DeviceProcessLogShow("接咖啡超时,接咖啡结束,等待取咖啡"); | ||||
bFirstTrig_Coffee = false; | bFirstTrig_Coffee = false; | ||||
@@ -231,7 +231,7 @@ namespace BPASmartClient.MorkT_Container | |||||
bFirstTrig_Juice = true; | bFirstTrig_Juice = true; | ||||
delayTimeOut_Juice = DateTime.Now; | delayTimeOut_Juice = DateTime.Now; | ||||
} | } | ||||
else if (DateTime.Now.Subtract(delayTimeOut_Juice).TotalSeconds > 3 && bFirstTrig_Juice == true) | |||||
else if (DateTime.Now.Subtract(delayTimeOut_Juice).TotalSeconds > 15 && bFirstTrig_Juice == true) | |||||
{ | { | ||||
DeviceProcessLogShow("接果汁超时,接果汁结束,等待取果汁"); | DeviceProcessLogShow("接果汁超时,接果汁结束,等待取果汁"); | ||||
bFirstTrig_Juice = false; | bFirstTrig_Juice = false; | ||||
@@ -246,7 +246,7 @@ namespace BPASmartClient.MorkT_Container | |||||
bFirstTrig_TeaWater = true; | bFirstTrig_TeaWater = true; | ||||
delayTimeOut_Water = DateTime.Now;//开启接水信号后,记录当前时间 | delayTimeOut_Water = DateTime.Now;//开启接水信号后,记录当前时间 | ||||
} | } | ||||
else if (DateTime.Now.Subtract(delayTimeOut_Water).TotalSeconds >= 5 && bFirstTrig_TeaWater == true)//接水超过50s后,启动接水完成标志,开启接水程序 | |||||
else if (DateTime.Now.Subtract(delayTimeOut_Water).TotalSeconds >= 50 && bFirstTrig_TeaWater == true)//接水超过50s后,启动接水完成标志,开启接水程序 | |||||
{ | { | ||||
DeviceProcessLogShow("接茶或水延迟时间结束"); | DeviceProcessLogShow("接茶或水延迟时间结束"); | ||||
bFirstTrig_TeaWater = false; | bFirstTrig_TeaWater = false; | ||||
@@ -329,7 +329,7 @@ namespace BPASmartClient.MorkT_Container | |||||
/// 判断是否有咖啡订单 | /// 判断是否有咖啡订单 | ||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
private bool IsMakeCoffee() | |||||
private bool IsMakeCoffee() | |||||
{ | { | ||||
bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesCoffee.Count > 0 && !morkTLebaiJC.IsHaveCoffeeCup) ? true : false; | bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesCoffee.Count > 0 && !morkTLebaiJC.IsHaveCoffeeCup) ? true : false; | ||||
return bMake; | return bMake; | ||||
@@ -340,7 +340,7 @@ namespace BPASmartClient.MorkT_Container | |||||
/// <returns></returns> | /// <returns></returns> | ||||
private bool IsMakeJuice() | private bool IsMakeJuice() | ||||
{ | { | ||||
bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesJuicer.Count > 0 && !morkTLebaiJC.IsHaveJuiceCup) ? true : false; | |||||
bool bMake = (IsHealth && morkTLebaiJC.morkOrderPushesJuicer.Count > 0 && !morkTLebaiJC.IsHaveJuiceCup) ? true : false; | |||||
return bMake; | return bMake; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -490,7 +490,7 @@ namespace BPASmartClient.MorkT_Container | |||||
outCupCheck = false; | outCupCheck = false; | ||||
OrderChange(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | OrderChange(morkTLebaiJC.morkOrderPushesCoffee.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | ||||
int resultTakeCup = takeCup(); | int resultTakeCup = takeCup(); | ||||
if (resultTakeCup == 1 || true) | |||||
if (resultTakeCup == 1) | |||||
{ | { | ||||
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | ||||
Sence(GVL_MorkT.机器人安全位); | Sence(GVL_MorkT.机器人安全位); | ||||
@@ -549,7 +549,7 @@ namespace BPASmartClient.MorkT_Container | |||||
{ | { | ||||
OrderChange(morkTLebaiJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | OrderChange(morkTLebaiJC.morkOrderPushesWater.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | ||||
int resultTakeCup = takeCup(); | int resultTakeCup = takeCup(); | ||||
if (resultTakeCup == 1 || true) | |||||
if (resultTakeCup == 1) | |||||
{ | { | ||||
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | ||||
Sence(GVL_MorkT.接开水); | Sence(GVL_MorkT.接开水); | ||||
@@ -587,7 +587,7 @@ namespace BPASmartClient.MorkT_Container | |||||
{ | { | ||||
OrderChange(morkTLebaiJC.morkOrderPushesTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | OrderChange(morkTLebaiJC.morkOrderPushesTea.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | ||||
int resultTakeCup = takeCup(); | int resultTakeCup = takeCup(); | ||||
if (resultTakeCup == 1 || true) | |||||
if (resultTakeCup == 1) | |||||
{ | { | ||||
DeviceProcessLogShow("取茶杯完成"); | DeviceProcessLogShow("取茶杯完成"); | ||||
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | ||||
@@ -688,7 +688,7 @@ namespace BPASmartClient.MorkT_Container | |||||
OrderChange(morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | OrderChange(morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); | ||||
int resultTakeCup = takeCup(); | int resultTakeCup = takeCup(); | ||||
JuiceCH = morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).Loc; | JuiceCH = morkTLebaiJC.morkOrderPushesJuicer.ElementAt(0).Loc; | ||||
if (resultTakeCup == 1 ||true ) | |||||
if (resultTakeCup == 1) | |||||
{ | { | ||||
getIce(); | getIce(); | ||||
new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }.Publish(); | ||||
@@ -7,7 +7,6 @@ using BPASmartClient.Device; | |||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
using BPASmartClient.LebaiRobot; | using BPASmartClient.LebaiRobot; | ||||
using BPASmartClient.DRCoffee; | using BPASmartClient.DRCoffee; | ||||
using BPASmartClient.IceMaker; | |||||
namespace BPASmartClient.MorkT_Container | namespace BPASmartClient.MorkT_Container | ||||
{ | { | ||||
@@ -208,7 +208,7 @@ namespace BPASmartClient.MorkT_Container.ViewModel; | |||||
} | } | ||||
private void IceMaker_BtnSetIceTimeCommand() | private void IceMaker_BtnSetIceTimeCommand() | ||||
{ | { | ||||
new SetIceNumber{ Value= IceMaker_IceTime }.Publish(); | |||||
new SetIceNumber{ Value= IceMaker_IceTime * 0.1 }.Publish(); | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 咖啡机 | #region 咖啡机 | ||||
@@ -88,6 +88,14 @@ namespace BPASmartClient.ViewModel | |||||
IsAllSelect = item.IsAllSelect, | IsAllSelect = item.IsAllSelect, | ||||
morkOrderPushes = morkOrders, | morkOrderPushes = morkOrders, | ||||
}); | }); | ||||
/* | |||||
foreach (var mo in morkOrders) | |||||
{ | |||||
DoOrderEvent de = new DoOrderEvent(); | |||||
de.DeviceId = int.Parse(item.DeviceId); | |||||
de.MorkOrder = mo.OrderPush; | |||||
EventBus.EventBus.GetInstance().Publish(de); | |||||
}*/ | |||||
} | } | ||||
} | } | ||||
WeakReferenceMessenger.Default.Send("true", "Close"); | WeakReferenceMessenger.Default.Send("true", "Close"); | ||||
@@ -6,14 +6,19 @@ | |||||
<!--<add key="ClientId" value="43"/>--> | <!--<add key="ClientId" value="43"/>--> | ||||
<add key="IsEnableTest" value="false"/> | <add key="IsEnableTest" value="false"/> | ||||
<!--开发环境--> | |||||
<!--测试环境--> | |||||
<add key="apollouri" value="http://10.2.1.21:28080/"/> | <add key="apollouri" value="http://10.2.1.21:28080/"/> | ||||
<add key="AppId" value="test1_HostComputer"/> | |||||
<add key ="Namespaces" value="DEV.test1.Config"/> | |||||
<!--开发环境--> | |||||
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/> | |||||
<add key="AppId" value="dev1_common"/> | <add key="AppId" value="dev1_common"/> | ||||
<add key ="Namespaces" value="DEV.Config"/> | |||||
<add key ="Namespaces" value="DEV.Config"/>--> | |||||
<!--正式环境--> | <!--正式环境--> | ||||
<!--<add key="apollouri" value="http://47.108.65.220:28080/"/> | <!--<add key="apollouri" value="http://47.108.65.220:28080/"/> | ||||
<add key="AppId" value="order"/> | |||||
<add key="AppId" value="HostComputer"/> | |||||
<add key ="Namespaces" value="TEST1.Config"/>--> | <add key ="Namespaces" value="TEST1.Config"/>--> | ||||
<!--阿里云上报启动方式:API 或者 LOCAL--> | <!--阿里云上报启动方式:API 或者 LOCAL--> | ||||
@@ -389,7 +389,7 @@ | |||||
Foreground="{StaticResource TextBlockForeground}" | Foreground="{StaticResource TextBlockForeground}" | ||||
IcoText="" | IcoText="" | ||||
MouseLeftButtonDown="IcoButton_MouseLeftButtonDown" | MouseLeftButtonDown="IcoButton_MouseLeftButtonDown" | ||||
Style="{StaticResource NewButtonStyle}" /> | |||||
Style="{StaticResource IcoButtonStyle}" /> | |||||
<pry:IcoButton | <pry:IcoButton | ||||
Grid.Column="5" | Grid.Column="5" | ||||
@@ -400,7 +400,7 @@ | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TextBlockForeground}" | Foreground="{StaticResource TextBlockForeground}" | ||||
IcoText="" | IcoText="" | ||||
Style="{StaticResource NewButtonStyle}" /> | |||||
Style="{StaticResource IcoButtonStyle}" /> | |||||
</Grid> | </Grid> | ||||
@@ -5,9 +5,10 @@ | |||||
<TargetFramework>net6.0-windows</TargetFramework> | <TargetFramework>net6.0-windows</TargetFramework> | ||||
<Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
<UseWPF>true</UseWPF> | <UseWPF>true</UseWPF> | ||||
<ApplicationManifest>app.manifest</ApplicationManifest> | |||||
<ApplicationManifest></ApplicationManifest> | |||||
<ApplicationIcon>hbl.ico</ApplicationIcon> | <ApplicationIcon>hbl.ico</ApplicationIcon> | ||||
<PlatformTarget>AnyCPU</PlatformTarget> | <PlatformTarget>AnyCPU</PlatformTarget> | ||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild> | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -17,11 +17,6 @@ | |||||
</UserControl.DataContext> | </UserControl.DataContext> | ||||
<Grid> | <Grid> | ||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="40" | |||||
Foreground="Wheat" | |||||
Text="硬件状态" /> | |||||
<pry:DosingSystem/> | |||||
</Grid> | </Grid> | ||||
</UserControl> | </UserControl> |
@@ -62,7 +62,7 @@ | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="Aqua" | Foreground="Aqua" | ||||
IcoText="" | IcoText="" | ||||
Style="{StaticResource NewButtonStyle}" /> | |||||
Style="{StaticResource IcoButtonStyle}" /> | |||||
<pry:IcoButton | <pry:IcoButton | ||||
Grid.Column="3" | Grid.Column="3" | ||||
@@ -76,7 +76,7 @@ | |||||
Foreground="Aqua" | Foreground="Aqua" | ||||
IcoText="" | IcoText="" | ||||
IsEnabled="True" | IsEnabled="True" | ||||
Style="{StaticResource NewButtonStyle}" /> | |||||
Style="{StaticResource IcoButtonStyle}" /> | |||||
</StackPanel> | </StackPanel> | ||||
<!--#endregion--> | <!--#endregion--> | ||||
@@ -1,79 +0,0 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | |||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | |||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | |||||
<security> | |||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | |||||
<!-- UAC 清单选项 | |||||
如果想要更改 Windows 用户帐户控制级别,请使用 | |||||
以下节点之一替换 requestedExecutionLevel 节点。 | |||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | |||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | |||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | |||||
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。 | |||||
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此 | |||||
元素。 | |||||
--> | |||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | |||||
</requestedPrivileges> | |||||
</security> | |||||
</trustInfo> | |||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | |||||
<application> | |||||
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的 | |||||
Windows 版本的列表。取消评论适当的元素, | |||||
Windows 将自动选择最兼容的环境。 --> | |||||
<!-- Windows Vista --> | |||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />--> | |||||
<!-- Windows 7 --> | |||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--> | |||||
<!-- Windows 8 --> | |||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />--> | |||||
<!-- Windows 8.1 --> | |||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />--> | |||||
<!-- Windows 10 --> | |||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />--> | |||||
</application> | |||||
</compatibility> | |||||
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行 | |||||
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需 | |||||
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应 | |||||
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。 | |||||
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation --> | |||||
<!-- | |||||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | |||||
<windowsSettings> | |||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> | |||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware> | |||||
</windowsSettings> | |||||
</application> | |||||
--> | |||||
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) --> | |||||
<!-- | |||||
<dependency> | |||||
<dependentAssembly> | |||||
<assemblyIdentity | |||||
type="win32" | |||||
name="Microsoft.Windows.Common-Controls" | |||||
version="6.0.0.0" | |||||
processorArchitecture="*" | |||||
publicKeyToken="6595b64144ccf1df" | |||||
language="*" | |||||
/> | |||||
</dependentAssembly> | |||||
</dependency> | |||||
--> | |||||
</assembly> |
@@ -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.Linq; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using System.Windows; | using System.Windows; | ||||
using AlarmInfo = BPASmartClient.CustomResource.Pages.Model.AlarmInfo; | |||||
namespace FryPot_DosingSystem | namespace FryPot_DosingSystem | ||||
{ | { | ||||
@@ -37,23 +38,25 @@ namespace FryPot_DosingSystem | |||||
mv.Show(); | mv.Show(); | ||||
DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 | DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 | ||||
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | ||||
HubHelper.GetInstance.Connect("192.168.1.130", 8089); | |||||
AlarmHelper<AlarmInfo>.Init(); | |||||
} | } | ||||
else | else | ||||
mv.Close(); | 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) | protected override void OnExit(ExitEventArgs e) | ||||
{ | { | ||||
@@ -171,7 +174,7 @@ namespace FryPot_DosingSystem | |||||
SubMenuName = "用户登录", | SubMenuName = "用户登录", | ||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | ||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.LoginView" | |||||
ToggleWindowPath = "Pages.View.SubPagLoginView" | |||||
}); | }); | ||||
UserManager.Add(new SubMenumodel() | UserManager.Add(new SubMenumodel() | ||||
@@ -192,6 +195,23 @@ namespace FryPot_DosingSystem | |||||
subMenumodels = UserManager, | subMenumodels = UserManager, | ||||
}); | }); | ||||
#endregion | #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() | private void LoginDataInite() | ||||
{ | { | ||||
@@ -20,7 +20,7 @@ namespace FryPot_DosingSystem.Control | |||||
ModbusTcp modbus = new ModbusTcp(); | ModbusTcp modbus = new ModbusTcp(); | ||||
private string Ip { get; set; } | private string Ip { get; set; } | ||||
private string Port { get; set; } | private string Port { get; set; } | ||||
private bool Connected { get; set; } | |||||
public bool Connected { get; set; } | |||||
private string DeviceName { get; set; } | private string DeviceName { get; set; } | ||||
@@ -78,7 +78,7 @@ namespace FryPot_DosingSystem.Control | |||||
{ | { | ||||
foreach (var item in Variables) | 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)) | if (Data.ContainsKey(item.Address)) | ||||
{ | { | ||||
Data[item.Address] = res; | Data[item.Address] = res; | ||||
@@ -95,8 +95,11 @@ namespace FryPot_DosingSystem.Control | |||||
}),$"设备【{DeviceName}】PLC实时数据读取线程"); | }),$"设备【{DeviceName}】PLC实时数据读取线程"); | ||||
} | } | ||||
public void WritePlcData(string address,ushort value) | public void WritePlcData(string address,ushort value) | ||||
{ | |||||
modbus.Write(address, value,"180项目"); | |||||
{ | |||||
lock (this) | |||||
{ | |||||
modbus.Write(address, value); | |||||
} | |||||
} | } | ||||
public ConcurrentDictionary<string, object> GetAllData() | public ConcurrentDictionary<string, object> GetAllData() | ||||
{ | { | ||||
@@ -11,6 +11,8 @@ namespace FryPot_DosingSystem.Control | |||||
/// </summary> | /// </summary> | ||||
internal class GlobalVariable | internal class GlobalVariable | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 滚筒线1 | /// 滚筒线1 | ||||
/// </summary> | /// </summary> | ||||
@@ -61,17 +63,57 @@ namespace FryPot_DosingSystem.Control | |||||
/// </summary> | /// </summary> | ||||
public bool ExitMainTask { get; set; } | public bool ExitMainTask { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 允许AGV去线体装桶条件 | |||||
/// 允许AGV去线体1装桶条件 | |||||
/// </summary> | /// </summary> | ||||
public bool AllowAgvToLineLoadRoller { get; set; } = true; | public bool AllowAgvToLineLoadRoller { get; set; } = true; | ||||
/// <summary> | /// <summary> | ||||
/// 允许AGV去线体2装桶条件 | |||||
/// </summary> | |||||
public bool AllowAgvToLineTwoLoadRoller { get; set; } = true; | |||||
/// <summary> | |||||
/// 允许AGV去线体3装桶条件 | |||||
/// </summary> | |||||
public bool AllowAgvToLineThreeLoadRoller { get; set; } = true; | |||||
/// <summary> | |||||
/// 配方唯一ID | /// 配方唯一ID | ||||
/// </summary> | /// </summary> | ||||
public string RecipeId { get; set; } | public string RecipeId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 进桶出桶互锁 | |||||
/// 线体1对应的进桶出桶互锁 | |||||
/// </summary> | /// </summary> | ||||
public bool InOrOutputLock { get; set; } | 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 | #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; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -30,38 +31,42 @@ namespace FryPot_DosingSystem.View | |||||
private void Button_Click(object sender, RoutedEventArgs e) | 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.MergedDictionaries> | ||||
</ResourceDictionary> | </ResourceDictionary> | ||||
</UserControl.Resources> | </UserControl.Resources> | ||||
<Grid> | <Grid> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
<RowDefinition Height="50"/> | |||||
<RowDefinition Height="20"/> | |||||
<RowDefinition Height="55"/> | |||||
<RowDefinition Height="10"/> | |||||
<RowDefinition/> | <RowDefinition/> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | <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> | </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" > | <Viewbox Grid.Row="2" VerticalAlignment="Top" > | ||||
<ItemsControl ItemsSource="{Binding devices}"> | |||||
<ItemsControl ItemsSource="{Binding devices}" Padding="0,5,0,0"> | |||||
<ItemsControl.ItemsPanel> | <ItemsControl.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
<StackPanel></StackPanel> | <StackPanel></StackPanel> | ||||
@@ -190,17 +190,26 @@ | |||||
<Grid > | <Grid > | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
<RowDefinition Height="50"></RowDefinition> | <RowDefinition Height="50"></RowDefinition> | ||||
<RowDefinition Height="60"></RowDefinition> | |||||
<RowDefinition Height="80"></RowDefinition> | |||||
<RowDefinition Height="40"></RowDefinition> | |||||
<RowDefinition></RowDefinition> | <RowDefinition></RowDefinition> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<TextBlock Text="配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="25" Margin="0,10"></TextBlock> | <TextBlock Text="配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="25" Margin="0,10"></TextBlock> | ||||
<UniformGrid Grid.Row="1" Columns="2"> | <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" | VerticalContentAlignment="Center" | ||||
BorderBrush="Aqua" VerticalAlignment="Center" FontSize="16" ></TextBox> | 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> | ||||
<StackPanel Orientation="Horizontal"> | <StackPanel Orientation="Horizontal"> | ||||
<Button Content="添加原料" Width="150" Margin="10" Height="30" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Cursor="Hand" Command="{Binding AddRecipe}" ></Button> | <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> | <Button Click="Button_Click" Content="取消" Height="30" FontSize="20" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Width="100" Margin="8,10" Cursor="Hand"></Button> | ||||
</StackPanel> | </StackPanel> | ||||
</UniformGrid> | </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 ItemsSource="{Binding materials}"> | ||||
<ItemsControl.ItemsPanel> | <ItemsControl.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
@@ -228,8 +252,8 @@ | |||||
<ColumnDefinition Width="225"></ColumnDefinition> | <ColumnDefinition Width="225"></ColumnDefinition> | ||||
<ColumnDefinition></ColumnDefinition> | <ColumnDefinition></ColumnDefinition> | ||||
</Grid.ColumnDefinitions> | </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}"> | <Style TargetType="{x:Type ComboBoxItem}"> | ||||
<Setter Property="Background" Value="White" /> | <Setter Property="Background" Value="White" /> | ||||
<Setter Property="Foreground" Value="#e69519"/> | <Setter Property="Foreground" Value="#e69519"/> | ||||
@@ -252,7 +276,7 @@ | |||||
Content="删除" | Content="删除" | ||||
Width="94" | Width="94" | ||||
FontSize="14" | FontSize="14" | ||||
Margin="0,0,10,10" | |||||
Margin="0,0,20,10" | |||||
Background="Transparent" | Background="Transparent" | ||||
BorderBrush="#e69519" Foreground="LightGray" HorizontalAlignment="Right" | BorderBrush="#e69519" Foreground="LightGray" HorizontalAlignment="Right" | ||||
Command="{Binding DataContext.RemoveRecipe,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" | Command="{Binding DataContext.RemoveRecipe,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" | ||||
@@ -1,8 +1,10 @@ | |||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
using FryPot_DosingSystem.Model; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
using System.Text.RegularExpressions; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using System.Windows; | using System.Windows; | ||||
using System.Windows.Controls; | using System.Windows.Controls; | ||||
@@ -32,5 +34,56 @@ namespace FryPot_DosingSystem.View | |||||
{ | { | ||||
this.Close(); | 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,39 +44,53 @@ | |||||
</UserControl.Resources> | </UserControl.Resources> | ||||
<Grid> | <Grid> | ||||
<Grid.RowDefinitions> | <Grid.RowDefinitions> | ||||
<RowDefinition Height="50"></RowDefinition> | |||||
<RowDefinition Height="20"></RowDefinition> | |||||
<RowDefinition Height="55"></RowDefinition> | |||||
<RowDefinition Height="30"></RowDefinition> | |||||
<RowDefinition></RowDefinition> | <RowDefinition></RowDefinition> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<UniformGrid Columns="2"> | <UniformGrid Columns="2"> | ||||
<Image Source="../hbl.ico" HorizontalAlignment="Left"></Image> | <Image Source="../hbl.ico" HorizontalAlignment="Left"></Image> | ||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2"> | <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2"> | ||||
<pry:IcoButton Content="新建配方" | <pry:IcoButton Content="新建配方" | ||||
Margin="80,5,15,5" | |||||
Margin="80,15,10,0" | |||||
Width="150" | Width="150" | ||||
FontSize="16" | FontSize="16" | ||||
Foreground="Aqua" | Foreground="Aqua" | ||||
IcoText="" | IcoText="" | ||||
Cursor="Hand" | Cursor="Hand" | ||||
Style="{StaticResource NewButtonStyle}" | |||||
Style="{StaticResource IcoButtonStyle}" | |||||
Command="{Binding NewRecipe}"> | Command="{Binding NewRecipe}"> | ||||
</pry:IcoButton> | </pry:IcoButton> | ||||
<pry:IcoButton | <pry:IcoButton | ||||
Content="保存配方" Margin="5,5" | |||||
Content="保存配方" Margin="5,15,10,0" | |||||
Width="150" | Width="150" | ||||
FontSize="16" | FontSize="16" | ||||
Foreground="Aqua" | Foreground="Aqua" | ||||
IcoText="" | IcoText="" | ||||
Cursor="Hand" | Cursor="Hand" | ||||
Style="{StaticResource NewButtonStyle}" | |||||
Style="{StaticResource IcoButtonStyle}" | |||||
Command="{Binding SaveRecipe}"> | Command="{Binding SaveRecipe}"> | ||||
</pry:IcoButton> | </pry:IcoButton> | ||||
</StackPanel> | </StackPanel> | ||||
</UniformGrid> | </UniformGrid> | ||||
<!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>--> | <!--<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 ItemsSource="{Binding recipeModels}"> | ||||
<ItemsControl.ItemsPanel> | <ItemsControl.ItemsPanel> | ||||
<ItemsPanelTemplate> | <ItemsPanelTemplate> | ||||
@@ -90,26 +104,26 @@ | |||||
<ControlTemplate> | <ControlTemplate> | ||||
<Grid x:Name="gr"> | <Grid x:Name="gr"> | ||||
<Grid.ColumnDefinitions> | <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> | </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" | 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> | 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> | 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> | </Button> | ||||
</Grid> | |||||
</Grid> | </Grid> | ||||
<ControlTemplate.Triggers> | <ControlTemplate.Triggers> | ||||
<Trigger Property="IsMouseOver" Value="true"> | <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; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -17,11 +18,479 @@ namespace FryPot_DosingSystem.ViewModel | |||||
public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel()); | public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel()); | ||||
public 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 | #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 FryPot_DosingSystem.Model; | ||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | using Microsoft.Toolkit.Mvvm.ComponentModel; | ||||
using Microsoft.Toolkit.Mvvm.Input; | using Microsoft.Toolkit.Mvvm.Input; | ||||
@@ -18,27 +19,38 @@ namespace FryPot_DosingSystem.ViewModel | |||||
/// </summary> | /// </summary> | ||||
public string recipeId { get; set; } | public string recipeId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 配料名称 | |||||
/// 配方名称 | |||||
/// </summary> | /// </summary> | ||||
private string _recipeName; | private string _recipeName; | ||||
public string RecipeName { get { return _recipeName; } set { _recipeName = value; OnPropertyChanged(); } } | 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<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 AddRecipe { get; set; } | ||||
public RelayCommand<string> RemoveRecipe { get; set; } | public RelayCommand<string> RemoveRecipe { get; set; } | ||||
public RelayCommand Comfirm { get; set; } | public RelayCommand Comfirm { get; set; } | ||||
public NewRecipeViewModel() | 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) | if (Id != null && Id is string strId) | ||||
{ | { | ||||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == strId); | var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == strId); | ||||
if (res != null && res is NewRecipeModel rom) | if (res != null && res is NewRecipeModel rom) | ||||
{ | { | ||||
RecipeName = rom.RecipeName; | RecipeName = rom.RecipeName; | ||||
RecipeRollerNum = rom.materialCollection.Count; | |||||
foreach (var item in rom.materialCollection) | foreach (var item in rom.materialCollection) | ||||
{ | { | ||||
materials.Add(item); | materials.Add(item); | ||||
@@ -46,20 +58,24 @@ namespace FryPot_DosingSystem.ViewModel | |||||
recipeId = strId; | recipeId = strId; | ||||
} | } | ||||
} | } | ||||
}),"EditRecipe"); | |||||
}), "EditRecipe"); | |||||
AddRecipe = new RelayCommand(() => | 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 => | RemoveRecipe = new RelayCommand<string>(code => | ||||
{ | { | ||||
@@ -72,27 +88,35 @@ namespace FryPot_DosingSystem.ViewModel | |||||
var bom = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeId); | var bom = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeId); | ||||
if (bom == null)//新配方 | 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 | else | ||||
{ | { | ||||
goto prop; | |||||
MessageLog.GetInstance.ShowUserLog("新建配方无效【配方中没有添加原料】"); | |||||
} | } | ||||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | ActionManage.GetInstance.Send("CloseNewRecipeView"); | ||||
} | } | ||||
else //已有配方,用于编辑 | else //已有配方,用于编辑 | ||||
{ | { | ||||
bom.materialCollection= materials; | |||||
bom.materialCollection = materials; | |||||
bom.RecipeName = RecipeName; | bom.RecipeName = RecipeName; | ||||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | ActionManage.GetInstance.Send("CloseNewRecipeView"); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -14,7 +14,7 @@ namespace FryPot_DosingSystem.ViewModel | |||||
{ | { | ||||
internal class RecipeSetDownViewModel : ObservableObject | internal class RecipeSetDownViewModel : ObservableObject | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 配方下发 | /// 配方下发 | ||||
@@ -36,18 +36,19 @@ namespace FryPot_DosingSystem.ViewModel | |||||
var res = Recipes.FirstOrDefault(p => p.RecipeId == strId); | var res = Recipes.FirstOrDefault(p => p.RecipeId == strId); | ||||
if (res != null) | if (res != null) | ||||
{ | { | ||||
RecipeSetDown(res); | |||||
RecipeSetDown(new NewRecipeModel[] { res }); | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
AllRecipeSetDownCommand = new RelayCommand(() => | 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> | ||||
/// 数据下发方法 | /// 数据下发方法 | ||||
/// </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 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
# Visual Studio Version 17 | |||||
# Blend for Visual Studio Version 17 | |||||
VisualStudioVersion = 17.0.32002.185 | VisualStudioVersion = 17.0.32002.185 | ||||
MinimumVisualStudioVersion = 10.0.40219.1 | MinimumVisualStudioVersion = 10.0.40219.1 | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DRCoffee", "BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj", "{31E9DC70-5889-4BA5-A5BA-FFDE66AFF314}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.DRCoffee", "BPASmartClient.DRCoffee\BPASmartClient.DRCoffee.csproj", "{31E9DC70-5889-4BA5-A5BA-FFDE66AFF314}" | ||||
@@ -116,7 +116,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDemo", "TestDemo\TestDe | |||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{099E047C-F40E-47A3-A5BA-81FC1500D5E8}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.HubHelper", "BPASmartClient.HubHelper\BPASmartClient.HubHelper.csproj", "{099E047C-F40E-47A3-A5BA-81FC1500D5E8}" | ||||
EndProject | EndProject | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTM", "BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj", "{38158761-8060-4C53-BD50-CCF531C5ED0B}" | |||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTM", "BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj", "{76B6B333-0109-4EE8-A9B2-3E53A7421D92}" | |||||
EndProject | EndProject | ||||
Global | Global | ||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
@@ -1092,26 +1092,6 @@ Global | |||||
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x64.Build.0 = Release|Any CPU | {099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x64.Build.0 = Release|Any CPU | ||||
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.ActiveCfg = Release|Any CPU | {099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.ActiveCfg = Release|Any CPU | ||||
{099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.Build.0 = Release|Any CPU | {099E047C-F40E-47A3-A5BA-81FC1500D5E8}.Release|x86.Build.0 = Release|Any CPU | ||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|ARM.Build.0 = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|ARM64.Build.0 = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|x64.Build.0 = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|x86.ActiveCfg = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Debug|x86.Build.0 = Debug|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|ARM.ActiveCfg = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|ARM.Build.0 = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|ARM64.ActiveCfg = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|ARM64.Build.0 = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|x64.ActiveCfg = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|x64.Build.0 = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|x86.ActiveCfg = Release|Any CPU | |||||
{38158761-8060-4C53-BD50-CCF531C5ED0B}.Release|x86.Build.0 = Release|Any CPU | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
@@ -1165,7 +1145,6 @@ Global | |||||
{E7168B03-68E5-4285-BB95-5660F877577A} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | {E7168B03-68E5-4285-BB95-5660F877577A} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | ||||
{A49E1C5A-9489-451C-9CE6-CEA586234B84} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | {A49E1C5A-9489-451C-9CE6-CEA586234B84} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | ||||
{099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | {099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | ||||
{38158761-8060-4C53-BD50-CCF531C5ED0B} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(ExtensibilityGlobals) = postSolution | GlobalSection(ExtensibilityGlobals) = postSolution | ||||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | ||||
@@ -16,7 +16,7 @@ namespace TestDemo | |||||
{ | { | ||||
AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); | AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); | ||||
string value = JsonConvert.SerializeObject(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); | var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); | ||||
} | } | ||||
@@ -25,7 +25,7 @@ namespace TestDemo | |||||
Upstreamrequest aGVToUpSystem = new Upstreamrequest(); | Upstreamrequest aGVToUpSystem = new Upstreamrequest(); | ||||
string value = JsonConvert.SerializeObject(aGVToUpSystem); | 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); | var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); | ||||
} | } | ||||
} | } |