Browse Source

解决冲突

样式分支
pengliangyang 2 years ago
parent
commit
d0c37edfde
76 changed files with 5207 additions and 524 deletions
  1. +288
    -42
      BPASmartClient.AGV/AGVHelper.cs
  2. +1
    -0
      BPASmartClient.Business/Plugin/ConfigMgr.cs
  3. +10
    -0
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  4. BIN
     
  5. BIN
     
  6. BIN
     
  7. BIN
     
  8. BIN
     
  9. +1
    -4
      BPASmartClient.CustomResource/Pages/Model/Config.cs
  10. +4
    -0
      BPASmartClient.CustomResource/Pages/Model/Global.cs
  11. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
  12. +4
    -2
      BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
  13. +2
    -1
      BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs
  14. +2
    -0
      BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
  15. +1
    -0
      BPASmartClient.CustomResource/Pages/Model/UserManager.cs
  16. +16
    -0
      BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs
  17. +330
    -0
      BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml
  18. +60
    -0
      BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs
  19. +2
    -2
      BPASmartClient.CustomResource/Pages/View/AlarmView.xaml
  20. +14
    -0
      BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml
  21. +28
    -0
      BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml.cs
  22. +4
    -3
      BPASmartClient.CustomResource/Pages/View/RunLogView.xaml
  23. +406
    -0
      BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml
  24. +44
    -0
      BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs
  25. +2
    -2
      BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
  26. +170
    -0
      BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml
  27. +27
    -0
      BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml.cs
  28. +449
    -6
      BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml
  29. +87
    -1
      BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs
  30. +61
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs
  31. +48
    -14
      BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
  32. +28
    -17
      BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
  33. +14
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs
  34. +158
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs
  35. +77
    -0
      BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs
  36. +32
    -2
      BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs
  37. +2
    -1
      BPASmartClient.MorkS/Control_Morks.cs
  38. +4
    -1
      BPASmartClient.MorkS/ViewModel/DebugViewModel.cs
  39. +25
    -19
      BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs
  40. +13
    -0
      BPASmartClient.S7Net/BPASmartClient.S7Net.csproj
  41. +69
    -0
      BPASmartClient.S7Net/SiemensHelper.cs
  42. +6
    -6
      BPASmartClient/App.config
  43. +7
    -0
      DosingSystem/App.xaml.cs
  44. +8
    -0
      FryPot_DosingSystem/AGV/WhichCart.cs
  45. +221
    -21
      FryPot_DosingSystem/Control/DeviceOperate.cs
  46. +1466
    -264
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  47. +79
    -4
      FryPot_DosingSystem/Control/GlobalVariable.cs
  48. +16
    -8
      FryPot_DosingSystem/FryPotStatus/PotFiveStatus.cs
  49. +15
    -8
      FryPot_DosingSystem/FryPotStatus/PotFourStatus.cs
  50. +15
    -8
      FryPot_DosingSystem/FryPotStatus/PotOneStatus.cs
  51. +16
    -8
      FryPot_DosingSystem/FryPotStatus/PotThreeStatus.cs
  52. +15
    -8
      FryPot_DosingSystem/FryPotStatus/PotTwoStatus.cs
  53. +2
    -0
      FryPot_DosingSystem/FryPot_DosingSystem.csproj
  54. +16
    -0
      FryPot_DosingSystem/Model/FlowProcessManage.cs
  55. +48
    -0
      FryPot_DosingSystem/Model/FlowProcessModel.cs
  56. +6
    -1
      FryPot_DosingSystem/Model/RecipeModel.cs
  57. +93
    -1
      FryPot_DosingSystem/Resources/fonts/demo_index.html
  58. BIN
     
  59. +164
    -11
      FryPot_DosingSystem/View/AgvView.xaml
  60. +3
    -1
      FryPot_DosingSystem/View/AgvView.xaml.cs
  61. +57
    -6
      FryPot_DosingSystem/View/DebugView.xaml
  62. +75
    -0
      FryPot_DosingSystem/View/FlowProcessView.xaml
  63. +35
    -0
      FryPot_DosingSystem/View/FlowProcessView.xaml.cs
  64. +13
    -13
      FryPot_DosingSystem/View/NewRecipeView.xaml
  65. +1
    -0
      FryPot_DosingSystem/View/RecipeManageView.xaml
  66. +3
    -2
      FryPot_DosingSystem/View/RecipeSendDownView.xaml
  67. +50
    -5
      FryPot_DosingSystem/View/SqliteDataView.xaml
  68. +4
    -1
      FryPot_DosingSystem/View/SqliteDataView.xaml.cs
  69. +7
    -0
      FryPot_DosingSystem/ViewModel/AgvViewModel.cs
  70. +84
    -0
      FryPot_DosingSystem/ViewModel/DebugViewModel.cs
  71. +1
    -1
      FryPot_DosingSystem/ViewModel/DeviceListViewModel.cs
  72. +77
    -0
      FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
  73. +1
    -1
      FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs
  74. +16
    -0
      FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs
  75. +57
    -6
      FryPot_DosingSystem/ViewModel/SqliteDataViewModel.cs
  76. +46
    -22
      SmartClient.sln

+ 288
- 42
BPASmartClient.AGV/AGVHelper.cs View File

@@ -95,49 +95,49 @@ namespace BPASmartClient.AGV
/// <returns></returns>
public string AgvToLineOneLoadRoller(string robotJobId)
{
string url = AGVRequestUrl.GetInstance.TaskSendUrl;
//请求报文头
HttpRequestHeaderModel.GetInstance.appKey = "";
HttpRequestHeaderModel.GetInstance.appSecret = "";
HttpRequestHeaderModel.GetInstance.requestId = "";
HttpRequestHeaderModel.GetInstance.timestamp = "";
HttpRequestHeaderModel.GetInstance.version = "2.8";
string head = JsonConvert.SerializeObject(HttpRequestHeaderModel.GetInstance);
//请求报文体
AGVModel.GetInstance.robotJobId = robotJobId;//上游提供
AGVModel.GetInstance.warehouseId = 123; //仓库编号
AGVModel.GetInstance.jobPriority = 1;//任务执行的优先级
AGVModel.GetInstance.jobPriorityType = 1;//0:根据优先级来执行,1:强制执行
AGVModel.GetInstance.jobType = "POINT_ROLLER_MOVE"; //SLOT_ROLLER_MOVE / POINT_ROLLER_MOVE
//详细任务数据
//点到点
AGV_PointRollerJobData.GetInstance.startPoint = "";//起点点位
AGV_PointRollerJobData.GetInstance.endPoint = "";//目的点位
AGV_PointRollerJobData.GetInstance.autoLoad = true;//是否自动上料 true:自动上料 false:人工上料
AGV_PointRollerJobData.GetInstance.enableIOLoad = true;//上料交互方式 false:接口交互 true:光电交互
AGV_PointRollerJobData.GetInstance.autoUnload = true;//是否自动下料 true:自动下料 false:人工下料
AGV_PointRollerJobData.GetInstance.enableIOUnload = true;//下料交互方式 false:接口交互 true:光电交互
AGVModel.GetInstance.jobData = AGV_PointRollerJobData.GetInstance;
string body = JsonConvert.SerializeObject(AGVModel.GetInstance);
// string newBody = String.Join(",\r\n", body.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);
//启用签名
//url = url + "?sign=" + MD5Deal(body);
string data = HttpRequest(url, head, body);
object objData = JsonConvert.DeserializeObject(data);
if (objData != null && objData is HttpResponseBodyModel response)
{
return response.code;
}
//// string newBody = String.Join(",\r\n", body.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);
////启用签名
////url = url + "?sign=" + MD5Deal(body);
//string data = HttpRequest(url, head, body);
//object objData = JsonConvert.DeserializeObject(data);
//if (objData != null && objData is HttpResponseBodyModel response)
//{
// return response.code;
//}
return "Analysis Error";
}
/// <summary>
@@ -239,6 +239,55 @@ namespace BPASmartClient.AGV
return "Analysis Error";
}
/// <summary>
/// AGV从清洗台到4号线体卸桶
/// </summary>
/// <returns></returns>
public string AgvFromCleanToLineFourUnLoadRoller(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 body = JsonConvert.SerializeObject(AGVModel.GetInstance);
////启用签名
////url = url + "?sign=" + MD5Deal(body);
//string data = HttpRequest(url, head, body);
//object objData = JsonConvert.DeserializeObject(data);
//if (objData != null && objData is HttpResponseBodyModel response)
//{
// return response.code;
//}
return "Analysis Error";
}
/// <summary>
/// AGV离开炒锅1
/// </summary>
/// <returns></returns>
@@ -483,6 +532,203 @@ namespace BPASmartClient.AGV
//}
return "Analysis Error";
}

/// <summary>
/// AGV从1号线运空桶洗桶
/// </summary>
/// <returns></returns>
public string AgvLeaveLOneToClean(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 body = JsonConvert.SerializeObject(AGVModel.GetInstance);
////启用签名
////url = url + "?sign=" + MD5Deal(body);
//string data = HttpRequest(url, head, body);
//object objData = JsonConvert.DeserializeObject(data);
//if (objData != null && objData is HttpResponseBodyModel response)
//{
// return response.code;
//}
return "Analysis Error";
}
/// <summary>
/// AGV从2号线运空桶洗桶
/// </summary>
/// <returns></returns>
public string AgvLeaveLTwoToClean(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 body = JsonConvert.SerializeObject(AGVModel.GetInstance);
////启用签名
////url = url + "?sign=" + MD5Deal(body);
//string data = HttpRequest(url, head, body);
//object objData = JsonConvert.DeserializeObject(data);
//if (objData != null && objData is HttpResponseBodyModel response)
//{
// return response.code;
//}
return "Analysis Error";
}
/// <summary>
/// AGV从3号线运空桶洗桶
/// </summary>
/// <returns></returns>
public string AgvLeaveLThreeToClean(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 body = JsonConvert.SerializeObject(AGVModel.GetInstance);
////启用签名
////url = url + "?sign=" + MD5Deal(body);
//string data = HttpRequest(url, head, body);
//object objData = JsonConvert.DeserializeObject(data);
//if (objData != null && objData is HttpResponseBodyModel response)
//{
// return response.code;
//}
return "Analysis Error";
}
/// <summary>
/// AGV从洗桶处运桶到4号洗桶线
/// </summary>
/// <returns></returns>
public string AgvLeaveCleanToLFour(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 body = JsonConvert.SerializeObject(AGVModel.GetInstance);
////启用签名
////url = url + "?sign=" + MD5Deal(body);
//string data = HttpRequest(url, head, body);
//object objData = JsonConvert.DeserializeObject(data);
//if (objData != null && objData is HttpResponseBodyModel response)
//{
// return response.code;
//}
return "Analysis Error";
}
/// <summary>
/// 任务取消
/// </summary>


+ 1
- 0
BPASmartClient.Business/Plugin/ConfigMgr.cs View File

@@ -84,6 +84,7 @@ namespace BPASmartClient.Business
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());
configurationBuilder.AddApolloConfiguration(p =>
{
p.AppId = apoid;
p.MetaServer = apolloUri;
p.Namespaces = new List<string>() { "application", namespa };


+ 10
- 0
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -114,6 +114,10 @@
<None Remove="Image\工艺流程.jpg" />
<None Remove="Image\工艺流程.png" />
<None Remove="Image\底部背景.png" />
<None Remove="Image\按钮\AddGreen.png" />
<None Remove="Image\按钮\Delete.png" />
<None Remove="Image\按钮\停用.png" />
<None Remove="Image\按钮\添加.png" />
<None Remove="Image\弹窗.png" />
<None Remove="Image\搜索按钮.png" />
<None Remove="Image\搜索框.png" />
@@ -123,6 +127,7 @@
<None Remove="Image\智慧城市科技风登录页面.png" />
<None Remove="Image\智慧城市科技风登录页面边框.png" />
<None Remove="Image\有告警.png" />
<None Remove="Image\权限背景.png" />
<None Remove="Image\标题背景.png" />
<None Remove="Image\浅色背景.jpeg" />
<None Remove="Image\环形切图\内圈\未选中.png" />
@@ -272,9 +277,14 @@
<Resource Include="Image\告警\轻微告警.png" />
<Resource Include="Image\工艺流程.jpg" />
<Resource Include="Image\工艺流程.png" />
<Resource Include="Image\按钮\AddGreen.png" />
<Resource Include="Image\按钮\Delete.png" />
<Resource Include="Image\按钮\停用.png" />
<Resource Include="Image\按钮\添加.png" />
<Resource Include="Image\弹窗.png" />
<Resource Include="Image\智慧城市科技风登录页面.png" />
<Resource Include="Image\智慧城市科技风登录页面边框.png" />
<Resource Include="Image\权限背景.png" />
<Resource Include="Image\浅色背景.jpeg" />
<Resource Include="Image\界面2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


+ 1
- 4
BPASmartClient.CustomResource/Pages/Model/Config.cs View File

@@ -38,10 +38,7 @@ namespace BPASmartClient.CustomResource.Pages.Model

private void AddData()
{
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.管理员, UserName = "admin", Password = "admin" }); ;
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.操作员, UserName = "czy", Password = "123456" });
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.观察员, UserName = "gcy", Password = "654321" });
Global.userManager.userInfos.Add(new UserInfo() { Id = IdProcess(), permission = Permission.技术员, UserName = "jsy", Password = "88888888" });
Global.userManager.userInfos.Add(new UserInfo() { permission = Permission.管理员, UserName = "admin", Password = "admin" });
SaveUser();
}



+ 4
- 0
BPASmartClient.CustomResource/Pages/Model/Global.cs View File

@@ -12,6 +12,10 @@ namespace BPASmartClient.CustomResource.Pages.Model
public static UserManager userManager { get; set; } = new UserManager();

public static UserInfo userInfo { get; set; } = new UserInfo();
/// <summary>
/// 重置密码页面传值
/// </summary>
public static UserInfo changeUserInfo { get; set; } = null;

}
}

+ 1
- 1
BPASmartClient.CustomResource/Pages/Model/MenuManage.cs View File

@@ -114,7 +114,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// 子菜单的显示隐藏设置
/// </summary>
public Visibility SubMenuVisibility { get { return _mSubMenuVisibility; } set { _mSubMenuVisibility = value; OnPropertyChanged(); } }
private Visibility _mSubMenuVisibility;
private Visibility _mSubMenuVisibility = Visibility.Collapsed;

}



+ 4
- 2
BPASmartClient.CustomResource/Pages/Model/MessageLog.cs View File

@@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.Model;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Pages.Model
{
@@ -72,8 +73,9 @@ namespace BPASmartClient.CustomResource.Pages.Model
RunLog?.Invoke(info);
}
}
int AlarmID;
public void ShowAlarmLog(string info, string AlarmNumber="_", AlarmLevel level= AlarmLevel.一般报警)
public void ShowAlarmLog(string info, string AlarmNumber = "_", AlarmLevel level = AlarmLevel.一般报警)
{
lock (alarmlock)
{
@@ -85,7 +87,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
Time = DateTime.Now.ToString("HH:mm:ss"),
Info = info,
Value = AlarmNumber,
Grade = (level)+""
Grade = (level) + ""
};
Sqlite<Alarm>.GetInstance.Base.Add(alarmLog);
Application.Current.Dispatcher.Invoke(new Action(() => { alarmLogs.Insert(0, alarmLog); }));


+ 2
- 1
BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs View File

@@ -1,5 +1,6 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
@@ -10,6 +11,6 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
public class PlcVariableInfoManage:ObservableObject
{
public ObservableCollection<PlcVariableInfoModel> VariablesInfo { get; set; } = new ObservableCollection<PlcVariableInfoModel>();
public ConcurrentDictionary<string, ObservableCollection<PlcVariableInfoModel>> VariablesInfo { get; set; } = new ConcurrentDictionary<string, ObservableCollection<PlcVariableInfoModel>>();
}
}

+ 2
- 0
BPASmartClient.CustomResource/Pages/Model/UserInfo.cs View File

@@ -10,6 +10,8 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
public class UserInfo:ObservableObject
{
public String LastLogInTime { get; set; } = "无";
public List<UserTreeViewModel> userTreeViewModels { get; set; }
public string Id { get { return _id; }set { _id = value;OnPropertyChanged(); } }
private string _id;
public Permission permission { get { return _perimission; } set { _perimission = value;OnPropertyChanged(); } }


+ 1
- 0
BPASmartClient.CustomResource/Pages/Model/UserManager.cs View File

@@ -10,5 +10,6 @@ namespace BPASmartClient.CustomResource.Pages.Model
public class UserManager
{
public ObservableCollection<UserInfo> userInfos { get; set; } = new ObservableCollection<UserInfo>();
}
}

+ 16
- 0
BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs View File

@@ -0,0 +1,16 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class UserTreeViewModel: ObservableObject
{
public string Name { get; set; }

public List<UserTreeViewModel> TreeViewItems { get; set; }
}
}

+ 330
- 0
BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml View File

@@ -0,0 +1,330 @@
<Window x:Class="BPASmartClient.CustomResource.Pages.View.AddNewUser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:common="clr-namespace:BPASmartClient.CustomResource.Pages.Model"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
Title="AddNewUser"
Width="400"
Height="350"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">
<Window.DataContext>
<vm:AddNewUserViewModel/>
</Window.DataContext>
<Window.Resources>
<Style x:Key="TxLogin" TargetType="TextBlock">
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="#ddd" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

<!--#region 密码输入框样式-->
<Style x:Key="PasswordBoxStyle" TargetType="{x:Type PasswordBox}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="FontFamily" Value="Times New Roman" />
<Setter Property="PasswordChar" Value="●" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Padding" Value="1" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="AllowDrop" Value="true" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="CaretBrush" Value="#009DFF" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type PasswordBox}">
<Border
x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"
SnapsToDevicePixels="true">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
x:Name="UserTextBlock"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="../../Fonts/#iconfont"
FontSize="20"
Foreground="{TemplateBinding BorderBrush}"
Text="&#xe850;" />

