终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

184 行
7.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Configuration;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Threading;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using BPASmartClient.CustomResource.Pages.Enums;
  11. using BPASmartClient.CustomResource.Pages.Model;
  12. using BPASmartClient.CustomResource.Pages.View;
  13. using BPASmartClient.CustomResource.Pages.ViewModel;
  14. using BPASmartClient.Helper;
  15. using BPASmartClient.JXJFoodBigStation.Model;
  16. namespace BPASmartClient.JXJFoodBigStation
  17. {
  18. /// <summary>
  19. /// Interaction logic for App.xaml
  20. /// </summary>
  21. public partial class App : Application
  22. {
  23. public static Window MainWindow;
  24. protected override void OnStartup(StartupEventArgs e)
  25. {
  26. base.OnStartup(e);
  27. MenuInit();
  28. DataInit();
  29. ProcessControl.GetInstance.Init();
  30. MainView mv = new MainView();
  31. //mv.Show();
  32. LoginView lv = new LoginView();
  33. var res = lv.ShowDialog();
  34. if (res != null && res == true)
  35. {
  36. MessageNotify.GetInstance.ShowUserLog("用户登录");
  37. mv.Show();
  38. }
  39. else
  40. mv.Close();
  41. MainWindow = mv;
  42. }
  43. protected override void OnExit(ExitEventArgs e)
  44. {
  45. base.OnExit(e);
  46. MessageNotify.GetInstance.LogSave();
  47. ThreadManage.GetInstance().Dispose();
  48. }
  49. private void MenuInit()
  50. {
  51. #region 配方管理菜单
  52. ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>();
  53. RecipeManage.Add(new SubMenumodel()
  54. {
  55. SubMenuName = "配方管理",
  56. SubMenuPermission = new Permission[] { Permission.管理员 },
  57. AssemblyName = "BPASmartClient.JXJFoodBigStation",
  58. ToggleWindowPath = "View.RecipeReceiveView"
  59. });
  60. RecipeManage.Add(new SubMenumodel()
  61. {
  62. SubMenuName = "本地配方下发",
  63. SubMenuPermission = new Permission[] { Permission.管理员 },
  64. AssemblyName = "BPASmartClient.JXJFoodBigStation",
  65. ToggleWindowPath = "View.RecipeSendDownView"
  66. });
  67. RecipeManage.Add(new SubMenumodel()
  68. {
  69. SubMenuName = "西门子配方下发",
  70. SubMenuPermission = new Permission[] { Permission.管理员 },
  71. AssemblyName = "BPASmartClient.JXJFoodBigStation",
  72. ToggleWindowPath = "View.SiemensRecipeSendDownView"
  73. });
  74. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  75. {
  76. MainMenuIcon = "&#xe683;",
  77. MainMenuName = "配方管理",
  78. Alias = "Recipe Management",
  79. subMenumodels = RecipeManage,
  80. });
  81. #endregion
  82. #region 消息日志
  83. ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
  84. InfoLog.Add(new SubMenumodel()
  85. {
  86. SubMenuName = "操作日志",
  87. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
  88. AssemblyName = "BPASmartClient.CustomResource",
  89. ToggleWindowPath = "Pages.View.UserLogView"
  90. });
  91. InfoLog.Add(new SubMenumodel()
  92. {
  93. SubMenuName = "运行日志",
  94. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
  95. AssemblyName = "BPASmartClient.CustomResource",
  96. ToggleWindowPath = "Pages.View.RunLogView"
  97. });
  98. InfoLog.Add(new SubMenumodel()
  99. {
  100. SubMenuName = "报警记录",
  101. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
  102. AssemblyName = "BPASmartClient.CustomResource",
  103. ToggleWindowPath = "Pages.View.AlarmView"
  104. });
  105. InfoLog.Add(new SubMenumodel()
  106. {
  107. SubMenuName = "调试日志",
  108. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
  109. AssemblyName = "BPASmartClient.CustomResource",
  110. ToggleWindowPath = "Pages.View.DebugLogView"
  111. });
  112. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  113. {
  114. MainMenuIcon = "&#xe668;",
  115. MainMenuName = "消息日志",
  116. Alias = "Message Log",
  117. subMenumodels = InfoLog,
  118. });
  119. #endregion
  120. #region 硬件设备监控
  121. ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>();
  122. DeviceMonitor.Add(new SubMenumodel()
  123. {
  124. SubMenuName = "设备状态",
  125. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  126. AssemblyName = "BPASmartClient.JXJFoodBigStation",
  127. ToggleWindowPath = "View.HardwareStatusView"
  128. });
  129. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  130. {
  131. MainMenuIcon = "&#xe603;",
  132. MainMenuName = "设备监控",
  133. Alias = "Device Monitor",
  134. subMenumodels = DeviceMonitor,
  135. });
  136. #endregion
  137. #region 用户管理
  138. ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>();
  139. UserManager.Add(new SubMenumodel()
  140. {
  141. SubMenuName = "用户登录",
  142. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  143. AssemblyName = "BPASmartClient.CustomResource",
  144. ToggleWindowPath = "Pages.View.SubPagLoginView"
  145. });
  146. UserManager.Add(new SubMenumodel()
  147. {
  148. SubMenuName = "密码修改",
  149. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  150. AssemblyName = "BPASmartClient.CustomResource",
  151. ToggleWindowPath = "Pages.View.PasswordChangeView"
  152. });
  153. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  154. {
  155. MainMenuIcon = "&#xe66d;",
  156. MainMenuName = "用户管理",
  157. Alias = "User Management",
  158. subMenumodels = UserManager,
  159. });
  160. #endregion
  161. }
  162. private void DataInit()
  163. {
  164. //Config.GetInstance.Init();
  165. //Json<LocaPar>.Read();
  166. Json<LocalRecipe>.Read();
  167. }
  168. }
  169. }