pry 1 anno fa
parent
commit
6af72a3522
100 ha cambiato i file con 376 aggiunte e 366 eliminazioni
  1. +1
    -0
      BPASmartClient.Business/BPASmartClient.Business.csproj
  2. +1
    -1
      BPASmartClient.Business/InternetInfo.cs
  3. +16
    -9
      BPASmartClient.Business/LocalMqtt.cs
  4. +1
    -2
      BPASmartClient.Business/MainConsole.cs
  5. +1
    -1
      BPASmartClient.Business/Plugin/ConfigMgr.cs
  6. +1
    -1
      BPASmartClient.Business/Plugin/DeviceMgr.cs
  7. +21
    -20
      BPASmartClient.Business/Plugin/MQTTMgr.cs
  8. +4
    -4
      BPASmartClient.Business/Plugin/OrderProxy.cs
  9. +5
    -5
      BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs
  10. +4
    -4
      BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs
  11. +1
    -1
      BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs
  12. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs
  13. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs
  14. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs
  15. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs
  16. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs
  17. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs
  18. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs
  19. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs
  20. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs
  21. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs
  22. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs
  23. +1
    -1
      BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs
  24. +38
    -39
      BPASmartClient.DRCoffee/CoffeeMachine.cs
  25. +7
    -6
      BPASmartClient.DRCoffee/CommandHandler.cs
  26. +5
    -6
      BPASmartClient.Device/AlarmHelper.cs
  27. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/BomOfMaterialViewModel.cs
  28. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs
  29. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/DeviceListViewModel.cs
  30. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/DeviceMaterialParViewModel.cs
  31. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/ManualCommViewModel.cs
  32. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs
  33. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/ManualFlowViewModel.cs
  34. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/NewLocalRecipeViewModel.cs
  35. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/NewMaterialViewModel.cs
  36. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs
  37. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs
  38. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/RecipeInfosViewModel.cs
  39. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs
  40. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs
  41. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/SelectRecipesViewModel.cs
  42. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/SiemensRecipeReceiveViewModel.cs
  43. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/StockBinRawMaterialViewModel.cs
  44. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs
  45. +5
    -4
      BPASmartClient.GSIceCream/CommandHandler.cs
  46. +5
    -5
      BPASmartClient.GSIceCream/IceCreamMachine.cs
  47. +1
    -1
      BPASmartClient.GSIceCream/MorkIStatus.cs
  48. +1
    -1
      BPASmartClient.Helper/ActionManage.cs
  49. +1
    -1
      BPASmartClient.Helper/ExcelHelper.cs
  50. +1
    -1
      BPASmartClient.Helper/SystemHelper.cs
  51. +1
    -1
      BPASmartClient.Helper/ThreadManage.cs
  52. +22
    -22
      BPASmartClient.IceMaker/IceMakerMachine.cs
  53. +1
    -1
      BPASmartClient.IoT/DataVClient.cs
  54. +1
    -1
      BPASmartClient.IoT/Model/FileUpload.cs
  55. +25
    -25
      BPASmartClient.JAKA/JakaMachine.cs
  56. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/BomOfMaterialViewModel.cs
  57. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/ChangeDeviceNameViewModel.cs
  58. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/DeviceManageViewModel.cs
  59. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs
  60. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs
  61. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs
  62. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs
  63. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs
  64. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs
  65. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/SelectRecipesViewModel.cs
  66. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs
  67. +1
    -1
      BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs
  68. +1
    -1
      BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs
  69. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/BomOfMaterialViewModel.cs
  70. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs
  71. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs
  72. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceMaterialParViewModel.cs
  73. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs
  74. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/ManualCommViewModel.cs
  75. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/ManualControlViewModel.cs
  76. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs
  77. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs
  78. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs
  79. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs
  80. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs
  81. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs
  82. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
  83. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs
  84. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/RobotViewModel.cs
  85. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs
  86. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs
  87. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/StockBinRawMaterialViewModel.cs
  88. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/SystemParViewModel.cs
  89. +1
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/WindSendParViewModel.cs
  90. +2
    -2
      BPASmartClient.Juicer/JuicerMachine.cs
  91. +1
    -1
      BPASmartClient.KHKJ/KHKJMachine.cs
  92. +75
    -75
      BPASmartClient.KLMCoffee/CoffeeMachine.cs
  93. +13
    -12
      BPASmartClient.Lebai/LebaiRobot.cs
  94. +1
    -1
      BPASmartClient.LebaiRobot/LebaiHelper.cs
  95. +4
    -3
      BPASmartClient.MCU/MCUMachine.cs
  96. +3
    -2
      BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs
  97. +38
    -39
      BPASmartClient.MilkTeaCube/MilkTeaCubeMachine.cs
  98. +1
    -1
      BPASmartClient.MilkWithTea/MainWindow.xaml.cs
  99. +3
    -3
      BPASmartClient.MilkWithTea/ViewModel/MainControlViewModel.cs
  100. +1
    -1
      BPASmartClient.MilkWithTea/ViewModel/PatrameterSettiongViewModel.cs