<!--<TextBlock
Name="markText"
Grid.Column="1"
Margin="10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="20"
Foreground="#88009dff"
Text="请输入账号密码"
Visibility="Collapsed" />-->

<ScrollViewer
x:Name="PART_ContentHost"
Grid.Column="1"
MinHeight="20"
VerticalAlignment="Center"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>

</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Bd" Property="Opacity" Value="0.56" />
<Setter TargetName="UserTextBlock" Property="Opacity" Value="0.56" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Bd" Property="BorderBrush" Value="#FF7EB4EA" />
<Setter TargetName="UserTextBlock" Property="Foreground" Value="#FF7EB4EA" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="Bd" Property="BorderBrush" Value="#FF569DE5" />
<Setter TargetName="UserTextBlock" Property="Foreground" Value="#FF569DE5" />
</Trigger>
<!--<DataTrigger Binding="{Binding Path=Password, RelativeSource={RelativeSource Mode=self}}" Value="">
<Setter TargetName="markText" Property="Visibility" Value="Visible" />
</DataTrigger>-->

</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
<Condition Property="IsSelectionActive" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
</MultiTrigger>
</Style.Triggers>
</Style>
<!--#endregion-->

<!--#region 用户输入框样式-->
<Style x:Key="UserTextBoxStyle" TargetType="TextBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="CaretBrush" Value="#009DFF" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"
SnapsToDevicePixels="true">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
x:Name="PasswordTextBlock"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="../../Fonts/#iconfont"
FontSize="20"
Foreground="{TemplateBinding BorderBrush}"
Text="&#xe66d;" />

<TextBlock
Name="markText"
Grid.Column="1"
Margin="10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="20"
Foreground="#88009dff"
Text="请输入账号名称"
Visibility="Collapsed" />


<ScrollViewer
x:Name="PART_ContentHost"
Grid.Column="1"
MinHeight="20"
VerticalAlignment="Center"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>

</Border>

<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="border" Property="Opacity" Value="0.56" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
</Trigger>
<DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource Mode=self}}" Value="">
<Setter TargetName="markText" Property="Visibility" Value="Visible" />
</DataTrigger>
</ControlTemplate.Triggers>

</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->

</Window.Resources>
<Border
x:Name="br"
BorderBrush="#009dff"
BorderThickness="2">
<Border.Effect>
<DropShadowEffect
BlurRadius="10"
ShadowDepth="1"
Color="#009DFF" />
</Border.Effect>
<Grid>
<Image Source="../../Image/登录界面背景.jpg" Stretch="Fill" />
<Image Source="../../Image/阴影边框.png" Stretch="Fill" />
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
Margin="0,10,0,0"
HorizontalAlignment="Center"
FontSize="20"
Foreground="#ddd"
Text="注册新用户" />
<TextBlock
Margin="20,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
FontSize="16"
Foreground="#FFEF2020"
Text="{Binding ErrorInfo}" />

<Grid Grid.Row="1">
<TextBox
Text="{Binding UserName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Name="oldpb"
Height="40"
Margin="20,0"
BorderBrush="#009DFF"
FontSize="16"
Foreground="#aadddddd"
Style="{DynamicResource UserTextBoxStyle}"
TabIndex="2" />


</Grid>

<Grid Grid.Row="2">
<PasswordBox
Name="newpb1"
Height="40"
Margin="20,0"
common:PasswordHelper.Attach="True"
common:PasswordHelper.Password="{Binding NewPassword1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
BorderBrush="#009DFF"
FontSize="16"
Foreground="#aadddddd"
PasswordChanged="newpb1_PasswordChanged"
Style="{DynamicResource PasswordBoxStyle}"
TabIndex="2" />

<TextBlock
Name="newmarkText1"
Margin="70,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="20"
Foreground="#88009dff"
IsHitTestVisible="False"
Text="请输入新密码"
Visibility="Visible" />

</Grid>

<Grid Grid.Row="3">
<PasswordBox
Name="newpb2"
Height="40"
Margin="20,0"
common:PasswordHelper.Attach="True"
common:PasswordHelper.Password="{Binding NewPassword2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
BorderBrush="#009DFF"
FontSize="16"
Foreground="#aadddddd"
PasswordChanged="newpb2_PasswordChanged"
Style="{DynamicResource PasswordBoxStyle}"
TabIndex="2" />

<TextBlock
Name="newmarkText2"
Margin="70,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="20"
Foreground="#88009dff"
IsHitTestVisible="False"
Text="请再次输入新密码"
Visibility="Visible" />

</Grid>

<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Button
Margin="20,10"
Background="#009DFF"
BorderThickness="0"
Command="{Binding ExitCommand}"
Content="取 消"
FontSize="20"
Foreground="White" />

<Button
Grid.Column="1"
Margin="20,10"
Background="#009DFF"
BorderThickness="0"
Command="{Binding ConfirmCommand}"
Content="确 认"
FontSize="20"
Foreground="White"
TabIndex="3" />

</Grid>
</Grid>
</Grid>
</Border>
</Window>

+ 60
- 0
BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs View File

@@ -0,0 +1,60 @@
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.Shapes;

namespace BPASmartClient.CustomResource.Pages.View
{
/// <summary>
/// AddNewUser.xaml 的交互逻辑
/// </summary>
public partial class AddNewUser : Window
{
public AddNewUser()
{
InitializeComponent();
this.br.MouseLeftButtonDown += (o, e) =>
{
if (e.LeftButton == MouseButtonState.Pressed) this.DragMove();
};
ActionManage.GetInstance.CancelRegister("AddNewUserViewConfirm");
ActionManage.GetInstance.CancelRegister("AddNewUserViewCancel");
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "AddNewUserViewConfirm");
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "AddNewUserViewCancel");
}

private void newpb2_PasswordChanged(object sender, RoutedEventArgs e)
{
if (this.newpb2.Password.Length > 0)
{
this.newmarkText2.Visibility = Visibility.Collapsed;
}
else
{
this.newmarkText2.Visibility = Visibility.Visible;
}
}

private void newpb1_PasswordChanged(object sender, RoutedEventArgs e)
{
if (this.newpb1.Password.Length > 0)
{
this.newmarkText1.Visibility = Visibility.Collapsed;
}
else
{
this.newmarkText1.Visibility = Visibility.Visible;
}
}
}
}

+ 2
- 2
BPASmartClient.CustomResource/Pages/View/AlarmView.xaml View File

@@ -25,7 +25,7 @@
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="TitleFontColor" Color="White" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

@@ -157,7 +157,7 @@
</StackPanel>

<!--#region 表格标题栏设置-->
<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid Grid.Row="1" Background="#FF19B7EC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />


+ 14
- 0
BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml View File

@@ -0,0 +1,14 @@
<UserControl x:Class="BPASmartClient.CustomResource.Pages.View.PermissionConfigurationView"
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:BPASmartClient.CustomResource.Pages.View"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.CustomResource/Pages/View/PermissionConfigurationView.xaml.cs View File

@@ -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.Pages.View
{
/// <summary>
/// PermissionConfigurationView.xaml 的交互逻辑
/// </summary>
public partial class PermissionConfigurationView : UserControl
{
public PermissionConfigurationView()
{
InitializeComponent();
}
}
}

+ 4
- 3
BPASmartClient.CustomResource/Pages/View/RunLogView.xaml View File

@@ -25,7 +25,7 @@
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="TitleFontColor" Color="White" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

@@ -158,7 +158,7 @@
</StackPanel>

<!--#region 表格标题栏设置-->
<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid Grid.Row="1" Background="#FF19B7EC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
@@ -261,7 +261,8 @@
<TextBlock
Grid.Column="2"
Style="{StaticResource DataTextBlockStyle}"
Text="{Binding RunLogInfo}" />
Text="{Binding RunLogInfo}"
/>

<!--<Grid Grid.Column="3">
<TextBlock


+ 406
- 0
BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml View File

@@ -0,0 +1,406 @@
<Window x:Class="BPASmartClient.CustomResource.Pages.View.UserConfigView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
Title="UserConfigView" Width="800"
Height="1000"
AllowsTransparency="True"
Background="{x:Null}"
Topmost="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">
<Window.DataContext>
<vm:UserConfigViewModel/>
</Window.DataContext>
<Window.Resources>
<ImageBrush x:Key="ImageBrushAddBlue" ImageSource="../../Image/按钮/AddGreen.png"></ImageBrush>
<ImageBrush x:Key="ImageBrushAddGray" ImageSource="../../Image/按钮/Delete.png"></ImageBrush>
<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Border Background="Transparent" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
<Grid>
<Border CornerRadius="2" Width="0.5" Background="#FF046BFF" />
<Track x:Name="PART_Track" IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="4,0,4,0" Background="DodgerBlue"></Thumb>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
</ControlTemplate>

<ControlTemplate x:Key="ScrollViewerControlTemplate1" TargetType="{x:Type ScrollViewer}">
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
<ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1"
Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"
Template="{StaticResource VerticalScrollBar}"/>
<ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
</ControlTemplate>
<!--对象树子模板-->
<DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
<Grid Margin="50,0,0,0" Height="28">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="30"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tb_PageName" Text="{Binding Name}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0"/>
<Button x:Name="BtnAdd" Grid.Column="1" Background="Transparent" VerticalAlignment="Center" HorizontalAlignment="Center"
Command="{Binding DataContext.AddUserPageCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=TreeView}}"
CommandParameter="{Binding Path=Text,ElementName=tb_PageName}">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
<Rectangle x:Name="BtnRetangle" Height="20" Width="20" Stroke="Transparent" StrokeThickness="1"
Fill="{StaticResource ImageBrushAddBlue}"
VerticalAlignment="Center" HorizontalAlignment="Center">
</Rectangle>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="BtnRetangle" Property="Height" Value="22"></Setter>
<Setter TargetName="BtnRetangle" Property="Width" Value="22"></Setter>
</Trigger>
<DataTrigger Binding="{Binding IsChecked}" Value="true">
<Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddGray}"></Setter>
<Setter Property="ToolTip" Value="已添加"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsChecked}" Value="false">
<Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddBlue}"></Setter>
<Setter Property="ToolTip" Value="添加"></Setter>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</DataTemplate>
<Style TargetType="TreeViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="IsExpanded" Value="True"></Setter>
<Setter Property="HeaderTemplate">
<Setter.Value>
<HierarchicalDataTemplate ItemsSource="{Binding TreeViewItems,Mode=TwoWay}" ItemTemplate="{StaticResource TreeItemTemplate}">
<StackPanel Orientation="Horizontal" Height="28" VerticalAlignment="Center" HorizontalAlignment="Left">
<!--Image Source="folder.png" VerticalAlignment="Center" Height="17" Margin="10,0"/>-->
<TextBlock Text="{Binding Name}" Margin="5,0,0,0" FontSize="15" VerticalAlignment="Center" Foreground="White"/>
</StackPanel>
</HierarchicalDataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" >
<EasingColorKeyFrame KeyTime="0" Value="Transparent" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>

<VisualState x:Name="Unselected" />
<VisualState x:Name="SelectedInactive">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0" Value="Transparent" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ExpansionStates">
<VisualState x:Name="Expanded">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ItemsHost">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Collapsed" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Bd" Grid.Column="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Border>
<ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Visibility="Collapsed" />
</Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="HasHeader" Value="false" />
<Condition Property="Width" Value="Auto" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="HasHeader" Value="false" />
<Condition Property="Height" Value="Auto" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="ItemContainer" TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="IconBorder" Background="Transparent" CornerRadius="4" BorderThickness="0">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="IconBorder" Property="BitmapEffect">
<Setter.Value>
<OuterGlowBitmapEffect GlowColor="Transparent" GlowSize="5" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>





</Window.Resources>
<Border Background="Black"
x:Name="br"
BorderBrush="#009dff"
BorderThickness="2">
<Border.Effect>
<DropShadowEffect
BlurRadius="10"
ShadowDepth="1"
Color="#009DFF" />
</Border.Effect>
<Grid>
<Image Source="../../Image/权限背景.png" Stretch="Fill"/>
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="80"/>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="{Binding UserName}" HorizontalAlignment="Center"
FontSize="24"
Foreground="#ddd"/>
<TextBlock Text="权限分配" Margin="10,0,0,0"
HorizontalAlignment="Center"
FontSize="24"
Foreground="#ddd"/>
</StackPanel>
<TextBlock Grid.Row="1"
Text="页面权限分配" Margin="10,0,0,0"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="20"
Foreground="#ddd"/>
<TextBlock Grid.Row="3"
Text="配料权限分配" Margin="10,0,0,0"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="20"
Foreground="#ddd"/>

<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<TextBlock Text="权限列表" Width="20"
TextWrapping="Wrap" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center"
FontSize="20"
Foreground="#ddd"/>
<TextBlock Text="当前用户权限" Width="20"
Grid.Column="4"
TextWrapping="Wrap"
HorizontalAlignment="Left" VerticalAlignment="Center"
FontSize="20"
Foreground="#ddd"/>
<!--#region 页面权限-->
<ScrollViewer Grid.Column="1" Margin="20,0,0,0" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True">
<TreeView x:Name="MyTreeView" ItemsSource="{Binding pageTreeViewModels}"
ScrollViewer.VerticalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" Background="Transparent" BorderBrush="Transparent"></TreeView>
</ScrollViewer>


<ScrollViewer Grid.Column="3" Margin="10,0,20,0" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True">
<ListBox x:Name="RightListBox" Grid.Column="3" Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
ItemsSource="{Binding SelectePage}" >
<ListBox.Template>
<ControlTemplate>
<StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="28" Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="60"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tb_Name" Text="{Binding Name}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" />
<Button x:Name="BtnDelete" Grid.Column="1" Background="Transparent" ToolTip="移除" VerticalAlignment="Center" HorizontalAlignment="Left"
Command="{Binding DataContext.DeleteUserPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
CommandParameter="{Binding Path=Text,ElementName=tb_Name}">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
<Rectangle x:Name="BtnRetangle" Height="17" Width="17" Stroke="Transparent" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left">
<Rectangle.Fill>
<ImageBrush ImageSource="../../Image/按钮/Delete.png"></ImageBrush>
</Rectangle.Fill>
</Rectangle>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="BtnRetangle" Property="Height" Value="19"></Setter>
<Setter TargetName="BtnRetangle" Property="Width" Value="19"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ScrollViewer>
<StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Foreground="White" Background="#009DFF"
FontSize="16" Height="50" Width="70" Margin="10,20"
Command="{Binding AddAllPageCommand}">
<TextBlock Text="全部
添加" TextWrapping="Wrap"/>
</Button>
<Button Foreground="White" Background="#009DFF"
FontSize="16" Height="50" Width="70" Margin="10,20"
Command="{Binding DeleteAllPageCommand}">
<TextBlock Text="全部
移除" TextWrapping="Wrap"/>
</Button>
</StackPanel>
<!--#endregion-->
</Grid>

<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<TextBlock Text="当前用户权限" Width="20"
TextWrapping="Wrap"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="20"
Foreground="#ddd"/>
<TextBlock Text="权限列表" Width="20"
Grid.Column="4"
TextWrapping="Wrap"
HorizontalAlignment="Center" VerticalAlignment="Center"
FontSize="20"
Foreground="#ddd"/>
</Grid>
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Content="保存"
Background="#009DFF"
Margin="200,5,20,5"
BorderThickness="0"
Command="{Binding SaveCommand}"
FontSize="20"
Foreground="White"
TabIndex="3" />
<Button Content="取消" Grid.Column="1" Background="#009DFF"
Margin="20,5,200,5"
BorderThickness="0"
Command="{Binding CancelCommand}"
FontSize="20"
Foreground="White"
TabIndex="3"/>
</Grid>
</Grid>
</Grid>
</Border>
</Window>

+ 44
- 0
BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs View File

@@ -0,0 +1,44 @@
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.Shapes;

namespace BPASmartClient.CustomResource.Pages.View
{
/// <summary>
/// UserConfigView.xaml 的交互逻辑
/// </summary>
public partial class UserConfigView : Window
{
public UserConfigView()
{
InitializeComponent();
this.br.MouseLeftButtonDown += (o, e) =>
{
if (e.LeftButton == MouseButtonState.Pressed) this.DragMove();
};
ActionManage.GetInstance.CancelRegister("UserConfigViewConfirm");
ActionManage.GetInstance.CancelRegister("UserConfigViewCancel");
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = true; this.Close(); }), "UserConfigViewConfirm");
ActionManage.GetInstance.Register(new Action(() => { this.DialogResult = false; this.Close(); }), "UserConfigViewCancel");


}


}

}

+ 2
- 2
BPASmartClient.CustomResource/Pages/View/UserLogView.xaml View File

@@ -26,7 +26,7 @@
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="TitleFontColor" Color="White" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

@@ -240,7 +240,7 @@
</StackPanel>

<!--#region 表格标题栏设置-->
<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid Grid.Row="1" Background="#FF19B7EC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.3*" />


+ 170
- 0
BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml View File

@@ -0,0 +1,170 @@
<UserControl x:Class="BPASmartClient.CustomResource.Pages.View.UserManagerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
Width="1400"
Height="900"
Background="{x:Null}"
mc:Ignorable="d">
<UserControl.DataContext>
<vm:UserManagerViewModel/>
</UserControl.DataContext>
<UserControl.Resources>
<Style x:Key="CommonTextBlockStyle" TargetType="TextBlock">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#B1E8FF"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="TextBlock.FontSize" Value="13" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="#87CEFA"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content.Text}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<!--HorizontalAlignment 可以设置内容展示位置-->
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center"
Margin="{TemplateBinding Padding}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value=".56"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="DataGridRow">
<Setter Property="FontSize" Value="16"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,5"/>
<Style.Triggers>
<!-- 隔行换色 -->
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="Transparent" />
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="Transparent" />
</Trigger>

