Comparar comentimentos

...

227 Cometimentos

Autor SHA1 Mensagem Data
  lyw 37c09f6727 zancun há 6 meses
  pry 5811130920 滚动设置 há 8 meses
  pry a5af2cd723 滚动 há 8 meses
  lyw 7753ea9f5b 上传3/4 há 8 meses
  lyw 3af0babd2a 上传 há 8 meses
  lyw 8b5a12442d 上传 há 8 meses
  lyw 3ffb2815f9 最新 há 8 meses
  lyw 7780f1bc56 上传 há 8 meses
  lyw 31ba753380 hhh há 8 meses
  lyw c269c7962e sss há 8 meses
  lyw f37692b23c hhh há 8 meses
  lyw 5f5c721d03 s há 8 meses
  lyw 6f087998df baocun há 8 meses
  lyw bd32efda18 本地存储 há 8 meses
  lyw 6d96ec638c 111 há 8 meses
  lyw 1461f18fe6 优化前备份 há 9 meses
  lyw bbd2c29794 上传 há 9 meses
  lyw bf077fb66c shangchaun há 9 meses
  pry 28405ef9f3 日志修改 há 9 meses
  lyw 5f51952342 shangchuan há 9 meses
  lyw df4363e7a3 shangchaun há 9 meses
  lyw 076b57b178 上传 há 9 meses
  lyw 82411d6fd7 新系统逻辑更新 há 9 meses
  ZhaoGang 6e5303cfa6 。。。 há 11 meses
  ZhaoGang 4137e39045 调试 há 11 meses
  ZhaoGang 152b882b76 Merge branch '一拖四味魔方配料系统' of http://111.9.47.105:10244/bpa/BPASmartClient into 一拖四味魔方配料系统 há 11 meses
  ZhaoGang 2bc4c46f84 ... há 11 meses
  ZhaoGang 6915081605 ... há 11 meses
  ZhaoGang 8c3adfcdc2 调试 há 11 meses
  ZhaoGang 43484a8c94 修改 há 11 meses
  ZhaoGang 00a6c2a19e 11 há 11 meses
  ZhaoGang 04725ff2b0 临时修改 há 11 meses
  ZhaoGang 1eab32e406 Merge branch '一拖四味魔方配料系统' of http://111.9.47.105:10244/bpa/BPASmartClient into 一拖四味魔方配料系统 há 11 meses
  ZhaoGang 2a8595be60 22 há 11 meses
  ZhaoGang be8d06dee6 22 há 11 meses
  ZhaoGang 65a9dad594 11 há 11 meses
  ZhaoGang c721a16fac 111 há 11 meses
  yaowen liu 1a97c50f8f Merge branch '一拖四味魔方配料系统' of http://111.9.47.105:10244/bpa/BPASmartClient into 一拖四味魔方配料系统 há 11 meses
  yaowen liu f0c48a337f 上传 há 11 meses
  ZhaoGang 315048d7ee 11 há 11 meses
  ZhaoGang 93bc6b8105 Merge branch '一拖四味魔方配料系统' of http://111.9.47.105:10244/bpa/BPASmartClient into 一拖四味魔方配料系统 há 11 meses
  yaowen liu 67be91b0b4 11上传 há 11 meses
  ZhaoGang 8bf65b7687 11 há 11 meses
  ZhaoGang a4801ebd90 11 há 11 meses
  yaowen liu 242964620f 上传 há 11 meses
  yaowen liu 42744bb295 上传 há 11 meses
  yaowen liu e6ac665fdf 测试版本 há 1 ano
  yaowen liu 5830b211bc 手自动切换控制 há 1 ano
  yaowen liu 6625267155 更改 há 1 ano
  yaowen liu 5583ce5ae1 配方配料 há 1 ano
  yaowen liu cde3997c6f aaa há 1 ano
  yaowen liu b9702de59c 配料系统完成 há 1 ano
  yaowen liu 6e38d7b802 逻辑更改 há 1 ano
  yaowen liu 41c4d5f146 qqqq há 1 ano
  yaowen liu a924a14476 上传 há 1 ano
  yaowen liu 4d16bdf182 recipe há 1 ano
  yaowen liu 26c7a373ad 设备点位完善 há 1 ano
  yaowen liu 9511f71b23 更新 há 1 ano
  yaowen liu 1411ab54de 配料更新 há 1 ano
  yaowen liu 0e8d79d275 配料更新 há 1 ano
  yaowen liu a667b367cd 味魔方配料同步 há 1 ano
  ZhaoGang 3662bb90f6 炒菜系统添加机器人维护位置功能 há 1 ano
  ZhaoGang 595789cefe Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z 81f87cc93b Morks本地订单更新 há 1 ano
  ZhaoGang c1fe4b32fd 1. 修改冒菜机的模拟订单功能。2. 煮面机模拟界面碗位置默认修改为11. há 1 ano
  ZhaoGang efb530183b 1. 搅拌频率可输入0-60Hz,2. 添加辅料库位按炒锅区分功能及相应的配置界面。 há 1 ano
  ZhaoGang 8828bcfcaf 1. 小炒系统电子秤委托修改。 há 1 ano
  ZhaoGang aea508a4ac 1. 添加参数设置页面。2. 添加库位可人工修改库位信息的功能。 há 1 ano
  ZhaoGang 2cea2352bf 现场调试修改。 há 1 ano
  ZhaoGang bab6ca369f 1. 炒锅在做菜的时候,不可手动控制。2. 添加取消任务时,等待操作也取消。3. modbus通讯修改超时时间。 há 1 ano
  ZhaoGang ed1e5c8e3f 修改冒菜机订单状态改变事件推送方式。2. 成都旅游学院调试修改 há 1 ano
  pry d4757a4091 网络调整修改 há 1 ano
  pry fb560fc9c6 监控状态排序 há 1 ano
  ZhaoGang e8d384bc59 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 085ecfc10b 2 há 1 ano
  ZhaoGang c768eb1af5 修改冒菜机的订单模拟功能。 há 1 ano
  ZhaoGang 25729cc792 1 há 1 ano
  pry c077ce7750 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 08628bef31 日志添加 há 1 ano
  ZhaoGang b0dc675213 1. 改为出餐优先 há 1 ano
  ZhaoGang 9d1b781078 柔性配料系统添加接收MQTT工单 há 1 ano
  ZhaoGang e10539084a 删除合并冲突印记 há 1 ano
  ZhaoGang 0f03b6ddff 1 há 1 ano
  ZhaoGang e71cb499fd 1 há 1 ano
  ZhaoGang 6707cc5e31 1. 添加MQTTServer基础。2. 修改了一些命名。3. 删除了一些多余的类。 há 1 ano
  ZhaoGang a07b4a8bca Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 30d0f67030 剔除西门子业务逻辑 há 1 ano
  Mr_z 9e2c247440 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z 5e818a85b3 阿里云联调更新 há 1 ano
  ZhaoGang 17c108c638 日志打印简化 há 1 ano
  Mr_z bd840e91fb 增加物模型默认模板事件 há 1 ano
  Mr_z 904948869b Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z 176c56a537 物模型属性更新 há 1 ano
  ZhaoGang 70ea1d70be Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang ba8fffe3f0 1Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 9167417d40 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 88014f7cf2 1. 代码格式化。2.恢复注释。 há 1 ano
  Mr_z f2a16ec1ad 增加料仓在线状态属性上报 há 1 ano
  Mr_z 84fb2cfd6c Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z 8079a30c82 柔性配料系统接入阿里云Iot há 1 ano
  ZhaoGang b89c5f2d03 1. 修改数据库初始化。 há 1 ano
  ZhaoGang 2ac2bb56cf Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang c1cea78eef 1. 优化手动调试系界面代码。2. 完善报警变量及赋值。 há 1 ano
  Mr_z 912e73f769 冲突更新 há 1 ano
  Mr_z a418a36a31 更新 há 1 ano
  ZhaoGang 56c1023501 1. 修改入库程序到Control_MorkCL里。2. 配方编辑界面添加上移下移功能。 há 1 ano
  ZhaoGang 1cd8119b09 修改手动调试炒锅界面代码。 há 1 ano
  ZhaoGang c0af685c3d 1. 完善手动调试界面。2. 修改入库条件判断。 há 1 ano
  ZhaoGang 96480deff6 海科调试。 há 1 ano
  pry 9a14ec46c4 从站设置 há 1 ano
  pry 64fc2d20d4 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang dc34d54028 恢复注释。 há 1 ano
  ZhaoGang 937e5b140a 下发配方时添加物料查找验证。 há 1 ano
  pry b0a1aece7e Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 678c9099e3 测试项目添加 há 1 ano
  ZhaoGang 3d6149a7d6 添加手动调试界面。 há 1 ano
  ZhaoGang 3d3dfcce1c 修改入库界面库位显示。 há 1 ano
  ZhaoGang e99a352a6c 修改配方分配逻辑。 há 1 ano
  ZhaoGang 85b638fd9e 1. 添加修改变量。2. 修改配方功能。 há 1 ano
  ZhaoGang db149553ba 海科调试修改。 há 1 ano
  ZhaoGang e5d89c9254 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang a72757c144 1 há 1 ano
  ZhaoGang b384e0e54a 1. 添加日志输出,测试订单下发。2. 读取变量程序更新。 há 1 ano
  Mr_z 78cdd8c5d5 柔性配料调试更新 há 1 ano
  Mr_z c3d46b40f0 更新 há 1 ano
  Mr_z 8e7aec3c18 配料状态更新 há 1 ano
  Mr_z 3b9e68d0f1 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z e89c847747 调试更新 há 1 ano
  ZhaoGang 7ad95a23f2 1 há 1 ano
  ZhaoGang f216983a7d Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang e037129464 修复加载Json文件多添加参数的问题。以及代码格式化。 há 1 ano
  ZhaoGang 310f8e6582 配方功能参数编辑框调整为部分参数使用ComboBox选择。 há 1 ano
  Mr_z e8fa48765a Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z 5d9c288879 配方执行逻辑更新 há 1 ano
  Nah a94953e850 1 há 1 ano
  ZhaoGang 70e6844d9e 成都旅游学院项目修改所在文件夹名称。 há 1 ano
  ZhaoGang 5f343e3671 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang ad732e6d30 新增全局流程变量监控页面。 há 1 ano
  pry b692557aa6 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 70b008a545 1 há 1 ano
  Mr_z 0aafdb6434 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  Mr_z a2dc345f4a 多桶配料 há 1 ano
  pry c8f3eece23 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 347fedfd0f 1 há 1 ano
  Mr_z f9ee456b27 冲突解决 há 1 ano
  Mr_z 12627e7fbf 调试更新 há 1 ano
  ZhaoGang 8e1e6b47e7 配方ID改为自动生成。 há 1 ano
  ZhaoGang 504ab28c9c Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 5bad282b21 修改配方数据,新增配方下发。 há 1 ano
  pry 5d34b83083 包管理更新 há 1 ano
  pry c44d1bffb0 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 40cf72d7bc 模拟配方提添加 há 1 ano
  ZhaoGang 3c21143479 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 66c36ec461 修改配方Model类命名。 há 1 ano
  pry 449897d2ac 模拟工艺添加 há 1 ano
  pry c9a7ab810f 1 há 1 ano
  pry 427d4bf586 1 há 1 ano
  pry b1fed931f6 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 99a6ee5665 通讯组件修改 há 1 ano
  ZhaoGang 4097d8467e Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 9b2e950537 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry f4f1942a4a 包更新 há 1 ano
  ZhaoGang 9180d06f96 新增物料信息编辑弹框。 há 1 ano
  pry c529755e85 包更新 há 1 ano
  pry e5d441d1a9 1 há 1 ano
  Mr_z 32f1fe0610 1 há 1 ano
  Mr_z dce9473191 冲突解决 há 1 ano
  pry 80e2fe8717 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 8aab8e3ef7 调整修改 há 1 ano
  ZhaoGang 9868bee14f Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 636e629590 配方管理页面添加命令并做基本测试。 há 1 ano
  pry 3fe73c2ca0 配料系统调试 há 1 ano
  pry 9728ceb17f 1 há 1 ano
  pry acdb8baaba 包更新 há 1 ano
  Mr_z 66bd28605a 冲突解决 há 1 ano
  pry d3055b8843 变量监控添加 há 1 ano
  pry 694604c4f0 通讯库验证更新 há 1 ano
  pry 0e0636890e Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 75089fd056 机器人模型添加 há 1 ano
  ZhaoGang ca33e181bc Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang ed15d6ce45 修改功能编辑页面。 há 1 ano
  pry 3cddfb6317 炒锅通讯添加 há 1 ano
  pry cea0a5938f Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 1227494131 控制修改 há 1 ano
  ZhaoGang 4fddadf09d Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang df6984415e 修改配方管理界面。 há 1 ano
  pry 34ad8dc9a3 原料管理 há 1 ano
  Nah 8639cbf8ad 1 há 1 ano
  ZhaoGang 37c1a5233e 修改命名空间 há 1 ano
  ZhaoGang 4c11e4b2e8 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang 2c7dbd78d5 调整添加原料页面 há 1 ano
  pry 63e4cac92c 1 há 1 ano
  pry 794c948e66 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 8b7d0947fb 基础配置 há 1 ano
  ZhaoGang 3f25e86d5c Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  ZhaoGang d95a182dcc 添加页面 há 1 ano
  pry c9b2be01e1 物料信息添加 há 1 ano
  pry 11fea40c27 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 72913d6a55 框架搭建 há 1 ano
  ZhaoGang 5a1414b09e 添加依赖 há 1 ano
  ZhaoGang 4f58ecaa3c 新增页面 há 1 ano
  ZhaoGang 6a6b515f8b 新增页面 há 1 ano
  pry b0784c0873 1 há 1 ano
  ZhaoGang 5bb2b54c95 旅游学院修改为单机设备框架。 há 1 ano
  ZhaoGang cff11e553d 1 há 1 ano
  ZhaoGang a9adfffb50 新增页面 há 1 ano
  pry 70aba46ed1 1 há 1 ano
  pry d007bcd0e0 1 há 1 ano
  pry 0973051ff3 Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration há 1 ano
  pry 04f275ff32 同步更新 há 1 ano
  ZhaoGang 03d0215060 修改大料站原料厂显示顺序。 há 1 ano
  pry 03d5d98f53 1 há 1 ano
  pry e16afc9d10 分支调整合并 há 1 ano
  pry 26eb67ee22 1 há 1 ano
  pry 7af9b8718c 1 há 1 ano
  pry 3b2a26493f 1 há 1 ano
  pry 746fe78e5b 1 há 1 ano
  pry 8bfe9b27c8 1 há 1 ano
  pry 8d95c34a50 1 há 1 ano
  pry a97d4951d2 1 há 1 ano
  pry 23bedc9078 1 há 1 ano
  pry 6af72a3522 1 há 1 ano
  pry c8c0f36f13 1 há 1 ano
  pry 4a1540a10f 1 há 1 ano
  pry 06321117c7 1 há 1 ano
  pry 70ca161975 1 há 1 ano
  pry d3b20a58a4 1 há 1 ano
