Compare commits

...

197 Commits

Author SHA1 Message Date
  lyw 2440a1db60 更改名称 1 month ago
  lyw 298f2f4b93 食堂更新 1 month ago
  lyw 7d393a93da sss 2 months ago
  lyw 6e314ba49a 历史订单查询,及保存日期更改 2 months ago
  lyw d473534f01 鸿鹄煮面机 2 months ago
  lyw 5b02db498a 鸿鹄中学版本 2 months ago
  lyw cee913ddb0 sss 3 months ago
  lyw 91440c354a bendi 5 months ago
  lyw 472d6f13f7 当前更新 5 months ago
  lyw 08d0a7e0bd 本地存储 5 months ago
  lyw dbe238bdf8 暂存 5 months ago
  lyw e3716f6aeb 历史订单 5 months ago
  lyw 4e35086fa8 界面更新 5 months ago
  lyw d94432cfe7 现场更新 6 months ago
  lyw e94722d6bc Merge branch '煮面机(新)' of http://111.9.47.105:10244/bpa/BPASmartClient into 煮面机(新) 6 months ago
  lyw b84a066a27 上传 6 months ago
  pry fffc6474dd 网络验证修改 6 months ago
  lyw 639e656874 上传 6 months ago
  lyw 9a266794c0 baocun 6 months ago
  lyw 4e68b456b6 baocun 6 months ago
  lyw 7cf4a5a69b 保存 6 months ago
  lyw 010aa05d39 现场 6 months ago
  lyw 07709d37c0 zancun 6 months ago
  lyw e5cd042425 更改上传---lyw 6 months ago
  lyw fd12f1450f 新建煮面机分支----lyw 24/5/30 6 months ago
  pry 09e01a96b6 Morks煮面机接口更新修改 7 months ago
  ZhaoGang ab9f3d8cfd 1. 添加新建模板配方的功能。2. 工艺添加部分默认参数值。 1 year ago
  ZhaoGang 4abe039c18 1. 精简配方工艺。2.修改调试界面使得更方便。 1 year ago
  ZhaoGang 4985c1e36d 1. 延长通讯时间。2. 修改调试界面按钮大小。 3. 新增机械手清洗完成按钮。 1 year ago
  ZhaoGang b9fad2016e 食堂分餐机大屏添加日期时间显示 1 year ago
  ZhaoGang 21b912b337 1. 三代煮面机初次修改。 1 year ago
  ZhaoGang 3662bb90f6 炒菜系统添加机器人维护位置功能 1 year ago
  ZhaoGang 595789cefe Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z 81f87cc93b Morks本地订单更新 1 year ago
  ZhaoGang c1fe4b32fd 1. 修改冒菜机的模拟订单功能。2. 煮面机模拟界面碗位置默认修改为11. 1 year ago
  ZhaoGang efb530183b 1. 搅拌频率可输入0-60Hz,2. 添加辅料库位按炒锅区分功能及相应的配置界面。 1 year ago
  ZhaoGang 8828bcfcaf 1. 小炒系统电子秤委托修改。 1 year ago
  ZhaoGang aea508a4ac 1. 添加参数设置页面。2. 添加库位可人工修改库位信息的功能。 1 year ago
  ZhaoGang 2cea2352bf 现场调试修改。 1 year ago
  ZhaoGang bab6ca369f 1. 炒锅在做菜的时候,不可手动控制。2. 添加取消任务时,等待操作也取消。3. modbus通讯修改超时时间。 1 year ago
  ZhaoGang ed1e5c8e3f 修改冒菜机订单状态改变事件推送方式。2. 成都旅游学院调试修改 1 year ago
  pry d4757a4091 网络调整修改 1 year ago
  pry fb560fc9c6 监控状态排序 1 year ago
  ZhaoGang e8d384bc59 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 085ecfc10b 2 1 year ago
  ZhaoGang c768eb1af5 修改冒菜机的订单模拟功能。 1 year ago
  ZhaoGang 25729cc792 1 1 year ago
  pry c077ce7750 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 08628bef31 日志添加 1 year ago
  ZhaoGang b0dc675213 1. 改为出餐优先 1 year ago
  ZhaoGang 9d1b781078 柔性配料系统添加接收MQTT工单 1 year ago
  ZhaoGang e10539084a 删除合并冲突印记 1 year ago
  ZhaoGang 0f03b6ddff 1 1 year ago
  ZhaoGang e71cb499fd 1 1 year ago
  ZhaoGang 6707cc5e31 1. 添加MQTTServer基础。2. 修改了一些命名。3. 删除了一些多余的类。 1 year ago
  ZhaoGang a07b4a8bca Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 30d0f67030 剔除西门子业务逻辑 1 year ago
  Mr_z 9e2c247440 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z 5e818a85b3 阿里云联调更新 1 year ago
  ZhaoGang 17c108c638 日志打印简化 1 year ago
  Mr_z bd840e91fb 增加物模型默认模板事件 1 year ago
  Mr_z 904948869b Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z 176c56a537 物模型属性更新 1 year ago
  ZhaoGang 70ea1d70be Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang ba8fffe3f0 1Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 9167417d40 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 88014f7cf2 1. 代码格式化。2.恢复注释。 1 year ago
  Mr_z f2a16ec1ad 增加料仓在线状态属性上报 1 year ago
  Mr_z 84fb2cfd6c Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z 8079a30c82 柔性配料系统接入阿里云Iot 1 year ago
  ZhaoGang b89c5f2d03 1. 修改数据库初始化。 1 year ago
  ZhaoGang 2ac2bb56cf Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang c1cea78eef 1. 优化手动调试系界面代码。2. 完善报警变量及赋值。 1 year ago
  Mr_z 912e73f769 冲突更新 1 year ago
  Mr_z a418a36a31 更新 1 year ago
  ZhaoGang 56c1023501 1. 修改入库程序到Control_MorkCL里。2. 配方编辑界面添加上移下移功能。 1 year ago
  ZhaoGang 1cd8119b09 修改手动调试炒锅界面代码。 1 year ago
  ZhaoGang c0af685c3d 1. 完善手动调试界面。2. 修改入库条件判断。 1 year ago
  ZhaoGang 96480deff6 海科调试。 1 year ago
  pry 9a14ec46c4 从站设置 1 year ago
  pry 64fc2d20d4 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang dc34d54028 恢复注释。 1 year ago
  ZhaoGang 937e5b140a 下发配方时添加物料查找验证。 1 year ago
  pry b0a1aece7e Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 678c9099e3 测试项目添加 1 year ago
  ZhaoGang 3d6149a7d6 添加手动调试界面。 1 year ago
  ZhaoGang 3d3dfcce1c 修改入库界面库位显示。 1 year ago
  ZhaoGang e99a352a6c 修改配方分配逻辑。 1 year ago
  ZhaoGang 85b638fd9e 1. 添加修改变量。2. 修改配方功能。 1 year ago
  ZhaoGang db149553ba 海科调试修改。 1 year ago
  ZhaoGang e5d89c9254 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang a72757c144 1 1 year ago
  ZhaoGang b384e0e54a 1. 添加日志输出,测试订单下发。2. 读取变量程序更新。 1 year ago
  Mr_z 78cdd8c5d5 柔性配料调试更新 1 year ago
  Mr_z c3d46b40f0 更新 1 year ago
  Mr_z 8e7aec3c18 配料状态更新 1 year ago
  Mr_z 3b9e68d0f1 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z e89c847747 调试更新 1 year ago
  ZhaoGang 7ad95a23f2 1 1 year ago
  ZhaoGang f216983a7d Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang e037129464 修复加载Json文件多添加参数的问题。以及代码格式化。 1 year ago
  ZhaoGang 310f8e6582 配方功能参数编辑框调整为部分参数使用ComboBox选择。 1 year ago
  Mr_z e8fa48765a Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z 5d9c288879 配方执行逻辑更新 1 year ago
  Nah a94953e850 1 1 year ago
  ZhaoGang 70e6844d9e 成都旅游学院项目修改所在文件夹名称。 1 year ago
  ZhaoGang 5f343e3671 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang ad732e6d30 新增全局流程变量监控页面。 1 year ago
  pry b692557aa6 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 70b008a545 1 1 year ago
  Mr_z 0aafdb6434 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  Mr_z a2dc345f4a 多桶配料 1 year ago
  pry c8f3eece23 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 347fedfd0f 1 1 year ago
  Mr_z f9ee456b27 冲突解决 1 year ago
  Mr_z 12627e7fbf 调试更新 1 year ago
  ZhaoGang 8e1e6b47e7 配方ID改为自动生成。 1 year ago
  ZhaoGang 504ab28c9c Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 5bad282b21 修改配方数据,新增配方下发。 1 year ago
  pry 5d34b83083 包管理更新 1 year ago
  pry c44d1bffb0 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 40cf72d7bc 模拟配方提添加 1 year ago
  ZhaoGang 3c21143479 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 66c36ec461 修改配方Model类命名。 1 year ago
  pry 449897d2ac 模拟工艺添加 1 year ago
  pry c9a7ab810f 1 1 year ago
  pry 427d4bf586 1 1 year ago
  pry b1fed931f6 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 99a6ee5665 通讯组件修改 1 year ago
  ZhaoGang 4097d8467e Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 9b2e950537 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry f4f1942a4a 包更新 1 year ago
  ZhaoGang 9180d06f96 新增物料信息编辑弹框。 1 year ago
  pry c529755e85 包更新 1 year ago
  pry e5d441d1a9 1 1 year ago
  Mr_z 32f1fe0610 1 1 year ago
  Mr_z dce9473191 冲突解决 1 year ago
  pry 80e2fe8717 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 8aab8e3ef7 调整修改 1 year ago
  ZhaoGang 9868bee14f Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 636e629590 配方管理页面添加命令并做基本测试。 1 year ago
  pry 3fe73c2ca0 配料系统调试 1 year ago
  pry 9728ceb17f 1 1 year ago
  pry acdb8baaba 包更新 1 year ago
  Mr_z 66bd28605a 冲突解决 1 year ago
  pry d3055b8843 变量监控添加 1 year ago
  pry 694604c4f0 通讯库验证更新 1 year ago
  pry 0e0636890e Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 75089fd056 机器人模型添加 1 year ago
  ZhaoGang ca33e181bc Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang ed15d6ce45 修改功能编辑页面。 1 year ago
  pry 3cddfb6317 炒锅通讯添加 1 year ago
  pry cea0a5938f Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 1227494131 控制修改 1 year ago
  ZhaoGang 4fddadf09d Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang df6984415e 修改配方管理界面。 1 year ago
  pry 34ad8dc9a3 原料管理 1 year ago
  Nah 8639cbf8ad 1 1 year ago
  ZhaoGang 37c1a5233e 修改命名空间 1 year ago
  ZhaoGang 4c11e4b2e8 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang 2c7dbd78d5 调整添加原料页面 1 year ago
  pry 63e4cac92c 1 1 year ago
  pry 794c948e66 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 8b7d0947fb 基础配置 1 year ago
  ZhaoGang 3f25e86d5c Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  ZhaoGang d95a182dcc 添加页面 1 year ago
  pry c9b2be01e1 物料信息添加 1 year ago
  pry 11fea40c27 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 72913d6a55 框架搭建 1 year ago
  ZhaoGang 5a1414b09e 添加依赖 1 year ago
  ZhaoGang 4f58ecaa3c 新增页面 1 year ago
  ZhaoGang 6a6b515f8b 新增页面 1 year ago
  pry b0784c0873 1 1 year ago
  ZhaoGang 5bb2b54c95 旅游学院修改为单机设备框架。 1 year ago
  ZhaoGang cff11e553d 1 1 year ago
  ZhaoGang a9adfffb50 新增页面 1 year ago
  pry 70aba46ed1 1 1 year ago
  pry d007bcd0e0 1 1 year ago
  pry 0973051ff3 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration 1 year ago
  pry 04f275ff32 同步更新 1 year ago
  ZhaoGang 03d0215060 修改大料站原料厂显示顺序。 1 year ago
  pry 03d5d98f53 1 1 year ago
  pry e16afc9d10 分支调整合并 1 year ago
  pry 26eb67ee22 1 1 year ago
  pry 7af9b8718c 1 1 year ago
  pry 3b2a26493f 1 1 year ago
  pry 746fe78e5b 1 1 year ago
  pry 8bfe9b27c8 1 1 year ago
  pry 8d95c34a50 1 1 year ago
  pry a97d4951d2 1 1 year ago
  pry 23bedc9078 1 1 year ago
  pry 6af72a3522 1 1 year ago
  pry c8c0f36f13 1 1 year ago
  pry 4a1540a10f 1 1 year ago
  pry 06321117c7 1 1 year ago
  pry 70ca161975 1 1 year ago
  pry d3b20a58a4 1 1 year ago