<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#87CEFA" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="40" />
<Setter Property="Foreground" Value="#ddd" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridColumnHeader">

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center"
HorizontalAlignment="Center" />
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill"
Grid.Column="0" Width="8" Height="6" Fill="Transparent" Margin="0,0,50,0"
VerticalAlignment="Center" RenderTransformOrigin="1,1" />
<Rectangle Width="1" Fill="#87CEFA" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
</Grid>

</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="25" />
</Style>
<Style x:Key="datagridButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Foreground" Value="#1874CD"/>
<Setter Property="FontSize" Value="18"/>
</Style>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<TextBlock Text="用户管理" FontSize="28" Style="{DynamicResource CommonTextBlockStyle}"/>
<DataGrid Grid.Row="1" Margin="30" AutoGenerateColumns="False" RowHeight="35" ItemsSource="{Binding userManager}"
Background="Transparent"
FrozenColumnCount="1"
VerticalAlignment="Top"
IsReadOnly="True"
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single"
CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTemplateColumn Header="用户名" Width="200">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding UserName}" FontSize="20" Foreground="White"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="最后登录时间" Width="300" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding LastLogInTime}" FontSize="20" Foreground="White"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="权限" Width="250">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="权限" Style="{DynamicResource datagridButton}"
Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid},Path=SelectedItem}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="重置密码" Width="250">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="重置密码" Style="{DynamicResource datagridButton}" Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid},Path=SelectedItem}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="删除" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="删除" Style="{DynamicResource datagridButton}"
Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid},Path=SelectedItem}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Button Grid.Row="2"
Height="50" Width="200"
Background="#009DFF"
BorderThickness="0"
Command="{Binding AddNewUserCommand}"
Content="添加新用户"
FontSize="24"
Foreground="White" />
</Grid>
</UserControl>

+ 27
- 0
BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml.cs View File

@@ -0,0 +1,27 @@
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.Shapes;

namespace BPASmartClient.CustomResource.Pages.View
{
/// <summary>
/// UserManager.xaml 的交互逻辑
/// </summary>
public partial class UserManagerView : UserControl
{
public UserManagerView()
{
InitializeComponent();
}
}
}

+ 449
- 6
BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml View File

@@ -5,12 +5,14 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.DataContext>
<vm:VariableViewModel/>
</UserControl.DataContext>
<UserControl.Resources>
<Style x:Key="dataGrid" TargetType="DataGrid" >
<Setter Property="HorizontalGridLinesBrush" Value="#FF2AB2E7"/>
<Setter Property="VerticalGridLinesBrush" Value="#FF2AB2E7"/>
@@ -83,24 +85,466 @@
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
</Style>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="TextBox.Static.Background" Color="#FFFFFFFF"/>
<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="Transparent" Offset="0.0"/>
<GradientStop Color="Transparent" Offset="1.0"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ComboBox.Static.Border" Color="#FFACACAC"/>
<SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="#FF2AB2E7"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="Transparent"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
<LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="Transparent" Offset="0.0"/>
<GradientStop Color="Transparent" Offset="1.0"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF7EB4EA"/>
<SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="Transparent"/>
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
<LinearGradientBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="Transparent" Offset="0.0"/>
<GradientStop Color="Transparent" Offset="1.0"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
<LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFDAECFC" Offset="0.0"/>
<GradientStop Color="#FFC4E0FC" Offset="1.0"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="#FF569DE5"/>
<SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
<LinearGradientBrush x:Key="ComboBox.Pressed.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFDAEBFC" Offset="0.0"/>
<GradientStop Color="#FFC4E0FC" Offset="1.0"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Border" Color="#FF569DE5"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#FFF0F0F0"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="#FFD9D9D9"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Glyph" Color="#FFBFBFBF"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="#FFBFBFBF"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="Transparent"/>
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="Transparent"/>
<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="ClickMode" Value="Press"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border x:Name="templateRoot" Background="{StaticResource ComboBox.Static.Background}" BorderBrush="{StaticResource ComboBox.Static.Border}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
<Path x:Name="arrow" Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z" Fill="{StaticResource ComboBox.Static.Glyph}" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center"/>
</Border>
</Border>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Border}"/>
<Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Background}"/>
<Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Border}"/>
</MultiDataTrigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.MouseOver.Glyph}"/>
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
<Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Background}"/>
<Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Border}"/>
</MultiDataTrigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Pressed.Glyph}"/>
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
<Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Background}"/>
<Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Border}"/>
</MultiDataTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Disabled.Glyph}"/>
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Border}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Border}"/>
<Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Background}"/>
<Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Border}"/>
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
</Grid.ColumnDefinitions>
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="dropDownBorder" Background="Transparent" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
<Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
</Canvas>
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</ScrollViewer>
</Border>
</theme:SystemDropShadowChrome>
</Popup>
<ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
<Border x:Name="border" Background="{StaticResource TextBox.Static.Background}" Margin="{TemplateBinding BorderThickness}">
<TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="true">
<Setter Property="Foreground" Value="Black"/>
</Trigger>
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
<Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
<Setter Property="Color" TargetName="shadow" Value="#71000000"/>
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true"/>
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</MultiTrigger>
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
</Grid.ColumnDefinitions>
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
<Border x:Name="dropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
<Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
</Canvas>
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</ScrollViewer>
</Border>
</theme:SystemDropShadowChrome>
</Popup>
<ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
<ContentPresenter x:Name="contentPresenter" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
<Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
<Setter Property="Color" TargetName="shadow" Value="#71000000"/>
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true"/>
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</MultiTrigger>
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource ComboBox.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource ComboBox.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Padding" Value="6,3,5,3"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/>
<Style.Triggers>
<Trigger Property="IsEditable" Value="true">
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.12*"/>
<RowDefinition/>
</Grid.RowDefinitions>

<Button HorizontalAlignment="Right" Width="120" Height="40" Margin="0,0,10,0" Background="Transparent" Content="保存配置" Foreground="#FF2AB2E7" FontSize="20" BorderBrush="LightSkyBlue" BorderThickness="2" Command="{Binding SaveDataCommand}" ></Button>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<ComboBox ItemsSource="{Binding DeviceName}" Text="滚筒输送线" Style="{StaticResource ComboBoxStyle1}" SelectionChanged="ComboBox_SelectionChanged" FontSize="20" Foreground="#FF2AB2E7" Width="120" Height="40" Margin="0,0,10,0"></ComboBox>
<Button HorizontalAlignment="Right" Width="120" Height="40" Margin="0,0,10,0" Background="Transparent" Content="保存配置" Foreground="#FF2AB2E7" FontSize="20" BorderBrush="LightSkyBlue" BorderThickness="2" Command="{Binding SaveDataCommand}"></Button>
</StackPanel>
<!--变量配置-->
<DataGrid Grid.Row="1" ItemsSource="{Binding Variables}" GridLinesVisibility="All" Background="Transparent"
<DataGrid Name="GT" Grid.Row="1" ItemsSource="{Binding Variables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}"
LoadingRow="DataGrid_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="False" Style="{StaticResource textboxStyle}"></TextBox>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="PLC地址" Binding="{Binding PlcAddress}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="地址长度" Binding="{Binding Length}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<!--炒锅1配置-->
<DataGrid x:Name="fryOne" Grid.Row="1" Visibility="Collapsed" ItemsSource="{Binding FryOneVariables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}"
LoadingRow="fryOne_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="PLC地址" Binding="{Binding PlcAddress}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="地址长度" Binding="{Binding Length}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<!--炒锅2配置-->
<DataGrid x:Name="fryTwo" Grid.Row="1" Visibility="Collapsed" ItemsSource="{Binding FryTwoVariables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}"
LoadingRow="fryTwo_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="PLC地址" Binding="{Binding PlcAddress}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="地址长度" Binding="{Binding Length}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<!--炒锅3配置-->
<DataGrid x:Name="fryThree" Grid.Row="1" Visibility="Collapsed" ItemsSource="{Binding FryThreeVariables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}"
LoadingRow="fryThree_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="PLC地址" Binding="{Binding PlcAddress}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="地址长度" Binding="{Binding Length}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<!--炒锅4配置-->
<DataGrid x:Name="fryFour" Grid.Row="1" Visibility="Collapsed" ItemsSource="{Binding FryFourVariables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}"
LoadingRow="fryFour_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="PLC地址" Binding="{Binding PlcAddress}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="False" Width="0.45*" Header="地址长度" Binding="{Binding Length}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<!--炒锅5配置-->
<DataGrid x:Name="fryFive" Grid.Row="1" Visibility="Collapsed" ItemsSource="{Binding FryFiveVariables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False"
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}"
LoadingRow="fryFive_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -124,6 +568,5 @@
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

+ 87
- 1
BPASmartClient.CustomResource/Pages/View/VariableConfigView.xaml.cs View File

@@ -29,7 +29,93 @@ namespace BPASmartClient.CustomResource.Pages.View
{
e.Row.Header = e.Row.GetIndex() + 1;
}
private void fryOne_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}

private void fryTwo_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}

private void fryThree_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}

private void fryFour_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}

private void fryFive_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}

private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ComboBox cbo= sender as ComboBox;
if (cbo != null)
{
switch (cbo.SelectedValue)
{
case "滚筒输送线":
this.GT.Visibility = Visibility.Visible;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility=Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Collapsed;
break;
case "炒锅1":
this.GT.Visibility = Visibility.Collapsed;
this.fryOne.Visibility = Visibility.Visible;
this.fryTwo.Visibility = Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Collapsed;
break;
case "炒锅2":
this.GT.Visibility = Visibility.Collapsed;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility = Visibility.Visible;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Collapsed;
break;
case "炒锅3":
this.GT.Visibility = Visibility.Collapsed;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility = Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Visible;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Collapsed;
break;
case "炒锅4":
this.GT.Visibility = Visibility.Collapsed;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility = Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Visible;
this.fryFive.Visibility = Visibility.Collapsed;
break;
case "炒锅5":
this.GT.Visibility = Visibility.Collapsed;
this.fryOne.Visibility = Visibility.Collapsed;
this.fryTwo.Visibility = Visibility.Collapsed;
this.fryThree.Visibility = Visibility.Collapsed;
this.fryFour.Visibility = Visibility.Collapsed;
this.fryFive.Visibility = Visibility.Visible;
break;
}
}

}

}
}

+ 61
- 0
BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs View File

@@ -0,0 +1,61 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class AddNewUserViewModel:ObservableObject
{
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
private string _mErrorInfo;

public string UserName { get { return _userName; } set { _userName = value; OnPropertyChanged(); } }
private string _userName;


public string NewPassword1 { get { return _mNewPassword1; } set { _mNewPassword1 = value; OnPropertyChanged(); } }
private string _mNewPassword1;


public string NewPassword2 { get { return _mNewPassword2; } set { _mNewPassword2 = value; OnPropertyChanged(); } }
private string _mNewPassword2;

public RelayCommand ExitCommand { get; set; }

public RelayCommand ConfirmCommand { get; set; }

private void Confirm()
{
if (UserName == null) { ErrorInfo = "用户名不能为空"; return; }
if (NewPassword1 == null) { ErrorInfo = "请输入密码"; return; }
if (NewPassword2 != NewPassword1) { ErrorInfo = "两次密码不一致"; return; }
var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == UserName);
if (res != null) { ErrorInfo = "用户名已存在";return; }
Global.userManager.userInfos.Add(new UserInfo
{
UserName = UserName,
Password = NewPassword1,
userTreeViewModels = new List<UserTreeViewModel>()
});
Config.GetInstance.SaveUser();
ActionManage.GetInstance.Send("AddNewUserViewConfirm");
}

public AddNewUserViewModel()
{
ConfirmCommand = new RelayCommand(Confirm);

ExitCommand = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AddNewUserViewCancel");
});
}
}
}

+ 48
- 14
BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs View File

@@ -63,26 +63,60 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
Global.userInfo.permission = res.permission;
Global.userInfo.UserName = res.UserName;
Global.userInfo.Password = res.Password;
for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
Global.userInfo.LastLogInTime = DateTime.Now.ToString();
res.LastLogInTime = DateTime.Now.ToString();
Config.GetInstance.SaveUser();
if(res.permission == Enums.Permission.管理员)
{
if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission))
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible;
else
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null)
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
foreach( var items in MenuManage.GetInstance.menuModels)
{
if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission))
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible;
else
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed;
foreach(var item in items.subMenumodels)
{
item.SubMenuVisibility = Visibility.Visible;
}
}
}
else
{
if (res.userTreeViewModels != null)
{
if (res.userTreeViewModels.Count > 0)
{
foreach (var items in MenuManage.GetInstance.menuModels)
{
foreach (var item in items.subMenumodels)
{
if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null)
{
item.SubMenuVisibility = Visibility.Visible;
}
}
}
}
}
}

//for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++)
//{
// if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission))
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible;
// else
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

// if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null)
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed;

// for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++)
// {
// if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission))
// MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible;
// else
// MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed;
// }
//}
ActionManage.GetInstance.Send("PermissionChange");
ActionManage.GetInstance.Send("LoginOk");
}
else
{


+ 28
- 17
BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs View File

@@ -10,37 +10,48 @@ using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{

public class PasswordChangeViewModel : ObservableObject
{
public PasswordChangeViewModel()
private void CheckPassword(UserInfo userInfo)
{
LoginCommand = new RelayCommand(() =>
if (userInfo.Password == OldPassword)
{
if (Global.userInfo.Password == OldPassword)
if (NewPassword1 == NewPassword2)
{
if (NewPassword1 == NewPassword2)
{
Global.userInfo.Password = NewPassword2;
int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.UserName == Global.userInfo.UserName);
if (index >= 0 && index < Global.userManager.userInfos.Count)
Global.userManager.userInfos.ElementAt(index).Password = NewPassword1;
Config.GetInstance.SaveUser();
ActionManage.GetInstance.Send("PasswordChangeViewconfirm");
}
else
{
ErrorInfo = "新密码不匹配";
}
userInfo.Password = NewPassword2;
int index = Array.FindIndex(Global.userManager.userInfos.ToArray(), p => p.UserName == userInfo.UserName);
if (index >= 0 && index < Global.userManager.userInfos.Count)
Global.userManager.userInfos.ElementAt(index).Password = NewPassword1;
Config.GetInstance.SaveUser();
ActionManage.GetInstance.Send("PasswordChangeViewconfirm");
Global.changeUserInfo = null;
}
else
{
ErrorInfo = "原密码错误";
ErrorInfo = "新密码不匹配";
}
}
else
{
ErrorInfo = "原密码错误";
}
}

public PasswordChangeViewModel( )
{
LoginCommand = new RelayCommand(() =>
{
if (Global.changeUserInfo == null) CheckPassword(Global.userInfo);
else { CheckPassword(Global.changeUserInfo); }

});

ExitCommand = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("PasswordChangeViewCancel");
Global.changeUserInfo = null;
});
}



+ 14
- 0
BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs View File

@@ -0,0 +1,14 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class PermissionConfigurationViewModel:ObservableObject
{
}
}

+ 158
- 0
BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs View File

@@ -0,0 +1,158 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.Helper;
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 BPASmartClient.CustomResource.Pages.ViewModel
{
public class UserConfigViewModel:ObservableObject
{
/// <summary>
/// 页面列表集合
/// </summary>
public ObservableCollection<UserTreeViewModel> pageTreeViewModels { get; set; } = new ObservableCollection<UserTreeViewModel>();
/// <summary>
/// 已选择页面
/// </summary>
public ObservableCollection<UserTreeViewModel> SelectePage { get; set; } = new ObservableCollection<UserTreeViewModel>();

/// <summary>
/// 用户名
/// </summary>
public string UserName { get { return _username; } set { _username = value; OnPropertyChanged(); } }
private string _username;

public RelayCommand<object> AddUserPageCommand { get; set; }

public RelayCommand<object> DeleteUserPageCommand { get; set; }

public RelayCommand DeleteAllPageCommand { get; set; }

public RelayCommand AddAllPageCommand { get; set; }



public RelayCommand SaveCommand { get; set; }

public RelayCommand CancelCommand { get; set; }

private void AddUserPage(object o)
{
if (o == null) return;
if(o is string name)
{
var s = SelectePage.FirstOrDefault(x => x.Name == name);
if (!SelectePage.Contains(s))
{
foreach (UserTreeViewModel item in pageTreeViewModels)
{
var res = item.TreeViewItems.FirstOrDefault(P => P.Name == name);
if(res != null)
{
SelectePage.Add(res);
return;
}
}
}
}
}
private void DeleteUserPage(object o)
{
if (o == null) return;
if (o is string name)
{
var res = SelectePage.FirstOrDefault(p=>p.Name == name);
SelectePage.Remove(res);
}
}


public UserConfigViewModel()
{
AddUserPageCommand = new RelayCommand<object>(AddUserPage);

DeleteUserPageCommand = new RelayCommand<object>(DeleteUserPage);

DeleteAllPageCommand = new RelayCommand(() =>
{
SelectePage.Clear();
});

AddAllPageCommand = new RelayCommand(() =>
{
foreach(UserTreeViewModel item in pageTreeViewModels)
{
foreach(var res in item.TreeViewItems)
{
if (!SelectePage.Contains(res)) SelectePage.Add(res);
}
}
});


SaveCommand = new RelayCommand(() =>
{
var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == Global.changeUserInfo.UserName && p.Password == Global.changeUserInfo.Password);
if(res != null)
{
res.userTreeViewModels = new List<UserTreeViewModel>();
res.userTreeViewModels.AddRange(SelectePage);
Config.GetInstance.SaveUser();
}
Global.changeUserInfo = null;
ActionManage.GetInstance.Send("UserConfigViewConfirm");
});

CancelCommand = new RelayCommand(() =>
{
Global.changeUserInfo = null;
ActionManage.GetInstance.Send("UserConfigViewCancel");
});

foreach (var item in MenuManage.GetInstance.menuModels)
{
List<UserTreeViewModel> list = new List<UserTreeViewModel>();
foreach(var res in item.subMenumodels)
{
list.Add(new UserTreeViewModel { Name = res.SubMenuName});
}
pageTreeViewModels.Add(new UserTreeViewModel
{
Name = item.MainMenuName,
TreeViewItems = list
});
}

if(Global.changeUserInfo != null)
{
UserName = Global.changeUserInfo.UserName;
if (Global.changeUserInfo.userTreeViewModels != null)
{
if(Global.changeUserInfo.userTreeViewModels.Count > 0)
{
foreach(UserTreeViewModel item in Global.changeUserInfo.userTreeViewModels)
{
SelectePage.Add(item);
}
}
}
}




}

}
}