100 ficheiros alterados com 626 adições e 631 eliminações
  1. +7
    -0
      BPASmartClient.AliyunIot/AliyunIot.cs
  2. +9
    -0
      BPASmartClient.AliyunIot/BPASmartClient.AliyunIot.csproj
  3. +1
    -3
      BPASmartClient.Business/BPASmartClient.Business.csproj
  4. +2
    -2
      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. +5
    -6
      BPASmartClient.Business/Plugin/DeviceMgr.cs
  9. +27
    -22
      BPASmartClient.Business/Plugin/MQTTMgr.cs
  10. +38
    -32
      BPASmartClient.Business/Plugin/OrderProxy.cs
  11. +1
    -1
      BPASmartClient.Business/Plugin/Plugin.cs
  12. +6
    -6
      BPASmartClient.Business/Plugin/StatusMgr.cs
  13. +1
    -1
      BPASmartClient.Business/TopicDefine.cs
  14. +7
    -7
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  15. BIN
     
  16. +14
    -137
      BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs
  17. +7
    -7
      BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs
  18. +4
    -4
      BPASmartClient.CustomResource/Pages/Model/MenuManage.cs
  19. +16
    -8
      BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
  20. +4
    -3
      BPASmartClient.CustomResource/Pages/Model/NfcServer.cs
  21. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoManage.cs
  22. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/PlcVariableInfoModel.cs
  23. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/ProductionDataHelper.cs
  24. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/RecipeCompleteLog.cs
  25. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/ReportBase.cs
  26. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/ReportHelper.cs
  27. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/ReportTestModel.cs
  28. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/RunLog.cs
  29. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserInfo.cs
  30. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserLog.cs
  31. +2
    -2
      BPASmartClient.CustomResource/Pages/Model/UserTreeViewModel.cs
  32. +3
    -2
      BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs
  33. +1
    -1
      BPASmartClient.CustomResource/Pages/View/AddNewUser.xaml.cs
  34. +1
    -1
      BPASmartClient.CustomResource/Pages/View/LoginView.xaml.cs
  35. +12
    -2
      BPASmartClient.CustomResource/Pages/View/MainView.xaml
  36. +10
    -2
      BPASmartClient.CustomResource/Pages/View/MainView.xaml.cs
  37. +1
    -1
      BPASmartClient.CustomResource/Pages/View/NfcSetView.xaml.cs
  38. +1
    -1
      BPASmartClient.CustomResource/Pages/View/PasswordChangeView.xaml.cs
  39. +1
    -1
      BPASmartClient.CustomResource/Pages/View/SubPagLoginView.xaml.cs
  40. +1
    -1
      BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml.cs
  41. +9
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/AddNewUserViewModel.cs
  42. +10
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs
  43. +3
    -3
      BPASmartClient.CustomResource/Pages/ViewModel/DebugLogViewModel.cs
  44. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
  45. +42
    -34
      BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs
  46. +11
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
  47. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
  48. +2
    -2
      BPASmartClient.CustomResource/Pages/ViewModel/PermissionConfigurationViewModel.cs
  49. +2
    -2
      BPASmartClient.CustomResource/Pages/ViewModel/ProductionDataViewModel.cs
  50. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs
  51. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs
  52. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
  53. +26
    -26
      BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs
  54. +8
    -8
      BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
  55. +11
    -11
      BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs
  56. +13
    -13
      BPASmartClient.CustomResource/Pages/ViewModel/UserManagerViewModel.cs
  57. +6
    -6
      BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs
  58. +3
    -3
      BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml
  59. +2
    -2
      BPASmartClient.CustomResource/UserControls/IcoButton.cs
  60. +42
    -43
      BPASmartClient.DRCoffee/CoffeeMachine.cs
  61. +8
    -7
      BPASmartClient.DRCoffee/CommandHandler.cs
  62. +2
    -2
      BPASmartClient.DRCoffee/MorkCStatus.cs
  63. +6
    -7
      BPASmartClient.Device/AlarmHelper.cs
  64. +0
    -1
      BPASmartClient.Device/BPASmartClient.Device.csproj
  65. +31
    -23
      BPASmartClient.Device/BaseDevice.cs
  66. +1
    -1
      BPASmartClient.Device/IDevice.cs
  67. +2
    -2
      BPASmartClient.Device/VariableMonitor.cs
  68. +55
    -1
      BPASmartClient.Device/VariableMonitorAttribute.cs
  69. +3
    -3
      BPASmartClient.DosingSystemSingle/App.xaml.cs
  70. +1
    -1
      BPASmartClient.DosingSystemSingle/BPASmartClient.DosingSystemSingle.csproj
  71. +4
    -4
      BPASmartClient.DosingSystemSingle/Model/DeviceInquire.cs
  72. +2
    -2
      BPASmartClient.DosingSystemSingle/Service/SiemensDevice.cs
  73. +1
    -1
      BPASmartClient.DosingSystemSingle/View/HardwareStatusView.xaml.cs
  74. +1
    -1
      BPASmartClient.DosingSystemSingle/View/ManualControlView.xaml.cs
  75. +1
    -1
      BPASmartClient.DosingSystemSingle/View/NewMaterialView.xaml.cs
  76. +1
    -1
      BPASmartClient.DosingSystemSingle/ViewModel/HardwareStatusViewModel.cs
  77. +1
    -1
      BPASmartClient.DosingSystemSingle/ViewModel/ManualControlViewModel.cs
  78. +2
    -2
      BPASmartClient.DosingSystemSingle/ViewModel/RecipeControlViewModel.cs
  79. +0
    -4
      BPASmartClient.EventBus/BPASmartClient.EventBus.csproj
  80. +3
    -3
      BPASmartClient.FoodStationTest/App.xaml.cs
  81. +1
    -1
      BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj
  82. +2
    -2
      BPASmartClient.FoodStationTest/Model/Bom/BomMaterial.cs
  83. +2
    -2
      BPASmartClient.FoodStationTest/Model/GVL/PlcInfos.cs
  84. +2
    -2
      BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceStatus.cs
  85. +2
    -2
      BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs
  86. +9
    -9
      BPASmartClient.FoodStationTest/Model/ProcessControl.cs
  87. +2
    -2
      BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceCurrentStatus.cs
  88. +14
    -14
      BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs
  89. +2
    -2
      BPASmartClient.FoodStationTest/Model/RawMaterial/DevicePar.cs
  90. +2
    -2
      BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceParModel.cs
  91. +2
    -2
      BPASmartClient.FoodStationTest/Model/RawMaterial/RawMaterialColl.cs
  92. +2
    -2
      BPASmartClient.FoodStationTest/Model/RawMaterial/RawMaterialStockBin.cs
  93. +2
    -2
      BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeModel.cs
  94. +2
    -2
      BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs
  95. +2
    -2
      BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeRawMaterial.cs
  96. +1
    -1
      BPASmartClient.FoodStationTest/View/ChangeDeviceNameView.xaml.cs
  97. +1
    -1
      BPASmartClient.FoodStationTest/View/NewLocalRecipeView.xaml.cs
  98. +1
    -1
      BPASmartClient.FoodStationTest/View/NewRecipeView.xaml.cs
  99. +1
    -1
      BPASmartClient.FoodStationTest/View/RecipeInfosView.xaml.cs
  100. +1
    -1
      BPASmartClient.FoodStationTest/View/SelectRecipesView.xaml.cs