+ 1
- 0
BPASmartClient.Business/BPASmartClient.Business.csproj Vedi File

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

<ItemGroup>
<PackageReference Include="BPA.ApolloClient" Version="1.0.12" />
<PackageReference Include="BPA.Communication" Version="1.0.106" />
<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" />


+ 1
- 1
BPASmartClient.Business/InternetInfo.cs Vedi File

@@ -8,7 +8,7 @@ using System.IO;
using Microsoft.Extensions.Configuration;
using System.Threading;
using BPA.Helper;
using BPASmartClient.Message;
using BPA.ApolloClient;
using BPA.ApolloClient.Options;
using Com.Ctrip.Framework.Apollo;


+ 16
- 9
BPASmartClient.Business/LocalMqtt.cs Vedi File

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

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

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

ScreenDeviceType LocDeviceType;

@@ -33,25 +33,32 @@ namespace BPASmartClient.Business
{
MqttPushs.Name = DeviceType;
LocDeviceType = DeviceType;
mQTTProxy.Connected = new Action(() =>
mQTTProxy.ConnectOk = 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 Vedi File

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

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


+ 1
- 1
BPASmartClient.Business/Plugin/ConfigMgr.cs Vedi File

@@ -1,7 +1,7 @@
using BPA.ApolloClient;
using BPA.Message;
using BPA.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;


+ 1
- 1
BPASmartClient.Business/Plugin/DeviceMgr.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.Device;

using BPA.Helper;
using BPASmartClient.Http;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.小炒机;
using BPASmartClient.Model.调酒机;


+ 21
- 20
BPASmartClient.Business/Plugin/MQTTMgr.cs Vedi File

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

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,28 +43,29 @@ 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.ConnectOk = () =>
{
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 = 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(() =>
{
@@ -88,7 +89,7 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, "MQTT 消息处理", true);
}, "MQTT 消息处理", isRestart: true);
}

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



+ 4
- 4
BPASmartClient.Business/Plugin/OrderProxy.cs Vedi File

@@ -6,7 +6,7 @@ using BPASmartClient.Device;

using BPA.Helper;
using BPASmartClient.Http;
using BPASmartClient.Message;
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 BPA.Helper.EventBus;

namespace BPASmartClient.Business
{
@@ -136,7 +136,7 @@ namespace BPASmartClient.Business
}
});

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

private void StartTargetDeviceOrderJob(int deviceId)
@@ -164,7 +164,7 @@ namespace BPASmartClient.Business
}
Thread.Sleep(50);
}
}, $"MQTT 订单接收处理-设备[{deviceId}]", true);
}, $"MQTT 订单接收处理-设备[{deviceId}]", isRestart: true);
}

public void OrderStatusChangedHandle(IEvent @event, EventCallBackHandle callBack)


+ 5
- 5
BPASmartClient.CustomResource/Pages/Model/AlarmTest.cs Vedi File

@@ -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; }
@@ -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/MessageNotify.cs Vedi File

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

@@ -43,7 +43,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
{
Sqlite<UserLog>.GetInstance.Save();
Sqlite<RunLog>.GetInstance.Save();
Sqlite<Alarm>.GetInstance.Save();
Sqlite<BPASmartClient.Model.Alarm>.GetInstance.Save();
Sqlite<RecipeCompleteLog>.GetInstance.Save();
}

@@ -122,7 +122,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 +131,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);
}


+ 1
- 1
BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs Vedi File

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

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Model;
using Google.Protobuf.WellKnownTypes;


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/LoginViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using System.Windows;
using BPASmartClient.CustomResource.Pages.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs Vedi File

