diff --git a/BPASmartClient.AGV/AGVHelper.cs b/BPASmartClient.AGV/AGVHelper.cs index ca56e07e..95be2611 100644 --- a/BPASmartClient.AGV/AGVHelper.cs +++ b/BPASmartClient.AGV/AGVHelper.cs @@ -471,7 +471,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 5; - httpJobData.unloadEquipmentId = 4; + httpJobData.unloadEquipmentId = 40; httpModel.jobData = httpJobData; string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 @@ -526,7 +526,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 6; - httpJobData.unloadEquipmentId = 4; + httpJobData.unloadEquipmentId = 41; httpModel.jobData = httpJobData; string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 @@ -581,7 +581,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 7; - httpJobData.unloadEquipmentId = 4; + httpJobData.unloadEquipmentId = 42; httpModel.jobData = httpJobData; string body ="["+ JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 @@ -636,7 +636,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 8; - httpJobData.unloadEquipmentId = 4; + httpJobData.unloadEquipmentId = 40; httpModel.jobData = httpJobData; string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 @@ -691,7 +691,7 @@ namespace BPASmartClient.AGV httpJobData.autoUnload = Convert.ToBoolean(config.AppSettings.Settings["autoUnload"].Value); //是否自动下料 true:自动下料 false:人工下料 httpJobData.enableIOUnload = Convert.ToBoolean(config.AppSettings.Settings["enableIOUnload"].Value); ;//下料交互方式 false:接口交互 true:光电交互 httpJobData.loadEquipmentId = 9; - httpJobData.unloadEquipmentId = 4; + httpJobData.unloadEquipmentId = 41; httpModel.jobData = httpJobData; string body = "["+JsonConvert.SerializeObject(httpModel)+"]"; //货位到货位 diff --git a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs index e1325b1a..f0688f09 100644 --- a/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs +++ b/BPASmartClient.CustomResource/Pages/Model/MessageNotify.cs @@ -66,15 +66,23 @@ namespace BPASmartClient.CustomResource.Pages.Model { lock (runLock) { - RunLog runLog = new RunLog() + try { - Date = DateTime.Now.ToString("yyyy-MM-dd"), - Time = DateTime.Now.ToString("HH:mm:ss"), - RunLogInfo = info - }; - Sqlite.GetInstance.Base.Add(runLog); - Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); - RunLog?.Invoke(info); + RunLog runLog = new RunLog() + { + Date = DateTime.Now.ToString("yyyy-MM-dd"), + Time = DateTime.Now.ToString("HH:mm:ss"), + RunLogInfo = info + }; + Sqlite.GetInstance.Base.Add(runLog); + Application.Current.Dispatcher.Invoke(new Action(() => { runLogs.Insert(0, runLog); })); + RunLog?.Invoke(info); + } + catch (Exception) + { + + // throw; + } } } diff --git a/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml b/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml index ef67919e..e265a036 100644 --- a/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml +++ b/BPASmartClient.CustomResource/Pages/View/RunLogView.xaml @@ -263,7 +263,8 @@ Margin="10,0,0,0" HorizontalAlignment="Left" Style="{StaticResource DataTextBlockStyle}" - Text="{Binding RunLogInfo}" /> + Text="{Binding RunLogInfo}" + TextWrapping="Wrap"/> + Text="{Binding LogInfo}" + TextWrapping="Wrap" + /> 0) - { - foreach (var items in MenuManage.GetInstance.menuModels) - { - foreach (var item in items.subMenumodels) - { - items.MainMenuVisibility = Visibility.Visible; - if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) - { - item.SubMenuVisibility = Visibility.Visible; - } - } - } - } - } - } + ////分配后的权限 + //if (res.permission == Enums.Permission.管理员) + //{ + // foreach (var items in MenuManage.GetInstance.menuModels) + // { + // items.MainMenuVisibility = Visibility.Visible; + // foreach (var item in items.subMenumodels) + // { + // item.SubMenuVisibility = Visibility.Visible; + // } + // } + //} + //else + //{ + // if (res.userTreeViewModels != null) + // { + // if (res.userTreeViewModels.Count > 0) + // { + // foreach (var items in MenuManage.GetInstance.menuModels) + // { + // foreach (var item in items.subMenumodels) + // { + // items.MainMenuVisibility = Visibility.Visible; + // if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) + // { + // item.SubMenuVisibility = Visibility.Visible; + // } + // } + // } + // } + // } + //} ActionManage.GetInstance.Send("PermissionChange"); diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs index e2d6bde9..a1a4ddf9 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs @@ -20,6 +20,40 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel public MainViewModel() { NavChangedCommand = new RelayCommand(DoNavChanged); + BPASmartClient.Message. MessageLog.GetInstance.InfoNotify = new Action((o) => + { + Application.Current?.Dispatcher?.Invoke(() => + { + //ff20aefe + var temp = new MessageModel() + { + LogInfo = o, + Forground = new SolidColorBrush(Color.FromArgb(255, 32, 174, 254)) + }; + if (DebugLogViewModel.MessageModels.Count > 0) + DebugLogViewModel.MessageModels.Insert(0, temp); + else + DebugLogViewModel.MessageModels.Add(temp); + }); + }); + + BPASmartClient.Message.MessageLog.GetInstance.ExInfoNotify = new Action((o) => + { + Application.Current?.Dispatcher?.Invoke(() => + { + //FFF53F62 + var temp = new MessageModel() + { + LogInfo = o, + Forground = new SolidColorBrush(Color.FromArgb(255, 245, 63, 98)) + }; + if (DebugLogViewModel.MessageModels.Count > 0) + DebugLogViewModel.MessageModels.Insert(0, temp); + else + DebugLogViewModel.MessageModels.Add(temp); + }); + }); + BPA.Helper.MessageLog.GetInstance.NotifyShow = new Action((o) => { Application.Current?.Dispatcher?.Invoke(() => diff --git a/BPASmartClient.Helper/Json.cs b/BPASmartClient.Helper/Json.cs index e20bdb75..c9950a08 100644 --- a/BPASmartClient.Helper/Json.cs +++ b/BPASmartClient.Helper/Json.cs @@ -22,6 +22,8 @@ namespace BPASmartClient.Helper public static T Data { get; set; } = new T(); + + /// /// 保存数据 /// @@ -36,12 +38,14 @@ namespace BPASmartClient.Helper /// public static void Read() { - if (File.Exists(path)) - { - string JsonString = File.ReadAllText(path); - var result = JsonConvert.DeserializeObject(JsonString); - if (result != null) { Data = result; } - } + + if (File.Exists(path)) + { + string JsonString = File.ReadAllText(path); + var result = JsonConvert.DeserializeObject(JsonString); + if (result != null) { Data = result; } + } + } /// diff --git a/BPASmartClient.HubHelper/HubHelper.cs b/BPASmartClient.HubHelper/HubHelper.cs index a687570a..7ae097ae 100644 --- a/BPASmartClient.HubHelper/HubHelper.cs +++ b/BPASmartClient.HubHelper/HubHelper.cs @@ -19,7 +19,6 @@ namespace BPASmartClient.HubHelper public void Connect(string ip, int port) { hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl($"http://{ip}:{port}/personhub").Build();//连接 - hubConnection.On("Report", (s) => { Report?.Invoke(s); });//客户端注册方法 hubConnection.On("Upstreamrequest", (s) => { Upstreamrequest?.Invoke(s); });//客户端注册方法 diff --git a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs index aa438a47..c658c57b 100644 --- a/BPASmartClient.JXJFoodSmallStation/App.xaml.cs +++ b/BPASmartClient.JXJFoodSmallStation/App.xaml.cs @@ -28,9 +28,9 @@ namespace BPASmartClient.JXJFoodSmallStation base.OnStartup(e); MenuInit(); DataInit(); - DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化 - ProcessControl.GetInstance.Init(); + //DeviceInquire.GetInstance.Init();//配料机设备上线监听,设备列表初始化 MainView mv = new MainView(); + ProcessControl.GetInstance.Init(); LoginView lv = new LoginView(); var res = lv.ShowDialog(); if (res != null && res == true) diff --git a/BPASmartClient.Modbus/ModbusTcp.cs b/BPASmartClient.Modbus/ModbusTcp.cs index b18f23db..1e4164dd 100644 --- a/BPASmartClient.Modbus/ModbusTcp.cs +++ b/BPASmartClient.Modbus/ModbusTcp.cs @@ -38,7 +38,7 @@ namespace BPASmartClient.Modbus public Action Disconnect { get; set; } - public bool IsReconnect { get; set; } = true; //true=启用重连,false=禁用重连 + public bool IsReconnect { get; set; } = false; //true=启用重连,false=禁用重连 /// /// 判断是否连接成功 @@ -430,7 +430,7 @@ namespace BPASmartClient.Modbus { commandType = CommandType.Inputs; } - Show?.Invoke($"成功,地址:{address},值:{value}"); + //Show?.Invoke($"成功,地址:{address},值:{value}"); return true; } catch (Exception ex) diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs index 3b9a58cf..dbe281db 100644 --- a/DosingSystem/App.xaml.cs +++ b/DosingSystem/App.xaml.cs @@ -96,19 +96,19 @@ namespace BPASmartClient.DosingSystem ParSet.Add(new SubMenumodel() { - SubMenuName = "设备控制参数设置", + SubMenuName = "设备参数设置", SubMenuPermission = new Permission[] { Permission.管理员 }, AssemblyName = "BPASmartClient.DosingSystem", ToggleWindowPath = "View.CommParSetView" }); - ParSet.Add(new SubMenumodel() - { - SubMenuName = "出料口管理设置", - SubMenuPermission = new Permission[] { Permission.管理员 }, - AssemblyName = "BPASmartClient.DosingSystem", - ToggleWindowPath = "View.OutletManagementView" - }); + //ParSet.Add(new SubMenumodel() + //{ + // SubMenuName = "出料口管理设置", + // SubMenuPermission = new Permission[] { Permission.管理员 }, + // AssemblyName = "BPASmartClient.DosingSystem", + // ToggleWindowPath = "View.OutletManagementView" + //}); MenuManage.GetInstance.menuModels.Add(new MenuModel() { @@ -186,13 +186,13 @@ namespace BPASmartClient.DosingSystem ToggleWindowPath = "Pages.View.DebugLogView" }); - InfoLog.Add(new SubMenumodel() - { - SubMenuName = "报表数据", - SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 }, - AssemblyName = "BPASmartClient.CustomResource", - ToggleWindowPath = "Pages.View.ReportView" - }); + //InfoLog.Add(new SubMenumodel() + //{ + // SubMenuName = "报表数据", + // SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 }, + // AssemblyName = "BPASmartClient.CustomResource", + // ToggleWindowPath = "Pages.View.ReportView" + //}); MenuManage.GetInstance.menuModels.Add(new MenuModel() { @@ -255,13 +255,13 @@ namespace BPASmartClient.DosingSystem ToggleWindowPath = "Pages.View.UserManagerView" }); - UserManager.Add(new SubMenumodel() - { - SubMenuName = "NFC登录管理", - SubMenuPermission = new Permission[] { Permission.管理员 }, - AssemblyName = "BPASmartClient.CustomResource", - ToggleWindowPath = "Pages.View.NfcSetView" - }); + //UserManager.Add(new SubMenumodel() + //{ + // SubMenuName = "NFC登录管理", + // SubMenuPermission = new Permission[] { Permission.管理员 }, + // AssemblyName = "BPASmartClient.CustomResource", + // ToggleWindowPath = "Pages.View.NfcSetView" + //}); MenuManage.GetInstance.menuModels.Add(new MenuModel() { diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs index 93cd452e..869cb80f 100644 --- a/DosingSystem/Model/DeviceInquire.cs +++ b/DosingSystem/Model/DeviceInquire.cs @@ -114,7 +114,7 @@ namespace BPASmartClient.DosingSystem { if (!string.IsNullOrEmpty(Json.Data.BaseParModel.NetworkSegAddress)) IPSegment = Json.Data.BaseParModel.NetworkSegAddress; else Json.Data.BaseParModel.NetworkSegAddress = IPSegment; - //TestData(); + TestData(); IpAddressLines(); SiemensDevice.GetInstance.Connect(Json.Data.BaseParModel.DeviceAddress); DeviceDataInit(); diff --git a/DosingSystem/View/RecipeSettingsView.xaml b/DosingSystem/View/RecipeSettingsView.xaml index ad1c0c0c..e2e81dc2 100644 --- a/DosingSystem/View/RecipeSettingsView.xaml +++ b/DosingSystem/View/RecipeSettingsView.xaml @@ -65,14 +65,14 @@ IcoText="" Style="{StaticResource IcoButtonStyle}" />--> -