PlcMessageShowBindingClass.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  1. using CCDCount.DLL;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Linq;
  6. using System.Security.Cryptography.X509Certificates;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace CCDCountWpf
  10. {
  11. public class PlcMessageShowBindingClass : INotifyPropertyChanged
  12. {
  13. /// <summary>
  14. /// 使能完成
  15. /// </summary>
  16. private bool enableCompletion;
  17. public bool EnableCompletion
  18. {
  19. get { return enableCompletion; }
  20. set
  21. {
  22. enableCompletion = value;
  23. OnPropertyChanged("EnableCompletion");
  24. }
  25. }
  26. /// <summary>
  27. /// 归零完成
  28. /// </summary>
  29. private bool returnToZeroCompletion;
  30. public bool ReturnToZeroCompletion
  31. {
  32. get { return returnToZeroCompletion; }
  33. set
  34. {
  35. returnToZeroCompletion = value;
  36. OnPropertyChanged("ReturnToZeroCompletion");
  37. }
  38. }
  39. /// <summary>
  40. /// 停止完成
  41. /// </summary>
  42. private bool stopCompletion;
  43. public bool StopCompletion
  44. {
  45. get { return stopCompletion; }
  46. set
  47. {
  48. stopCompletion = value;
  49. OnPropertyChanged("StopCompletion");
  50. }
  51. }
  52. /// <summary>
  53. /// 速度运行
  54. /// </summary>
  55. private bool speedRunning;
  56. public bool SpeedRunning
  57. {
  58. get { return speedRunning; }
  59. set
  60. {
  61. speedRunning = value;
  62. OnPropertyChanged("SpeedRunning");
  63. }
  64. }
  65. /// <summary>
  66. /// 回零中
  67. /// </summary>
  68. private bool returnToZero;
  69. public bool ReturnToZero
  70. {
  71. get { return returnToZero; }
  72. set
  73. {
  74. returnToZero = value;
  75. OnPropertyChanged("ReturnToZero");
  76. }
  77. }
  78. /// <summary>
  79. /// 中转阀开定位完成
  80. /// </summary>
  81. private bool transferValveOpenCompletion;
  82. public bool TransferValveOpenCompletion
  83. {
  84. get { return transferValveOpenCompletion; }
  85. set
  86. {
  87. transferValveOpenCompletion = value;
  88. OnPropertyChanged("TransferValveOpenCompletion");
  89. }
  90. }
  91. /// <summary>
  92. /// 中转阀关定位完成
  93. /// </summary>
  94. private bool transferValveCloseCompletion;
  95. public bool TransferValveCloseCompletion
  96. {
  97. get { return transferValveCloseCompletion; }
  98. set
  99. {
  100. transferValveCloseCompletion = value;
  101. OnPropertyChanged("TransferValveCloseCompletion");
  102. }
  103. }
  104. /// <summary>
  105. /// 允许数据交换
  106. /// </summary>
  107. private bool allowsDataExchange;
  108. public bool AllowsDataExchange
  109. {
  110. get { return allowsDataExchange; }
  111. set
  112. {
  113. allowsDataExchange = value;
  114. OnPropertyChanged("AllowsDataExchange");
  115. }
  116. }
  117. /// <summary>
  118. /// 暂停数据交换
  119. /// </summary>
  120. private bool pauseDataExchange;
  121. public bool PauseDataExchange
  122. {
  123. get { return pauseDataExchange; }
  124. set
  125. {
  126. pauseDataExchange = value;
  127. OnPropertyChanged("PauseDataExchange");
  128. }
  129. }
  130. /// <summary>
  131. /// 缓存计数延迟完成
  132. /// </summary>
  133. private bool cacheCountDelayed;
  134. public bool CacheCountDelayed
  135. {
  136. get { return cacheCountDelayed; }
  137. set
  138. {
  139. cacheCountDelayed = value;
  140. OnPropertyChanged("CacheCountDelayed");
  141. }
  142. }
  143. /// <summary>
  144. /// 使能
  145. /// </summary>
  146. private bool enable;
  147. public bool Enable
  148. {
  149. get { return enable; }
  150. set
  151. {
  152. enable = value;
  153. OnPropertyChanged("Enable");
  154. }
  155. }
  156. /// <summary>
  157. /// 送瓶轮使能完成
  158. /// </summary>
  159. private bool bottleFeedingWheelEnableCompletion;
  160. public bool BottleFeedingWheelEnableCompletion
  161. {
  162. get { return bottleFeedingWheelEnableCompletion; }
  163. set
  164. {
  165. bottleFeedingWheelEnableCompletion = value;
  166. OnPropertyChanged("BottleFeedingWheelEnableCompletion");
  167. }
  168. }
  169. /// <summary>
  170. /// 送瓶轮停止完成
  171. /// </summary>
  172. private bool bottleFeedingWheelStopCompletion;
  173. public bool BottleFeedingWheelStopCompletion
  174. {
  175. get { return bottleFeedingWheelStopCompletion; }
  176. set
  177. {
  178. bottleFeedingWheelStopCompletion = value;
  179. OnPropertyChanged("BottleFeedingWheelStopCompletion");
  180. }
  181. }
  182. /// <summary>
  183. /// 速度模式运行速度
  184. /// </summary>
  185. private float speedModeRunningSpeed;
  186. public string SpeedModeRunningSpeed
  187. {
  188. get { return speedModeRunningSpeed.ToString("F2"); }
  189. set
  190. {
  191. if (float.TryParse(value, out float result))
  192. {
  193. speedModeRunningSpeed = result;
  194. PlcSettingMessageBus.pLCManagement.WriteSpeedModeRunningSpeed(result);
  195. OnPropertyChanged("SpeedModeRunningSpeed");
  196. }
  197. }
  198. }
  199. /// <summary>
  200. /// 点动速度
  201. /// </summary>
  202. private float jogSpeed;
  203. public string JogSpeed
  204. {
  205. get { return jogSpeed.ToString("F2"); }
  206. set
  207. {
  208. if (float.TryParse(value, out float result))
  209. {
  210. jogSpeed = result;
  211. PlcSettingMessageBus.pLCManagement.WriteJogSpeed(result);
  212. OnPropertyChanged("JogSpeed");
  213. }
  214. }
  215. }
  216. /// <summary>
  217. /// 瓶装设定值
  218. /// </summary>
  219. private ushort bottValueSet;
  220. public ushort BottValueSet
  221. {
  222. get { return bottValueSet; }
  223. set
  224. {
  225. bottValueSet = value;
  226. PlcSettingMessageBus.pLCManagement.WriteBottValueSet(value);
  227. OnPropertyChanged("BottValueSet");
  228. }
  229. }
  230. /// <summary>
  231. /// 中转阀打开速度
  232. /// </summary>
  233. private float transferValveOpeningSpeed;
  234. public string TransferValveOpeningSpeed
  235. {
  236. get { return transferValveOpeningSpeed.ToString("F2"); }
  237. set
  238. {
  239. if (float.TryParse(value, out float result))
  240. {
  241. transferValveOpeningSpeed = result;
  242. PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningSpeed(result);
  243. OnPropertyChanged("TransferValveOpeningSpeed");
  244. }
  245. }
  246. }
  247. /// <summary>
  248. /// 中转阀打开时间
  249. /// </summary>
  250. private UInt32 transferValveOpeningTime;
  251. public UInt32 TransferValveOpeningTime
  252. {
  253. get { return transferValveOpeningTime; }
  254. set
  255. {
  256. transferValveOpeningTime = value;
  257. PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningTime(value);
  258. OnPropertyChanged("TransferValveOpeningTime");
  259. }
  260. }
  261. /// <summary>
  262. /// 罐装减速值
  263. /// </summary>
  264. private ushort bottingDecelerationValue;
  265. public ushort BottingDecelerationValue
  266. {
  267. get { return bottingDecelerationValue; }
  268. set
  269. {
  270. bottingDecelerationValue = value;
  271. PlcSettingMessageBus.pLCManagement.WriteBottingDecelerationValue(value);
  272. OnPropertyChanged("BottingDecelerationValue");
  273. }
  274. }
  275. /// <summary>
  276. /// 缓存减速值
  277. /// </summary>
  278. private UInt16 cacheDecelerationValue { get; set;}
  279. public UInt16 CacheDecelerationValue
  280. {
  281. get { return cacheDecelerationValue; }
  282. set
  283. {
  284. cacheDecelerationValue = value;
  285. PlcSettingMessageBus.pLCManagement.WriteCacheDecelerationValue(value);
  286. OnPropertyChanged("CacheDecelerationValue");
  287. }
  288. }
  289. /// <summary>
  290. /// 缓存计数延迟时间
  291. /// </summary>
  292. private UInt32 cacheCountDelayTiming;
  293. public UInt32 CacheCountDelayTiming
  294. {
  295. get { return cacheCountDelayTiming; }
  296. set
  297. {
  298. cacheCountDelayTiming = value;
  299. PlcSettingMessageBus.pLCManagement.WriteCacheCountDelayTiming(value);
  300. OnPropertyChanged("CacheCountDelayTiming");
  301. }
  302. }
  303. /// <summary>
  304. /// 缓存停机值
  305. /// </summary>
  306. private ushort cacheShutdownValue;
  307. public ushort CacheShutdownValue
  308. {
  309. get { return cacheShutdownValue; }
  310. set
  311. {
  312. cacheShutdownValue = value;
  313. PlcSettingMessageBus.pLCManagement.WriteCacheShutdownValue(value);
  314. OnPropertyChanged("CacheShutdownValue");
  315. }
  316. }
  317. /// <summary>
  318. /// 罐装料筒震台高速值
  319. /// </summary>
  320. private ushort bottingMaterialCylinderVibrationTableHighSpeedValue;
  321. public ushort BottingMaterialCylinderVibrationTableHighSpeedValue
  322. {
  323. get { return bottingMaterialCylinderVibrationTableHighSpeedValue; }
  324. set
  325. {
  326. bottingMaterialCylinderVibrationTableHighSpeedValue = value;
  327. PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableHighSpeedValue(value);
  328. OnPropertyChanged("BottingMaterialCylinderVibrationTableHighSpeedValue");
  329. }
  330. }
  331. /// <summary>
  332. /// 罐装过滤震台高速值
  333. /// </summary>
  334. private ushort bottingFilterVibrationTableHighSpeedValue;
  335. public ushort BottingFilterVibrationTableHighSpeedValue
  336. {
  337. get { return bottingFilterVibrationTableHighSpeedValue; }
  338. set
  339. {
  340. bottingFilterVibrationTableHighSpeedValue = value;
  341. PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableHighSpeedValue(value);
  342. OnPropertyChanged("BottingFilterVibrationTableHighSpeedValue");
  343. }
  344. }
  345. /// <summary>
  346. /// 罐装计数震台高速值
  347. /// </summary>
  348. private ushort bottingCountVibrationTableHighSpeedValue;
  349. public ushort BottingCountVibrationTableHighSpeedValue
  350. {
  351. get { return bottingCountVibrationTableHighSpeedValue; }
  352. set
  353. {
  354. bottingCountVibrationTableHighSpeedValue = value;
  355. PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableHighSpeedValue(value);
  356. OnPropertyChanged("BottingCountVibrationTableHighSpeedValue");
  357. }
  358. }
  359. /// <summary>
  360. /// 罐装料筒震台减速值
  361. /// </summary>
  362. private ushort bottingMaterialCylinderVibrationTableDecelerationSpeedValue;
  363. public ushort BottingMaterialCylinderVibrationTableDecelerationSpeedValue
  364. {
  365. get { return bottingMaterialCylinderVibrationTableDecelerationSpeedValue; }
  366. set
  367. {
  368. bottingMaterialCylinderVibrationTableDecelerationSpeedValue = value;
  369. PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableDecelerationSpeedValue(value);
  370. OnPropertyChanged("BottingMaterialCylinderVibrationTableDecelerationSpeedValue");
  371. }
  372. }
  373. /// <summary>
  374. /// 罐装过滤震台减速值
  375. /// </summary>
  376. private ushort bottingFilterVibrationTableDecelerationSpeedValue;
  377. public ushort BottingFilterVibrationTableDecelerationSpeedValue
  378. {
  379. get { return bottingFilterVibrationTableDecelerationSpeedValue; }
  380. set
  381. {
  382. bottingFilterVibrationTableDecelerationSpeedValue = value;
  383. PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableDecelerationSpeedValue(value);
  384. OnPropertyChanged("BottingFilterVibrationTableDecelerationSpeedValue");
  385. }
  386. }
  387. /// <summary>
  388. /// 罐装计数震台减速值
  389. /// </summary>
  390. private ushort bottingCountVibrationTableDecelerationSpeedValue;
  391. public ushort BottingCountVibrationTableDecelerationSpeedValue
  392. {
  393. get { return bottingCountVibrationTableDecelerationSpeedValue; }
  394. set
  395. {
  396. bottingCountVibrationTableDecelerationSpeedValue = value;
  397. PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableDecelerationSpeedValue(value);
  398. OnPropertyChanged("BottingCountVibrationTableDecelerationSpeedValue");
  399. }
  400. }
  401. /// <summary>
  402. /// 缓存料筒震台高速值
  403. /// </summary>
  404. private ushort cacheMaterialCylinderVibrationTableHighSpeedValue;
  405. public ushort CacheMaterialCylinderVibrationTableHighSpeedValue
  406. {
  407. get { return cacheMaterialCylinderVibrationTableHighSpeedValue; }
  408. set
  409. {
  410. cacheMaterialCylinderVibrationTableHighSpeedValue = value;
  411. PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableHighSpeedValue(value);
  412. OnPropertyChanged("CacheMaterialCylinderVibrationTableHighSpeedValue");
  413. }
  414. }
  415. /// <summary>
  416. /// 缓存过滤震台高速值
  417. /// </summary>
  418. private ushort cacheFilterVibrationTableHighSpeedValue;
  419. public ushort CacheFilterVibrationTableHighSpeedValue
  420. {
  421. get { return cacheFilterVibrationTableHighSpeedValue; }
  422. set
  423. {
  424. cacheFilterVibrationTableHighSpeedValue = value;
  425. PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableHighSpeedValue(value);
  426. OnPropertyChanged("CacheFilterVibrationTableHighSpeedValue");
  427. }
  428. }
  429. /// <summary>
  430. /// 缓存计数震台高速值
  431. /// </summary>
  432. private ushort cacheCountVibrationTableHighSpeedValue;
  433. public ushort CacheCountVibrationTableHighSpeedValue
  434. {
  435. get { return cacheCountVibrationTableHighSpeedValue; }
  436. set
  437. {
  438. cacheCountVibrationTableHighSpeedValue = value;
  439. PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableHighSpeedValue(value);
  440. OnPropertyChanged("CacheCountVibrationTableHighSpeedValue");
  441. }
  442. }
  443. /// <summary>
  444. /// 缓存料筒震台减速值
  445. /// </summary>
  446. private ushort cacheMaterialCylinderVibrationTableDecelerationSpeedValue;
  447. public ushort CacheMaterialCylinderVibrationTableDecelerationSpeedValue
  448. {
  449. get { return cacheMaterialCylinderVibrationTableDecelerationSpeedValue; }
  450. set
  451. {
  452. cacheMaterialCylinderVibrationTableDecelerationSpeedValue = value;
  453. PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableDecelerationSpeedValue(value);
  454. OnPropertyChanged("CacheMaterialCylinderVibrationTableDecelerationSpeedValue");
  455. }
  456. }
  457. /// <summary>
  458. /// 缓存过滤震台减速值
  459. /// </summary>
  460. private ushort cacheFilterVibrationTableDecelerationSpeedValue;
  461. public ushort CacheFilterVibrationTableDecelerationSpeedValue
  462. {
  463. get { return cacheFilterVibrationTableDecelerationSpeedValue; }
  464. set
  465. {
  466. cacheFilterVibrationTableDecelerationSpeedValue = value;
  467. PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableDecelerationSpeedValue(value);
  468. OnPropertyChanged("CacheFilterVibrationTableDecelerationSpeedValue");
  469. }
  470. }
  471. /// <summary>
  472. /// 缓存计数震台减速值
  473. /// </summary>
  474. private ushort cacheCountVibrationTableDecelerationSpeedValue;
  475. public ushort CacheCountVibrationTableDecelerationSpeedValue
  476. {
  477. get { return cacheCountVibrationTableDecelerationSpeedValue; }
  478. set
  479. {
  480. cacheCountVibrationTableDecelerationSpeedValue = value;
  481. PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableDecelerationSpeedValue(value);
  482. OnPropertyChanged("CacheCountVibrationTableDecelerationSpeedValue");
  483. }
  484. }
  485. /// <summary>
  486. /// 阀门打开延时
  487. /// </summary>
  488. private UInt32 gateOpeningDelay;
  489. public UInt32 GateOpeningDelay
  490. {
  491. get { return gateOpeningDelay; }
  492. set
  493. {
  494. gateOpeningDelay = value;
  495. PlcSettingMessageBus.pLCManagement.WriteGateOpeningDelay(value);
  496. OnPropertyChanged("GateOpeningDelay");
  497. }
  498. }
  499. /// <summary>
  500. /// 回零偏移值
  501. /// </summary>
  502. private float returnToZeroOffsetValue;
  503. public string ReturnToZeroOffsetValue
  504. {
  505. get { return returnToZeroOffsetValue.ToString("F2"); }
  506. set
  507. {
  508. if (value == "-")
  509. {
  510. return;
  511. }
  512. if (float.TryParse(value, out float result))
  513. {
  514. returnToZeroOffsetValue = result;
  515. PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetValue(result);
  516. OnPropertyChanged("ReturnToZeroOffsetValue");
  517. }
  518. }
  519. }
  520. /// <summary>
  521. /// 回零偏移速度
  522. /// </summary>
  523. private float returnToZeroOffsetSpeed;
  524. public string ReturnToZeroOffsetSpeed
  525. {
  526. get { return returnToZeroOffsetSpeed.ToString("F2"); }
  527. set
  528. {
  529. if (float.TryParse(value, out float result))
  530. {
  531. returnToZeroOffsetSpeed = result;
  532. PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetSpeed(result);
  533. OnPropertyChanged("ReturnToZeroOffsetSpeed");
  534. }
  535. }
  536. }
  537. /// <summary>
  538. /// 中转阀关闭速度
  539. /// </summary>
  540. private float transferValveClosingSpeed;
  541. public string TransferValveClosingSpeed
  542. {
  543. get { return transferValveClosingSpeed.ToString("F2"); }
  544. set
  545. {
  546. if (float.TryParse(value, out float result))
  547. {
  548. transferValveClosingSpeed = result;
  549. PlcSettingMessageBus.pLCManagement.WriteTransferValveClosingSpeed(result);
  550. OnPropertyChanged("TransferValveClosingSpeed");
  551. }
  552. }
  553. }
  554. /// <summary>
  555. /// 中转阀开位置
  556. /// </summary>
  557. private float transferValveOpenPosition;
  558. public string TransferValveOpenPosition
  559. {
  560. get { return transferValveOpenPosition.ToString("F2"); }
  561. set
  562. {
  563. if (float.TryParse(value, out float result))
  564. {
  565. transferValveOpenPosition = result;
  566. PlcSettingMessageBus.pLCManagement.WriteTransferValveOpenPosition(result);
  567. OnPropertyChanged("TransferValveOpenPosition");
  568. }
  569. }
  570. }
  571. /// <summary>
  572. /// 中转阀关位置
  573. /// </summary>
  574. private float transferValveClosePosition;
  575. public string TransferValveClosePosition
  576. {
  577. get { return transferValveClosePosition.ToString("F2"); }
  578. set
  579. {
  580. if (float.TryParse(value, out float result))
  581. {
  582. transferValveClosePosition = result;
  583. PlcSettingMessageBus.pLCManagement.WriteTransferValveClosePosition(result);
  584. OnPropertyChanged("TransferValveClosePosition");
  585. }
  586. }
  587. }
  588. /// <summary>
  589. /// 气阀开延时
  590. /// </summary>
  591. private UInt32 airValveOpeningDelay;
  592. public UInt32 AirValveOpeningDelay
  593. {
  594. get { return airValveOpeningDelay; }
  595. set
  596. {
  597. airValveOpeningDelay = value;
  598. PlcSettingMessageBus.pLCManagement.WriteAirValveOpeningDelay(value);
  599. OnPropertyChanged("AirValveOpeningDelay");
  600. }
  601. }
  602. /// <summary>
  603. /// 装瓶停机值
  604. /// </summary>
  605. private UInt16 bottlingShutdownValue;
  606. public UInt16 BottlingShutdownValue
  607. {
  608. get { return bottlingShutdownValue; }
  609. set
  610. {
  611. bottlingShutdownValue = value;
  612. PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownValue(value);
  613. OnPropertyChanged("BottlingShutdownValue");
  614. }
  615. }
  616. /// <summary>
  617. /// 装瓶停机时间
  618. /// </summary>
  619. private UInt32 bottlingShutdownTime;
  620. public UInt32 BottlingShutdownTime
  621. {
  622. get { return bottlingShutdownTime; }
  623. set
  624. {
  625. bottlingShutdownTime = value;
  626. PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownTime(value);
  627. OnPropertyChanged("BottlingShutdownTime");
  628. }
  629. }
  630. /// <summary>
  631. /// 送瓶轮运行速度
  632. /// </summary>
  633. private float bottleFeedingWheelRunningSpeed;
  634. public string BottleFeedingWheelRunningSpeed
  635. {
  636. get { return bottleFeedingWheelRunningSpeed.ToString("F2"); }
  637. set
  638. {
  639. if (float.TryParse(value, out float result))
  640. {
  641. bottleFeedingWheelRunningSpeed = result;
  642. PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelRunningSpeed(result);
  643. OnPropertyChanged("BottleFeedingWheelRunningSpeed");
  644. }
  645. }
  646. }
  647. /// <summary>
  648. /// 送瓶轮点动速度
  649. /// </summary>
  650. private float bottleFeedingWheelJogRunningSpeed;
  651. public string BottleFeedingWheelJogRunningSpeed
  652. {
  653. get { return bottleFeedingWheelJogRunningSpeed.ToString("F2"); }
  654. set
  655. {
  656. if (float.TryParse(value, out float result))
  657. {
  658. bottleFeedingWheelJogRunningSpeed = result;
  659. PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelJogRunningSpeed(result);
  660. OnPropertyChanged("BottleFeedingWheelJogRunningSpeed");
  661. }
  662. }
  663. }
  664. /// <summary>
  665. /// 送瓶轮回零偏移值
  666. /// </summary>
  667. private float bottleFeedingWheelReturnToZeroOffsetValue;
  668. public string BottleFeedingWheelReturnToZeroOffsetValue
  669. {
  670. get { return bottleFeedingWheelReturnToZeroOffsetValue.ToString("F2"); }
  671. set
  672. {
  673. if (float.TryParse(value, out float result))
  674. {
  675. bottleFeedingWheelReturnToZeroOffsetValue = result;
  676. PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroOffsetValue(result);
  677. OnPropertyChanged("BottleFeedingWheelReturnToZeroOffsetValue");
  678. }
  679. }
  680. }
  681. /// <summary>
  682. /// 送瓶轮回零速度
  683. /// </summary>
  684. private float bottleFeedingWheelReturnToZeroSpeed;
  685. public string BottleFeedingWheelReturnToZeroSpeed
  686. {
  687. get { return bottleFeedingWheelReturnToZeroSpeed.ToString("F2"); }
  688. set
  689. {
  690. if (float.TryParse(value, out float result))
  691. {
  692. bottleFeedingWheelReturnToZeroSpeed = result;
  693. PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroSpeed(result);
  694. OnPropertyChanged("BottleFeedingWheelReturnToZeroSpeed");
  695. }
  696. }
  697. }
  698. /// <summary>
  699. /// 送瓶轮定位长度
  700. /// </summary>
  701. private float bottleFeedingWheelPositionLength;
  702. public string BottleFeedingWheelPositionLength
  703. {
  704. get { return bottleFeedingWheelPositionLength.ToString("F2"); }
  705. set
  706. {
  707. if (float.TryParse(value, out float result))
  708. {
  709. bottleFeedingWheelPositionLength = result;
  710. PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPositionLength(result);
  711. OnPropertyChanged("BottleFeedingWheelPositionLength");
  712. }
  713. }
  714. }
  715. /// <summary>
  716. /// 送瓶轮暂停时间
  717. /// </summary>
  718. private UInt32 bottleFeedingWheelPauseTime;
  719. public UInt32 BottleFeedingWheelPauseTime
  720. {
  721. get { return bottleFeedingWheelPauseTime; }
  722. set
  723. {
  724. bottleFeedingWheelPauseTime = value;
  725. PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPauseTime(value);
  726. OnPropertyChanged("BottleFeedingWheelPauseTime");
  727. }
  728. }
  729. /// <summary>
  730. /// 下料延时
  731. /// </summary>
  732. private UInt32 delayBlanking;
  733. public UInt32 DelayBlanking
  734. {
  735. get { return delayBlanking; }
  736. set
  737. {
  738. delayBlanking = value;
  739. PlcSettingMessageBus.pLCManagement.WriteDelayBlanking(value);
  740. OnPropertyChanged("DelayBlanking");
  741. }
  742. }
  743. //数据绑定核心实现
  744. public event PropertyChangedEventHandler PropertyChanged;
  745. protected void OnPropertyChanged(string propertyName)
  746. {
  747. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  748. }
  749. }
  750. }