@@ -12,7 +12,7 @@ using BPASmartClient.CustomResource.Pages.Model;
using BPA.Helper;
using BPASmartClient.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/NfcSetViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
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;


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/PasswordChangeViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using BPASmartClient.CustomResource.Pages.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.CustomResource.Pages.ViewModel
{


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/RecipeCompleteViewModel.cs Vedi File

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


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/ReportViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;
using Microsoft.Toolkit.Mvvm.Input;
using System.Diagnostics;
using System.IO;



+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/RunLogViewModel.cs Vedi File

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


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/UserConfigViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.Pages.View;
using BPA.Helper;
using BPASmartClient.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/UserLogViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.CustomResource.Pages.Model;
using System.Windows;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;

namespace BPASmartClient.CustomResource.Pages.ViewModel


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/UserManageViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPASmartClient.CustomResource.Pages.Enums;
using BPASmartClient.CustomResource.Pages.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;


+ 1
- 1
BPASmartClient.CustomResource/Pages/ViewModel/VariableViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 38
- 39
BPASmartClient.DRCoffee/CoffeeMachine.cs Vedi File

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

using BPA.Helper;
using BPASmartClient.Message;
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 BPA.Helper.EventBus;

namespace BPASmartClient.DRCoffee
{
@@ -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();


+ 7
- 6
BPASmartClient.DRCoffee/CommandHandler.cs Vedi File

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


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

}



+ 5
- 6
BPASmartClient.Device/AlarmHelper.cs Vedi File

@@ -1,5 +1,4 @@
using BPA.Helper;
using BPASmartClient.Message;
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)
{


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/BomOfMaterialViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.FoodStationTest.Model.Bom;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/DeviceListViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPASmartClient.FoodStationTest.View;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;

namespace BPASmartClient.FoodStationTest.ViewModel


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/DeviceMaterialParViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/ManualCommViewModel.cs Vedi File

@@ -1,6 +1,6 @@
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/ManualFlowViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.FoodStationTest.Model.HK_PLC;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.ComponentModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/NewLocalRecipeViewModel.cs Vedi File

@@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/NewMaterialViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPA.Helper;
using BPASmartClient.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPASmartClient.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPASmartClient.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/RecipeInfosViewModel.cs Vedi File

@@ -1,7 +1,7 @@
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.FoodStationTest.View;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.FoodStationTest.View;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/SelectRecipesViewModel.cs Vedi File

@@ -1,7 +1,7 @@
using BPASmartClient.FoodStationTest.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/SiemensRecipeReceiveViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.FoodStationTest.View;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Linq;



+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/StockBinRawMaterialViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.FoodStationTest.Model.RawMaterial;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.ObjectModel;
using System.Linq;


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.FoodStationTest.Model.HK_PLC;
using BPASmartClient.FoodStationTest.Model.Par;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.FoodStationTest.ViewModel
{


+ 5
- 4
BPASmartClient.GSIceCream/CommandHandler.cs Vedi File

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


using BPA.Helper;
using BPASmartClient.GSIceCream;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.冰淇淋.Enum;
using BPASmartClient.SerialPort;
@@ -11,7 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static BPA.Helper.EventBus;

namespace BPASmartClient.DRCoffee
{
@@ -34,8 +35,8 @@ namespace BPASmartClient.DRCoffee
this.commProxy = commProxy;
ICMSG_Heart_DW heartDW = new ICMSG_Heart_DW();
cmdHeartDW = IcPack.StructureToByte(heartDW);
EventBus.EventBus.GetInstance().Subscribe<GSIceCream_ModeSetEvent>(0, ModeSetEventHandle);
EventBus.EventBus.GetInstance().Subscribe<GSIceCream_DischargeEvent>(0,DischargeEventHandle);
EventBus.GetInstance().Subscribe<GSIceCream_ModeSetEvent>(0, ModeSetEventHandle);
EventBus.GetInstance().Subscribe<GSIceCream_DischargeEvent>(0, DischargeEventHandle);
}
/// <summary>
/// 发送心跳


+ 5
- 5
BPASmartClient.GSIceCream/IceCreamMachine.cs Vedi File

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

using BPA.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.冰淇淋.Enum;
using BPASmartClient.Peripheral;
@@ -9,7 +9,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using static BPA.Helper.EventBus;
using static BPASmartClient.GSIceCream.MessageDefine;

namespace BPASmartClient.GSIceCream
@@ -176,7 +176,7 @@ namespace BPASmartClient.GSIceCream

private void ProcessHeart(ICMSG_Heart_UP heartUpMsg)
{
IsConnected = OnLine;
status["IceCreamIsConnected"] = OnLine;
status["IceCreamCurrentMode"] = heartUpMsg.MS;
@@ -253,7 +253,7 @@ namespace BPASmartClient.GSIceCream
commProxy = new SerialPortClient(communicationPar.SerialPort, (BaudRates)communicationPar.BaudRate);
commProxy.SetDataStorage(dataStorage);

EventBus.EventBus.GetInstance().Subscribe<GSIceCream_ModeSetEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<GSIceCream_ModeSetEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
@@ -272,7 +272,7 @@ namespace BPASmartClient.GSIceCream
});

//广深冰淇淋机打料
EventBus.EventBus.GetInstance().Subscribe<GSIceCream_DischargeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<GSIceCream_DischargeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{


+ 1
- 1
BPASmartClient.GSIceCream/MorkIStatus.cs Vedi File

@@ -1,6 +1,6 @@
using BPASmartClient.GSIceCream;
using BPA.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model.冰淇淋.Enum;
using System;
using System.Collections.Generic;


+ 1
- 1
BPASmartClient.Helper/ActionManage.cs Vedi File

@@ -7,7 +7,7 @@ using System.Collections.Concurrent;
using System.Reflection.Metadata;
using System.Threading;
using System.Reflection;
using BPASmartClient.Message;

namespace BPASmartClient.Helper
{


+ 1
- 1
BPASmartClient.Helper/ExcelHelper.cs Vedi File

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

using System;
using System.Collections.Generic;
using System.Data;


+ 1
- 1
BPASmartClient.Helper/SystemHelper.cs Vedi File

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

using IWshRuntimeLibrary;
using Microsoft.Win32;
using System;


+ 1
- 1
BPASmartClient.Helper/ThreadManage.cs Vedi File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Threading;
using BPASmartClient.Message;

namespace BPASmartClient.Helper
{


+ 22
- 22
BPASmartClient.IceMaker/IceMakerMachine.cs Vedi File

@@ -31,32 +31,32 @@ namespace BPASmartClient.IceMaker
Thread.Sleep(1000);
}), $"设备[{DeviceId}]制冰机读取线程", true);

EventBus.EventBus.GetInstance().Subscribe<StartMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.StartCook();
});
EventBus.EventBus.GetInstance().Subscribe<StopMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.EndCook();
});
EventBus.EventBus.GetInstance().Subscribe<PumpMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<StartMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.StartCook();
});
EventBus.GetInstance().Subscribe<StopMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.EndCook();
});
EventBus.GetInstance().Subscribe<PumpMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.pump();
});
EventBus.EventBus.GetInstance().Subscribe<StandbyMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.Standby();
});
EventBus.EventBus.GetInstance().Subscribe<PowerOnMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.PowerOn();
});
EventBus.EventBus.GetInstance().Subscribe<SetIceNumber>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<StandbyMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.Standby();
});
EventBus.GetInstance().Subscribe<PowerOnMakeIce>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
iceMakerHelper.PowerOn();
});
EventBus.GetInstance().Subscribe<SetIceNumber>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var parm = @event as SetIceNumber;


