|
@@ -15,12 +15,14 @@ using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text;
|
|
|
|
+using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows;
|
|
|
|
|
|
namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
{
|
|
{
|
|
|
|
|
|
|
|
+
|
|
public class AutoTestViewModel : BindableBase, IDialogAware
|
|
public class AutoTestViewModel : BindableBase, IDialogAware
|
|
{
|
|
{
|
|
private readonly IDialogService _dialog;
|
|
private readonly IDialogService _dialog;
|
|
@@ -41,8 +43,9 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
private long schId = 0; //方案ID
|
|
private long schId = 0; //方案ID
|
|
private long globalSchDetailId = 0; //测试方案明细ID
|
|
private long globalSchDetailId = 0; //测试方案明细ID
|
|
private BizTestRecordDtlDto bizTestRecordDtlDto = new BizTestRecordDtlDto(); //测试方案明细表
|
|
private BizTestRecordDtlDto bizTestRecordDtlDto = new BizTestRecordDtlDto(); //测试方案明细表
|
|
- private const string TestMode = "手动测试";
|
|
|
|
-
|
|
|
|
|
|
+ private const string TestMode = "自动测试";
|
|
|
|
+ ManualResetEvent m = new ManualResetEvent(true); //实例化阻塞事件
|
|
|
|
+ CancellationTokenSource tokensource = new CancellationTokenSource(); //声明令牌
|
|
public AutoTestViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper, ILogger logger)
|
|
public AutoTestViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IBizTestRecordService iBizTestRecordService, IBizTestRecordDtlService iBizTestRecordDtlService, IMapper mapper, ILogger logger)
|
|
{
|
|
{
|
|
_dialog = dialog;
|
|
_dialog = dialog;
|
|
@@ -55,10 +58,9 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
_logger = logger;
|
|
_logger = logger;
|
|
CloseCommand = new DelegateCommand(Close);
|
|
CloseCommand = new DelegateCommand(Close);
|
|
- StartCommand = new DelegateCommand<object>(Start);
|
|
|
|
- PreviousCommand = new DelegateCommand<object>(Previous);
|
|
|
|
- NextCommand = new DelegateCommand<object>(Next);
|
|
|
|
- DoneCommand = new DelegateCommand<object>(Done);
|
|
|
|
|
|
+ StartCommand = new DelegateCommand(Start);
|
|
|
|
+ StopOrContinueCommand = new DelegateCommand<object>(StopOrContinueMethod);
|
|
|
|
+
|
|
BeforeConList = new ObservableCollection<BasPlcItemConfigDto>();
|
|
BeforeConList = new ObservableCollection<BasPlcItemConfigDto>();
|
|
InConList = new ObservableCollection<BasPlcItemConfigDto>();
|
|
InConList = new ObservableCollection<BasPlcItemConfigDto>();
|
|
OutConList = new ObservableCollection<BasPlcItemConfigDto>();
|
|
OutConList = new ObservableCollection<BasPlcItemConfigDto>();
|
|
@@ -66,11 +68,29 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void StopOrContinueMethod(object obj)
|
|
|
|
+ {
|
|
|
|
+ if(StopOrContinueCont=="暂停")
|
|
|
|
+ {
|
|
|
|
+ m.Reset(); //阻塞线程
|
|
|
|
+ StopOrContinueCont = "继续";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (StopOrContinueCont == "继续")
|
|
|
|
+ {
|
|
|
|
+ m.Set(); //继续线程
|
|
|
|
+ StopOrContinueCont = "暂停";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region idialog接口实现
|
|
#region idialog接口实现
|
|
- public string Title { set; get; } = "手动测试";
|
|
|
|
|
|
+ public string Title { set; get; } = "自动测试";
|
|
|
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
public event Action<IDialogResult> RequestClose;
|
|
|
|
|
|
@@ -224,7 +244,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 增加测试记录明细
|
|
/// 增加测试记录明细
|
|
/// </summary>
|
|
/// </summary>
|
|
- private void AddTesDtltRecord(long schDetailId)
|
|
|
|
|
|
+ private void AddOrEditTesDtltRecord(long schDetailId)
|
|
{
|
|
{
|
|
//查找record ID
|
|
//查找record ID
|
|
long recordId = 0;
|
|
long recordId = 0;
|
|
@@ -234,105 +254,206 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
recordId = findRecordID.record_id;
|
|
recordId = findRecordID.record_id;
|
|
}
|
|
}
|
|
testStatus = 99;//测试状态赋值为99
|
|
testStatus = 99;//测试状态赋值为99
|
|
|
|
+ //状态status 没有赋值
|
|
|
|
+
|
|
|
|
+ bizTestRecordDtlDto.RecordId = recordId;
|
|
|
|
+ bizTestRecordDtlDto.SchemeDtlId = schDetailId;
|
|
|
|
+ bizTestRecordDtlDto.StartTestTime = startTime;
|
|
|
|
+ bizTestRecordDtlDto.FinishTestTime = endTime;
|
|
|
|
+ bizTestRecordDtlDto.TestMode = TestMode;
|
|
|
|
+ bizTestRecordDtlDto.Status = testStatus;
|
|
|
|
+ bizTestRecordDtlDto.TestResult = GetTestResult();
|
|
|
|
+ bizTestRecordDtlDto.CreateBy = Appsession.UserName;
|
|
|
|
+ bizTestRecordDtlDto.CreateTime = startTime;
|
|
|
|
+ bizTestRecordDtlDto.UpdateBy = Appsession.UserName;
|
|
|
|
+ bizTestRecordDtlDto.UpdateTime = DateTime.Now;
|
|
//记录记录明细表中是否有这个方案明细ID的记录,没有则添加,有则更新记录状态
|
|
//记录记录明细表中是否有这个方案明细ID的记录,没有则添加,有则更新记录状态
|
|
var findRecordDetail = _iBizTestRecordDtlService.FindRecordDetailBySchDtlID(schDetailId);
|
|
var findRecordDetail = _iBizTestRecordDtlService.FindRecordDetailBySchDtlID(schDetailId);
|
|
if (findRecordDetail == null)
|
|
if (findRecordDetail == null)
|
|
{
|
|
{
|
|
- //状态status 没有赋值
|
|
|
|
|
|
|
|
- bizTestRecordDtlDto.RecordId = recordId;
|
|
|
|
- bizTestRecordDtlDto.SchemeDtlId = schDetailId;
|
|
|
|
- bizTestRecordDtlDto.StartTestTime = startTime;
|
|
|
|
- bizTestRecordDtlDto.FinishTestTime = endTime;
|
|
|
|
- bizTestRecordDtlDto.TestMode = TestMode;
|
|
|
|
- bizTestRecordDtlDto.Status = testStatus;
|
|
|
|
- bizTestRecordDtlDto.TestResult = testResult;
|
|
|
|
- bizTestRecordDtlDto.CreateBy = Appsession.UserName;
|
|
|
|
- bizTestRecordDtlDto.CreateTime = DateTime.Now;
|
|
|
|
- bizTestRecordDtlDto.UpdateBy = Appsession.UserName;
|
|
|
|
- bizTestRecordDtlDto.UpdateTime = DateTime.Now;
|
|
|
|
var testRecordDtl = _mapper.Map<BizTestRecordDtlDto, biz_test_record_dtl>(bizTestRecordDtlDto);
|
|
var testRecordDtl = _mapper.Map<BizTestRecordDtlDto, biz_test_record_dtl>(bizTestRecordDtlDto);
|
|
_iBizTestRecordDtlService.Add(testRecordDtl);
|
|
_iBizTestRecordDtlService.Add(testRecordDtl);
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.RecordDtlId = findRecordDetail.record_dtl_id;
|
|
|
|
+ //更新时间
|
|
|
|
+ bizTestRecordDtlDto.UpdateBy = Appsession.UserName;
|
|
|
|
+ bizTestRecordDtlDto.UpdateTime = DateTime.Now;
|
|
|
|
+ UpdateTesDtltRecord();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private int GetTestResult()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ foreach (var item in BeforeConList)
|
|
|
|
+ {
|
|
|
|
+ if (item.TestResult == "不合格" || string.IsNullOrEmpty(item.TestResult))
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ foreach (var item in InConList)
|
|
|
|
+ {
|
|
|
|
+ if (item.TestResult == "不合格" || string.IsNullOrEmpty(item.TestResult))
|
|
|
|
+ {
|
|
|
|
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ foreach (var item in OutConList)
|
|
|
|
+ {
|
|
|
|
+ if (item.TestResult == "不合格" || string.IsNullOrEmpty(item.TestResult))
|
|
|
|
+ {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 更新测试记录
|
|
|
|
+ /// </summary>
|
|
private void UpdateTesDtltRecord()
|
|
private void UpdateTesDtltRecord()
|
|
{
|
|
{
|
|
|
|
|
|
var testRecordDtl = _mapper.Map<BizTestRecordDtlDto, biz_test_record_dtl>(bizTestRecordDtlDto);
|
|
var testRecordDtl = _mapper.Map<BizTestRecordDtlDto, biz_test_record_dtl>(bizTestRecordDtlDto);
|
|
_iBizTestRecordDtlService.Edit(testRecordDtl);
|
|
_iBizTestRecordDtlService.Edit(testRecordDtl);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 完成时间
|
|
|
|
|
|
+ /// 下一步
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="obj"></param>
|
|
|
|
- private void Done(object obj)
|
|
|
|
|
|
+ private void Next( )
|
|
{
|
|
{
|
|
- endTime = DateTime.Now;
|
|
|
|
|
|
+ StepIndex = 0;
|
|
|
|
+ ///查找方案下的所有方案明细,并排序,
|
|
|
|
+ var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.OrderBy(x => x.scheme_dtl_id);
|
|
|
|
+ foreach (var item in basicSchDtls)
|
|
|
|
+ {
|
|
|
|
+ //在测试结果明细中查看
|
|
|
|
+ long schDetailId = item.scheme_dtl_id;
|
|
|
|
+ if (schDetailId > globalSchDetailId)
|
|
|
|
+ {
|
|
|
|
+ globalSchDetailId = schDetailId;
|
|
|
|
+ int id = Convert.ToInt32(schDetailId);
|
|
|
|
+ //界面显示
|
|
|
|
+ GetDetailInfo(id);
|
|
|
|
+ //记录记录明细表中是否有这个方案明细ID的记录,没有则添加,有则更新记录状态
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ long maxDtlId = basicSchDtls.Select(x => x.scheme_dtl_id).Max();
|
|
|
|
+ if (globalSchDetailId== maxDtlId)
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show("已是此测试方案最后一个测试项!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- private void Next(object obj)
|
|
|
|
|
|
+ private void Previous(object obj)
|
|
{
|
|
{
|
|
|
|
+ StepIndex = 0;
|
|
///查找方案下的所有方案明细,并排序,
|
|
///查找方案下的所有方案明细,并排序,
|
|
var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.OrderBy(x => x.scheme_dtl_id);
|
|
var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.OrderBy(x => x.scheme_dtl_id);
|
|
foreach (var item in basicSchDtls)
|
|
foreach (var item in basicSchDtls)
|
|
{
|
|
{
|
|
//在测试结果明细中查看
|
|
//在测试结果明细中查看
|
|
long schDetailId = item.scheme_dtl_id;
|
|
long schDetailId = item.scheme_dtl_id;
|
|
- if (schDetailId > globalSchDetailId)
|
|
|
|
|
|
+ if (schDetailId < globalSchDetailId)
|
|
{
|
|
{
|
|
globalSchDetailId = schDetailId;
|
|
globalSchDetailId = schDetailId;
|
|
int id = Convert.ToInt32(schDetailId);
|
|
int id = Convert.ToInt32(schDetailId);
|
|
//界面显示
|
|
//界面显示
|
|
GetDetailInfo(id);
|
|
GetDetailInfo(id);
|
|
//记录记录明细表中是否有这个方案明细ID的记录,没有则添加,有则更新记录状态
|
|
//记录记录明细表中是否有这个方案明细ID的记录,没有则添加,有则更新记录状态
|
|
- var findRecordDetail = _iBizTestRecordDtlService.FindRecordDetailBySchDtlID(schDetailId);
|
|
|
|
- if (findRecordDetail == null)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- //增加测试记录明细
|
|
|
|
- AddTesDtltRecord(globalSchDetailId);
|
|
|
|
|
|
|
|
- }
|
|
|
|
break;
|
|
break;
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show("已是此测试方案第一个测试项!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 开始检测
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="obj"></param>
|
|
|
|
+ private async void Start()
|
|
|
|
+ {
|
|
|
|
+ CancellationToken cancellationToken = tokensource.Token;
|
|
|
|
+ await Task.Run(async() => //模拟耗时任务
|
|
|
|
+ {
|
|
|
|
+ if (cancellationToken.IsCancellationRequested)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ m.WaitOne(); //当m等于true,才会往下执行,否则一直在此等待
|
|
|
|
|
|
- private void Previous(object obj)
|
|
|
|
|
|
+ //开始时间
|
|
|
|
+ startTime = DateTime.Now;
|
|
|
|
+ //增加测试记录主表
|
|
|
|
+ AddTestRecord();
|
|
|
|
+
|
|
|
|
+ //前置项
|
|
|
|
+ bool preBool = TestPreceditionMethod();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //输入项
|
|
|
|
+ bool isAction = TestActionMethod();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //输出项
|
|
|
|
+ bool isJudgeResult = await TestJudgementMethod();
|
|
|
|
+ //下一项
|
|
|
|
+ StepIndex = 0;
|
|
|
|
+ ///查找方案下的所有方案明细,并排序,
|
|
|
|
+ var basicSchDtls = _basicPlcTestSchemeDtlService.FindAllBySchId(schId)?.OrderBy(x => x.scheme_dtl_id);
|
|
|
|
+ foreach (var item in basicSchDtls)
|
|
|
|
+ {
|
|
|
|
+ //在测试结果明细中查看
|
|
|
|
+ long schDetailId = item.scheme_dtl_id;
|
|
|
|
+ if (schDetailId > globalSchDetailId)
|
|
|
|
+ {
|
|
|
|
+ globalSchDetailId = schDetailId;
|
|
|
|
+ int id = Convert.ToInt32(schDetailId);
|
|
|
|
+ //界面显示
|
|
|
|
+ GetDetailInfo(id);
|
|
|
|
+ //递归调用
|
|
|
|
+ Start();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }, cancellationToken);//绑定令牌到多线程
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 更新测试结果
|
|
|
|
+ /// </summary>
|
|
|
|
+ private void UpdateTestRecord()
|
|
{
|
|
{
|
|
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 开始检测
|
|
|
|
|
|
+ /// 测试前置项目
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="obj"></param>
|
|
|
|
- private void Start(object obj)
|
|
|
|
- {
|
|
|
|
- //开始时间
|
|
|
|
- startTime = DateTime.Now;
|
|
|
|
- //增加测试记录主表
|
|
|
|
- AddTestRecord();
|
|
|
|
- //增加测试记录明细表
|
|
|
|
- AddTesDtltRecord(globalSchDetailId);
|
|
|
|
- //前置项
|
|
|
|
- TestPreceditionMethod();
|
|
|
|
- MessageBox.Show("前置项测试完成!", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
|
- //输入项
|
|
|
|
- TestActionMethod();
|
|
|
|
- MessageBox.Show("输入项测试完成!", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
|
- //输出项
|
|
|
|
- TestJudgementMethod();
|
|
|
|
- MessageBox.Show("输出项测试完成!", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void TestPreceditionMethod()
|
|
|
|
|
|
+ private bool TestPreceditionMethod()
|
|
{
|
|
{
|
|
switch (BeforeSelectJudge)
|
|
switch (BeforeSelectJudge)
|
|
{
|
|
{
|
|
@@ -341,9 +462,17 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
MessageBoxResult boxResult = MessageBox.Show(BeforeDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
MessageBoxResult boxResult = MessageBox.Show(BeforeDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
if (boxResult == MessageBoxResult.OK)
|
|
if (boxResult == MessageBoxResult.OK)
|
|
{
|
|
{
|
|
|
|
+ //前置项测试结果json转化
|
|
|
|
+ string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
StepIndex = 1;
|
|
StepIndex = 1;
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
break;
|
|
case "自动判定":
|
|
case "自动判定":
|
|
@@ -351,59 +480,26 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
switch (SelectLogic)
|
|
switch (SelectLogic)
|
|
{
|
|
{
|
|
case "NULL":
|
|
case "NULL":
|
|
- break;
|
|
|
|
- case "AND":
|
|
|
|
- case "ONLY":
|
|
|
|
- int countCond = 0;
|
|
|
|
- foreach (var item in BeforeConList)
|
|
|
|
- {
|
|
|
|
- string plcAddress = item.PlcAddress;
|
|
|
|
- string plcAddType = item.PlcAddType;
|
|
|
|
- string plcValue = item.PlcValue;
|
|
|
|
-
|
|
|
|
- switch (plcAddType)
|
|
|
|
- {
|
|
|
|
- case "bool":
|
|
|
|
- // string readResult = PLCCom.GetInstance().ReadPlcObject(plcAddress, VarType.Bit);
|
|
|
|
- ///实时值记录
|
|
|
|
- string readResult = "1";
|
|
|
|
- item.RealValue = readResult;
|
|
|
|
- item.TestTime = DateTime.Now;
|
|
|
|
- if (readResult.Trim() == plcValue.Trim())
|
|
|
|
- {
|
|
|
|
- item.TestResult = "合格";
|
|
|
|
- countCond++;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- item.TestResult = "不合格";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- break;
|
|
|
|
- case "word":
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- //测试记录存入数据库
|
|
|
|
- //前置项测试结果json转化
|
|
|
|
- string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
|
- //json字符串
|
|
|
|
- bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
|
|
- //条件满足
|
|
|
|
- if (countCond == BeforeConList.Count)
|
|
|
|
|
|
+ //弹出确认的对话框
|
|
|
|
+ MessageBoxResult boxResultAuto = MessageBox.Show(BeforeDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
|
+ if (boxResultAuto == MessageBoxResult.OK)
|
|
{
|
|
{
|
|
|
|
+ //前置项测试结果json转化
|
|
|
|
+ string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
StepIndex = 1;
|
|
StepIndex = 1;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- bizTestRecordDtlDto.PreconditionResult = "不合格";
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
-
|
|
|
|
break;
|
|
break;
|
|
|
|
+ case "AND":
|
|
|
|
+ case "ONLY":
|
|
case "OR":
|
|
case "OR":
|
|
|
|
+ ReadPredice(SelectLogic);
|
|
break;
|
|
break;
|
|
|
|
|
|
case "ORDER":
|
|
case "ORDER":
|
|
@@ -412,10 +508,86 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
//更新测试记录
|
|
//更新测试记录
|
|
- UpdateTesDtltRecord();
|
|
|
|
|
|
+ AddOrEditTesDtltRecord(globalSchDetailId);
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
- private void TestActionMethod()
|
|
|
|
|
|
+
|
|
|
|
+ private void ReadPredice(string strLogic)
|
|
{
|
|
{
|
|
|
|
+ int countCond = 0;
|
|
|
|
+ foreach (var item in BeforeConList)
|
|
|
|
+ {
|
|
|
|
+ string plcAddress = item.PlcAddress;
|
|
|
|
+ string plcAddType = item.PlcAddType;
|
|
|
|
+ string plcValue = item.PlcValue;
|
|
|
|
+
|
|
|
|
+ switch (plcAddType)
|
|
|
|
+ {
|
|
|
|
+ case "bool":
|
|
|
|
+ string readResult = PLCCom.GetInstance().ReadPlcObject(plcAddress, VarType.Bit);
|
|
|
|
+ ///实时值记录
|
|
|
|
+
|
|
|
|
+ item.RealValue = readResult;
|
|
|
|
+ item.TestTime = DateTime.Now;
|
|
|
|
+ if (readResult.Trim() == plcValue.Trim())
|
|
|
|
+ {
|
|
|
|
+ item.TestResult = "合格";
|
|
|
|
+ countCond++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ item.TestResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "word":
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ //测试记录存入数据库
|
|
|
|
+ //前置项测试结果json转化
|
|
|
|
+ string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
|
|
+ //条件满足
|
|
|
|
+ switch (strLogic)
|
|
|
|
+ {
|
|
|
|
+ case "AND":
|
|
|
|
+ case "ONLY":
|
|
|
|
+ if ((countCond == BeforeConList.Count) && (countCond != 0))
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "OR":
|
|
|
|
+ if ((countCond != 0))
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ StepIndex = 1;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 输入项写入
|
|
|
|
+ /// </summary>
|
|
|
|
+ private bool TestActionMethod()
|
|
|
|
+ {
|
|
|
|
+ bool isActionResult = true;
|
|
switch (SelectInJudge)
|
|
switch (SelectInJudge)
|
|
{
|
|
{
|
|
case "人工判定":
|
|
case "人工判定":
|
|
@@ -423,9 +595,17 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
MessageBoxResult boxResult = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
MessageBoxResult boxResult = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
if (boxResult == MessageBoxResult.OK)
|
|
if (boxResult == MessageBoxResult.OK)
|
|
{
|
|
{
|
|
|
|
+ //前置项测试结果json转化
|
|
|
|
+ string actionJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.ActionFinal = actionJsonStr;
|
|
bizTestRecordDtlDto.ActionResult = "合格";
|
|
bizTestRecordDtlDto.ActionResult = "合格";
|
|
StepIndex = 2;
|
|
StepIndex = 2;
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ isActionResult = false;
|
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
break;
|
|
case "自动判定":
|
|
case "自动判定":
|
|
@@ -433,73 +613,27 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
switch (InSelectLogic)
|
|
switch (InSelectLogic)
|
|
{
|
|
{
|
|
case "NULL":
|
|
case "NULL":
|
|
- break;
|
|
|
|
- case "AND":
|
|
|
|
- case "ONLY":
|
|
|
|
- int countCond = 0;
|
|
|
|
- foreach (var item in InConList)
|
|
|
|
- {
|
|
|
|
- string plcAddress = item.PlcAddress;
|
|
|
|
- string plcAddType = item.PlcAddType;
|
|
|
|
- string plcValue = item.PlcValue;
|
|
|
|
-
|
|
|
|
- switch (plcAddType)
|
|
|
|
- {
|
|
|
|
- case "bool":
|
|
|
|
-
|
|
|
|
- DialogParameters parm = new DialogParameters();
|
|
|
|
- parm.Add("Key", plcAddress);
|
|
|
|
- parm.Add("Key2", plcValue);
|
|
|
|
- //弹出写入对话框
|
|
|
|
- _dialog.ShowDialog("WritePLCView", parm, async callback =>
|
|
|
|
- {
|
|
|
|
- if (callback.Result == ButtonResult.OK)
|
|
|
|
- {
|
|
|
|
- // bool writeResult = PLCCom.GetInstance().WritePlcObject(plcAddress, VarType.Bit, plcValue);
|
|
|
|
- ///实时值记录
|
|
|
|
- bool writeResult = true;
|
|
|
|
- item.TestTime = DateTime.Now;
|
|
|
|
- if (writeResult)
|
|
|
|
- {
|
|
|
|
- ///单个测试项合格
|
|
|
|
- item.TestResult = "合格";
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- item.TestResult = "不合格";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- break;
|
|
|
|
- case "word":
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- //测试记录存入数据库
|
|
|
|
- //前置项测试结果json转化
|
|
|
|
- string actionJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
|
|
|
|
- //json字符串
|
|
|
|
- bizTestRecordDtlDto.ActionFinal = actionJsonStr;
|
|
|
|
- //条件满足
|
|
|
|
- if ((countCond == InConList.Count) && (countCond != 0))
|
|
|
|
|
|
+ //弹出确认的对话框
|
|
|
|
+ MessageBoxResult boxResultAction = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
|
+ if (boxResultAction == MessageBoxResult.OK)
|
|
{
|
|
{
|
|
|
|
+ //前置项测试结果json转化
|
|
|
|
+ string actionJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.ActionFinal = actionJsonStr;
|
|
bizTestRecordDtlDto.ActionResult = "合格";
|
|
bizTestRecordDtlDto.ActionResult = "合格";
|
|
StepIndex = 2;
|
|
StepIndex = 2;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- bizTestRecordDtlDto.ActionResult = "不合格";
|
|
|
|
|
|
+ isActionResult = false;
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
|
|
+ case "AND":
|
|
|
|
+ case "ONLY":
|
|
case "OR":
|
|
case "OR":
|
|
|
|
+ isActionResult = SendActionToPLC(InSelectLogic);
|
|
break;
|
|
break;
|
|
|
|
|
|
case "ORDER":
|
|
case "ORDER":
|
|
@@ -508,10 +642,114 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
//更新测试记录
|
|
//更新测试记录
|
|
- UpdateTesDtltRecord();
|
|
|
|
|
|
+ //更新测试记录
|
|
|
|
+ AddOrEditTesDtltRecord(globalSchDetailId);
|
|
|
|
+ return isActionResult;
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 发送命令给PLC
|
|
|
|
+ /// </summary>
|
|
|
|
+ private bool SendActionToPLC(string strActionLogic)
|
|
|
|
+ {
|
|
|
|
+ bool isAction = true;
|
|
|
|
+ int countCond = 0;
|
|
|
|
+ foreach (var item in InConList)
|
|
|
|
+ {
|
|
|
|
+ string plcAddress = item.PlcAddress;
|
|
|
|
+ string plcAddType = item.PlcAddType;
|
|
|
|
+ string plcValue = item.PlcValue;
|
|
|
|
+
|
|
|
|
+ switch (plcAddType)
|
|
|
|
+ {
|
|
|
|
+ case "bool":
|
|
|
|
+
|
|
|
|
+ bool writeResult = PLCCom.GetInstance().WritePlcObject(plcAddress, VarType.Bit, plcValue);
|
|
|
|
+ ///实时值记录
|
|
|
|
+ item.RealValue = plcValue;
|
|
|
|
+ item.TestTime = DateTime.Now;
|
|
|
|
+ if (writeResult)
|
|
|
|
+ {
|
|
|
|
+ ///单个测试项合格
|
|
|
|
+ item.TestResult = "合格";
|
|
|
|
+ countCond++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ item.TestResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ case "word":
|
|
|
|
+
|
|
|
|
+ bool writeWrordResult = PLCCom.GetInstance().WritePlcObject(plcAddress, VarType.Word, plcValue);
|
|
|
|
+ ///实时值记录
|
|
|
|
+ item.RealValue = plcValue;
|
|
|
|
+ item.TestTime = DateTime.Now;
|
|
|
|
+ if (writeWrordResult)
|
|
|
|
+ {
|
|
|
|
+ ///单个测试项合格
|
|
|
|
+ item.TestResult = "合格";
|
|
|
|
+ countCond++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ item.TestResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (!isAction)
|
|
|
|
+ {
|
|
|
|
+ return isAction;
|
|
|
|
+ }
|
|
|
|
+ //测试记录存入数据库
|
|
|
|
+ //前置项测试结果json转化
|
|
|
|
+ string actionJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.ActionFinal = actionJsonStr;
|
|
|
|
+ //条件满足
|
|
|
|
+
|
|
|
|
+ //条件满足
|
|
|
|
+ switch (strActionLogic)
|
|
|
|
+ {
|
|
|
|
+ case "AND":
|
|
|
|
+ case "ONLY":
|
|
|
|
+ if ((countCond == BeforeConList.Count) && (countCond != 0))
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.ActionResult = "合格";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.ActionResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "OR":
|
|
|
|
+ if ((countCond != 0))
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.ActionResult = "合格";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.ActionResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ StepIndex = 2;
|
|
|
|
+ return isAction;
|
|
}
|
|
}
|
|
- private void TestJudgementMethod()
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 结果项判定
|
|
|
|
+ /// </summary>
|
|
|
|
+ private async Task<bool> TestJudgementMethod()
|
|
{
|
|
{
|
|
|
|
+ bool isJudge = true;
|
|
switch (SelectOutJudge)
|
|
switch (SelectOutJudge)
|
|
{
|
|
{
|
|
case "人工判定":
|
|
case "人工判定":
|
|
@@ -522,6 +760,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
bizTestRecordDtlDto.JudgementResult = "合格";
|
|
bizTestRecordDtlDto.JudgementResult = "合格";
|
|
StepIndex = 3;
|
|
StepIndex = 3;
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ isJudge = false;
|
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
break;
|
|
case "自动判定":
|
|
case "自动判定":
|
|
@@ -529,69 +771,124 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
switch (OutSelectLogic)
|
|
switch (OutSelectLogic)
|
|
{
|
|
{
|
|
case "NULL":
|
|
case "NULL":
|
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
|
+ StepIndex = 3;
|
|
break;
|
|
break;
|
|
case "AND":
|
|
case "AND":
|
|
case "ONLY":
|
|
case "ONLY":
|
|
- int countCond = 0;
|
|
|
|
- foreach (var item in OutConList)
|
|
|
|
- {
|
|
|
|
- string plcAddress = item.PlcAddress;
|
|
|
|
- string plcAddType = item.PlcAddType;
|
|
|
|
- string plcValue = item.PlcValue;
|
|
|
|
-
|
|
|
|
- switch (plcAddType)
|
|
|
|
- {
|
|
|
|
|
|
+ case "OR":
|
|
|
|
+ await ReadJudge(OutSelectLogic);
|
|
|
|
+ break;
|
|
|
|
+ case "ORDER":
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ //更新测试记录
|
|
|
|
+ //更新测试记录
|
|
|
|
+ AddOrEditTesDtltRecord(globalSchDetailId);
|
|
|
|
|
|
- case "bool":
|
|
|
|
- //string readResult = PLCCom.GetInstance().ReadPlcObject(plcAddress, VarType.Bit);
|
|
|
|
- string readResult = "1";
|
|
|
|
- ///实时值记录
|
|
|
|
- item.RealValue = readResult;
|
|
|
|
- item.TestTime = DateTime.Now;
|
|
|
|
- if (readResult.Trim() == plcValue.Trim())
|
|
|
|
- {
|
|
|
|
- item.TestResult = "合格";
|
|
|
|
- countCond++;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- item.TestResult = "不合格";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- break;
|
|
|
|
- case "word":
|
|
|
|
- break;
|
|
|
|
|
|
+ //判定是否为最后一项
|
|
|
|
+ long maxDtlId = _basicPlcTestSchemeDtlService.FindAllBySchId(schId).Select(x => x.scheme_dtl_id).Max();
|
|
|
|
+ if (globalSchDetailId == maxDtlId)
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show("已是此测试方案最后一个测试项!", "确认", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
|
|
+ }
|
|
|
|
+ return isJudge;
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 读取结果
|
|
|
|
+ /// </summary>
|
|
|
|
+ private async Task ReadJudge(String strLogic)
|
|
|
|
+ {
|
|
|
|
+ int countCond = 0;
|
|
|
|
+ foreach (var item in OutConList)
|
|
|
|
+ {
|
|
|
|
+ string plcAddress = item.PlcAddress;
|
|
|
|
+ string plcAddType = item.PlcAddType;
|
|
|
|
+ string plcValue = item.PlcValue;
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ switch (plcAddType)
|
|
|
|
+ {
|
|
|
|
|
|
- }
|
|
|
|
- //测试记录存入数据库
|
|
|
|
- //前置项测试结果json转化
|
|
|
|
- string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
|
- //json字符串
|
|
|
|
- bizTestRecordDtlDto.JudgementResultFinal = prefixJsonStr;
|
|
|
|
- //条件满足
|
|
|
|
- if ((countCond == OutConList.Count) && (countCond != 0))
|
|
|
|
|
|
+ case "bool":
|
|
|
|
+ DateTime entryTime = DateTime.Now;
|
|
|
|
+ string readResult = string.Empty;
|
|
|
|
+ //一直读
|
|
|
|
+ await Task.Run(async () =>
|
|
|
|
+ {
|
|
|
|
+ while (entryTime.AddMilliseconds(10 * 1000) > DateTime.Now)
|
|
{
|
|
{
|
|
- bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
|
- StepIndex = 3;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- bizTestRecordDtlDto.JudgementResult = "不合格";
|
|
|
|
|
|
+ //显示进度条
|
|
|
|
+ System.Windows.Application.Current.Dispatcher.Invoke((delegate
|
|
|
|
+ {
|
|
|
|
+ ProVisibility = Visibility.Visible;
|
|
|
|
+ }));
|
|
|
|
+
|
|
|
|
+ readResult = PLCCom.GetInstance().ReadPlcObject(plcAddress, VarType.Bit);
|
|
|
|
+ if (readResult == item.PlcValue)
|
|
|
|
+ {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ await Task.Delay(1000);
|
|
}
|
|
}
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ ProVisibility = Visibility.Hidden;
|
|
|
|
+ ///实时值记录
|
|
|
|
+ item.RealValue = readResult;
|
|
|
|
+ item.TestTime = DateTime.Now;
|
|
|
|
+ if (readResult.Trim() == plcValue?.Trim())
|
|
|
|
+ {
|
|
|
|
+ item.TestResult = "合格";
|
|
|
|
+ countCond++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ item.TestResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ case "word":
|
|
|
|
+ break;
|
|
|
|
|
|
- break;
|
|
|
|
- case "OR":
|
|
|
|
- break;
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- case "ORDER":
|
|
|
|
- break;
|
|
|
|
|
|
+ }
|
|
|
|
+ //测试记录存入数据库
|
|
|
|
+ //输出项测试结果json转化
|
|
|
|
+ string prefixJsonStr = ModelToJsonToStr(SelectOutJudge, OutSelectLogic, OutDetail, OutConList);
|
|
|
|
+ //json字符串
|
|
|
|
+ bizTestRecordDtlDto.JudgementResultFinal = prefixJsonStr;
|
|
|
|
+ //条件满足
|
|
|
|
+ switch (strLogic)
|
|
|
|
+ {
|
|
|
|
+ case "AND":
|
|
|
|
+ case "ONLY":
|
|
|
|
+ if ((countCond == OutConList.Count) && (countCond != 0))
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "不合格";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case "OR":
|
|
|
|
+ if (countCond != 0)
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "不合格";
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- //更新测试记录
|
|
|
|
- UpdateTesDtltRecord();
|
|
|
|
|
|
+
|
|
|
|
+ StepIndex = 3;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 获取配置
|
|
/// 获取配置
|
|
@@ -685,12 +982,10 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
#region 命令绑定
|
|
#region 命令绑定
|
|
public DelegateCommand CloseCommand { set; get; }
|
|
public DelegateCommand CloseCommand { set; get; }
|
|
|
|
|
|
- public DelegateCommand<object> StartCommand { set; get; }
|
|
|
|
- public DelegateCommand<object> PreviousCommand { set; get; }
|
|
|
|
-
|
|
|
|
- public DelegateCommand<object> NextCommand { set; get; }
|
|
|
|
|
|
+ public DelegateCommand StartCommand { set; get; }
|
|
|
|
+ public DelegateCommand<object> StopOrContinueCommand { set; get; }
|
|
|
|
|
|
- public DelegateCommand<object> DoneCommand { set; get; }
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -877,6 +1172,20 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
get { return stepIndex; }
|
|
get { return stepIndex; }
|
|
set { stepIndex = value; RaisePropertyChanged(); }
|
|
set { stepIndex = value; RaisePropertyChanged(); }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private Visibility proVisibility = Visibility.Hidden;
|
|
|
|
+ public Visibility ProVisibility
|
|
|
|
+ {
|
|
|
|
+ get { return proVisibility; }
|
|
|
|
+ set { proVisibility = value; RaisePropertyChanged(); }
|
|
|
|
+ }
|
|
|
|
+ private string stopOrContinueCont ="暂停";
|
|
|
|
+ public string StopOrContinueCont
|
|
|
|
+ {
|
|
|
|
+ get { return stopOrContinueCont; }
|
|
|
|
+ set { stopOrContinueCont = value; RaisePropertyChanged(); }
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|