终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

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