+ 7
- 0
BPASmartClient.AliyunIot/AliyunIot.cs Ver ficheiro

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

}
}

+ 9
- 0
BPASmartClient.AliyunIot/BPASmartClient.AliyunIot.csproj Ver ficheiro

@@ -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 Ver ficheiro

@@ -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>

+ 2
- 2
BPASmartClient.Business/InternetInfo.cs Ver ficheiro

@@ -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;


+ 15
- 8
BPASmartClient.Business/LocalMqtt.cs Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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);


+ 5
- 6
BPASmartClient.Business/Plugin/DeviceMgr.cs Ver ficheiro

@@ -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);
@@ -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)
{


+ 27
- 22
BPASmartClient.Business/Plugin/MQTTMgr.cs Ver ficheiro

@@ -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>();

@@ -43,30 +43,35 @@ namespace BPASmartClient.Business
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 +93,7 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, "MQTT 消息处理", true);
}, "MQTT 消息处理", isRestart: true);
}

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



+ 38
- 32
BPASmartClient.Business/Plugin/OrderProxy.cs Ver ficheiro

@@ -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)
{
@@ -136,12 +136,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 +164,7 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, $"MQTT 订单接收处理-设备[{deviceId}]", true);
}, $"MQTT 订单接收处理-设备[{deviceId}]", isRestart: true);
}

