using Aitex.Core.UI.MVVM;
using MECF.Framework.Common.CommonData.Prewet;
using MECF.Framework.Common.CommonData.PUF;
using MECF.Framework.Common.CommonData.Vpw;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.Common.Device.LinMot;
using MECF.Framework.Common.OperationCenter;
using MECF.Framework.Common.Persistent.Prewet;
using MECF.Framework.Common.Persistent.VpwMain;
using MECF.Framework.Common.RecipeCenter;
using MECF.Framework.Common.Utilities;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Windows.Threading;
namespace PunkHPX8_MainPages.ViewModels
{
public class VPWMainViewModel : BindableBase
{
#region 常量
private const string COMMONDATA = "CommonData";
private const string VPW = "vpw";
private const string PERSISTENT_VALUE = "PersistentValue";
#endregion
#region 内部变量
#region Common
///
/// 模块名称
///
private string _module;
///
/// StateMachine
///
private string _stateMachine;
///
/// Status
///
private string _status;
///
/// 数据
///
private VpwMainCommonData _vpwMainCommonData;
///
/// Threshold
///
private VpwMainPersistentValue _vpwMainPersistent;
///
/// 是否是Manual模式
///
private bool _isManualOperationMode;
#endregion
#region UI
///
/// IsErrorState 用于腔体变红
///
private bool _isErrorState;
///
/// 页面功能启用
///
private bool _isEnabled;
///
/// AutoMode页面功能启用
///
private bool _isAutoEnabled;
#endregion
#endregion
#region 系统数据
///
/// 定时器
///
DispatcherTimer _timer;
///
/// 查询后台数据集合
///
private List _rtDataKeys = new List();
///
/// rt查询key数值字典
///
private Dictionary _rtDataValueDic = new Dictionary();
#endregion
#region 属性
#region Common
///
/// 模块名称
///
public string Module { get { return _module; } set { SetProperty(ref _module, value); } }
///
/// StateMachine
///
public string StateMachine { get { return _stateMachine; } set { SetProperty(ref _stateMachine, value); } }
///
/// Status
///
public string Status { get { return _status; } set { SetProperty(ref _status, value); } }
///
/// Commondata
///
public VpwMainCommonData VpwMainCommonData
{
get { return _vpwMainCommonData; }
set { SetProperty(ref _vpwMainCommonData, value); }
}
///
/// Persistent
///
public VpwMainPersistentValue VpwMainPersistent
{
get { return _vpwMainPersistent; }
set { SetProperty(ref _vpwMainPersistent, value); }
}
///
/// 是否是Manual模式
///
public bool IsManualOperationMode { get { return _isManualOperationMode; } set { SetProperty(ref _isManualOperationMode, value); } }
#endregion
#region UI
///
/// IsErrorState
///
public bool IsErrorState { get { return _isErrorState; } set { SetProperty(ref _isErrorState, value); } }
///
/// 页面功能启用
///
public bool IsEnabled
{
get { return _isEnabled; }
set { SetProperty(ref _isEnabled, value); }
}
///
/// AutoMode页面功能启用
///
public bool IsAutoEnabled
{
get { return _isAutoEnabled; }
set { SetProperty(ref _isAutoEnabled, value); }
}
#endregion
#endregion
#region Command指令
public ICommand InitializeCommand { get; set; }
public ICommand HomeCommand { get; set; }
#endregion
public VPWMainViewModel()
{
InitializeCommand = new DelegateCommand