PlcMessageShowBindingClass.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  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. if (PlcSettingMessageBus.pLCManagement.WriteSpeedModeRunningSpeed(result))
  194. {
  195. speedModeRunningSpeed = result;
  196. }
  197. OnPropertyChanged("SpeedModeRunningSpeed");
  198. }
  199. }
  200. }
  201. /// <summary>
  202. /// 点动速度
  203. /// </summary>
  204. private float jogSpeed;
  205. public string JogSpeed
  206. {
  207. get { return jogSpeed.ToString("F2"); }
  208. set
  209. {
  210. if (float.TryParse(value, out float result))
  211. {
  212. if(PlcSettingMessageBus.pLCManagement.WriteJogSpeed(result))
  213. {
  214. jogSpeed = result;
  215. }
  216. OnPropertyChanged("JogSpeed");
  217. }
  218. }
  219. }
  220. /// <summary>
  221. /// 瓶装设定值
  222. /// </summary>
  223. private ushort bottValueSet;
  224. public ushort BottValueSet
  225. {
  226. get { return bottValueSet; }
  227. set
  228. {
  229. if(PlcSettingMessageBus.pLCManagement.WriteBottValueSet(value))
  230. {
  231. bottValueSet = value;
  232. }
  233. OnPropertyChanged("BottValueSet");
  234. }
  235. }
  236. /// <summary>
  237. /// 中转阀打开速度
  238. /// </summary>
  239. private float transferValveOpeningSpeed;
  240. public string TransferValveOpeningSpeed
  241. {
  242. get { return transferValveOpeningSpeed.ToString("F2"); }
  243. set
  244. {
  245. if (float.TryParse(value, out float result))
  246. {
  247. if(PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningSpeed(result))
  248. {
  249. transferValveOpeningSpeed = result;
  250. }
  251. OnPropertyChanged("TransferValveOpeningSpeed");
  252. }
  253. }
  254. }
  255. /// <summary>
  256. /// 中转阀打开时间
  257. /// </summary>
  258. private UInt32 transferValveOpeningTime;
  259. public UInt32 TransferValveOpeningTime
  260. {
  261. get { return transferValveOpeningTime; }
  262. set
  263. {
  264. if (PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningTime(value))
  265. {
  266. transferValveOpeningTime = value;
  267. }
  268. OnPropertyChanged("TransferValveOpeningTime");
  269. }
  270. }
  271. /// <summary>
  272. /// 罐装减速值
  273. /// </summary>
  274. private ushort bottingDecelerationValue;
  275. public ushort BottingDecelerationValue
  276. {
  277. get { return bottingDecelerationValue; }
  278. set
  279. {
  280. if (PlcSettingMessageBus.pLCManagement.WriteBottingDecelerationValue(value))
  281. {
  282. bottingDecelerationValue = value;
  283. }
  284. OnPropertyChanged("BottingDecelerationValue");
  285. }
  286. }
  287. /// <summary>
  288. /// 缓存减速值
  289. /// </summary>
  290. private UInt16 cacheDecelerationValue { get; set;}
  291. public UInt16 CacheDecelerationValue
  292. {
  293. get { return cacheDecelerationValue; }
  294. set
  295. {
  296. if (PlcSettingMessageBus.pLCManagement.WriteCacheDecelerationValue(value))
  297. {
  298. cacheDecelerationValue = value;
  299. }
  300. OnPropertyChanged("CacheDecelerationValue");
  301. }
  302. }
  303. /// <summary>
  304. /// 缓存计数延迟时间
  305. /// </summary>
  306. private UInt32 cacheCountDelayTiming;
  307. public UInt32 CacheCountDelayTiming
  308. {
  309. get { return cacheCountDelayTiming; }
  310. set
  311. {
  312. if (PlcSettingMessageBus.pLCManagement.WriteCacheCountDelayTiming(value))
  313. {
  314. cacheCountDelayTiming = value;
  315. }
  316. OnPropertyChanged("CacheCountDelayTiming");
  317. }
  318. }
  319. /// <summary>
  320. /// 缓存停机值
  321. /// </summary>
  322. private ushort cacheShutdownValue;
  323. public ushort CacheShutdownValue
  324. {
  325. get { return cacheShutdownValue; }
  326. set
  327. {
  328. if (PlcSettingMessageBus.pLCManagement.WriteCacheShutdownValue(value))
  329. {
  330. cacheShutdownValue = value;
  331. }
  332. OnPropertyChanged("CacheShutdownValue");
  333. }
  334. }
  335. /// <summary>
  336. /// 罐装料筒震台高速值
  337. /// </summary>
  338. private ushort bottingMaterialCylinderVibrationTableHighSpeedValue;
  339. public ushort BottingMaterialCylinderVibrationTableHighSpeedValue
  340. {
  341. get { return bottingMaterialCylinderVibrationTableHighSpeedValue; }
  342. set
  343. {
  344. if (PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableHighSpeedValue(value))
  345. {
  346. bottingMaterialCylinderVibrationTableHighSpeedValue = value;
  347. }
  348. OnPropertyChanged("BottingMaterialCylinderVibrationTableHighSpeedValue");
  349. }
  350. }
  351. /// <summary>
  352. /// 罐装过滤震台高速值
  353. /// </summary>
  354. private ushort bottingFilterVibrationTableHighSpeedValue;
  355. public ushort BottingFilterVibrationTableHighSpeedValue
  356. {
  357. get { return bottingFilterVibrationTableHighSpeedValue; }
  358. set
  359. {
  360. if (PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableHighSpeedValue(value))
  361. {
  362. bottingFilterVibrationTableHighSpeedValue = value;
  363. }
  364. OnPropertyChanged("BottingFilterVibrationTableHighSpeedValue");
  365. }
  366. }
  367. /// <summary>
  368. /// 罐装计数震台高速值
  369. /// </summary>
  370. private ushort bottingCountVibrationTableHighSpeedValue;
  371. public ushort BottingCountVibrationTableHighSpeedValue
  372. {
  373. get { return bottingCountVibrationTableHighSpeedValue; }
  374. set
  375. {
  376. if(PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableHighSpeedValue(value))
  377. {
  378. bottingCountVibrationTableHighSpeedValue = value;
  379. }
  380. OnPropertyChanged("BottingCountVibrationTableHighSpeedValue");
  381. }
  382. }
  383. /// <summary>
  384. /// 罐装料筒震台减速值
  385. /// </summary>
  386. private ushort bottingMaterialCylinderVibrationTableDecelerationSpeedValue;
  387. public ushort BottingMaterialCylinderVibrationTableDecelerationSpeedValue
  388. {
  389. get { return bottingMaterialCylinderVibrationTableDecelerationSpeedValue; }
  390. set
  391. {
  392. if(PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableDecelerationSpeedValue(value))
  393. {
  394. bottingMaterialCylinderVibrationTableDecelerationSpeedValue = value;
  395. }
  396. OnPropertyChanged("BottingMaterialCylinderVibrationTableDecelerationSpeedValue");
  397. }
  398. }
  399. /// <summary>
  400. /// 罐装过滤震台减速值
  401. /// </summary>
  402. private ushort bottingFilterVibrationTableDecelerationSpeedValue;
  403. public ushort BottingFilterVibrationTableDecelerationSpeedValue
  404. {
  405. get { return bottingFilterVibrationTableDecelerationSpeedValue; }
  406. set
  407. {
  408. if(PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableDecelerationSpeedValue(value))
  409. {
  410. bottingFilterVibrationTableDecelerationSpeedValue = value;
  411. }
  412. OnPropertyChanged("BottingFilterVibrationTableDecelerationSpeedValue");
  413. }
  414. }
  415. /// <summary>
  416. /// 罐装计数震台减速值
  417. /// </summary>
  418. private ushort bottingCountVibrationTableDecelerationSpeedValue;
  419. public ushort BottingCountVibrationTableDecelerationSpeedValue
  420. {
  421. get { return bottingCountVibrationTableDecelerationSpeedValue; }
  422. set
  423. {
  424. if(PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableDecelerationSpeedValue(value))
  425. {
  426. bottingCountVibrationTableDecelerationSpeedValue = value;
  427. }
  428. OnPropertyChanged("BottingCountVibrationTableDecelerationSpeedValue");
  429. }
  430. }
  431. /// <summary>
  432. /// 缓存料筒震台高速值
  433. /// </summary>
  434. private ushort cacheMaterialCylinderVibrationTableHighSpeedValue;
  435. public ushort CacheMaterialCylinderVibrationTableHighSpeedValue
  436. {
  437. get { return cacheMaterialCylinderVibrationTableHighSpeedValue; }
  438. set
  439. {
  440. if(PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableHighSpeedValue(value))
  441. {
  442. cacheMaterialCylinderVibrationTableHighSpeedValue = value;
  443. }
  444. OnPropertyChanged("CacheMaterialCylinderVibrationTableHighSpeedValue");
  445. }
  446. }
  447. /// <summary>
  448. /// 缓存过滤震台高速值
  449. /// </summary>
  450. private ushort cacheFilterVibrationTableHighSpeedValue;
  451. public ushort CacheFilterVibrationTableHighSpeedValue
  452. {
  453. get { return cacheFilterVibrationTableHighSpeedValue; }
  454. set
  455. {
  456. if(PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableHighSpeedValue(value))
  457. {
  458. cacheFilterVibrationTableHighSpeedValue = value;
  459. }
  460. OnPropertyChanged("CacheFilterVibrationTableHighSpeedValue");
  461. }
  462. }
  463. /// <summary>
  464. /// 缓存计数震台高速值
  465. /// </summary>
  466. private ushort cacheCountVibrationTableHighSpeedValue;
  467. public ushort CacheCountVibrationTableHighSpeedValue
  468. {
  469. get { return cacheCountVibrationTableHighSpeedValue; }
  470. set
  471. {
  472. if(PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableHighSpeedValue(value))
  473. {
  474. cacheCountVibrationTableHighSpeedValue = value;
  475. }
  476. OnPropertyChanged("CacheCountVibrationTableHighSpeedValue");
  477. }
  478. }
  479. /// <summary>
  480. /// 缓存料筒震台减速值
  481. /// </summary>
  482. private ushort cacheMaterialCylinderVibrationTableDecelerationSpeedValue;
  483. public ushort CacheMaterialCylinderVibrationTableDecelerationSpeedValue
  484. {
  485. get { return cacheMaterialCylinderVibrationTableDecelerationSpeedValue; }
  486. set
  487. {
  488. if(PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableDecelerationSpeedValue(value))
  489. {
  490. cacheMaterialCylinderVibrationTableDecelerationSpeedValue = value;
  491. }
  492. OnPropertyChanged("CacheMaterialCylinderVibrationTableDecelerationSpeedValue");
  493. }
  494. }
  495. /// <summary>
  496. /// 缓存过滤震台减速值
  497. /// </summary>
  498. private ushort cacheFilterVibrationTableDecelerationSpeedValue;
  499. public ushort CacheFilterVibrationTableDecelerationSpeedValue
  500. {
  501. get { return cacheFilterVibrationTableDecelerationSpeedValue; }
  502. set
  503. {
  504. if(PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableDecelerationSpeedValue(value))
  505. {
  506. cacheFilterVibrationTableDecelerationSpeedValue = value;
  507. }
  508. OnPropertyChanged("CacheFilterVibrationTableDecelerationSpeedValue");
  509. }
  510. }
  511. /// <summary>
  512. /// 缓存计数震台减速值
  513. /// </summary>
  514. private ushort cacheCountVibrationTableDecelerationSpeedValue;
  515. public ushort CacheCountVibrationTableDecelerationSpeedValue
  516. {
  517. get { return cacheCountVibrationTableDecelerationSpeedValue; }
  518. set
  519. {
  520. if(PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableDecelerationSpeedValue(value))
  521. {
  522. cacheCountVibrationTableDecelerationSpeedValue = value;
  523. }
  524. OnPropertyChanged("CacheCountVibrationTableDecelerationSpeedValue");
  525. }
  526. }
  527. /// <summary>
  528. /// 阀门打开延时
  529. /// </summary>
  530. private UInt32 gateOpeningDelay;
  531. public UInt32 GateOpeningDelay
  532. {
  533. get { return gateOpeningDelay; }
  534. set
  535. {
  536. if(PlcSettingMessageBus.pLCManagement.WriteGateOpeningDelay(value))
  537. {
  538. gateOpeningDelay = value;
  539. }
  540. OnPropertyChanged("GateOpeningDelay");
  541. }
  542. }
  543. /// <summary>
  544. /// 回零偏移值
  545. /// </summary>
  546. private float returnToZeroOffsetValue;
  547. public string ReturnToZeroOffsetValue
  548. {
  549. get { return returnToZeroOffsetValue.ToString("F2"); }
  550. set
  551. {
  552. if (value == "-")
  553. {
  554. return;
  555. }
  556. if (float.TryParse(value, out float result))
  557. {
  558. if (PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetValue(result))
  559. {
  560. returnToZeroOffsetValue = result;
  561. }
  562. OnPropertyChanged("ReturnToZeroOffsetValue");
  563. }
  564. }
  565. }
  566. /// <summary>
  567. /// 回零偏移速度
  568. /// </summary>
  569. private float returnToZeroOffsetSpeed;
  570. public string ReturnToZeroOffsetSpeed
  571. {
  572. get { return returnToZeroOffsetSpeed.ToString("F2"); }
  573. set
  574. {
  575. if (float.TryParse(value, out float result))
  576. {
  577. if (PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetSpeed(result))
  578. {
  579. returnToZeroOffsetSpeed = result;
  580. }
  581. OnPropertyChanged("ReturnToZeroOffsetSpeed");
  582. }
  583. }
  584. }
  585. /// <summary>
  586. /// 中转阀关闭速度
  587. /// </summary>
  588. private float transferValveClosingSpeed;
  589. public string TransferValveClosingSpeed
  590. {
  591. get { return transferValveClosingSpeed.ToString("F2"); }
  592. set
  593. {
  594. if (float.TryParse(value, out float result))
  595. {
  596. if(PlcSettingMessageBus.pLCManagement.WriteTransferValveClosingSpeed(result))
  597. {
  598. transferValveClosingSpeed = result;
  599. }
  600. OnPropertyChanged("TransferValveClosingSpeed");
  601. }
  602. }
  603. }
  604. /// <summary>
  605. /// 中转阀开位置
  606. /// </summary>
  607. private float transferValveOpenPosition;
  608. public string TransferValveOpenPosition
  609. {
  610. get { return transferValveOpenPosition.ToString("F2"); }
  611. set
  612. {
  613. if (float.TryParse(value, out float result))
  614. {
  615. if(PlcSettingMessageBus.pLCManagement.WriteTransferValveOpenPosition(result))
  616. {
  617. transferValveOpenPosition = result;
  618. }
  619. OnPropertyChanged("TransferValveOpenPosition");
  620. }
  621. }
  622. }
  623. /// <summary>
  624. /// 中转阀关位置
  625. /// </summary>
  626. private float transferValveClosePosition;
  627. public string TransferValveClosePosition
  628. {
  629. get { return transferValveClosePosition.ToString("F2"); }
  630. set
  631. {
  632. if (float.TryParse(value, out float result))
  633. {
  634. if(PlcSettingMessageBus.pLCManagement.WriteTransferValveClosePosition(result))
  635. {
  636. transferValveClosePosition = result;
  637. }
  638. OnPropertyChanged("TransferValveClosePosition");
  639. }
  640. }
  641. }
  642. /// <summary>
  643. /// 气阀开延时
  644. /// </summary>
  645. private UInt32 airValveOpeningDelay;
  646. public UInt32 AirValveOpeningDelay
  647. {
  648. get { return airValveOpeningDelay; }
  649. set
  650. {
  651. if(PlcSettingMessageBus.pLCManagement.WriteAirValveOpeningDelay(value))
  652. {
  653. airValveOpeningDelay = value;
  654. }
  655. OnPropertyChanged("AirValveOpeningDelay");
  656. }
  657. }
  658. /// <summary>
  659. /// 装瓶停机值
  660. /// </summary>
  661. private UInt16 bottlingShutdownValue;
  662. public UInt16 BottlingShutdownValue
  663. {
  664. get { return bottlingShutdownValue; }
  665. set
  666. {
  667. if(PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownValue(value))
  668. {
  669. bottlingShutdownValue = value;
  670. }
  671. OnPropertyChanged("BottlingShutdownValue");
  672. }
  673. }
  674. /// <summary>
  675. /// 装瓶停机时间
  676. /// </summary>
  677. private UInt32 bottlingShutdownTime;
  678. public UInt32 BottlingShutdownTime
  679. {
  680. get { return bottlingShutdownTime; }
  681. set
  682. {
  683. if(PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownTime(value))
  684. {
  685. bottlingShutdownTime = value;
  686. }
  687. OnPropertyChanged("BottlingShutdownTime");
  688. }
  689. }
  690. /// <summary>
  691. /// 送瓶轮运行速度
  692. /// </summary>
  693. private float bottleFeedingWheelRunningSpeed;
  694. public string BottleFeedingWheelRunningSpeed
  695. {
  696. get { return bottleFeedingWheelRunningSpeed.ToString("F2"); }
  697. set
  698. {
  699. if (float.TryParse(value, out float result))
  700. {
  701. if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelRunningSpeed(result))
  702. {
  703. bottleFeedingWheelRunningSpeed = result;
  704. }
  705. OnPropertyChanged("BottleFeedingWheelRunningSpeed");
  706. }
  707. }
  708. }
  709. /// <summary>
  710. /// 送瓶轮点动速度
  711. /// </summary>
  712. private float bottleFeedingWheelJogRunningSpeed;
  713. public string BottleFeedingWheelJogRunningSpeed
  714. {
  715. get { return bottleFeedingWheelJogRunningSpeed.ToString("F2"); }
  716. set
  717. {
  718. if (float.TryParse(value, out float result))
  719. {
  720. if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelJogRunningSpeed(result))
  721. {
  722. bottleFeedingWheelJogRunningSpeed = result;
  723. }
  724. OnPropertyChanged("BottleFeedingWheelJogRunningSpeed");
  725. }
  726. }
  727. }
  728. /// <summary>
  729. /// 送瓶轮回零偏移值
  730. /// </summary>
  731. private float bottleFeedingWheelReturnToZeroOffsetValue;
  732. public string BottleFeedingWheelReturnToZeroOffsetValue
  733. {
  734. get { return bottleFeedingWheelReturnToZeroOffsetValue.ToString("F2"); }
  735. set
  736. {
  737. if (float.TryParse(value, out float result))
  738. {
  739. if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroOffsetValue(result))
  740. {
  741. bottleFeedingWheelReturnToZeroOffsetValue = result;
  742. }
  743. OnPropertyChanged("BottleFeedingWheelReturnToZeroOffsetValue");
  744. }
  745. }
  746. }
  747. /// <summary>
  748. /// 送瓶轮回零速度
  749. /// </summary>
  750. private float bottleFeedingWheelReturnToZeroSpeed;
  751. public string BottleFeedingWheelReturnToZeroSpeed
  752. {
  753. get { return bottleFeedingWheelReturnToZeroSpeed.ToString("F2"); }
  754. set
  755. {
  756. if (float.TryParse(value, out float result))
  757. {
  758. if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroSpeed(result))
  759. {
  760. bottleFeedingWheelReturnToZeroSpeed = result;
  761. }
  762. OnPropertyChanged("BottleFeedingWheelReturnToZeroSpeed");
  763. }
  764. }
  765. }
  766. /// <summary>
  767. /// 送瓶轮定位长度
  768. /// </summary>
  769. private float bottleFeedingWheelPositionLength;
  770. public string BottleFeedingWheelPositionLength
  771. {
  772. get { return bottleFeedingWheelPositionLength.ToString("F2"); }
  773. set
  774. {
  775. if (float.TryParse(value, out float result))
  776. {
  777. if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPositionLength(result))
  778. {
  779. bottleFeedingWheelPositionLength = result;
  780. }
  781. OnPropertyChanged("BottleFeedingWheelPositionLength");
  782. }
  783. }
  784. }
  785. /// <summary>
  786. /// 送瓶轮暂停时间
  787. /// </summary>
  788. private UInt32 bottleFeedingWheelPauseTime;
  789. public UInt32 BottleFeedingWheelPauseTime
  790. {
  791. get { return bottleFeedingWheelPauseTime; }
  792. set
  793. {
  794. if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPauseTime(value))
  795. {
  796. bottleFeedingWheelPauseTime = value;
  797. }
  798. OnPropertyChanged("BottleFeedingWheelPauseTime");
  799. }
  800. }
  801. /// <summary>
  802. /// 下料延时
  803. /// </summary>
  804. private UInt32 delayBlanking;
  805. public UInt32 DelayBlanking
  806. {
  807. get { return delayBlanking; }
  808. set
  809. {
  810. if (PlcSettingMessageBus.pLCManagement.WriteDelayBlanking(value))
  811. {
  812. delayBlanking = value;
  813. }
  814. OnPropertyChanged("DelayBlanking");
  815. }
  816. }
  817. //数据绑定核心实现
  818. public event PropertyChangedEventHandler PropertyChanged;
  819. protected void OnPropertyChanged(string propertyName)
  820. {
  821. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  822. }
  823. }
  824. }