public void OrderStatusChangedHandle(IEvent @event, EventCallBackHandle callBack)
@@ -179,36 +179,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 Ver ficheiro

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


+ 6
- 6
BPASmartClient.Business/Plugin/StatusMgr.cs Ver ficheiro

@@ -1,5 +1,5 @@
using BPA.Message;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -33,7 +33,7 @@ namespace BPASmartClient.Business
public void Start()
{
running = true;
ThreadManage.GetInstance().Start(() =>
TaskManage.GetInstance.Start(() =>
{
while (running)
{
@@ -44,11 +44,11 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, "设备状态收集", true);
}, "设备状态收集", isRestart: true);

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

ThreadManage.GetInstance().Start(() =>
TaskManage.GetInstance.Start(() =>
{
while (running)
{
@@ -59,13 +59,13 @@ namespace BPASmartClient.Business

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 Ver ficheiro

@@ -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;


+ 7
- 7
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj Ver ficheiro

@@ -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>
@@ -25,6 +29,7 @@
<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" />
@@ -317,6 +322,7 @@
<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" />
@@ -459,14 +465,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 +642,4 @@
</EmbeddedResource>
</ItemGroup>

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

</Project>


+ 14
- 137
BPASmartClient.CustomResource/Pages/Model/AlarmHelper.cs Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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>
/// 子菜单名称


+ 16
- 8
BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs Ver ficheiro

@@ -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);
}


+ 4
- 3
BPASmartClient.CustomResource/Pages/Model/NfcServer.cs Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

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


+ 12
- 2
BPASmartClient.CustomResource/Pages/View/MainView.xaml Ver ficheiro

@@ -432,6 +432,13 @@
</Window.Resources>

<Grid Background="#103153">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="764*" />
<ColumnDefinition Width="104*" />
<ColumnDefinition Width="28*" />
<ColumnDefinition Width="41*" />
<ColumnDefinition Width="263*" />
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
<RowDefinition Height="50" />
@@ -441,8 +448,9 @@
<!--#region 标题栏设置-->
<Border
x:Name="MoveBorder"
Grid.ColumnSpan="5"
Height="50"
VerticalAlignment="Top"
VerticalAlignment="Center"
Background="#0C2349"
BorderBrush="#55ffffff"
BorderThickness="0,0,0,1">
@@ -463,8 +471,10 @@
</Border>

<UniformGrid
Grid.Column="4"
Width="150"
Height="50"
Margin="113,0,0,0"
HorizontalAlignment="Right"
Columns="3">
<Button
@@ -490,7 +500,7 @@

<!--#region 显示区设置-->

<Grid Grid.Row="1">
<Grid Grid.Row="1" Grid.ColumnSpan="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition />


+ 10
- 2
BPASmartClient.CustomResource/Pages/View/MainView.xaml.cs Ver ficheiro

@@ -1,4 +1,5 @@
using System;
using BPASmartClient.CustomResource.Pages.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -30,7 +31,14 @@ namespace BPASmartClient.CustomResource.Pages.View
this.WindowState = WindowState.Maximized;
this.ButMin.Click += (o, e) => { this.WindowState = WindowState.Minimized; };
this.ButMax.Click += (o, e) => { this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; };
this.ButClose.Click += (o, e) => { this.Close(); Application.Current.Shutdown(); };
this.ButClose.Click += (o, e) =>
{
if (MessageNotify.GetInstance.ShowDialog("确认关闭上位机?", DialogType.Warning))
{
this.Close();
Application.Current.Shutdown();
}
};
this.MoveBorder.MouseLeftButtonDown += (o, e) =>
{
if (e.ClickCount > 1)


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

@@ -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 Ver ficheiro

@@ -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/SubPagLoginView.xaml.cs Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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;


+ 3
- 3
BPASmartClient.CustomResource/RecDictionarys/RecIcoButtonStyle.xaml Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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>


+ 31
- 23
BPASmartClient.Device/BaseDevice.cs Ver ficheiro

@@ -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
{
@@ -118,7 +116,7 @@ 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; }
@@ -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); }
}
@@ -186,7 +184,7 @@ namespace BPASmartClient.Device

public virtual void StartMain()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
int i = 0;
foreach (var peripheral in peripherals)
@@ -316,7 +314,7 @@ namespace BPASmartClient.Device
DeleteErrorAction?.Invoke(DeviceId, res);
}
});
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
AlarmMonitoring();
Thread.Sleep(500);
@@ -352,15 +350,19 @@ 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");
ResetProgram();
@@ -378,7 +380,7 @@ namespace BPASmartClient.Device
private void InitTask()
{
#region 数据读取
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
ReadData();
Thread.Sleep(10);
@@ -386,7 +388,7 @@ namespace BPASmartClient.Device
#endregion

#region 任务流程
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
MainTask();
Thread.Sleep(10);
@@ -394,7 +396,7 @@ namespace BPASmartClient.Device
#endregion

#region 设备状态监控
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
UpdateValue(InterfaceStatus);
Thread.Sleep(1000);
@@ -408,6 +410,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 +430,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 +453,9 @@ namespace BPASmartClient.Device
TempPlcAddress = $"M{plc[0]}.{plc[1]}";
}

