diff --git a/InSituLaboratory.Service/SysSequentialService.cs b/InSituLaboratory.Service/SysSequentialService.cs
index 07e7767..2d1a16b 100644
--- a/InSituLaboratory.Service/SysSequentialService.cs
+++ b/InSituLaboratory.Service/SysSequentialService.cs
@@ -77,7 +77,7 @@ namespace InSituLaboratory.Service
///
public IEnumerable GetSysSequentialTotal(string key, int pageSize, int pageIndex, out int totalCount)
{
- var pResult = this.QueryPage(m => string.IsNullOrEmpty(key) || m.Sequential.Contains(key) || m.SequenceGroup.Contains(key) || m.SensorID.Contains(key), pageSize, pageIndex, order => order.CreateTime.ToString(), false);
+ var pResult = this.QueryPage(m => string.IsNullOrEmpty(key) || m.Sequential.Contains(key) || m.SequenceGroup.Contains(key) || m.SensorID.Contains(key), pageSize, pageIndex, order => order.SequenceGroup, false);
totalCount = pResult.TotalCount;
diff --git a/InSituLaboratory/ViewModels/Pages/Dialogs/ModifySequentialViewModel.cs b/InSituLaboratory/ViewModels/Pages/Dialogs/ModifySequentialViewModel.cs
index 670dbdf..312a0e1 100644
--- a/InSituLaboratory/ViewModels/Pages/Dialogs/ModifySequentialViewModel.cs
+++ b/InSituLaboratory/ViewModels/Pages/Dialogs/ModifySequentialViewModel.cs
@@ -304,6 +304,8 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
}
+ private string totalKind;
+
#endregion
ISysSequentialService _sequentialService;
@@ -324,6 +326,7 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
kind = parameters.GetValue("kind");
+
if (SequentialDetail == null)
{
this.Title = "新增时序配置";
diff --git a/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs b/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs
index c4e6d6b..0826606 100644
--- a/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs
+++ b/InSituLaboratory/ViewModels/Pages/History/SequentialHistoryViewModel.cs
@@ -60,7 +60,7 @@ namespace InSituLaboratory.ViewModels.Pages.History
DurationTime = item.DurationTime,
CreateTime = item.CreateTime,
Sequential = item.Sequential,
- DeleteType = item.IsDelete == 0 ? "未删除" : "已删除",
+ Status = item.Status,
});
}
diff --git a/InSituLaboratory/ViewModels/Pages/RelayViewModel.cs b/InSituLaboratory/ViewModels/Pages/RelayViewModel.cs
index 8f02bf0..a0a4bfc 100644
--- a/InSituLaboratory/ViewModels/Pages/RelayViewModel.cs
+++ b/InSituLaboratory/ViewModels/Pages/RelayViewModel.cs
@@ -1011,19 +1011,17 @@ namespace InSituLaboratory.ViewModels.Pages
ulong hour;
ulong min;
ulong sec;
- ulong minsec;
//定义消息体数组
byte[] byteaq = new byte[16];
DateTime dateTime = DateTime.Now;
- year = (ulong)dateTime.Year * 10000000000000UL;
- month = (ulong)dateTime.Month * 100000000000UL;
- day = (ulong)dateTime.Day * 1000000000UL;
- hour = (ulong)dateTime.Hour * 10000000UL;
- min = (ulong)dateTime.Minute * 100000UL;
- sec = (ulong)dateTime.Second * 1000UL;
- minsec = (ulong)dateTime.Millisecond;
- senddate = year + month + day + hour + min + sec + minsec;
+ year = (ulong)dateTime.Year * 10000000000UL;
+ month = (ulong)dateTime.Month * 100000000UL;
+ day = (ulong)dateTime.Day * 1000000UL;
+ hour = (ulong)dateTime.Hour * 10000UL;
+ min = (ulong)dateTime.Minute * 100UL;
+ sec = (ulong)dateTime.Second;
+ senddate = year + month + day + hour + min + sec;
byteaq[0] = 0x90;
byteaq[1] = 0x02;
diff --git a/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs b/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
index b3292fa..dd28b9a 100644
--- a/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
+++ b/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
@@ -196,6 +196,117 @@ namespace InSituLaboratory.ViewModels.Pages
}
}
+
+ ///
+ /// 时序下发
+ ///
+ public override void SendS1()
+ {
+ if (sequentStatusModel.SequentialStartTime1 == null || sequentStatusModel.SequentialEndTime1 == null)
+ {
+ System.Windows.Forms.MessageBox.Show("时序1: 开始时间和结束时间不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
+ else
+ {
+ DateTime startTime = (DateTime)sequentStatusModel.SequentialStartTime1;
+ DateTime endTime = (DateTime)sequentStatusModel.SequentialEndTime1;
+
+ ulong senddate;
+ ulong year;
+ ulong month;
+ ulong day;
+ ulong hour;
+ ulong min;
+ ulong sec;
+
+ ulong sendenddate;
+ ulong endyear;
+ ulong endmonth;
+ ulong endday;
+ ulong endhour;
+ ulong endmin;
+ ulong endsec;
+
+ //定义消息体数组
+ byte[] byteaq = new byte[26];
+
+ year = (ulong)startTime.Year * 10000000000UL;
+ month = (ulong)startTime.Month * 100000000UL;
+ day = (ulong)startTime.Day * 1000000UL;
+ hour = (ulong)startTime.Hour * 10000UL;
+ min = (ulong)startTime.Minute * 100UL;
+ sec = (ulong)startTime.Second;
+ senddate = year + month + day + hour + min + sec;
+
+ endyear = (ulong)endTime.Year * 10000000000UL;
+ endmonth = (ulong)endTime.Month * 100000000UL;
+ endday = (ulong)endTime.Day * 1000000UL;
+ endhour = (ulong)endTime.Hour * 10000UL;
+ endmin = (ulong)endTime.Minute * 100UL;
+ endsec = (ulong)endTime.Second;
+ sendenddate = endyear + endmonth + endday + endhour + endmin + endsec;
+
+ //消息头
+ byteaq[0] = 0x91;
+ byteaq[1] = 0x00;
+ byteaq[2] = 0x10;
+ byteaq[3] = 0x01;
+ byteaq[4] = 0x00;
+ byteaq[5] = 0x00;
+ byteaq[6] = 0x00;
+ byteaq[7] = 0x00;
+
+ //时序组号
+ byteaq[8] = 0x01;
+
+ //操作类型
+ byteaq[9] = 0x01;
+
+ //开始时间
+ byteaq[10] = (byte)((senddate >> 56) & 0xff);
+ byteaq[11] = (byte)((senddate >> 48) & 0xff);
+ byteaq[12] = (byte)((senddate >> 40) & 0xff);
+ byteaq[13] = (byte)((senddate >> 32) & 0xff);
+ byteaq[14] = (byte)((senddate >> 24) & 0xff);
+ byteaq[15] = (byte)((senddate >> 16) & 0xff);
+ byteaq[16] = (byte)((senddate >> 8) & 0xff);
+ byteaq[17] = (byte)(senddate & 0xff);
+
+ //结束时间
+ byteaq[18] = (byte)((sendenddate >> 56) & 0xff);
+ byteaq[19] = (byte)((sendenddate >> 48) & 0xff);
+ byteaq[20] = (byte)((sendenddate >> 40) & 0xff);
+ byteaq[21] = (byte)((sendenddate >> 32) & 0xff);
+ byteaq[22] = (byte)((sendenddate >> 24) & 0xff);
+ byteaq[23] = (byte)((sendenddate >> 16) & 0xff);
+ byteaq[24] = (byte)((sendenddate >> 8) & 0xff);
+ byteaq[25] = (byte)(sendenddate & 0xff);
+
+ var datalist = _sysSequentialService.Query(m => m.StartTime == startTime && m.EndTime == endTime && m.IsDelete == 0 && m.Sequential == "时序1").OrderBy(n => n.SequenceGroup).ThenBy(s => s.CreateTime).ToArray();
+
+ //定义传感器个数
+ int num = 0;
+ for (int i = 0; i < datalist.Length; i++)
+ {
+
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+
+ }
+
+ }
+
#endregion
#region 时序 2
@@ -677,5 +788,69 @@ namespace InSituLaboratory.ViewModels.Pages
}
#endregion
+
+
+ ///
+ /// 转义封装
+ ///
+ ///
+ ///
+ public List Escape(byte[] bytes)
+ {
+ //标志位
+ byte head = 0x7f;
+ //crc
+ byte nr_crc = 0;
+ nr_crc = tools.CRC(bytes.ToArray(), 0, bytes.Length);
+
+ ///转义
+ int j = 0;
+ List tBuffer = bytes.ToList();
+ tBuffer.Add(nr_crc);
+ int length = tBuffer.ToArray().Length;
+ byte[] newAnswer = tBuffer.ToArray();
+ for (int i = 0; i < length; i++)
+ {
+ if (newAnswer[i] == 0x7e || newAnswer[i] == 0x7f)
+ {
+ j++;
+ }
+ }
+ byte[] newSendBuffer = new byte[length + j];
+ for (int i = 0; i < length; i++)
+ {
+ newSendBuffer[i] = newAnswer[i];
+ }
+ for (int i = 0; i < length + j; i++)
+ {
+ if (newSendBuffer[i] == 0x7e)
+ {
+ for (int k = length + j - 1; k > i + 1; k--)
+ {
+ newSendBuffer[k] = newSendBuffer[k - 1];
+ }
+ newSendBuffer[i + 1] = 0x01;
+ }
+ if (newSendBuffer[i] == 0x7f)
+ {
+ newSendBuffer[i] = 0x7e;
+ for (int k = length + j - 1; k > i + 1; k--)
+ {
+ newSendBuffer[k] = newSendBuffer[k - 1];
+ }
+ newSendBuffer[i + 1] = 0x02;
+ }
+ }
+
+ List buffer = new List();
+ buffer.Add(head);
+ for (int i = 0; i < newSendBuffer.Length; i++)
+ {
+ buffer.Add(newSendBuffer[i]);
+ }
+ buffer.Add(head);
+
+ return buffer;
+ }
}
}
diff --git a/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs b/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs
index b84fa74..fd0f39c 100644
--- a/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs
+++ b/InSituLaboratory/ViewModels/Pages/ViewModelBase.cs
@@ -65,33 +65,43 @@ namespace InSituLaboratory.ViewModels.Pages
public DelegateCommand SynchronizationCommand { get; set; }//时间同步
- #region 时序1-5 刷新 新增/编辑 删除 下发
+ #region 时序1-5 刷新 新增/编辑 删除 下发 启动 暂停
public DelegateCommand RefreshS1Command { get; set; }
public DelegateCommand SendS1Command { get; set; }
public DelegateCommand