818 lines
25 KiB
C#
818 lines
25 KiB
C#
using Community;
|
||
using DAL;
|
||
using MahApps.Metro.Controls.Dialogs;
|
||
using Model;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Reflection;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using System.Xml;
|
||
|
||
namespace ViewModel
|
||
{
|
||
public class StandVM : NotificationObject
|
||
{
|
||
/// <summary>
|
||
/// 上报异常的委托
|
||
/// </summary>
|
||
/// <param name="hv"></param>
|
||
public delegate void delegeateExcep(string str);
|
||
/// <summary>
|
||
/// 上报异常的委托事件
|
||
/// </summary>
|
||
public event delegeateExcep eventExcepReport;
|
||
|
||
/// <summary>
|
||
/// 数据引擎
|
||
/// </summary>
|
||
MainWindowDAL dal = new MainWindowDAL();
|
||
|
||
|
||
#region 站别参数
|
||
private StandModel myStand;
|
||
/// <summary>
|
||
/// 站别参数
|
||
/// </summary>
|
||
public StandModel MyStand
|
||
{
|
||
get { return myStand; }
|
||
set
|
||
{
|
||
myStand = value;
|
||
RaisePropertyChanged("MyStand");
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 输入信号
|
||
private List<InputSignal> inputList;
|
||
/// <summary>
|
||
/// 输入信号
|
||
/// </summary>
|
||
public List<InputSignal> InputList
|
||
{
|
||
get { return inputList; }
|
||
set
|
||
{
|
||
inputList = value;
|
||
RaisePropertyChanged("InputList");
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 输出信号
|
||
private List<OutputSignal> outputList;
|
||
/// <summary>
|
||
/// 输出信号
|
||
/// </summary>
|
||
public List<OutputSignal> OutputList
|
||
{
|
||
get { return outputList; }
|
||
set
|
||
{
|
||
outputList = value;
|
||
RaisePropertyChanged("OutputList");
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 通讯连接对象
|
||
private CommunicationManagementClass myConnect;
|
||
/// <summary>
|
||
/// 通讯连接对象
|
||
/// </summary>
|
||
public CommunicationManagementClass MyConnect
|
||
{
|
||
get { return myConnect; }
|
||
set
|
||
{
|
||
myConnect = value;
|
||
RaisePropertyChanged("MyConnect");
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 测试软件返回的信息
|
||
/// </summary>
|
||
CmdMessage TestSoftMessage { get; set; }
|
||
|
||
/// <summary>
|
||
/// 测试仪器回调函数
|
||
/// </summary>
|
||
/// <param name="str"></param>
|
||
private void TestContact_ReceiveCallback(string str)
|
||
{
|
||
TestSoftMessage = XmlTocmdResp(str);
|
||
TestLog(str);//记录日志信息
|
||
// TestSoftResp(TestSoftMessage);
|
||
}
|
||
#endregion
|
||
|
||
#region 取料点
|
||
/// <summary>
|
||
/// 取料点
|
||
/// </summary>
|
||
public RobotPoint TakePoint { get; set; }
|
||
#endregion
|
||
|
||
#region 放料点
|
||
/// <summary>
|
||
/// 放料点
|
||
/// </summary>
|
||
public RobotPoint PutPoint { get; set; }
|
||
#endregion
|
||
|
||
#region 指令集合
|
||
private List<CommonClass> cmdList;
|
||
/// <summary>
|
||
/// 指令集合
|
||
/// </summary>
|
||
public List<CommonClass> CmdList
|
||
{
|
||
get { return cmdList; }
|
||
set { cmdList = value; RaisePropertyChanged("CmdList"); }
|
||
}
|
||
#endregion
|
||
|
||
#region 选中的测试指令
|
||
private CommonClass selectCmd;
|
||
/// <summary>
|
||
/// 选中的测试指令
|
||
/// </summary>
|
||
public CommonClass SelectCmd
|
||
{
|
||
get { return selectCmd; }
|
||
set { selectCmd = value; RaisePropertyChanged("SelectCmd"); }
|
||
}
|
||
#endregion
|
||
|
||
#region 各种方法
|
||
/// <summary>
|
||
/// 手动发送测试指令
|
||
/// </summary>
|
||
public DelegateCommand ShouDongSendCmdCommand { get; set; }
|
||
|
||
/// <summary>
|
||
/// 生产数据清零
|
||
/// </summary>
|
||
public DelegateCommand CountClearedCommand { get; set; }
|
||
|
||
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 当前机种对象
|
||
/// </summary>
|
||
public MachineModel CurrMachine { get; set; }
|
||
|
||
|
||
private bool isEnable;
|
||
/// <summary>
|
||
/// 编辑权限
|
||
/// </summary>
|
||
public bool IsEnable
|
||
{
|
||
get { return isEnable; }
|
||
set { isEnable = value; RaisePropertyChanged("IsEnable"); }
|
||
}
|
||
|
||
#region 构造函数
|
||
/// <summary>
|
||
/// 构造函数
|
||
/// </summary>
|
||
public StandVM(StandModel sm)
|
||
{
|
||
this.MyStand = sm;
|
||
|
||
this.InputList = dal.GetInputList(sm.StandType);
|
||
this.OutputList = dal.GetOutputList(sm.StandType);
|
||
|
||
BoxOpenState = new ShowInfo();
|
||
CmdList = new List<CommonClass>() { new CommonClass() { CommonName="状态询问",CmdStr="A0 01 00 E0" },
|
||
new CommonClass() { CommonName="发送SN",CmdStr="SendSN"},
|
||
new CommonClass() { CommonName="PCB放置完成",CmdStr="A0 03 00 E0"},
|
||
new CommonClass() { CommonName="开始测试",CmdStr="A0 04 00 E0"},
|
||
|
||
};
|
||
|
||
ShouDongSendCmdCommand = new DelegateCommand() { ExecuteAction = new Action<object>(ShouDongSendCmd) };
|
||
CountClearedCommand = new DelegateCommand() { ExecuteAction = new Action<object>(CountCleared) };
|
||
|
||
}
|
||
|
||
|
||
#endregion
|
||
|
||
#region 生产数据清零
|
||
/// <summary>
|
||
/// 生产数据清零
|
||
/// </summary>
|
||
/// <param name="obj"></param>
|
||
private void CountCleared(object obj)
|
||
{
|
||
if (MyStand != null)
|
||
{
|
||
MyStand.BadQuantity = 0;
|
||
MyStand.Capacity = 0;
|
||
MyStand.CTime = 0;
|
||
MyStand.InputQuantity = 0;
|
||
MyStand.OutputQuantity = 0;
|
||
MyStand.RunTime = "";
|
||
MyStand.Yield = 1;
|
||
MyStand.NgCount = 0;
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 手动发送测试指令
|
||
/// <summary>
|
||
/// 手动发送测试指令
|
||
/// </summary>
|
||
/// <param name="obj"></param>
|
||
private void ShouDongSendCmd(object obj)
|
||
{
|
||
if (SelectCmd != null)
|
||
{
|
||
//MyConnect.HexSend = true;
|
||
//if (SelectCmd.CmdStr == "SendSN")
|
||
//{
|
||
// if (!string.IsNullOrEmpty(SnCode))
|
||
// {
|
||
// string str = string.Format("A0 02 {0}E0", StringToHex16String(SnCode.Trim()));
|
||
// MyConnect.Send(str);
|
||
// }
|
||
// else
|
||
// {
|
||
// MyMessageBox.Show("SN错误");
|
||
// }
|
||
|
||
//}
|
||
//else
|
||
//{
|
||
// MyConnect.Send(SelectCmd.CmdStr);
|
||
//}
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 测试盒开关
|
||
private OutputSignal boxSwitche;
|
||
/// <summary>
|
||
/// 测试盒开关
|
||
/// </summary>
|
||
public OutputSignal BoxSwitche
|
||
{
|
||
get { return boxSwitche; }
|
||
set
|
||
{
|
||
boxSwitche = value;
|
||
RaisePropertyChanged("BoxSwitche");
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
/// <summary>
|
||
/// 测试盒子打开信号
|
||
/// </summary>
|
||
public InputSignal BoxOpen { get; set; }
|
||
/// <summary>
|
||
/// 测试盒关闭信号
|
||
/// </summary>
|
||
public InputSignal BoxClose { get; set; }
|
||
|
||
#region 开关箱子状态
|
||
private ShowInfo boxOpenState;
|
||
/// <summary>
|
||
/// 开关箱子状态
|
||
/// </summary>
|
||
public ShowInfo BoxOpenState
|
||
{
|
||
get { return boxOpenState; }
|
||
set
|
||
{
|
||
boxOpenState = value;
|
||
RaisePropertyChanged("BoxOpenState");
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// MES连接对象
|
||
/// </summary>
|
||
public ERP_ParameterClass MyMes { get; set; }
|
||
|
||
|
||
private bool runSwitch;
|
||
/// <summary>
|
||
/// 运行开关
|
||
/// </summary>
|
||
public bool RunSwitch
|
||
{
|
||
get { return runSwitch; }
|
||
set { runSwitch = value; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 运行
|
||
/// </summary>
|
||
public void Run()
|
||
{
|
||
if (RunSwitch)
|
||
{
|
||
TestRun(TestFlow);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 测试流程
|
||
/// </summary>
|
||
public FlowModel TestFlow { get; set; }
|
||
|
||
#region 当前测试产品的SN
|
||
private string snCode;
|
||
/// <summary>
|
||
/// 当前测试产品的SN
|
||
/// </summary>
|
||
public string SnCode
|
||
{
|
||
get { return snCode; }
|
||
set { snCode = value; RaisePropertyChanged("SnCode"); }
|
||
}
|
||
#endregion
|
||
|
||
|
||
#region 测试运行
|
||
|
||
/// <summary>
|
||
/// 要发送的指令
|
||
/// </summary>
|
||
CmdModel SendCmd { get; set; } = new CmdModel();
|
||
/// <summary>
|
||
/// 开始测试时间
|
||
/// </summary>
|
||
DateTime StartTestTime { get; set; }
|
||
/// <summary>
|
||
/// 测试时长
|
||
/// </summary>
|
||
int Testdur { get; set; } = 30;
|
||
|
||
|
||
/// <summary>
|
||
/// 连续测试失败次数
|
||
/// </summary>
|
||
int testNGNumber { get; set; }
|
||
|
||
/// <summary>
|
||
/// 重测次数
|
||
/// </summary>
|
||
int chongceNumber { get; set; }
|
||
/// <summary>
|
||
/// 测试运行
|
||
/// </summary>
|
||
private void TestRun(FlowModel MyFlow)
|
||
{
|
||
switch (MyFlow.RunStep)
|
||
{
|
||
case GengralProcessEnum.Start:
|
||
//查询状态
|
||
SendCmd = new CmdModel() { cmdId = "106", devId = "0", tip = "Query status", uid = "xxxxxxx" };
|
||
MyConnect.SendInfo("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
TestLog("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
break;
|
||
case GengralProcessEnum.Step1:
|
||
//if (TestSoftRespObj.cmdId == "106" && TestSoftRespObj.status == "1")
|
||
if (TestSoftMessage.cmdId == "106")
|
||
{
|
||
//二维码不为空 发送二维码
|
||
if (!string.IsNullOrEmpty(MyStand.Product.StatuInfo))
|
||
{
|
||
//发送二维码
|
||
SendCmd = new CmdModel() { cmdId = "102", tip = "set barcode", devId = "0", uid = "xxxxxxx", QRCode = MyStand.Product.StatuInfo };
|
||
MyConnect.SendInfo("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
|
||
TestLog("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
}
|
||
}
|
||
else if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) //超过一秒没有得到回应 返回上一步继续发送
|
||
{
|
||
MyFlow.RunStep--;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step2:
|
||
//二维码响应正常
|
||
if (TestSoftMessage.cmdId == "102")
|
||
{
|
||
//开始测试
|
||
SendCmd = new CmdModel() { cmdId = "103", tip = "start test", devId = "0", uid = "xxxxxxx" };
|
||
MyConnect.SendInfo("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
|
||
TestLog("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
|
||
//开始计时
|
||
StartTestTime = DateTime.Now;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step3:
|
||
//开始命令响应正常
|
||
if (TestSoftMessage.cmdId == "103" && TestSoftMessage.result == "0")
|
||
{
|
||
//开始测试
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
else if (MyFlow.RunTime.AddMilliseconds(2000) < DateTime.Now)
|
||
{
|
||
//再发一次开始测试
|
||
SendCmd = new CmdModel() { cmdId = "103", tip = "start test", devId = "0", uid = "xxxxxxx" };
|
||
MyConnect.SendInfo("[[" + ConvertToXmL(SendCmd) + "]]");
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step4:
|
||
if (TestSoftMessage.notifyId == "201" && TestSoftMessage.testId == "801")
|
||
{
|
||
UnderLineFlow = new FlowModel("划线流程");
|
||
MyStand.StandState.StatuInfo = "烧录完成,开始划线";
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step5:
|
||
//划线运行
|
||
if (UnderLineRun(UnderLineFlow))
|
||
{
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step6:
|
||
if (TestSoftMessage.notifyId == "201" && TestSoftMessage.testId == "800")
|
||
{
|
||
PressFlow = new FlowModel("按压流程");
|
||
MyStand.StandState.StatuInfo = "划线完成,按压开始";
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step7:
|
||
//按压运行
|
||
if (PressRun(PressFlow))
|
||
{
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step8:
|
||
//等待结果
|
||
if (TestSoftMessage.notifyId == "204")
|
||
{
|
||
MyFlow.RunStep++;
|
||
MyFlow.RunTime = DateTime.Now;
|
||
}
|
||
else if (StartTestTime.AddSeconds(Testdur) < DateTime.Now)
|
||
{
|
||
eventExcepReport(this.MyStand.StandName + "测试超时");
|
||
}
|
||
break;
|
||
case GengralProcessEnum.Step9:
|
||
if (TestSoftMessage.totalResult == "0")
|
||
{
|
||
this.MyStand.InputQuantity++;
|
||
this.MyStand.OutputQuantity++;
|
||
|
||
this.MyStand.StandState.StatuInfo = "OK";
|
||
this.MyStand.StandState.StatusBackground = ColorStr.Green;
|
||
testNGNumber = 0;
|
||
chongceNumber = 0;
|
||
}
|
||
else
|
||
{
|
||
if (chongceNumber >= 1)
|
||
{
|
||
this.MyStand.InputQuantity++;
|
||
this.MyStand.InputQuantity++;
|
||
|
||
chongceNumber = 0;
|
||
this.MyStand.StandState.StatuInfo = "NG";
|
||
this.MyStand.StandState.StatusBackground = ColorStr.Red;
|
||
testNGNumber++;
|
||
if (testNGNumber > 3)
|
||
{
|
||
eventExcepReport(this.MyStand.StandName + "连续3次NG");
|
||
testNGNumber = 0;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//chongceNumber++;
|
||
//BoxContact.SendInfo("2C"); //发送测试盒取出完成命令 (重测直接发送取出完成信息号)
|
||
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 划线运行
|
||
/// <summary>
|
||
/// 划线流程
|
||
/// </summary>
|
||
FlowModel UnderLineFlow { get; set; }
|
||
/// <summary>
|
||
/// 划线运行
|
||
/// </summary>
|
||
private bool UnderLineRun(FlowModel MyFlow)
|
||
{
|
||
bool bl = false;
|
||
switch (MyFlow.RunStep)
|
||
{
|
||
case GengralProcessEnum.Start:
|
||
break;
|
||
case GengralProcessEnum.Step1:
|
||
break;
|
||
}
|
||
return bl;
|
||
}
|
||
#endregion
|
||
|
||
#region 按压运行
|
||
/// <summary>
|
||
/// 按压流程
|
||
/// </summary>
|
||
FlowModel PressFlow { get; set; }
|
||
/// <summary>
|
||
/// 按压运行
|
||
/// </summary>
|
||
/// <param name="MyFlow"></param>
|
||
private bool PressRun(FlowModel MyFlow)
|
||
{
|
||
bool bl = false;
|
||
switch (MyFlow.RunStep)
|
||
{
|
||
case GengralProcessEnum.Start:
|
||
break;
|
||
case GengralProcessEnum.Step1:
|
||
break;
|
||
}
|
||
return bl;
|
||
}
|
||
#endregion
|
||
|
||
|
||
|
||
|
||
#region 记录上传MES日志信息到文件
|
||
/// <summary>
|
||
/// 记录上传MES日志信息到文件
|
||
/// </summary>
|
||
/// <param name="info"></param>
|
||
private void RecordMesLog(string showMag)
|
||
{
|
||
|
||
try
|
||
{
|
||
string path = @"D:\\Log\MesLog\\" + DateTime.Now.ToString("D") + "\\"; //文件夹路径
|
||
string filePath = path + DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".txt"; //
|
||
//创建文件夹
|
||
if (!Directory.Exists(path))
|
||
{
|
||
Directory.CreateDirectory(path);
|
||
}
|
||
|
||
//打开或创建文件
|
||
FS = File.Open(filePath, FileMode.Append);
|
||
|
||
//获得字节数组
|
||
data = System.Text.Encoding.Default.GetBytes(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff") + showMag + "\r\n");
|
||
//开始写入
|
||
FS.Write(data, 0, data.Length);
|
||
//清空缓冲区、关闭流
|
||
FS.Flush();
|
||
FS.Close();
|
||
}
|
||
catch (Exception)
|
||
{
|
||
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 字符串转HEX
|
||
/// <summary>
|
||
/// 字符串转HEX
|
||
/// </summary>
|
||
/// <param name="_str"></param>
|
||
/// <returns></returns>
|
||
public string StringToHex16String(string _str)
|
||
{
|
||
//将字符串转换成字节数组。
|
||
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(_str);
|
||
//定义一个string类型的变量,用于存储转换后的值。
|
||
string result = string.Empty;
|
||
for (int i = 0; i < buffer.Length; i++)
|
||
{
|
||
//将每一个字节数组转换成16进制的字符串,以空格相隔开。
|
||
result += Convert.ToString(buffer[i], 16) + " ";
|
||
}
|
||
return result;
|
||
}
|
||
|
||
#endregion
|
||
|
||
|
||
#region XML转实体对象
|
||
/// <summary>
|
||
/// XML转实体对象
|
||
/// </summary>
|
||
/// <param name="xml"></param>
|
||
/// <returns></returns>
|
||
public CmdMessage XmlTocmdResp(string xml)
|
||
{
|
||
xml = xml.Replace("[[", "");
|
||
xml = xml.Replace("]]", "");
|
||
|
||
CmdMessage entity = new CmdMessage();
|
||
XmlDocument doc = new XmlDocument();
|
||
doc.LoadXml(xml);
|
||
XmlElement xe = doc.DocumentElement;
|
||
|
||
foreach (PropertyInfo p in typeof(CmdMessage).GetProperties())
|
||
{
|
||
p.SetValue(entity, xe.GetAttribute(p.Name), null);//获得s对象属性的值复制给d对象的属性
|
||
}
|
||
|
||
string biaoji = ConvertToXmL(entity);
|
||
return entity;
|
||
}
|
||
#endregion
|
||
|
||
#region 实体对象转换成XML元素
|
||
/// <summary>
|
||
/// 实体对象转换成XML元素
|
||
/// </summary>
|
||
/// <typeparam name="T"></typeparam>
|
||
/// <param name="command"></param>
|
||
/// <returns></returns>
|
||
public string ConvertToXmL<T>(T command)
|
||
{
|
||
XmlElement student = new XmlDocument().CreateElement(typeof(T).Name);//插入一个student节点
|
||
foreach (PropertyInfo p in typeof(T).GetProperties())
|
||
{
|
||
try
|
||
{
|
||
student.SetAttribute(p.Name, p.GetValue(command, null).ToString());//设置id属性
|
||
}
|
||
catch (Exception)
|
||
{
|
||
}
|
||
}
|
||
return student.OuterXml;
|
||
|
||
}
|
||
#endregion
|
||
|
||
|
||
#region 记录日志信息到文件
|
||
/// <summary>
|
||
/// 打开的文件流对象
|
||
/// </summary>
|
||
FileStream FS { get; set; }
|
||
|
||
byte[] data { get; set; }
|
||
/// <summary>
|
||
/// 记录日志信息到文件
|
||
/// </summary>
|
||
/// <param name="info"></param>
|
||
private void TestLog(string showMag)
|
||
{
|
||
lock (this)
|
||
{
|
||
string path = @"D:\\TestLog"; //文件夹路径
|
||
|
||
string paths = @"D:\\TestLog\" + this.MyStand.StandName + DateTime.Now.ToString("D") + ".txt"; //文件路径 以年月日为名称
|
||
|
||
//创建文件夹
|
||
if (!Directory.Exists(path))
|
||
{
|
||
Directory.CreateDirectory(path);
|
||
}
|
||
|
||
//打开或创建文件
|
||
FS = File.Open(paths, FileMode.Append);
|
||
|
||
//获得字节数组
|
||
|
||
data = System.Text.Encoding.Default.GetBytes(DateTime.Now.ToString("yyyyMMddHHmmss") + "→" + showMag + "\r\n");
|
||
//开始写入
|
||
FS.Write(data, 0, data.Length);
|
||
//清空缓冲区、关闭流
|
||
FS.Flush();
|
||
FS.Close();
|
||
}
|
||
|
||
}
|
||
#endregion
|
||
|
||
}
|
||
/// <summary>
|
||
/// 发送测试命令模型
|
||
/// </summary>
|
||
public class CmdModel
|
||
{
|
||
/// <summary>
|
||
/// 指令ID
|
||
/// </summary>
|
||
public string cmdId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 注解
|
||
/// </summary>
|
||
public string tip { get; set; }
|
||
public string devId { get; set; }
|
||
|
||
/// <summary>
|
||
/// Uid
|
||
/// </summary>
|
||
public string uid { get; set; }
|
||
/// <summary>
|
||
/// 二维码
|
||
/// </summary>
|
||
public string QRCode { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 测试指令响应或通知信息类
|
||
/// </summary>
|
||
public class CmdMessage
|
||
{
|
||
/// <summary>
|
||
/// 指令ID
|
||
/// </summary>
|
||
public string cmdId { get; set; }
|
||
/// <summary>
|
||
/// 响应通知ID
|
||
/// </summary>
|
||
public string notifyId { get; set; }
|
||
/// <summary>
|
||
/// 注解
|
||
/// </summary>
|
||
public string tip { get; set; }
|
||
/// <summary>
|
||
/// Uid
|
||
/// </summary>
|
||
public string uid { get; set; }
|
||
|
||
public string devId { get; set; }
|
||
/// <summary>
|
||
/// 状态 status为1表示空闲
|
||
/// </summary>
|
||
public string status { get; set; }
|
||
|
||
/// <summary>
|
||
/// 二维码
|
||
/// </summary>
|
||
public string QRCode { get; set; }
|
||
/// <summary>
|
||
/// 结果
|
||
/// </summary>
|
||
public string result { get; set; }
|
||
|
||
/// <summary>
|
||
/// 测试步骤ID
|
||
/// </summary>
|
||
public string testId { get; set; }
|
||
|
||
/// <summary>
|
||
/// 最终结结果 0:fals 1:true
|
||
/// </summary>
|
||
public string totalResult { get; set; }
|
||
|
||
public CmdMessage()
|
||
{
|
||
cmdId = "";
|
||
notifyId = "";
|
||
tip = "";
|
||
uid = "";
|
||
devId = "";
|
||
status = "";
|
||
QRCode = "";
|
||
result = "";
|
||
testId = "";
|
||
totalResult = "";
|
||
}
|
||
}
|
||
|
||
}
|