variableMonitors.Add(new VariableMonitor()
vm.Add(new VariableMonitor()
{
Id = variableMonitors.Count,
Id = vm.Count,
VarName = $"{item.Name}_{i + 1}",
Notes = $"{notes}_{i + 1}",
ModbusTcpAddress = $"{int.Parse(modadd) + i}",
@@ -470,12 +473,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,
VarName = $"{item.Name}_{i + 1}",
Notes = $"{notes}_{i + 1}",

@@ -487,12 +490,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,
VarName = item.Name,
Notes = notes,
ModbusTcpAddress = modadd,
@@ -504,6 +507,11 @@ namespace BPASmartClient.Device

}
}

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

}

/// <summary>


+ 1
- 1
BPASmartClient.Device/IDevice.cs Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

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


+ 1
- 1
BPASmartClient.DosingSystemSingle/ViewModel/HardwareStatusViewModel.cs Ver ficheiro

@@ -35,7 +35,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel
// }
// }
//});
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
for (int i = 0; i < Json<DevicePar>.Data.OutletInfoModels.Count; i++)
{


+ 1
- 1
BPASmartClient.DosingSystemSingle/ViewModel/ManualControlViewModel.cs Ver ficheiro

@@ -113,7 +113,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel
ModelSwitchText = res ? "自动" : "手动";*/
});

ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
for (int i = 0; i < cylinderModels.Count; i++)
{


+ 2
- 2
BPASmartClient.DosingSystemSingle/ViewModel/RecipeControlViewModel.cs Ver ficheiro

@@ -97,7 +97,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel
/// </summary>
private void RecipeRun()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (RecipeNames.Count > 0)
{
@@ -200,7 +200,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel
/// </summary>
private void RecipeStatusInquire()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
for (int i = 0; i < Recipes.Count; i++)
{


+ 0
- 4
BPASmartClient.EventBus/BPASmartClient.EventBus.csproj Ver ficheiro

@@ -6,8 +6,4 @@
<Nullable>enable</Nullable>
</PropertyGroup>

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

</Project>

+ 3
- 3
BPASmartClient.FoodStationTest/App.xaml.cs Ver ficheiro

@@ -2,7 +2,7 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.Pages.View;
using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.ObjectModel;
using System.Threading;
@@ -28,7 +28,7 @@ namespace BPASmartClient.FoodStationTest
App.Current.Shutdown();
Environment.Exit(0);
}
BPASmartClient.Helper.SystemHelper.GetInstance.CreateDesktopShortcut();
SystemHelper.GetInstance.CreateDesktopShortcut();
base.OnStartup(e);

MenuInit();
@@ -66,7 +66,7 @@ namespace BPASmartClient.FoodStationTest
Json<LocalRecipeDataColl>.Save();
Json<RemoteRecipeDataColl>.Save();
MessageNotify.GetInstance.LogSave();
ThreadManage.GetInstance().Dispose();
TaskManage.GetInstance.Dispose();
}

private void MenuInit()


+ 1
- 1
BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj Ver ficheiro

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

<ItemGroup>
<PackageReference Include="BPA.Communication" Version="1.0.105" />
<PackageReference Include="BPA.Communication" Version="1.0.116" />
</ItemGroup>

<ItemGroup>


+ 2
- 2
BPASmartClient.FoodStationTest/Model/Bom/BomMaterial.cs Ver ficheiro

@@ -1,8 +1,8 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model.Bom
{
public class BomMaterial : ObservableObject
public class BomMaterial : NotifyBase
{
public int Count { get { return _count; } set { _count = value; OnPropertyChanged(); } }
public int _count { get; set; }


+ 2
- 2
BPASmartClient.FoodStationTest/Model/GVL/PlcInfos.cs Ver ficheiro

@@ -1,11 +1,11 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model.GVL
{
/// <summary>
/// PLC变量信息
/// </summary>
public class PlcInfos : ObservableObject
public class PlcInfos : NotifyBase
{
/// <summary>
/// 变量序号


+ 2
- 2
BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceStatus.cs Ver ficheiro

@@ -1,5 +1,5 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.ObjectModel;
using System.Threading;
@@ -13,7 +13,7 @@ namespace BPASmartClient.FoodStationTest.Model.HK_PLC
public PlcReadAddressDB45 DeviceStatus = new PlcReadAddressDB45();
public void Init()
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (IsConnected)
{


+ 2
- 2
BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs Ver ficheiro

@@ -1,11 +1,11 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model.Par
{
/// <summary>
/// 连接参数设置。
/// </summary>
public class ConnectParMode : ObservableObject
public class ConnectParMode : NotifyBase
{
/// <summary>
/// 海科PLC是否连接


+ 9
- 9
BPASmartClient.FoodStationTest/Model/ProcessControl.cs Ver ficheiro

@@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.FoodStationTest.Model.GVL;
using BPASmartClient.FoodStationTest.Model.HK_PLC;
using BPASmartClient.FoodStationTest.Model.RawMaterial;
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -68,7 +68,7 @@ namespace BPASmartClient.FoodStationTest.Model
RegisterInit();
DeviceConnect();
//Json<RemoteRecipeDataColl>.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
GVL_SmallStation.GetInstance.DisEnableStockAlarm = Json<DevicePar>.Data.deviceConnectPar.ShieldStockbinAlarm;
if (HKDevice.IsConnected)
@@ -91,7 +91,7 @@ namespace BPASmartClient.FoodStationTest.Model
}
Thread.Sleep(200);
}), "海科plc通信心跳", true);
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (GVL_SmallStation.GetInstance.Order_Cancel)
{
@@ -104,13 +104,13 @@ namespace BPASmartClient.FoodStationTest.Model
}
Thread.Sleep(10);
}), "小料站流程控制", true);
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
RealTimeData();

Thread.Sleep(10);
}), "西门子PLC和小料站PLC的实时数据交互流程", true);
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
HKPlcRead();
GetStatus();
@@ -586,7 +586,7 @@ namespace BPASmartClient.FoodStationTest.Model
indexArr = Array.FindIndex(GVL_SmallStation.GetInstance.plcReadDataDB3.Recipe5BarrelPosReserve.ToArray(), p => p == i);
break;
}
if (indexArr >= 0 && GVL_SmallStation.GetInstance.StockBinDosingIssue[recipeNum].Get16bitValue((byte)i) == false)
if (indexArr >= 0 && GVL_SmallStation.GetInstance.StockBinDosingIssue[recipeNum].GetBitValue((byte)i) == false)
{
//查找每个料仓对应的重量。
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i);
@@ -626,7 +626,7 @@ namespace BPASmartClient.FoodStationTest.Model
{
//MessageNotify.GetInstance.ShowRunLog($"错误,有允许配料信号,但没有相应的位置 和桶号");
}
if ((DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) && indexArr >= 0 && GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum].Get16bitValue((byte)i))
if ((DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) && indexArr >= 0 && GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum].GetBitValue((byte)i))
{
//配料完成处理。
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i);
@@ -684,7 +684,7 @@ namespace BPASmartClient.FoodStationTest.Model
{
for (int i = 1; i < 17; i++)
{
if (GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum].Get16bitValue((byte)i))
if (GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeNum].GetBitValue((byte)i))
{
MessageNotify.GetInstance.ShowRunLog($"料仓配料完成,但存在料仓未配料:{i}号仓");
}
@@ -1176,7 +1176,7 @@ namespace BPASmartClient.FoodStationTest.Model
MessageNotify.GetInstance.ShowRunLog("海科plc初始化完成");
}

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


