using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tps_LQ_Transmitter.com;
namespace Tps_LQ_Transmitter.models
{
///
/// 测试模板,对测试模板的基础类别
///
public class BaseModel
{
///
/// 测试模板名称,测试指标配置表中的模板名称源自这个参数
///
public string TemplateName { get; protected set; }
public bool IsRuning { get; set; }
public bool IsPassed { get; protected set; }
public DateTime FinishedTime { get; protected set; }
///
/// 这个测试项对应的显示界面,也可能是一个界面有多个测试项共用,取决于顶层的控制
///
public UserControl UC { get; set; }
///
/// 主程序
///
public MainTps tps { get; set; }
public virtual bool Run(TestNode parameters)
{
return false;
}
///
/// 开始测试
///
///
public virtual bool Start(TestNode parameters)
{
IsRuning = true;
IsPassed = false;
bool ok = Run(parameters);
IsRuning = false;
FinishedTime = DateTime.Now;
return ok;
// return true;
}
///
/// 停止测试
///
///
public virtual bool Stop()
{
IsRuning = false;
return true;
}
public event DltShowMsg MessageEvent;
protected void ShowMessage(MsgType msgType, string msg)
{
if (MessageEvent != null)
{
MessageEvent(msgType, msg);
}
}
}
}