@@ -8,7 +8,7 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.ApolloClient" Version="1.0.12" /> | <PackageReference Include="BPA.ApolloClient" Version="1.0.12" /> | ||||
<PackageReference Include="BPA.Communication" Version="1.0.106" /> | |||||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | <PackageReference Include="BPA.Message" Version="1.0.86" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" /> | ||||
@@ -67,7 +67,7 @@ namespace BPASmartClient.Business | |||||
ClientId = $"ClientId-[{clientId}]-DeviceId-[{deviceId}]-{Guid.NewGuid()}" | ClientId = $"ClientId-[{clientId}]-DeviceId-[{deviceId}]-{Guid.NewGuid()}" | ||||
}); | }); | ||||
ThreadManage.GetInstance().Start(() => | |||||
TaskManage.GetInstance.Start(() => | |||||
{ | { | ||||
while (running) | while (running) | ||||
{ | { | ||||
@@ -44,7 +44,7 @@ namespace BPASmartClient.Business | |||||
deviceMgr = Plugin.GetInstance().GetPlugin<DeviceMgr>(); | deviceMgr = Plugin.GetInstance().GetPlugin<DeviceMgr>(); | ||||
if (InternetInfo.IsEnableTest) | if (InternetInfo.IsEnableTest) | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
while (morkOrderPushes.Count > 0) | while (morkOrderPushes.Count > 0) | ||||
{ | { | ||||
@@ -141,7 +141,7 @@ namespace BPASmartClient.Business | |||||
private void StartTargetDeviceOrderJob(int deviceId) | private void StartTargetDeviceOrderJob(int deviceId) | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(() => | |||||
TaskManage.GetInstance.Start(() => | |||||
{ | { | ||||
var device = deviceMgr.GetDevices().FirstOrDefault(p => p.DeviceId == deviceId); | var device = deviceMgr.GetDevices().FirstOrDefault(p => p.DeviceId == deviceId); | ||||
while (running) | while (running) | ||||
@@ -33,7 +33,7 @@ namespace BPASmartClient.Business | |||||
public void Start() | public void Start() | ||||
{ | { | ||||
running = true; | running = true; | ||||
ThreadManage.GetInstance().Start(() => | |||||
TaskManage.GetInstance.Start(() => | |||||
{ | { | ||||
while (running) | while (running) | ||||
{ | { | ||||
@@ -48,7 +48,7 @@ namespace BPASmartClient.Business | |||||
deviceStatus.BatchingInfo = new List<BPA.Models.BatchingInfo>(); | deviceStatus.BatchingInfo = new List<BPA.Models.BatchingInfo>(); | ||||
ThreadManage.GetInstance().Start(() => | |||||
TaskManage.GetInstance.Start(() => | |||||
{ | { | ||||
while (running) | while (running) | ||||
{ | { | ||||
@@ -459,7 +459,7 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Helper" Version="1.0.66" /> | |||||
<PackageReference Include="BPA.Helper" Version="1.0.67" /> | |||||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | <PackageReference Include="BPA.Message" Version="1.0.86" /> | ||||
<PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" /> | <PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -44,7 +44,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
public static void Init() | public static void Init() | ||||
{ | { | ||||
AlarmViewModel.AlarmInfos = Alarms; | AlarmViewModel.AlarmInfos = Alarms; | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (_Instance != null) | if (_Instance != null) | ||||
{ | { | ||||
@@ -41,7 +41,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
public static void Init() | public static void Init() | ||||
{ | { | ||||
AlarmViewModel.AlarmInfos = Alarms; | AlarmViewModel.AlarmInfos = Alarms; | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (_Instance != null) | if (_Instance != null) | ||||
{ | { | ||||
@@ -20,7 +20,7 @@ namespace BPASmartClient.CustomResource | |||||
static VoiceAPI() | static VoiceAPI() | ||||
{ | { | ||||
BPA.Helper.ThreadManage.GetInstance().StartLong(new Action(() => | |||||
BPA.Helper.TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
while (msg.Count > 0) | while (msg.Count > 0) | ||||
{ | { | ||||
@@ -87,7 +87,7 @@ namespace BPASmartClient.DRCoffee | |||||
/// </summary> | /// </summary> | ||||
private void MainLoop() | private void MainLoop() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (!free) | if (!free) | ||||
{ | { | ||||
@@ -96,7 +96,7 @@ namespace BPASmartClient.DRCoffee | |||||
Thread.Sleep(200); | Thread.Sleep(200); | ||||
}), "咖啡机询问线程"); | }), "咖啡机询问线程"); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
List<byte> temp = new List<byte>(); | List<byte> temp = new List<byte>(); | ||||
//一系列解包 | //一系列解包 | ||||
@@ -184,7 +184,7 @@ namespace BPASmartClient.Device | |||||
public virtual void StartMain() | public virtual void StartMain() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
int i = 0; | int i = 0; | ||||
foreach (var peripheral in peripherals) | foreach (var peripheral in peripherals) | ||||
@@ -314,7 +314,7 @@ namespace BPASmartClient.Device | |||||
DeleteErrorAction?.Invoke(DeviceId, res); | DeleteErrorAction?.Invoke(DeviceId, res); | ||||
} | } | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
AlarmMonitoring(); | AlarmMonitoring(); | ||||
Thread.Sleep(500); | Thread.Sleep(500); | ||||
@@ -350,15 +350,15 @@ namespace BPASmartClient.Device | |||||
private void InitResetTask() | private void InitResetTask() | ||||
{ | { | ||||
#region 复位程序 | #region 复位程序 | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (RTrig.GetInstance($"ResetProgram:{DeviceId}").Start(Initing)) | if (RTrig.GetInstance($"ResetProgram:{DeviceId}").Start(Initing)) | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask($"MainTask:{DeviceId}", new Action(() => | |||||
TaskManage.GetInstance.StopTask($"MainTask:{DeviceId}", new Action(() => | |||||
{ | { | ||||
ThreadManage.GetInstance().StopTask($"ReadData:{DeviceId}", new Action(() => | |||||
TaskManage.GetInstance.StopTask($"ReadData:{DeviceId}", new Action(() => | |||||
{ | { | ||||
ThreadManage.GetInstance().StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() => | |||||
TaskManage.GetInstance.StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() => | |||||
{ | { | ||||
ActionManage.GetInstance.Send("ClearOrders"); | ActionManage.GetInstance.Send("ClearOrders"); | ||||
ResetProgram(); | ResetProgram(); | ||||
@@ -376,7 +376,7 @@ namespace BPASmartClient.Device | |||||
private void InitTask() | private void InitTask() | ||||
{ | { | ||||
#region 数据读取 | #region 数据读取 | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
ReadData(); | ReadData(); | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
@@ -384,7 +384,7 @@ namespace BPASmartClient.Device | |||||
#endregion | #endregion | ||||
#region 任务流程 | #region 任务流程 | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
MainTask(); | MainTask(); | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
@@ -392,7 +392,7 @@ namespace BPASmartClient.Device | |||||
#endregion | #endregion | ||||
#region 设备状态监控 | #region 设备状态监控 | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
UpdateValue(InterfaceStatus); | UpdateValue(InterfaceStatus); | ||||
Thread.Sleep(1000); | Thread.Sleep(1000); | ||||
@@ -38,7 +38,7 @@ namespace BPASmartClient.DosingSystemSingle | |||||
SystemHelper.GetInstance.CreateDesktopShortcut(); | SystemHelper.GetInstance.CreateDesktopShortcut(); | ||||
MenuInit(); | MenuInit(); | ||||
DataInit(); | DataInit(); | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化 | DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化 | ||||
}), "设备初始化"); | }), "设备初始化"); | ||||
@@ -62,7 +62,7 @@ namespace BPASmartClient.DosingSystemSingle | |||||
Json<LocaPar>.Save(); | Json<LocaPar>.Save(); | ||||
Json<DevicePar>.Save(); | Json<DevicePar>.Save(); | ||||
BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave(); | BPASmartClient.CustomResource.Pages.Model.MessageNotify.GetInstance.LogSave(); | ||||
ThreadManage.GetInstance().Dispose(); | |||||
TaskManage.GetInstance.Dispose(); | |||||
} | } | ||||
private void MenuInit() | private void MenuInit() | ||||
@@ -16,7 +16,7 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Helper" Version="1.0.66" /> | |||||
<PackageReference Include="BPA.Helper" Version="1.0.67" /> | |||||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | <PackageReference Include="BPA.Message" Version="1.0.86" /> | ||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -32,7 +32,7 @@ namespace BPASmartClient.DosingSystemSingle | |||||
public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | ||||
private void DeviceDataInit() | private void DeviceDataInit() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < DeviceLists.Count; i++) | for (int i = 0; i < DeviceLists.Count; i++) | ||||
{ | { | ||||
@@ -117,7 +117,7 @@ namespace BPASmartClient.DosingSystemSingle | |||||
IpAddressLines(); | IpAddressLines(); | ||||
//SiemensDevice.GetInstance.Connect(Json<DevicePar>.Data.BaseParModel.DeviceAddress); | //SiemensDevice.GetInstance.Connect(Json<DevicePar>.Data.BaseParModel.DeviceAddress); | ||||
DeviceDataInit(); | DeviceDataInit(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IPQueues.Count >= IPLists.Count) | if (IPQueues.Count >= IPLists.Count) | ||||
//IpAddressLines(); | //IpAddressLines(); | ||||
@@ -303,7 +303,7 @@ namespace BPASmartClient.DosingSystemSingle | |||||
AlarmHelper<AlarmInfo>.Init(); | AlarmHelper<AlarmInfo>.Init(); | ||||
if (modbusTcp.Connected) | if (modbusTcp.Connected) | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
this.DeviceName = modbusTcp.GetString(DeviceAddress.DeviceName, 20)?.Trim()?.Replace(" ", ""); | this.DeviceName = modbusTcp.GetString(DeviceAddress.DeviceName, 20)?.Trim()?.Replace(" ", ""); | ||||
deviceStatus.RunStatus = (ushort)this.modbusTcp.ReadShort(DeviceAddress.RunStatus); //获取设备运行状态 | deviceStatus.RunStatus = (ushort)this.modbusTcp.ReadShort(DeviceAddress.RunStatus); //获取设备运行状态 | ||||
@@ -341,7 +341,7 @@ namespace BPASmartClient.DosingSystemSingle | |||||
public void Dispose() | public void Dispose() | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听"); | |||||
TaskManage.GetInstance.StopTask($"{DeviceName} 开始监听"); | |||||
} | } | ||||
public void Start(float Value) | public void Start(float Value) | ||||
@@ -35,14 +35,14 @@ namespace BPASmartClient.DosingSystemSingle | |||||
} | } | ||||
IsConnect = MySiemens.IsConnected; | IsConnect = MySiemens.IsConnected; | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnect) MySiemens.Write("DB4.DBX0.0", tempValue);//设备心跳 | if (IsConnect) MySiemens.Write("DB4.DBX0.0", tempValue);//设备心跳 | ||||
tempValue = !tempValue; | tempValue = !tempValue; | ||||
Thread.Sleep(100); | Thread.Sleep(100); | ||||
}), "设备心跳", true); | }), "设备心跳", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnect) | if (IsConnect) | ||||
{ | { | ||||
@@ -24,7 +24,7 @@ namespace BPASmartClient.DosingSystemSingle.View | |||||
public HardwareStatusView() | public HardwareStatusView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
this.Unloaded += (o, e) => { ThreadManage.GetInstance().StopTask("输送带料仓状态监控"); }; | |||||
this.Unloaded += (o, e) => { TaskManage.GetInstance.StopTask("输送带料仓状态监控"); }; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -24,7 +24,7 @@ namespace BPASmartClient.DosingSystemSingle.View | |||||
public ManualControlView() | public ManualControlView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
this.Unloaded += (o, e) => { ThreadManage.GetInstance().StopTask("手动气缸状态监控"); }; | |||||
this.Unloaded += (o, e) => { TaskManage.GetInstance.StopTask("手动气缸状态监控"); }; | |||||
this.SizeChanged += ManualControlView_SizeChanged; | this.SizeChanged += ManualControlView_SizeChanged; | ||||
this.cy.Height = this.list1.ActualHeight + 40; | this.cy.Height = this.list1.ActualHeight + 40; | ||||
this.zd.Height = this.list2.ActualHeight + 40; | this.zd.Height = this.list2.ActualHeight + 40; | ||||
@@ -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++) | for (int i = 0; i < Json<DevicePar>.Data.OutletInfoModels.Count; i++) | ||||
{ | { | ||||
@@ -113,7 +113,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel | |||||
ModelSwitchText = res ? "自动" : "手动";*/ | ModelSwitchText = res ? "自动" : "手动";*/ | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < cylinderModels.Count; i++) | for (int i = 0; i < cylinderModels.Count; i++) | ||||
{ | { | ||||
@@ -97,7 +97,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel | |||||
/// </summary> | /// </summary> | ||||
private void RecipeRun() | private void RecipeRun() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (RecipeNames.Count > 0) | if (RecipeNames.Count > 0) | ||||
{ | { | ||||
@@ -200,7 +200,7 @@ namespace BPASmartClient.DosingSystemSingle.ViewModel | |||||
/// </summary> | /// </summary> | ||||
private void RecipeStatusInquire() | private void RecipeStatusInquire() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < Recipes.Count; i++) | for (int i = 0; i < Recipes.Count; i++) | ||||
{ | { | ||||
@@ -66,7 +66,7 @@ namespace BPASmartClient.FoodStationTest | |||||
Json<LocalRecipeDataColl>.Save(); | Json<LocalRecipeDataColl>.Save(); | ||||
Json<RemoteRecipeDataColl>.Save(); | Json<RemoteRecipeDataColl>.Save(); | ||||
MessageNotify.GetInstance.LogSave(); | MessageNotify.GetInstance.LogSave(); | ||||
ThreadManage.GetInstance().Dispose(); | |||||
TaskManage.GetInstance.Dispose(); | |||||
} | } | ||||
private void MenuInit() | private void MenuInit() | ||||
@@ -16,7 +16,7 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Communication" Version="1.0.106" /> | |||||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -13,7 +13,7 @@ namespace BPASmartClient.FoodStationTest.Model.HK_PLC | |||||
public PlcReadAddressDB45 DeviceStatus = new PlcReadAddressDB45(); | public PlcReadAddressDB45 DeviceStatus = new PlcReadAddressDB45(); | ||||
public void Init() | public void Init() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnected) | if (IsConnected) | ||||
{ | { | ||||
@@ -68,7 +68,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
RegisterInit(); | RegisterInit(); | ||||
DeviceConnect(); | DeviceConnect(); | ||||
//Json<RemoteRecipeDataColl>.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据 | //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; | GVL_SmallStation.GetInstance.DisEnableStockAlarm = Json<DevicePar>.Data.deviceConnectPar.ShieldStockbinAlarm; | ||||
if (HKDevice.IsConnected) | if (HKDevice.IsConnected) | ||||
@@ -91,7 +91,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
} | } | ||||
Thread.Sleep(200); | Thread.Sleep(200); | ||||
}), "海科plc通信心跳", true); | }), "海科plc通信心跳", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (GVL_SmallStation.GetInstance.Order_Cancel) | if (GVL_SmallStation.GetInstance.Order_Cancel) | ||||
{ | { | ||||
@@ -104,13 +104,13 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
} | } | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
}), "小料站流程控制", true); | }), "小料站流程控制", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
RealTimeData(); | RealTimeData(); | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
}), "西门子PLC和小料站PLC的实时数据交互流程", true); | }), "西门子PLC和小料站PLC的实时数据交互流程", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
HKPlcRead(); | HKPlcRead(); | ||||
GetStatus(); | GetStatus(); | ||||
@@ -1176,7 +1176,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
MessageNotify.GetInstance.ShowRunLog("海科plc初始化完成"); | MessageNotify.GetInstance.ShowRunLog("海科plc初始化完成"); | ||||
} | } | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -33,7 +33,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | ||||
private void DeviceDataInit() | private void DeviceDataInit() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < DeviceLists.Count; i++) | 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; | 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); | DeviceLists[DeviceLists.ElementAt(i).Key].Init(deviceName); | ||||
} | } | ||||
@@ -111,7 +111,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
//TestData(); | //TestData(); | ||||
IpAddressLines(); | IpAddressLines(); | ||||
DeviceDataInit(); | DeviceDataInit(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IPQueues.Count >= IPLists.Count) | if (IPQueues.Count >= IPLists.Count) | ||||
IpAddressLines(); | IpAddressLines(); | ||||
@@ -338,7 +338,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
//AlarmHelper<AlarmInfo>.Init(); | //AlarmHelper<AlarmInfo>.Init(); | ||||
if (modbusTcp.IsConnected()) | if (modbusTcp.IsConnected()) | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (modbusTcp.IsConnected()) | if (modbusTcp.IsConnected()) | ||||
{ | { | ||||
@@ -402,7 +402,7 @@ namespace BPASmartClient.FoodStationTest.Model | |||||
public void Dispose() | public void Dispose() | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听"); | |||||
TaskManage.GetInstance.StopTask($"{DeviceName} 开始监听"); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -17,7 +17,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel | |||||
{ | { | ||||
public ManualControlViewModel() | public ManualControlViewModel() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
PlcSystemMode = GVL_SmallStation.GetInstance.PlcSystemMode; | PlcSystemMode = GVL_SmallStation.GetInstance.PlcSystemMode; | ||||
//SystemMode = GVL_SmallStation.GetInstance.PlcSystemMode ? "手动" : "自动"; | //SystemMode = GVL_SmallStation.GetInstance.PlcSystemMode ? "手动" : "自动"; | ||||
@@ -120,7 +120,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel | |||||
MessageNotify.GetInstance.ShowUserLog("手动清零配方完成数目。"); | MessageNotify.GetInstance.ShowUserLog("手动清零配方完成数目。"); | ||||
} | } | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum; | RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum; | ||||
Recipe1DosingComplete = GVL_SmallStation.GetInstance.RecipeStockBinDosing[0].ToBinString(); | Recipe1DosingComplete = GVL_SmallStation.GetInstance.RecipeStockBinDosing[0].ToBinString(); | ||||
@@ -45,7 +45,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (devices.Count > 0) | if (devices.Count > 0) | ||||
{ | { | ||||
@@ -93,7 +93,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel | |||||
}), "启动配方下发", true); | }), "启动配方下发", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < Recipes.Count; i++) | for (int i = 0; i < Recipes.Count; i++) | ||||
{ | { | ||||
@@ -77,7 +77,7 @@ namespace BPASmartClient.GSIceCream | |||||
private MSG_RESOLVE_STEP currentStep; | private MSG_RESOLVE_STEP currentStep; | ||||
private void MainLoop() | private void MainLoop() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (!free) | if (!free) | ||||
{ | { | ||||
@@ -86,7 +86,7 @@ namespace BPASmartClient.GSIceCream | |||||
Thread.Sleep(500); | Thread.Sleep(500); | ||||
}), "冰淇淋询问线程"); | }), "冰淇淋询问线程"); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
ResolveMsg(); | ResolveMsg(); | ||||
}), "冰淇淋解析线程"); | }), "冰淇淋解析线程"); | ||||
@@ -14,7 +14,7 @@ namespace BPASmartClient.IceMaker | |||||
{ | { | ||||
iceMakerHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate); | iceMakerHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
IsConnected = iceMakerHelper.IsOpen; | IsConnected = iceMakerHelper.IsOpen; | ||||
if (!IsConnected) IsWork = false; | if (!IsConnected) IsWork = false; | ||||
@@ -192,7 +192,7 @@ namespace BPASmartClient.IoT | |||||
/// </summary> | /// </summary> | ||||
public void Dispose() | public void Dispose() | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("DataV数据上报"); | |||||
TaskManage.GetInstance.StopTask("DataV数据上报"); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -250,7 +250,7 @@ namespace BPASmartClient.IoT | |||||
/// </summary> | /// </summary> | ||||
public void Start() | public void Start() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (DeviceDataV != null && DeviceDataV.GetIsConnected() && DeviceDataV.deviceTable != null) | if (DeviceDataV != null && DeviceDataV.GetIsConnected() && DeviceDataV.deviceTable != null) | ||||
{ | { | ||||
@@ -33,7 +33,7 @@ namespace BPASmartClient.IoT.Model | |||||
/// </summary> | /// </summary> | ||||
public static void FileRequest(DataVReport dataV) | public static void FileRequest(DataVReport dataV) | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -14,7 +14,7 @@ namespace BPASmartClient.JAKA | |||||
{ | { | ||||
jaKaHelper.Connect(communicationPar.IPAddress); | jaKaHelper.Connect(communicationPar.IPAddress); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
IsConnected = jaKaHelper.IsConnected; | IsConnected = jaKaHelper.IsConnected; | ||||
if (!IsConnected) | if (!IsConnected) | ||||
@@ -61,7 +61,7 @@ namespace BPASmartClient.JXJFoodBigStation | |||||
Json<BomMaterial>.Save(); | Json<BomMaterial>.Save(); | ||||
base.OnExit(e); | base.OnExit(e); | ||||
MessageNotify.GetInstance.LogSave(); | MessageNotify.GetInstance.LogSave(); | ||||
ThreadManage.GetInstance().Dispose(); | |||||
TaskManage.GetInstance.Dispose(); | |||||
} | } | ||||
private void MenuInit() | private void MenuInit() | ||||
@@ -17,7 +17,7 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Communication" Version="1.0.106" /> | |||||
<PackageReference Include="BPA.Communication" Version="1.0.107" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -29,7 +29,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||||
{ | { | ||||
MessageNotify.GetInstance.ShowRunLog("DB99块初始化值 失败"); | MessageNotify.GetInstance.ShowRunLog("DB99块初始化值 失败"); | ||||
} | } | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{/* | {/* | ||||
var res = HK_PLC_S7.ReadClass<StockBinName>(97);//料仓里原料的编码 | var res = HK_PLC_S7.ReadClass<StockBinName>(97);//料仓里原料的编码 | ||||
if (res != null && res is StockBinName data9) | if (res != null && res is StockBinName data9) | ||||
@@ -1929,7 +1929,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||||
public void ThreadInit() | public void ThreadInit() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (!HKDevice.IsConnected && GVL_BigStation.IsAllowHKPlcConnect) | if (!HKDevice.IsConnected && GVL_BigStation.IsAllowHKPlcConnect) | ||||
{ | { | ||||
@@ -1944,7 +1944,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
}), "西门子和海科PLC重新连接", true); | }), "西门子和海科PLC重新连接", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
GVL_BigStation.HeartBeatToPlc = !GVL_BigStation.HeartBeatToPlc; | GVL_BigStation.HeartBeatToPlc = !GVL_BigStation.HeartBeatToPlc; | ||||
HKDevice.HK_PLC_S7.Write("DB99.DBX0.0", GVL_BigStation.HeartBeatToPlc); | HKDevice.HK_PLC_S7.Write("DB99.DBX0.0", GVL_BigStation.HeartBeatToPlc); | ||||
@@ -2016,7 +2016,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||||
} | } | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
}), "海科plc和西门子数据交互", true); | }), "海科plc和西门子数据交互", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
testRawMaterialNameData();//自定义料仓名称 | testRawMaterialNameData();//自定义料仓名称 | ||||
if (GVL_BigStation.Order_Cancel) | if (GVL_BigStation.Order_Cancel) | ||||
@@ -20,7 +20,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||||
bool printFirstLog = false; | bool printFirstLog = false; | ||||
public void Init() | public void Init() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnected) | if (IsConnected) | ||||
{ | { | ||||
@@ -23,7 +23,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||||
PropertyInfo[] properties = type.GetProperties(); | PropertyInfo[] properties = type.GetProperties(); | ||||
double Offset = 0.0; | double Offset = 0.0; | ||||
string addressPos = ""; | string addressPos = ""; | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
foreach (PropertyInfo mi in properties) | foreach (PropertyInfo mi in properties) | ||||
{ | { | ||||
@@ -80,7 +80,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
Heartbeat = GVL_BigStation.HeartBeatFromPlc; | Heartbeat = GVL_BigStation.HeartBeatFromPlc; | ||||
Thread.Sleep(100); | Thread.Sleep(100); | ||||
@@ -72,7 +72,7 @@ namespace BPASmartClient.JXJFoodSmallStation | |||||
Json<LocalRecipeDataColl>.Save(); | Json<LocalRecipeDataColl>.Save(); | ||||
Json<RemoteRecipeDataColl>.Save(); | Json<RemoteRecipeDataColl>.Save(); | ||||
MessageNotify.GetInstance.LogSave(); | MessageNotify.GetInstance.LogSave(); | ||||
ThreadManage.GetInstance().Dispose(); | |||||
TaskManage.GetInstance.Dispose(); | |||||
} | } | ||||
private void MenuInit() | private void MenuInit() | ||||
@@ -19,7 +19,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC | |||||
public PlcReadAddressDB45 DeviceStatus = new PlcReadAddressDB45(); | public PlcReadAddressDB45 DeviceStatus = new PlcReadAddressDB45(); | ||||
public void Init() | public void Init() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnected) | if (IsConnected) | ||||
{ | { | ||||
@@ -83,7 +83,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
RegisterInit(); | RegisterInit(); | ||||
DeviceConnect(); | DeviceConnect(); | ||||
//Json<RemoteRecipeDataColl>.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据 | //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; | GVL_SmallStation.GetInstance.DisEnableStockAlarm = Json<DevicePar>.Data.deviceConnectPar.ShieldStockbinAlarm; | ||||
if (HKDevice.IsConnected) | if (HKDevice.IsConnected) | ||||
@@ -104,7 +104,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
} | } | ||||
Thread.Sleep(200); | Thread.Sleep(200); | ||||
}), "海科plc通信心跳", true); | }), "海科plc通信心跳", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (GVL_SmallStation.GetInstance.Order_Cancel) | if (GVL_SmallStation.GetInstance.Order_Cancel) | ||||
{ | { | ||||
@@ -117,7 +117,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
} | } | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
}), "小料站流程控制", true); | }), "小料站流程控制", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
RealTimeData(); | RealTimeData(); | ||||
foreach (var item in Json<DevicePar>.Data.windSendRawMaterial) | foreach (var item in Json<DevicePar>.Data.windSendRawMaterial) | ||||
@@ -133,7 +133,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
} | } | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
}), "西门子PLC和小料站PLC的实时数据交互流程", true); | }), "西门子PLC和小料站PLC的实时数据交互流程", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
HKPlcRead(); | HKPlcRead(); | ||||
GetStatus(); | GetStatus(); | ||||
@@ -1575,7 +1575,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
WindSendDevice.Init(); | WindSendDevice.Init(); | ||||
MessageNotify.GetInstance.ShowRunLog("风送粉料plc初始化完成"); | MessageNotify.GetInstance.ShowRunLog("风送粉料plc初始化完成"); | ||||
} | } | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -34,7 +34,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | public ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>(); | ||||
private void DeviceDataInit() | private void DeviceDataInit() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < DeviceLists.Count; i++) | for (int i = 0; i < DeviceLists.Count; i++) | ||||
{ | { | ||||
@@ -58,7 +58,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
{ | { | ||||
devices.ElementAt(deviceIndex).DeviceName = DeviceLists.ElementAt(i).Value.DeviceName; | 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); | DeviceLists[DeviceLists.ElementAt(i).Key].Init(deviceName); | ||||
} | } | ||||
@@ -112,7 +112,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
//TestData(); | //TestData(); | ||||
IpAddressLines(); | IpAddressLines(); | ||||
DeviceDataInit(); | DeviceDataInit(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IPQueues.Count >= IPLists.Count) | if (IPQueues.Count >= IPLists.Count) | ||||
IpAddressLines(); | IpAddressLines(); | ||||
@@ -344,7 +344,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
//AlarmHelper<AlarmInfo>.Init(); | //AlarmHelper<AlarmInfo>.Init(); | ||||
if (modbusTcp.Connected) | if (modbusTcp.Connected) | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (modbusTcp.Connected) | if (modbusTcp.Connected) | ||||
{ | { | ||||
@@ -408,7 +408,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
public void Dispose() | public void Dispose() | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听"); | |||||
TaskManage.GetInstance.StopTask($"{DeviceName} 开始监听"); | |||||
} | } | ||||
@@ -19,7 +19,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||||
public XL_DataColl_DB DataColl = new XL_DataColl_DB(); | public XL_DataColl_DB DataColl = new XL_DataColl_DB(); | ||||
public void Init() | public void Init() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnected) | if (IsConnected) | ||||
{ | { | ||||
@@ -20,7 +20,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||||
public bool test; | public bool test; | ||||
public void Init() | public void Init() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (IsConnected) | if (IsConnected) | ||||
{ | { | ||||
@@ -20,7 +20,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||||
{ | { | ||||
public ManualControlViewModel() | public ManualControlViewModel() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
PlcSystemMode = GVL_SmallStation.GetInstance.PlcSystemMode; | PlcSystemMode = GVL_SmallStation.GetInstance.PlcSystemMode; | ||||
//SystemMode = GVL_SmallStation.GetInstance.PlcSystemMode ? "手动" : "自动"; | //SystemMode = GVL_SmallStation.GetInstance.PlcSystemMode ? "手动" : "自动"; | ||||
@@ -187,7 +187,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||||
MessageNotify.GetInstance.ShowUserLog("手动清零配方完成数目。"); | MessageNotify.GetInstance.ShowUserLog("手动清零配方完成数目。"); | ||||
} | } | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum; | RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum; | ||||
Recipe1DosingComplete = GVL_SmallStation.GetInstance.RecipeStockBinDosing[0].ToBinString(); | Recipe1DosingComplete = GVL_SmallStation.GetInstance.RecipeStockBinDosing[0].ToBinString(); | ||||
@@ -50,7 +50,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (devices.Count > 0) | if (devices.Count > 0) | ||||
{ | { | ||||
@@ -97,7 +97,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||||
}), "启动配方下发",true); | }), "启动配方下发",true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
for (int i = 0; i < Recipes.Count; i++) | for (int i = 0; i < Recipes.Count; i++) | ||||
{ | { | ||||
@@ -24,7 +24,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||||
{ | { | ||||
public RobotViewModel() | public RobotViewModel() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(() => | |||||
TaskManage.GetInstance.StartLong(() => | |||||
{ | { | ||||
IsRunProgramNum = GVL_SmallStation.GetInstance.RobotProgramNum; | IsRunProgramNum = GVL_SmallStation.GetInstance.RobotProgramNum; | ||||
RobotIsAutoMode = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(2); | RobotIsAutoMode = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(2); | ||||
@@ -7,7 +7,7 @@ | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Helper" Version="1.0.66" /> | |||||
<PackageReference Include="BPA.Helper" Version="1.0.67" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
</Project> | </Project> |
@@ -101,7 +101,7 @@ namespace BPASmartClient.JakaRobot | |||||
//bool ErrorFlag = false; | //bool ErrorFlag = false; | ||||
//ThreadManage.GetInstance().StartLong(new Action(() => | |||||
//TaskManage.GetInstance.StartLong(new Action(() => | |||||
//{ | //{ | ||||
// if (rshd == -1 || login == false) | // if (rshd == -1 || login == false) | ||||
// { | // { | ||||
@@ -149,7 +149,7 @@ namespace BPASmartClient.JakaRobot | |||||
MessageLog.GetInstance.Show("节卡机器人物理网络准备就绪"); | MessageLog.GetInstance.Show("节卡机器人物理网络准备就绪"); | ||||
Thread.Sleep(3000); | Thread.Sleep(3000); | ||||
bool ErrorFlag = false; | bool ErrorFlag = false; | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (rshd == -1 || login == false) | if (rshd == -1 || login == false) | ||||
{ | { | ||||
@@ -14,7 +14,7 @@ namespace BPASmartClient.Juicer | |||||
{ | { | ||||
juicerHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate); | juicerHelper.Open(communicationPar.SerialPort, communicationPar.BaudRate); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
IsConnected = juicerHelper.IsOpen; | IsConnected = juicerHelper.IsOpen; | ||||
status["JuiceIsConnect"] = juicerHelper.IsOpen; | status["JuiceIsConnect"] = juicerHelper.IsOpen; | ||||
@@ -40,7 +40,7 @@ namespace BPASmartClient.KHKJ | |||||
private void MainLoop() | private void MainLoop() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (!free) | if (!free) | ||||
{ | { | ||||
@@ -49,7 +49,7 @@ namespace BPASmartClient.KHKJ | |||||
Thread.Sleep(500); | Thread.Sleep(500); | ||||
}), "KHKJ询问线程"); | }), "KHKJ询问线程"); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
ResolveMsg(); | ResolveMsg(); | ||||
}), "KHKJ解析线程"); | }), "KHKJ解析线程"); | ||||
@@ -87,7 +87,7 @@ namespace BPASmartClient.KLMCoffee | |||||
/// </summary> | /// </summary> | ||||
private void MainLoop() | private void MainLoop() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
if (!free) | if (!free) | ||||
{ | { | ||||
@@ -96,7 +96,7 @@ namespace BPASmartClient.KLMCoffee | |||||
Thread.Sleep(200); | Thread.Sleep(200); | ||||
}), "咖啡机询问线程"); | }), "咖啡机询问线程"); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
ResolveMsg(); | ResolveMsg(); | ||||
}), "咖啡机解析线程"); | }), "咖啡机解析线程"); | ||||
@@ -42,8 +42,8 @@ namespace BPASmartClient.Lebai | |||||
public override void Start() | public override void Start() | ||||
{ | { | ||||
LebaiHelper.GetInstance().Connect(communicationPar.IPAddress); | LebaiHelper.GetInstance().Connect(communicationPar.IPAddress); | ||||
ThreadManage.GetInstance().StartLong(() => { LebaiHelper.GetInstance().Reconnect(communicationPar.IPAddress); Thread.Sleep(5000); }, "机器人重连检测"); | |||||
ThreadManage.GetInstance().StartLong(() => | |||||
TaskManage.GetInstance.StartLong(() => { LebaiHelper.GetInstance().Reconnect(communicationPar.IPAddress); Thread.Sleep(5000); }, "机器人重连检测"); | |||||
TaskManage.GetInstance.StartLong(() => | |||||
{ | { | ||||
IsConnected = LebaiHelper.GetInstance().IsConnected; | IsConnected = LebaiHelper.GetInstance().IsConnected; | ||||
status["RobotIsConnected"] = LebaiHelper.GetInstance().IsConnected; | status["RobotIsConnected"] = LebaiHelper.GetInstance().IsConnected; | ||||
@@ -20,7 +20,7 @@ namespace BPASmartClient.PLC | |||||
{ | { | ||||
modbusTcp.ConnectOk = new Action(() => | modbusTcp.ConnectOk = new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
IsConnected = modbusTcp.Connected; | IsConnected = modbusTcp.Connected; | ||||
if (!IsConnected) IsWork = false; | if (!IsConnected) IsWork = false; | ||||
@@ -49,7 +49,7 @@ namespace BPASmartClient.MilkTeaCube | |||||
break; | break; | ||||
} | } | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
IsConnected = modbus.Connected; | IsConnected = modbus.Connected; | ||||
if (!IsConnected) IsWork = false; | if (!IsConnected) IsWork = false; | ||||
@@ -1,7 +1,6 @@ | |||||
global using BPA.Message; | global using BPA.Message; | ||||
global using BPA.Message.Enum; | global using BPA.Message.Enum; | ||||
global using BPASmartClient.Device; | global using BPASmartClient.Device; | ||||
global | |||||
global using BPA.Helper; | global using BPA.Helper; | ||||
global using BPASmartClient.MilkWithTea.Model; | global using BPASmartClient.MilkWithTea.Model; | ||||
global using BPASmartClient.Model; | global using BPASmartClient.Model; | ||||
@@ -29,7 +28,7 @@ namespace BPASmartClient.MilkWithTea | |||||
{ | { | ||||
base.OnStartup(e); | base.OnStartup(e); | ||||
SystemHelper.GetInstance.CreateDesktopShortcut(); | SystemHelper.GetInstance.CreateDesktopShortcut(); | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -96,7 +96,7 @@ namespace BPASmartClient.MilkWithTea | |||||
private void Initialize() | private void Initialize() | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
GetDevices(); | GetDevices(); | ||||
mainConsole = new MainConsole(); | mainConsole = new MainConsole(); | ||||
@@ -105,7 +105,7 @@ namespace BPASmartClient.MilkWithTea | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -1,5 +1,5 @@ | |||||
using BPASmartClient.MorkMOC; | using BPASmartClient.MorkMOC; | ||||
using CommunityToolkit.Mvvm.Input; | |||||
//using CommunityToolkit.Mvvm.Input; | |||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -19,16 +19,16 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// 本地奶茶配方列表 | /// 本地奶茶配方列表 | ||||
/// </summary> | /// </summary> | ||||
public ObservableCollection<LocalRecipe> localMaterialRecipes { get; set; } = Json<JsonLocalRecipes>.Data.localRecipes; | public ObservableCollection<LocalRecipe> localMaterialRecipes { get; set; } = Json<JsonLocalRecipes>.Data.localRecipes; | ||||
/// <summary> | /// <summary> | ||||
/// 删除配方奶茶 | /// 删除配方奶茶 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void DeleteRecipe(object o) | private void DeleteRecipe(object o) | ||||
{ | { | ||||
if (o == null) return; | if (o == null) return; | ||||
if(o is string id) | |||||
if (o is string id) | |||||
{ | { | ||||
var res = localMaterialRecipes.FirstOrDefault(p => p.RecipeID == id); | var res = localMaterialRecipes.FirstOrDefault(p => p.RecipeID == id); | ||||
if (res != null) | if (res != null) | ||||
@@ -36,8 +36,8 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
localMaterialRecipes.Remove(res); | localMaterialRecipes.Remove(res); | ||||
Json<JsonLocalRecipes>.Save(); | Json<JsonLocalRecipes>.Save(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -48,11 +48,11 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// 物料位置名称集合 | /// 物料位置名称集合 | ||||
/// </summary> | /// </summary> | ||||
public ObservableCollection<LocalMaterail> localMaterails { get; set; } = Json<JsonLocalRecipes>.Data.localMaterails; | public ObservableCollection<LocalMaterail> localMaterails { get; set; } = Json<JsonLocalRecipes>.Data.localMaterails; | ||||
/// <summary> | /// <summary> | ||||
/// 更新物料位置 | /// 更新物料位置 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void UpdateMaterialPosion() | private void UpdateMaterialPosion() | ||||
{ | { | ||||
Json<JsonLocalRecipes>.Save(); | Json<JsonLocalRecipes>.Save(); | ||||
@@ -61,12 +61,12 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
public LocalConfigureViewModel() | public LocalConfigureViewModel() | ||||
{ | { | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -1,11 +1,11 @@ | |||||
| | ||||
global using CommunityToolkit.Mvvm.Input; | |||||
//global using CommunityToolkit.Mvvm.Input; | |||||
using BPA.Helper; | using BPA.Helper; | ||||
namespace BPASmartClient.MilkWithTea.ViewModel | namespace BPASmartClient.MilkWithTea.ViewModel | ||||
{ | { | ||||
partial class MainControlViewModel: NotifyBase | |||||
partial class MainControlViewModel : NotifyBase | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
@@ -21,27 +21,48 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// <summary> | /// <summary> | ||||
/// 订单状态列表 | /// 订单状态列表 | ||||
/// </summary> | /// </summary> | ||||
public ObservableCollection<MorkOrder> orderStatusLists { get; set; } = new ObservableCollection<MorkOrder>(); | |||||
public ObservableCollection<MorkOrder> orderStatusLists { get; set; } = new ObservableCollection<MorkOrder>(); | |||||
/// <summary> | /// <summary> | ||||
/// 等待取餐列表 | /// 等待取餐列表 | ||||
/// </summary> | /// </summary> | ||||
public ObservableCollection<MorkOrder> WaitTakeMeal { get; set; } = new ObservableCollection<MorkOrder>(); | |||||
public ObservableCollection<MorkOrder> WaitTakeMeal { get; set; } = new ObservableCollection<MorkOrder>(); | |||||
/// <summary> | /// <summary> | ||||
/// 当前正在制作的奶茶 | /// 当前正在制作的奶茶 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
public string CurrentGood { get { return _currentGood; } set { _currentGood = value; OnPropertyChanged(); } } | |||||
private string _currentGood = "茉莉花茶"; | private string _currentGood = "茉莉花茶"; | ||||
/// <summary> | /// <summary> | ||||
/// 奶茶制作百分比 | /// 奶茶制作百分比 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
public string MakePercent { get { return _makePercent; } set { _makePercent = value; OnPropertyChanged(); } } | |||||
private string _makePercent = "0"; | private string _makePercent = "0"; | ||||
[ObservableProperty] | |||||
/// <summary> | |||||
/// 奶茶制作百分比 | |||||
/// </summary> | |||||
public LocalRecipe SelectedRecipe { get { return _selectedRecipe; } set { _selectedRecipe = value; OnPropertyChanged(); } } | |||||
private LocalRecipe _selectedRecipe; | private LocalRecipe _selectedRecipe; | ||||
///// <summary> | |||||
///// 当前正在制作的奶茶 | |||||
///// </summary> | |||||
//[ObservableProperty] | |||||
//private string _currentGood = "茉莉花茶"; | |||||
///// <summary> | |||||
///// 奶茶制作百分比 | |||||
///// </summary> | |||||
//[ObservableProperty] | |||||
//private string _makePercent = "0"; | |||||
//[ObservableProperty] | |||||
//private LocalRecipe _selectedRecipe; | |||||
/// <summary> | /// <summary> | ||||
/// 当前正在制作的奶茶 | /// 当前正在制作的奶茶 | ||||
/// </summary> | /// </summary> | ||||
@@ -50,14 +71,14 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// <summary> | /// <summary> | ||||
/// 本地奶茶制作 | /// 本地奶茶制作 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void MakeGood() | private void MakeGood() | ||||
{ | { | ||||
if(SelectedRecipe == null) return; | |||||
foreach(var item in SelectedRecipe.localMaterails) | |||||
if (SelectedRecipe == null) return; | |||||
foreach (var item in SelectedRecipe.localMaterails) | |||||
{ | { | ||||
var res = Json<JsonLocalRecipes>.Data.localMaterails.FirstOrDefault(p => p.MaterialID == item.MaterialID); | var res = Json<JsonLocalRecipes>.Data.localMaterails.FirstOrDefault(p => p.MaterialID == item.MaterialID); | ||||
if ( res!= null) | |||||
if (res != null) | |||||
{ | { | ||||
item.MaterialPosition = res.MaterialPosition; | item.MaterialPosition = res.MaterialPosition; | ||||
} | } | ||||
@@ -67,7 +88,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
ActionManage.GetInstance.Send( "MakeGoods",SelectedRecipe); | |||||
ActionManage.GetInstance.Send("MakeGoods", SelectedRecipe); | |||||
} | } | ||||
@@ -82,13 +103,16 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
orderStatusLists.Add(new MorkOrder() | orderStatusLists.Add(new MorkOrder() | ||||
{ | { | ||||
StartDate = "11:20",EndDate ="11:24",CompleteDate ="4",OrderStatus = ORDER_STATUS.COMPLETED_COOK, | |||||
OrderPush = morkOrderPush | |||||
StartDate = "11:20", | |||||
EndDate = "11:24", | |||||
CompleteDate = "4", | |||||
OrderStatus = ORDER_STATUS.COMPLETED_COOK, | |||||
OrderPush = morkOrderPush | |||||
}); | }); | ||||
orderStatusLists.Add(new MorkOrder() | orderStatusLists.Add(new MorkOrder() | ||||
{ | { | ||||
StartDate = "11:36", | StartDate = "11:36", | ||||
EndDate = "11:40", | EndDate = "11:40", | ||||
CompleteDate = "4", | CompleteDate = "4", | ||||
@@ -98,7 +122,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
}); | }); | ||||
orderStatusLists.Add(new MorkOrder() | orderStatusLists.Add(new MorkOrder() | ||||
{ | { | ||||
StartDate = "10:33", | StartDate = "10:33", | ||||
EndDate = "10:28", | EndDate = "10:28", | ||||
CompleteDate = "5", | CompleteDate = "5", | ||||
@@ -111,12 +135,12 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// MQTT 大屏取餐通知委托 | /// MQTT 大屏取餐通知委托 | ||||
/// </summary> | /// </summary> | ||||
public void Init() | |||||
public void Init() | |||||
{ | { | ||||
//清除订单数据 | //清除订单数据 | ||||
//ActionManage.GetInstance.Register(new Action(() => | //ActionManage.GetInstance.Register(new Action(() => | ||||
@@ -178,7 +202,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle); | EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle); | ||||
ActionManage.GetInstance.Register(new Action<object[]>((o)=> | |||||
ActionManage.GetInstance.Register(new Action<object[]>((o) => | |||||
{ | { | ||||
if (o is object[] obj) | if (o is object[] obj) | ||||
{ | { | ||||
@@ -190,7 +214,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
} | } | ||||
}), "奶茶制作进度"); | }), "奶茶制作进度"); | ||||
} | } | ||||
@@ -203,7 +227,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
case ORDER_STATUS.COOKING: | case ORDER_STATUS.COOKING: | ||||
if (index >= 0 && index < orderStatusLists.Count) | if (index >= 0 && index < orderStatusLists.Count) | ||||
orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; | orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; | ||||
break; | break; | ||||
case ORDER_STATUS.COMPLETED_COOK: | case ORDER_STATUS.COMPLETED_COOK: | ||||
if (index >= 0 && index < orderStatusLists.Count) | if (index >= 0 && index < orderStatusLists.Count) | ||||
@@ -1,7 +1,7 @@ | |||||
using BPA.Helper; | using BPA.Helper; | ||||
using BPASmartClient.Model; | using BPASmartClient.Model; | ||||
using CommunityToolkit.Mvvm.Input; | |||||
//using CommunityToolkit.Mvvm.Input; | |||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -13,7 +13,7 @@ using System.Threading.Tasks; | |||||
namespace BPASmartClient.MilkWithTea.ViewModel | namespace BPASmartClient.MilkWithTea.ViewModel | ||||
{ | { | ||||
partial class PatrameterSettiongViewModel: NotifyBase | |||||
partial class PatrameterSettiongViewModel : NotifyBase | |||||
{ | { | ||||
string FileName => GLobal.deviceConfig.Count > 0 ? GLobal.deviceConfig[0].ShopName : string.Empty; | string FileName => GLobal.deviceConfig.Count > 0 ? GLobal.deviceConfig[0].ShopName : string.Empty; | ||||
@@ -22,41 +22,45 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// </summary> | /// </summary> | ||||
public ObservableCollection<int> materialPosions { get; set; } = new ObservableCollection<int>(); | public ObservableCollection<int> materialPosions { get; set; } = new ObservableCollection<int>(); | ||||
[ObservableProperty] | |||||
public int MaterialID { get { return _materialID; } set { _materialID = value; OnPropertyChanged(); } } | |||||
private int _materialID = 0; | private int _materialID = 0; | ||||
/// <summary> | /// <summary> | ||||
/// 出料重量 | /// 出料重量 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private int _outMaterilWeight; | |||||
public int OutMaterilWeight { get { return _outMaterilWeight; } set { _outMaterilWeight = value; OnPropertyChanged(); } } | |||||
private int _outMaterilWeight = 0; | |||||
/// <summary> | /// <summary> | ||||
/// 矫正的通道号 | /// 矫正的通道号 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
public int CorrectPassway { get { return _CorrectPassway; } set { _CorrectPassway = value; OnPropertyChanged(); } } | |||||
private int _CorrectPassway = 0; | private int _CorrectPassway = 0; | ||||
/// <summary> | /// <summary> | ||||
/// 通道是否开启 | /// 通道是否开启 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private bool _passwayIsOpen ; | |||||
public bool PasswayIsOpen { get { return _passwayIsOpen; } set { _passwayIsOpen = value; OnPropertyChanged(); } } | |||||
private bool _passwayIsOpen; | |||||
/// <summary> | /// <summary> | ||||
/// 矫正重量 | /// 矫正重量 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private int _correctMatetailWeight = 0; | |||||
public int CorrectMatetailWeight { get { return _correctMatetailWeight; } set { _correctMatetailWeight = value; OnPropertyChanged(); } } | |||||
private int _correctMatetailWeight; | |||||
/// <summary> | /// <summary> | ||||
/// 矫正时间 | |||||
/// 矫正重量 | |||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private int _outTime = 0; | |||||
public int OutTime { get { return _outTime; } set { _outTime = value; OnPropertyChanged(); } } | |||||
private int _outTime; | |||||
public bool IsEnable { get { return !GLobal.makeEnable; } set { GLobal.makeEnable = !value; OnPropertyChanged(); } } | public bool IsEnable { get { return !GLobal.makeEnable; } set { GLobal.makeEnable = !value; OnPropertyChanged(); } } | ||||
/// <summary> | /// <summary> | ||||
/// 出料动作 | /// 出料动作 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void OutMaterial() | private void OutMaterial() | ||||
{ | { | ||||
ActionManage.GetInstance.Send("通道口出料", new object[] { MaterialID, OutMaterilWeight }); | ActionManage.GetInstance.Send("通道口出料", new object[] { MaterialID, OutMaterilWeight }); | ||||
@@ -64,7 +68,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// <summary> | /// <summary> | ||||
/// 开始矫正 | /// 开始矫正 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void CheckPassway() | private void CheckPassway() | ||||
{ | { | ||||
@@ -72,7 +76,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// <summary> | /// <summary> | ||||
/// 开启通道 | /// 开启通道 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void OpenPassway() | private void OpenPassway() | ||||
{ | { | ||||
@@ -80,7 +84,7 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// <summary> | /// <summary> | ||||
/// 确认重量 | /// 确认重量 | ||||
/// </summary> | /// </summary> | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void CheckMaterailWeight() | private void CheckMaterailWeight() | ||||
{ | { | ||||
@@ -90,48 +94,52 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
/// <summary> | /// <summary> | ||||
/// 店铺名称 | /// 店铺名称 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _shopName = string.Empty; | |||||
public string ShopName { get { return _shopName; } set { _shopName = value; OnPropertyChanged(); } } | |||||
private string _shopName; | |||||
/// <summary> | /// <summary> | ||||
/// 店铺ID | /// 店铺ID | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _shopID = string.Empty; | |||||
public string ShopID { get { return _shopID; } set { _shopID = value; OnPropertyChanged(); } } | |||||
private string _shopID; | |||||
/// <summary> | /// <summary> | ||||
/// 设备ID | /// 设备ID | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _deviceID = string.Empty; | |||||
public string DeviceID { get { return _deviceID; } set { _deviceID = value; OnPropertyChanged(); } } | |||||
private string _deviceID; | |||||
/// <summary> | /// <summary> | ||||
/// PLC地址 | /// PLC地址 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _pLCAdress = string.Empty; | |||||
public string PLCAdress { get { return _pLCAdress; } set { _pLCAdress = value; OnPropertyChanged(); } } | |||||
private string _pLCAdress; | |||||
[ObservableProperty] | |||||
public bool IsPort { get { return _isPort; } set { _isPort = value; OnPropertyChanged(); } } | |||||
private bool _isPort = true; | private bool _isPort = true; | ||||
[ObservableProperty] | |||||
public Visibility VsIP { get { return _vsIP; } set { _vsIP = value; OnPropertyChanged(); } } | |||||
private Visibility _vsIP = Visibility.Hidden; | private Visibility _vsIP = Visibility.Hidden; | ||||
[ObservableProperty] | |||||
public Visibility VsPort { get { return _vsPort; } set { _vsPort = value; OnPropertyChanged(); } } | |||||
private Visibility _vsPort = Visibility.Visible; | private Visibility _vsPort = Visibility.Visible; | ||||
[ObservableProperty] | |||||
public string[] Ports { get { return _ports; } set { _ports = value; OnPropertyChanged(); } } | |||||
private string[] _ports; | private string[] _ports; | ||||
[ObservableProperty] | |||||
public string Prot { get { return _prot; } set { _prot = value; OnPropertyChanged(); } } | |||||
private string _prot; | private string _prot; | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void SaveDevices() | private void SaveDevices() | ||||
{ | { | ||||
SaveDeviceMessage(); | SaveDeviceMessage(); | ||||
} | } | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void ChangeCommunation() | private void ChangeCommunation() | ||||
{ | { | ||||
if(IsPort) | |||||
if (IsPort) | |||||
{ | { | ||||
VsPort = Visibility.Visible; | VsPort = Visibility.Visible; | ||||
VsIP = Visibility.Hidden; | VsIP = Visibility.Hidden; | ||||
@@ -157,24 +165,24 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
} | } | ||||
if (GLobal.deviceConfig.Count > 0) | if (GLobal.deviceConfig.Count > 0) | ||||
{ | { | ||||
ShopName = GLobal.deviceConfig.ElementAtOrDefault(0).ShopName ; | |||||
ShopName = GLobal.deviceConfig.ElementAtOrDefault(0).ShopName; | |||||
ShopID = GLobal.deviceConfig.ElementAtOrDefault(0).ShopId; | ShopID = GLobal.deviceConfig.ElementAtOrDefault(0).ShopId; | ||||
DeviceID = GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAt(0).DeviceId; | DeviceID = GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAt(0).DeviceId; | ||||
PLCAdress = GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAt(0).communicationDevcies.ElementAt(0).communicationPar.IPAddress; | PLCAdress = GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAt(0).communicationDevcies.ElementAt(0).communicationPar.IPAddress; | ||||
} | } | ||||
} | } | ||||
private void SaveDeviceMessage() | private void SaveDeviceMessage() | ||||
{ | { | ||||
if (GLobal.deviceConfig.Count > 0) | if (GLobal.deviceConfig.Count > 0) | ||||
{ | { | ||||
GLobal.deviceConfig.ElementAtOrDefault(0).ShopName = ShopName; | GLobal.deviceConfig.ElementAtOrDefault(0).ShopName = ShopName; | ||||
GLobal.deviceConfig.ElementAtOrDefault(0).ShopId = ShopID; | GLobal.deviceConfig.ElementAtOrDefault(0).ShopId = ShopID; | ||||
GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAtOrDefault(0).DeviceId = DeviceID; | GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAtOrDefault(0).DeviceId = DeviceID; | ||||
if(IsPort) | |||||
if (IsPort) | |||||
{ | { | ||||
GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAtOrDefault(0).communicationDevcies.ElementAtOrDefault(0).communicationPar.IsSerialPort = true; | GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAtOrDefault(0).communicationDevcies.ElementAtOrDefault(0).communicationPar.IsSerialPort = true; | ||||
GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAtOrDefault(0).communicationDevcies.ElementAtOrDefault(0).communicationPar.SerialPort = Prot; | GLobal.deviceConfig.ElementAtOrDefault(0).deviceModels.ElementAtOrDefault(0).communicationDevcies.ElementAtOrDefault(0).communicationPar.SerialPort = Prot; | ||||
@@ -192,6 +200,6 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -7,44 +7,45 @@ using System.Windows.Controls; | |||||
namespace BPASmartClient.MilkWithTea.ViewModel | namespace BPASmartClient.MilkWithTea.ViewModel | ||||
{ | { | ||||
partial class RecipeConfigeViewModel:NotifyBase | |||||
partial class RecipeConfigeViewModel : NotifyBase | |||||
{ | { | ||||
public static ObservableCollection<LocalMaterail> Materails { get; set; } = new ObservableCollection<LocalMaterail>(); | public static ObservableCollection<LocalMaterail> Materails { get; set; } = new ObservableCollection<LocalMaterail>(); | ||||
public Dictionary<string,string> materialNames { get; set; } = new Dictionary<string,string>(); | |||||
public Dictionary<string, string> materialNames { get; set; } = new Dictionary<string, string>(); | |||||
[ObservableProperty] | |||||
private string _name = String.Empty; | |||||
public string Name { get { return _name; } set { _name = value; OnPropertyChanged(); } } | |||||
private string _name; | |||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void AddMaterial() | private void AddMaterial() | ||||
{ | { | ||||
Materails.Add(new LocalMaterail()); | Materails.Add(new LocalMaterail()); | ||||
} | } | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void Delete(object o) | private void Delete(object o) | ||||
{ | { | ||||
if (o == null) return; | if (o == null) return; | ||||
if(o is ListBoxItem id) | |||||
if (o is ListBoxItem id) | |||||
{ | { | ||||
Materails.Remove((LocalMaterail)id.DataContext); | |||||
Materails.Remove((LocalMaterail)id.DataContext); | |||||
} | } | ||||
} | } | ||||
[BPARelayCommand] | |||||
//[BPARelayCommand] | |||||
private void Save() | private void Save() | ||||
{ | { | ||||
if(Name == String.Empty) | |||||
if (Name == String.Empty) | |||||
{ | { | ||||
return; | return; | ||||
} | } | ||||
if(Json<JsonLocalRecipes>.Data.localRecipes.FirstOrDefault(p=>p.RecipeName == Name)!= null) | |||||
if (Json<JsonLocalRecipes>.Data.localRecipes.FirstOrDefault(p => p.RecipeName == Name) != null) | |||||
{ | { | ||||
return; | return; | ||||
} | } | ||||
foreach(var materail in Materails) | |||||
foreach (var materail in Materails) | |||||
{ | { | ||||
materail.MaterialName = materialNames[materail.MaterialID]; | |||||
materail.MaterialName = materialNames[materail.MaterialID]; | |||||
} | } | ||||
Json<JsonLocalRecipes>.Data.localRecipes.Add(new LocalRecipe | Json<JsonLocalRecipes>.Data.localRecipes.Add(new LocalRecipe | ||||
{ | { | ||||
@@ -59,11 +60,11 @@ namespace BPASmartClient.MilkWithTea.ViewModel | |||||
public RecipeConfigeViewModel() | public RecipeConfigeViewModel() | ||||
{ | { | ||||
if(Json<JsonLocalRecipes>.Data.localMaterails.Count > 0) | |||||
if (Json<JsonLocalRecipes>.Data.localMaterails.Count > 0) | |||||
{ | { | ||||
foreach(var item in Json<JsonLocalRecipes>.Data.localMaterails) | |||||
foreach (var item in Json<JsonLocalRecipes>.Data.localMaterails) | |||||
{ | { | ||||
if(item.MaterialID!=null&&item.MaterialName!=null) | |||||
if (item.MaterialID != null && item.MaterialName != null) | |||||
{ | { | ||||
materialNames.Add(item.MaterialID, item.MaterialName); | materialNames.Add(item.MaterialID, item.MaterialName); | ||||
} | } | ||||
@@ -5,7 +5,7 @@ | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Helper" Version="1.0.66" /> | |||||
<PackageReference Include="BPA.Helper" Version="1.0.67" /> | |||||
<PackageReference Include="NModbus" Version="3.0.72" /> | <PackageReference Include="NModbus" Version="3.0.72" /> | ||||
<PackageReference Include="System.IO.Ports" Version="6.0.0" /> | <PackageReference Include="System.IO.Ports" Version="6.0.0" /> | ||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | <PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" /> | ||||
@@ -16,7 +16,7 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BPA.Helper" Version="1.0.66" /> | |||||
<PackageReference Include="BPA.Helper" Version="1.0.67" /> | |||||
<PackageReference Include="BPA.Message" Version="1.0.86" /> | <PackageReference Include="BPA.Message" Version="1.0.86" /> | ||||
<PackageReference Include="log4net" Version="2.0.15" /> | <PackageReference Include="log4net" Version="2.0.15" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -52,8 +52,8 @@ namespace BPASmartClient.MorkBF | |||||
DataParse();//数据解析 | DataParse();//数据解析 | ||||
ScreenDataServer();//大屏数据上报 | ScreenDataServer();//大屏数据上报 | ||||
ActionManage.GetInstance.Send("更新菜单"); | ActionManage.GetInstance.Send("更新菜单"); | ||||
ThreadManage.GetInstance().Start(FirePot1_Process, "炒锅1流程"); | |||||
ThreadManage.GetInstance().Start(FirePot2_Process, "炒锅2流程"); | |||||
TaskManage.GetInstance.Start(FirePot1_Process, "炒锅1流程"); | |||||
TaskManage.GetInstance.Start(FirePot2_Process, "炒锅2流程"); | |||||
DeviceProcessLogShow("MORKF 设备初始化完成"); | DeviceProcessLogShow("MORKF 设备初始化完成"); | ||||
} | } | ||||
@@ -1014,7 +1014,7 @@ namespace BPASmartClient.MorkBF | |||||
private void ScreenDataServer() | private void ScreenDataServer() | ||||
{ | { | ||||
LocalMqtt.GetInstance.Init(ScreenDeviceType.大炒); | LocalMqtt.GetInstance.Init(ScreenDeviceType.大炒); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
List<StatsModel> statsModels = new List<StatsModel>(); | List<StatsModel> statsModels = new List<StatsModel>(); | ||||
statsModels.Add(new StatsModel() { Name = "帝王蟹", Count = 666 }); | statsModels.Add(new StatsModel() { Name = "帝王蟹", Count = 666 }); | ||||
@@ -272,7 +272,7 @@ namespace BPASmartClient.MorkF | |||||
private void Task2ReadMaterialData() | private void Task2ReadMaterialData() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
//获取定位到达状态 | //获取定位到达状态 | ||||
@@ -302,7 +302,7 @@ namespace BPASmartClient.MorkF | |||||
}), 2); | }), 2); | ||||
}), "ReadMaterialSmartArriveCompleteData", true); | }), "ReadMaterialSmartArriveCompleteData", true); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
ReadMaterialData(); | ReadMaterialData(); | ||||
@@ -423,7 +423,7 @@ namespace BPASmartClient.MorkF | |||||
#region 菜品库 | #region 菜品库 | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
FoodLibInit(); | FoodLibInit(); | ||||
}), "FoodLibInit"); | }), "FoodLibInit"); | ||||
@@ -434,7 +434,7 @@ namespace BPASmartClient.MorkF | |||||
}), "ModeChange"); | }), "ModeChange"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
if (!UpdateMaterialLibraryStock()) | if (!UpdateMaterialLibraryStock()) | ||||
{ | { | ||||
@@ -444,56 +444,56 @@ namespace BPASmartClient.MorkF | |||||
}), "SurplusCheck"); | }), "SurplusCheck"); | ||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
Electromagnetism(o); | Electromagnetism(o); | ||||
}), "Electromagnetism"); | }), "Electromagnetism"); | ||||
}), "Electromagnetism"); | }), "Electromagnetism"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
PawToPoint1(); | PawToPoint1(); | ||||
}), "PawToPoint1"); | }), "PawToPoint1"); | ||||
}), "PawToPoint1"); | }), "PawToPoint1"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
PawToPoint2(); | PawToPoint2(); | ||||
}), "PawToPoint2"); | }), "PawToPoint2"); | ||||
}), "PawToPoint2"); | }), "PawToPoint2"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
PawToPoint3(); | PawToPoint3(); | ||||
}), "PawToPoint3"); | }), "PawToPoint3"); | ||||
}), "PawToPoint3"); | }), "PawToPoint3"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
GetDistance_1(); | GetDistance_1(); | ||||
}), "GetDistance_1"); | }), "GetDistance_1"); | ||||
}), "GetDistance_1"); | }), "GetDistance_1"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
GetDistance_2(); | GetDistance_2(); | ||||
}), "GetDistance_2"); | }), "GetDistance_2"); | ||||
}), "GetDistance_2"); | }), "GetDistance_2"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
GetDistance_3(); | GetDistance_3(); | ||||
}), "GetDistance_3"); | }), "GetDistance_3"); | ||||
}), "GetDistance_3"); | }), "GetDistance_3"); | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
PawExtend(); | PawExtend(); | ||||
}), "PawTurnFront"); | }), "PawTurnFront"); | ||||
@@ -501,14 +501,14 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
PawShrink(); | PawShrink(); | ||||
}), "PawTurnBack"); | }), "PawTurnBack"); | ||||
}), "PawTurnBack"); | }), "PawTurnBack"); | ||||
ActionManage.GetInstance.Register(new Action<object>((list) => | ActionManage.GetInstance.Register(new Action<object>((list) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
if (list is List<int> list_int) | if (list is List<int> list_int) | ||||
{ | { | ||||
@@ -549,7 +549,7 @@ namespace BPASmartClient.MorkF | |||||
}), "ArmRunRight"); | }), "ArmRunRight"); | ||||
ActionManage.GetInstance.Register(new Action<object>((list) => | ActionManage.GetInstance.Register(new Action<object>((list) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
if (list is List<int> list_int) | if (list is List<int> list_int) | ||||
{ | { | ||||
@@ -562,7 +562,7 @@ namespace BPASmartClient.MorkF | |||||
}), "SetNowPosition"); | }), "SetNowPosition"); | ||||
ActionManage.GetInstance.Register(new Action<object>((list) => | ActionManage.GetInstance.Register(new Action<object>((list) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
if (list is List<object> list_object) | if (list is List<object> list_object) | ||||
{ | { | ||||
@@ -586,7 +586,7 @@ namespace BPASmartClient.MorkF | |||||
#region 配料控制 | #region 配料控制 | ||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
OutSeasoning(o, fryIndex); | OutSeasoning(o, fryIndex); | ||||
}), "OutMaterials"); | }), "OutMaterials"); | ||||
@@ -597,7 +597,7 @@ namespace BPASmartClient.MorkF | |||||
#region 炒锅 | #region 炒锅 | ||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
Plc1Reset(fryIndex); | Plc1Reset(fryIndex); | ||||
}), "Plc1Reset"); | }), "Plc1Reset"); | ||||
@@ -605,7 +605,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
AddOil(); | AddOil(); | ||||
}), "AddOil"); | }), "AddOil"); | ||||
@@ -613,7 +613,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
StartFire(fryIndex); | StartFire(fryIndex); | ||||
}), "StartFire"); | }), "StartFire"); | ||||
@@ -621,7 +621,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
StopFire(fryIndex); | StopFire(fryIndex); | ||||
}), "StopFire"); | }), "StopFire"); | ||||
@@ -629,7 +629,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
StartStir(fryIndex); | StartStir(fryIndex); | ||||
}), "StartStir"); | }), "StartStir"); | ||||
@@ -637,7 +637,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
StopStir(fryIndex); | StopStir(fryIndex); | ||||
}), "StopStir"); | }), "StopStir"); | ||||
@@ -645,7 +645,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
MagnetOn(fryIndex); | MagnetOn(fryIndex); | ||||
}), "MagnetOn"); | }), "MagnetOn"); | ||||
@@ -653,7 +653,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
MagnetOff(fryIndex); | MagnetOff(fryIndex); | ||||
}), "MagnetOff"); | }), "MagnetOff"); | ||||
@@ -661,7 +661,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
string error; | string error; | ||||
OutFood(fryIndex, out error); | OutFood(fryIndex, out error); | ||||
@@ -670,7 +670,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
StirArmGoOrigin(fryIndex); | StirArmGoOrigin(fryIndex); | ||||
}), "StirArmGoOrigin"); | }), "StirArmGoOrigin"); | ||||
@@ -678,7 +678,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
string error; | string error; | ||||
StirArmGoWork(fryIndex, out error); | StirArmGoWork(fryIndex, out error); | ||||
@@ -687,7 +687,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
HBOTGoWork(fryIndex); | HBOTGoWork(fryIndex); | ||||
}), "HBOTGoWork"); | }), "HBOTGoWork"); | ||||
@@ -695,7 +695,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action(() => | ActionManage.GetInstance.Register(new Action(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
OutMeal(fryIndex); | OutMeal(fryIndex); | ||||
}), "OutMeal"); | }), "OutMeal"); | ||||
@@ -703,7 +703,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
SetFire(o, fryIndex); | SetFire(o, fryIndex); | ||||
}), "SetFire"); | }), "SetFire"); | ||||
@@ -711,7 +711,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
SetFry(o); | SetFry(o); | ||||
}), "SetFry"); | }), "SetFry"); | ||||
@@ -719,7 +719,7 @@ namespace BPASmartClient.MorkF | |||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
SetStir(o, fryIndex); | SetStir(o, fryIndex); | ||||
}), "SetStir"); | }), "SetStir"); | ||||
@@ -840,12 +840,12 @@ namespace BPASmartClient.MorkF | |||||
if (!morkFs.ContainsKey(num)) | if (!morkFs.ContainsKey(num)) | ||||
{ | { | ||||
//根据调试界面的当前炒锅编号停止炒制线程 | //根据调试界面的当前炒锅编号停止炒制线程 | ||||
ThreadManage.GetInstance().StopTask(String.Format(striConst, fryIndex.ToString(), nowStirFryGood[fryIndex].GoodName), new Action(() => { Plc1Reset(fryIndex); })); | |||||
TaskManage.GetInstance.StopTask(String.Format(striConst, fryIndex.ToString(), nowStirFryGood[fryIndex].GoodName), new Action(() => { Plc1Reset(fryIndex); })); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
//根据炒锅编号停止炒制线程 | //根据炒锅编号停止炒制线程 | ||||
ThreadManage.GetInstance().StopTask(String.Format(striConst, fryIndex.ToString(), nowStirFryGood[num].GoodName), new Action(() => { Plc1Reset(num); })); | |||||
TaskManage.GetInstance.StopTask(String.Format(striConst, fryIndex.ToString(), nowStirFryGood[num].GoodName), new Action(() => { Plc1Reset(num); })); | |||||
} | } | ||||
} | } | ||||
@@ -1530,7 +1530,7 @@ namespace BPASmartClient.MorkF | |||||
} | } | ||||
WriteSpeed(50000);//移动速度 | WriteSpeed(50000);//移动速度 | ||||
//ThreadManage.GetInstance().Start(new Action(() => | |||||
//TaskManage.GetInstance.Start(new Action(() => | |||||
//{ | //{ | ||||
// //收缩爪子 | // //收缩爪子 | ||||
// PawShrink(); | // PawShrink(); | ||||
@@ -1834,7 +1834,7 @@ namespace BPASmartClient.MorkF | |||||
/// <param name="isGet"></param> | /// <param name="isGet"></param> | ||||
private void GetMaterailTest(MaterialOperation materialOperation) | private void GetMaterailTest(MaterialOperation materialOperation) | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
bool ret = false; | bool ret = false; | ||||
try | try | ||||
@@ -1955,7 +1955,7 @@ namespace BPASmartClient.MorkF | |||||
/// </summary> | /// </summary> | ||||
public void Plc1Reset(int num) | public void Plc1Reset(int num) | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
StopFire(num); | StopFire(num); | ||||
Thread.Sleep(200); | Thread.Sleep(200); | ||||
@@ -2581,7 +2581,7 @@ namespace BPASmartClient.MorkF | |||||
//炒锅取菜状态置为未取到 | //炒锅取菜状态置为未取到 | ||||
morkFs[i].GetMaterialComplete = false; | morkFs[i].GetMaterialComplete = false; | ||||
//开启线程进行炒制 | //开启线程进行炒制 | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -2604,7 +2604,7 @@ namespace BPASmartClient.MorkF | |||||
foreach (var potActions in res.StirPotActions) | foreach (var potActions in res.StirPotActions) | ||||
{ | { | ||||
if (ThreadManage.GetInstance().IsComplete(String.Format(striConst, i.ToString(), nowStirFryGood[i].GoodName))) | |||||
if (TaskManage.GetInstance.IsComplete(String.Format(striConst, i.ToString(), nowStirFryGood[i].GoodName))) | |||||
{ | { | ||||
return; | return; | ||||
} | } | ||||
@@ -2837,7 +2837,7 @@ namespace BPASmartClient.MorkF | |||||
morkFs[i].ScreenClear(); | morkFs[i].ScreenClear(); | ||||
//异常菜品统计数量+1 | //异常菜品统计数量+1 | ||||
morkFs[i].orderAbnormalCount++; | morkFs[i].orderAbnormalCount++; | ||||
ThreadManage.GetInstance().StopTask($"炒锅{i}{res.GoodName}炒制线程"); | |||||
TaskManage.GetInstance.StopTask($"炒锅{i}{res.GoodName}炒制线程"); | |||||
MessageLog.GetInstance.ShowEx($"炒锅{i}炒制菜品{res.GoodName}出错,错误信息:" + ex.Message); | MessageLog.GetInstance.ShowEx($"炒锅{i}炒制菜品{res.GoodName}出错,错误信息:" + ex.Message); | ||||
} | } | ||||
finally | finally | ||||
@@ -2865,7 +2865,7 @@ namespace BPASmartClient.MorkF | |||||
/// </summary> | /// </summary> | ||||
private void UpdateMaterialSurplus() | private void UpdateMaterialSurplus() | ||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
List<MaterialInfo> listSurplus = MaterialSurplusOperation.GetInstance().materialSurplus.dicSurplus; | List<MaterialInfo> listSurplus = MaterialSurplusOperation.GetInstance().materialSurplus.dicSurplus; | ||||
@@ -2923,7 +2923,7 @@ namespace BPASmartClient.MorkF | |||||
ml_morkf.MaterailIsWorking = true; | ml_morkf.MaterailIsWorking = true; | ||||
MessageLog.GetInstance.Show("开始操作菜品库"); | MessageLog.GetInstance.Show("开始操作菜品库"); | ||||
//ThreadManage.GetInstance().Start(new Action(()=>{ | |||||
//TaskManage.GetInstance.Start(new Action(()=>{ | |||||
// GetMaterail(res.x_high, res.y, res.fryNum); | // GetMaterail(res.x_high, res.y, res.fryNum); | ||||
//}),"菜品库操作"); | //}),"菜品库操作"); | ||||
GetMaterailTest(res); | GetMaterailTest(res); | ||||
@@ -2944,7 +2944,7 @@ namespace BPASmartClient.MorkF | |||||
private void ScreenDataServer() | private void ScreenDataServer() | ||||
{ | { | ||||
LocalMqtt.GetInstance.Init(ScreenDeviceType.小炒); | LocalMqtt.GetInstance.Init(ScreenDeviceType.小炒); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
//statsModels.Add(new StatsModel() { Name = "帝王蟹", Count = 666 }); | //statsModels.Add(new StatsModel() { Name = "帝王蟹", Count = 666 }); | ||||
ScreenModelMinWok maxWok = new ScreenModelMinWok | ScreenModelMinWok maxWok = new ScreenModelMinWok | ||||
@@ -318,7 +318,7 @@ namespace BPASmartClient.MorkF.ViewModel | |||||
; | ; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
//variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | //variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | ||||
@@ -1029,7 +1029,7 @@ namespace BPASmartClient.MorkF.ViewModel | |||||
PhysicalMaterialCoordinate(); | PhysicalMaterialCoordinate(); | ||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
if(o is List<string> nums) | if(o is List<string> nums) | ||||
{ | { | ||||
@@ -1039,7 +1039,7 @@ namespace BPASmartClient.MorkF.ViewModel | |||||
}), "CalibrationCallBack"); | }), "CalibrationCallBack"); | ||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
ThreadManage.GetInstance().Start(new Action(() => | |||||
TaskManage.GetInstance.Start(new Action(() => | |||||
{ | { | ||||
if (o is List<string> nums) | if (o is List<string> nums) | ||||
{ | { | ||||
@@ -8,7 +8,7 @@ using System.Collections.Generic; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using static BPA.Helper.EventBus; | |||||
namespace BPASmartClient.MorkMOC | namespace BPASmartClient.MorkMOC | ||||
{ | { | ||||
@@ -22,7 +22,7 @@ namespace BPASmartClient.MorkMOC | |||||
//放大倍数 | //放大倍数 | ||||
const int expand = 10; | const int expand = 10; | ||||
public override void DoMain() | public override void DoMain() | ||||
{ | { | ||||
ServerInit(); | ServerInit(); | ||||
@@ -132,9 +132,9 @@ namespace BPASmartClient.MorkMOC | |||||
/// 设定出料重量 | /// 设定出料重量 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="goodPushes"></param> | /// <param name="goodPushes"></param> | ||||
private void SetMaterialsWeight(Dictionary<int,int> goodPushes) | |||||
private void SetMaterialsWeight(Dictionary<int, int> goodPushes) | |||||
{ | { | ||||
foreach(var good in goodPushes) | |||||
foreach (var good in goodPushes) | |||||
{ | { | ||||
WriteControl(polymerBatching.plcData[good.Key - 1].WeightVar, good.Value * expand); | WriteControl(polymerBatching.plcData[good.Key - 1].WeightVar, good.Value * expand); | ||||
DeviceProcessLogShow($"{good.Key}号通道出料量:{good.Value}g"); | DeviceProcessLogShow($"{good.Key}号通道出料量:{good.Value}g"); | ||||
@@ -151,7 +151,7 @@ namespace BPASmartClient.MorkMOC | |||||
{ | { | ||||
WriteControl(polymerBatching.plcData[good.Key - 1].StartUpVar, true); | WriteControl(polymerBatching.plcData[good.Key - 1].StartUpVar, true); | ||||
Thread.Sleep(3000);//写入PLC开启通道后 PLC会先把完成信号置0,等待出料完成后置1 | Thread.Sleep(3000);//写入PLC开启通道后 PLC会先把完成信号置0,等待出料完成后置1 | ||||
while(!morkMoc.OutMaterailCompelete)//接收到完成信号后退出循环 | |||||
while (!morkMoc.OutMaterailCompelete)//接收到完成信号后退出循环 | |||||
{ | { | ||||
Thread.Sleep(1000); | Thread.Sleep(1000); | ||||
//需要加入超时提示或处理 | //需要加入超时提示或处理 | ||||
@@ -165,7 +165,7 @@ namespace BPASmartClient.MorkMOC | |||||
{ | { | ||||
GetStatus("M10.0", new Action<object>((obj) => | GetStatus("M10.0", new Action<object>((obj) => | ||||
{ | { | ||||
if (obj is bool[] bools && bools.Length > 0 ) | |||||
if (obj is bool[] bools && bools.Length > 0) | |||||
{ | { | ||||
morkMoc.OutMaterailCompelete = bools[0]; | morkMoc.OutMaterailCompelete = bools[0]; | ||||
} | } | ||||
@@ -182,14 +182,14 @@ namespace BPASmartClient.MorkMOC | |||||
ActionManage.GetInstance.Register(new Action<object>((o) => | ActionManage.GetInstance.Register(new Action<object>((o) => | ||||
{ | { | ||||
if (o == null) return; | if (o == null) return; | ||||
if(o is LocalRecipe recipe) | |||||
if (o is LocalRecipe recipe) | |||||
{ | { | ||||
Dictionary<int, int> OrderPushes = new Dictionary<int, int>(); | Dictionary<int, int> OrderPushes = new Dictionary<int, int>(); | ||||
foreach(var item in recipe.localMaterails) | |||||
foreach (var item in recipe.localMaterails) | |||||
{ | { | ||||
OrderPushes.Add(Convert.ToInt32(item.MaterialPosition), Convert.ToInt32(item.MaterialWeight)); | OrderPushes.Add(Convert.ToInt32(item.MaterialPosition), Convert.ToInt32(item.MaterialWeight)); | ||||
} | } | ||||
morkMoc.morkOrderPushes.Enqueue(new OrderLocInfo() | morkMoc.morkOrderPushes.Enqueue(new OrderLocInfo() | ||||
{ | { | ||||
GoodName = recipe.RecipeName, | GoodName = recipe.RecipeName, | ||||
@@ -197,7 +197,7 @@ namespace BPASmartClient.MorkMOC | |||||
GoodPushes = OrderPushes | GoodPushes = OrderPushes | ||||
}); | }); | ||||
} | } | ||||
}),"MakeGoods"); | |||||
}), "MakeGoods"); | |||||
} | } | ||||
public override void Stop() | public override void Stop() | ||||
@@ -8,45 +8,48 @@ using System.Threading.Tasks; | |||||
namespace BPASmartClient.MorkMOC | namespace BPASmartClient.MorkMOC | ||||
{ | { | ||||
public partial class LocalMaterail:NotifyBase | |||||
public partial class LocalMaterail : NotifyBase | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 物料ID | /// 物料ID | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _materialID; | |||||
/// <summary> | |||||
/// 物料本地名称 | |||||
/// </summary> | |||||
[ObservableProperty] | |||||
private string? _materialName; | |||||
public string MaterialID { get { return _materialID; } set { _materialID = value; OnPropertyChanged(); } } | |||||
private string _materialID; | |||||
/// <summary> | |||||
/// 物料本地名称 | |||||
/// </summary> | |||||
public string MaterialName { get { return _materialName; } set { _materialName = value; OnPropertyChanged(); } } | |||||
private string _materialName; | |||||
/// <summary> | /// <summary> | ||||
/// 物料位置 | /// 物料位置 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private int? _materialPosition; | |||||
public int MaterialPosition { get { return _materialPosition; } set { _materialPosition = value; OnPropertyChanged(); } } | |||||
private int _materialPosition; | |||||
/// <summary> | /// <summary> | ||||
/// 物料重量 | /// 物料重量 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _materialWeight; | |||||
public string MaterialWeight { get { return _materialWeight; } set { _materialWeight = value; OnPropertyChanged(); } } | |||||
private string _materialWeight; | |||||
} | } | ||||
public partial class LocalRecipe:NotifyBase | |||||
public partial class LocalRecipe : NotifyBase | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 配方ID | |||||
/// 物料重量 | |||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _recipeID; | |||||
public string RecipeID { get { return _recipeID; } set { _recipeID = value; OnPropertyChanged(); } } | |||||
private string _recipeID; | |||||
/// <summary> | /// <summary> | ||||
/// 配方名称 | /// 配方名称 | ||||
/// </summary> | /// </summary> | ||||
[ObservableProperty] | |||||
private string? _recipeName; | |||||
public string RecipeName { get { return _recipeName; } set { _recipeName = value; OnPropertyChanged(); } } | |||||
private string _recipeName; | |||||
/// <summary> | /// <summary> | ||||
/// 原料集合 | /// 原料集合 | ||||
/// </summary> | /// </summary> | ||||
@@ -65,7 +65,7 @@ namespace BPASmartClient.MorkMV1 | |||||
if (o.Length > 0) | if (o.Length > 0) | ||||
{ | { | ||||
Random rd = new Random(); | Random rd = new Random(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | ||||
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | ||||
@@ -26,7 +26,7 @@ namespace BPASmartClient.MorkMV1 | |||||
mQTTProxy.ConnectOk = new Action(() => | mQTTProxy.ConnectOk = new Action(() => | ||||
{ | { | ||||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | ||||
SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | ||||
@@ -37,7 +37,7 @@ namespace BPASmartClient.MorkMV1.ViewModel | |||||
}); | }); | ||||
SimOrderRandomCloseCommand = new BPARelayCommand(() => | SimOrderRandomCloseCommand = new BPARelayCommand(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("ForOrder"); | |||||
TaskManage.GetInstance.StopTask("ForOrder"); | |||||
MessageLog.GetInstance.Show("停止模拟随机订单"); | MessageLog.GetInstance.Show("停止模拟随机订单"); | ||||
}); | }); | ||||
EnableLacalSimOrder = new BPARelayCommand(() => | EnableLacalSimOrder = new BPARelayCommand(() => | ||||
@@ -37,7 +37,7 @@ namespace BPASmartClient.MorkMW | |||||
ConnectKlpRobot("192.168.0.100", 8001); | ConnectKlpRobot("192.168.0.100", 8001); | ||||
ServerInit(); | ServerInit(); | ||||
DataParse(); | DataParse(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => { VariableMonitor(); Thread.Sleep(5); }), "机器人变量状态监控线程", true); | |||||
TaskManage.GetInstance.StartLong(new Action(() => { VariableMonitor(); Thread.Sleep(5); }), "机器人变量状态监控线程", true); | |||||
} | } | ||||
private void VaribleMonitorDis() | private void VaribleMonitorDis() | ||||
@@ -63,7 +63,7 @@ namespace BPASmartClient.MorkS | |||||
if (o.Length > 0) | if (o.Length > 0) | ||||
{ | { | ||||
Random rd = new Random(); | Random rd = new Random(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | ||||
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | ||||
@@ -26,7 +26,7 @@ namespace BPASmartClient.MorkS | |||||
mQTTProxy.ConnectOk = new Action(() => | mQTTProxy.ConnectOk = new Action(() => | ||||
{ | { | ||||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | ||||
SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | ||||
@@ -37,7 +37,7 @@ namespace BPASmartClient.MorkS.ViewModel | |||||
}); | }); | ||||
SimOrderRandomCloseCommand = new BPARelayCommand(() => | SimOrderRandomCloseCommand = new BPARelayCommand(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("ForOrder"); | |||||
TaskManage.GetInstance.StopTask("ForOrder"); | |||||
MessageLog.GetInstance.Show("停止模拟随机订单"); | MessageLog.GetInstance.Show("停止模拟随机订单"); | ||||
}); | }); | ||||
EnableLacalSimOrder = new BPARelayCommand(() => | EnableLacalSimOrder = new BPARelayCommand(() => | ||||
@@ -14,7 +14,7 @@ | |||||
// { | // { | ||||
// public VoiceAPI() | // public VoiceAPI() | ||||
// { | // { | ||||
// BPA.Helper.ThreadManage.GetInstance().StartLong(new Action(() => | |||||
// BPA.Helper.TaskManage.GetInstance.StartLong(new Action(() => | |||||
// { | // { | ||||
// while (msg.Count > 0) | // while (msg.Count > 0) | ||||
// { | // { | ||||
@@ -61,7 +61,7 @@ namespace BPASmartClient.MorkS3 | |||||
if (o.Length > 0) | if (o.Length > 0) | ||||
{ | { | ||||
Random rd = new Random(); | Random rd = new Random(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | ||||
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | ||||
@@ -26,7 +26,7 @@ namespace BPASmartClient.MorkS3 | |||||
mQTTProxy.Connected = new Action(() => | mQTTProxy.Connected = new Action(() => | ||||
{ | { | ||||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | ||||
SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | ||||
@@ -37,7 +37,7 @@ namespace BPASmartClient.MorkS3.ViewModel | |||||
}); | }); | ||||
SimOrderRandomCloseCommand = new BPARelayCommand(() => | SimOrderRandomCloseCommand = new BPARelayCommand(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("ForOrder"); | |||||
TaskManage.GetInstance.StopTask("ForOrder"); | |||||
MessageLog.GetInstance.Show("停止模拟随机订单"); | MessageLog.GetInstance.Show("停止模拟随机订单"); | ||||
}); | }); | ||||
EnableLacalSimOrder = new BPARelayCommand(() => | EnableLacalSimOrder = new BPARelayCommand(() => | ||||
@@ -62,7 +62,7 @@ | |||||
// if (o.Length > 0) | // if (o.Length > 0) | ||||
// { | // { | ||||
// Random rd = new Random(); | // Random rd = new Random(); | ||||
// ThreadManage.GetInstance().StartLong(new Action(() => | |||||
// TaskManage.GetInstance.StartLong(new Action(() => | |||||
// { | // { | ||||
// int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | // int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | ||||
// int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | // int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | ||||
@@ -63,7 +63,7 @@ namespace BPASmartClient.MorkSUpgradedVer | |||||
if (o.Length > 0) | if (o.Length > 0) | ||||
{ | { | ||||
Random rd = new Random(); | Random rd = new Random(); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0]; | ||||
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; | ||||
@@ -25,7 +25,7 @@ namespace BPASmartClient.MorkSUpgradedVer | |||||
mQTTProxy.ConnectOk = new Action(() => | mQTTProxy.ConnectOk = new Action(() => | ||||
{ | { | ||||
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | morkS.MorkS_OrderCount = Json<OrderStatistics>.Data.Count; | ||||
SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); | ||||
@@ -37,7 +37,7 @@ namespace BPASmartClient.MorkSUpgradedVer.ViewModel | |||||
}); | }); | ||||
SimOrderRandomCloseCommand = new BPARelayCommand(() => | SimOrderRandomCloseCommand = new BPARelayCommand(() => | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("ForOrder"); | |||||
TaskManage.GetInstance.StopTask("ForOrder"); | |||||
MessageLog.GetInstance.Show("停止模拟随机订单"); | MessageLog.GetInstance.Show("停止模拟随机订单"); | ||||
}); | }); | ||||
EnableLacalSimOrder = new BPARelayCommand(() => | EnableLacalSimOrder = new BPARelayCommand(() => | ||||
@@ -28,8 +28,8 @@ namespace BPASmartClient.MorkTJAKAJC.View | |||||
private void Dubug_Unloaded(object sender, RoutedEventArgs e) | private void Dubug_Unloaded(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("MorkT-状态刷新"); | |||||
ThreadManage.GetInstance().StopTask("MorkT-传感器监视"); | |||||
TaskManage.GetInstance.StopTask("MorkT-状态刷新"); | |||||
TaskManage.GetInstance.StopTask("MorkT-传感器监视"); | |||||
} | } | ||||
} | } | ||||
@@ -233,7 +233,7 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel; | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | ||||
@@ -48,7 +48,7 @@ namespace BPASmartClient.MorkTLebaiJC.ViewModel | |||||
if (device.Name == "MorkT") DeviceId = device.DeviceId; | if (device.Name == "MorkT") DeviceId = device.DeviceId; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> | EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> | ||||
{ | { | ||||
@@ -28,8 +28,8 @@ namespace BPASmartClient.MorkT.View | |||||
private void Dubug_Unloaded(object sender, RoutedEventArgs e) | private void Dubug_Unloaded(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("MorkT-状态刷新"); | |||||
ThreadManage.GetInstance().StopTask("MorkT-传感器监视"); | |||||
TaskManage.GetInstance.StopTask("MorkT-状态刷新"); | |||||
TaskManage.GetInstance.StopTask("MorkT-传感器监视"); | |||||
} | } | ||||
} | } | ||||
@@ -233,7 +233,7 @@ namespace BPASmartClient.MorkT.ViewModel; | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | ||||
@@ -48,7 +48,7 @@ namespace BPASmartClient.MorkT.ViewModel | |||||
if (device.Name == "MorkT") DeviceId = device.DeviceId; | if (device.Name == "MorkT") DeviceId = device.DeviceId; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> | EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> | ||||
{ | { | ||||
@@ -28,8 +28,8 @@ namespace BPASmartClient.MorkT_BarCounter.View | |||||
private void Dubug_Unloaded(object sender, RoutedEventArgs e) | private void Dubug_Unloaded(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("MorkT-状态刷新"); | |||||
ThreadManage.GetInstance().StopTask("MorkT-传感器监视"); | |||||
TaskManage.GetInstance.StopTask("MorkT-状态刷新"); | |||||
TaskManage.GetInstance.StopTask("MorkT-传感器监视"); | |||||
} | } | ||||
} | } | ||||
@@ -28,8 +28,8 @@ namespace BPASmartClient.MorkT_BarCounter.View | |||||
private void Dubug_Unloaded(object sender, RoutedEventArgs e) | private void Dubug_Unloaded(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
ThreadManage.GetInstance().StopTask("MorkT-状态刷新"); | |||||
ThreadManage.GetInstance().StopTask("MorkT-传感器监视"); | |||||
TaskManage.GetInstance.StopTask("MorkT-状态刷新"); | |||||
TaskManage.GetInstance.StopTask("MorkT-传感器监视"); | |||||
} | } | ||||
} | } | ||||
@@ -327,7 +327,7 @@ namespace BPASmartClient.MorkT_BarCounter.ViewModel; | |||||
if (device.Name == "MorkT") DeviceId = device.DeviceId | if (device.Name == "MorkT") DeviceId = device.DeviceId | ||||
; | ; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | ||||
if (variableMonitors != null && variableMonitors.Count > 0) | if (variableMonitors != null && variableMonitors.Count > 0) | ||||
@@ -28,8 +28,8 @@ namespace BPASmartClient.MorkT_Container.View | |||||
private void Dubug_Unloaded(object sender, RoutedEventArgs e) | private void Dubug_Unloaded(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
/* ThreadManage.GetInstance().StopTask("MorkT-状态刷新"); | |||||
ThreadManage.GetInstance().StopTask("MorkT-传感器监视");*/ | |||||
/* TaskManage.GetInstance.StopTask("MorkT-状态刷新"); | |||||
TaskManage.GetInstance.StopTask("MorkT-传感器监视");*/ | |||||
} | } | ||||
} | } | ||||
@@ -339,7 +339,7 @@ namespace BPASmartClient.MorkT_Container.ViewModel; | |||||
if (device.Name == "Container") DeviceId = device.DeviceId | if (device.Name == "Container") DeviceId = device.DeviceId | ||||
; | ; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(async () => | |||||
TaskManage.GetInstance.StartLong(new Action(async () => | |||||
{ | { | ||||
variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | ||||
if (variableMonitors != null && variableMonitors.Count > 0) | if (variableMonitors != null && variableMonitors.Count > 0) | ||||
@@ -28,8 +28,8 @@ namespace BPASmartClient.MorkTHQ.View | |||||
private void Dubug_Unloaded(object sender, RoutedEventArgs e) | private void Dubug_Unloaded(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
//ThreadManage.GetInstance().StopTask("MorkT-状态刷新"); | |||||
//ThreadManage.GetInstance().StopTask("MorkT-传感器监视"); | |||||
//TaskManage.GetInstance.StopTask("MorkT-状态刷新"); | |||||
//TaskManage.GetInstance.StopTask("MorkT-传感器监视"); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -353,7 +353,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel | |||||
if (device.Name == "MorkTHQ") DeviceId = device.DeviceId | if (device.Name == "MorkTHQ") DeviceId = device.DeviceId | ||||
; | ; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors; | ||||
@@ -48,7 +48,7 @@ namespace BPASmartClient.MorkTHQ.ViewModel | |||||
if (device.Name == "MorkT") DeviceId = device.DeviceId; | if (device.Name == "MorkT") DeviceId = device.DeviceId; | ||||
}); | }); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
TaskManage.GetInstance.StartLong(new Action(() => | |||||
{ | { | ||||
EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> | EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent() { DeviceId = DeviceId, Pin = 1 },(res)=> | ||||
{ | { | ||||