|
- using BPASmartClient.Helper;
- using BPASmartClient.MorkF.Model;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using Microsoft.Toolkit.Mvvm.Input;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.MorkF.ViewModel
- {
- internal class DebugViewModel : ObservableObject
- {
- public bool SimOrderEnable { get { return General_Config.SimOrderAllow; } set { General_Config.SimOrderAllow = value; OnPropertyChanged(); } }
- #region 设备控制
- public RelayCommand PlcInite { get; set; }
- public RelayCommand SimulateOrder { get; set; }
- public RelayCommand MaterialOne { get; set; }
- public RelayCommand MaterialTwo { get; set; }
- public RelayCommand MaterialThree { get; set; }
- public RelayCommand MaterialFour { get; set; }
- public RelayCommand MaterialFive { get; set; }
- public RelayCommand OpenExhaust { get;set; }
- public RelayCommand CloaseExhaust { get; set; }
- public RelayCommand StartQXOne { get; set; }
- public RelayCommand StartQXTwo { get; set; }
- #endregion
-
- #region 菜品控制
-
- public RelayCommand ShreddCabbage { get; set; }
- public RelayCommand FryPork { get; set; }
- public RelayCommand XingBaoGu { get; set; }
- #endregion
-
-
- #region 配料仓控制
- public List<string> PassageWays = new List<string>()
- {
- "通道1",
- "通道2",
- "通道3",
- "通道4",
- "通道5",
- "通道6",
- "通道7",
- "通道8",
- "通道9",
- "通道10",
- "通道11",
- "通道12",
- "通道13",
- "通道14",
- };
- public int PassagePosition { get { return _passagePosition; } set { _passagePosition = value; OnPropertyChanged(); } }
- private int _passagePosition;
- public int Weight { get { return _weight; } set { _weight = value; OnPropertyChanged(); } }
- private int _weight;
- public RelayCommand OutMaterials { get; set; }
- #endregion
-
- #region 炒锅1
- public RelayCommand AddOil { get; set; }
- public RelayCommand StartFire { get; set; }
- public RelayCommand StopFire { get; set; }
- public RelayCommand StartStir { get; set; }
- public RelayCommand StopStir { get; set; }
- public RelayCommand OutFood { get; set; }
- public RelayCommand StirArmGoOrigin { get; set; }
- public RelayCommand StirArmGoWork { get; set; }
- public RelayCommand HBOTGoWork { get; set; }
- public RelayCommand OutMeal { get; set; }
- public RelayCommand SetFire { get; set; }
- public RelayCommand SetStir { get; set; }
- public List<int> lstFire { get; set; } = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
- public List<int> lstStir { get; set; } = new List<int>() { 1, 2, 3 };
- public int FireGear { get { return _fireGear; } set { _fireGear = value; OnPropertyChanged(); } }
- private int _fireGear;
- public int StirGear { get { return _stirGear; } set { _stirGear = value; OnPropertyChanged(); } }
- private int _stirGear;
- #endregion
-
-
- #region 炒锅2
- public RelayCommand SecAddOil { get; set; }
- public RelayCommand SecTempTurnOff { get; set; }
- public RelayCommand SecOneBlock { get; set; }
- public RelayCommand SecTwoBlock { get; set; }
- public RelayCommand SecThreeBlock { get; set; }
- public RelayCommand SecOverTurnOff { get; set; }
- public RelayCommand SecOverOneBlock { get; set; }
- public RelayCommand SecOverTwoBlock { get; set; }
- public RelayCommand SecOverThreeBlock { get; set; }
- public RelayCommand SecOverGoOn { get; set; }
- public RelayCommand SecOverGoDown { get; set; }
- public RelayCommand SecAutoModel { get; set; }
- public RelayCommand SecManualModel { get; set; }
- #endregion
-
- public DebugViewModel()
- {
- #region 设备控制
- PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); });
- SimulateOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("SimultaorOrder"); });
- MaterialOne = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialOne"); });
- MaterialTwo = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialTwo"); });
- MaterialThree = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialThree"); });
- MaterialFour = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialFour"); });
- MaterialFive = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialFive"); });
- OpenExhaust = new RelayCommand(() => { ActionManage.GetInstance.Send("OpenExhaust"); });
- CloaseExhaust = new RelayCommand(() => { ActionManage.GetInstance.Send("CloseExhaust"); });
- StartQXOne = new RelayCommand(() => { ActionManage.GetInstance.Send("StartQXOne", 1); });
- StartQXTwo = new RelayCommand(() => { ActionManage.GetInstance.Send("StartQXTwo", 2); });
- #endregion
- ShreddCabbage = new RelayCommand(() => { ActionManage.GetInstance.Send("ShreddCabbage"); });
- FryPork = new RelayCommand(() => { ActionManage.GetInstance.Send("FryPork"); });
- XingBaoGu = new RelayCommand(() => { ActionManage.GetInstance.Send("XingBaoGu"); });
-
-
- #region 配料仓控制
- OutMaterials = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMaterials" ,new List<int> { PassagePosition,Weight } ); });
- #endregion
-
-
- #region 炒锅1
- AddOil = new RelayCommand(() => { ActionManage.GetInstance.Send("AddOil", 1); });//加油
- StartFire = new RelayCommand(() => { ActionManage.GetInstance.Send("StartFire"); });//加热启动
- StopFire = new RelayCommand(() => { ActionManage.GetInstance.Send("StopFire"); });//加热停止
- StartStir = new RelayCommand(() => { ActionManage.GetInstance.Send("StartStir"); });//搅拌启动
- StopStir = new RelayCommand(() => { ActionManage.GetInstance.Send("StopStir"); });//搅拌停止
- OutFood = new RelayCommand(() => { ActionManage.GetInstance.Send("OutFood"); });//倒菜启动
- StirArmGoOrigin = new RelayCommand(() => { ActionManage.GetInstance.Send("StirArmGoOrigin"); });//搅拌臂去原点位
- StirArmGoWork = new RelayCommand(() => { ActionManage.GetInstance.Send("StirArmGoWork"); });//搅拌臂去炒制位
- HBOTGoWork = new RelayCommand(() => { ActionManage.GetInstance.Send("HBOTGoWork"); });//放盒子到位
- OutMeal = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMeal"); });//出餐启动
- SetFire = new RelayCommand(() => { ActionManage.GetInstance.Send("SetFire", new List<int> { FireGear }); });//加热挡位设定
- SetStir = new RelayCommand(() => { ActionManage.GetInstance.Send("SetStir", new List<int> { StirGear }); });//搅拌挡位设定
- #endregion
-
-
-
- #region 炒锅2
- SecAddOil = new RelayCommand(() => { ActionManage.GetInstance.Send("AddOil", 2); });
- SecTempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff", 2); });
- SecOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock", 2); });
- SecTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock", 2); });
- SecThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock", 2); });
- SecOverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff", 2); });
- SecOverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock", 2); });
- SecOverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock", 2); });
- SecOverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock", 2); });
- SecOverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn", 2); });
- SecOverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown", 2); });
- SecAutoModel = new RelayCommand(() => { ActionManage.GetInstance.Send("AutoModel", 2); });
- SecManualModel = new RelayCommand(() => { ActionManage.GetInstance.Send("ManualModel", 2); });
- #endregion
- }
-
- }
- }
|