using Aitex.Core.Common;
using Aitex.Core.UI.MVVM;
using Aitex.Core.Util;
using Aitex.Core.Utilities;
using LiveCharts;
using MECF.Framework.Common.Beckhoff.AxisProvider;
using MECF.Framework.Common.Beckhoff.Station;
using MECF.Framework.Common.CommonData.PUF;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.Common.OperationCenter;
using MECF.Framework.Common.Utilities;
using CyberX8_MainPages.Unity;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Input;
using System.Windows.Threading;
namespace CyberX8_MainPages.ViewModels
{
    public class LoaderCycleViewModel : BindableBase
    {
        #region 常量 
        #endregion
        #region 内部变量
        /// 
        /// 模块名称
        /// 
        private string _module = "";
        /// 
        /// 定时器
        /// 
        private DispatcherTimer _timer;
        /// 
        /// RT查询key集合
        /// 
        private List _rtDataKeys = new List();
        /// 
        /// rt查询key数值字典
        /// 
        private Dictionary _rtDataValueDic = new Dictionary();
        /// 
        /// A面循环次数
        /// 
        private string _sideACurrentCycle;
        /// 
        /// A面当前状态
        /// 
        private string _sideAState;
        /// 
        /// A面总共循环次数
        /// 
        private int _sideATotalCycle;
        /// 
        /// A面当前步骤
        /// 
        private string _sideACurrentStep;
        /// 
        /// A面忽略LeakTest
        /// 
        private bool _sideAIgnoreLeakTest;
        /// 
        /// B面循环次数
        /// 
        private string _sideBCurrentCycle;
        /// 
        /// B面当前状态
        /// 
        private string _sideBState;
        /// 
        /// B面总共循环次数
        /// 
        private int _sideBTotalCycle;
        /// 
        /// B面当前步聚
        /// 
        private string _sideBCurrentStep;
        /// 
        /// B面忽略LeakTest
        /// 
        private bool _sideBIgnoreLeakTest;
        #endregion
        #region 属性
        /// 
        /// 模块名称
        /// 
        public string Module
        {
            get { return _module; }
            set { SetProperty(ref _module, value); }
        }
        /// 
        /// A面当前循环次数
        /// 
        public string SideACurrentCycle
        {
            get { return _sideACurrentCycle; }
            set { SetProperty(ref _sideACurrentCycle, value);}
        }
        /// 
        /// A面当前状态
        /// 
        public string SideAState
        {
            get { return _sideAState; }
            set { SetProperty(ref _sideAState, value); }
        }
        /// 
        /// A面总共循环次数
        /// 
        public int SideATotalCycle
        {
            get { return _sideATotalCycle; }
            set { SetProperty(ref _sideATotalCycle, value); }
        }
        /// 
        /// A面当前步骤
        /// 
        public string SideACurrentStep
        {
            get { return _sideACurrentStep; }
            set { SetProperty(ref _sideACurrentStep, value); }
        }
        /// 
        /// A面忽略LeakTest
        /// 
        public bool SideAIgnoreLeakTest
        {
            get { return _sideAIgnoreLeakTest; }
            set { SetProperty(ref _sideAIgnoreLeakTest, value); }
        }
        /// 
        /// B面当前循环次数
        /// 
        public string SideBCurrentCycle
        {
            get { return _sideBCurrentCycle; }
            set { SetProperty(ref _sideBCurrentCycle, value); }
        }
        /// 
        /// B面当前状态
        /// 
        public string SideBState
        {
            get { return _sideBState; }
            set { SetProperty(ref _sideBState, value); }
        }
        /// 
        /// B面总共循环次数
        /// 
        public int SideBTotalCycle
        {
            get { return _sideBTotalCycle; }
            set { SetProperty(ref _sideBTotalCycle, value); }
        }
        /// 
        /// B面当前步骤
        /// 
        public string SideBCurrentStep
        {
            get { return _sideBCurrentStep; }
            set { SetProperty(ref _sideBCurrentStep, value); }
        }
        /// 
        /// B面忽略LeakTest
        /// 
        public bool SideBIgnoreLeakTest
        {
            get { return _sideBIgnoreLeakTest; }
            set { SetProperty(ref _sideBIgnoreLeakTest, value);}
        }
        #endregion
        #region 指令 
        /// 
        /// A面启动循环Command
        /// 
        public ICommand SideAStartCycleCommand { get;private set; }
        /// 
        /// A面启动循环Command
        /// 
        public ICommand SideAStopCycleCommand { get; private set; }
        /// 
        /// B面启动循环Command
        /// 
        public ICommand SideBStartCycleCommand { get; private set; }
        /// 
        /// B面启动循环Command
        /// 
        public ICommand SideBStopCycleCommand { get; private set; }
        #endregion
        /// 
        /// 构造函数
        /// 
        public LoaderCycleViewModel()
        {
            SideAStartCycleCommand = new DelegateCommand