MainPage.xaml.cs 24 KB

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