+ 2
- 2
BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceCurrentStatus.cs Ver ficheiro

@@ -1,11 +1,11 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model
{
/// <summary>
/// 味魔方当前状态。
/// </summary>
public class DeviceCurrentStatus : ObservableObject
public class DeviceCurrentStatus : NotifyBase
{

public double Weight { get { return _mWeight; } set { _mWeight = value; OnPropertyChanged(); } }


+ 14
- 14
BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs Ver ficheiro

@@ -1,7 +1,7 @@
using BPA.Communication;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.FoodStationTest.ViewModel;
using BPASmartClient.Helper;
using BPA.Helper;
using BPASmartClient.Model;
using System;
using System.Collections.Concurrent;
@@ -33,7 +33,7 @@ namespace BPASmartClient.FoodStationTest.Model
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++)
{
@@ -57,7 +57,7 @@ namespace BPASmartClient.FoodStationTest.Model
{
devices.ElementAt(deviceIndex).DeviceName = DeviceLists.ElementAt(i).Value.DeviceName;
}
if (!ThreadManage.GetInstance().IsContainsKey($"{deviceName} 开始监听"))
if (!TaskManage.GetInstance.IsContainsKey($"{deviceName} 开始监听"))
{
DeviceLists[DeviceLists.ElementAt(i).Key].Init(deviceName);
}
@@ -111,7 +111,7 @@ namespace BPASmartClient.FoodStationTest.Model
//TestData();
IpAddressLines();
DeviceDataInit();
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (IPQueues.Count >= IPLists.Count)
IpAddressLines();
@@ -185,7 +185,7 @@ namespace BPASmartClient.FoodStationTest.Model
DeviceStatus DS = new DeviceStatus();
DS.modbusTcp.IsReconnect = false;

DS.modbusTcp.ConnectOk = new Action(() =>
DS.modbusTcp.Connected = new Action(() =>
{
string DeviceName = DS.modbusTcp.Read<string>(DeviceAddress.DeviceName, 20).Content.Trim()?.Replace(" ", "");//读取设备名称
if (DeviceName.Length > 0)
@@ -318,7 +318,7 @@ namespace BPASmartClient.FoodStationTest.Model
/// <summary>
/// ModbusTcp的地址。
/// </summary>
public string IpAddress=> modbusTcp.GetConfigPar().IpAddress;
public string IpAddress => modbusTcp.GetConfigPar().IpAddress;
/// <summary>
/// 设备状态
/// </summary>
@@ -338,7 +338,7 @@ namespace BPASmartClient.FoodStationTest.Model
//AlarmHelper<AlarmInfo>.Init();
if (modbusTcp.IsConnected())
{
ThreadManage.GetInstance().StartLong(new Action(() =>
TaskManage.GetInstance.StartLong(new Action(() =>
{
if (modbusTcp.IsConnected())
{
@@ -347,12 +347,12 @@ namespace BPASmartClient.FoodStationTest.Model
deviceStatus.NowWeightFeedback = this.modbusTcp.Read<float>(DeviceAddress.CutWeightFeedback).Content;//获取下料重量
deviceStatus.DeviceNum = (ushort)this.modbusTcp.Read<ushort>(DeviceAddress.DeviceNum).Content;//获取设备编号
deviceStatus.DeviceAlarmCode = (ushort)this.modbusTcp.Read<ushort>(DeviceAddress.DeviceAlarmCode).Content;//获取设备故障编码
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1 = deviceStatus.DeviceAlarmCode.Get16bitValue(1);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo = deviceStatus.DeviceAlarmCode.Get16bitValue(2);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Inverter = deviceStatus.DeviceAlarmCode.Get16bitValue(3);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2 = deviceStatus.DeviceAlarmCode.Get16bitValue(7);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(8);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit = deviceStatus.DeviceAlarmCode.Get16bitValue(9);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop1 = deviceStatus.DeviceAlarmCode.GetBitValue(1);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Servo = deviceStatus.DeviceAlarmCode.GetBitValue(2);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).Inverter = deviceStatus.DeviceAlarmCode.GetBitValue(3);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).EStop2 = deviceStatus.DeviceAlarmCode.GetBitValue(7);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloUpperLimit = deviceStatus.DeviceAlarmCode.GetBitValue(8);
AlarmHelper<AlarmInfo>.GetInstance(DeviceName).SiloLowerLimit = deviceStatus.DeviceAlarmCode.GetBitValue(9);
//允许配料即产线气缸抬起,发送给味魔方
if (deviceStatus.DeviceNum >= 1 && deviceStatus.DeviceNum <= 15)
{
@@ -402,7 +402,7 @@ namespace BPASmartClient.FoodStationTest.Model

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

/// <summary>


+ 2
- 2
BPASmartClient.FoodStationTest/Model/RawMaterial/DevicePar.cs Ver ficheiro

@@ -1,12 +1,12 @@
using BPASmartClient.FoodStationTest.Model.Bom;
using BPASmartClient.FoodStationTest.Model.Par;
using BPASmartClient.FoodStationTest.Model.RawMaterial;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.ObjectModel;

namespace BPASmartClient.FoodStationTest.Model
{
public class DevicePar : ObservableObject
public class DevicePar : NotifyBase
{
public ObservableCollection<DeviceParMode> deviceParModels { get; set; } = new ObservableCollection<DeviceParMode>();
public ConnectParMode deviceConnectPar { get { return _mdeviceConnectPar; } set { _mdeviceConnectPar = value; OnPropertyChanged(); } }


+ 2
- 2
BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceParModel.cs Ver ficheiro

@@ -1,8 +1,8 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model
{
public class DeviceParMode : ObservableObject
public class DeviceParMode : NotifyBase
{

/// <summary>


+ 2
- 2
BPASmartClient.FoodStationTest/Model/RawMaterial/RawMaterialColl.cs Ver ficheiro

@@ -1,8 +1,8 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model.RawMaterial
{
public class RawMaterialColl : ObservableObject
public class RawMaterialColl : NotifyBase
{
/// <summary>
/// 原料设备IP


+ 2
- 2
BPASmartClient.FoodStationTest/Model/RawMaterial/RawMaterialStockBin.cs Ver ficheiro

@@ -1,8 +1,8 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model.RawMaterial
{
public class RawMaterialStockBin : ObservableObject
public class RawMaterialStockBin : NotifyBase
{

public short RawMaterialCount { get { return _mRawMaterialCount; } set { _mRawMaterialCount = value; OnPropertyChanged(); } }


+ 2
- 2
BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeModel.cs Ver ficheiro

@@ -1,5 +1,5 @@
using BPASmartClient.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.ObjectModel;
using System.Threading;

@@ -8,7 +8,7 @@ namespace BPASmartClient.FoodStationTest.Model
/// <summary>
/// 配方模块
/// </summary>
public class RecipeModel : ObservableObject
public class RecipeModel : NotifyBase
{
[Newtonsoft.Json.JsonIgnore]
public bool IsEnable { get { return _mIsEnable; } set { _mIsEnable = value; OnPropertyChanged(); } }


+ 2
- 2
BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs Ver ficheiro

@@ -1,4 +1,4 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;
using System.Collections.ObjectModel;

namespace BPASmartClient.FoodStationTest.Model
@@ -7,7 +7,7 @@ namespace BPASmartClient.FoodStationTest.Model
/// <summary>
/// 远程配方数据。
/// </summary>
public class RemoteRecipeData : ObservableObject
public class RemoteRecipeData : NotifyBase
{
/// <summary>
/// 配方名称


+ 2
- 2
BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeRawMaterial.cs Ver ficheiro

@@ -1,8 +1,8 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;
using BPA.Helper;

namespace BPASmartClient.FoodStationTest.Model
{
public class RemoteRecipeRawMaterial : ObservableObject
public class RemoteRecipeRawMaterial : NotifyBase
{
public int DeviceIp { get { return _mIp; } set { _mIp = value; } }
private int _mIp;


+ 1
- 1
BPASmartClient.FoodStationTest/View/ChangeDeviceNameView.xaml.cs Ver ficheiro

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Windows;
using System.Windows.Input;


+ 1
- 1
BPASmartClient.FoodStationTest/View/NewLocalRecipeView.xaml.cs Ver ficheiro

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Windows;
using System.Windows.Input;


+ 1
- 1
BPASmartClient.FoodStationTest/View/NewRecipeView.xaml.cs Ver ficheiro

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Windows;
using System.Windows.Input;


+ 1
- 1
BPASmartClient.FoodStationTest/View/RecipeInfosView.xaml.cs Ver ficheiro

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Windows;
using System.Windows.Input;


+ 1
- 1
BPASmartClient.FoodStationTest/View/SelectRecipesView.xaml.cs Ver ficheiro

@@ -1,4 +1,4 @@
using BPASmartClient.Helper;
using BPA.Helper;
using System;
using System.Windows;
using System.Windows.Input;


Alguns ficheiros não foram mostrados porque foram alterados demasiados ficheiros neste diff

Carregando…
Cancelar
Guardar