+ 1
- 1
BPASmartClient.IoT/DataVClient.cs Vedi File

@@ -5,7 +5,7 @@ using BPASmartClient.Business;
using BPASmartClient.Device;
using BPA.Helper;
using BPASmartClient.IoT.Model;
using BPASmartClient.Message;
using BPASmartDatavDeviceClient.IoT;
using System;
using System.Collections.Generic;


+ 1
- 1
BPASmartClient.IoT/Model/FileUpload.cs Vedi File

@@ -1,5 +1,5 @@
using BPA.Helper;
using BPASmartClient.Message;
using BPASmartDatavDeviceClient.IoT;
using DataVAPI.Tool.IOT;
using System;


+ 25
- 25
BPASmartClient.JAKA/JakaMachine.cs Vedi File

@@ -41,31 +41,31 @@ namespace BPASmartClient.JAKA



EventBus.EventBus.GetInstance().Subscribe<WriteJaka>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as WriteJaka;
switch (par?.TagName)
{
case "Power_On":
jaKaHelper.Power_On();
break;
case "Enable_robot":
jaKaHelper.Enable_robot();
break;
case "Set_RobotAO1":
if (par?.Value is int intvalue) jaKaHelper.Set_RobotAO1(intvalue);
break;
case "JaKaProgramName":
if (par?.Value is string stringvalue) jaKaHelper.JaKaProgramName(stringvalue);
break;
case "JakaDOutput":
if (par?.Value is bool DO_value && par?.DO_Index is int DO_Index) jaKaHelper.Set_RobotDO(DO_Index, DO_value);
break;
default:
break;
}
});
EventBus.GetInstance().Subscribe<WriteJaka>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as WriteJaka;
switch (par?.TagName)
{
case "Power_On":
jaKaHelper.Power_On();
break;
case "Enable_robot":
jaKaHelper.Enable_robot();
break;
case "Set_RobotAO1":
if (par?.Value is int intvalue) jaKaHelper.Set_RobotAO1(intvalue);
break;
case "JaKaProgramName":
if (par?.Value is string stringvalue) jaKaHelper.JaKaProgramName(stringvalue);
break;
case "JakaDOutput":
if (par?.Value is bool DO_value && par?.DO_Index is int DO_Index) jaKaHelper.Set_RobotDO(DO_Index, DO_value);
break;
default:
break;
}
});
}

//public override void ReadData(string address)


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/BomOfMaterialViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/ChangeDeviceNameViewModel.cs Vedi File

@@ -1,7 +1,7 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPA.Helper;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/DeviceManageViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.View;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/HKPlcCommMonitorViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/HardwareStatusViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.View;
using System.Windows.Forms;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/ManualFlowViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeInfosViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.CustomResource.Pages.Model;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeReceiveViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.View;
using BPASmartClient.CustomResource.UserControls;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/RecipeSendDownViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using BPASmartClient.JXJFoodBigStation.View;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/SelectRecipesViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/SiemensRecipeSendDownViewModel.cs Vedi File