+ 77
- 0
BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs View File

@@ -0,0 +1,77 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
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 BPASmartClient.CustomResource.Pages.ViewModel
{
public class UserManagerViewModel
{
/// <summary>
/// datagrid绑定
/// </summary>
public ObservableCollection<UserInfo> userManager { get; set; } = Global.userManager.userInfos;

public RelayCommand<object> ChangePasswardCommand { get; set; }

public RelayCommand AddNewUserCommand { get; set; }

public RelayCommand<object> DeleteUserCommand { get; set; }

public RelayCommand<object> EditUserConfigCommand { get; set; }

private void ChangePassward(object o)
{
if (o != null && o is UserInfo infos)
{
Global.changeUserInfo = infos;
PasswordChangeView passwordChangeView = new PasswordChangeView();
passwordChangeView.ShowDialog();
}
}

private void DeleteUser(object o)
{
if (o != null && o is UserInfo infos)
{
var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == infos.UserName);
if (res != null) Global.userManager.userInfos.Remove(res);
Config.GetInstance.SaveUser();
}
}

private void EditUserConfig(object o)
{
if (o != null && o is UserInfo infos)
{
Global.changeUserInfo = null;
Global.changeUserInfo = infos;
UserConfigView userConfigView = new UserConfigView();
userConfigView.ShowDialog();
}
}

public UserManagerViewModel()
{
ChangePasswardCommand = new RelayCommand<object>(ChangePassward);

AddNewUserCommand = new RelayCommand(() =>
{
AddNewUser addNewUser = new AddNewUser();
addNewUser.ShowDialog();
});

DeleteUserCommand = new RelayCommand<object>(DeleteUser);

EditUserConfigCommand = new RelayCommand<object>(EditUserConfig);
}

}
}

+ 32
- 2
BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs View File

@@ -15,15 +15,45 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public class VariableViewModel : ObservableObject
{
public ObservableCollection<PlcVariableInfoModel> Variables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();

public ObservableCollection<PlcVariableInfoModel> FryOneVariables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();
public ObservableCollection<PlcVariableInfoModel> FryTwoVariables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();
public ObservableCollection<PlcVariableInfoModel> FryThreeVariables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();
public ObservableCollection<PlcVariableInfoModel> FryFourVariables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();
public ObservableCollection<PlcVariableInfoModel> FryFiveVariables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();

public List<string> DeviceName { get; set; } = new List<string> { "滚筒输送线", "炒锅1", "炒锅2", "炒锅3", "炒锅4", "炒锅5" };
public RelayCommand SaveDataCommand { get; set; }
public VariableViewModel()
{
Json<PlcVariableInfoManage>.Read();
Variables = Json<PlcVariableInfoManage>.Data.VariablesInfo;

try
{
if (Json<PlcVariableInfoManage>.Data.VariablesInfo.Count>0)
{
Variables = Json<PlcVariableInfoManage>.Data.VariablesInfo["滚筒输送线"];
FryOneVariables = Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅1"];
FryTwoVariables = Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅2"];
FryThreeVariables = Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅3"];
FryFourVariables = Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅4"];
FryFiveVariables = Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅5"];
}
}
catch (Exception)
{

}
SaveDataCommand = new RelayCommand(() =>
{
Json<PlcVariableInfoManage>.Data.VariablesInfo["滚筒输送线"] = Variables;
Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅1"] = FryOneVariables;
Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅2"]=FryTwoVariables;
Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅3"] = FryThreeVariables;
Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅4"]= FryFourVariables;
Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅5"] = FryFiveVariables;
Json<PlcVariableInfoManage>.Save();
MessageBox.Show("保存成功","提示",MessageBoxButton.OK,MessageBoxImage.Information);
});


+ 2
- 1
BPASmartClient.MorkS/Control_Morks.cs View File

@@ -34,7 +34,8 @@ namespace BPASmartClient.MorkS

public override void DoMain()
{

MonitorViewModel.DeviceId = DeviceId;
ServerInit();
DataParse();


+ 4
- 1
BPASmartClient.MorkS/ViewModel/DebugViewModel.cs View File

@@ -18,7 +18,10 @@ namespace BPASmartClient.MorkS.ViewModel
{
public DebugViewModel()
{
InitCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("InitDevice"); });
InitCommand = new RelayCommand(() => {
ActionManage.GetInstance.Send("InitDevice");
ActionManage.GetInstance.Send("初始化设定煮面时间");
});
SimOrderCommand = new RelayCommand(() =>
{
new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish();


+ 25
- 19
BPASmartClient.MorkS/ViewModel/ParSetViewModel.cs View File

@@ -8,6 +8,7 @@ using BPASmartClient.Helper;
using BPASmartClient.Model;
using BPASmartClient.MorkS.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.MorkS.ViewModel
{
@@ -15,29 +16,34 @@ namespace BPASmartClient.MorkS.ViewModel
{
public ParSetViewModel()
{
SaveInfoCommand = new Action(() =>
{
List<ushort> values = new List<ushort>();
values.Clear();

List<bool> bools = new List<bool>();
bools.Clear();
SaveInfoCommand = new RelayCommand(SaveSettingData);

for (int i = 0; i < Json<MorksPar>.Data.parSets.Count; i++)
{
values.Clear();
values.Add(Json<MorksPar>.Data.parSets[i].Minute);
values.Add(Json<MorksPar>.Data.parSets[i].Second);
bools.Add(Json<MorksPar>.Data.parSets[i].IsShield);
ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() });
}
ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() });
Json<MorksPar>.Save();
});
ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间");
}

public Action SaveInfoCommand { get; set; }
public RelayCommand SaveInfoCommand { get; set; }

public ObservableCollection<ParSet> parSets { get; set; } = Json<MorksPar>.Data.parSets;

private void SaveSettingData()
{
List<ushort> values = new List<ushort>();
values.Clear();

List<bool> bools = new List<bool>();
bools.Clear();

for (int i = 0; i < Json<MorksPar>.Data.parSets.Count; i++)
{
values.Clear();
values.Add(Json<MorksPar>.Data.parSets[i].Minute);
values.Add(Json<MorksPar>.Data.parSets[i].Second);
bools.Add(Json<MorksPar>.Data.parSets[i].IsShield);
ActionManage.GetInstance.Send("WriteVW", new WritePar() { Address = $"VW{116 + (i * 6)}", Value = values.ToArray() });
}
ActionManage.GetInstance.Send("WriteBools", new WritePar() { Address = "M260.0", Value = bools.ToArray() });
Json<MorksPar>.Save();
}
}
}

+ 13
- 0
BPASmartClient.S7Net/BPASmartClient.S7Net.csproj View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="S7netplus" Version="0.14.0" />
</ItemGroup>

</Project>

+ 69
- 0
BPASmartClient.S7Net/SiemensHelper.cs View File

@@ -0,0 +1,69 @@
using S7.Net;

namespace BPASmartClient.S7Net
{
public class SiemensHelper
{

Plc myPlc;

public bool IsConnected => myPlc is null ? false : myPlc.IsConnected;

/// <summary>
/// 打开连接
/// </summary>
/// <param name="cpuType">PLC CPU 类型</param>
/// <param name="ip">plc ip 地址</param>
/// <param name="port">plc 端口号</param>
/// <param name="rack">PLC 机架号</param>
/// <param name="solt"> PLC 插槽号</param>
public void Connect(CpuType cpuType, string ip, int port = 102, short rack = 0, short solt = 0)
{
myPlc = new Plc(cpuType, ip, port, rack, solt);
myPlc.Open();
}

/// <summary>
/// 断开和PLC的连接
/// </summary>
public void Disconnect()
{
myPlc?.Close();
}

public object Read(string address)
{
if (!IsConnected) return default;
return myPlc?.Read(address);
}

public void Write(string address, object value)
{
myPlc?.Write(address, value);
}

public ReadT ReadStruct<ReadT>(int db, int startAddress = 0)
{
if (!IsConnected) return default;
return (ReadT)myPlc.ReadStruct(typeof(ReadT), db, startAddress);
}

public void WriteStruct(object structValue, int db, int startAddress = 0)
{
myPlc?.WriteStruct(structValue, db, startAddress);
}


public int ReadClass(object sourceClass, int db, int startAddress = 0)
{
if (!IsConnected) return -1;
return myPlc.ReadClass(sourceClass, db, startAddress);
}

public void WriteClass(object sourceClass, int db, int startAddress = 0)
{
myPlc?.WriteClass(sourceClass, db, startAddress);
}

}
}

+ 6
- 6
BPASmartClient/App.config View File

@@ -6,20 +6,20 @@
<!--<add key="ClientId" value="43"/>-->
<add key="IsEnableTest" value="false"/>

<!--测试环境--><!--
<!--测试环境-->
<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 ="Namespaces" value="DEV.test1.Config"/>

<!--开发环境--><!--
<add key="apollouri" value="http://10.2.1.21:28080/"/>
<!--开发环境-->
<!--<add key="apollouri" value="http://10.2.1.21:28080/"/>
<add key="AppId" value="HostComputer"/>
<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="HostComputer"/>
<add key ="Namespaces" value="TEST1.Config"/>
<add key ="Namespaces" value="TEST1.Config"/>-->

<!--阿里云上报启动方式:API 或者 LOCAL-->
<!--API :通过客户端ID,调用接口查询“设备连接信息”-->


+ 7
- 0
DosingSystem/App.xaml.cs View File

@@ -171,6 +171,13 @@ namespace BPASmartClient.DosingSystem
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.PasswordChangeView"
});
UserManager.Add(new SubMenumodel()
{
SubMenuName = "用户管理",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.UserManagerView"
});

UserManager.Add(new SubMenumodel()
{


+ 8
- 0
FryPot_DosingSystem/AGV/WhichCart.cs View File

@@ -51,6 +51,14 @@ namespace FryPot_DosingSystem.AGV
hs_4,//4号炒锅-运输空碗到-空碗流水线
hs_5,//5号炒锅-运输空碗到-空碗流水线

tqx_1,
tqx_2,
tqx_3,

qxt_4,
jtqx,

qxt_hj,
hj,//空碗流水线-回到充电桩或者停车桩
}



+ 221
- 21
FryPot_DosingSystem/Control/DeviceOperate.cs View File

@@ -20,15 +20,35 @@ namespace FryPot_DosingSystem.Control
private static DeviceOperate _instance;
public static DeviceOperate GetInstance => _instance ??= new DeviceOperate();
public bool IsConfig { get; set; }//设备plc数据是否配置
ModbusTcp modbus = new ModbusTcp();
private string Ip { get; set; }
private string Port { get; set; }
ModbusTcp modbus = new ModbusTcp();//滚筒线Modbus通讯对象
ModbusTcp fryOneModbus = new ModbusTcp();//炒锅1Modbus通讯对象
ModbusTcp fryTwoModbus = new ModbusTcp();//炒锅2Modbus通讯对象
ModbusTcp fryThreeModbus = new ModbusTcp();//炒锅3Modbus通讯对象
ModbusTcp fryFourModbus = new ModbusTcp();//炒锅4Modbus通讯对象
ModbusTcp fryFiveModbus = new ModbusTcp();//炒锅5Modbus通讯对象
// private string Ip { get; set; }
// private string Port { get; set; }
public bool Connected { get; set; }
public bool FryOneConnected { get; set; }
public bool FryTwoConnected { get; set; }
public bool FryThreeConnected { get; set; }
public bool FryFourConnected { get; set; }
public bool FryFiveConnected { get; set; }

private string DeviceName { get; set; }
// private string DeviceName { get; set; }

public ConcurrentDictionary<string, object> Data { get; set; } = new ConcurrentDictionary<string, object>();
public ConcurrentDictionary<string, object> FryOneData { get; set; } = new ConcurrentDictionary<string, object>();
public ConcurrentDictionary<string, object> FryTwoData { get; set; } = new ConcurrentDictionary<string, object>();
public ConcurrentDictionary<string, object> FryThreeData { get; set; } = new ConcurrentDictionary<string, object>();
public ConcurrentDictionary<string, object> FryFourData { get; set; } = new ConcurrentDictionary<string, object>();
public ConcurrentDictionary<string, object> FryFiveData { get; set; } = new ConcurrentDictionary<string, object>();
public ObservableCollection<PlcVariableModel> Variables { get; set; } = new ObservableCollection<PlcVariableModel>();
public ObservableCollection<PlcVariableModel> FryOneVariables { get; set; } = new ObservableCollection<PlcVariableModel>();
public ObservableCollection<PlcVariableModel> FryTwoVariables { get; set; } = new ObservableCollection<PlcVariableModel>();
public ObservableCollection<PlcVariableModel> FryThreeVariables { get; set; } = new ObservableCollection<PlcVariableModel>();
public ObservableCollection<PlcVariableModel> FryFourVariables { get; set; } = new ObservableCollection<PlcVariableModel>();
public ObservableCollection<PlcVariableModel> FryFiveVariables { get; set; } = new ObservableCollection<PlcVariableModel>();
public DeviceOperate()
{
Init();
@@ -37,18 +57,69 @@ namespace FryPot_DosingSystem.Control
}
public void Init()
{
if (Variables.Count > 0)
{
Variables.Clear();
}
Variables.Clear();
FryOneVariables.Clear();
FryTwoVariables.Clear();
FryThreeVariables.Clear();
FryFourVariables.Clear();
FryFiveVariables.Clear();

Json<PlcVariableInfoManage>.Read();
if (Json<PlcVariableInfoManage>.Data.VariablesInfo.Count > 0)
{
try
{
foreach (var item in Json<PlcVariableInfoManage>.Data.VariablesInfo)
if (Json<PlcVariableInfoManage>.Data.VariablesInfo["滚筒输送线"].Count>0)
{
Variables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
//foreach (var item in Json<PlcVariableInfoManage>.Data.VariablesInfo["滚筒运输线"])
//{
// Variables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
//}
foreach (KeyValuePair<string,ObservableCollection<PlcVariableInfoModel>> dic in Json<PlcVariableInfoManage>.Data.VariablesInfo)
{
if (string.Equals(dic.Key, "滚筒输送线"))
{
foreach (var item in dic.Value)
{
Variables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
}
}
if (string.Equals(dic.Key, "炒锅1"))
{
foreach (var item in dic.Value)
{
FryOneVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
}
}
if (string.Equals(dic.Key, "炒锅2"))
{
foreach (var item in dic.Value)
{
FryTwoVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
}
}
if (string.Equals(dic.Key, "炒锅3"))
{
foreach (var item in dic.Value)
{
FryThreeVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
}
}
if (string.Equals(dic.Key, "炒锅4"))
{
foreach (var item in dic.Value)
{
FryFourVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
}
}
if (string.Equals(dic.Key, "炒锅5"))
{
foreach (var item in dic.Value)
{
FryFiveVariables.Add(new PlcVariableModel { Address = item.PlcAddress, Length = (ushort)(item.Length == null ? 0 : item.Length) });
}
}
}
}
IsConfig = true;
}
@@ -59,8 +130,8 @@ namespace FryPot_DosingSystem.Control
}
}
else
{
IsConfig= false;
{
IsConfig = false;
}
//Variables.Add(new PlcVariableModel() { Address = "D2001", Length = 8 });//1号线体滚筒工位号
//Variables.Add(new PlcVariableModel() { Address = "D2011", Length = 8 });//2号线体滚筒工位号
@@ -88,13 +159,26 @@ namespace FryPot_DosingSystem.Control
{
if (devices.Devices.Count > 0)
{
Ip = devices.Devices[0].Ip;
Port = devices.Devices[0].Port;
DeviceName = devices.Devices[0].DeviceName;
Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); });
// Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); App.Current.Dispatcher.Invoke(new Action(() => { BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.RunLog("PLC连接成功"); })); });
for (int i = 0; i < devices.Devices.Count; i++)
{
string Ip = devices.Devices[i].Ip;
string Port = devices.Devices[i].Port;
string DeviceName = devices.Devices[i].DeviceName;
switch (DeviceName)
{
case "滚筒输送线": Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break;
case "炒锅1": Task.Run(() => { fryOneModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break;
case "炒锅2": Task.Run(() => { fryTwoModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break;
case "炒锅3": Task.Run(() => { fryThreeModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break;
case "炒锅4": Task.Run(() => { fryFourModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break;
case "炒锅5": Task.Run(() => { fryFiveModbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); }); break;

}

}
// Task.Run(() => { modbus.ModbusTcpConnect(Ip, Convert.ToInt32(Port)); App.Current.Dispatcher.Invoke(new Action(() => { BPASmartClient.CustomResource.Pages.Model.MessageLog.GetInstance.RunLog("PLC连接成功"); })); });
}
}
}
}
}
public void ReadData()
@@ -103,6 +187,7 @@ namespace FryPot_DosingSystem.Control
{
ThreadManage.GetInstance().StartLong(new Action(() =>
{
//滚筒线
Connected = modbus.Connected;
while (Connected)
{
@@ -118,11 +203,106 @@ namespace FryPot_DosingSystem.Control
Data.TryAdd(item.Address, res);
}
}
Thread.Sleep(500);
Thread.Sleep(50);

}
//炒锅1
FryOneConnected = fryOneModbus.Connected;
while (FryOneConnected)
{
foreach (var item in FryOneVariables)
{
var res = fryOneModbus.Read(item.Address, item.Length);//读取plc数据
if (FryOneData.ContainsKey(item.Address))
{
FryOneData[item.Address] = res;
}
else
{
FryOneData.TryAdd(item.Address, res);
}
}
Thread.Sleep(50);

}
Thread.Sleep(1000);
}), $"设备【{DeviceName}】PLC实时数据读取线程");
//炒锅2
FryTwoConnected = fryTwoModbus.Connected;
while (FryTwoConnected)
{
foreach (var item in FryTwoVariables)
{
var res = fryTwoModbus.Read(item.Address, item.Length);//读取plc数据
if (FryTwoData.ContainsKey(item.Address))
{
FryTwoData[item.Address] = res;
}
else
{
FryTwoData.TryAdd(item.Address, res);
}
}
Thread.Sleep(50);

}
//炒锅3
FryThreeConnected = fryThreeModbus.Connected;
while (FryThreeConnected)
{
foreach (var item in FryThreeVariables)
{
var res = fryThreeModbus.Read(item.Address, item.Length);//读取plc数据
if (FryThreeData.ContainsKey(item.Address))
{
FryThreeData[item.Address] = res;
}
else
{
FryThreeData.TryAdd(item.Address, res);
}
}
Thread.Sleep(50);

}
//炒锅4
FryFourConnected = fryFourModbus.Connected;
while (FryFourConnected)
{
foreach (var item in FryFourVariables)
{
var res = fryFourModbus.Read(item.Address, item.Length);//读取plc数据
if (FryFourData.ContainsKey(item.Address))
{
FryFourData[item.Address] = res;
}
else
{
FryFourData.TryAdd(item.Address, res);
}
}
Thread.Sleep(50);

}
//炒锅5
FryFiveConnected = fryFiveModbus.Connected;
while (FryFiveConnected)
{
foreach (var item in FryFiveVariables)
{
var res = fryFiveModbus.Read(item.Address, item.Length);//读取plc数据
if (FryFiveData.ContainsKey(item.Address))
{
FryFiveData[item.Address] = res;
}
else
{
FryFiveData.TryAdd(item.Address, res);
}
}
Thread.Sleep(50);

}
Thread.Sleep(500);
}), $"PLC实时数据读取线程");
}
}
public void WritePlcData(string address, ushort value)
@@ -136,5 +316,25 @@ namespace FryPot_DosingSystem.Control
{
return Data;
}
public ConcurrentDictionary<string, object> GetFryOneData()
{
return FryOneData;
}
public ConcurrentDictionary<string, object> GetFryTwoData()
{
return FryTwoData;
}
public ConcurrentDictionary<string, object> GetFryThreeData()
{
return FryThreeData;
}
public ConcurrentDictionary<string, object> GetFryFourData()
{
return FryFourData;
}
public ConcurrentDictionary<string, object> GetFryFiveData()
{
return FryFiveData;
}
}
}

