diff --git a/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs b/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
index 440e5e0..5ba4bd7 100644
--- a/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
+++ b/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
@@ -1,11 +1,14 @@
-using InSituLaboratory.Common;
+using Azure;
+using InSituLaboratory.Common;
using InSituLaboratory.Entities;
using InSituLaboratory.Entities.SqlSugar;
using InSituLaboratory.IService;
using InSituLaboratory.IService.Sensor;
using InSituLaboratory.Models;
using InSituLaboratory.Service;
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Query.Internal;
+using Prism.Commands;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
@@ -33,6 +36,7 @@ namespace InSituLaboratory.ViewModels.Pages
public CurrentSequentiualModel CurrentSequentiual { get; set; } = new CurrentSequentiualModel(); //当前运行时序状态表
public SequentStatusModel sequentStatusModel { get; set; } = new SequentStatusModel();
+
System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$");
#endregion
@@ -1530,6 +1534,40 @@ namespace InSituLaboratory.ViewModels.Pages
}
#endregion
+ ///
+ /// 请求当前时序
+ ///
+ ///
+ public override void DoSync(object o)
+ {
+ string[] msg = o.ToString().Split(',');
+ switch (msg[0])
+ {
+ //时序1
+ case "sequent1":
+ DoSyncSend(0x01);
+ break;
+ //时序2
+ case "sequent2":
+ DoSyncSend(0x02);
+ break;
+ //时序3
+ case "sequent3":
+ DoSyncSend(0x03);
+ break;
+ //时序4
+ case "sequent4":
+ DoSyncSend(0x04);
+ break;
+ //时序5
+ case "sequent5":
+ DoSyncSend(0x05);
+ break;
+ default:
+ break;
+ }
+ System.Windows.Forms.MessageBox.Show("已请求当前时序同步!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
///
/// 转义封装
@@ -1596,7 +1634,7 @@ namespace InSituLaboratory.ViewModels.Pages
///
- /// 命令发送
+ /// 命令发送 ---时序清空
///
/// 时序号
/// 操作类型
@@ -1612,6 +1650,22 @@ namespace InSituLaboratory.ViewModels.Pages
}
+ ///
+ /// 请求当前时序下发
+ ///
+ /// 时序组号
+ public void DoSyncSend(byte x1)
+ {
+ //消息体
+ byte[] byteaq = new byte[] { 0x92, 0x02, 0x10, 0x01, 0x00, 0x00, 0x00, 0x01, x1 };
+ List buffer = Escape(byteaq);
+ string list = tools.byteToHexStr(buffer.ToArray());
+ byte[] bytea = tools.ConvertHexStringToBytes(list);
+ RelayViewModel.clientModel.SendData(bytea);
+
+ }
+
+
///
/// 时序下发封装数据域
///
@@ -1661,7 +1715,7 @@ namespace InSituLaboratory.ViewModels.Pages
System.TimeSpan t3 = endTime - startTime;
float getMinute = (float)t3.TotalMinutes;
-
+
year = (ulong)startTime.Year * 10000000000UL;
month = (ulong)startTime.Month * 100000000UL;
@@ -1753,7 +1807,7 @@ namespace InSituLaboratory.ViewModels.Pages
}
if (totalTime > getMinute)
{
- throw new Exception("当前所下发的时序中,所有设备工作总时长:"+ totalTime + "分钟,已经超过时序规定时长:"+ getMinute + "分钟!" + "\n请修改设备后重试!!!");
+ throw new Exception("当前所下发的时序中,所有设备工作总时长:" + totalTime + "分钟,已经超过时序规定时长:" + getMinute + "分钟!" + "\n请修改设备后重试!!!");
}
//b = new List() { 4, 3, 4, 6 };
diff --git a/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs b/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs
index d79074b..b4052b4 100644
--- a/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs
+++ b/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs
@@ -1,4 +1,5 @@
-using Prism.Commands;
+using Microsoft.Identity.Client.NativeInterop;
+using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System;
@@ -64,9 +65,11 @@ namespace InSituLaboratory.ViewModels.Pages
public DelegateCommand StartCommand { get; set; }//一键启动
public DelegateCommand SynchronizationCommand { get; set; }//时间同步
-
+ public DelegateCommand