@@ -2,7 +2,7 @@
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodBigStation/ViewModel/StockBinRawMaterialViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/Model/RawMaterial/ActionMenu.cs Vedi File

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

namespace BPASmartClient.JXJFoodSmallStation.Model
{


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/BomOfMaterialViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.Model.Bom;
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/ChangeDeviceNameViewModel.cs Vedi File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using BPA.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.Pages.Model;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceListViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.View;
using BPASmartClient.JXJFoodSmallStation.Model;



+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/DeviceMaterialParViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/HardwareStatusViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;

namespace BPASmartClient.JXJFoodSmallStation.ViewModel


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/ManualCommViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/ManualControlViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using System.Threading;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/NewMaterialViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using BPASmartClient.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/NewRecipeViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.CustomResource.Pages.Model;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeControlViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using System.Threading;
using BPASmartClient.CustomResource.Pages.Model;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using BPA.Helper;
using System.Collections.ObjectModel;
using Microsoft.Toolkit.Mvvm.Input;
using BPA.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.CustomResource.Pages.Model;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.View;
using BPASmartClient.CustomResource.UserControls;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeSettingsViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.View;
using BPASmartClient.CustomResource.UserControls;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/RobotViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs Vedi File

@@ -3,7 +3,7 @@ using BPA.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs Vedi File

@@ -8,7 +8,7 @@ using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Windows;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.View;
using BPASmartClient.CustomResource.UserControls;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/StockBinRawMaterialViewModel.cs Vedi File

@@ -5,7 +5,7 @@ using BPA.Helper;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPASmartClient.JXJFoodSmallStation.Model.RawMaterial;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/SystemParViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 1
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/WindSendParViewModel.cs Vedi File

@@ -7,7 +7,7 @@ using BPA.Helper;
using System.Collections.ObjectModel;
using BPASmartClient.JXJFoodSmallStation.Model;
using BPA.Helper;
using Microsoft.Toolkit.Mvvm.Input;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.CustomResource.UserControls;
using System.Diagnostics;


+ 2
- 2
BPASmartClient.Juicer/JuicerMachine.cs Vedi File

@@ -3,7 +3,7 @@ using BPA.Helper;
using BPASmartClient.Model;
using BPASmartClient.Peripheral;
using BPASmartClient.SerialPort;
using static BPA.Helper.EventBus;

namespace BPASmartClient.Juicer
{
@@ -32,7 +32,7 @@ namespace BPASmartClient.Juicer
Thread.Sleep(1000);
}), $"设备[{DeviceId}]果汁机读取线程", true);

EventBus.EventBus.GetInstance().Subscribe<WriteJuicer>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<WriteJuicer>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as WriteJuicer;


+ 1
- 1
BPASmartClient.KHKJ/KHKJMachine.cs Vedi File

@@ -1,5 +1,5 @@
using BPA.Helper;
using BPASmartClient.Message;
using BPASmartClient.SerialPort;
using System;
using System.Collections.Generic;


+ 75
- 75
BPASmartClient.KLMCoffee/CoffeeMachine.cs Vedi File

@@ -1,7 +1,7 @@

using BPA.Helper;
using BPASmartClient.KLMCoffee.Protocal;
using BPASmartClient.Message;
using BPASmartClient.Model;
using BPASmartClient.Model.咖啡机.Enum;
using BPASmartClient.Peripheral;
@@ -12,7 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static BPA.Helper.EventBus;