+ 1466
- 264
FryPot_DosingSystem/Control/DosingLogicControl.cs
File diff suppressed because it is too large
View File


+ 79
- 4
FryPot_DosingSystem/Control/GlobalVariable.cs View File

@@ -57,6 +57,10 @@ namespace FryPot_DosingSystem.Control
/// PLC初始化状态
/// </summary>
public ushort PlcInite { get; set; }
/// <summary>
/// 清洗台清洗完成信号
/// </summary>
public ushort CleanComplete { get; set; }
#region 上位机内部逻辑条件
/// <summary>
/// 退出线体1任务
@@ -161,6 +165,7 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveUnLoad { get; set; }
public bool agvFryPotEmptyRollerArrive { get; set; }
public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineOneLoadCom { get; set; }//线体1上料完成

public int LTwoMaterialNum { get; set; } = 0;
public int LTwoFryPotSerial { get; set; } = 2;
@@ -168,7 +173,7 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveLTwoUpLoad { get; set; }
public bool LTwoagvArriveUnLoad { get; set; }
public bool LTwoagvFryPotEmptyRollerArrive { get; set; }
public bool LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineTwoLoadCom { get; set; }//线体2上料完成

public int LThreeMaterialNum { get; set; } = 0;
public int LThreeFryPotSerial { get; set; } = 3;
@@ -176,10 +181,24 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveLThreeUpLoad { get; set; }
public bool LThreeagvArriveUnLoad { get; set; }
public bool LThreeagvFryPotEmptyRollerArrive { get; set; }
public bool LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineThreeLoadCom { get; set; }//线体1上料完成

public int LFourRollerNum { get; set; } = 0;//4号线体空桶数量
//新增空桶清洗系列变量
public bool agvArriveLineFour { get; set; }//agv到达线体4下料位置从清洗台或炒锅
public bool agvArriveCleanUnLoad { get; set; }//agv到达清洗台下料位置
public bool agvArriveCleanLoad { get; set; }//agv到达清洗台上料位置

public bool agvArriveLineOneLoadEmptyRoller { get; set; }//agv到达线体1空桶上料位置
public bool agvArriveLineTwoLoadEmptyRoller { get; set; }//agv到达线体2空桶上料位置

public bool agvArriveLineThreeLoadEmptyRoller { get; set; }//agv到达线体3空桶上料位置

public int LFourRollerNum { get; set; } = 0;
#endregion
public bool agvArriveLineOneLoadCom { get; set; } //agv线体1空桶上料完成
public bool agvArriveLineTwoLoadCom { get; set; } //agv线体2空桶上料完成
public bool agvArriveLineThreeLoadCom { get; set; }//agv线体3空桶上料完成
//空桶清洗流程锁
#endregion
}
/// <summary>
/// 滚筒线1相关变量
@@ -230,8 +249,25 @@ namespace FryPot_DosingSystem.Control
/// 当前线体配方完成信号
/// </summary>
public ushort RecipeCompleteSingle { get; set; }
/// <summary>
/// 线体1上空桶确认信号
/// </summary>
public ushort EmptyRollerConfirmSingle { get; set; }
/// <summary>
/// 线体1上单个空桶编号
/// </summary>
public ushort EmptyRollerNum { get; set; }

/// <summary>
/// 上一个桶是否是空桶
/// </summary>
public bool IsEpmtyBefore { get; set; } //空桶上料结束后,配方料桶AGV才能去1号线装桶

public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶
/// <summary>
/// 线体1上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; } = new List<ushort>();
}
/// <summary>
/// 滚筒线2相关变量
@@ -282,6 +318,25 @@ namespace FryPot_DosingSystem.Control
/// 当前线体配方完成信号
/// </summary>
public ushort RecipeCompleteSingle { get; set; }

/// <summary>
/// 线体1上空桶确认信号
/// </summary>
public ushort EmptyRollerConfirmSingle { get; set; }
/// <summary>
/// 线体1上单个空桶编号
/// </summary>
public ushort EmptyRollerNum { get; set; }
/// <summary>
/// 上一个同时否是空桶
/// </summary>
public bool IsEpmtyBefore { get; set; }

public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶
/// <summary>
/// 线体2上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; } = new List<ushort>();
}
/// <summary>
/// 滚筒线3相关变量
@@ -332,6 +387,26 @@ namespace FryPot_DosingSystem.Control
/// 当前线体配方完成信号
/// </summary>
public ushort RecipeCompleteSingle { get; set; }

/// <summary>
/// 线体1上空桶确认信号
/// </summary>
public ushort EmptyRollerConfirmSingle { get; set; }
/// <summary>
/// 线体1上单个空桶编号
/// </summary>
public ushort EmptyRollerNum { get; set; }
/// <summary>
/// 上一个同时否是空桶
/// </summary>
public bool IsEpmtyBefore { get; set; }

public bool CanRun { get; set; } = true;//配方料桶上料结束后,线体空桶AGV才能1号线装桶

/// <summary>
/// 线体3上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; } = new List<ushort>();
}
/// <summary>
/// 滚筒线4相关变量


+ 16
- 8
FryPot_DosingSystem/FryPotStatus/PotFiveStatus.cs View File

@@ -11,7 +11,8 @@ using System.Threading.Tasks;
namespace FryPot_DosingSystem.FryPotStatus
{
[Table("TbfryPotFive")]
internal class PotFiveStatus:ObservableObject
[Serializable]
internal class PotFiveStatus
{
[Key]
[Column("Id")]
@@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 温度
/// </summary>
public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } }
public double? Temperature { get { return temperature; } set { temperature = value; } }
private double? temperature=0;
[Column("HotPower")]
[Variable("FryPotFivePower", "5号炒锅火力", "", "")]
/// <summary>
/// 火力
/// </summary>
public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } }
public string? HotPower { get { return hotPower; } set { hotPower = value; } }
private string? hotPower="0";
[Column("Speed")]
[Variable("FryPotFiveSpeed", "5号炒锅搅拌速度", "", "")]
/// <summary>
/// 搅拌速度
/// </summary>
public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } }
public double? Speed { get { return speed; } set { speed = value; } }
private double? speed=0;
[Column("FryPotWeight")]
[Variable("FryPotFiveWeight", "5号炒锅载重", "", "")]
/// <summary>
/// 炒锅重量
/// </summary>
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } }
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } }
private double? fryPotWeight=0;
[Column("OilCapacity")]
[Variable("FryPotFiveOil", "5号炒锅当前配方用油量", "", "")]
/// <summary>
/// 单次配方用油量
/// </summary>
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } }
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } }
private double? oilCapacity=0;
[Column("TotalOilCapactiy")]
[Variable("FryPotFiveTotalOil", "5号炒锅总用油量", "", "")]
/// <summary>
/// 一天总用油量
/// </summary>
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } }
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } }
private double? totalOilCapactiy=0;

[Column("TotalProduct")]
@@ -65,8 +66,15 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 一天配方生产总量
/// </summary>
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } }
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } }
private int? totalProduct=0;


[Column("ReicpeName")]
/// <summary>
/// 当前配方名称
/// </summary>
public string RecipeName { get; set; } = string.Empty;
[Column("Time")]
/// <summary>
/// 时间


+ 15
- 8
FryPot_DosingSystem/FryPotStatus/PotFourStatus.cs View File

@@ -11,7 +11,8 @@ using System.Threading.Tasks;
namespace FryPot_DosingSystem.FryPotStatus
{
[Table("TbfryPotOne")]
internal class PotFourStatus:ObservableObject
[Serializable]
internal class PotFourStatus
{
[Key]
[Column("Id")]
@@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 温度
/// </summary>
public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } }
public double? Temperature { get { return temperature; } set { temperature = value; } }
private double? temperature=0;
[Column("HotPower")]
[Variable("FryPotFourPower", "4号炒锅火力", "", "")]
/// <summary>
/// 火力
/// </summary>
public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } }
public string? HotPower { get { return hotPower; } set { hotPower = value; } }
private string? hotPower="0";
[Column("Speed")]
[Variable("FryPotFourSpeed", "4号炒锅搅拌速度", "", "")]
/// <summary>
/// 搅拌速度
/// </summary>
public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } }
public double? Speed { get { return speed; } set { speed = value; } }
private double? speed=0;
[Column("FryPotWeight")]
[Variable("FryPotFourWeight", "4号炒锅载重", "", "")]
/// <summary>
/// 炒锅重量
/// </summary>
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } }
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } }
private double? fryPotWeight=0;
[Column("OilCapacity")]
[Variable("FryPotFourOil", "4号炒锅当前配方用油量", "", "")]
/// <summary>
/// 单次配方用油量
/// </summary>
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } }
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } }
private double? oilCapacity=0;
[Column("TotalOilCapactiy")]
[Variable("FryPotFourTotalOil", "4号炒锅总用油量", "", "")]
/// <summary>
/// 一天总用油量
/// </summary>
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } }
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value;; } }
private double? totalOilCapactiy=0;

[Column("TotalProduct")]
@@ -65,8 +66,14 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 一天配方生产总量
/// </summary>
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } }
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } }
private int? totalProduct=0;

[Column("ReicpeName")]
/// <summary>
/// 当前配方名称
/// </summary>
public string RecipeName { get; set; } = string.Empty;
[Column("Time")]
/// <summary>
/// 时间


+ 15
- 8
FryPot_DosingSystem/FryPotStatus/PotOneStatus.cs View File

@@ -11,7 +11,8 @@ using System.Threading.Tasks;
namespace FryPot_DosingSystem.FryPotStatus
{
[Table("TbfryPotOne")]
internal class PotOneStatus:ObservableObject
[Serializable]
internal class PotOneStatus
{
[Key]
[Column("Id")]
@@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 温度
/// </summary>
public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } }
public double? Temperature { get { return temperature; } set { temperature = value;} }
private double? temperature=0;
[Column("HotPower")]
[Variable("FryPotOnePower", "1号炒锅火力", "", "")]
/// <summary>
/// 火力
/// </summary>
public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } }
public string? HotPower { get { return hotPower; } set { hotPower = value; } }
private string? hotPower="0";
[Column("Speed")]
[Variable("FryPotOneSpeed", "1号炒锅搅拌速度", "", "")]
/// <summary>
/// 搅拌速度
/// </summary>
public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } }
public double? Speed { get { return speed; } set { speed = value; } }
private double? speed = 0;
[Column("FryPotWeight")]
[Variable("FryPotOneWeight", "1号炒锅载重", "", "")]
/// <summary>
/// 炒锅重量
/// </summary>
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } }
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } }
private double? fryPotWeight = 0;
[Column("OilCapacity")]
[Variable("FryPotOneOil", "1号炒锅当前配方用油量", "", "")]
/// <summary>
/// 单次配方用油量
/// </summary>
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } }
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } }
private double? oilCapacity = 0;
[Column("TotalOilCapactiy")]
[Variable("FryPotOneTotalOil", "1号炒锅总用油量", "", "")]
/// <summary>
/// 一天总用油量
/// </summary>
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } }
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } }
private double? totalOilCapactiy = 0;

[Column("TotalProduct")]
@@ -65,12 +66,18 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 一天配方生产总量
/// </summary>
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } }
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } }
private int? totalProduct = 0;
[Column("ReicpeName")]
/// <summary>
/// 当前配方名称
/// </summary>
public string RecipeName { get; set; } = string.Empty;
[Column("Time")]
/// <summary>
/// 时间
/// </summary>
public string Time { get; set; } = DateTime.Now.ToShortTimeString();
}
}

+ 16
- 8
FryPot_DosingSystem/FryPotStatus/PotThreeStatus.cs View File

@@ -11,7 +11,8 @@ using System.Threading.Tasks;
namespace FryPot_DosingSystem.FryPotStatus
{
[Table("TbfryPotThree")]
internal class PotThreeStatus:ObservableObject
[Serializable]
internal class PotThreeStatus
{
[Key]
[Column("Id")]
@@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 温度
/// </summary>
public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } }
public double? Temperature { get { return temperature; } set { temperature = value; } }
private double? temperature=0;
[Column("HotPower")]
[Variable("FryPotThreePower", "3号炒锅火力", "", "")]
/// <summary>
/// 火力
/// </summary>
public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } }
public string? HotPower { get { return hotPower; } set { hotPower = value;} }
private string? hotPower="0";
[Column("Speed")]
[Variable("FryPotThreeSpeed", "3号炒锅搅拌速度", "", "")]
/// <summary>
/// 搅拌速度
/// </summary>
public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } }
public double? Speed { get { return speed; } set { speed = value; } }
private double? speed=0;
[Column("FryPotWeight")]
[Variable("FryPotThreeWeight", "3号炒锅载重", "", "")]
/// <summary>
/// 炒锅重量
/// </summary>
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } }
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } }
private double? fryPotWeight=0;
[Column("OilCapacity")]
[Variable("FryPotThreeOil", "3号炒锅当前配方用油量", "", "")]
/// <summary>
/// 单次配方用油量
/// </summary>
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } }
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } }
private double? oilCapacity=0;
[Column("TotalOilCapactiy")]
[Variable("FryPotThreeTotalOil", "3号炒锅总用油量", "", "")]
/// <summary>
/// 一天总用油量
/// </summary>
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } }
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } }
private double? totalOilCapactiy=0;

[Column("TotalProduct")]
@@ -65,8 +66,15 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 一天配方生产总量
/// </summary>
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } }
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } }
private int? totalProduct=0;


[Column("ReicpeName")]
/// <summary>
/// 当前配方名称
/// </summary>
public string RecipeName { get; set; } = string.Empty;
[Column("Time")]
/// <summary>
/// 时间


+ 15
- 8
FryPot_DosingSystem/FryPotStatus/PotTwoStatus.cs View File

@@ -11,7 +11,8 @@ using System.Threading.Tasks;
namespace FryPot_DosingSystem.FryPotStatus
{
[Table("TbfryPotTwo")]
internal class PotTwoStatus:ObservableObject
[Serializable]
internal class PotTwoStatus
{
[Key]
[Column("Id")]
@@ -22,42 +23,42 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 温度
/// </summary>
public double? Temperature { get { return temperature; } set { temperature = value; OnPropertyChanged(); } }
public double? Temperature { get { return temperature; } set { temperature = value; } }
private double? temperature=0;
[Column("HotPower")]
[Variable("FryPotTwoPower", "2号炒锅火力", "", "")]
/// <summary>
/// 火力
/// </summary>
public string? HotPower { get { return hotPower; } set { hotPower = value; OnPropertyChanged(); } }
public string? HotPower { get { return hotPower; } set { hotPower = value; } }
private string? hotPower="0";
[Column("Speed")]
[Variable("FryPotTwoSpeed", "2号炒锅搅拌速度", "", "")]
/// <summary>
/// 搅拌速度
/// </summary>
public double? Speed { get { return speed; } set { speed = value; OnPropertyChanged(); } }
public double? Speed { get { return speed; } set { speed = value; } }
private double? speed=0;
[Column("FryPotWeight")]
[Variable("FryPotTwoWeight", "2号炒锅载重", "", "")]
/// <summary>
/// 炒锅重量
/// </summary>
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; OnPropertyChanged(); } }
public double? FryPotWeight { get { return fryPotWeight; } set { fryPotWeight = value; } }
private double? fryPotWeight=0;
[Column("OilCapacity")]
[Variable("FryPotTwoOil", "2号炒锅当前配方用油量", "", "")]
/// <summary>
/// 单次配方用油量
/// </summary>
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; OnPropertyChanged(); } }
public double? OilCapacity { get { return oilCapacity; } set { oilCapacity = value; } }
private double? oilCapacity=0;
[Column("TotalOilCapactiy")]
[Variable("FryPotTwoTotalOil", "2号炒锅总用油量", "", "")]
/// <summary>
/// 一天总用油量
/// </summary>
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; OnPropertyChanged(); } }
public double? TotalOilCapactiy { get { return totalOilCapactiy; } set { totalOilCapactiy = value; } }
private double? totalOilCapactiy=0;

