MainPage.xaml.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. 
  2. using CCDCount.DLL;
  3. using CCDCount.MODEL.ConfigModel;
  4. using LogClass;
  5. using MvCameraControl;
  6. using System;
  7. using System.Diagnostics;
  8. using System.Drawing;
  9. using System.IO;
  10. using System.Threading;
  11. using System.Threading.Tasks;
  12. using System.Windows;
  13. using System.Windows.Controls;
  14. using System.Windows.Data;
  15. using System.Windows.Input;
  16. using System.Windows.Interop;
  17. using System.Windows.Media;
  18. using System.Windows.Media.Imaging;
  19. using static System.Net.Mime.MediaTypeNames;
  20. namespace CCDCountWpf.WpfPage
  21. {
  22. /// <summary>
  23. /// MainPage.xaml 的交互逻辑
  24. /// </summary>
  25. public partial class MainPage : Page
  26. {
  27. #region 变量与实例
  28. #endregion
  29. public MainPage()
  30. {
  31. InitializeComponent();
  32. DataContext = ShowMessageBus.ShowBinding;
  33. InitFormationItems();
  34. }
  35. private void DataClear_Click(object sender, RoutedEventArgs e)
  36. {
  37. if(MessageBus.MainThreadS.Count<MessageBus.NowLoadCameraIndex+1)
  38. return;
  39. MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].ClearHistoryActive();
  40. }
  41. private void Page_Loaded(object sender, RoutedEventArgs e)
  42. {
  43. this.Width = double.NaN; // 等效于 Auto
  44. this.Height = double.NaN;
  45. StopIdentifyBtn.IsEnabled = false;
  46. StopIdentifyBtn.Opacity = 0.5;
  47. if(MessageBus.NowLoadCameraIndex>=0)
  48. {
  49. if (MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].CameraRunStatic)
  50. {
  51. StartIdentifyBtn.IsEnabled = false;
  52. StartIdentifyBtn.Opacity = 0.5;
  53. StopIdentifyBtn.IsEnabled = true;
  54. StopIdentifyBtn.Opacity = 1;
  55. }
  56. else
  57. {
  58. StartIdentifyBtn.IsEnabled = true;
  59. StartIdentifyBtn.Opacity = 1;
  60. StopIdentifyBtn.IsEnabled = false;
  61. StopIdentifyBtn.Opacity = 0.5;
  62. }
  63. }
  64. }
  65. private void MiniShowImageBox2_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
  66. {
  67. if(MessageBus.MainThreadS.Count < 2) return;
  68. MessageBus.NowLoadCameraIndex = 1;
  69. }
  70. private void MiniShowImageBox1_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
  71. {
  72. if (MessageBus.MainThreadS.Count < 1) return;
  73. MessageBus.NowLoadCameraIndex = 0;
  74. }
  75. private void MiniShowImageBox3_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
  76. {
  77. if (MessageBus.MainThreadS.Count < 3) return;
  78. MessageBus.NowLoadCameraIndex = 2;
  79. }
  80. private void MiniShowImageBox4_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
  81. {
  82. if (MessageBus.MainThreadS.Count < 4) return;
  83. MessageBus.NowLoadCameraIndex = 3;
  84. }
  85. /// <summary>
  86. /// 启动相机识别
  87. /// </summary>
  88. private void RunCameraIdentify()
  89. {
  90. for (int i = 0; i < MessageBus.MainThreadS.Count; i++)
  91. {
  92. MessageBus.MainThreadS[i].BatchNumber = ShowMessageBus.ShowBinding.BatchNumber;
  93. if (MessageBus.MainThreadS[i].CameraConfigIsChange)
  94. {
  95. MessageBus.MainThreadS[i].ReLoadCameraConfig();
  96. }
  97. //启动单相机实例的全部线程
  98. if (!MessageBus.MainThreadS[i].StartMianThread())
  99. {
  100. FaultLog.RecordErrorMessage(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "启动失败");
  101. //LOG.error(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "启动失败");
  102. MessageBox.Show(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "启动失败");
  103. continue;
  104. }
  105. }
  106. MessageBus.NowLoadCammeraSN = MessageBus.MainThreadS[0].cameraConfig.CameraSNNum;
  107. MessageBus.SeetingNowLoadInMaThreadsIndex = 0;
  108. MessageBus.NowLoadCameraIndex = 0;
  109. }
  110. /// <summary>
  111. /// 停止相机识别
  112. /// </summary>
  113. private void StopCameraIdentify()
  114. {
  115. for (int i = 0; i < MessageBus.MainThreadS.Count; i++)
  116. {
  117. //启动单相机实例的全部线程
  118. if (!MessageBus.MainThreadS[i].StopMianThread())
  119. {
  120. FaultLog.RecordErrorMessage(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "关闭失败");
  121. MessageBox.Show(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "关闭失败");
  122. continue;
  123. }
  124. }
  125. }
  126. private void StartIdentifyBtn_Click(object sender, RoutedEventArgs e)
  127. {
  128. if(ShowMessageBus.ShowBinding.BatchNumber == "")
  129. {
  130. MessageBox.Show("请输入批次号!");
  131. return;
  132. }
  133. RunCameraIdentify();
  134. StartIdentifyBtn.IsEnabled = false;
  135. StartIdentifyBtn.Opacity = 0.5;
  136. StopIdentifyBtn.IsEnabled = true;
  137. StopIdentifyBtn.Opacity = 1;
  138. if(PlcSettingMessageBus.pLCManagement.IsConnect)
  139. {
  140. PlcSettingMessageBus.pLCManagement.InitiateToTrue();
  141. }
  142. }
  143. private void StopIdentifyBtn_Click(object sender, RoutedEventArgs e)
  144. {
  145. StopCameraIdentify();
  146. StartIdentifyBtn.IsEnabled = true;
  147. StartIdentifyBtn.Opacity = 1;
  148. StopIdentifyBtn.IsEnabled = false;
  149. StopIdentifyBtn.Opacity = 0.5;
  150. if (PlcSettingMessageBus.pLCManagement.IsConnect)
  151. {
  152. PlcSettingMessageBus.pLCManagement.StopToTrue();
  153. }
  154. }
  155. private void BottingMaterialCylinderVibrationTableHighSpeedValueUpUpBtn_Click(object sender, RoutedEventArgs e)
  156. {
  157. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue + 10) >
  158. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
  159. {
  160. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue += 10;
  161. }
  162. }
  163. private void BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
  164. {
  165. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue + 1) >
  166. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
  167. {
  168. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue += 1;
  169. }
  170. }
  171. private void BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
  172. {
  173. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue - 1) <
  174. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
  175. {
  176. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue -= 1;
  177. }
  178. }
  179. private void BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn_Click(object sender, RoutedEventArgs e)
  180. {
  181. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue - 10) <
  182. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
  183. {
  184. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue -= 10;
  185. }
  186. }
  187. private void BottingFilterVibrationTableHighSpeedValueUpUpBtn_Click(object sender, RoutedEventArgs e)
  188. {
  189. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue + 10) >
  190. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
  191. {
  192. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue += 10;
  193. }
  194. }
  195. private void BottingFilterVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
  196. {
  197. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue + 1) >
  198. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
  199. {
  200. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue += 1;
  201. }
  202. }
  203. private void BottingFilterVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
  204. {
  205. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue - 1) <
  206. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
  207. {
  208. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue -= 1;
  209. }
  210. }
  211. private void BottingFilterVibrationTableHighSpeedValueDownDownBtn_Click(object sender, RoutedEventArgs e)
  212. {
  213. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue - 10) <
  214. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
  215. {
  216. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue -= 10;
  217. }
  218. }
  219. private void BottingCountVibrationTableHighSpeedValueUpUpBtn_Click(object sender, RoutedEventArgs e)
  220. {
  221. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue + 10) >
  222. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
  223. {
  224. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue += 10;
  225. }
  226. }
  227. private void BottingCountVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
  228. {
  229. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue + 1) >
  230. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
  231. {
  232. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue += 1;
  233. }
  234. }
  235. private void BottingCountVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
  236. {
  237. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue - 1) <
  238. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
  239. {
  240. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue -= 1;
  241. }
  242. }
  243. private void BottingCountVibrationTableHighSpeedValueDownDownBtn_Click(object sender, RoutedEventArgs e)
  244. {
  245. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue - 10) <
  246. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
  247. {
  248. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue -= 10;
  249. }
  250. }
  251. private void BottValueSetUpUpBtn_Click(object sender, RoutedEventArgs e)
  252. {
  253. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet + 5) >
  254. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
  255. {
  256. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet += 5;
  257. }
  258. }
  259. private void BottValueSetUpBtn_Click(object sender, RoutedEventArgs e)
  260. {
  261. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet + 1) >
  262. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
  263. {
  264. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet += 1;
  265. }
  266. }
  267. private void BottValueSetDownBtn_Click(object sender, RoutedEventArgs e)
  268. {
  269. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet - 1) <
  270. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
  271. {
  272. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet -= 1;
  273. }
  274. }
  275. private void BottValueSetDownDownBtn_Click(object sender, RoutedEventArgs e)
  276. {
  277. if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet - 5) <
  278. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
  279. {
  280. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet -= 5;
  281. }
  282. }
  283. private void TextBox_KeyDown(object sender,KeyEventArgs e)
  284. {
  285. if (e.Key == Key.Enter)
  286. {
  287. TextBox textBox = sender as TextBox;
  288. if (textBox != null)
  289. {
  290. // 强制更新源数据
  291. BindingExpression bindingExpression = textBox.GetBindingExpression(TextBox.TextProperty);
  292. bindingExpression.UpdateSource();
  293. }
  294. }
  295. }
  296. private void MyCombo_OnLoaded(object sender, RoutedEventArgs e)
  297. {
  298. var textbox = (TextBox)FormulationCoBox.Template.FindName("PART_EditableTextBox", FormulationCoBox);
  299. if (textbox != null)
  300. {
  301. var parent = (Border)textbox.Parent;
  302. parent.Background = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#FF0087FF"));
  303. }
  304. }
  305. /// <summary>
  306. /// 初始化配方列表
  307. /// </summary>
  308. private void InitFormationItems()
  309. {
  310. string folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}Formulations";
  311. if (!Directory.Exists(folderPath))
  312. {
  313. // 创建文件夹
  314. Directory.CreateDirectory(folderPath);
  315. }
  316. try
  317. {
  318. // 获取文件列表(包含子目录)
  319. string[] files = Directory.GetFiles(folderPath, "*.*", SearchOption.AllDirectories);
  320. ShowMessageBus.ShowBinding.FormulationItems.Clear();
  321. foreach (string file in files)
  322. {
  323. ShowMessageBus.ShowBinding.FormulationItems.Add(Path.GetFileNameWithoutExtension(file));
  324. }
  325. if (ShowMessageBus.ShowBinding.FormulationName != null && ShowMessageBus.ShowBinding.FormulationName != string.Empty)
  326. {
  327. try
  328. {
  329. FormulationCoBox.SelectedItem = ShowMessageBus.ShowBinding.FormulationName;
  330. }
  331. catch { }
  332. }
  333. }
  334. catch
  335. { }
  336. }
  337. private void SaveFormulationBtn_Click(object sender, RoutedEventArgs e)
  338. {
  339. if (string.IsNullOrEmpty(ShowMessageBus.ShowBinding.FormulationName))
  340. {
  341. MessageBox.Show("请输入配方名称!");
  342. return;
  343. }
  344. var ParaValue = PlcSettingMessageBus.pLCManagement.ReadAllPara();
  345. FormulationConfigClass formulationConfigClass = FormulationClass.InitFormulation(
  346. MessageBus.NowSettingLoadMainThread.cameraConfig, MessageBus.NowSettingLoadMainThread.shuLiConfig,ParaValue);
  347. if (formulationConfigClass == null)
  348. {
  349. MessageBox.Show("获取参数失败,请检查与PLC的连接");
  350. return;
  351. }
  352. formulationConfigClass.FormulationName = ShowMessageBus.ShowBinding.FormulationName;
  353. string folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}Formulations";
  354. string FilePath = folderPath + "\\" + ShowMessageBus.ShowBinding.FormulationName + ".xml";
  355. if (File.Exists(FilePath))
  356. {
  357. var confirmResult = MessageBox.Show("配方已存在,是否覆盖?",
  358. "保存确认", MessageBoxButton.YesNo);
  359. if (confirmResult == MessageBoxResult.No)
  360. {
  361. return;
  362. }
  363. }
  364. if (!Directory.Exists(folderPath)) Directory.CreateDirectory(folderPath);
  365. {
  366. XmlStorage.SerializeToXml(formulationConfigClass, FilePath);
  367. InitFormationItems();
  368. MessageBus.NowSettingLoadMainThread.FormulationName = formulationConfigClass.FormulationName;
  369. MessageBus.NowSettingLoadMainThread.IsLoadFormulation = true;
  370. MessageBox.Show("保存成功");
  371. }
  372. }
  373. private void ReadFormulationBtn_Click(object sender, RoutedEventArgs e)
  374. {
  375. string folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}Formulations\\{FormulationCoBox.SelectedItem}.xml";
  376. if (!File.Exists(folderPath))
  377. {
  378. MessageBox.Show("指定文件不存在,请选择一个正确的配方");
  379. return;
  380. }
  381. try
  382. {
  383. FormulationConfigClass formulationConfigClass = null;
  384. formulationConfigClass = XmlStorage.DeserializeFromXml<FormulationConfigClass>(folderPath);
  385. LoadFormulation(formulationConfigClass);
  386. MessageBus.NowSettingLoadMainThread.FormulationName = formulationConfigClass.FormulationName;
  387. MessageBus.NowSettingLoadMainThread.IsLoadFormulation = true;
  388. MessageBox.Show("加载成功");
  389. }
  390. catch (Exception ex)
  391. {
  392. MessageBox.Show($"读取文件时出错:{ex.Message}");
  393. }
  394. }
  395. /// <summary>
  396. /// 加载配方
  397. /// </summary>
  398. /// <param name="FormulationConfig"></param>
  399. private void LoadFormulation(FormulationConfigClass FormulationConfig)
  400. {
  401. ShowMessageBus.ShowBinding.AcquistionLineRate = FormulationConfig.AcquistionLineRateValue.ToString();
  402. ShowMessageBus.ShowBinding.ExposureTimeValue = FormulationConfig.ExposureTimeValue.ToString();
  403. ShowMessageBus.ShowBinding.Channel = FormulationConfig.Channel.ToString();
  404. ShowMessageBus.ShowBinding.FormulationName = FormulationConfig.FormulationName;
  405. ShowMessageBus.ShowBinding.MAX_OBJECT_LENGTH = FormulationConfig.MAX_Object_LENGTH.ToString();
  406. ShowMessageBus.ShowBinding.MIN_OBJECT_LENGTH = FormulationConfig.MIN_Object_LENGTH.ToString();
  407. ShowMessageBus.ShowBinding.PandingCode = FormulationConfig.PandingCode.ToString();
  408. ShowMessageBus.ShowBinding.RegionThreshold = FormulationConfig.RegionThreshold.ToString();
  409. PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed =
  410. FormulationConfig.SpeedModeRunningSpeed.ToString();
  411. PlcSettingMessageBus.PlcMessageShowBindage.JogSpeed =
  412. FormulationConfig.JogSpeed.ToString();
  413. PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet =
  414. FormulationConfig.BottValueSet;
  415. PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningSpeed =
  416. FormulationConfig.TransferValveOpeningSpeed.ToString();
  417. PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime =
  418. FormulationConfig.TransferValveOpeningTime;
  419. PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue =
  420. FormulationConfig.BottingDecelerationValue;
  421. PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue =
  422. FormulationConfig.CacheDecelerationValue;
  423. PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming =
  424. FormulationConfig.CacheCountDelayTiming;
  425. PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue =
  426. FormulationConfig.CacheShutdownValue;
  427. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue =
  428. FormulationConfig.BottingMaterialCylinderVibrationTableHighSpeedValue;
  429. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue =
  430. FormulationConfig.BottingFilterVibrationTableHighSpeedValue;
  431. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue =
  432. FormulationConfig.BottingCountVibrationTableHighSpeedValue;
  433. PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue =
  434. FormulationConfig.BottingMaterialCylinderVibrationTableDecelerationSpeedValue;
  435. PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue =
  436. FormulationConfig.BottingFilterVibrationTableDecelerationSpeedValue;
  437. PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue =
  438. FormulationConfig.BottingCountVibrationTableDecelerationSpeedValue;
  439. PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue =
  440. FormulationConfig.CacheMaterialCylinderVibrationTableHighSpeedValue;
  441. PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue =
  442. FormulationConfig.CacheFilterVibrationTableHighSpeedValue;
  443. PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue =
  444. FormulationConfig.CacheCountVibrationTableHighSpeedValue;
  445. PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue =
  446. FormulationConfig.CacheMaterialCylinderVibrationTableDecelerationSpeedValue;
  447. PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue =
  448. FormulationConfig.CacheMaterialCylinderVibrationTableHighSpeedValue;
  449. PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue =
  450. FormulationConfig.CacheCountVibrationTableDecelerationSpeedValue;
  451. PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay =
  452. FormulationConfig.GateOpeningDelay;
  453. PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue =
  454. FormulationConfig.ReturnToZeroOffsetValue.ToString();
  455. PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed =
  456. FormulationConfig.ReturnToZeroOffsetSpeed.ToString();
  457. PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed =
  458. FormulationConfig.TransferValveClosingSpeed.ToString();
  459. PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition =
  460. FormulationConfig.TransferValveOpenPosition.ToString();
  461. PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition =
  462. FormulationConfig.TransferValveClosePosition.ToString();
  463. PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay =
  464. FormulationConfig.AirValveOpeningDelay;
  465. PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue =
  466. FormulationConfig.BottlingShutdownValue;
  467. PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime =
  468. FormulationConfig.BottlingShutdownTime;
  469. PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed =
  470. FormulationConfig.BottleFeedingWheelRunningSpeed.ToString();
  471. PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed =
  472. FormulationConfig.BottleFeedingWheelJogRunningSpeed.ToString();
  473. PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue =
  474. FormulationConfig.BottleFeedingWheelReturnToZeroOffsetValue.ToString();
  475. PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed =
  476. FormulationConfig.BottleFeedingWheelReturnToZeroSpeed.ToString();
  477. PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength =
  478. FormulationConfig.BottleFeedingWheelPositionLength.ToString();
  479. PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime =
  480. FormulationConfig.BottleFeedingWheelPauseTime;
  481. PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking =
  482. FormulationConfig.DelayBlanking;
  483. }
  484. }
  485. }