namespace BPASmartClient.KLMCoffee
{
@@ -112,7 +112,7 @@ namespace BPASmartClient.KLMCoffee
{
byte item = dataStorage.GetData();
List<byte> data = new List<byte>() { item };
if (Encoding.ASCII.GetString(data.ToArray()) == ":")
if (Encoding.ASCII.GetString(data.ToArray()) == ":")
{
temp.Add(item);
while (dataStorage.GetSize() < 32) { Thread.Sleep(5); }
@@ -127,7 +127,7 @@ namespace BPASmartClient.KLMCoffee
//帧尾
//if (Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\\r\\n" || Encoding.ASCII.GetString(vs.ToArray()).ToLower() == "\r\n")
var package = Encoding.ASCII.GetString(temp.ToArray());
if(package.Contains("\\r\\n"))
if (package.Contains("\\r\\n"))
{
ProcessMsg(package);
}
@@ -147,10 +147,10 @@ namespace BPASmartClient.KLMCoffee
if (systemStatus != null)
{
status["CoffeeIsConnected"] = OnLine;
if((K95SysTemStatus)status["CoffeeStatus"] == K95SysTemStatus.正在制作咖啡&&systemStatus.temStatus != K95SysTemStatus.正在制作咖啡)
if ((K95SysTemStatus)status["CoffeeStatus"] == K95SysTemStatus.正在制作咖啡 && systemStatus.temStatus != K95SysTemStatus.正在制作咖啡)
{
status["CoffeeStatus"] = systemStatus.temStatus;
EventBus.EventBus.GetInstance().Publish(new KLMCoffee_CoffeEndCookEvent { DeviceId = DeviceId });
EventBus.GetInstance().Publish(new KLMCoffee_CoffeEndCookEvent { DeviceId = DeviceId });
}
else status["CoffeeStatus"] = systemStatus.temStatus;
status["CoffeedrinkType"] = systemStatus.drinkType;
@@ -187,64 +187,64 @@ namespace BPASmartClient.KLMCoffee
commProxy.SetDataStorage(dataStorage);

//伽乐美咖啡机制作
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_MakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(300);
K95deFaultCoffeeEnum K95Code = (K95deFaultCoffeeEnum)((KLMCoffee_MakeCoffeeEvent)@event).KLMDrinkFaultCode;
//byte[] data = command.ReturnsCommandData(K95CommandEnum.配方咖啡制作.GetString(), new RecipeModel().Packe(((KLMCoffee_MakeCoffeeEvent)@event).DrinkCode));
byte[] data = command.ReturnsCommandData(K95CommandEnum.咖啡制作.GetString(), K95Code.GetString());
commProxy.SendData(data);
MessageLog.GetInstance.Show($"制作{K95Code}数据发送完成");
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
EventBus.GetInstance().Subscribe<KLMCoffee_MakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(300);
K95deFaultCoffeeEnum K95Code = (K95deFaultCoffeeEnum)((KLMCoffee_MakeCoffeeEvent)@event).KLMDrinkFaultCode;
//byte[] data = command.ReturnsCommandData(K95CommandEnum.配方咖啡制作.GetString(), new RecipeModel().Packe(((KLMCoffee_MakeCoffeeEvent)@event).DrinkCode));
byte[] data = command.ReturnsCommandData(K95CommandEnum.咖啡制作.GetString(), K95Code.GetString());
commProxy.SendData(data);
MessageLog.GetInstance.Show($"制作{K95Code}数据发送完成");
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});

//伽乐美咖啡机取消制作咖啡
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_CancelMakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
byte[] data = command.ReturnsCancelMake();
commProxy.SendData(data);
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
EventBus.GetInstance().Subscribe<KLMCoffee_CancelMakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
byte[] data = command.ReturnsCancelMake();
commProxy.SendData(data);
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});

//伽乐美咖啡机清洗冲泡器
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_WashCPJEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
byte[] data = command.ReturnsWashCPJ();
commProxy.SendData(data);
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
EventBus.GetInstance().Subscribe<KLMCoffee_WashCPJEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
byte[] data = command.ReturnsWashCPJ();
commProxy.SendData(data);
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});

//伽乐美咖啡机放杯确认
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_CupIsOKEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<KLMCoffee_CupIsOKEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
@@ -263,26 +263,26 @@ namespace BPASmartClient.KLMCoffee


//伽乐美咖啡机清洗奶沫器
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_WashNMJEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
byte[] data = command.ReturnsWashNMJ();
commProxy.SendData(data);
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});
EventBus.GetInstance().Subscribe<KLMCoffee_WashNMJEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{
free = true;
Thread.Sleep(200);
byte[] data = command.ReturnsWashNMJ();
commProxy.SendData(data);
Thread.Sleep(200);
free = false;
}
catch (Exception ex)
{
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]");
}
});