[Column("TotalProduct")]
@@ -65,8 +66,14 @@ namespace FryPot_DosingSystem.FryPotStatus
/// <summary>
/// 一天配方生产总量
/// </summary>
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; OnPropertyChanged(); } }
public int? TotalProduct { get { return totalProduct; } set { totalProduct = value; } }
private int? totalProduct=0;

[Column("ReicpeName")]
/// <summary>
/// 当前配方名称
/// </summary>
public string RecipeName { get; set; } = string.Empty;
[Column("Time")]
/// <summary>
/// 时间


+ 2
- 0
FryPot_DosingSystem/FryPot_DosingSystem.csproj View File

@@ -12,6 +12,7 @@
<None Remove="hbl.ico" />
<None Remove="Resources\fonts\iconfont.ttf" />
<None Remove="Resources\fonts\iconfont2.ttf" />
<None Remove="Resources\pictures\战斗机.jpeg" />
</ItemGroup>

<ItemGroup>
@@ -35,6 +36,7 @@

<ItemGroup>
<Resource Include="Resources\fonts\iconfont.ttf" />
<Resource Include="Resources\pictures\战斗机.jpeg" />
</ItemGroup>

</Project>

+ 16
- 0
FryPot_DosingSystem/Model/FlowProcessManage.cs View File

@@ -0,0 +1,16 @@
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
{
internal class FlowProcessManage:ObservableObject
{
public string RecipeName { get; set; }
public ObservableCollection<FlowProcessModel> fpModels { get; set; } = new ObservableCollection<FlowProcessModel>();
}
}

+ 48
- 0
FryPot_DosingSystem/Model/FlowProcessModel.cs View File

@@ -0,0 +1,48 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FryPot_DosingSystem.Model
{
internal class FlowProcessModel:ObservableObject
{
/// <summary>
/// 工艺对应配方名称
/// </summary>
public string RecipeName { get { return _recipeName; }set { _recipeName = value;OnPropertyChanged(); } }
private string _recipeName;
/// <summary>
/// 工艺步骤
/// </summary>
public int Id { get; set; }

/// <summary>
/// 炒制原料/桶号
/// </summary>
public string FryMaterialNum { get { return _fryMaterialNum; } set { _fryMaterialNum = value;OnPropertyChanged(); } }
private string _fryMaterialNum;
/// <summary>
/// 炒制速度
/// </summary>
public double FrySpeed { get { return _frySpeed; }set { _frySpeed = value;OnPropertyChanged(); } }
private double _frySpeed;
/// <summary>
/// 炒制重量
/// </summary>
public double FryWeight { get { return _fryMaterialWeight; }set { _fryMaterialWeight = value;OnPropertyChanged(); } }
private double _fryMaterialWeight;
/// <summary>
/// 炒制温度
/// </summary>
public double FryTemperature { get { return _fryTemperature; } set { _fryTemperature = value;OnPropertyChanged(); } }
private double _fryTemperature;
/// <summary>
/// 炒制时间
/// </summary>
public double FryPeriodTime { get { return _fryPeriodTime; } set { _fryPeriodTime = value;OnPropertyChanged(); } }
private double _fryPeriodTime;
}
}

+ 6
- 1
FryPot_DosingSystem/Model/RecipeModel.cs View File

@@ -29,7 +29,12 @@ namespace FryPot_DosingSystem.Model

private string _updateTime;
public string UpdateTime { get { return _updateTime; } set { _updateTime = value;OnPropertyChanged(); } }

/// <summary>
/// 工艺流程
/// </summary>
public FlowProcessManage FlowProcess { get { return _flowProcessManage; } set { _flowProcessManage = value;OnPropertyChanged(); } }
private FlowProcessManage _flowProcessManage;
/// <summary>
/// 配方下发状况信息
/// </summary>


+ 93
- 1
FryPot_DosingSystem/Resources/fonts/demo_index.html View File

@@ -52,12 +52,30 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe6e2;</span>
<div class="name">节点-子流程</div>
<div class="code-name">&amp;#xe6e2;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe64c;</span>
<div class="name">流程</div>
<div class="code-name">&amp;#xe64c;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe622;</span>
<div class="name">下载</div>
<div class="code-name">&amp;#xe622;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe8cc;</span>
<div class="name">232编辑、输入</div>
<div class="code-name">&amp;#xe8cc;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe668;</span>
<div class="name">账号信息</div>
@@ -118,6 +136,12 @@
<div class="code-name">&amp;#xe6b7;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe7ab;</span>
<div class="name">工艺流程_0</div>
<div class="code-name">&amp;#xe7ab;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe8e0;</span>
<div class="name">166-NFC</div>
@@ -142,7 +166,7 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.ttf?t=1659497763775') format('truetype');
src: url('iconfont.ttf?t=1659942239310') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -168,6 +192,24 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-jiedianziliucheng"></span>
<div class="name">
节点-子流程
</div>
<div class="code-name">.icon-jiedianziliucheng
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-liucheng"></span>
<div class="name">
流程
</div>
<div class="code-name">.icon-liucheng
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-xiazai"></span>
<div class="name">
@@ -177,6 +219,15 @@
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-bianjishuru"></span>
<div class="name">
232编辑、输入
</div>
<div class="code-name">.icon-bianjishuru
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-zhanghaoxinxi"></span>
<div class="name">
@@ -267,6 +318,15 @@
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-gongyiliucheng_0"></span>
<div class="name">
工艺流程_0
</div>
<div class="code-name">.icon-gongyiliucheng_0
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-166-NFC"></span>
<div class="name">
@@ -303,6 +363,22 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jiedianziliucheng"></use>
</svg>
<div class="name">节点-子流程</div>
<div class="code-name">#icon-jiedianziliucheng</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-liucheng"></use>
</svg>
<div class="name">流程</div>
<div class="code-name">#icon-liucheng</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xiazai"></use>
@@ -311,6 +387,14 @@
<div class="code-name">#icon-xiazai</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-bianjishuru"></use>
</svg>
<div class="name">232编辑、输入</div>
<div class="code-name">#icon-bianjishuru</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-zhanghaoxinxi"></use>
@@ -391,6 +475,14 @@
<div class="code-name">#icon-mianxingmima</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-gongyiliucheng_0"></use>
</svg>
<div class="name">工艺流程_0</div>
<div class="code-name">#icon-gongyiliucheng_0</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-166-NFC"></use>


BIN
View File


+ 164
- 11
FryPot_DosingSystem/View/AgvView.xaml View File

@@ -566,6 +566,7 @@
</Setter.Value>
</Setter>
</Style>

<Style x:Key="停车位" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF1F4D69"/>
@@ -574,7 +575,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid Width="60" Height="55">
<Ellipse x:Name="name_11" VerticalAlignment="Bottom" Visibility="Collapsed" Margin="0,0,0,0" Fill="#FF9E4C4C" Stroke="#FF9E4141" Width="60" Height="20"></Ellipse>
<Ellipse x:Name="name_12" VerticalAlignment="Bottom" Visibility="Collapsed" Margin="0,0,0,5" Fill="#FFAD2121" Stroke="#FF9E4141" Width="40" Height="10"></Ellipse>
<Ellipse x:Name="name_21" VerticalAlignment="Bottom" Visibility="Visible" Margin="0,0,0,0" Fill="#FF4CA756" Stroke="#FF419E53" Width="60" Height="20"></Ellipse>
@@ -760,6 +761,16 @@
<PathGeometry x:Key="yc_1_3" Figures="M335,258 L334.5,490.5 680,490.99893 680,840"/>
<PathGeometry x:Key="yc_1_4" Figures="M337,256.5 L334,492 965.5,492 966.50079,840"/>
<PathGeometry x:Key="yc_1_5" Figures="M335.99357,253.70082 L334.33946,490.553 1256.2374,491.4823 1254.2358,840"/>
<!--从123线体到空桶洗桶台-->
<PathGeometry x:Key="tqx_1" Figures="M337,260 L337.5,488.5 1165,490.5 1165,410"/>
<PathGeometry x:Key="tqx_2" Figures="M488.35495,257.41892 L488.65986,490.93723 1165,490.5 1165,410"/>
<PathGeometry x:Key="tqx_3" Figures="M655.97662,256.40013 L655.68368,491.79548 1165,490.5 1165,410"/>
<!--从清洗台到4号线体-->
<PathGeometry x:Key="qxt_4" Figures="M1165,410 L1165,490.5 811.14431,490.74164 811.53039,265"/>
<!--从清洗台回家-->
<PathGeometry x:Key="qxt_hj" Figures="M1165,410 L1165,490.5 1512,491"/>
<!--从家到清洗台-->
<PathGeometry x:Key="jtqx" Figures="M1512,491 L1165,490.5 1164,410"/>
<!--送菜品路线 2号取菜口送到5个锅-->
<PathGeometry x:Key="yc_2_1" Figures="M488.35495,257.41892 L488.65986,490.93723 100,491.1112 100,840"/>
<PathGeometry x:Key="yc_2_2" Figures="M488.35495,257.41892 L488.65986,490.93723 391.20932,490.91674 391.28296,840"/>
@@ -767,11 +778,11 @@
<PathGeometry x:Key="yc_2_4" Figures="M488.35495,257.41892 L488.65986,490.93723 964.81356,491.71074 962.82129,840"/>
<PathGeometry x:Key="yc_2_5" Figures="M488.35495,257.41892 L488.65986,490.93723 1254.2358,491.20803 1254.2358,840"/>
<!--送菜品路线 3号取菜口送到5个锅-->
<PathGeometry x:Key="yc_3_1" Figures="M678.97662,256.40013 L678.68368,491.79548 100,492.63368 100,840"/>
<PathGeometry x:Key="yc_3_2" Figures="M678.97662,256.40013 L678.68368,491.79548 391.28296,488.69436 391.28296,840"/>
<PathGeometry x:Key="yc_3_3" Figures="M678.97662,256.40013 L678.68368,491.79548 680,491.67667 680,840"/>
<PathGeometry x:Key="yc_3_4" Figures="M678.97662,256.40013 L678.68368,491.79548 964.81356,490.50591 962.82129,840"/>
<PathGeometry x:Key="yc_3_5" Figures="M678.97662,256.40013 L678.68368,491.79548 1256.2374,491.4823 1254.2358,840"/>
<PathGeometry x:Key="yc_3_1" Figures="M655.97662,256.40013 L655.68368,491.79548 100,492.63368 100,840"/>
<PathGeometry x:Key="yc_3_2" Figures="M655.97662,256.40013 L655.68368,491.79548 391.28296,488.69436 391.28296,840"/>
<PathGeometry x:Key="yc_3_3" Figures="M655.97662,256.40013 L655.68368,491.79548 680,491.67667 680,840"/>
<PathGeometry x:Key="yc_3_4" Figures="M655.97662,256.40013 L655.68368,491.79548 964.81356,490.50591 962.82129,840"/>
<PathGeometry x:Key="yc_3_5" Figures="M655.97662,256.40013 L655.68368,491.79548 1256.2374,491.4823 1254.2358,840"/>
<!--送完菜品 回收路线-->
<PathGeometry x:Key="hs_1" Figures="M100,862 L99.749407,491.33482 455.92934,491.23722 811.14431,490.74164 811.53039,265"/>
<PathGeometry x:Key="hs_2" Figures="M389.82645,862.91662 L389.79339,491.26265 811.14431,490.74164 811.53039,265"/>
@@ -908,6 +919,40 @@
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource hj}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource hj}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
<!--线体123到清洗台-->
<Storyboard x:Key="Storyboard_tqx_1" RepeatBehavior="0:0:5">
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(Angle)" Duration="0:0:5" PathGeometry="{StaticResource tqx_1}" Storyboard.TargetName="yunshuche" Source="Angle"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource tqx_1}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource tqx_1}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
<Storyboard x:Key="Storyboard_tqx_2" RepeatBehavior="0:0:5">
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(Angle)" Duration="0:0:5" PathGeometry="{StaticResource tqx_2}" Storyboard.TargetName="yunshuche" Source="Angle"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource tqx_2}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource tqx_2}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
<Storyboard x:Key="Storyboard_tqx_3" RepeatBehavior="0:0:5">
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(Angle)" Duration="0:0:5" PathGeometry="{StaticResource tqx_3}" Storyboard.TargetName="yunshuche" Source="Angle"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource tqx_3}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource tqx_3}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
<!--清洗台到线体4-->
<Storyboard x:Key="Storyboard_qxt_4" RepeatBehavior="0:0:5">
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(Angle)" Duration="0:0:5" PathGeometry="{StaticResource qxt_4}" Storyboard.TargetName="yunshuche" Source="Angle"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource qxt_4}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource qxt_4}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
<!--从清洗台回家-->
<Storyboard x:Key="Storyboard_qxt_hj" RepeatBehavior="0:0:5">
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(Angle)" Duration="0:0:5" PathGeometry="{StaticResource qxt_hj}" Storyboard.TargetName="yunshuche" Source="Angle"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource qxt_hj}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource qxt_hj}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
<!--从家到清洗台-->
<Storyboard x:Key="Storyboard_jtqx" RepeatBehavior="0:0:5">
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(Angle)" Duration="0:0:5" PathGeometry="{StaticResource jtqx}" Storyboard.TargetName="yunshuche" Source="Angle"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Duration="0:0:5" PathGeometry="{StaticResource jtqx}" Storyboard.TargetName="yunshuche" Source="X"/>
<DoubleAnimationUsingPath Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Duration="0:0:5" PathGeometry="{StaticResource jtqx}" Storyboard.TargetName="yunshuche" Source="Y"/>
</Storyboard>
</ControlTemplate.Resources>
<Grid x:Name="yunshuche">
<Grid.RenderTransform>
@@ -1010,6 +1055,14 @@
<StopStoryboard BeginStoryboardName="begin_hs_4"/>
<StopStoryboard BeginStoryboardName="begin_hs_5"/>

<StopStoryboard BeginStoryboardName="begin_tqx_1"/>
<StopStoryboard BeginStoryboardName="begin_tqx_2"/>
<StopStoryboard BeginStoryboardName="begin_tqx_3"/>

<StopStoryboard BeginStoryboardName="begin_qxt_4"/>
<StopStoryboard BeginStoryboardName="begin_jtqx"/>

<StopStoryboard BeginStoryboardName="begin_qxt_hj"/>
<StopStoryboard BeginStoryboardName="begin_hj"/>
</Trigger.EnterActions>
<Setter TargetName="yunshuche" Property="Visibility" Value="Collapsed" />
@@ -1168,7 +1221,45 @@
</Trigger.EnterActions>
</Trigger>
<!--#endregion-->

<!--123线体到清洗台-->
<Trigger Property="Tag" Value="tqx_1">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_tqx_1" Storyboard="{StaticResource Storyboard_tqx_1}"/>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="Tag" Value="tqx_2">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_tqx_2" Storyboard="{StaticResource Storyboard_tqx_2}"/>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="Tag" Value="tqx_3">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_tqx_3" Storyboard="{StaticResource Storyboard_tqx_3}"/>
</Trigger.EnterActions>
</Trigger>
<Trigger Property="Tag" Value="qxt_4">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_qxt_4" Storyboard="{StaticResource Storyboard_qxt_4}"/>
</Trigger.EnterActions>
</Trigger>
<!--从家到清洗台-->
<Trigger Property="Tag" Value="jtqx">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_jtqx" Storyboard="{StaticResource Storyboard_jtqx}"/>
</Trigger.EnterActions>
</Trigger>
<!--从清洗台回家-->
<Trigger Property="Tag" Value="qxt_hj">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard x:Name="begin_qxt_hj" Storyboard="{StaticResource Storyboard_qxt_hj}"/>
</Trigger.EnterActions>
</Trigger>
<!--#region 回家路线-->
<Trigger Property="Tag" Value="hj">
<Setter TargetName="yunshuche" Property="Visibility" Value="Visible" />
@@ -1247,7 +1338,7 @@
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
@@ -1294,12 +1385,13 @@
<Button Margin="5" Click="Button_Click" Tag="只有碗" Cursor="Hand">只有碗</Button>
<Button Margin="5" Click="Button_Click" Tag="无物品" Cursor="Hand">无物品</Button>
</StackPanel>
<StackPanel>
<TextBlock Margin="5">滚筒炒锅</TextBlock>
<TextBox x:Name="guntongchaoguo_text" Margin="5">1</TextBox>
<Button Margin="5" Click="Button_Click" Tag="启动炒锅" Cursor="Hand">启动炒锅</Button>
<Button Margin="5" Click="Button_Click" Tag="停止炒锅" Cursor="Hand">停止炒锅</Button>
<Button Margin="5" Click="Button_Click" Tag="清洗桶数" Cursor="Hand">清洗桶数</Button>
</StackPanel>

</StackPanel>
@@ -1322,13 +1414,17 @@