100 changed files with 862 additions and 650 deletions
Split View
  1. +7
    -0
      BPASmartClient.AliyunIot/AliyunIot.cs
  2. +9
    -0
      BPASmartClient.AliyunIot/BPASmartClient.AliyunIot.csproj
  3. +1
    -3
      BPASmartClient.Business/BPASmartClient.Business.csproj
  4. +16
    -6
      BPASmartClient.Business/InternetInfo.cs
  5. +15
    -8
      BPASmartClient.Business/LocalMqtt.cs
  6. +1
    -2
      BPASmartClient.Business/MainConsole.cs
  7. +3
    -4
      BPASmartClient.Business/Plugin/ConfigMgr.cs
  8. +7
    -8
      BPASmartClient.Business/Plugin/DeviceMgr.cs
  9. +28
    -22
      BPASmartClient.Business/Plugin/MQTTMgr.cs
  10. +39
    -32
      BPASmartClient.Business/Plugin/OrderProxy.cs
  11. +1
    -1
      BPASmartClient.Business/Plugin/Plugin.cs
  12. +12
    -9
      BPASmartClient.Business/Plugin/StatusMgr.cs
  13. +1
    -1
      BPASmartClient.Business/TopicDefine.cs
  14. +49
    -7
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  15. +23
    -1
      BPASmartClient.CustomResource/Converters/ColorConverter.cs
  16. +5
    -1
      BPASmartClient.CustomResource/Converters/TextConverter.cs
  17. BIN
     
  18. BIN
     
  19. BIN
     
  20. BIN
     
  21. BIN
     
  22. BIN
     
  23. BIN
     
  24. BIN
     
  25. BIN
     
  26. BIN
     
  27. BIN
     
  28. BIN
     
  29. BIN
     
  30. BIN
     
  31. BIN
     
  32. BIN
     
  33. BIN
     
  34. BIN
     
  35. BIN
     
  36. BIN
     
  37. BIN
     
  38. BIN
     
  39. +14
    -137
      BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs
  40. +7
    -7
      BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs
  41. +4
    -4
      BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
  42. +17
    -9
      BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
  43. +4
    -3
      BPASmartClient.CustomResource/Pages/Model/NfcServer.cs
  44. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs
  45. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoModel.cs
  46. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/ProductionDataHelper.cs
  47. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/RecipeCompleteLog.cs
  48. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/ReportBase.cs
  49. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/ReportHelper.cs
  50. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/ReportTestModel.cs
  51. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/RunLog.cs
  52. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
  53. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserLog.cs
  54. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs
  55. +3
    -2
      BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs
  56. +1
    -1
      BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs
  57. +1
    -1
      BPASmartClient.CustomResource/Pages/View/LoginView.xaml.cs
  58. +1
    -1
      BPASmartClient.CustomResource/Pages/View/NfcSetView.xaml.cs
  59. +1
    -1
      BPASmartClient.CustomResource/Pages/View/PasswordChangeView.xaml.cs
  60. +48
    -62
      BPASmartClient.CustomResource/Pages/View/PromptView.xaml
  61. +1
    -1
      BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml.cs
  62. +1
    -1
      BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs
  63. +9
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs
  64. +10
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs
  65. +3
    -3
      BPASmartClient.CustomResource/Pages/ViewModel/DebugLogViewModel.cs
  66. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
  67. +42
    -34
      BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs
  68. +11
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
  69. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
  70. +2
    -2
      BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs
  71. +2
    -2
      BPASmartClient.CustomResource/Pages/ViewModel/ProductionDataViewModel.cs
  72. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs
  73. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs
  74. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
  75. +26
    -26
      BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs
  76. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
  77. +11
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs
  78. +13
    -13
      BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs
  79. +6
    -6
      BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs
  80. +6
    -5
      BPASmartClient.CustomResource/RecDictionarys/DatePickeerDictionary.xaml
  81. +143
    -0
      BPASmartClient.CustomResource/RecDictionarys/RecComboBox.xaml
  82. +3
    -3
      BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml
  83. +2
    -2
      BPASmartClient.CustomResource/UserControls/IcoButton.cs
  84. +42
    -43
      BPASmartClient.DRCoffee/CoffeeMachine.cs
  85. +8
    -7
      BPASmartClient.DRCoffee/CommandHandler.cs
  86. +2
    -2
      BPASmartClient.DRCoffee/MorkCStatus.cs
  87. +6
    -7
      BPASmartClient.Device/AlarmHelper.cs
  88. +0
    -1
      BPASmartClient.Device/BPASmartClient.Device.csproj
  89. +55
    -29
      BPASmartClient.Device/BaseDevice.cs
  90. +2
    -2
      BPASmartClient.Device/DeviceStatus.cs
  91. +1
    -1
      BPASmartClient.Device/IDevice.cs
  92. +2
    -2
      BPASmartClient.Device/VariableMonitor.cs
  93. +55
    -1
      BPASmartClient.Device/VariableMonitorAttribute.cs
  94. +3
    -3
      BPASmartClient.DosingSystemSingle/App.xaml.cs
  95. +1
    -1
      BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj
  96. +4
    -4
      BPASmartClient.DosingSystemSingle/Model/DeviceInquire.cs
  97. +2
    -2
      BPASmartClient.DosingSystemSingle/Service/SiemensDevice.cs
  98. +1
    -1
      BPASmartClient.DosingSystemSingle/View/HardwareStatusView.xaml.cs
  99. +1
    -1
      BPASmartClient.DosingSystemSingle/View/ManualControlView.xaml.cs
  100. +1
    -1
      BPASmartClient.DosingSystemSingle/View/NewMaterialView.xaml.cs

+ 7
- 0
BPASmartClient.AliyunIot/AliyunIot.cs View File

@@ -0,0 +1,7 @@
namespace BPASmartClient.AliyunIot
{
public class AliyunIot
{

}
}

+ 9
- 0
BPASmartClient.AliyunIot/BPASmartClient.AliyunIot.csproj View File

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

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

</Project>

+ 1
- 3
BPASmartClient.Business/BPASmartClient.Business.csproj View File

@@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="BPA.ApolloClient" Version="1.0.12" />
<PackageReference Include="BPA.Helper" Version="1.0.54" />
<PackageReference Include="BPA.Communication" Version="1.0.116" />
<PackageReference Include="BPA.Message" Version="1.0.86" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
@@ -17,10 +17,8 @@

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" />
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" />
<ProjectReference Include="..\BPASmartClient.Http\BPASmartClient.Http.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.MQTT\BPASmartClient.MQTT.csproj" />
</ItemGroup>

</Project>

+ 16
- 6
BPASmartClient.Business/InternetInfo.cs View File

@@ -7,8 +7,8 @@ using System.Configuration;
using System.IO;
using Microsoft.Extensions.Configuration;
using System.Threading;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPA.Helper;
using BPA.ApolloClient;
using BPA.ApolloClient.Options;
using Com.Ctrip.Framework.Apollo;
@@ -20,17 +20,27 @@ namespace BPASmartClient.Business
/// </summary>
public class InternetInfo
{
/// <summary>
/// 是否启用网络验证
/// </summary>
public static bool IsEnableNetwork { get; set; } = true;

/// <summary>
/// 配置初始化
/// </summary>
public static void InitConfig()
{
NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState();
while (!NetworkConnectState)
if (!IsEnableNetwork) return;
Task.Factory.StartNew(() =>
{
NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState();
Thread.Sleep(2000);
}
while (!NetworkConnectState)
{
NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState();
Thread.Sleep(2000);
}
});
}

/// <summary>


+ 15
- 8
BPASmartClient.Business/LocalMqtt.cs View File

@@ -1,5 +1,5 @@
using BPA.Message;
using BPASmartClient.MQTT;
using BPA.Communication;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -9,7 +9,7 @@ using System.Threading.Tasks;

namespace BPASmartClient.Business
{
public class LocalMqtt
public class LocalMqtt
{
private volatile static LocalMqtt _Instance;
public static LocalMqtt GetInstance => _Instance ?? (_Instance = new LocalMqtt());
@@ -20,7 +20,7 @@ namespace BPASmartClient.Business
/// </summary>
SendScreenDataModel MqttPushs = new SendScreenDataModel();

MQTTProxy mQTTProxy = new MQTTProxy();
MqttHelper mQTTProxy = new MqttHelper();

ScreenDeviceType LocDeviceType;

@@ -35,23 +35,30 @@ namespace BPASmartClient.Business
LocDeviceType = DeviceType;
mQTTProxy.Connected = new Action(() =>
{
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)) ;
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType));
});
MQTT_IP = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_IP"].ToString();
MQTT_PORT = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Port"].ToString();
MQTT_USERNAME = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_User"].ToString();
MQTT_PASSWORD = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Password"].ToString();

mQTTProxy.Connect(MQTT_USERNAME, MQTT_PASSWORD, MQTT_IP, int.Parse(MQTT_PORT), $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");//"10.2.1.254""admin", "public"
mQTTProxy.Connect(new BPA.Communication.Base.ConfigurationOptions()
{
UserName = MQTT_USERNAME,
Password = MQTT_PASSWORD,
IpAddress = MQTT_IP,
Port = int.Parse(MQTT_PORT),
ClientId = $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"
});
}

public void Start()
{
}


/// <summary>
/// MQTT消息推送


+ 1
- 2
BPASmartClient.Business/MainConsole.cs View File

@@ -1,5 +1,4 @@
using BPASmartClient.Message;
using HBLConsole.Communication;

using System;
using System.Collections.Generic;
using System.Linq;


+ 3
- 4
BPASmartClient.Business/Plugin/ConfigMgr.cs View File

@@ -1,7 +1,6 @@
using BPA.ApolloClient;
using BPA.Message;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPA.Helper;

using BPASmartClient.Model;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
@@ -45,7 +44,7 @@ namespace BPASmartClient.Business
public void Initialize()
{
var text = TextHelper.GetInstance.ReadTextInfo("StartShop", "DeviceConfig");
string path = $"{LocaPath.GetInstance().GetDeviceConfigPath}{text}.json";
string path = $"{LocaPath.GetDeviceConfigPath}{text}.json";
if (File.Exists(path))
{
string JsonString = File.ReadAllText(path);


+ 7
- 8
BPASmartClient.Business/Plugin/DeviceMgr.cs View File

@@ -1,9 +1,8 @@
using BPA.Message;
using BPASmartClient.Device;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPASmartClient.Http;
using BPASmartClient.Message;

using BPA.Helper;

using BPASmartClient.Model;
using BPASmartClient.Model.小炒机;
using BPASmartClient.Model.调酒机;
@@ -52,7 +51,7 @@ namespace BPASmartClient.Business
{
var result = Plugin.GetInstance().GetPlugin<ConfigMgr>()?.deviceConfigModelJsons;
//var text = TextHelper.GetInstance.ReadTextInfo("StartShop", "DeviceConfig");
//string path = $"{LocaPath.GetInstance().GetDeviceConfigPath}{text}.json";
//string path = $"{LocaPath.GetDeviceConfigPath}{text}.json";
//if (File.Exists(path))
//{
//string JsonString = File.ReadAllText(path);
@@ -79,7 +78,7 @@ namespace BPASmartClient.Business
peripheralTemp.communicationPar = comms.communicationPar;
peripherals.Add(peripheralTemp);
}
deviceTemp.Initliaze(peripherals);
this.devices.Add(deviceTemp);
}
@@ -93,7 +92,7 @@ namespace BPASmartClient.Business
this.devices.ForEach(device =>
{
device.StartMain();
if (!InternetInfo.IsEnableNetwork) return;
#region 获取物料数据
string result = string.Empty;
for (int i = 0; i < 4; i++)
@@ -105,7 +104,7 @@ namespace BPASmartClient.Business
var jsondata = new { clientId, PushType };
string header = $"[/stock/GetItemInfo]_[{DateTime.Now.Ticks}]".AESEncrypt();
string url = $"{InternetInfo.StockServer}GetItemInfo";
result = APIHelper.GetInstance.HttpRequest(url, header, jsondata, RequestType.POST);
result = APIHelper.GetInstance.HttpRequest(url, jsondata, header, RequestType.POST);

if (PushType == 1)
{


+ 28
- 22
BPASmartClient.Business/Plugin/MQTTMgr.cs View File

@@ -1,8 +1,7 @@
using BPA.Message;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.MQTT;
using HBLConsole.Communication;
using BPA.Helper;

using BPA.Communication;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Concurrent;
@@ -29,7 +28,8 @@ namespace BPASmartClient.Business
//消息缓存
private ConcurrentQueue<string> msg = new ConcurrentQueue<string>();
//MQTT 代理
private MQTTProxy mqttProxy = new MQTTProxy();
private MqttHelper mqttProxy = new MqttHelper();

//消息处理者
private List<RecivedHandle> messageRecives = new List<RecivedHandle>();

@@ -40,33 +40,39 @@ namespace BPASmartClient.Business

public void Start()
{
if (!InternetInfo.NetworkConnectState) return;
running = true;
//主题初始化
TopicDefine.GetInstance().Initialize(Plugin.GetInstance().GetPlugin<DeviceMgr>().GetDevices());
//MQTT 连接成功
mqttProxy.Connected = new Action(() =>
{
mqttProxy.Subscrib(TopicDefine.GetInstance().SubscribTopics.ToArray());
});
//MQTT 连接成功
mqttProxy.LostConnect = new Action(() =>

mqttProxy.Connected = () =>
{
mqttProxy.Subscrib(TopicDefine.GetInstance().SubscribTopics.ToArray());
});
};

//MQTT 数据接收
mqttProxy.MessageRecive = new Action<string>((message) =>
{
msg.Enqueue(message);
});
mqttProxy.MessageRecive = s => { msg.Enqueue(s); };

var MqttServerConfig = Plugin.GetInstance().GetPlugin<ConfigMgr>().MQTT_Config;
var MqttServerAccount = Plugin.GetInstance().GetPlugin<ConfigMgr>().Mqtt_Account;
var deviceConfig = Plugin.GetInstance().GetPlugin<ConfigMgr>().deviceConfigModelJsons;
string deviceId = deviceConfig[0].deviceModels[0].DeviceId;
string deviceId = "";
if (deviceConfig.Count > 0 && deviceConfig[0].deviceModels.Count > 0)
{
deviceId = deviceConfig[0].deviceModels[0].DeviceId;
}
clientId = Plugin.GetInstance().GetPlugin<ConfigMgr>().ClientId;
//MQTT 初始化
mqttProxy.Connect(MqttServerAccount.UserName, MqttServerAccount.Password, MqttServerConfig.Host, MqttServerConfig.Port, "ClientId:" + clientId + "DeviceId:" + deviceId + Guid.NewGuid().ToString());
mqttProxy.Connect(new BPA.Communication.Base.ConfigurationOptions()
{
UserName = MqttServerAccount.UserName,
Password = MqttServerAccount.Password,
IpAddress = MqttServerConfig.Host,
Port = MqttServerConfig.Port,
ClientId = $"ClientId-[{clientId}]-DeviceId-[{deviceId}]-{Guid.NewGuid()}"
});

ThreadManage.GetInstance().Start(() =>
TaskManage.GetInstance.Start(() =>
{
while (running)
{
@@ -88,7 +94,7 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, "MQTT 消息处理", true);
}, "MQTT 消息处理", isRestart: true);
}

/// <summary>
@@ -115,7 +121,7 @@ namespace BPASmartClient.Business
public void Dispose()
{
running = false;
mqttProxy.CloseConnect();
mqttProxy.Dispose();
messageRecives.Clear();
}



+ 39
- 32
BPASmartClient.Business/Plugin/OrderProxy.cs View File

@@ -3,10 +3,10 @@ using BPA.Message;
using BPA.Message.Enum;
using BPA.Models;
using BPASmartClient.Device;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPASmartClient.Http;
using BPASmartClient.Message;
using BPA.Helper;
using BPASmartClient.Model;
using BPASmartClient.Model.小炒机;
using BPASmartClient.Model.调酒机;
@@ -18,7 +18,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static BPASmartClient.EventBus.EventBus;
using static BPA.Helper.EventBus;

namespace BPASmartClient.Business
{
@@ -44,7 +44,7 @@ namespace BPASmartClient.Business
deviceMgr = Plugin.GetInstance().GetPlugin<DeviceMgr>();
if (InternetInfo.IsEnableTest)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
while (morkOrderPushes.Count > 0)
{
@@ -69,6 +69,7 @@ namespace BPASmartClient.Business

public void Start()
{
if (!InternetInfo.IsEnableNetwork) return;
running = true;
Plugin.GetInstance().GetPlugin<MQTTMgr>().SetMessageReciveHandler(delegate (IMessage message)
{
@@ -136,12 +137,12 @@ namespace BPASmartClient.Business
}
});

EventBus.EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle);
EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle);
}

private void StartTargetDeviceOrderJob(int deviceId)
{
ThreadManage.GetInstance().Start(() =>
TaskManage.GetInstance.Start(() =>
{
var device = deviceMgr.GetDevices().FirstOrDefault(p => p.DeviceId == deviceId);
while (running)
@@ -164,7 +165,7 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, $"MQTT 订单接收处理-设备[{deviceId}]", true);
}, $"MQTT 订单接收处理-设备[{deviceId}]", isRestart: true);
}

public void OrderStatusChangedHandle(IEvent @event, EventCallBackHandle callBack)
@@ -179,36 +180,42 @@ namespace BPASmartClient.Business
SortNum = orderStatusChangedEvent.SortNum
};

#region API 订单状态修改
if (orderStatusChange.SuborderId.Length > 0 && orderStatusChange.CookingStatus != ORDER_STATUS.WAIT)
try
{
try
bool isSuccess = false;
#region API 订单状态修改
if (orderStatusChange.SuborderId.Length > 0 && orderStatusChange.CookingStatus != ORDER_STATUS.WAIT)
{

string header = $"[{InternetInfo.OrderServer}/order/robotstatuschange]_[{DateTime.Now.Ticks}]".AESEncrypt();
string url = $"{InternetInfo.OrderServer}order/robotstatuschange";
result = APIHelper.GetInstance.HttpRequest(url, header, orderStatusChange, RequestType.POST);
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx(ex.ToString());
result = APIHelper.GetInstance.HttpRequest(url, orderStatusChange, header, RequestType.POST);

var res = JsonConvert.DeserializeObject<OrderStatusRsp>(result);
ActionManage.GetInstance.Send("OrderStatusChange", orderStatusChangedEvent);
isSuccess = res == null ? false : res.isSuccess;
//MessageLog.GetInstance.Show($"订单:{orderStatusChange.SuborderId} 状态:{orderStatusChange.CookingStatus} 执行结果:{isSuccess}");
//MessageLog.GetInstance.Show(string.Format("订单状态改变,调用API执行结果{0}", res == null ? false : res.isSuccess));
}
var res = JsonConvert.DeserializeObject<OrderStatusRsp>(result);
ActionManage.GetInstance.Send("OrderStatusChange", orderStatusChangedEvent);
bool isSuccess = res == null ? false : res.isSuccess;
MessageLog.GetInstance.Show($"订单:{orderStatusChange.SuborderId} 状态:{orderStatusChange.CookingStatus} 执行结果:{isSuccess}");
//MessageLog.GetInstance.Show(string.Format("订单状态改变,调用API执行结果{0}", res == null ? false : res.isSuccess));
}
#endregion
#endregion

#region MQTT 订单状态修改
var clientId = Plugin.GetInstance().GetPlugin<ConfigMgr>().ClientId;
var temp = BPAPackage.Make(orderStatusChange, clientId, orderStatusChangedEvent.deviceClientType);
var q = temp.Serialize(false);
Plugin.GetInstance().GetPlugin<MQTTMgr>().Publish(TOPIC.GetInstance.GetAppTopic(clientId.ToString()), temp.Serialize(false));
if (orderStatusChange.CookingStatus == ORDER_STATUS.COMPLETED_TAKE)
MessageLog.GetInstance.Show($"通知叫号:{orderStatusChange.GoodName}--{orderStatusChange.SortNum}");
#endregion

if (isSuccess) callBack?.Invoke();

#region MQTT 订单状态修改
var clientId = Plugin.GetInstance().GetPlugin<ConfigMgr>().ClientId;
var temp = BPAPackage.Make(orderStatusChange, clientId, orderStatusChangedEvent.deviceClientType);
var q = temp.Serialize(false);
Plugin.GetInstance().GetPlugin<MQTTMgr>().Publish(TOPIC.GetInstance.GetAppTopic(clientId.ToString()), temp.Serialize(false));
if (orderStatusChange.CookingStatus == ORDER_STATUS.COMPLETED_TAKE)
MessageLog.GetInstance.Show($"通知叫号:{orderStatusChange.GoodName}--{orderStatusChange.SortNum}");
#endregion
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx(ex.ToString());
}
}




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

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