//伽乐美咖啡机清洗奶沫器确认
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_WashNMJIsOKEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<KLMCoffee_WashNMJIsOKEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
try
{


+ 13
- 12
BPASmartClient.Lebai/LebaiRobot.cs Vedi File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using Lebai.SDK;
using Lebai.SDK.Dtos;
using Robotc;
using BPASmartClient.Message;
using BPA.Helper;
using TaskStatus = Lebai.SDK.Dtos.TaskStatus;
using BPASmartClient.Peripheral;
@@ -16,6 +16,7 @@ using BPASmartClient.Peripheral;
using BPASmartClient.Model;
using BPASmartClient.LebaiRobot;
using BPASmartClient.Model.乐白机器人;
using static BPA.Helper.EventBus;

namespace BPASmartClient.Lebai
{
@@ -48,7 +49,7 @@ namespace BPASmartClient.Lebai
status["RobotIsConnected"] = LebaiHelper.GetInstance().IsConnected;
status["RobotOK"] = LebaiHelper.GetInstance().GetValueAsync().Ok;
status["RobotValue"] = LebaiHelper.GetInstance().GetValueAsync().Value;
if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] =(ELebaiRModel)LebaiHelper.GetInstance().robotData.RobotMode.Mode;
if (LebaiHelper.GetInstance().robotData != null) status["RobotMode"] = (ELebaiRModel)LebaiHelper.GetInstance().robotData.RobotMode.Mode;
status["RobotValue1"] = LebaiHelper.GetInstance().GetValueAsync(1).Value;
status["LeibaiGetTcpInput"] = LebaiHelper.GetInstance().GetTcpInput(0);
status["LeibaiGetInput1"] = LebaiHelper.GetInstance().GetInput(0);
@@ -68,12 +69,12 @@ namespace BPASmartClient.Lebai

public override void Init()
{
EventBus.EventBus.GetInstance().Subscribe<Demo_MakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<Demo_MakeCoffeeEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{

});
//获取机器人信号
EventBus.EventBus.GetInstance().Subscribe<LebaiRobot_GetInputEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<LebaiRobot_GetInputEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is LebaiRobot_GetInputEvent getInput)
@@ -82,7 +83,7 @@ namespace BPASmartClient.Lebai
}
});
//获取Tcp信号
EventBus.EventBus.GetInstance().Subscribe<LebaiRobot_GetTCPInputEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<LebaiRobot_GetTCPInputEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is LebaiRobot_GetTCPInputEvent getTCPInput)
@@ -91,7 +92,7 @@ namespace BPASmartClient.Lebai
}
});
//机器人输入信号
EventBus.EventBus.GetInstance().Subscribe<LebaiRobot_SetValueEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<LebaiRobot_SetValueEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is LebaiRobot_SetValueEvent SetValueEvent)
@@ -100,7 +101,7 @@ namespace BPASmartClient.Lebai
}
});
//控制机器人
EventBus.EventBus.GetInstance().Subscribe<LebaiRobot_LebaiControlEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<LebaiRobot_LebaiControlEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is LebaiRobot_LebaiControlEvent lebaiControlEvent)
@@ -132,7 +133,7 @@ namespace BPASmartClient.Lebai
}
});
//选择机器人场景
EventBus.EventBus.GetInstance().Subscribe<LebaiRobot_LebaiSenceEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<LebaiRobot_LebaiSenceEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is LebaiRobot_LebaiSenceEvent lebaiSenceEvent)
@@ -141,12 +142,12 @@ namespace BPASmartClient.Lebai
}
});

EventBus.EventBus.GetInstance().Subscribe<LebaiRobot_SetOutPutEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<LebaiRobot_SetOutPutEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
if (@event is LebaiRobot_SetOutPutEvent lebaiOutputEvent)
{
LebaiHelper.GetInstance().SetOutput(lebaiOutputEvent.Value,lebaiOutputEvent.Pin);
LebaiHelper.GetInstance().SetOutput(lebaiOutputEvent.Value, lebaiOutputEvent.Pin);
}
});

@@ -157,8 +158,8 @@ namespace BPASmartClient.Lebai

public override void WriteData(string address, object value)
{
}
}
}

+ 1
- 1
BPASmartClient.LebaiRobot/LebaiHelper.cs Vedi File

@@ -1,5 +1,5 @@
using BPA.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using Lebai.SDK;
using Lebai.SDK.Dtos;


+ 4
- 3
BPASmartClient.MCU/MCUMachine.cs Vedi File

@@ -1,9 +1,10 @@

using BPA.Helper;
using BPASmartClient.Model.PLC;
using BPASmartClient.Model.单片机;
using BPASmartClient.Peripheral;
using BPASmartClient.SerialPort;
using static BPA.Helper.EventBus;

namespace BPASmartClient.MCU
{
@@ -15,7 +16,7 @@ namespace BPASmartClient.MCU
{
mCUSerialHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate);

EventBus.EventBus.GetInstance().Subscribe<ReadMcu>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<ReadMcu>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as ReadMcu;
@@ -25,7 +26,7 @@ namespace BPASmartClient.MCU
}
});

EventBus.EventBus.GetInstance().Subscribe<WriteMcu>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<WriteMcu>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as WriteMcu;


+ 3
- 2
BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs Vedi File

@@ -1,11 +1,12 @@
using BPASmartClient.Peripheral;
using BPA.Helper;
using BPASmartClient.Message;

using BPASmartClient.Modbus;

using BPASmartClient.Model;
using BPASmartClient.Model.PLC;
using static BPA.Helper.EventBus;

