using Prism.Mvvm;
using System;
using System.Windows;
namespace TeamAAS_VP.Models
{
///
/// 设备信息配置,用于保存线别/站点/机台以及 MES 上传设置。
///
public class DeviceInfo : BindableBase
{
private int _deviceNo;
///
/// 设备编号,从0开始
///
public int DeviceNo { get => _deviceNo; set => SetProperty(ref _deviceNo, value); }
private string _deviceName;
///
/// 设备名称
///
public string DeviceName { get => _deviceName; set => SetProperty(ref _deviceName, value); }
private string _deviceDesc;
///
/// 设备描述
///
public string DeviceDesc { get => _deviceDesc; set => SetProperty(ref _deviceDesc, value); }
private string _line;
///
/// 当前作业的线别
///
public string Line { get => _line; set => SetProperty(ref _line, value); }
private string _station;
///
/// 当前作业的站点
///
public string Station { get => _station; set => SetProperty(ref _station, value); }
private string _fixtureId;
///
/// 当前作业的机台编号
///
public string FixtureId { get => _fixtureId; set => SetProperty(ref _fixtureId, value); }
private bool _enableMes;
///
/// 是否启用 MES 通讯功能
///
public bool EnableMES { get => _enableMes; set => SetProperty(ref _enableMes, value); }
private bool _enableXY;
///
/// 是否启用锁螺丝XY超限 通讯功能,默认不启用
///
public bool EnableXY { get => _enableXY; set => SetProperty(ref _enableXY, value); }
private string _mesUrl;
///
/// URL
///
public string MesUrl { get => _mesUrl; set => SetProperty(ref _mesUrl, value); }
private string _LogUrl;
///
/// log的url
///
public string LogUrl { get => _LogUrl; set => SetProperty(ref _LogUrl, value); }
private string _ApiKey;
///
/// ApiKey
///
public string ApiKey { get => _ApiKey; set => SetProperty(ref _ApiKey, value); }
private string _f;
///
/// 全局function参数,传模块,组装站PQC检测组装的传PTL
/// f=PTL
///
public string F { get => _f; set => SetProperty(ref _f, value); }
private string _comp;
///
/// 此参数只有包装站是必传,其他组装站不用传,格式是部件名:部件编码,多个时用英文逗号隔开
/// comp=battery1:B00012345,battery2:B00022355
///
public string comp { get => _comp; set => SetProperty(ref _comp, value); }
private bool _saveCsv;
///
/// 是否保存CSV文件,默认不保存
///
public bool SaveCsv { get => _saveCsv; set => SetProperty(ref _saveCsv, value); }
private bool _ScrewOverrun;
///
/// 是否保存CSV文件,默认不保存
///
public bool ScrewOverrun { get => _ScrewOverrun; set => SetProperty(ref _ScrewOverrun, value); }
private bool _saveCsvPPID;
///
/// 是否保存CSV文件的PPID,默认不保存
///
public bool SaveCsvPPID { get => _saveCsvPPID; set => SetProperty(ref _saveCsvPPID, value); }
private string _saveCsvPath;
///
/// 保存的CSV文件路径
///
public string SaveCsvPath { get => _saveCsvPath; set => SetProperty(ref _saveCsvPath, value); }
//private bool _enableDoubleMes;
/////
///// 是否启用两次产品编号MES获取,默认不启用
/////
//public bool EnableDoubleMes { get => _enableDoubleMes; set => SetProperty(ref _enableDoubleMes, value); }
private CTQ_Data _dataInfo = new CTQ_Data();
public CTQ_Data DataInfo
{
get { return _dataInfo; }
set { SetProperty(ref _dataInfo, value); }
}
public DeviceInfo()
{
DeviceNo = 0;
Line = string.Empty;
Station = string.Empty;
FixtureId = string.Empty;
F = string.Empty;
comp = string.Empty;
MesUrl = string.Empty;
LogUrl = string.Empty;
ApiKey = string.Empty;
EnableMES = false;
EnableXY = false;
SaveCsvPPID = true;
}
public DeviceInfo Copy()
{
return new DeviceInfo
{
DeviceNo = this.DeviceNo,
DeviceName = this.DeviceName,
DeviceDesc = this.DeviceDesc,
Line = this.Line,
Station = this.Station,
FixtureId = this.FixtureId,
F = this.F,
comp = this.comp,
MesUrl = this.MesUrl,
EnableMES = this.EnableMES,
EnableXY = this.EnableXY,
SaveCsv = this.SaveCsv,
ScrewOverrun=this.ScrewOverrun,
SaveCsvPath = this.SaveCsvPath,
//EnableDoubleMes = this.EnableDoubleMes,
DataInfo = this.DataInfo.Copy(),
LogUrl = this.LogUrl,
ApiKey = this.ApiKey,
};
}
}
}