<Grid x:Name="一号道路" Margin="0,80,0,0">
<Path Data="M1016.6667,415.98725 L330.95862,417.18254 331.55089,170.03705" Fill="Transparent" HorizontalAlignment="Left" Height="243" Margin="334,170,0,0" Stroke="#FF627569" StrokeDashArray="5 5" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="1160" />
<Path Data="M1016.0158,386.81528 L725.54498,387.52324 725.50328,170.91436" Fill="Transparent" HorizontalAlignment="Left" Height="215" Margin="840,172,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="649" />
<Path Data="M1016.0158,386.81528 L725.54498,387.52324 725.50328,170.91436" Fill="Transparent" HorizontalAlignment="Left" Height="215" Margin="840,172,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="300" />
<Path Data="M725.50328,386.81528 L725.50328,330.91436" Stroke="#FF2D3E33" StrokeThickness="2" Margin="414.5,-0.5,0,0" />
<Path Data="M725.50328,386.81528 L725.50328,330.91436" Stroke="#FF2D3E33" StrokeThickness="2" Margin="463.5,-0.8,0,0" />
<Path Data="M1016.0158,386.81528 L725.54498,387.52324 725.50328,170.91436 " Fill="Transparent" HorizontalAlignment="Left" Height="2" Margin="1189,384,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="300" RenderTransformOrigin="0.5,0.5"/>
<Path Data="M794.17358,168.8504 L795.74395,387.54981 689.48232,387.29818 689.48232,165.11694" Fill="Transparent" HorizontalAlignment="Left" Height="223" Margin="682,164,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="104"/>
<Path Data="M632.68285,173.84703 L633.02686,385.98646 527.43527,386.74398 526.83156,171.85808" Fill="Transparent" HorizontalAlignment="Left" Height="215" Margin="523,172,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="104"/>
<Path Data="M470.73348,171.25096 L470.73348,386.67023 364.24292,386.67023 364.24292,169.22349" Fill="Transparent" HorizontalAlignment="Left" Height="216" Margin="364,171,0,0" Stroke="#FF2D3E33" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="105"/>
<Path Data="M494,380.61719 L494,173.42969" Fill="Transparent" HorizontalAlignment="Left" Height="206" StrokeDashArray="5 5" Margin="494,174,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="2"/>
<Path Data="M651.5,387.34183 L651.5,164.69054" Fill="Transparent" HorizontalAlignment="Left" Height="223" StrokeDashArray="5 5" Margin="652,164,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="2" />
<Path Data="M812,390.42647 L812,175.98529" Fill="Transparent" HorizontalAlignment="Left" Height="213" StrokeDashArray="5 5" Margin="812,175,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="2"/>
<Path Data="M812,390.42647 L812,200.98529" Fill="Transparent" HorizontalAlignment="Left" Height="56" StrokeDashArray="5 5" Margin="1163,332,0,0" Stroke="#FF627569" StrokeThickness="2" Stretch="Fill" VerticalAlignment="Top" Width="2"/>
<Path Data="M311.25,9.5 L311.25,224" Fill="Transparent" HorizontalAlignment="Left" Height="216" Margin="309,172,0,0" Stroke="#FF2D3E33" Stretch="Fill" VerticalAlignment="Top" StrokeThickness="2" Width="4"/>

</Grid>
@@ -1610,9 +1706,66 @@
<TextBox Style="{StaticResource 停车位}" Margin="0,26,0,0" Text="{Binding ParkingPileModel_3.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,25,0,0" Text="{Binding ParkingPileModel_4.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,25,0,0" Text="{Binding ParkingPileModel_5.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<TextBox Style="{StaticResource 停车位}" Margin="0,25,0,0" Text="{Binding ParkingPileModel_6.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Style="{StaticResource 停车位}" Margin="0,25,0,0" Text="{Binding ParkingPileModel_5.Text ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<!--#endregion-->
<!--新增-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="600,230,0,0" Width="420" Height="180">
<Viewbox>
<Canvas Width="420" Height="180">
<Path Margin="-75,0,0,0">
<Path.Fill>
<LinearGradientBrush >
<GradientStop Offset="0" Color="Gray"/>
<GradientStop Offset="0.5" Color="White"/>
<GradientStop Offset="1" Color="Gray"/>
<LinearGradientBrush.RelativeTransform>
<RotateTransform Angle="-5"/>
</LinearGradientBrush.RelativeTransform>
</LinearGradientBrush>
</Path.Fill>
<Path.Data>
<PathGeometry Figures="M 186.6,67.5 Q 279.9,33.75 373.2,67.5 L391.86,33.075 Q298.56,1.125 205.26,33.075 L183.801,67.275"/>
</Path.Data>
</Path>
<Path Margin="-75,0,0,0">
<Path.Fill>
<LinearGradientBrush>
<GradientStop Offset="0.3" Color="Gray"/>
<GradientStop Offset="0.7" Color="White"/>
</LinearGradientBrush>
</Path.Fill>
<Path.Data>
<PathGeometry Figures="M374.133,90 L374.133,66.825 391.86,33.075 391.86,56.25 374.133,89.775"/>
</Path.Data>
</Path>
<Path Margin="-75,0,0,0">
<Path.Fill>
<LinearGradientBrush>
<GradientStop Offset="0.6" Color="AntiqueWhite"/>
<GradientStop Offset="0" Color="SlateGray"/>
<LinearGradientBrush.RelativeTransform>
<RotateTransform Angle="35"/>
</LinearGradientBrush.RelativeTransform>
</LinearGradientBrush>
</Path.Fill>
<Path.Data>
<PathGeometry Figures="M185.667,90 L242.58,67.5 Q279.9,51.75 317.22,67.5 L373.2,90 373.2,66.825 Q279.9,33.75 186.6,67.5 L186.6,66.825 186.6,90"/>
</Path.Data>
</Path>
<TextBlock Text="当前桶数:" Style="{DynamicResource 80号字体样式}" Canvas.Left="94" Canvas.Top="115" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBlock Text="{Binding DataContext.RollerNum, RelativeSource={RelativeSource AncestorType=Canvas, Mode=FindAncestor}}" FontSize="24" Style="{DynamicResource 80号字体样式}" Canvas.Left="195" Canvas.Top="111" HorizontalAlignment="Center" VerticalAlignment="Top" />
<!--<TextBox1 Style="{StaticResource 传送带空}" IsEnabled="False" Text="{Binding RollerLines_4.Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Tag="{Binding RollerLines_4.DishesNum,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Canvas.Left="176" Canvas.Top="73" HorizontalAlignment="Center" VerticalAlignment="Top">
<TextBox.RenderTransform>
<ScaleTransform ScaleY="0.48"/>
</TextBox.RenderTransform>
</TextBox>-->
</Canvas>
</Viewbox>

</StackPanel>
<TextBlock Style="{DynamicResource 80号字体样式}" VerticalAlignment="Top" Margin="950,250,0,0" FontSize="16" Width="16" >空桶清洗台</TextBlock>
</Grid>

</UserControl>

+ 3
- 1
FryPot_DosingSystem/View/AgvView.xaml.cs View File

@@ -187,7 +187,9 @@ namespace FryPot_DosingSystem.View
}
AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop);
break;

case "清洗桶数":
AgvViewModel.GetInstance().SetCleanRollerNum(2);
break;
}
}
}


+ 57
- 6
FryPot_DosingSystem/View/DebugView.xaml View File

@@ -32,26 +32,47 @@
<RowDefinition/>
</Grid.RowDefinitions>
<UniformGrid Columns="2">
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink">
<WrapPanel Orientation="Horizontal">
<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}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button>
<Button Content="AGV接口调试" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/>
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
</WrapPanel>
</GroupBox>
</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 Content="AGV线体1上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineOneLoadCom}"/>
<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}"/>
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotGetEmptyRoller}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体1空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineOneEmptyRollerLoc}"/>
<Button Content="AGV线体1空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineOneLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
</WrapPanel>
</GroupBox>
</WrapPanel>
</GroupBox>
</UniformGrid>
<UniformGrid Columns="2" Grid.Row="1">
<GroupBox Grid.Column="1" Header="PLC信号" Foreground="Aqua" BorderBrush="Pink">
@@ -61,16 +82,31 @@
<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}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
</WrapPanel>
</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线体2上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineTwoLoadCom}"/>
<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}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体2空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineTwoEmptyRollerLoc}"/>
<Button Content="AGV线体2空桶上完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineTwoLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
</WrapPanel>
</WrapPanel>
</GroupBox>
</UniformGrid>
@@ -82,16 +118,31 @@
<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}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
</WrapPanel>
</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线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/>
<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}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/>
<Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
</WrapPanel>
</WrapPanel>
</GroupBox>
</UniformGrid>


+ 75
- 0
FryPot_DosingSystem/View/FlowProcessView.xaml View File

@@ -0,0 +1,75 @@
<Window x:Class="FryPot_DosingSystem.View.FlowProcessView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FryPot_DosingSystem.View"
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
mc:Ignorable="d"
Title="FlowProcessView" Height="550" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True">
<Window.DataContext>
<vm:FlowProcessSetViewModel/>
</Window.DataContext>
<Border x:Name="br">
<Border.Background>
<SolidColorBrush Color="#264c73"/>
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="40"/>
<RowDefinition/>
</Grid.RowDefinitions>

<TextBlock Text="炒锅工艺" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" Background="Transparent" FontSize="25" Cursor="Arrow" ></TextBlock>

<Border BorderThickness="0,0,0,1" BorderBrush="#FF2AB2E7"></Border>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="保存工艺" Width="100" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" FontSize="18" Command="{Binding ConfirmCommand}" ></Button>
<Button Content="取消" Height="30" Width="100" Margin="0,0,10,0" Background="Transparent" FontSize="18" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding CloseWindowCommand}"></Button>

</StackPanel>
<Grid Grid.Row="2" Background="#FF2AB2E7" Margin="0,0,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="140"/>
</Grid.ColumnDefinitions>
<TextBlock Text="工艺步骤" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="1" Text="炒制原料/桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="1" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="2" Text="炒制速度" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="2" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="3" Text="炒制重量" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"></TextBlock>
<GridSplitter Grid.Column="3" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="4" Text="炒制温度" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
<GridSplitter Grid.Column="4" BorderThickness="0.2" BorderBrush="White"></GridSplitter>
<TextBlock Grid.Column="5" Text="炒制时间" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="white" FontSize="18"/>
</Grid>
<ItemsControl ItemsSource="{Binding flowProcessModels}" Grid.Row="3">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<TextBox Text="{Binding Id}" Foreground="SkyBlue" Width="100" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Background="Transparent" IsReadOnly="True" BorderBrush="#FF2AB2E7" BorderThickness="1,1,0.5,1" />
<TextBox Text="{Binding FryMaterialNum}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FrySpeed}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryWeight}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryTemperature}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,0.5,1"/>
<TextBox Text="{Binding FryPeriodTime}" Width="140" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="Transparent" Foreground="SkyBlue" FontSize="18" BorderBrush="#FF2AB2E7" BorderThickness="0.5,1,1,1"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Border>
</Window>

+ 35
- 0
FryPot_DosingSystem/View/FlowProcessView.xaml.cs View File

@@ -0,0 +1,35 @@
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.Shapes;

namespace FryPot_DosingSystem.View
{
/// <summary>
/// FlowProcessView.xaml 的交互逻辑
/// </summary>
public partial class FlowProcessView : Window
{
public FlowProcessView()
{
InitializeComponent();
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
ActionManage.GetInstance.CancelRegister("CloseFlowProcessView");
ActionManage.GetInstance.Register(new Action(() => {
this.Close();
}), "CloseFlowProcessView");
}

}
}

+ 13
- 13
FryPot_DosingSystem/View/NewRecipeView.xaml View File

@@ -195,20 +195,20 @@
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>

<TextBlock Text="配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="25" Margin="0,10"></TextBlock>
<TextBlock Text="配方信息" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF2AB2E7" FontSize="25" Margin="0,10"></TextBlock>
<UniformGrid Grid.Row="1" Columns="2">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="请输入配方名称:" Foreground="Aqua" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="请输入配方名称:" Foreground="#FF2AB2E7" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
<TextBox Style="{DynamicResource TextBoxStyle}" Text="{Binding RecipeName}" Width="230" Height="30" BorderThickness="1" Background="Transparent" Foreground="Orange"
VerticalContentAlignment="Center"
BorderBrush="Aqua" VerticalAlignment="Center" FontSize="16" ></TextBox>
BorderBrush="#FF2AB2E7" VerticalAlignment="Center" FontSize="16" ></TextBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="请输入桶的数量:" Foreground="Aqua" FontSize="18" Margin="10,0,5,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="请输入桶的数量:" Foreground="#FF2AB2E7" 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>
BorderBrush="#FF2AB2E7" VerticalAlignment="Center" FontSize="16" TextChanged="TextBox_TextChanged"></TextBox>
</StackPanel>
</StackPanel>
<Grid>
@@ -217,30 +217,30 @@
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="添加原料" Width="180" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Cursor="Hand" Command="{Binding AddRecipe}" ></Button>
<Button Content="确认更新" Height="30" Width="180" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Command="{Binding Comfirm}"></Button>
<Button Content="添加原料" Width="180" Margin="0,0,10,0" Height="30" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Cursor="Hand" Command="{Binding AddRecipe}" ></Button>
<Button Content="确认更新" Height="30" Width="180" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Command="{Binding Comfirm}"></Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
<Button Content="另存为" Height="30" Width="180" Margin="0,0,10,0" Command="{Binding SaveAs}" Cursor="Hand"/>
<Button Click="Button_Click" Content="取消" Height="30" FontSize="20" Background="Transparent" BorderBrush="Aqua" Foreground="Aqua" Width="180" Cursor="Hand"></Button>
<Button Click="Button_Click" Content="取消" Height="30" FontSize="20" Background="Transparent" BorderBrush="#FF2AB2E7" Foreground="#FF2AB2E7" Width="180" Cursor="Hand"></Button>
</StackPanel>
</Grid>
</UniformGrid>
<Grid Grid.Row="2" Background="Cyan" Margin="0,0,0,10">
<Grid Grid.Row="2" Background="#FF2AB2E7" 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"/>
<TextBlock Text="原料名称" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<GridSplitter></GridSplitter>
<TextBlock Grid.Column="1" Text="原料桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Tomato"/>
<TextBlock Grid.Column="1" Text="原料桶号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
<GridSplitter Grid.Column="1"></GridSplitter>
<TextBlock Grid.Column="2" Text="原料重量" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Tomato"></TextBlock>
<TextBlock Grid.Column="2" Text="原料重量" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"></TextBlock>
<GridSplitter Grid.Column="2"></GridSplitter>
<TextBlock Grid.Column="3" Text="操作" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Tomato"/>
<TextBlock Grid.Column="3" Text="操作" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Grid>
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding materials}">


+ 1
- 0
FryPot_DosingSystem/View/RecipeManageView.xaml View File

@@ -150,6 +150,7 @@
<TextBlock Text="操作:" Foreground="White" FontSize="18"></TextBlock>
<Button Style="{DynamicResource ButtonStyle1}" Content="编辑" Cursor="Hand" Foreground="Orange" FontSize="18" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
CommandParameter="{Binding RecipeId}"/>
<Button Margin="60,0,0,0" Style="{DynamicResource ButtonStyle1}" Content="炒制工艺" Cursor="Hand" Foreground="Orange" FontSize="18" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.OperateFlowProcess,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,5">
<TextBlock Text="创建时间:" FontSize="18" Foreground="White"></TextBlock>


+ 3
- 2
FryPot_DosingSystem/View/RecipeSendDownView.xaml View File

@@ -116,7 +116,8 @@
</Grid.ColumnDefinitions>
<Line StrokeThickness="3" Grid.Column="0" HorizontalAlignment="Left" Stroke="LawnGreen" X1="0" Y1="5" X2="0" Y2="110"></Line>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Margin="0,0,0,5" Height="27" Command="{Binding DataContext.RecipeSetDownCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}" Cursor="Hand" >
<TextBlock FontSize="16" Text="{Binding RecipeSetInfo}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<Button Margin="0,5,0,0" Height="27" Command="{Binding DataContext.RecipeSetDownCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}" Cursor="Hand" >
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<StackPanel Orientation="Horizontal" >
@@ -133,7 +134,7 @@
</Button.Template>
</Button>
<TextBlock FontSize="16" Text="{Binding RecipeSetInfo}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</StackPanel>
</Grid>


+ 50
- 5
FryPot_DosingSystem/View/SqliteDataView.xaml View File

@@ -479,18 +479,18 @@
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<DatePicker Margin="50,0" Height="35" Style="{StaticResource PickerStyle}" SelectedDate="{Binding SelectedDate}"></DatePicker>
<ComboBox Style="{DynamicResource ComboBoxStyle1}" ItemsSource="{Binding list}" Height="35" Width="150" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Foreground="#FF2AB2E7" SelectedValue="{Binding cboSelectedValue}" Margin="0,0,50,0"></ComboBox>
<Button Width="150" Height="35" Content="查询" FontSize="20" Foreground="#FF2AB2E7" Background="Transparent" BorderBrush="#FF2AB2E7" BorderThickness="1" Command="{Binding SelectCommand}"></Button>
<!--<DatePicker Margin="50,0" Height="35" Style="{StaticResource PickerStyle}" SelectedDate="{Binding SelectedDate}"></DatePicker>
<ComboBox Style="{DynamicResource ComboBoxStyle1}" ItemsSource="{Binding list}" Height="35" Width="150" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" Foreground="#FF2AB2E7" SelectedValue="{Binding cboSelectedValue}" Margin="0,0,50,0"></ComboBox>-->
<Button Width="150" Height="35" Content="查询" FontSize="20" Foreground="#FF2AB2E7" Background="Transparent" BorderBrush="#FF2AB2E7" BorderThickness="1" Margin="0,0,10,0" Command="{Binding SelectCommand}"></Button>
</StackPanel>
<DataGrid Grid.Row="1" x:Name="fryOne" Visibility="{Binding fryOneDataVisible}" ItemsSource="{Binding StatusOne}" GridLinesVisibility="All" Background="Transparent"
<DataGrid Grid.Row="1" x:Name="fryPot" ItemsSource="{Binding Status}" GridLinesVisibility="All" Background="Transparent" LoadingRow="fryPot_LoadingRow"
AutoGenerateColumns="False" IsReadOnly="True" Style="{StaticResource dataGrid}"
ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Id}" IsReadOnly="False" Style="{StaticResource textboxStyle}"></TextBox>
<TextBox Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" IsReadOnly="True" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -502,6 +502,8 @@
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="炒锅载重" Binding="{Binding FryPotWeight}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="配方名称" Binding="{Binding RecipeName}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="配方用油量" Binding="{Binding OilCapacity}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="总用油量" Binding="{Binding TotalOilCapactiy}" ElementStyle="{StaticResource dgCellstyle }">
@@ -526,6 +528,49 @@
</DataGridTemplateColumn>-->
</DataGrid.Columns>
</DataGrid>
<!--<DataGrid Grid.Row="1" x:Name="fryOne" Visibility="{Binding fryOneDataVisible}" ItemsSource="{Binding StatusOne}" GridLinesVisibility="All" Background="Transparent"
AutoGenerateColumns="False" IsReadOnly="True" Style="{StaticResource dataGrid}"
ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
<DataGrid.Columns>
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Id}" IsReadOnly="False" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="0.2*" Header="温度" Binding="{Binding Temperature}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="火力" Binding="{Binding HotPower}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="搅拌速度" Binding="{Binding Speed}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="炒锅载重" Binding="{Binding FryPotWeight}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="配方用油量" Binding="{Binding OilCapacity}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="总用油量" Binding="{Binding TotalOilCapactiy}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="产量" Binding="{Binding TotalProduct}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
<DataGridTextColumn Width="0.2*" Header="时间" Binding="{Binding Time}" ElementStyle="{StaticResource dgCellstyle }">
</DataGridTextColumn>
--><!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding PlcAddress}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn IsReadOnly="False" Width="0.45*" Header="地址长度">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Length}" Style="{StaticResource textboxStyle}"></TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>--><!--
</DataGrid.Columns>
</DataGrid>-->
<DataGrid x:Name="fryTwo" Grid.Row="1" Visibility="{Binding fryTwoDataVisible}" ItemsSource="{Binding StatusTwo}" GridLinesVisibility="All" Background="Transparent"
AutoGenerateColumns="False" IsReadOnly="True" Style="{StaticResource dataGrid}"
ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">


