|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134 |
- using FryPot_DosingSystem.AGV;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows;
-
- namespace FryPot_DosingSystem.ViewModel
- {
- /// <summary>
- /// AGV 视图
- /// </summary>
- public class AgvViewModel : ObservableObject
- {
- #region 单例模式
- private volatile static AgvViewModel _Instance;
- public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel());
- public AgvViewModel()
- {
- Init();
- }
- #endregion
-
- #region 私有函数
- public void Init()
- {
- //初始化车辆控制
- cartModel_1 = new CartModel();
- cartModel_2 = new CartModel();
- cartModel_3 = new CartModel();
- cartModel_4 = new CartModel();
- //初始化滚筒线
- RollerLines_1 = new RollerLinesModel();
- RollerLines_2 = new RollerLinesModel();
- RollerLines_3 = new RollerLinesModel();
- RollerLines_4 = new RollerLinesModel();
- //初始化停车桩
- ParkingPileModel_1 = new ParkingPileModel { isBool = IsBool.Yes };
- ParkingPileModel_2 = new ParkingPileModel { isBool = IsBool.Yes };
- ParkingPileModel_3 = new ParkingPileModel { isBool = IsBool.Yes };
- ParkingPileModel_4 = new ParkingPileModel { isBool = IsBool.Yes };
- ParkingPileModel_5 = new ParkingPileModel { isBool = IsBool.No };
- ParkingPileModel_6 = new ParkingPileModel { isBool = IsBool.No };
- //初始化炒锅
- wokModel_1 = new WokModel();
- wokModel_2 = new WokModel();
- wokModel_3 = new WokModel();
- wokModel_4 = new WokModel();
- wokModel_5 = new WokModel();
- // Test();
- }
- #endregion
-
- #region 公共调用函数
- public void Test()
- {
- RollerLines_2.DishesNum = "3";
-
-
- wokModel_1.goodsName = "番茄炒蛋";
- wokModel_1.workflows = new ObservableCollection<WorkflowModel>
- {
- new WorkflowModel {id=1,Name="取番茄",isBool= IsBool.Yes},
- new WorkflowModel {id=2,Name="取蛋" } };
- }
- /// <summary>
- /// 设置停车桩或充电桩
- /// </summary>
- /// <param name="id">设置哪一个停车桩:1 2 3(5 6 为充电桩)</param>
- /// <param name="isBool">是否有小车</param>
- public void Set停车桩(int id, IsBool isBool)
- {
- try
- {
- switch (id)
- {
- case 1:
- ParkingPileModel_1.isBool = isBool;
- break;
- case 2:
- ParkingPileModel_2.isBool = isBool;
- break;
- case 3:
- ParkingPileModel_3.isBool = isBool;
- break;
- case 4:
- ParkingPileModel_4.isBool = isBool;
- break;
- case 5:
- ParkingPileModel_5.isBool = isBool;
- break;
- case 6:
- ParkingPileModel_6.isBool = isBool;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 小车停止
- /// </summary>
- /// <param name="id">默认:1 2 3 4,代表四辆车</param>
- public void Set小车停止(int id)
- {
- try
- {
- switch (id)
- {
- case 1:
- cartModel_1.cartMotionTrajectory = CartMotionTrajectory.Stop;
- break;
- case 2:
- cartModel_2.cartMotionTrajectory = CartMotionTrajectory.Stop;
- break;
- case 3:
- cartModel_3.cartMotionTrajectory = CartMotionTrajectory.Stop;
- break;
- case 4:
- cartModel_4.cartMotionTrajectory = CartMotionTrajectory.Stop;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 控制小车运行
- /// </summary>
- /// <param name="id">默认:1 2 3 4,代表四辆车</param>
- /// <param name="cart"></param>
- public void Set小车运动(int id, CartMotionTrajectory cart)
- {
- try
- {
- switch (id)
- {
- case 1:
- cartModel_1.cartMotionTrajectory = CartMotionTrajectory.Stop;
- Thread.Sleep(10);
- cartModel_1.cartMotionTrajectory = cart;
- break;
- case 2:
- cartModel_2.cartMotionTrajectory = CartMotionTrajectory.Stop;
- Thread.Sleep(10);
- cartModel_2.cartMotionTrajectory = cart;
- break;
- case 3:
- cartModel_3.cartMotionTrajectory = CartMotionTrajectory.Stop;
- Thread.Sleep(10);
- cartModel_3.cartMotionTrajectory = cart;
- break;
- case 4:
- cartModel_4.cartMotionTrajectory = CartMotionTrajectory.Stop;
- Thread.Sleep(10);
- cartModel_4.cartMotionTrajectory = cart;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 小车是否承载物品
- /// </summary>
- /// <param name="id">默认:1 2 3 4,代表四辆车</param>
- /// <param name="cart"></param>
- public void Set小车是否承载物品(int id, IsBool cart)
- {
- try
- {
- switch (id)
- {
- case 1:
- cartModel_1.isBool = cart;
- break;
- case 2:
- cartModel_2.isBool = cart;
- break;
- case 3:
- cartModel_3.isBool = cart;
- break;
- case 4:
- cartModel_4.isBool = cart;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 滚筒线状态
- /// </summary>
- /// <param name="id">默认:1 2 3 4,代表四条滚筒线,(4 代表空桶线)</param>
- /// <param name="cart"></param>
- public void Set滚筒线状态(int id, IsRun cart)
- {
- try
- {
- switch (id)
- {
- case 1:
- RollerLines_1.isRun = cart;
- break;
- case 2:
- RollerLines_2.isRun = cart;
- break;
- case 3:
- RollerLines_3.isRun = cart;
- break;
- case 4:
- RollerLines_4.isRun = cart;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 滚筒线上数量
- /// </summary>
- /// <param name="id">默认:1 2 3 4,代表四条滚筒线,(4 代表空桶线)</param>
- /// <param name="cart">默认: 1 - 8,最多承载 8个菜品或者8个空碗</param>
- public void Set滚筒线上数量(int id, string cart)
- {
- try
- {
- switch (id)
- {
- case 1:
- RollerLines_1.DishesNum = cart;
- break;
- case 2:
- RollerLines_2.DishesNum = cart;
- break;
- case 3:
- RollerLines_3.DishesNum = cart;
- break;
- case 4:
- RollerLines_4.DishesNum = cart;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 设置炒锅显示流程
- /// </summary>
- /// <param name="id">默认:1 2 3 4 5,代表五个炒锅</param>
- /// <param name="mode"></param>
- public void Set炒锅显示流程(int id, WokModel mode)
- {
- try
- {
- switch (id)
- {
- case 1:
- wokModel_1=mode;
- break;
- case 2:
- wokModel_2 = mode;
- break;
- case 3:
- wokModel_3 = mode;
- break;
- case 4:
- wokModel_4 = mode;
- break;
- case 5:
- wokModel_5 = mode;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- /// <summary>
- /// 启动或停止炒锅
- /// </summary>
- /// <param name="id">默认:1 2 3 4 5,代表五个炒锅</param>
- /// <param name="mode"></param>
- public void Set启动或停止炒锅(int id, IsRun mode)
- {
- try
- {
- switch (id)
- {
- case 1:
- wokModel_1.isRun= mode;
- break;
- case 2:
- wokModel_2.isRun = mode;
- break;
- case 3:
- wokModel_3.isRun = mode;
- break;
- case 4:
- wokModel_4.isRun = mode;
- break;
- case 5:
- wokModel_5.isRun = mode;
- break;
- }
-
- }
- catch (Exception ex)
- {
-
- }
- }
- #endregion
-
- #region 其他函数
- /// <summary>
- /// 获取所有命令
- /// </summary>
- public List<string> GetCommand()
- {
- List<string> vs = new List<string>();
- try
- {
- vs = System.Enum.GetNames(typeof(CartMotionTrajectory))?.ToList();
- }
- catch (Exception ex)
- {
- return vs;
- }
- return vs;
- }
- /// <summary>
- /// 根据命令获取值
- /// </summary>
- public CartMotionTrajectory GetCommandValue(string name)
- {
- return ToEnumValue<CartMotionTrajectory>(name);
- }
- /// <summary>
- /// 根据枚举名称获取枚举值
- /// </summary>
- public T ToEnumValue<T>(string name)
- {
- return (T)Enum.Parse(typeof(T), name);
- }
- #endregion
-
- #region 4个滚筒线控制
- /// <summary>
- /// 一号滚筒线
- /// </summary>
- private RollerLinesModel _RollerLines_1;
- public RollerLinesModel RollerLines_1
- {
- get
- {
- return _RollerLines_1;
- }
- set
- {
- if (_RollerLines_1 == value)
- return;
- _RollerLines_1 = value;
- OnPropertyChanged("RollerLines_1");
- }
- }
- /// <summary>
- /// 二号滚筒线
- /// </summary>
- private RollerLinesModel _RollerLines_2;
- public RollerLinesModel RollerLines_2
- {
- get
- {
- return _RollerLines_2;
- }
- set
- {
- if (_RollerLines_2 == value)
- return;
- _RollerLines_2 = value;
- OnPropertyChanged("RollerLines_2");
- }
- }
- /// <summary>
- /// 三号滚筒线
- /// </summary>
- private RollerLinesModel _RollerLines_3;
- public RollerLinesModel RollerLines_3
- {
- get
- {
- return _RollerLines_3;
- }
- set
- {
- if (_RollerLines_3 == value)
- return;
- _RollerLines_3 = value;
- OnPropertyChanged("RollerLines_3");
- }
- }
- /// <summary>
- /// 四号滚筒线
- /// </summary>
- private RollerLinesModel _RollerLines_4;
- public RollerLinesModel RollerLines_4
- {
- get
- {
- return _RollerLines_4;
- }
- set
- {
- if (_RollerLines_4 == value)
- return;
- _RollerLines_4 = value;
- OnPropertyChanged("RollerLines_4");
- }
- }
- #endregion
-
- #region 4个运动小车控制
- /// <summary>
- /// 一号车控制
- /// </summary>
- private CartModel _cartModel_1;
- public CartModel cartModel_1
- {
- get
- {
- return _cartModel_1;
- }
- set
- {
- if (_cartModel_1 == value)
- return;
- _cartModel_1 = value;
- OnPropertyChanged("cartModel_1");
- }
- }
- /// <summary>
- /// 二号车控制
- /// </summary>
- private CartModel _cartModel_2;
- public CartModel cartModel_2
- {
- get
- {
- return _cartModel_2;
- }
- set
- {
- if (_cartModel_2 == value)
- return;
- _cartModel_2 = value;
- OnPropertyChanged("cartModel_2");
- }
- }
- /// <summary>
- /// 三号车控制
- /// </summary>
- private CartModel _cartModel_3;
- public CartModel cartModel_3
- {
- get
- {
- return _cartModel_3;
- }
- set
- {
- if (_cartModel_3 == value)
- return;
- _cartModel_3 = value;
- OnPropertyChanged("cartModel_3");
- }
- }
- /// <summary>
- /// 四号车控制
- /// </summary>
- private CartModel _cartModel_4;
- public CartModel cartModel_4
- {
- get
- {
- return _cartModel_4;
- }
- set
- {
- if (_cartModel_4 == value)
- return;
- _cartModel_4 = value;
- OnPropertyChanged("cartModel_4");
- }
- }
- #endregion
-
- #region 6个停车桩控制
- /// <summary>
- /// 一号停车装
- /// </summary>
- private ParkingPileModel _ParkingPileModel_1;
- public ParkingPileModel ParkingPileModel_1
- {
- get
- {
- return _ParkingPileModel_1;
- }
- set
- {
- if (_ParkingPileModel_1 == value)
- return;
- _ParkingPileModel_1 = value;
- OnPropertyChanged("ParkingPileModel_1");
- }
- }
- /// <summary>
- /// 二号停车装
- /// </summary>
- private ParkingPileModel _ParkingPileModel_2;
- public ParkingPileModel ParkingPileModel_2
- {
- get
- {
- return _ParkingPileModel_2;
- }
- set
- {
- if (_ParkingPileModel_2 == value)
- return;
- _ParkingPileModel_2 = value;
- OnPropertyChanged("ParkingPileModel_2");
- }
- }
- /// <summary>
- /// 三号停车装
- /// </summary>
- private ParkingPileModel _ParkingPileModel_3;
- public ParkingPileModel ParkingPileModel_3
- {
- get
- {
- return _ParkingPileModel_3;
- }
- set
- {
- if (_ParkingPileModel_3 == value)
- return;
- _ParkingPileModel_3 = value;
- OnPropertyChanged("ParkingPileModel_3");
- }
- }
- /// <summary>
- /// 四号停车装
- /// </summary>
- private ParkingPileModel _ParkingPileModel_4;
- public ParkingPileModel ParkingPileModel_4
- {
- get
- {
- return _ParkingPileModel_4;
- }
- set
- {
- if (_ParkingPileModel_4 == value)
- return;
- _ParkingPileModel_4 = value;
- OnPropertyChanged("ParkingPileModel_4");
- }
- }
- /// <summary>
- /// 五号停车装
- /// </summary>
- private ParkingPileModel _ParkingPileModel_5;
- public ParkingPileModel ParkingPileModel_5
- {
- get
- {
- return _ParkingPileModel_5;
- }
- set
- {
- if (_ParkingPileModel_5 == value)
- return;
- _ParkingPileModel_5 = value;
- OnPropertyChanged("ParkingPileModel_5");
- }
- }
- /// <summary>
- /// 六号停车装
- /// </summary>
- private ParkingPileModel _ParkingPileModel_6;
- public ParkingPileModel ParkingPileModel_6
- {
- get
- {
- return _ParkingPileModel_6;
- }
- set
- {
- if (_ParkingPileModel_6 == value)
- return;
- _ParkingPileModel_6 = value;
- OnPropertyChanged("ParkingPileModel_6");
- }
- }
- #endregion
-
- #region 5个炒锅流程控制
- /// <summary>
- /// 一号炒锅工作流程
- /// </summary>
- private WokModel _wokModel_1;
- public WokModel wokModel_1
- {
- get
- {
- if (_wokModel_1 == null)
- {
- _wokModel_1 = new WokModel();
- }
- return _wokModel_1;
- }
- set
- {
- if (_wokModel_1 == value)
- return;
- _wokModel_1 = value;
- OnPropertyChanged("wokModel_1");
- }
- }
- /// <summary>
- /// 二号炒锅工作流程
- /// </summary>
- private WokModel _wokModel_2;
- public WokModel wokModel_2
- {
- get
- {
- return _wokModel_2;
- }
- set
- {
- if (_wokModel_2 == value)
- return;
- _wokModel_2 = value;
- OnPropertyChanged("wokModel_2");
- }
- }
- /// <summary>
- /// 三号炒锅工作流程
- /// </summary>
- private WokModel _wokModel_3;
- public WokModel wokModel_3
- {
- get
- {
- return _wokModel_3;
- }
- set
- {
- if (_wokModel_3 == value)
- return;
- _wokModel_3 = value;
- OnPropertyChanged("wokModel_3");
- }
- }
- /// <summary>
- /// 四号炒锅工作流程
- /// </summary>
- private WokModel _wokModel_4;
- public WokModel wokModel_4
- {
- get
- {
- return _wokModel_4;
- }
- set
- {
- if (_wokModel_4 == value)
- return;
- _wokModel_4 = value;
- OnPropertyChanged("wokModel_4");
- }
- }
- /// <summary>
- /// 五号炒锅工作流程
- /// </summary>
- private WokModel _wokModel_5;
- public WokModel wokModel_5
- {
- get
- {
- return _wokModel_5;
- }
- set
- {
- if (_wokModel_5 == value)
- return;
- _wokModel_5 = value;
- OnPropertyChanged("wokModel_5");
- }
- }
- #endregion
- }
-
- /// <summary>
- /// 小车控制Model
- /// </summary>
- public class CartModel : ObservableObject
- {
- /// <summary>
- /// 车上是否有物品
- /// </summary>
- private IsBool _isBool = IsBool.No;
- public IsBool isBool
- {
- get
- {
- return _isBool;
- }
- set
- {
- _isBool = value;
- Text = _isBool.ToString();
- OnPropertyChanged("isBool");
- }
- }
- /// <summary>
- /// 车运动轨迹方式
- /// </summary>
- private CartMotionTrajectory _cartMotionTrajectory = CartMotionTrajectory.Stop;
- public CartMotionTrajectory cartMotionTrajectory
- {
- get
- {
- return _cartMotionTrajectory;
- }
- set
- {
- _cartMotionTrajectory = value;
- Tag = _cartMotionTrajectory.ToString();
- OnPropertyChanged("cartMotionTrajectory");
- }
- }
- private string _Text = IsBool.No.ToString();
- public string Text
- {
- get
- {
- return _Text;
- }
- set
- {
- _Text = value;
- OnPropertyChanged("Text");
- }
- }
- private string _Tag = CartMotionTrajectory.Stop.ToString();
- public string Tag
- {
- get
- {
- return _Tag;
- }
- set
- {
- _Tag = value;
- OnPropertyChanged("Tag");
- }
- }
-
- }
- /// <summary>
- /// 停车装控制
- /// </summary>
- public class ParkingPileModel : ObservableObject
- {
- /// <summary>
- /// 是否有小车
- /// </summary>
- private IsBool _isBool = IsBool.No;
- public IsBool isBool
- {
- get
- {
- return _isBool;
- }
- set
- {
- _isBool = value;
- Text = _isBool.ToString();
- OnPropertyChanged("isBool");
- }
- }
- private string _Text = IsBool.No.ToString();
- public string Text
- {
- get
- {
- return _Text;
- }
- set
- {
- _Text = value;
- OnPropertyChanged("Text");
- }
- }
- }
- /// <summary>
- /// 滚筒线控制
- /// </summary>
- public class RollerLinesModel : ObservableObject
- {
- /// <summary>
- /// 是否运行
- /// </summary>
- private IsRun _isRun = IsRun.Stop;
- public IsRun isRun
- {
- get
- {
- return _isRun;
- }
- set
- {
- _isRun = value;
- Text = _isRun.ToString();
- OnPropertyChanged("isBool");
- }
- }
- /// <summary>
- /// 滚筒线上面的数量
- /// </summary>
- private string _DishesNum = "8";
- public string DishesNum
- {
- get
- {
- return _DishesNum;
- }
- set
- {
- _DishesNum = value;
- if (!string.IsNullOrEmpty(_DishesNum))
- {
- int count = 1;
- try
- {
- count = int.Parse(_DishesNum);
- if (count >= 0 && count <= 8)
- {
- _DishesNum = count.ToString();
- }
- else
- _DishesNum = 8.ToString();
- }
- catch (Exception ex)
- {
- _DishesNum = 8.ToString();
- }
- }
- OnPropertyChanged("DishesNum");
- }
- }
- private string _Text = IsRun.Stop.ToString();
- public string Text
- {
- get
- {
- return _Text;
- }
- set
- {
- _Text = value;
- OnPropertyChanged("Text");
- }
- }
- }
- /// <summary>
- /// 炒锅 流程控制
- /// </summary>
- public class WokModel : ObservableObject
- {
- /// <summary>
- /// id
- /// </summary>
- private string _id;
- public string id
- {
- get
- {
- return _id;
- }
- set
- {
- _id = value;
- OnPropertyChanged("id");
- }
- }
- /// <summary>
- /// 订单id
- /// </summary>
- private string _orderID;
- public string orderID
- {
- get
- {
- return _orderID;
- }
- set
- {
- _orderID = value;
- OnPropertyChanged("orderID");
- }
- }
- /// <summary>
- /// 商品名称
- /// </summary>
- private string _goodsName;
- public string goodsName
- {
- get
- {
- return _goodsName;
- }
- set
- {
- _goodsName = value;
- OnPropertyChanged("goodsName");
- }
- }
- /// <summary>
- /// 其他信息
- /// </summary>
- private string _other;
- public string other
- {
- get
- {
- return _other;
- }
- set
- {
- _other = value;
- OnPropertyChanged("other");
- }
- }
- /// <summary>
- /// 是否运行
- /// </summary>
- private IsRun _isRun = IsRun.Stop;
- public IsRun isRun
- {
- get
- {
- return _isRun;
- }
- set
- {
- _isRun = value;
- Text = _isRun.ToString();
- OnPropertyChanged("isBool");
- }
- }
- private string _Text = IsRun.Stop.ToString();
- public string Text
- {
- get
- {
- return _Text;
- }
- set
- {
- _Text = value;
- OnPropertyChanged("Text");
- }
- }
-
- /// <summary>
- /// 工作流程
- /// </summary>
- private ObservableCollection<WorkflowModel> _workflows = new ObservableCollection<WorkflowModel>();
- public ObservableCollection<WorkflowModel> workflows
- {
- get
- {
- return _workflows;
- }
- set
- {
- _workflows = value;
- OnPropertyChanged("workflows");
- }
- }
- public WokModel()
- {
- id = Guid.NewGuid().ToString();
- workflows = new ObservableCollection<WorkflowModel>();
- }
- }
-
- /// <summary>
- /// 工作流程
- /// </summary>
- public class WorkflowModel : ObservableObject
- {
- /// <summary>
- /// 序号默认:1-10
- /// </summary>
- private int _id=1;
- public int id
- {
- get
- {
- return _id;
- }
- set
- {
- _id = value;
- xh = GetXH.ID(_id);
- OnPropertyChanged("id");
- }
- }
- /// <summary>
- /// 名称
- /// </summary>
- private string _Name;
- public string Name
- {
- get
- {
- return _Name;
- }
- set
- {
- _Name = value;
- OnPropertyChanged("Name");
- }
- }
- /// <summary>
- /// 是否已完成当前步骤
- /// </summary>
- private IsBool _isBool = IsBool.No;
- public IsBool isBool
- {
- get
- {
- return _isBool;
- }
- set
- {
- _isBool = value;
- if (_isBool == IsBool.Yes)
- {
- visibility = Visibility.Visible;
- }
- else
- {
- visibility = Visibility.Collapsed;
- }
- OnPropertyChanged("isBool");
- }
- }
- private Visibility _visibility = Visibility.Collapsed;
- public Visibility visibility
- {
- get
- {
- return _visibility;
- }
- set
- {
- _visibility = value;
- OnPropertyChanged("visibility");
- }
- }
- private string _xh;
- public string xh
- {
- get
- {
- return _xh;
- }
- set
- {
- _xh = value;
- OnPropertyChanged("xh");
- }
- }
- }
-
- /// <summary>
- /// 获取序号
- /// </summary>
- static class GetXH
- {
- //①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿
- public static string ID(int i)
- {
- string strbu = "① ";
- string str = "①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿";
- if (i <= 50)
- {
- strbu= str.Substring(i-1, 1)+" ";
- }
- return strbu;
- }
- }
- }
|