+ 12
- 9
BPASmartClient.Business/Plugin/StatusMgr.cs View File

@@ -1,10 +1,11 @@
using BPA.Message;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Concurrent;

namespace BPASmartClient.Business
{
@@ -22,7 +23,7 @@ namespace BPASmartClient.Business
private bool wholeDeviceHealth;


private Dictionary<int, Dictionary<string, object>> wholeDeviceStatus = new Dictionary<int, Dictionary<string, object>>();
private ConcurrentDictionary<int, ConcurrentDictionary<string, object>> wholeDeviceStatus = new ConcurrentDictionary<int, ConcurrentDictionary<string, object>>();

public void Initialize()
{
@@ -32,40 +33,42 @@ namespace BPASmartClient.Business

public void Start()
{
if (!InternetInfo.NetworkConnectState) return;
running = true;
ThreadManage.GetInstance().Start(() =>
TaskManage.GetInstance.Start(() =>
{
while (running)
{
wholeDeviceHealth = true;
foreach (var device in deviceMgr.GetDevices())
{
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus();
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus();
}
Thread.Sleep(50);
}
}, "设备状态收集", true);
}, "设备状态收集", isRestart: true);

deviceStatus.BatchingInfo = new List<BPA.Models.BatchingInfo>();

ThreadManage.GetInstance().Start(() =>
TaskManage.GetInstance.Start(() =>
{
while (running)
{
wholeDeviceHealth = true;
foreach (var device in deviceMgr.GetDevices())
{
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus();
var s = device.Status.GetStatus();
wholeDeviceStatus[device.DeviceId] = s;

deviceStatus.Healthy = device.IsHealth ? BPA.Message.Enum.DeviceHealthy.Health : BPA.Message.Enum.DeviceHealthy.UnHealth;
deviceStatus.DeviceType = device.DeviceType;
deviceStatus.BatchingInfo = device.BatchingInfos;
deviceStatus.BatchingInfo = device.BatchingInfos;
var msg = BPAPackage.Make(deviceStatus, device.DeviceId, device.DeviceType);
mqttMgr.Publish(TopicDefine.GetInstance().PushHeartbeatTopics[device.DeviceType], msg.Serialize());
}
Thread.Sleep(1000);
}
}, "设备心跳上报", true);
}, "设备心跳上报", isRestart: true);
}

public void Dispose()


+ 1
- 1
BPASmartClient.Business/TopicDefine.cs View File

@@ -1,7 +1,7 @@
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Device;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


+ 49
- 7
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj View File

@@ -9,9 +9,13 @@

<ItemGroup>
<Compile Remove="Fonts\Debug\**" />
<Compile Remove="Resources\**" />
<EmbeddedResource Remove="Fonts\Debug\**" />
<EmbeddedResource Remove="Resources\**" />
<None Remove="Fonts\Debug\**" />
<None Remove="Resources\**" />
<Page Remove="Fonts\Debug\**" />
<Page Remove="Resources\**" />
</ItemGroup>

<ItemGroup>
@@ -20,11 +24,13 @@

<ItemGroup>
<None Remove="Fonts\80号-萌趣小鱼体.ttf" />
<None Remove="Fonts\AlimamaDaoLiTi.ttf" />
<None Remove="Fonts\font\iconfont.ttf" />
<None Remove="Fonts\iconfont.ttf" />
<None Remove="Fonts\MT\iconfont.ttf" />
<None Remove="Fonts\naicha.ttf" />
<None Remove="Fonts\new\iconfont.ttf" />
<None Remove="Fonts\pic\iconfont.ttf" />
<None Remove="Fonts\Quartz Regular.ttf" />
<None Remove="Image\AGV\agv.png" />
<None Remove="Image\AGV\AGV小车.png" />
@@ -76,6 +82,7 @@
<None Remove="Image\Scroll_↑.png" />
<None Remove="Image\Scroll_→.png" />
<None Remove="Image\Scroll_↓.png" />
<None Remove="Image\Settings.png" />
<None Remove="Image\shape.png" />
<None Remove="Image\shape1.png" />
<None Remove="Image\textBox.png" />
@@ -98,8 +105,12 @@
<None Remove="Image\产品制作.png" />
<None Remove="Image\光柱.png" />
<None Remove="Image\内部.png" />
<None Remove="Image\减.png" />
<None Remove="Image\删除.png" />
<None Remove="Image\功能列表.png" />
<None Remove="Image\加.png" />
<None Remove="Image\发光按钮.png" />
<None Remove="Image\右.png" />
<None Remove="Image\告警.png" />
<None Remove="Image\告警\Wifi_NO.ico" />
<None Remove="Image\告警\Wifi_NO.png" />
@@ -126,6 +137,7 @@
<None Remove="Image\容器边框2.png" />
<None Remove="Image\工艺流程.jpg" />
<None Remove="Image\工艺流程.png" />
<None Remove="Image\左.png" />
<None Remove="Image\底部背景.png" />
<None Remove="Image\弹框\BG.png" />
<None Remove="Image\弹框\bh.png" />
@@ -156,11 +168,14 @@
<None Remove="Image\按钮\组 8.png" />
<None Remove="Image\按钮背景蓝色.png" />
<None Remove="Image\按钮背景黄.png" />
<None Remove="Image\提示.png" />
<None Remove="Image\搜索按钮.png" />
<None Remove="Image\搜索框.png" />
<None Remove="Image\文字.png" />
<None Remove="Image\日历.png" />
<None Remove="Image\日期1.png" />
<None Remove="Image\时间.png" />
<None Remove="Image\时间_1.png" />
<None Remove="Image\智慧城市科技风登录页面.png" />
<None Remove="Image\智慧城市科技风登录页面边框.png" />
<None Remove="Image\有告警.png" />
@@ -168,6 +183,8 @@
<None Remove="Image\标签.png" />
<None Remove="Image\标题背景.png" />
<None Remove="Image\浅色背景.jpeg" />
<None Remove="Image\点餐.png" />
<None Remove="Image\状态.png" />
<None Remove="Image\环形切图\内圈\未选中.png" />
<None Remove="Image\环形切图\内圈\选中.png" />
<None Remove="Image\环形切图\占位.png" />
@@ -182,6 +199,7 @@
<None Remove="Image\矩形2.png" />
<None Remove="Image\矩形样式.png" />
<None Remove="Image\矩形边框.png" />
<None Remove="Image\碗.png" />
<None Remove="Image\窗体样式\datagrid\data_标题栏背景.png" />
<None Remove="Image\窗体样式\datagrid\data_行背景.png" />
<None Remove="Image\窗体样式\From\内部背景.png" />
@@ -213,6 +231,7 @@
<None Remove="Image\窗体样式\Tab\Tab_SelectBJ.png" />
<None Remove="Image\窗体样式\Tab\Tab_SelectWZBJ.png" />
<None Remove="Image\竖线.png" />
<None Remove="Image\管理员-用户查询.png" />
<None Remove="Image\系统名称.png" />
<None Remove="Image\红色圆角矩形背景.png" />
<None Remove="Image\纹理背景.jpeg" />
@@ -242,6 +261,8 @@
<None Remove="Image\荧光\立体三角.png" />
<None Remove="Image\荧光\蓝色提示框.png" />
<None Remove="Image\荧光\返回.png" />
<None Remove="Image\菜品_1.png" />
<None Remove="Image\菜谱.png" />
<None Remove="Image\营销额.png" />
<None Remove="Image\蓝色背景.png" />
<None Remove="Image\蓝边框.png" />
@@ -256,10 +277,12 @@
<None Remove="Image\表格\表格顶左.png" />
<None Remove="Image\表格标题背景2.png" />
<None Remove="Image\调味品.jpeg" />
<None Remove="Image\购物车.png" />
<None Remove="Image\边框效果2.png" />
<None Remove="Image\边框线.png" />
<None Remove="Image\边角.png" />
<None Remove="Image\退出.png" />
<None Remove="Image\退出_1.png" />
<None Remove="Image\退出按钮.png" />
<None Remove="Image\透明背景.png" />
<None Remove="Image\配方背景\圆角矩形.png" />
@@ -269,6 +292,8 @@
<None Remove="Image\配方背景\蓝色背景2.png" />
<None Remove="Image\配方背景\黄色背景.png" />
<None Remove="Image\阴影边框.png" />
<None Remove="Image\面条.png" />
<None Remove="Image\面条_1.png" />
<None Remove="Image\顶部.png" />
<None Remove="Image\顶部切图\Button_No.png" />
<None Remove="Image\顶部切图\Button_Select.png" />
@@ -312,11 +337,13 @@