namespace BPASmartClient.PLC
{
@@ -71,7 +72,7 @@ namespace BPASmartClient.PLC


//写入数据
EventBus.EventBus.GetInstance().Subscribe<WriteModel>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
EventBus.GetInstance().Subscribe<WriteModel>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as WriteModel;


+ 38
- 39
BPASmartClient.MilkTeaCube/MilkTeaCubeMachine.cs Vedi File

@@ -4,52 +4,51 @@ using BPASmartClient.Modbus;
using BPA.Helper;
using System.Threading;
using BPASmartClient.Model.Ä̲èζħ·½;


using static BPA.Helper.EventBus;

namespace BPASmartClient.MilkTeaCube
{
public class MilkTeaCubeMachine: BasePeripheral
public class MilkTeaCubeMachine : BasePeripheral
{
public ModbusTcp modbus =new ModbusTcp();
public override void Init()
public ModbusTcp modbus = new ModbusTcp();
public override void Init()
{
modbus.ModbusTcpConnect(communicationPar.IPAddress);
EventBus.EventBus.GetInstance().Subscribe<MilkTea_MakeMilkTeaEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as MilkTea_MakeMilkTeaEvent;
switch (par?.TagName)
{
case "Start":
modbus.Write("LB14", true);
Thread.Sleep(200);
modbus.Write("LB14", false);
EventBus.GetInstance().Subscribe<MilkTea_MakeMilkTeaEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
{
if (@event == null) return;
var par = @event as MilkTea_MakeMilkTeaEvent;
switch (par?.TagName)
{
case "Start":
modbus.Write("LB14", true);
Thread.Sleep(200);
modbus.Write("LB14", false);

break;
case "ParameterSet":
modbus.Write("LB14", false);
Thread.Sleep(500);
modbus.Write("LW1001", par.MilkTeaKind[0]);
modbus.Write("LW1003", par.MilkTeaKind[1]);
modbus.Write("LW1004", par.MilkTeaKind[2]);
modbus.Write("LW1005", par.MilkTeaKind[3]);
modbus.Write("LW1006", par.MilkTeaKind[4]);
modbus.Write("LW1007", par.MilkTeaKind[5]);
modbus.Write("LW1008", par.MilkTeaKind[6]);
modbus.Write("LW1009", par.MilkTeaKind[7]);
modbus.Write("LW1010", par.MilkTeaKind[8]);
modbus.Write("LW1011", par.MilkTeaKind[9]);
modbus.Write("LW1012", par.MilkTeaKind[10]);
modbus.Write("LW1013", par.MilkTeaKind[11]);
break;
case "StartSignReset":
modbus.Write("LB14", false);
break;
default:
break;
}
});
break;
case "ParameterSet":
modbus.Write("LB14", false);
Thread.Sleep(500);
modbus.Write("LW1001", par.MilkTeaKind[0]);
modbus.Write("LW1003", par.MilkTeaKind[1]);
modbus.Write("LW1004", par.MilkTeaKind[2]);
modbus.Write("LW1005", par.MilkTeaKind[3]);
modbus.Write("LW1006", par.MilkTeaKind[4]);
modbus.Write("LW1007", par.MilkTeaKind[5]);
modbus.Write("LW1008", par.MilkTeaKind[6]);
modbus.Write("LW1009", par.MilkTeaKind[7]);
modbus.Write("LW1010", par.MilkTeaKind[8]);
modbus.Write("LW1011", par.MilkTeaKind[9]);
modbus.Write("LW1012", par.MilkTeaKind[10]);
modbus.Write("LW1013", par.MilkTeaKind[11]);
break;
case "StartSignReset":
modbus.Write("LB14", false);
break;
default:
break;
}
});
ThreadManage.GetInstance().StartLong(new Action(() =>
{
IsConnected = modbus.Connected;


+ 1
- 1
BPASmartClient.MilkWithTea/MainWindow.xaml.cs Vedi File

@@ -4,7 +4,7 @@ using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.Device;
using BPA.Helper;
using BPASmartClient.IoT;
using BPASmartClient.Message;
using BPASmartClient.Peripheral;
using BPASmartClient.ViewModel;
using Newtonsoft.Json;


+ 3
- 3
BPASmartClient.MilkWithTea/ViewModel/MainControlViewModel.cs Vedi File

@@ -1,7 +1,7 @@

global using CommunityToolkit.Mvvm.Input;
using BPA.Helper;
using BPASmartClient.Message;

namespace BPASmartClient.MilkWithTea.ViewModel
{
@@ -176,7 +176,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel

}), "AddOrder");

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

ActionManage.GetInstance.Register(new Action<object[]>((o)=>
{
@@ -194,7 +194,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel

}

private void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack)
private void OrderStatusChangedHandle(IEvent @event, EventBus.EventCallBackHandle callBack)
{
OrderStatusChangedEvent orderStatusChange = @event as OrderStatusChangedEvent;
int index = Array.FindIndex(orderStatusLists.ToArray(), p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId);


+ 1
- 1
BPASmartClient.MilkWithTea/ViewModel/PatrameterSettiongViewModel.cs Vedi File

@@ -1,5 +1,5 @@
using BPA.Helper;
using BPASmartClient.Message;
using BPASmartClient.Model;
using CommunityToolkit.Mvvm.Input;
using Newtonsoft.Json;


Dato che sono stati cambiati molti file in questo diff, alcuni di essi non verranno mostrati

Caricamento…
Annulla
Salva