终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1142 lines
30 KiB

  1. using FryPot_DosingSystem.AGV;
  2. using Microsoft.Toolkit.Mvvm.ComponentModel;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. namespace FryPot_DosingSystem.ViewModel
  12. {
  13. /// <summary>
  14. /// AGV 视图
  15. /// </summary>
  16. public class AgvViewModel : ObservableObject
  17. {
  18. #region 单例模式
  19. private volatile static AgvViewModel _Instance;
  20. public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel());
  21. public int RollerNum { get { return _rollerNum; } set { _rollerNum = value;OnPropertyChanged(); } }
  22. private int _rollerNum;
  23. public AgvViewModel()
  24. {
  25. Init();
  26. }
  27. #endregion
  28. #region 私有函数
  29. public void Init()
  30. {
  31. //初始化车辆控制
  32. cartModel_1 = new CartModel();
  33. cartModel_2 = new CartModel();
  34. cartModel_3 = new CartModel();
  35. cartModel_4 = new CartModel();
  36. //初始化滚筒线
  37. RollerLines_1 = new RollerLinesModel();
  38. RollerLines_2 = new RollerLinesModel();
  39. RollerLines_3 = new RollerLinesModel();
  40. RollerLines_4 = new RollerLinesModel();
  41. //初始化停车桩
  42. ParkingPileModel_1 = new ParkingPileModel { isBool = IsBool.Yes };
  43. ParkingPileModel_2 = new ParkingPileModel { isBool = IsBool.Yes };
  44. ParkingPileModel_3 = new ParkingPileModel { isBool = IsBool.Yes };
  45. ParkingPileModel_4 = new ParkingPileModel { isBool = IsBool.Yes };
  46. ParkingPileModel_5 = new ParkingPileModel { isBool = IsBool.No };
  47. ParkingPileModel_6 = new ParkingPileModel { isBool = IsBool.No };
  48. //初始化炒锅
  49. wokModel_1 = new WokModel();
  50. wokModel_2 = new WokModel();
  51. wokModel_3 = new WokModel();
  52. wokModel_4 = new WokModel();
  53. wokModel_5 = new WokModel();
  54. // Test();
  55. }
  56. #endregion
  57. #region 公共调用函数
  58. public void Test()
  59. {
  60. RollerLines_2.DishesNum = "3";
  61. wokModel_1.goodsName = "番茄炒蛋";
  62. wokModel_1.workflows = new ObservableCollection<WorkflowModel>
  63. {
  64. new WorkflowModel {id=1,Name="取番茄",isBool= IsBool.Yes},
  65. new WorkflowModel {id=2,Name="取蛋" } };
  66. }
  67. public void SetCleanRollerNum(int num)
  68. {
  69. RollerNum = num;
  70. }
  71. /// <summary>
  72. /// 设置停车桩或充电桩
  73. /// </summary>
  74. /// <param name="id">设置哪一个停车桩:1 2 3(5 6 为充电桩)</param>
  75. /// <param name="isBool">是否有小车</param>
  76. public void Set停车桩(int id, IsBool isBool)
  77. {
  78. try
  79. {
  80. switch (id)
  81. {
  82. case 1:
  83. ParkingPileModel_1.isBool = isBool;
  84. break;
  85. case 2:
  86. ParkingPileModel_2.isBool = isBool;
  87. break;
  88. case 3:
  89. ParkingPileModel_3.isBool = isBool;
  90. break;
  91. case 4:
  92. ParkingPileModel_4.isBool = isBool;
  93. break;
  94. case 5:
  95. ParkingPileModel_5.isBool = isBool;
  96. break;
  97. case 6:
  98. ParkingPileModel_6.isBool = isBool;
  99. break;
  100. }
  101. }
  102. catch (Exception ex)
  103. {
  104. }
  105. }
  106. /// <summary>
  107. /// 小车停止
  108. /// </summary>
  109. /// <param name="id">默认:1 2 3 4,代表四辆车</param>
  110. public void Set小车停止(int id)
  111. {
  112. try
  113. {
  114. switch (id)
  115. {
  116. case 1:
  117. cartModel_1.cartMotionTrajectory = CartMotionTrajectory.Stop;
  118. break;
  119. case 2:
  120. cartModel_2.cartMotionTrajectory = CartMotionTrajectory.Stop;
  121. break;
  122. case 3:
  123. cartModel_3.cartMotionTrajectory = CartMotionTrajectory.Stop;
  124. break;
  125. case 4:
  126. cartModel_4.cartMotionTrajectory = CartMotionTrajectory.Stop;
  127. break;
  128. }
  129. }
  130. catch (Exception ex)
  131. {
  132. }
  133. }
  134. /// <summary>
  135. /// 控制小车运行
  136. /// </summary>
  137. /// <param name="id">默认:1 2 3 4,代表四辆车</param>
  138. /// <param name="cart"></param>
  139. public void Set小车运动(int id, CartMotionTrajectory cart)
  140. {
  141. try
  142. {
  143. switch (id)
  144. {
  145. case 1:
  146. cartModel_1.cartMotionTrajectory = CartMotionTrajectory.Stop;
  147. Thread.Sleep(10);
  148. cartModel_1.cartMotionTrajectory = cart;
  149. break;
  150. case 2:
  151. cartModel_2.cartMotionTrajectory = CartMotionTrajectory.Stop;
  152. Thread.Sleep(10);
  153. cartModel_2.cartMotionTrajectory = cart;
  154. break;
  155. case 3:
  156. cartModel_3.cartMotionTrajectory = CartMotionTrajectory.Stop;
  157. Thread.Sleep(10);
  158. cartModel_3.cartMotionTrajectory = cart;
  159. break;
  160. case 4:
  161. cartModel_4.cartMotionTrajectory = CartMotionTrajectory.Stop;
  162. Thread.Sleep(10);
  163. cartModel_4.cartMotionTrajectory = cart;
  164. break;
  165. }
  166. }
  167. catch (Exception ex)
  168. {
  169. }
  170. }
  171. /// <summary>
  172. /// 小车是否承载物品
  173. /// </summary>
  174. /// <param name="id">默认:1 2 3 4,代表四辆车</param>
  175. /// <param name="cart"></param>
  176. public void Set小车是否承载物品(int id, IsBool cart)
  177. {
  178. try
  179. {
  180. switch (id)
  181. {
  182. case 1:
  183. cartModel_1.isBool = cart;
  184. break;
  185. case 2:
  186. cartModel_2.isBool = cart;
  187. break;
  188. case 3:
  189. cartModel_3.isBool = cart;
  190. break;
  191. case 4:
  192. cartModel_4.isBool = cart;
  193. break;
  194. }
  195. }
  196. catch (Exception ex)
  197. {
  198. }
  199. }
  200. /// <summary>
  201. /// 滚筒线状态
  202. /// </summary>
  203. /// <param name="id">默认:1 2 3 4,代表四条滚筒线,(4 代表空桶线)</param>
  204. /// <param name="cart"></param>
  205. public void Set滚筒线状态(int id, IsRun cart)
  206. {
  207. try
  208. {
  209. switch (id)
  210. {
  211. case 1:
  212. RollerLines_1.isRun = cart;
  213. break;
  214. case 2:
  215. RollerLines_2.isRun = cart;
  216. break;
  217. case 3:
  218. RollerLines_3.isRun = cart;
  219. break;
  220. case 4:
  221. RollerLines_4.isRun = cart;
  222. break;
  223. }
  224. }
  225. catch (Exception ex)
  226. {
  227. }
  228. }
  229. /// <summary>
  230. /// 滚筒线上数量
  231. /// </summary>
  232. /// <param name="id">默认:1 2 3 4,代表四条滚筒线,(4 代表空桶线)</param>
  233. /// <param name="cart">默认: 1 - 8,最多承载 8个菜品或者8个空碗</param>
  234. public void Set滚筒线上数量(int id, string cart)
  235. {
  236. try
  237. {
  238. switch (id)
  239. {
  240. case 1:
  241. RollerLines_1.DishesNum = cart;
  242. break;
  243. case 2:
  244. RollerLines_2.DishesNum = cart;
  245. break;
  246. case 3:
  247. RollerLines_3.DishesNum = cart;
  248. break;
  249. case 4:
  250. RollerLines_4.DishesNum = cart;
  251. break;
  252. }
  253. }
  254. catch (Exception ex)
  255. {
  256. }
  257. }
  258. /// <summary>
  259. /// 设置炒锅显示流程
  260. /// </summary>
  261. /// <param name="id">默认:1 2 3 4 5,代表五个炒锅</param>
  262. /// <param name="mode"></param>
  263. public void Set炒锅显示流程(int id, WokModel mode)
  264. {
  265. try
  266. {
  267. switch (id)
  268. {
  269. case 1:
  270. wokModel_1=mode;
  271. break;
  272. case 2:
  273. wokModel_2 = mode;
  274. break;
  275. case 3:
  276. wokModel_3 = mode;
  277. break;
  278. case 4:
  279. wokModel_4 = mode;
  280. break;
  281. case 5:
  282. wokModel_5 = mode;
  283. break;
  284. }
  285. }
  286. catch (Exception ex)
  287. {
  288. }
  289. }
  290. /// <summary>
  291. /// 启动或停止炒锅
  292. /// </summary>
  293. /// <param name="id">默认:1 2 3 4 5,代表五个炒锅</param>
  294. /// <param name="mode"></param>
  295. public void Set启动或停止炒锅(int id, IsRun mode)
  296. {
  297. try
  298. {
  299. switch (id)
  300. {
  301. case 1:
  302. wokModel_1.isRun= mode;
  303. break;
  304. case 2:
  305. wokModel_2.isRun = mode;
  306. break;
  307. case 3:
  308. wokModel_3.isRun = mode;
  309. break;
  310. case 4:
  311. wokModel_4.isRun = mode;
  312. break;
  313. case 5:
  314. wokModel_5.isRun = mode;
  315. break;
  316. }
  317. }
  318. catch (Exception ex)
  319. {
  320. }
  321. }
  322. #endregion
  323. #region 其他函数
  324. /// <summary>
  325. /// 获取所有命令
  326. /// </summary>
  327. public List<string> GetCommand()
  328. {
  329. List<string> vs = new List<string>();
  330. try
  331. {
  332. vs = System.Enum.GetNames(typeof(CartMotionTrajectory))?.ToList();
  333. }
  334. catch (Exception ex)
  335. {
  336. return vs;
  337. }
  338. return vs;
  339. }
  340. /// <summary>
  341. /// 根据命令获取值
  342. /// </summary>
  343. public CartMotionTrajectory GetCommandValue(string name)
  344. {
  345. return ToEnumValue<CartMotionTrajectory>(name);
  346. }
  347. /// <summary>
  348. /// 根据枚举名称获取枚举值
  349. /// </summary>
  350. public T ToEnumValue<T>(string name)
  351. {
  352. return (T)Enum.Parse(typeof(T), name);
  353. }
  354. #endregion
  355. #region 4个滚筒线控制
  356. /// <summary>
  357. /// 一号滚筒线
  358. /// </summary>
  359. private RollerLinesModel _RollerLines_1;
  360. public RollerLinesModel RollerLines_1
  361. {
  362. get
  363. {
  364. return _RollerLines_1;
  365. }
  366. set
  367. {
  368. if (_RollerLines_1 == value)
  369. return;
  370. _RollerLines_1 = value;
  371. OnPropertyChanged("RollerLines_1");
  372. }
  373. }
  374. /// <summary>
  375. /// 二号滚筒线
  376. /// </summary>
  377. private RollerLinesModel _RollerLines_2;
  378. public RollerLinesModel RollerLines_2
  379. {
  380. get
  381. {
  382. return _RollerLines_2;
  383. }
  384. set
  385. {
  386. if (_RollerLines_2 == value)
  387. return;
  388. _RollerLines_2 = value;
  389. OnPropertyChanged("RollerLines_2");
  390. }
  391. }
  392. /// <summary>
  393. /// 三号滚筒线
  394. /// </summary>
  395. private RollerLinesModel _RollerLines_3;
  396. public RollerLinesModel RollerLines_3
  397. {
  398. get
  399. {
  400. return _RollerLines_3;
  401. }
  402. set
  403. {
  404. if (_RollerLines_3 == value)
  405. return;
  406. _RollerLines_3 = value;
  407. OnPropertyChanged("RollerLines_3");
  408. }
  409. }
  410. /// <summary>
  411. /// 四号滚筒线
  412. /// </summary>
  413. private RollerLinesModel _RollerLines_4;
  414. public RollerLinesModel RollerLines_4
  415. {
  416. get
  417. {
  418. return _RollerLines_4;
  419. }
  420. set
  421. {
  422. if (_RollerLines_4 == value)
  423. return;
  424. _RollerLines_4 = value;
  425. OnPropertyChanged("RollerLines_4");
  426. }
  427. }
  428. #endregion
  429. #region 4个运动小车控制
  430. /// <summary>
  431. /// 一号车控制
  432. /// </summary>
  433. private CartModel _cartModel_1;
  434. public CartModel cartModel_1
  435. {
  436. get
  437. {
  438. return _cartModel_1;
  439. }
  440. set
  441. {
  442. if (_cartModel_1 == value)
  443. return;
  444. _cartModel_1 = value;
  445. OnPropertyChanged("cartModel_1");
  446. }
  447. }
  448. /// <summary>
  449. /// 二号车控制
  450. /// </summary>
  451. private CartModel _cartModel_2;
  452. public CartModel cartModel_2
  453. {
  454. get
  455. {
  456. return _cartModel_2;
  457. }
  458. set
  459. {
  460. if (_cartModel_2 == value)
  461. return;
  462. _cartModel_2 = value;
  463. OnPropertyChanged("cartModel_2");
  464. }
  465. }
  466. /// <summary>
  467. /// 三号车控制
  468. /// </summary>
  469. private CartModel _cartModel_3;
  470. public CartModel cartModel_3
  471. {
  472. get
  473. {
  474. return _cartModel_3;
  475. }
  476. set
  477. {
  478. if (_cartModel_3 == value)
  479. return;
  480. _cartModel_3 = value;
  481. OnPropertyChanged("cartModel_3");
  482. }
  483. }
  484. /// <summary>
  485. /// 四号车控制
  486. /// </summary>
  487. private CartModel _cartModel_4;
  488. public CartModel cartModel_4
  489. {
  490. get
  491. {
  492. return _cartModel_4;
  493. }
  494. set
  495. {
  496. if (_cartModel_4 == value)
  497. return;
  498. _cartModel_4 = value;
  499. OnPropertyChanged("cartModel_4");
  500. }
  501. }
  502. #endregion
  503. #region 6个停车桩控制
  504. /// <summary>
  505. /// 一号停车装
  506. /// </summary>
  507. private ParkingPileModel _ParkingPileModel_1;
  508. public ParkingPileModel ParkingPileModel_1
  509. {
  510. get
  511. {
  512. return _ParkingPileModel_1;
  513. }
  514. set
  515. {
  516. if (_ParkingPileModel_1 == value)
  517. return;
  518. _ParkingPileModel_1 = value;
  519. OnPropertyChanged("ParkingPileModel_1");
  520. }
  521. }
  522. /// <summary>
  523. /// 二号停车装
  524. /// </summary>
  525. private ParkingPileModel _ParkingPileModel_2;
  526. public ParkingPileModel ParkingPileModel_2
  527. {
  528. get
  529. {
  530. return _ParkingPileModel_2;
  531. }
  532. set
  533. {
  534. if (_ParkingPileModel_2 == value)
  535. return;
  536. _ParkingPileModel_2 = value;
  537. OnPropertyChanged("ParkingPileModel_2");
  538. }
  539. }
  540. /// <summary>
  541. /// 三号停车装
  542. /// </summary>
  543. private ParkingPileModel _ParkingPileModel_3;
  544. public ParkingPileModel ParkingPileModel_3
  545. {
  546. get
  547. {
  548. return _ParkingPileModel_3;
  549. }
  550. set
  551. {
  552. if (_ParkingPileModel_3 == value)
  553. return;
  554. _ParkingPileModel_3 = value;
  555. OnPropertyChanged("ParkingPileModel_3");
  556. }
  557. }
  558. /// <summary>
  559. /// 四号停车装
  560. /// </summary>
  561. private ParkingPileModel _ParkingPileModel_4;
  562. public ParkingPileModel ParkingPileModel_4
  563. {
  564. get
  565. {
  566. return _ParkingPileModel_4;
  567. }
  568. set
  569. {
  570. if (_ParkingPileModel_4 == value)
  571. return;
  572. _ParkingPileModel_4 = value;
  573. OnPropertyChanged("ParkingPileModel_4");
  574. }
  575. }
  576. /// <summary>
  577. /// 五号停车装
  578. /// </summary>
  579. private ParkingPileModel _ParkingPileModel_5;
  580. public ParkingPileModel ParkingPileModel_5
  581. {
  582. get
  583. {
  584. return _ParkingPileModel_5;
  585. }
  586. set
  587. {
  588. if (_ParkingPileModel_5 == value)
  589. return;
  590. _ParkingPileModel_5 = value;
  591. OnPropertyChanged("ParkingPileModel_5");
  592. }
  593. }
  594. /// <summary>
  595. /// 六号停车装
  596. /// </summary>
  597. private ParkingPileModel _ParkingPileModel_6;
  598. public ParkingPileModel ParkingPileModel_6
  599. {
  600. get
  601. {
  602. return _ParkingPileModel_6;
  603. }
  604. set
  605. {
  606. if (_ParkingPileModel_6 == value)
  607. return;
  608. _ParkingPileModel_6 = value;
  609. OnPropertyChanged("ParkingPileModel_6");
  610. }
  611. }
  612. #endregion
  613. #region 5个炒锅流程控制
  614. /// <summary>
  615. /// 一号炒锅工作流程
  616. /// </summary>
  617. private WokModel _wokModel_1;
  618. public WokModel wokModel_1
  619. {
  620. get
  621. {
  622. if (_wokModel_1 == null)
  623. {
  624. _wokModel_1 = new WokModel();
  625. }
  626. return _wokModel_1;
  627. }
  628. set
  629. {
  630. if (_wokModel_1 == value)
  631. return;
  632. _wokModel_1 = value;
  633. OnPropertyChanged("wokModel_1");
  634. }
  635. }
  636. /// <summary>
  637. /// 二号炒锅工作流程
  638. /// </summary>
  639. private WokModel _wokModel_2;
  640. public WokModel wokModel_2
  641. {
  642. get
  643. {
  644. return _wokModel_2;
  645. }
  646. set
  647. {
  648. if (_wokModel_2 == value)
  649. return;
  650. _wokModel_2 = value;
  651. OnPropertyChanged("wokModel_2");
  652. }
  653. }
  654. /// <summary>
  655. /// 三号炒锅工作流程
  656. /// </summary>
  657. private WokModel _wokModel_3;
  658. public WokModel wokModel_3
  659. {
  660. get
  661. {
  662. return _wokModel_3;
  663. }
  664. set
  665. {
  666. if (_wokModel_3 == value)
  667. return;
  668. _wokModel_3 = value;
  669. OnPropertyChanged("wokModel_3");
  670. }
  671. }
  672. /// <summary>
  673. /// 四号炒锅工作流程
  674. /// </summary>
  675. private WokModel _wokModel_4;
  676. public WokModel wokModel_4
  677. {
  678. get
  679. {
  680. return _wokModel_4;
  681. }
  682. set
  683. {
  684. if (_wokModel_4 == value)
  685. return;
  686. _wokModel_4 = value;
  687. OnPropertyChanged("wokModel_4");
  688. }
  689. }
  690. /// <summary>
  691. /// 五号炒锅工作流程
  692. /// </summary>
  693. private WokModel _wokModel_5;
  694. public WokModel wokModel_5
  695. {
  696. get
  697. {
  698. return _wokModel_5;
  699. }
  700. set
  701. {
  702. if (_wokModel_5 == value)
  703. return;
  704. _wokModel_5 = value;
  705. OnPropertyChanged("wokModel_5");
  706. }
  707. }
  708. #endregion
  709. }
  710. /// <summary>
  711. /// 小车控制Model
  712. /// </summary>
  713. public class CartModel : ObservableObject
  714. {
  715. /// <summary>
  716. /// 车上是否有物品
  717. /// </summary>
  718. private IsBool _isBool = IsBool.No;
  719. public IsBool isBool
  720. {
  721. get
  722. {
  723. return _isBool;
  724. }
  725. set
  726. {
  727. _isBool = value;
  728. Text = _isBool.ToString();
  729. OnPropertyChanged("isBool");
  730. }
  731. }
  732. /// <summary>
  733. /// 车运动轨迹方式
  734. /// </summary>
  735. private CartMotionTrajectory _cartMotionTrajectory = CartMotionTrajectory.Stop;
  736. public CartMotionTrajectory cartMotionTrajectory
  737. {
  738. get
  739. {
  740. return _cartMotionTrajectory;
  741. }
  742. set
  743. {
  744. _cartMotionTrajectory = value;
  745. Tag = _cartMotionTrajectory.ToString();
  746. OnPropertyChanged("cartMotionTrajectory");
  747. }
  748. }
  749. private string _Text = IsBool.No.ToString();
  750. public string Text
  751. {
  752. get
  753. {
  754. return _Text;
  755. }
  756. set
  757. {
  758. _Text = value;
  759. OnPropertyChanged("Text");
  760. }
  761. }
  762. private string _Tag = CartMotionTrajectory.Stop.ToString();
  763. public string Tag
  764. {
  765. get
  766. {
  767. return _Tag;
  768. }
  769. set
  770. {
  771. _Tag = value;
  772. OnPropertyChanged("Tag");
  773. }
  774. }
  775. }
  776. /// <summary>
  777. /// 停车装控制
  778. /// </summary>
  779. public class ParkingPileModel : ObservableObject
  780. {
  781. /// <summary>
  782. /// 是否有小车
  783. /// </summary>
  784. private IsBool _isBool = IsBool.No;
  785. public IsBool isBool
  786. {
  787. get
  788. {
  789. return _isBool;
  790. }
  791. set
  792. {
  793. _isBool = value;
  794. Text = _isBool.ToString();
  795. OnPropertyChanged("isBool");
  796. }
  797. }
  798. private string _Text = IsBool.No.ToString();
  799. public string Text
  800. {
  801. get
  802. {
  803. return _Text;
  804. }
  805. set
  806. {
  807. _Text = value;
  808. OnPropertyChanged("Text");
  809. }
  810. }
  811. }
  812. /// <summary>
  813. /// 滚筒线控制
  814. /// </summary>
  815. public class RollerLinesModel : ObservableObject
  816. {
  817. /// <summary>
  818. /// 是否运行
  819. /// </summary>
  820. private IsRun _isRun = IsRun.Stop;
  821. public IsRun isRun
  822. {
  823. get
  824. {
  825. return _isRun;
  826. }
  827. set
  828. {
  829. _isRun = value;
  830. Text = _isRun.ToString();
  831. OnPropertyChanged("isBool");
  832. }
  833. }
  834. /// <summary>
  835. /// 滚筒线上面的数量
  836. /// </summary>
  837. private string _DishesNum = "8";
  838. public string DishesNum
  839. {
  840. get
  841. {
  842. return _DishesNum;
  843. }
  844. set
  845. {
  846. _DishesNum = value;
  847. if (!string.IsNullOrEmpty(_DishesNum))
  848. {
  849. int count = 1;
  850. try
  851. {
  852. count = int.Parse(_DishesNum);
  853. if (count >= 0 && count <= 8)
  854. {
  855. _DishesNum = count.ToString();
  856. }
  857. else
  858. _DishesNum = 8.ToString();
  859. }
  860. catch (Exception ex)
  861. {
  862. _DishesNum = 8.ToString();
  863. }
  864. }
  865. OnPropertyChanged("DishesNum");
  866. }
  867. }
  868. private string _Text = IsRun.Stop.ToString();
  869. public string Text
  870. {
  871. get
  872. {
  873. return _Text;
  874. }
  875. set
  876. {
  877. _Text = value;
  878. OnPropertyChanged("Text");
  879. }
  880. }
  881. }
  882. /// <summary>
  883. /// 炒锅 流程控制
  884. /// </summary>
  885. public class WokModel : ObservableObject
  886. {
  887. /// <summary>
  888. /// id
  889. /// </summary>
  890. private string _id;
  891. public string id
  892. {
  893. get
  894. {
  895. return _id;
  896. }
  897. set
  898. {
  899. _id = value;
  900. OnPropertyChanged("id");
  901. }
  902. }
  903. /// <summary>
  904. /// 订单id
  905. /// </summary>
  906. private string _orderID;
  907. public string orderID
  908. {
  909. get
  910. {
  911. return _orderID;
  912. }
  913. set
  914. {
  915. _orderID = value;
  916. OnPropertyChanged("orderID");
  917. }
  918. }
  919. /// <summary>
  920. /// 商品名称
  921. /// </summary>
  922. private string _goodsName;
  923. public string goodsName
  924. {
  925. get
  926. {
  927. return _goodsName;
  928. }
  929. set
  930. {
  931. _goodsName = value;
  932. OnPropertyChanged("goodsName");
  933. }
  934. }
  935. /// <summary>
  936. /// 其他信息
  937. /// </summary>
  938. private string _other;
  939. public string other
  940. {
  941. get
  942. {
  943. return _other;
  944. }
  945. set
  946. {
  947. _other = value;
  948. OnPropertyChanged("other");
  949. }
  950. }
  951. /// <summary>
  952. /// 是否运行
  953. /// </summary>
  954. private IsRun _isRun = IsRun.Stop;
  955. public IsRun isRun
  956. {
  957. get
  958. {
  959. return _isRun;
  960. }
  961. set
  962. {
  963. _isRun = value;
  964. Text = _isRun.ToString();
  965. OnPropertyChanged("isBool");
  966. }
  967. }
  968. private string _Text = IsRun.Stop.ToString();
  969. public string Text
  970. {
  971. get
  972. {
  973. return _Text;
  974. }
  975. set
  976. {
  977. _Text = value;
  978. OnPropertyChanged("Text");
  979. }
  980. }
  981. /// <summary>
  982. /// 工作流程
  983. /// </summary>
  984. private ObservableCollection<WorkflowModel> _workflows = new ObservableCollection<WorkflowModel>();
  985. public ObservableCollection<WorkflowModel> workflows
  986. {
  987. get
  988. {
  989. return _workflows;
  990. }
  991. set
  992. {
  993. _workflows = value;
  994. OnPropertyChanged("workflows");
  995. }
  996. }
  997. public WokModel()
  998. {
  999. id = Guid.NewGuid().ToString();
  1000. workflows = new ObservableCollection<WorkflowModel>();
  1001. }
  1002. }
  1003. /// <summary>
  1004. /// 工作流程
  1005. /// </summary>
  1006. public class WorkflowModel : ObservableObject
  1007. {
  1008. /// <summary>
  1009. /// 序号默认:1-10
  1010. /// </summary>
  1011. private int _id=1;
  1012. public int id
  1013. {
  1014. get
  1015. {
  1016. return _id;
  1017. }
  1018. set
  1019. {
  1020. _id = value;
  1021. xh = GetXH.ID(_id);
  1022. OnPropertyChanged("id");
  1023. }
  1024. }
  1025. /// <summary>
  1026. /// 名称
  1027. /// </summary>
  1028. private string _Name;
  1029. public string Name
  1030. {
  1031. get
  1032. {
  1033. return _Name;
  1034. }
  1035. set
  1036. {
  1037. _Name = value;
  1038. OnPropertyChanged("Name");
  1039. }
  1040. }
  1041. /// <summary>
  1042. /// 是否已完成当前步骤
  1043. /// </summary>
  1044. private IsBool _isBool = IsBool.No;
  1045. public IsBool isBool
  1046. {
  1047. get
  1048. {
  1049. return _isBool;
  1050. }
  1051. set
  1052. {
  1053. _isBool = value;
  1054. if (_isBool == IsBool.Yes)
  1055. {
  1056. visibility = Visibility.Visible;
  1057. }
  1058. else
  1059. {
  1060. visibility = Visibility.Collapsed;
  1061. }
  1062. OnPropertyChanged("isBool");
  1063. }
  1064. }
  1065. private Visibility _visibility = Visibility.Collapsed;
  1066. public Visibility visibility
  1067. {
  1068. get
  1069. {
  1070. return _visibility;
  1071. }
  1072. set
  1073. {
  1074. _visibility = value;
  1075. OnPropertyChanged("visibility");
  1076. }
  1077. }
  1078. private string _xh;
  1079. public string xh
  1080. {
  1081. get
  1082. {
  1083. return _xh;
  1084. }
  1085. set
  1086. {
  1087. _xh = value;
  1088. OnPropertyChanged("xh");
  1089. }
  1090. }
  1091. }
  1092. /// <summary>
  1093. /// 获取序号
  1094. /// </summary>
  1095. static class GetXH
  1096. {
  1097. //①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿
  1098. public static string ID(int i)
  1099. {
  1100. string strbu = "① ";
  1101. string str = "①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿";
  1102. if (i <= 50)
  1103. {
  1104. strbu= str.Substring(i-1, 1)+" ";
  1105. }
  1106. return strbu;
  1107. }
  1108. }
  1109. }