<ItemGroup>
<Resource Include="Fonts\80号-萌趣小鱼体.ttf" />
<Resource Include="Fonts\AlimamaDaoLiTi.ttf" />
<Resource Include="Fonts\font\iconfont.ttf" />
<Resource Include="Fonts\iconfont.ttf" />
<Resource Include="Fonts\MT\iconfont.ttf" />
<Resource Include="Fonts\naicha.ttf" />
<Resource Include="Fonts\new\iconfont.ttf" />
<Resource Include="Fonts\pic\iconfont.ttf" />
<Resource Include="Fonts\Quartz Regular.ttf" />
<Resource Include="Image\AGV\agv.png" />
<Resource Include="Image\AGV\AGV小车.png" />
@@ -339,6 +366,7 @@
<Resource Include="Image\leftback.png" />
<Resource Include="Image\leftImage.png" />
<Resource Include="Image\Login.png" />
<Resource Include="Image\Settings.png" />
<Resource Include="Image\textBox.png" />
<Resource Include="Image\WindowImages.png" />
<Resource Include="Image\上箭头.png" />
@@ -350,8 +378,12 @@
<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\加.png" />
<Resource Include="Image\发光按钮.png" />
<Resource Include="Image\右.png" />
<Resource Include="Image\告警\Wifi_NO.png" />
<Resource Include="Image\告警\Wifi_OK.png" />
<Resource Include="Image\告警\严重告警.png" />
@@ -363,6 +395,7 @@
<Resource Include="Image\容器边框2.png" />
<Resource Include="Image\工艺流程.jpg" />
<Resource Include="Image\工艺流程.png" />
<Resource Include="Image\左.png" />
<Resource Include="Image\弹框\BG.png" />
<Resource Include="Image\弹框\bh.png" />
<Resource Include="Image\弹框\biankuang_.png" />
@@ -392,11 +425,16 @@
<Resource Include="Image\按钮\组 8.png" />
<Resource Include="Image\按钮背景蓝色.png" />
<Resource Include="Image\按钮背景黄.png" />
<Resource Include="Image\提示.png" />
<Resource Include="Image\时间.png" />
<Resource Include="Image\时间_1.png" />
<Resource Include="Image\智慧城市科技风登录页面.png" />
<Resource Include="Image\智慧城市科技风登录页面边框.png" />
<Resource Include="Image\权限背景.png" />
<Resource Include="Image\标签.png" />
<Resource Include="Image\浅色背景.jpeg" />
<Resource Include="Image\点餐.png" />
<Resource Include="Image\状态.png" />
<Resource Include="Image\界面2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
@@ -406,6 +444,8 @@
<Resource Include="Image\直线.png" />
<Resource Include="Image\矩形2.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" />
@@ -426,9 +466,12 @@
<Resource Include="Image\荧光\立体三角.png" />
<Resource Include="Image\荧光\蓝色提示框.png" />
<Resource Include="Image\荧光\返回.png" />
<Resource Include="Image\菜品_1.png" />
<Resource Include="Image\菜谱.png" />
<Resource Include="Image\蓝色背景.png" />
<Resource Include="Image\蓝边框.png" />
<Resource Include="Image\调味品.jpeg" />
<Resource Include="Image\购物车.png" />
<Resource Include="Image\边框线.png" />
<Resource Include="Image\边角.png" />
</ItemGroup>
@@ -437,6 +480,7 @@
<Resource Include="Image\HBL.png" />
<Resource Include="Image\告警\Wifi_NO.ico" />
<Resource Include="Image\告警\Wifi_OK.ico" />
<Resource Include="Image\退出_1.png" />
<Resource Include="Image\透明背景.png" />
<Resource Include="Image\配方背景\圆角矩形.png" />
<Resource Include="Image\配方背景\竖背景框.png" />
@@ -445,6 +489,10 @@
<Resource Include="Image\配方背景\蓝色背景2.png" />
<Resource Include="Image\配方背景\黄色背景.png" />
<Resource Include="Image\阴影边框.png" />
<Resource Include="Image\面条.png" />
<Resource Include="Image\面条_1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Image\顶部切图\Button_No.png" />
<Resource Include="Image\顶部切图\Button_Select.png" />
<Resource Include="Image\顶部切图\Top_L.png" />
@@ -459,14 +507,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BPA.Helper" Version="1.0.62" />
<PackageReference Include="BPA.Helper" Version="1.0.77" />
<PackageReference Include="BPA.Message" Version="1.0.86" />
<PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.Nfc\BPASmartClient.Nfc.csproj" />
</ItemGroup>
@@ -638,8 +684,4 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>

</Project>

+ 23
- 1
BPASmartClient.CustomResource/Converters/ColorConverter.cs View File

@@ -5,6 +5,7 @@ using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;

@@ -30,7 +31,10 @@ namespace BPASmartClient.CustomResource.Converters
returnValue = new SolidColorBrush(Color.FromArgb(255, 102, 204, 153));
break;
case ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING:
returnValue = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
returnValue = new SolidColorBrush(Color.FromArgb(180, 180, 180, 180));
break;
case ORDER_STATUS.UNABLE_COOK:
returnValue = new SolidColorBrush(Color.FromRgb(247, 156,154));
break;
default:
break;
@@ -38,6 +42,24 @@ namespace BPASmartClient.CustomResource.Converters
return returnValue;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class VisibleConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
switch ((ORDER_STATUS)value)
{
case ORDER_STATUS.WAIT:
return Visibility.Visible;
default:
return Visibility.Collapsed;
}
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();


+ 5
- 1
BPASmartClient.CustomResource/Converters/TextConverter.cs View File