+ 4
- 1
FryPot_DosingSystem/View/SqliteDataView.xaml.cs View File

@@ -25,6 +25,9 @@ namespace FryPot_DosingSystem.View
InitializeComponent();
}

private void fryPot_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}
}
}

+ 7
- 0
FryPot_DosingSystem/ViewModel/AgvViewModel.cs View File

@@ -19,6 +19,9 @@ namespace FryPot_DosingSystem.ViewModel
#region 单例模式
private volatile static AgvViewModel _Instance;
public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel());

public int RollerNum { get { return _rollerNum; } set { _rollerNum = value;OnPropertyChanged(); } }
private int _rollerNum;
public AgvViewModel()
{
Init();
@@ -67,6 +70,10 @@ namespace FryPot_DosingSystem.ViewModel
new WorkflowModel {id=1,Name="取番茄",isBool= IsBool.Yes},
new WorkflowModel {id=2,Name="取蛋" } };
}
public void SetCleanRollerNum(int num)
{
RollerNum = num;
}
/// <summary>
/// 设置停车桩或充电桩
/// </summary>


+ 84
- 0
FryPot_DosingSystem/ViewModel/DebugViewModel.cs View File

@@ -28,6 +28,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AGVFryPotDownArrive { get; set; }
public RelayCommand AGVFryPotUpArrive { get; set; }
public RelayCommand AGVFryPotGetEmptyRoller { get; set; }
public RelayCommand AGVLineOneLoadCom { get; set; }//线体1上料完成

//滚筒线2绑定命令
public RelayCommand RollerLineTwoRunning { get; set; }
@@ -41,6 +42,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AGVFryPotTwoDownArrive { get; set; }
public RelayCommand AGVFryPotTwoUpArrive { get; set; }
public RelayCommand AGVFryPotTwoGetEmptyRoller { get; set; }
public RelayCommand AGVLineTwoLoadCom { get; set; }//线体2上料完成
//滚筒线3绑定命令
public RelayCommand RollerLineThreeRunning { get; set; }
//public RelayCommand EightWorkLoc { get; set; }
@@ -52,9 +54,91 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AGVFryPotThreeDownArrive { get; set; }
public RelayCommand AGVFryPotThreeUpArrive { get; set; }
public RelayCommand AGVFryPotThreeGetEmptyRoller { get; set; }
public RelayCommand AGVLineThreeLoadCom { get; set; }//线体3上料完成

//AGV接口联调
public RelayCommand AgvDebug { get; set; }

//线体123空桶清洗以及回收
public RelayCommand AgvArriveLineOneEmptyRollerLoc { get; set; }

public RelayCommand AgvLineOneLoadEmptyCom { get; set; }
public RelayCommand AgvArriveLineTwoEmptyRollerLoc { get; set; }
public RelayCommand AgvLineTwoLoadEmptyCom { get; set; }
public RelayCommand AgvArriveLineThreeEmptyRollerLoc { get; set; }
public RelayCommand AgvLineThreeLoadEmptyCom { get; set; }
public RelayCommand CleanPlateCallAgv { get; set; }
public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料
public RelayCommand AgvArriveLineFourLoc { get; set; }

public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料

public RelayCommand EmptyRollerCleanTaskRestart { get; set; }
public DebugViewModel()
{
AgvDebug = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvDebug");
}));

EmptyRollerCleanTaskRestart = new RelayCommand(() =>
{

ActionManage.GetInstance.Send("EmptyRollerCleanTaskRestart");
});
AgvLineOneLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineOneLoadEmptyCom");
});
AgvLineTwoLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineTwoLoadEmptyCom");
});
AgvLineThreeLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineThreeLoadEmptyCom");
});
AGVLineOneLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AGVLineOneLoadCom");
});
AGVLineTwoLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AGVLineTwoLoadCom");

});
AGVLineThreeLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AGVLineThreeLoadCom");

});
AgvArriveLineOneEmptyRollerLoc = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveLineOneEmptyRollerLoc");
}));
AgvArriveLineTwoEmptyRollerLoc = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveLineTwoEmptyRollerLoc");
}));
AgvArriveLineThreeEmptyRollerLoc = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveLineThreeEmptyRollerLoc");
}));
CleanPlateCallAgv = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("CleanPlateCallAgv");
}));
AgvArriveCleanPlateLoc = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveCleanPlateLoc");
}));
AgvArriveCleanPlateLocLoad = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoad");
}));
AgvArriveLineFourLoc = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveLineFourLoc");
}));

RollerLineRunning = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("RollerLineRunning");


+ 1
- 1
FryPot_DosingSystem/ViewModel/DeviceListViewModel.cs View File

@@ -20,7 +20,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand<string> DeleteDevice { get; set; }
public DeviceListViewModel()
{
//Json<DeviceManage>.Read();
Json<DeviceManage>.Read();
devices = Json<DeviceManage>.Data.Devices;
DeviceName.Add("滚筒输送线");
DeviceName.Add("炒锅1");


+ 77
- 0
FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs View File

@@ -0,0 +1,77 @@
using BPASmartClient.Helper;
using FryPot_DosingSystem.Model;
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 FlowProcessSetViewModel
{
public int Id { get; set; } = 0;
public ObservableCollection<FlowProcessModel> flowProcessModels { get; set; } = new ObservableCollection<FlowProcessModel>();

public string currnetRecipeName { get; set;}
public RelayCommand CloseWindowCommand { get; set; }

public RelayCommand ConfirmCommand { get; set; }
public FlowProcessSetViewModel()
{
ActionManage.GetInstance.Register(new Action<object>(recipeName =>
{
if (recipeName != null)
{
currnetRecipeName = recipeName.ToString();
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess.RecipeName == recipeName.ToString());
if (res != null && res is NewRecipeModel recipe) //编辑已有工艺
{
//flowProcessModels = recipe.FlowProcess.fpModels;
foreach (var item in recipe.FlowProcess.fpModels)
{
flowProcessModels.Add(new FlowProcessModel { Id = item.Id, FryMaterialNum = item.FryMaterialNum, FrySpeed = item.FrySpeed, FryWeight = item.FryWeight, FryTemperature = item.FryTemperature, FryPeriodTime = item.FryPeriodTime });
}
}
else//创建新工艺
{
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p=>p.RecipeName==recipeName.ToString());
if (name != null)
{
name.FlowProcess.RecipeName = recipeName.ToString();
flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = "油" });
Id++;
foreach (var item in name.materialCollection)
{
flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = item.MaterialName });
Id++;
}
name.FlowProcess.fpModels= flowProcessModels;
}
}
}

}), "EditFlowProcess");
CloseWindowCommand = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("CloseFlowProcessView");
});
ConfirmCommand = new RelayCommand(() =>
{
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeName == currnetRecipeName.ToString());
if (name != null)
{
name.FlowProcess.RecipeName = currnetRecipeName.ToString();
name.FlowProcess.fpModels = flowProcessModels;
}
Json<RecipeManage>.Save();
ActionManage.GetInstance.Send("CloseFlowProcessView");
});
}
}
}

+ 1
- 1
FryPot_DosingSystem/ViewModel/NewRecipeViewModel.cs View File

@@ -102,7 +102,7 @@ namespace FryPot_DosingSystem.ViewModel
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,DataTime=DateTime.Now.ToShortDateString()});//配方添加
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, FlowProcess=new FlowProcessManage(), materialCollection = materials,DataTime=DateTime.Now.ToShortDateString()});//配方添加
}
else
{


+ 16
- 0
FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs View File

@@ -33,6 +33,10 @@ namespace FryPot_DosingSystem.ViewModel

public RelayCommand SaveRecipe { get; set; }
/// <summary>
/// 工艺操作
/// </summary>
public RelayCommand<string> OperateFlowProcess { get; set; }
/// <summary>
/// 编辑配方
/// </summary>
public RelayCommand<object> EditRecipeCommand { get; set; }
@@ -103,6 +107,18 @@ namespace FryPot_DosingSystem.ViewModel
}
}
});
//工艺流程操作
OperateFlowProcess = new RelayCommand<string>((recipeName) =>
{
if (recipeName != null && recipeName != string.Empty && recipeName != "")
{
ActionManage.GetInstance.CancelRegister("EditFlowProcess");
FlowProcessView fps = new FlowProcessView();
ActionManage.GetInstance.Send("EditFlowProcess", recipeName);
fps.ShowDialog();
}
});
}
}
}

+ 57
- 6
FryPot_DosingSystem/ViewModel/SqliteDataViewModel.cs View File

@@ -5,7 +5,9 @@ using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
@@ -15,18 +17,20 @@ namespace FryPot_DosingSystem.ViewModel
{
internal class SqliteDataViewModel : ObservableObject
{
public ObservableCollection<PotOneStatus> StatusOne { get; set; } = new ObservableCollection<PotOneStatus>();
public ObservableCollection<PotTwoStatus> StatusTwo { get; set; } = new ObservableCollection<PotTwoStatus>();
public ObservableCollection<PotThreeStatus> StatusThree { get; set; } = new ObservableCollection<PotThreeStatus>();
public ObservableCollection<PotFourStatus> StatusFour { get; set; } = new ObservableCollection<PotFourStatus>();
public ObservableCollection<PotFiveStatus> StatusFive { get; set; } = new ObservableCollection<PotFiveStatus>();

public ObservableCollection<object> Status { get; set; } = new ObservableCollection<object>();

public Visibility fryOneDataVisible { get { return _fryOneDataVisible; } set { _fryOneDataVisible = value; OnPropertyChanged(); } }
private Visibility _fryOneDataVisible=Visibility.Visible;
private Visibility _fryOneDataVisible = Visibility.Visible;

public Visibility fryTwoDataVisible { get { return _fryTwoDataVisible; } set { _fryTwoDataVisible = value; OnPropertyChanged(); } }
private Visibility _fryTwoDataVisible=Visibility.Collapsed;
private Visibility _fryTwoDataVisible = Visibility.Collapsed;

public Visibility fryThreeDataVisible { get { return _fryThreeDataVisible; } set { _fryThreeDataVisible = value; OnPropertyChanged(); } }
private Visibility _fryThreeDataVisible = Visibility.Collapsed;
@@ -174,19 +178,66 @@ namespace FryPot_DosingSystem.ViewModel
// }
//}
#endregion
using (OpenFileDialog openFile = new OpenFileDialog())
{
openFile.Title = "请选择对应数据文件";
openFile.Filter = "*.BIN|*.bin";
openFile.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory+"AccessFile\\"+"DB";
openFile.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "AccessFile\\" + "DB\\";
openFile.Multiselect = false;
DialogResult res= openFile.ShowDialog();
DialogResult res = openFile.ShowDialog();
if (res == DialogResult.OK)
{
string file = openFile.FileName;
if (Path.GetExtension(file).Equals(".bin"))
{
if (Status.Count > 0)
{
Status.Clear();
}
using (FileStream readStream = new FileStream(file, FileMode.Open, FileAccess.Read))
{
readStream.Position = 0;
while (readStream.Position < readStream.Length)
{
BinaryFormatter bf = new BinaryFormatter();
object a = bf.Deserialize(readStream);
if (a is PotOneStatus p1)
{

Status.Add(p1);

}
if (a is PotTwoStatus p2)
{

Status.Add(p2);

}
if (a is PotThreeStatus p3)
{

Status.Add(p3);

}
if (a is PotFourStatus p4)
{

Status.Add(p4);

}
if (a is PotFiveStatus p5)
{

Status.Add(p5);

}
}
}
}
}
}
});
}
}


+ 46
- 22
SmartClient.sln View File

@@ -118,14 +118,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTSingle"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MilkWithTea", "BPASmartClient.MilkWithTea\BPASmartClient.MilkWithTea.csproj", "{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectricCurrentTestDemo", "..\..\TEST\ElectricCurrentTestDemo\ElectricCurrentTestDemo.csproj", "{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTM", "BPASmartClient.MorkTM\BPASmartClient.MorkTM.csproj", "{1612F583-D328-45C6-8BB1-5D41B8F1D216}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.KHKJ", "BPASmartClient.KHKJ\BPASmartClient.KHKJ.csproj", "{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Nfc", "BPASmartClient.Nfc\BPASmartClient.Nfc.csproj", "{42D35B7C-764C-4692-AA85-9B343A0F5B7F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Argox", "BPASmartClient.Argox\BPASmartClient.Argox.csproj", "{B8D499BA-A18A-4FD6-B036-44F02B4D164B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.S7Net", "BPASmartClient.S7Net\BPASmartClient.S7Net.csproj", "{D1F2379E-1755-4B50-9D67-15C960C33FFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JXJFoodBigStation", "BPASmartClient.JXJFoodBigStation\BPASmartClient.JXJFoodBigStation.csproj", "{FA695D7E-6F12-4483-A16D-8494609FAE68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JXJFoodSmallStation", "BPASmartClient.JXJFoodSmallStation\BPASmartClient.JXJFoodSmallStation.csproj", "{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40}"
@@ -1124,26 +1127,6 @@ Global
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x64.Build.0 = Release|Any CPU
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x86.ActiveCfg = Release|Any CPU
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B}.Release|x86.Build.0 = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM.ActiveCfg = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM.Build.0 = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|ARM64.Build.0 = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x64.ActiveCfg = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x64.Build.0 = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x86.ActiveCfg = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Debug|x86.Build.0 = Debug|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|Any CPU.Build.0 = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM.ActiveCfg = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM.Build.0 = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM64.ActiveCfg = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|ARM64.Build.0 = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x64.ActiveCfg = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x64.Build.0 = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x86.ActiveCfg = Release|Any CPU
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44}.Release|x86.Build.0 = Release|Any CPU
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -1164,6 +1147,26 @@ Global
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x64.Build.0 = Release|Any CPU
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x86.ActiveCfg = Release|Any CPU
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B}.Release|x86.Build.0 = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|ARM.ActiveCfg = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|ARM.Build.0 = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|ARM64.Build.0 = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|x64.ActiveCfg = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|x64.Build.0 = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|x86.ActiveCfg = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Debug|x86.Build.0 = Debug|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|Any CPU.Build.0 = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|ARM.ActiveCfg = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|ARM.Build.0 = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|ARM64.ActiveCfg = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|ARM64.Build.0 = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|x64.ActiveCfg = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|x64.Build.0 = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|x86.ActiveCfg = Release|Any CPU
{1612F583-D328-45C6-8BB1-5D41B8F1D216}.Release|x86.Build.0 = Release|Any CPU
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42D35B7C-764C-4692-AA85-9B343A0F5B7F}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -1204,6 +1207,26 @@ Global
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x64.Build.0 = Release|Any CPU
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x86.ActiveCfg = Release|Any CPU
{B8D499BA-A18A-4FD6-B036-44F02B4D164B}.Release|x86.Build.0 = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|ARM.ActiveCfg = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|ARM.Build.0 = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|ARM64.Build.0 = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|x64.ActiveCfg = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|x64.Build.0 = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|x86.ActiveCfg = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Debug|x86.Build.0 = Debug|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|Any CPU.Build.0 = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|ARM.ActiveCfg = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|ARM.Build.0 = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|ARM64.ActiveCfg = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|ARM64.Build.0 = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|x64.ActiveCfg = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|x64.Build.0 = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|x86.ActiveCfg = Release|Any CPU
{D1F2379E-1755-4B50-9D67-15C960C33FFA}.Release|x86.Build.0 = Release|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA695D7E-6F12-4483-A16D-8494609FAE68}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -1298,10 +1321,11 @@ Global
{099E047C-F40E-47A3-A5BA-81FC1500D5E8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{2366AC9B-B662-4550-9486-AF848B4D2961} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{BFA4E222-BBCC-4AC7-9EA4-4549AEF3174B} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{75B55300-ABC3-4CA1-B9B6-DF954E6C7B44} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{C0060FB3-7AEA-4D14-ADCE-DB78D3665D5B} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD}
{1612F583-D328-45C6-8BB1-5D41B8F1D216} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{42D35B7C-764C-4692-AA85-9B343A0F5B7F} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{B8D499BA-A18A-4FD6-B036-44F02B4D164B} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{D1F2379E-1755-4B50-9D67-15C960C33FFA} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
{FA695D7E-6F12-4483-A16D-8494609FAE68} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{D609C4CF-FA5C-4D39-B12F-07A60FFE5E40} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
EndGlobalSection


Loading…
Cancel
Save