@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Converters
{
@@ -29,7 +30,10 @@ namespace BPASmartClient.CustomResource.Converters
Text = "取餐完成";
break;
case ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING:
Text = "制作超时";
Text = "未完成订单";
break;
case ORDER_STATUS.UNABLE_COOK:
Text = "已取消订单";
break;
default:
break;


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


+ 14
- 137
BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs View File

@@ -1,5 +1,5 @@
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using System;
using System.Collections.Concurrent;
@@ -31,8 +31,8 @@ namespace BPASmartClient.CustomResource.Pages.Model
private AlarmHelper() { }


public static ObservableCollection<Alarm> Alarms { get; set; } = new ObservableCollection<Alarm>();
public static List<Alarm> HistoryAlarms { get; set; } = new List<Alarm>();
public static ObservableCollection<BPASmartClient.Model.Alarm> Alarms { get; set; } = new ObservableCollection<BPASmartClient.Model.Alarm>();
public static List<BPASmartClient.Model.Alarm> HistoryAlarms { get; set; } = new List<BPASmartClient.Model.Alarm>();
static ConcurrentDictionary<string, bool> flagbit = new ConcurrentDictionary<string, bool>();
static ConcurrentDictionary<string, Delay> delays = new ConcurrentDictionary<string, Delay>();
public static Action<string> AddAction { get; set; }
@@ -44,7 +44,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
public static void Init()
{
AlarmViewModel.AlarmInfos = Alarms;
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (_Instance != null)
{
@@ -97,7 +97,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// <param name="AlarmInfo">报警信息</param>
private static void AddAlarm(object value, string AlarmInfo, AlarmLevel alarmLevel)
{
Alarm tempAlarm = new Alarm()
BPASmartClient.Model.Alarm tempAlarm = new BPASmartClient.Model.Alarm()
{
NumId = Alarms.Count + 1,
Date = DateTime.Now.ToString("yyyy/MM/dd"),
@@ -106,9 +106,16 @@ namespace BPASmartClient.CustomResource.Pages.Model
Value = value.ToString(),
Time = DateTime.Now.ToString("HH:mm:ss"),
};
try
{
var res = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Base.Add(tempAlarm);
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save();
}
catch (Exception)
{
}

var res = Sqlite<Alarm>.GetInstance.Base.Add(tempAlarm);
Sqlite<Alarm>.GetInstance.Save();

if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null)
{
@@ -145,134 +152,4 @@ namespace BPASmartClient.CustomResource.Pages.Model

}

//public class AlarmHelper<AlarmT> where AlarmT : class, new()
//{


// //private volatile static ConcurrentDictionary<string, AlarmT> _Instance;
// //public static AlarmT GetInstance(string name)
// //{
// // if (_Instance == null) _Instance = new ConcurrentDictionary<string, AlarmT>();
// // if (!_Instance.ContainsKey(name)) _Instance.TryAdd(name, new AlarmT());
// // return _Instance[name];
// //}
// //private AlarmHelper() { }


// public static ObservableCollection<Alarm> Alarms { get; set; } = new ObservableCollection<Alarm>();
// public static List<Alarm> HistoryAlarms { get; set; } = new List<Alarm>();
// static ConcurrentDictionary<string, bool> flagbit = new ConcurrentDictionary<string, bool>();
// static ConcurrentDictionary<string, Delay> delays = new ConcurrentDictionary<string, Delay>();
// public static Action<string> AddAction { get; set; }
// public static Action<string> RemoveAction { get; set; }
// public static Action ChangeAction { get; set; }

// public static AlarmT Alarm { get; set; } = new AlarmT();

// public static void Init()
// {
// AlarmViewModel.AlarmInfos = Alarms;
// ThreadManage.GetInstance().StartLong(new Action(() =>
// {
// foreach (var item in Alarm.GetType().GetProperties())
// {
// if (item.CustomAttributes.Count() > 0)
// {
// var AlarmModel = item.GetCustomAttribute<AlarmAttribute>();
// if (AlarmModel != null)
// {
// bool value = Convert.ToBoolean(Alarm.GetType().GetProperty(item.Name)?.GetValue(Alarm));
// EdgeAlarm(value, AlarmModel.AlarmInfo, 1, AlarmModel.AlarmLevel, AlarmModel.AlarmType);
// }
// }
// }
// Thread.Sleep(100);
// }), $"{typeof(AlarmT).Name},报警通用模块监听");

// }


// //public static void AnalogAlarm(dynamic Trigger, string info, dynamic HH = null, dynamic H = 0, dynamic L = 0, dynamic LL = 0)
// //{

// //}




// /// <summary>
// /// 沿报警检测
// /// </summary>
// /// <param name="Trigger">触发变量</param>
// /// <param name="text">报警信息</param>
// /// <param name="edgeType">触发类型,上升沿 或 下降沿</param>
// private static void EdgeAlarm(bool Trigger, string text, int delay = 2, AlarmLevel alarmLevel = AlarmLevel.一般报警, AlarmTriggerType edgeType = AlarmTriggerType.Rising)
// {
// if (!flagbit.ContainsKey(text)) flagbit.TryAdd(text, false);
// if (!delays.ContainsKey(text)) delays.TryAdd(text, Delay.GetInstance(text));
// if (edgeType == AlarmTriggerType.Rising ? delays[text].Start(Trigger, delay) : delays[text].Start(!Trigger, delay))
// {
// if (edgeType == AlarmTriggerType.Rising ? !flagbit[text] : flagbit[text])
// {
// AddAlarm(Trigger, text, alarmLevel);
// flagbit[text] = edgeType == AlarmTriggerType.Rising ? true : false;
// }
// }
// else RemoveAlarm(text);
// if (edgeType == AlarmTriggerType.Rising ? flagbit[text] : !flagbit[text]) flagbit[text] = Trigger;
// }

// /// <summary>
// /// 添加报警信息
// /// </summary>
// /// <param name="AlarmInfo">报警信息</param>
// private static void AddAlarm(object value, string AlarmInfo, AlarmLevel alarmLevel)
// {
// Alarm tempAlarm = new Alarm()
// {
// NumId = Alarms.Count + 1,
// Date = DateTime.Now.ToString("yyyy/MM/dd"),
// Grade = alarmLevel.ToString(),
// Info = AlarmInfo,
// Value = value.ToString(),
// Time = DateTime.Now.ToString("HH:mm:ss"),
// };

// var res = Sqlite<Alarm>.GetInstance.Base.Add(tempAlarm);
// Sqlite<Alarm>.GetInstance.Save();

// if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null)
// {
// Application.Current.Dispatcher.Invoke(new Action(() =>
// {
// Alarms.Insert(0, tempAlarm);
// for (int i = 0; i < Alarms.Count; i++) { Alarms.ElementAt(i).NumId = i + 1; }
// }));

// AddAction?.Invoke(AlarmInfo);//添加报警通知
// ChangeAction?.Invoke();//更改报警通知
// }
// }

// /// <summary>
// /// 移除报警信息
// /// </summary>
// /// <param name="AlarmInfo">报警信息</param>
// private static void RemoveAlarm(string AlarmInfo)
// {
// var result = Alarms.FirstOrDefault(p => p.Info == AlarmInfo);
// if (result != null)
// {
// Application.Current.Dispatcher.Invoke(new Action(() =>
// {
// Alarms.Remove(result);
// for (int i = 0; i < Alarms.Count; i++) { Alarms.ElementAt(i).NumId = i + 1; }
// }));

// if (RemoveAction != null) RemoveAction(AlarmInfo);
// if (ChangeAction != null) ChangeAction();
// }
// }

//}
}

+ 7
- 7
BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs View File

@@ -1,5 +1,5 @@
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using System;
using System.Collections.Concurrent;
@@ -28,8 +28,8 @@ namespace BPASmartClient.CustomResource.Pages.Model
private AlarmTest() { }


public static ObservableCollection<Alarm> Alarms { get; set; } = new ObservableCollection<Alarm>();
public static List<Alarm> HistoryAlarms { get; set; } = new List<Alarm>();
public static ObservableCollection<BPASmartClient.Model.Alarm> Alarms { get; set; } = new();
public static List<BPASmartClient.Model.Alarm> HistoryAlarms { get; set; } = new();
static ConcurrentDictionary<string, bool> flagbit = new ConcurrentDictionary<string, bool>();
static ConcurrentDictionary<string, Delay> delays = new ConcurrentDictionary<string, Delay>();
public static Action<string> AddAction { get; set; }
@@ -41,7 +41,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
public static void Init()
{
AlarmViewModel.AlarmInfos = Alarms;
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (_Instance != null)
{
@@ -94,7 +94,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// <param name="AlarmInfo">报警信息</param>
private static void AddAlarm(object value, string AlarmInfo, AlarmLevel alarmLevel)
{
Alarm tempAlarm = new Alarm()
BPASmartClient.Model.Alarm tempAlarm = new BPASmartClient.Model.Alarm()
{
NumId = Alarms.Count + 1,
Date = DateTime.Now.ToString("yyyy/MM/dd"),
@@ -104,8 +104,8 @@ namespace BPASmartClient.CustomResource.Pages.Model
Time = DateTime.Now.ToString("HH:mm:ss"),
};

var res = Sqlite<Alarm>.GetInstance.Base.Add(tempAlarm);
Sqlite<Alarm>.GetInstance.Save();
var res = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Base.Add(tempAlarm);
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save();

if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null)
{


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

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using BPASmartClient.CustomResource.Pages.Enums;
using System.Windows;

@@ -13,7 +13,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
/// <summary>
/// 在启动界面之前设置菜单项
/// </summary>
public class MenuManage : ObservableObject
public class MenuManage : NotifyBase
{
private volatile static MenuManage _Instance;
public static MenuManage GetInstance => _Instance ?? (_Instance = new MenuManage());
@@ -22,7 +22,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
public ObservableCollection<MenuModel> menuModels { get; set; } = new ObservableCollection<MenuModel>();
}

public class MenuModel : ObservableObject
public class MenuModel : NotifyBase
{

private Permission[] pers
@@ -84,7 +84,7 @@ namespace BPASmartClient.CustomResource.Pages.Model

}

public class SubMenumodel : ObservableObject
public class SubMenumodel : NotifyBase
{
/// <summary>
/// 子菜单名称


+ 17
- 9
BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs View File

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -35,16 +35,24 @@ namespace BPASmartClient.CustomResource.Pages.Model

public ObservableCollection<UserLog> userLogs { get; set; } = new();

public ObservableCollection<Alarm> alarmLogs { get; set; } = new();
public ObservableCollection<BPASmartClient.Model.Alarm> alarmLogs { get; set; } = new();

public ObservableCollection<RecipeCompleteLog> recipeLogs { get; set; } = new();

public void LogSave()
{
Sqlite<UserLog>.GetInstance.Save();
Sqlite<RunLog>.GetInstance.Save();
Sqlite<Alarm>.GetInstance.Save();
Sqlite<RecipeCompleteLog>.GetInstance.Save();
try
{
Sqlite<UserLog>.GetInstance.Save();
Sqlite<RunLog>.GetInstance.Save();
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save();
Sqlite<RecipeCompleteLog>.GetInstance.Save();
}
catch (Exception)
{

// throw;
}
}

public void ShowRecipeLog(string info)
@@ -122,7 +130,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
lock (alarmlock)
{
AlarmID++;
Alarm alarmLog = new Alarm()
BPASmartClient.Model.Alarm alarmLog = new BPASmartClient.Model.Alarm()
{
NumId = AlarmID,
Date = DateTime.Now.ToString("yyyy-MM-dd"),
@@ -131,7 +139,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
Value = AlarmNumber,
Grade = (level) + ""
};
Sqlite<Alarm>.GetInstance.Base.Add(alarmLog);
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Base.Add(alarmLog);
Application.Current.Dispatcher.Invoke(new Action(() => { alarmLogs.Insert(0, alarmLog); }));
AlarmLog?.Invoke(info);
}
@@ -160,7 +168,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
break;
case DialogType.Information:
PV.TextBlockIcon = "&#xe657;";
PV.TextBlockForeground = Brushes.DeepSkyBlue;
PV.TextBlockForeground = Brushes.Black;
PV.infoType.Text = "提示:";
//PV.Cancel.Visibility = Visibility.Visible;
break;


+ 4
- 3
BPASmartClient.CustomResource/Pages/Model/NfcServer.cs View File

@@ -1,4 +1,5 @@
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPA.Helper;
using BPASmartClient.CustomResource.Pages.ViewModel;
using BPASmartClient.Nfc;
using System;
using System.Collections.Generic;
@@ -28,10 +29,10 @@ namespace BPASmartClient.CustomResource.Pages.Model
if (NFCHelper.GetInstance.GetReadResult?.CardNum.Length > 0)
{
string id = NFCHelper.GetInstance.GetReadResult?.CardNum;
var res = Global.userManager.userInfos.FirstOrDefault(p => p.CardId == id) ;
var res = Global.userManager.userInfos.FirstOrDefault(p => p.CardId == id);
if (res != null)
{
BPASmartClient.Message.MessageLog.GetInstance.ShowDebugLog("NFC卡登录");
MessageLog.GetInstance.Show("NFC卡登录");
LoginViewModel.NfcLogin(id);
}
}


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

@@ -1,4 +1,4 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -9,7 +9,7 @@ using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class PlcVariableInfoManage:ObservableObject
public class PlcVariableInfoManage:NotifyBase
{
public ConcurrentDictionary<string, ObservableCollection<PlcVariableInfoModel>> VariablesInfo { get; set; } = new ConcurrentDictionary<string, ObservableCollection<PlcVariableInfoModel>>();
}


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

@@ -1,5 +1,5 @@

using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -8,7 +8,7 @@ using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class PlcVariableInfoModel : ObservableObject
public class PlcVariableInfoModel : NotifyBase
{
//public int Id { get { return _id; } set { _id = value;OnPropertyChanged(); } }
//private int _id;


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

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Collections.ObjectModel;
using System.Windows;
using System.IO;
using BPASmartClient.Helper;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.Model
{


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

@@ -1,4 +1,4 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -8,7 +8,7 @@ using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class RecipeCompleteLog : ObservableObject
public class RecipeCompleteLog : NotifyBase
{
[Key]
public int Id { get; set; }


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

@@ -4,12 +4,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.Model
{
[Serializable]
public class ReportBase : ObservableObject
public class ReportBase : NotifyBase
{
}
}

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

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using BPASmartClient.Helper;
using BPA.Helper;


namespace BPASmartClient.CustomResource.Pages.Model


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

@@ -4,7 +4,7 @@ using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.Model
{


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

@@ -4,11 +4,11 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class RunLog : ObservableObject
public class RunLog : NotifyBase
{
[Key]
public int Id { get; set; }


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

@@ -1,6 +1,6 @@
using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,7 +9,7 @@ using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class UserInfo : ObservableObject
public class UserInfo : NotifyBase
{
public String LastLogInTime { get; set; } = "无";



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

@@ -4,11 +4,11 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.Model
{
public class UserLog : ObservableObject
public class UserLog : NotifyBase
{
[Key]
public int Id { get; set; }


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

@@ -1,4 +1,4 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -7,7 +7,7 @@ using System.Threading.Tasks;

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



+ 3
- 2
BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs View File

@@ -1,4 +1,5 @@
using BPASmartClient.Message;

using BPA.Helper;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -19,7 +20,7 @@ namespace BPASmartClient.CustomResource

static VoiceAPI()
{
BPA.Helper.ThreadManage.GetInstance().StartLong(new Action(() =>
BPA.Helper.TaskManage.GetInstance.StartLong(new Action(() =>
{
while (msg.Count > 0)
{


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

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


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

@@ -1,5 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Diagnostics;


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

@@ -1,5 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


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

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


+ 48
- 62
BPASmartClient.CustomResource/Pages/View/PromptView.xaml View File

@@ -28,78 +28,63 @@
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="infoColor" StartPoint="0,0" EndPoint="1,1" Opacity="1">
<GradientStop Offset="0" Color="#3598C2"/>
<GradientStop Offset="1" Color="#48ADD8"/>
</LinearGradientBrush>
<Style x:Key="userBtn" TargetType="{x:Type Button}">
</Style>
</Window.Resources>

<Grid Name="main">
<Grid.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗.png" Stretch="Fill" />
</Grid.Background>
<Border Background="{StaticResource infoColor}" BorderBrush="Black" BorderThickness="3" CornerRadius="10">
<Grid Name="main" >

<Grid Margin="18,16">
<Button
Width="30"
Height="20"
Content="关闭"
Foreground="Black"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
Click="Button_Click" />

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
<TextBlock Name="icon" FontFamily="../../Fonts/#iconfont" VerticalAlignment="Center" FontSize="30" Foreground="White" Text="&#xe61f;" />
<TextBlock Margin="10,0,0,0" x:Name="infoType" VerticalAlignment="Center" FontWeight="Black" FontSize="20" Foreground="White"/>
</StackPanel>
</Grid>


<Grid Margin="18,16">
<Button
Width="30"
Height="20"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
Click="Button_Click" />

<Grid Margin="0,40,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*" />
<ColumnDefinition Width="0.15*" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Name="infoType"
Grid.Column="1"
VerticalAlignment="Top"
FontSize="15"
Foreground="DeepSkyBlue" />
<TextBlock
Name="icon"
Name="info"
Grid.Column="2"
Margin="10,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
VerticalAlignment="Top"
FontFamily="../../Fonts/#iconfont"
FontSize="30"
Foreground="DeepSkyBlue"
Text="&#xe61f;" />
<TextBlock
Name="info"
Grid.Column="2"
Margin="10,0,0,0"
VerticalAlignment="Top"
FontSize="15"
Foreground="DeepSkyBlue"
Text="警告:"
TextWrapping="Wrap" />
FontSize="20"
Foreground="White" FontWeight="Black"
Text="警告:"
TextWrapping="Wrap" />
</Grid>

<StackPanel
Grid.Row="1"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Name="Cancel"
Width="90"
Height="30"
Margin="5,0,5,0"
Click="Cancel_Click"
Content="取消"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />
Grid.Row="1"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Border CornerRadius="5" Margin="5,0,5,0" Background="#ECBB52" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" Width="90" BorderBrush="Black" BorderThickness="2">
<Button x:Name="Cancel" Background="Transparent" Click="Cancel_Click" Style="{StaticResource adbtn}" Foreground="Black" Content="取消" BorderThickness="0" FontSize="20" FontWeight="Black"/>
</Border>
<Border CornerRadius="5" Margin="5,0,5,0" Background="#ECBB52" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" Width="90" BorderBrush="Black" BorderThickness="2">
<Button x:Name="ok" Background="Transparent" Click="ok_Click" Style="{StaticResource adbtn}" Content="确定" Foreground="Black" BorderThickness="0" FontSize="20" FontWeight="Black"/>
</Border>

<Button
Name="ok"
Width="90"
Height="30"
Margin="5,0,5,0"
Click="ok_Click"
Content="确定"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />
</StackPanel>

<Grid.RowDefinitions>
@@ -107,5 +92,6 @@
<RowDefinition Height="0.5*" />
</Grid.RowDefinitions>
</Grid>
</Grid>
</Border>
</Window>

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

@@ -1,5 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


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

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


+ 9
- 11
BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs View File

@@ -1,7 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -10,7 +8,7 @@ using System.Threading.Tasks;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class AddNewUserViewModel:ObservableObject
public class AddNewUserViewModel : NotifyBase
{
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
private string _mErrorInfo;
@@ -26,9 +24,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public string NewPassword2 { get { return _mNewPassword2; } set { _mNewPassword2 = value; OnPropertyChanged(); } }
private string _mNewPassword2;

public RelayCommand ExitCommand { get; set; }
public BPARelayCommand ExitCommand { get; set; }

public RelayCommand ConfirmCommand { get; set; }
public BPARelayCommand ConfirmCommand { get; set; }

private void Confirm()
{
@@ -36,9 +34,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
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; }
if (res != null) { ErrorInfo = "用户名已存在"; return; }
Global.userManager.userInfos.Add(new UserInfo
{
{
UserName = UserName,
Password = NewPassword1,
userTreeViewModels = new List<UserTreeViewModel>()
@@ -49,12 +47,12 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

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

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


+ 10
- 11
BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs View File

@@ -3,12 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.Input;

using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Model;
using Google.Protobuf.WellKnownTypes;
@@ -16,11 +15,11 @@ using System.Threading;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class AlarmViewModel : ObservableObject
public class AlarmViewModel : NotifyBase
{
public AlarmViewModel()
{
ControlCommand = new RelayCommand(() =>
ControlCommand = new BPARelayCommand(() =>
{
if (ControlButText == "报警复位")
{
@@ -42,7 +41,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

});

SwitchCommand = new RelayCommand(() =>
SwitchCommand = new BPARelayCommand(() =>
{
if (ButContent == "历史报警")
{
@@ -72,7 +71,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

private void GetHistoryAlarm()
{
var data = Sqlite<Alarm>.GetInstance.GetData();
var data = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.GetData();
if (data != null)
{
HistoryAlarm.Clear();
@@ -87,9 +86,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

public RelayCommand SwitchCommand { get; set; }
public BPARelayCommand SwitchCommand { get; set; }

public RelayCommand ControlCommand { get; set; }
public BPARelayCommand ControlCommand { get; set; }


public Visibility CurrentDataVis { get { return _mCurrentDataVis; } set { _mCurrentDataVis = value; OnPropertyChanged(); } }
@@ -132,8 +131,8 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
private DateTime _mEndDateTime = DateTime.Now;


public static ObservableCollection<Alarm> AlarmInfos { get; set; }
public ObservableCollection<Alarm> HistoryAlarm { get; set; } = new ObservableCollection<Alarm>();
public static ObservableCollection<BPASmartClient.Model.Alarm> AlarmInfos { get; set; }
public ObservableCollection<BPASmartClient.Model.Alarm> HistoryAlarm { get; set; } = new();

}
}

+ 3
- 3
BPASmartClient.CustomResource/Pages/ViewModel/DebugLogViewModel.cs View File

@@ -5,14 +5,14 @@ using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using BPA.Helper;
using System.Collections.ObjectModel;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class DebugLogViewModel : ObservableObject
public class DebugLogViewModel : NotifyBase
{
public DebugLogViewModel()
{
@@ -38,7 +38,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

}

public class MessageModel : ObservableObject
public class MessageModel : NotifyBase
{
public string LogInfo { get { return _mLogInfo; } set { _mLogInfo = value; OnPropertyChanged(); } }
private string _mLogInfo;


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

@@ -5,21 +5,21 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class LoginViewModel : ObservableObject
public class LoginViewModel : NotifyBase
{
public LoginViewModel()
{
Config.GetInstance.Init();
ActionManage.GetInstance.Register(new Action(() => { Login(); }), "EnterLogin", true);
LoginCommand = new RelayCommand(() => { Login(); });
LoginCommand = new BPARelayCommand(() => { Login(); });

ExitCommand = new RelayCommand(() =>
ExitCommand = new BPARelayCommand(() =>
{
ActionManage.GetInstance.Send("ExitAction");
});
@@ -188,9 +188,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

public RelayCommand LoginCommand { get; set; }
public BPARelayCommand LoginCommand { get; set; }

public RelayCommand ExitCommand { get; set; }
public BPARelayCommand ExitCommand { get; set; }





+ 42
- 34
BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs View File

@@ -9,44 +9,27 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class MainViewModel : ObservableObject
public class MainViewModel : NotifyBase
{
public MainViewModel()
{
NavChangedCommand = new RelayCommand<object>(DoNavChanged);
BPASmartClient.Message. MessageLog.GetInstance.InfoNotify = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>
{
//ff20aefe
var temp = new MessageModel()
{
LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
};
if (DebugLogViewModel.MessageModels.Count > 0)
DebugLogViewModel.MessageModels.Insert(0, temp);
else
DebugLogViewModel.MessageModels.Add(temp);
});
});

BPASmartClient.Message.MessageLog.GetInstance.ExInfoNotify = new Action<string>((o) =>
NavChangedCommand = new BPARelayCommand<object>(DoNavChanged);
MessageLog.GetInstance.InfoNotify = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>
{
//FFF53F62
//ff20aefe
var temp = new MessageModel()
{
LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98))
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
};
if (DebugLogViewModel.MessageModels.Count > 0)
DebugLogViewModel.MessageModels.Insert(0, temp);
@@ -55,15 +38,15 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
});
});

BPA.Helper.MessageLog.GetInstance.NotifyShow = new Action<string>((o) =>
MessageLog.GetInstance.ExInfoNotify = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>
{
//ff20aefe
//FFF53F62
var temp = new MessageModel()
{
LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98))
};
if (DebugLogViewModel.MessageModels.Count > 0)
DebugLogViewModel.MessageModels.Insert(0, temp);
@@ -71,6 +54,31 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
DebugLogViewModel.MessageModels.Add(temp);
});
});

BPA.Helper.MessageLog.GetInstance.NotifyShow = new Action<string>((o) =>
{
try
{
Application.Current?.Dispatcher?.Invoke(() =>
{
//ff20aefe
var temp = new MessageModel()
{
LogInfo = o,
Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254))
};
if (DebugLogViewModel.MessageModels.Count > 0)
DebugLogViewModel.MessageModels.Insert(0, temp);
else
DebugLogViewModel.MessageModels.Add(temp);
});
}
catch (Exception)
{

//throw;
}
});
BPA.Helper.MessageLog.GetInstance.NotifyShowEx = new Action<string>((o) =>
{
Application.Current?.Dispatcher?.Invoke(() =>
@@ -98,9 +106,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

ActionManage.GetInstance.Register(new Action<object>((c) =>
{
if(c!=null)
IsAlarm = Convert.ToBoolean(c);
}),"HeartBeatCheck");
if (c != null)
IsAlarm = Convert.ToBoolean(c);
}), "HeartBeatCheck");
}

private void PermissionChange()
@@ -160,20 +168,20 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
OnPropertyChanged();
}
}
private bool _isAlarm=true;
private bool _isAlarm = true;
/// <summary>
/// 心跳检测报警
/// </summary>
public bool IsAlarm
{
get { return _isAlarm; }
set { _isAlarm = value;OnPropertyChanged(); }
set { _isAlarm = value; OnPropertyChanged(); }
}
/// <summary>
/// 开机自启
/// </summary>
public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } }
public RelayCommand<object> NavChangedCommand { get; set; }
public BPARelayCommand<object> NavChangedCommand { get; set; }

public FrameworkElement MainContent { get { return _mMainContent; } set { _mMainContent = value; OnPropertyChanged(); } }
private FrameworkElement _mMainContent;


+ 11
- 11
BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs View File

@@ -3,18 +3,18 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Enums;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Nfc;
using System.Threading;
using BPASmartClient.Helper;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class NfcSetViewModel : ObservableObject
public class NfcSetViewModel : NotifyBase
{
public NfcSetViewModel()
{
@@ -25,7 +25,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
if (item != "管理员") permissions.Add(new PermissionSelect() { PermissionName = item });
});

UserAddCommand = new RelayCommand(() =>
UserAddCommand = new BPARelayCommand(() =>
{
if (permissions?.FirstOrDefault(p => p.PermissionSelected == true) == null)
{
@@ -85,7 +85,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
});

UserCancelCommand = new RelayCommand(() =>
UserCancelCommand = new BPARelayCommand(() =>
{
if (CardNum != null && CardNum != string.Empty)
{
@@ -151,17 +151,17 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public string CheckPassword { get { return _checkPassword; } set { _checkPassword = value; OnPropertyChanged(); } }
private string _checkPassword = "888888";

public RelayCommand SavePermission { get; set; }
public BPARelayCommand SavePermission { get; set; }

public RelayCommand DeletePermission { get; set; }
public BPARelayCommand DeletePermission { get; set; }

public RelayCommand UserAddCommand { get; set; }
public BPARelayCommand UserAddCommand { get; set; }

public RelayCommand UserCancelCommand { get; set; }
public BPARelayCommand UserCancelCommand { get; set; }

}

public class PermissionSelect : ObservableObject
public class PermissionSelect : NotifyBase
{

public string PermissionName { get { return _mPermissionName; } set { _mPermissionName = value; OnPropertyChanged(); } }


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

@@ -4,14 +4,14 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{

public class PasswordChangeViewModel : ObservableObject
public class PasswordChangeViewModel : NotifyBase
{
private void CheckPassword(UserInfo userInfo)
{
@@ -40,7 +40,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

public PasswordChangeViewModel( )
{
LoginCommand = new RelayCommand(() =>
LoginCommand = new BPARelayCommand(() =>
{
if (Global.changeUserInfo == null) CheckPassword(Global.userInfo);
else { CheckPassword(Global.changeUserInfo); }
@@ -48,16 +48,16 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
});

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

public RelayCommand LoginCommand { get; set; }
public BPARelayCommand LoginCommand { get; set; }

public RelayCommand ExitCommand { get; set; }
public BPARelayCommand ExitCommand { get; set; }





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

@@ -1,4 +1,4 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -7,7 +7,7 @@ using System.Threading.Tasks;

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


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

@@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class ProductionDataViewModel : ObservableObject
public class ProductionDataViewModel : NotifyBase
{
public ProductionDataViewModel()
{


+ 8
- 8
BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs View File

@@ -3,21 +3,21 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;
using System.Windows;
using BPASmartClient.Helper;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class RecipeCompleteViewModel : ObservableObject
public class RecipeCompleteViewModel : NotifyBase
{
public RecipeCompleteViewModel()
{
Sqlite<RecipeCompleteLog>.GetInstance.Save();
SwitchCommand = new RelayCommand(() =>
SwitchCommand = new BPARelayCommand(() =>
{
if (ButContent == "历史日志")
{
@@ -41,7 +41,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

});

ControlCommand = new RelayCommand(() =>
ControlCommand = new BPARelayCommand(() =>
{

if (ControlButText == "报警复位") return;
@@ -79,9 +79,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

public RelayCommand SwitchCommand { get; set; }
public BPARelayCommand SwitchCommand { get; set; }

public RelayCommand ControlCommand { get; set; }
public BPARelayCommand ControlCommand { get; set; }

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


+ 8
- 8
BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs View File

@@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;
using Microsoft.Toolkit.Mvvm.Input;
using System.Diagnostics;
using System.IO;

@@ -17,7 +17,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
ReportHelper reportHelper = new ReportHelper();
public ReportViewModel()
{
AddCommand = new RelayCommand(() =>
AddCommand = new BPARelayCommand(() =>
{
for (int i = 0; i < 30; i++)
{
@@ -34,12 +34,12 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
//ReportData = reportHelper.Reports;
});

SaveCommand = new RelayCommand(() =>
SaveCommand = new BPARelayCommand(() =>
{
reportHelper.Save($"aa.pry");
});

ReadCommand = new RelayCommand(() =>
ReadCommand = new BPARelayCommand(() =>
{
ReportData.Clear();
var res = reportHelper.GetData($"{AppDomain.CurrentDomain.BaseDirectory}AccessFile\\ProductionData\\aa.pry");
@@ -56,8 +56,8 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

public ObservableCollection<ReportBase> ReportData { get; set; } = new ObservableCollection<ReportBase>();

public RelayCommand AddCommand { get; set; }
public RelayCommand SaveCommand { get; set; }
public RelayCommand ReadCommand { get; set; }
public BPARelayCommand AddCommand { get; set; }
public BPARelayCommand SaveCommand { get; set; }
public BPARelayCommand ReadCommand { get; set; }
}
}

+ 8
- 8
BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs View File

@@ -3,22 +3,22 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;
using System.Windows;
using BPASmartClient.Helper;
using BPA.Helper;
using System.Diagnostics;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class RunLogViewModel : ObservableObject
public class RunLogViewModel : NotifyBase
{
public RunLogViewModel()
{
Sqlite<RunLog>.GetInstance.Save();
SwitchCommand = new RelayCommand(() =>
SwitchCommand = new BPARelayCommand(() =>
{
if (ButContent == "历史日志")
{
@@ -42,7 +42,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

});

ControlCommand = new RelayCommand(() =>
ControlCommand = new BPARelayCommand(() =>
{

if (ControlButText == "报警复位") return;
@@ -88,9 +88,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

public RelayCommand SwitchCommand { get; set; }
public BPARelayCommand SwitchCommand { get; set; }

public RelayCommand ControlCommand { get; set; }
public BPARelayCommand ControlCommand { get; set; }

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


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

@@ -1,9 +1,9 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -14,7 +14,7 @@ using System.Windows;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class UserConfigViewModel:ObservableObject
public class UserConfigViewModel:NotifyBase
{
/// <summary>
/// 页面列表集合
@@ -63,27 +63,27 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
public Visibility VisibilityDevice { get { return _visibilityDevice; } set { _visibilityDevice = value; OnPropertyChanged(); } }
private Visibility _visibilityDevice = Visibility.Collapsed;

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

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

public RelayCommand<object> DeleteAllCommand { get; set; }
public BPARelayCommand<object> DeleteAllCommand { get; set; }

public RelayCommand<object> AddAllCommand { get; set; }
public BPARelayCommand<object> AddAllCommand { get; set; }

public RelayCommand<object> ChangeMaterailPageCommand { get; set; }
public BPARelayCommand<object> ChangeMaterailPageCommand { get; set; }

public RelayCommand SaveCommand { get; set; }
public BPARelayCommand SaveCommand { get; set; }

public RelayCommand CancelCommand { get; set; }
public BPARelayCommand CancelCommand { get; set; }

public RelayCommand<object> AddLoaclMaterialCommand { get; set; }
public BPARelayCommand<object> AddLoaclMaterialCommand { get; set; }
public RelayCommand<object> DeleteLoaclMaterialCommand { get; set; }
public BPARelayCommand<object> DeleteLoaclMaterialCommand { get; set; }
public RelayCommand<object> AddDeviceMaterialCommand { get; set; }
public BPARelayCommand<object> AddDeviceMaterialCommand { get; set; }
public RelayCommand<object> DeleteDeviceMaterialCommand { get; set; }
public BPARelayCommand<object> DeleteDeviceMaterialCommand { get; set; }


private void AddUserPage(object o)
@@ -228,19 +228,19 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

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

DeleteUserPageCommand = new RelayCommand<object>(DeleteUserPage);
DeleteUserPageCommand = new BPARelayCommand<object>(DeleteUserPage);

DeleteAllCommand = new RelayCommand<object>(DeleteAll);
DeleteAllCommand = new BPARelayCommand<object>(DeleteAll);


AddAllCommand = new RelayCommand<object>(AddAll);
AddAllCommand = new BPARelayCommand<object>(AddAll);

ChangeMaterailPageCommand = new RelayCommand<object>(ChangeMaterailPage);
ChangeMaterailPageCommand = new BPARelayCommand<object>(ChangeMaterailPage);

SaveCommand = new RelayCommand(() =>
SaveCommand = new BPARelayCommand(() =>
{
var res = Global.userManager.userInfos.FirstOrDefault(p => p.UserName == Global.changeUserInfo.UserName && p.Password == Global.changeUserInfo.Password);
if(res != null)
@@ -257,19 +257,19 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
ActionManage.GetInstance.Send("UserConfigViewConfirm");
});

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

AddLoaclMaterialCommand = new RelayCommand<object>(AddLoaclMaterial);
AddLoaclMaterialCommand = new BPARelayCommand<object>(AddLoaclMaterial);

DeleteLoaclMaterialCommand = new RelayCommand<object>(DeleteLoaclMaterial);
DeleteLoaclMaterialCommand = new BPARelayCommand<object>(DeleteLoaclMaterial);

AddDeviceMaterialCommand = new RelayCommand<object>(AddDeviceMaterial);
AddDeviceMaterialCommand = new BPARelayCommand<object>(AddDeviceMaterial);

DeleteDeviceMaterialCommand = new RelayCommand<object>(DeleteDeviceMaterial);
DeleteDeviceMaterialCommand = new BPARelayCommand<object>(DeleteDeviceMaterial);


foreach (var item in MenuManage.GetInstance.menuModels)


+ 8
- 8
BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs View File

@@ -3,22 +3,22 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;
using System.Windows;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.Helper;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class UserLogViewModel : ObservableObject
public class UserLogViewModel : NotifyBase
{
public UserLogViewModel()
{
Sqlite<UserLog>.GetInstance.Save();
UserLogs = MessageNotify.GetInstance.userLogs;
SwitchCommand = new RelayCommand(() =>
SwitchCommand = new BPARelayCommand(() =>
{
if (ButContent == "历史日志")
{
@@ -42,7 +42,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

});

ControlCommand = new RelayCommand(() =>
ControlCommand = new BPARelayCommand(() =>
{
if (ControlButText == "报警复位") return;
if (ControlButText == "开始查询")
@@ -81,9 +81,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
}
}

public RelayCommand SwitchCommand { get; set; }
public BPARelayCommand SwitchCommand { get; set; }

public RelayCommand ControlCommand { get; set; }
public BPARelayCommand ControlCommand { get; set; }

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


+ 11
- 11
BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs View File

@@ -1,8 +1,8 @@
using BPA.Message;
using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.CustomResource.Pages.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -15,7 +15,7 @@ using System.Windows;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
internal class UserManageViewModel:ObservableObject
internal class UserManageViewModel:NotifyBase
{
//private static UserManageViewModel _instance;
//public static UserManageViewModel GetInstance => _instance ??= new UserManageViewModel();
@@ -23,19 +23,19 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

//public List<Permission> Authorities { get; set; } = new List<Permission>() { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 };
public List<string> Authorities { get; set; } = new List<string>();
public RelayCommand<string> SaveCommand { get; set; }
public RelayCommand<string> DeleteCommand { get; set; }
public BPARelayCommand<string> SaveCommand { get; set; }
public BPARelayCommand<string> DeleteCommand { get; set; }

public RelayCommand AddUserInfoCommand { get; set; }
public BPARelayCommand AddUserInfoCommand { get; set; }

public RelayCommand SaveDataCommand { get; set; }
public BPARelayCommand SaveDataCommand { get; set; }
public UserManageViewModel()
{
var userManager = JsonConvert.DeserializeObject<UserManager>(File.ReadAllText("up.hbl").AESDecrypt());
usersInfo = userManager.userInfos;
AddAuthorities();

SaveCommand = new RelayCommand<string>((str) =>
SaveCommand = new BPARelayCommand<string>((str) =>
{
if (str != string.Empty && str != null)
{
@@ -62,7 +62,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
MessageBox.Show("保存失败,用户名为空或输入后未回车确认", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
}
});
DeleteCommand = new RelayCommand<string>((str) =>
DeleteCommand = new BPARelayCommand<string>((str) =>
{
if (str != string.Empty && str != null)
{
@@ -89,13 +89,13 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
});


AddUserInfoCommand = new RelayCommand( ()=>
AddUserInfoCommand = new BPARelayCommand( ()=>
{
usersInfo.Add(new UserInfo() { Id=IdProcess()});
});
SaveDataCommand = new RelayCommand(() =>
SaveDataCommand = new BPARelayCommand(() =>
{
Global.userManager.userInfos = usersInfo;
File.WriteAllText("up.hbl", JsonConvert.SerializeObject(Global.userManager).AESEncrypt());


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

@@ -1,6 +1,6 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -15,20 +15,20 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
/// <summary>
/// datagrid绑定
/// </summary>
public ObservableCollection<UserInfo> userManager { get; set; } = Global.userManager.userInfos;
public ObservableCollection<UserInfo> userManager { get; set; } = Global.userManager.userInfos;

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

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

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

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

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

private void ChangePassward(object o)
{
if (o != null && o is UserInfo infos)
if (o != null && o is UserInfo infos)
{
Global.changeUserInfo = infos;
PasswordChangeView passwordChangeView = new PasswordChangeView();
@@ -55,22 +55,22 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
UserConfigView userConfigView = new UserConfigView();
userConfigView.ShowDialog();
}
}

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

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

DeleteUserCommand = new RelayCommand<object>(DeleteUser);
DeleteUserCommand = new BPARelayCommand<object>(DeleteUser);

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

}


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

@@ -1,9 +1,9 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -14,7 +14,7 @@ using System.Windows;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{
public class VariableViewModel : ObservableObject
public class VariableViewModel : NotifyBase
{
public ObservableCollection<PlcVariableInfoModel> Variables { get; set; } = new ObservableCollection<PlcVariableInfoModel>();

@@ -25,7 +25,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel
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 BPARelayCommand SaveDataCommand { get; set; }
public VariableViewModel()
{
@@ -48,7 +48,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel

}
SaveDataCommand = new RelayCommand(() =>
SaveDataCommand = new BPARelayCommand(() =>
{
Json<PlcVariableInfoManage>.Data.VariablesInfo["滚筒输送线"] = Variables;
Json<PlcVariableInfoManage>.Data.VariablesInfo["炒锅1"] = FryOneVariables;


+ 6
- 5
BPASmartClient.CustomResource/RecDictionarys/DatePickeerDictionary.xaml View File

@@ -185,7 +185,7 @@
<Setter TargetName="Grid" Property="Opacity" Value="0.5" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="red" />
<Setter Property="Foreground" Value="Red" />
</Trigger>
<Trigger Property="IsToday" Value="True">
<Setter Property="Foreground" Value="yellow" />
@@ -218,8 +218,8 @@
<Border
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
BorderThickness="2">
<ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
@@ -264,10 +264,11 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Header -->
<Grid
Grid.Row="0"
Grid.Row="2"
HorizontalAlignment="Stretch"
Background="Transparent">
<Grid.ColumnDefinitions>
@@ -494,7 +495,7 @@
Width="19"
Height="18"
Margin="3,0,3,0"
Fill="#A5FFFFFF"
Fill="Black"
RadiusX="1"
RadiusY="1" />
<Popup


+ 143
- 0
BPASmartClient.CustomResource/RecDictionarys/RecComboBox.xaml View File

@@ -202,4 +202,147 @@
</Setter>
</Style>
<!--#endregion-->

<Style x:Key="ComboBoxStyle_1" TargetType="{x:Type ComboBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ComboBoxItem">
<Setter Property="Height" Value="25" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
<Border x:Name="_borderbg" Background="Transparent" />

<TextBlock
x:Name="_txt"
Margin="5,0,3,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="#DDD"
Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />

<Border
x:Name="_border"
Background="#103153"
Opacity="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="_txt" Property="Foreground" Value="{StaticResource ComboBoxSelectedForeground}" />
<Setter TargetName="_borderbg" Property="Background" Value="{StaticResource ComboBoxSelectdBackground}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="false" />
<Condition Property="IsMouseOver" Value="true" />
</MultiTrigger.Conditions>
<Setter TargetName="_borderbg" Property="Background" Value="{StaticResource ComboBoxMouseOverBackground}" />
<Setter TargetName="_txt" Property="Foreground" Value="{StaticResource ComboBoxMouseOverForegrond}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Grid>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.3*" MaxWidth="30" />
</Grid.ColumnDefinitions>
<Border
x:Name="_prybr"
Grid.Column="0"
Grid.ColumnSpan="2"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="0" />
<ContentPresenter
x:Name="ContentSite"
Margin="3,3,0,3"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="Center"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
IsHitTestVisible="False" />

<!-- ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen -->
<ToggleButton
x:Name="ToggleButton"
Grid.Column="0"
Grid.ColumnSpan="2"
ClickMode="Press"
Focusable="false"
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Template="{StaticResource ComboBoxToggleButton}" />
<!-- 必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它 -->
<TextBox
x:Name="PART_EditableTextBox"
Margin="2,0,0,0"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
CaretBrush="{TemplateBinding Foreground}"
Focusable="True"
Foreground="{TemplateBinding Foreground}"
IsReadOnly="{TemplateBinding IsReadOnly}"
Visibility="Hidden" />

<!-- Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen -->
<Popup
x:Name="Popup"
AllowsTransparency="True"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="Slide">
<Grid
x:Name="DropDown"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="150"
SnapsToDevicePixels="True">
<Border
x:Name="DropDownBorder"
BorderBrush="#3ba7f2"
BorderThickness="0" />
<ScrollViewer
Margin="1"
CanContentScroll="True"
HorizontalScrollBarVisibility="Auto"
SnapsToDevicePixels="True"
VerticalScrollBarVisibility="Auto">
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
<!-- 一下可以设置列表背景色 -->
<StackPanel
Background="#103153"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEditable" Value="true">
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="_prybr" Property="BorderBrush" Value="#aa3ba7f2" />
<!--<Setter Property="Background" Value="#553ba7f2" TargetName="_prybr"/>-->
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentSite" Property="Opacity" Value="0.6" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

+ 3
- 3
BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml View File

@@ -34,12 +34,12 @@
</ControlTemplate>

<Style x:Key="IcoButtonStyle" TargetType="local:IcoButton">
<Setter Property="FontFamily" Value="../Fonts/#iconfont" />
<Setter Property="FontFamily" Value="../Fonts/pic/#iconfont" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Background" Value="#2219b7ec" />
<!--<Setter Property="Background" Value="#2219b7ec" />
<Setter Property="BorderBrush" Value="#ff19b7ec" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="EnterBackground" Value="#8819b7ec" />
<Setter Property="EnterBackground" Value="#8819b7ec" />-->
</Style>

<Style x:Key="IcoTitleBarStyle" TargetType="local:IcoButton">


+ 2
- 2
BPASmartClient.CustomResource/UserControls/IcoButton.cs View File

@@ -119,7 +119,7 @@ namespace BPASmartClient.CustomResource.UserControls
}
public static readonly DependencyProperty EnterBackgroundProperty =
DependencyProperty.Register("EnterBackground", typeof(Brush), typeof(IcoButton),
new PropertyMetadata(Brushes.DarkGray, new PropertyChangedCallback(OnPropertyChanged)));
new PropertyMetadata(Brushes.Transparent, new PropertyChangedCallback(OnPropertyChanged)));


public Brush PressedBackground
@@ -212,7 +212,7 @@ namespace BPASmartClient.CustomResource.UserControls

private void Gr_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
//Command?.Invoke();
Command?.Execute(null);
//this.Background = PressedBackground;
}



+ 42
- 43
BPASmartClient.DRCoffee/CoffeeMachine.cs View File

@@ -1,7 +1,6 @@
using BPASmartClient.DRCoffee;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPASmartClient.Message;

using BPA.Helper;
using BPASmartClient.Model;
using BPASmartClient.Model.咖啡机.Enum;
using BPASmartClient.Peripheral;
@@ -9,7 +8,7 @@ using BPASmartClient.SerialPort;
using System;
using System.Collections.Generic;
using System.Threading;
using static BPASmartClient.EventBus.EventBus;
using static BPA.Helper.EventBus;

namespace BPASmartClient.DRCoffee
{
@@ -88,7 +87,7 @@ namespace BPASmartClient.DRCoffee
/// </summary>
private void MainLoop()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (!free)
{
@@ -97,7 +96,7 @@ namespace BPASmartClient.DRCoffee
Thread.Sleep(200);
}), "咖啡机询问线程");

ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
List<byte> temp = new List<byte>();
//一系列解包
@@ -147,7 +146,7 @@ namespace BPASmartClient.DRCoffee
if (((DrCoffeeStatus)status["CoffeeStatus"]) == DrCoffeeStatus.Running && package.Status != DrCoffeeStatus.Running)
{
status["CoffeeStatus"] = package.Status;
EventBus.EventBus.GetInstance().Publish(new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId });
EventBus.GetInstance().Publish(new DRCoffee_CoffeEndCookEvent() { DeviceId = DeviceId });
}
else status["CoffeeStatus"] = package.Status;
status["CoffeeAppStatus"] = package.ApplicationStatus;
@@ -180,27 +179,27 @@ namespace BPASmartClient.DRCoffee
commProxy.SetDataStorage(dataStorage);

//咖博士咖啡机制作
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_MakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
drinksOrder.CommCmd = DrCoffeeCommCmd.饮品制作指令;
drinksOrder.DrinksCode = ((DRCoffee_MakeCoffeeEvent)@event).DrinkCode;
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 制作咖啡指令");
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
EventBus.GetInstance().Subscribe<DRCoffee_MakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
drinksOrder.CommCmd = DrCoffeeCommCmd.饮品制作指令;
drinksOrder.DrinksCode = ((DRCoffee_MakeCoffeeEvent)@event).DrinkCode;
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 制作咖啡指令");
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});

//咖博士咖啡机取消制作咖啡
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CancelMakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<DRCoffee_CancelMakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
@@ -220,23 +219,23 @@ namespace BPASmartClient.DRCoffee
});

//咖博士咖啡机模式设置
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CoffeeCommCmdEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
drinksOrder.CommCmd = ((DRCoffee_CoffeeCommCmdEvent)@event).CommCmd;
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 咖啡模式设置指令");
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
EventBus.GetInstance().Subscribe<DRCoffee_CoffeeCommCmdEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
drinksOrder.CommCmd = ((DRCoffee_CoffeeCommCmdEvent)@event).CommCmd;
commProxy.SendData(DrCoffee.Packe(drinksOrder));
Thread.Sleep(200);
free = false;
MessageLog.GetInstance.Show($"咖啡机: 咖啡模式设置指令");
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
InitStatus();
//测试
Start();


+ 8
- 7
BPASmartClient.DRCoffee/CommandHandler.cs View File

@@ -1,5 +1,6 @@

using BPASmartClient.EventBus;

using BPA.Helper;
using BPASmartClient.Model;
using BPASmartClient.Model.咖啡机.Enum;
using BPASmartClient.SerialPort;
@@ -9,10 +10,10 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static BPASmartClient.EventBus.EventBus;
using static BPA.Helper.EventBus;

namespace BPASmartClient.DRCoffee
{
namespace BPASmartClient.DRCoffee
{
/// <summary>
/// 指令封装
/// </summary>
@@ -35,9 +36,9 @@ namespace BPASmartClient.DRCoffee
cmdAsk = DrCoffee.Packe(package);
drinksOrder.CommCmd = DrCoffeeCommCmd.饮品制作指令;

EventBus.EventBus.GetInstance().Subscribe<DRCoffee_MakeCoffeeEvent>(0,MakeCoffeeEventHandle);
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CancelMakeCoffeeEvent>(0, CancelMakeCoffeeEventHandle);
EventBus.EventBus.GetInstance().Subscribe<DRCoffee_CoffeeCommCmdEvent>(0, CoffeeCommCmdEventHandle);
EventBus.GetInstance().Subscribe<DRCoffee_MakeCoffeeEvent>(0, MakeCoffeeEventHandle);
EventBus.GetInstance().Subscribe<DRCoffee_CancelMakeCoffeeEvent>(0, CancelMakeCoffeeEventHandle);
EventBus.GetInstance().Subscribe<DRCoffee_CoffeeCommCmdEvent>(0, CoffeeCommCmdEventHandle);

}



+ 2
- 2
BPASmartClient.DRCoffee/MorkCStatus.cs View File

@@ -1,6 +1,6 @@
using BPASmartClient.DRCoffee;
using BPASmartClient.EventBus;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using System;
using System.Collections.Generic;


+ 6
- 7
BPASmartClient.Device/AlarmHelper.cs View File

@@ -1,5 +1,4 @@
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPA.Helper;
using BPASmartClient.Model;
using System;
using System.Collections.Concurrent;
@@ -12,8 +11,8 @@ namespace BPASmartClient.Device
{
public class AlarmHelper
{
public List<Alarm> Alarms { get; set; } = new List<Alarm>();
public List<Alarm> HistoryAlarms { get; set; } = new List<Alarm>();
public List<BPASmartClient.Model.Alarm> Alarms { get; set; } = new();
public List<BPASmartClient.Model.Alarm> HistoryAlarms { get; set; } = new();
ConcurrentDictionary<string, bool> flagbit = new ConcurrentDictionary<string, bool>();
ConcurrentDictionary<string, Delay> delays = new ConcurrentDictionary<string, Delay>();
public Action<string> AddAction { get; set; }
@@ -55,7 +54,7 @@ namespace BPASmartClient.Device
/// <param name="AlarmInfo">报警信息</param>
private void AddAlarm(object value, string AlarmInfo, AlarmLevel alarmLevel)
{
Alarm tempAlarm = new Alarm()
BPASmartClient.Model.Alarm tempAlarm = new BPASmartClient.Model.Alarm()
{
NumId = Alarms.Count + 1,
Date = DateTime.Now.ToString("yyyy/MM/dd"),
@@ -65,8 +64,8 @@ namespace BPASmartClient.Device
Time = DateTime.Now.ToString("HH:mm:ss"),
};

var res = Sqlite<Alarm>.GetInstance.Base.Add(tempAlarm);
Sqlite<Alarm>.GetInstance.Save();
var res = Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Base.Add(tempAlarm);
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save();

if (Alarms.FirstOrDefault(p => p.Info == AlarmInfo) == null)
{


+ 0
- 1
BPASmartClient.Device/BPASmartClient.Device.csproj View File

@@ -12,7 +12,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" />
<ProjectReference Include="..\BPASmartClient.Model\BPASmartClient.Model.csproj" />
<ProjectReference Include="..\BPASmartClient.Peripheral\BPASmartClient.Peripheral.csproj" />
</ItemGroup>


+ 55
- 29
BPASmartClient.Device/BaseDevice.cs View File

@@ -1,7 +1,5 @@
using BPA.Message;
using BPA.Message.Enum;
using BPASmartClient.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Peripheral;
using System;
@@ -14,8 +12,8 @@ using System.Threading;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using BPASmartClient.Model.单片机;
using BPASmartClient.EventBus;
using BPA.Models;
using BPA.Helper;

namespace BPASmartClient.Device
{
@@ -24,10 +22,11 @@ namespace BPASmartClient.Device
/// </summary>
public abstract class BaseDevice : IDevice
{
public Action<bool> stateAction;
public BaseDevice()
{
}
public bool IsConnected { get; set; }=false;
#region 属性
/// <summary>
/// 订单物料信息
@@ -118,12 +117,11 @@ namespace BPASmartClient.Device

public Action<int, object> AddErrorAction { get; set; }
public Action<int, object> DeleteErrorAction { get; set; }
public List<Alarm> alarms { get; set; } = new List<Alarm>();
public List<BPASmartClient.Model.Alarm> alarms { get; set; } = new List<BPASmartClient.Model.Alarm>();
public IAlarm InterfaceAlarm { get; set; }
public AlarmHelper alarmHelper { get; set; } = new AlarmHelper();
public IStatus InterfaceStatus { get; set; }
public ObservableCollection<Variable> variables { get; set; } = new ObservableCollection<Variable>();

#endregion

/// <summary>
@@ -164,7 +162,7 @@ namespace BPASmartClient.Device
/// <param name="info"></param>
public void DeviceProcessLogShow(string info)
{
Log.Insert(0, new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "流程", Text = info });
Log.Insert(0, new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"), Type = "流程", Text = info });
MessageLog.GetInstance.DeviceProcessLogShow(DeviceId.ToString(), info);
if (Log.Count > 100) { Log.RemoveAt(Log.Count - 1); }
}
@@ -178,15 +176,30 @@ namespace BPASmartClient.Device
peripherals.ForEach(p =>
{
p.DeviceId = this.DeviceId;

p.Init();
});
this.peripherals = peripherals;
TaskManage.GetInstance.StartLong(() =>
{
var res = this.peripherals.FindAll(o => o.IsConnected == true);
if (res.Count > 0&&!IsConnected)
{
IsConnected = true;
stateAction?.Invoke(true);
}
else if (res.Count<=0&&IsConnected)
{
IsConnected= false;
stateAction?.Invoke(false);
}
Thread.Sleep(3000);
}, "设备状态监控");
}

public virtual void StartMain()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
int i = 0;
foreach (var peripheral in peripherals)
@@ -254,7 +267,7 @@ namespace BPASmartClient.Device
Thread.Sleep(100);
}), $"GetAllStatus:{DeviceId}");
DoMain();
SimOrder();
//SimOrder();
GetGvlStatus();
InitResetTask();
InitTask();
@@ -316,7 +329,7 @@ namespace BPASmartClient.Device
DeleteErrorAction?.Invoke(DeviceId, res);
}
});
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
AlarmMonitoring();
Thread.Sleep(500);
@@ -352,17 +365,21 @@ namespace BPASmartClient.Device
private void InitResetTask()
{
#region 复位程序
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (RTrig.GetInstance($"ResetProgram:{DeviceId}").Start(Initing))
{
ThreadManage.GetInstance().StopTask($"MainTask:{DeviceId}", new Action(() =>
DeviceProcessLogShow("启动初始化");
//记录监控数据
DeviceProcessLogShow($"监控数据:【 {variableMonitors.ToJSON()} 】");

TaskManage.GetInstance.StopTask($"MainTask:{DeviceId}", new Action(() =>
{
ThreadManage.GetInstance().StopTask($"ReadData:{DeviceId}", new Action(() =>
TaskManage.GetInstance.StopTask($"ReadData:{DeviceId}", new Action(() =>
{
ThreadManage.GetInstance().StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() =>
TaskManage.GetInstance.StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() =>
{
ActionManage.GetInstance.Send("ClearOrders");
//ActionManage.GetInstance.Send("ClearOrders");
ResetProgram();
ResetStatus();
InitTask();
@@ -378,7 +395,7 @@ namespace BPASmartClient.Device
private void InitTask()
{
#region 数据读取
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
ReadData();
Thread.Sleep(10);
@@ -386,15 +403,18 @@ namespace BPASmartClient.Device
#endregion

#region 任务流程
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
MainTask();
if (IsConnected)
{
MainTask();
}
Thread.Sleep(10);
}), $"MainTask:{DeviceId}", true);
#endregion

#region 设备状态监控
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
UpdateValue(InterfaceStatus);
Thread.Sleep(1000);
@@ -408,6 +428,7 @@ namespace BPASmartClient.Device
private void GetMonitorData(IStatus status)
{
if (status == null) return;
List<VariableMonitor> vm = new List<VariableMonitor>();
foreach (var item in status.GetType().GetProperties())
{
if (item.CustomAttributes.Count() > 0)
@@ -427,7 +448,7 @@ namespace BPASmartClient.Device
{
for (int i = 0; i < arr.Length; i++)
{
var res = variableMonitors.FirstOrDefault(p => p.VarName == $"{item.Name}_{i + 1}");
var res = vm.FirstOrDefault(p => p.VarName == $"{item.Name}_{i + 1}");
if (res == null)
{
string[] plc = plcadd?.Substring(1).Split('.');
@@ -450,9 +471,9 @@ namespace BPASmartClient.Device
TempPlcAddress = $"M{plc[0]}.{plc[1]}";
}

variableMonitors.Add(new VariableMonitor()
vm.Add(new VariableMonitor()
{
Id = variableMonitors.Count,
Id = vm.Count+1,
VarName = $"{item.Name}_{i + 1}",
Notes = $"{notes}_{i + 1}",
ModbusTcpAddress = $"{int.Parse(modadd) + i}",
@@ -470,12 +491,12 @@ namespace BPASmartClient.Device
{
for (int i = 0; i < arr.Length; i++)
{
var res = variableMonitors.FirstOrDefault(p => p.VarName == $"{item.Name}_{i + 1}");
var res = vm.FirstOrDefault(p => p.VarName == $"{item.Name}_{i + 1}");
if (res == null)
{
variableMonitors.Add(new VariableMonitor()
vm.Add(new VariableMonitor()
{
Id = variableMonitors.Count,
Id = vm.Count+1,
VarName = $"{item.Name}_{i + 1}",
Notes = $"{notes}_{i + 1}",

@@ -487,12 +508,12 @@ namespace BPASmartClient.Device
}
else
{
var res = variableMonitors.FirstOrDefault(p => p.VarName == item.Name);
var res = vm.FirstOrDefault(p => p.VarName == item.Name);
if (res == null)
{
variableMonitors.Add(new VariableMonitor()
vm.Add(new VariableMonitor()
{
Id = variableMonitors.Count,
Id = vm.Count+1,
VarName = item.Name,
Notes = notes,
ModbusTcpAddress = modadd,
@@ -504,6 +525,11 @@ namespace BPASmartClient.Device

}
}

//监控列表排序
//vm.OrderBy(p => p.VarName).ToList().ForEach(item => { variableMonitors.Add(item); });
vm.ForEach(item => { variableMonitors.Add(item); });

}

/// <summary>


+ 2
- 2
BPASmartClient.Device/DeviceStatus.cs View File

@@ -50,9 +50,9 @@ namespace BPASmartClient.Device
status.AddOrUpdate(key, value, (key, value) => value);
}

public Dictionary<string, object> GetStatus()
public ConcurrentDictionary<string, object> GetStatus()
{
return status.ToDictionary(x => x.Key, x => x.Value);
return status;
}

public object GetIOTStatus()


+ 1
- 1
BPASmartClient.Device/IDevice.cs View File

@@ -67,7 +67,7 @@ namespace BPASmartClient.Device
/// <summary>
/// 设备报警信息集合
/// </summary>
List<Alarm> alarms { get; set; }
List<BPASmartClient.Model.Alarm> alarms { get; set; }

/// <summary>
/// 接口报警对象


+ 2
- 2
BPASmartClient.Device/VariableMonitor.cs View File

@@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.Device
{
public class VariableMonitor : ObservableObject
public class VariableMonitor : NotifyBase
{
public int Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } }
private int _mId;


+ 55
- 1
BPASmartClient.Device/VariableMonitorAttribute.cs View File

@@ -28,7 +28,12 @@ namespace BPASmartClient.Device
if (address.Length > 0)
{
address = address.Trim();
if (address.ToUpper().Contains("M") && address.Length >= 4)
if (address.ToUpper().Contains("GM") && address.Length >= 3)
{
var res = address.Remove(0, 2);
if (res != null && res.Length > 0) return (int.Parse(res) + 4096).ToString();
}
else if (address.ToUpper().Contains("M") && address.Length >= 4)
{
var res = address.Substring(1).Split('.');
if (res != null && res.Length == 2)
@@ -42,6 +47,19 @@ namespace BPASmartClient.Device
}
}
}
else if (address.ToUpper().Contains("GI") && address.Length >= 3)
{
var res = address.Remove(0, 2);
if (res != null && res.Length > 0) return res;
}
else if (address.ToUpper().Contains("LB") && address.Length >= 3)
{
var res = address.Substring(2);
if (res != null && res.Length > 0)
{
if (int.TryParse(res, out int firstAddress)) return firstAddress.ToString();
}
}
else if ((address.ToUpper().Contains("VW") || address.ToUpper().Contains("VD")) && address.Length >= 3)
{
var res = address.Substring(2);
@@ -50,8 +68,44 @@ namespace BPASmartClient.Device
return ((tempAddress / 2) + 100).ToString();
}
}
else if (address.ToUpper().Contains("LW") && address.Length >= 3)
{
var res = address.Substring(2);
if (res != null && int.TryParse(res, out int LwAddress))
{
return LwAddress.ToString();
}
}
}
return "";
//if (address == null) return "";
//if (address.Length > 0)
//{
// address = address.Trim();
// if (address.ToUpper().Contains("M") && address.Length >= 4)
// {
// var res = address.Substring(1).Split('.');
// if (res != null && res.Length == 2)
// {
// if (int.TryParse(res[0], out int firstAddress) && int.TryParse(res[1], out int ExitAddress))
// {
// if (ExitAddress >= 0 && ExitAddress <= 7)
// {
// return ((firstAddress * 8) + 320 + ExitAddress).ToString();
// }
// }
// }
// }
// else if ((address.ToUpper().Contains("VW") || address.ToUpper().Contains("VD")) && address.Length >= 3)
// {
// var res = address.Substring(2);
// if (res != null && int.TryParse(res, out int tempAddress))
// {
// return ((tempAddress / 2) + 100).ToString();
// }
// }
//}
//return "";
}

/// <summary>


+ 3
- 3
BPASmartClient.DosingSystemSingle/App.xaml.cs View File

@@ -35,10 +35,10 @@ namespace BPASmartClient.DosingSystemSingle
Environment.Exit(0);
}
base.OnStartup(e);
BPASmartClient.Helper.SystemHelper.GetInstance.CreateDesktopShortcut();
SystemHelper.GetInstance.CreateDesktopShortcut();
MenuInit();
DataInit();
ThreadManage.GetInstance().Start(new Action(() =>
TaskManage.GetInstance.Start(new Action(() =>
{
DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化
}), "设备初始化");
@@ -62,7 +62,7 @@ namespace BPASmartClient.DosingSystemSingle
Json<LocaPar>.Save();
Json<DevicePar>.Save();
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
TaskManage.GetInstance.Dispose();
}

private void MenuInit()


+ 1
- 1
BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj View File

@@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BPA.Helper" Version="1.0.54" />
<PackageReference Include="BPA.Helper" Version="1.0.73" />
<PackageReference Include="BPA.Message" Version="1.0.86" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>


+ 4
- 4
BPASmartClient.DosingSystemSingle/Model/DeviceInquire.cs View File

@@ -32,7 +32,7 @@ namespace BPASmartClient.DosingSystemSingle
public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>();
private void DeviceDataInit()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
for (int i = 0; i < DeviceLists.Count; i++)
{
@@ -117,7 +117,7 @@ namespace BPASmartClient.DosingSystemSingle
IpAddressLines();
//SiemensDevice.GetInstance.Connect(Json<DevicePar>.Data.BaseParModel.DeviceAddress);
DeviceDataInit();
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (IPQueues.Count >= IPLists.Count)
//IpAddressLines();
@@ -303,7 +303,7 @@ namespace BPASmartClient.DosingSystemSingle
AlarmHelper<AlarmInfo>.Init();
if (modbusTcp.Connected)
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
this.DeviceName = modbusTcp.GetString(DeviceAddress.DeviceName, 20)?.Trim()?.Replace(" ", "");
deviceStatus.RunStatus = (ushort)this.modbusTcp.ReadShort(DeviceAddress.RunStatus); //获取设备运行状态
@@ -341,7 +341,7 @@ namespace BPASmartClient.DosingSystemSingle

public void Dispose()
{
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听");
TaskManage.GetInstance.StopTask($"{DeviceName} 开始监听");
}

public void Start(float Value)


+ 2
- 2
BPASmartClient.DosingSystemSingle/Service/SiemensDevice.cs View File

@@ -35,14 +35,14 @@ namespace BPASmartClient.DosingSystemSingle
}
IsConnect = MySiemens.IsConnected;
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (IsConnect) MySiemens.Write("DB4.DBX0.0", tempValue);//设备心跳
tempValue = !tempValue;
Thread.Sleep(100);
}), "设备心跳", true);

ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (IsConnect)
{


+ 1
- 1
BPASmartClient.DosingSystemSingle/View/HardwareStatusView.xaml.cs View File

@@ -24,7 +24,7 @@ namespace BPASmartClient.DosingSystemSingle.View
public HardwareStatusView()
{
InitializeComponent();
this.Unloaded += (o, e) => { ThreadManage.GetInstance().StopTask("输送带料仓状态监控"); };
this.Unloaded += (o, e) => { TaskManage.GetInstance.StopTask("输送带料仓状态监控"); };
}
}
}

+ 1
- 1
BPASmartClient.DosingSystemSingle/View/ManualControlView.xaml.cs View File

@@ -24,7 +24,7 @@ namespace BPASmartClient.DosingSystemSingle.View
public ManualControlView()
{
InitializeComponent();
this.Unloaded += (o, e) => { ThreadManage.GetInstance().StopTask("手动气缸状态监控"); };
this.Unloaded += (o, e) => { TaskManage.GetInstance.StopTask("手动气缸状态监控"); };
this.SizeChanged += ManualControlView_SizeChanged;
this.cy.Height = this.list1.ActualHeight + 40;
this.zd.Height = this.list2.ActualHeight + 40;


+ 1
- 1
BPASmartClient.DosingSystemSingle/View/NewMaterialView.xaml.cs View File

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save