时序下发增加功耗计算校验
This commit is contained in:
parent
fd091e4f3f
commit
5663aeff05
@ -71,17 +71,6 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_sequenceGroup = value;
|
_sequenceGroup = value;
|
||||||
|
|
||||||
//SysSequentialdata = _sequentialService.GetSequentialSequenceGroup(SequenceGroup, kind);
|
|
||||||
//if (SysSequentialdata != null)
|
|
||||||
//{
|
|
||||||
// ErrorList.Add("DurationTime", new List<string> { "当前配置存在循环时长:" + SysSequentialdata.DurationTime + "s" });
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// ErrorList.Remove("DurationTime");
|
|
||||||
//}
|
|
||||||
//this.RaiseErrorsChanged("DurationTime");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string? _sensorID;
|
private string? _sensorID;
|
||||||
@ -256,41 +245,34 @@ namespace InSituLaboratory.ViewModels.Pages.Dialogs
|
|||||||
{
|
{
|
||||||
workTime = "0";
|
workTime = "0";
|
||||||
}
|
}
|
||||||
workInt = Convert.ToInt64(workTime) * 60 * 60;
|
workInt = Convert.ToInt64(workTime);
|
||||||
switch (SensorID)
|
switch (SensorID)
|
||||||
{
|
{
|
||||||
case "气相色谱仪":
|
case "气相色谱仪":
|
||||||
if (Convert.ToInt64(WorkTime) > workInt)
|
if (Convert.ToInt64(WorkTime) > workInt)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长超过传感器本身最大工作时长,为:" + workTime + "h/ " + workInt + "s", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长:" + WorkTime + "h"+ ",已超过设备最大工作时长:" + workTime + "h" +"\n 请修改您填写的设备工作时长后重试!!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "质谱仪":
|
case "质谱仪":
|
||||||
if (Convert.ToInt64(WorkTime) > workInt)
|
if (Convert.ToInt64(WorkTime) > workInt)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长超过传感器本身最大工作时长,为:" + workTime + "h/ " + workInt + "s", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长:" + WorkTime + "h"+ ",已超过设备最大工作时长:" + workTime + "h" + "\n 请修改您填写的设备工作时长后重试!!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "二氧化碳同位素分析仪":
|
case "二氧化碳同位素分析仪":
|
||||||
if (Convert.ToInt64(WorkTime) > workInt)
|
if (Convert.ToInt64(WorkTime) > workInt)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长超过传感器本身最大工作时长,为:" + workTime + "h/ " + workInt + "s", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长:" + WorkTime + "h"+ ",已超过设备最大工作时长:" + workTime + "h" + "\n 请修改您填写的设备工作时长后重试!!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "基因测序仪":
|
|
||||||
if (Convert.ToInt64(WorkTime) > workInt)
|
|
||||||
{
|
|
||||||
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长超过传感器本身最大工作时长,为:" + workTime + "h/ " + workInt + "s", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "甲烷同位素分析仪":
|
case "甲烷同位素分析仪":
|
||||||
if (Convert.ToInt64(WorkTime) > workInt)
|
if (Convert.ToInt64(WorkTime) > workInt)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长超过传感器本身最大工作时长,为:" + workTime + "h/ " + workInt + "s", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
System.Windows.Forms.MessageBox.Show(SensorID + "设置的工作时长:" + WorkTime + "h" + ",已超过设备最大工作时长:" + workTime + "h" + "\n 请修改您填写的设备工作时长后重试!!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -115,12 +115,14 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="model"></param>
|
/// <param name="model"></param>
|
||||||
public override void DoModifyS1(object model)
|
public override void DoModifyS1(object model)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var status = "";
|
var status = "";
|
||||||
var datalist1 = _sysSequentialService.Query<SysSequential>(m => m.StartTime == sequentStatusModel.SequentialStartTime1 && m.EndTime == sequentStatusModel.SequentialEndTime1 && m.IsDelete == 0 && m.Sequential == "时序1").ToList();
|
var datalist1 = _sysSequentialService.Query<SysSequential>(m => m.StartTime == sequentStatusModel.SequentialStartTime1 && m.EndTime == sequentStatusModel.SequentialEndTime1 && m.IsDelete == 0 && m.Sequential == "时序1").ToList();
|
||||||
if (sequentStatusModel.SequentialStartTime1 == null || sequentStatusModel.SequentialEndTime1 == null)
|
if (sequentStatusModel.SequentialStartTime1 == null || sequentStatusModel.SequentialEndTime1 == null)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 开始时间和结束时间不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 开始时间和结束时间不能为空!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -138,15 +140,15 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
|
|
||||||
if (expirationDate < dateTime)
|
if (expirationDate < dateTime)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 开始时间不得早于当前时间!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 开始时间不得早于当前时间!");
|
||||||
}
|
}
|
||||||
else if (expirationDate1 < dateTime)
|
else if (expirationDate1 < dateTime)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 结束时间不得早于当前时间!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 结束时间不得早于当前时间!");
|
||||||
}
|
}
|
||||||
else if (expirationDate >= expirationDate1)
|
else if (expirationDate >= expirationDate1)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 结束时间不得早于开始时间!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 结束时间不得早于开始时间!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -167,7 +169,7 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show(" 当前时序已下发!!! \n 若要设置新的时序,您可以修改时序的开始时间和结束时间即可!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("当前时序已下发!!! \n 若要设置新的时序,您可以修改时序的开始时间和结束时间即可!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -178,15 +180,15 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
|
|
||||||
if (expirationDate < dateTime)
|
if (expirationDate < dateTime)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 开始时间不得早于当前时间!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 开始时间不得早于当前时间!");
|
||||||
}
|
}
|
||||||
else if (expirationDate1 < dateTime)
|
else if (expirationDate1 < dateTime)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 结束时间不得早于当前时间!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 结束时间不得早于当前时间!");
|
||||||
}
|
}
|
||||||
else if (expirationDate >= expirationDate1)
|
else if (expirationDate >= expirationDate1)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 结束时间不得早于开始时间!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 结束时间不得早于开始时间!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -208,6 +210,12 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
System.Windows.Forms.MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除
|
/// 删除
|
||||||
@ -267,17 +275,19 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
/// 时序下发
|
/// 时序下发
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void SendS1()
|
public override void SendS1()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var status = "";
|
var status = "";
|
||||||
var datalist1 = _sysSequentialService.Query<SysSequential>(m => m.StartTime == sequentStatusModel.SequentialStartTime1 && m.EndTime == sequentStatusModel.SequentialEndTime1 && m.IsDelete == 0 && m.Sequential == "时序1").ToList();
|
var datalist1 = _sysSequentialService.Query<SysSequential>(m => m.StartTime == sequentStatusModel.SequentialStartTime1 && m.EndTime == sequentStatusModel.SequentialEndTime1 && m.IsDelete == 0 && m.Sequential == "时序1").ToList();
|
||||||
|
|
||||||
if (sequentStatusModel.SequentialStartTime1 == null || sequentStatusModel.SequentialEndTime1 == null)
|
if (sequentStatusModel.SequentialStartTime1 == null || sequentStatusModel.SequentialEndTime1 == null)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1: 开始时间和结束时间不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1: 开始时间和结束时间不能为空!");
|
||||||
}
|
}
|
||||||
else if (datalist1.Count() == 0)
|
else if (datalist1.Count() == 0)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("时序1中未有设备,无法下发!!!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("时序1中未有设备,无法下发!!!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -297,9 +307,6 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
if (s1 == System.Windows.Forms.DialogResult.Yes)
|
if (s1 == System.Windows.Forms.DialogResult.Yes)
|
||||||
{
|
{
|
||||||
//计算设备功耗是否超总功耗及设备运行时长是否超时
|
//计算设备功耗是否超总功耗及设备运行时长是否超时
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<byte> byteaq = encode(startTime, endTime, 0x01, "时序1");
|
List<byte> byteaq = encode(startTime, endTime, 0x01, "时序1");
|
||||||
List<byte> buffer = Escape(byteaq.ToArray());
|
List<byte> buffer = Escape(byteaq.ToArray());
|
||||||
string list = tools.byteToHexStr(buffer.ToArray());
|
string list = tools.byteToHexStr(buffer.ToArray());
|
||||||
@ -314,8 +321,6 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
else if (s1 == System.Windows.Forms.DialogResult.No)
|
else if (s1 == System.Windows.Forms.DialogResult.No)
|
||||||
{
|
{
|
||||||
//计算设备功耗是否超总功耗及设备运行时长是否超时
|
//计算设备功耗是否超总功耗及设备运行时长是否超时
|
||||||
|
|
||||||
|
|
||||||
List<byte> byteaq = encode((DateTime)sequentStatusModel.SequentialStartTime1, (DateTime)sequentStatusModel.SequentialEndTime1, 0x02, "时序1");
|
List<byte> byteaq = encode((DateTime)sequentStatusModel.SequentialStartTime1, (DateTime)sequentStatusModel.SequentialEndTime1, 0x02, "时序1");
|
||||||
List<byte> buffer = Escape(byteaq.ToArray());
|
List<byte> buffer = Escape(byteaq.ToArray());
|
||||||
string list = tools.byteToHexStr(buffer.ToArray());
|
string list = tools.byteToHexStr(buffer.ToArray());
|
||||||
@ -329,16 +334,22 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("当前时序已下发!!!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("当前时序已下发!!!");
|
||||||
}
|
}
|
||||||
this.RefreshS1();
|
this.RefreshS1();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show("请先连接服务端!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
throw new Exception("请先连接服务端!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
System.Windows.Forms.MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 时序清空
|
/// 时序清空
|
||||||
@ -1321,6 +1332,15 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
ulong endmin;
|
ulong endmin;
|
||||||
ulong endsec;
|
ulong endsec;
|
||||||
|
|
||||||
|
//初始化电能板1 负载功耗=0
|
||||||
|
float EnergyBoard1 = 0;
|
||||||
|
//初始化电能板2 负载功耗=0
|
||||||
|
float EnergyBoard2 = 0;
|
||||||
|
//初始化电能板3 负载功耗=0
|
||||||
|
float EnergyBoard3 = 0;
|
||||||
|
//初始化电能板4 负载功耗=0
|
||||||
|
float EnergyBoard4 = 0;
|
||||||
|
|
||||||
//定义消息体数组
|
//定义消息体数组
|
||||||
List<byte> byteaq = new List<byte>();
|
List<byte> byteaq = new List<byte>();
|
||||||
|
|
||||||
@ -1391,7 +1411,12 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
//先遍历 datalist 确定 SequenceGroup的种类和数量
|
//先遍历 datalist 确定 SequenceGroup的种类和数量
|
||||||
for (int i = 0; i < datalist.Length; i++)
|
for (int i = 0; i < datalist.Length; i++)
|
||||||
{
|
{
|
||||||
if (i != 0 && datalist.Length >= 1)
|
//只有一个子时序且子时序中只有一台设备
|
||||||
|
if (datalist.Length == 1)
|
||||||
|
{
|
||||||
|
b.Add(1);
|
||||||
|
}
|
||||||
|
else if (i != 0 && datalist.Length > 1)
|
||||||
{
|
{
|
||||||
if (datalist[i].SequenceGroup != datalist[i - 1].SequenceGroup)
|
if (datalist[i].SequenceGroup != datalist[i - 1].SequenceGroup)
|
||||||
{
|
{
|
||||||
@ -1404,6 +1429,7 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
m = 0;
|
m = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//b = new List<int>() { 4, 3, 4, 6 };
|
//b = new List<int>() { 4, 3, 4, 6 };
|
||||||
//3 3 2 1
|
//3 3 2 1
|
||||||
@ -1428,76 +1454,127 @@ namespace InSituLaboratory.ViewModels.Pages
|
|||||||
{
|
{
|
||||||
case "工控机":
|
case "工控机":
|
||||||
byteaq.Add(0x00);
|
byteaq.Add(0x00);
|
||||||
|
EnergyBoard3 += 12;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "色质联用":
|
case "色质联用":
|
||||||
byteaq.Add(0x01);
|
byteaq.Add(0x01);
|
||||||
|
EnergyBoard2 += 150;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "备用串口1":
|
case "备用串口1":
|
||||||
byteaq.Add(0x02);
|
byteaq.Add(0x02);
|
||||||
|
EnergyBoard1 += 100;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "备用串口2":
|
case "备用串口2":
|
||||||
byteaq.Add(0x03);
|
byteaq.Add(0x03);
|
||||||
|
EnergyBoard1 += 100;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "光通讯机":
|
case "光通讯机":
|
||||||
byteaq.Add(0x04);
|
byteaq.Add(0x04);
|
||||||
|
EnergyBoard1 += 30;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "ADCP":
|
case "ADCP":
|
||||||
byteaq.Add(0x05);
|
byteaq.Add(0x05);
|
||||||
|
EnergyBoard1 += 24;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "CTD":
|
case "CTD":
|
||||||
byteaq.Add(0x06);
|
byteaq.Add(0x06);
|
||||||
|
EnergyBoard1 += 0.2F;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "气相色谱仪":
|
case "气相色谱仪":
|
||||||
byteaq.Add(0x07);
|
byteaq.Add(0x07);
|
||||||
|
EnergyBoard3 += 120;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "甲烷传感器":
|
case "甲烷传感器":
|
||||||
byteaq.Add(0x08);
|
byteaq.Add(0x08);
|
||||||
|
EnergyBoard2 += 80;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "二氧化碳同位素分析仪":
|
case "二氧化碳同位素分析仪":
|
||||||
byteaq.Add(0x09);
|
byteaq.Add(0x09);
|
||||||
|
EnergyBoard3 += 48;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "备用网口设备":
|
case "备用网口设备":
|
||||||
byteaq.Add(0x0a);
|
byteaq.Add(0x0a);
|
||||||
break;
|
break;
|
||||||
case "ICL":
|
case "ICL":
|
||||||
byteaq.Add(0x0b);
|
byteaq.Add(0x0b);
|
||||||
|
EnergyBoard2 += 8;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "显微拉曼分析仪":
|
case "显微拉曼分析仪":
|
||||||
byteaq.Add(0x0c);
|
byteaq.Add(0x0c);
|
||||||
|
EnergyBoard4 += 150;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "质谱仪":
|
case "质谱仪":
|
||||||
byteaq.Add(0x0d);
|
byteaq.Add(0x0d);
|
||||||
|
EnergyBoard4 += 150;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "声学定位":
|
case "声学定位":
|
||||||
byteaq.Add(0x0e);
|
byteaq.Add(0x0e);
|
||||||
|
EnergyBoard4 += 10;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "摄像1":
|
case "摄像1":
|
||||||
byteaq.Add(0x0f);
|
byteaq.Add(0x0f);
|
||||||
|
EnergyBoard2 += 3;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "摄像2":
|
case "摄像2":
|
||||||
byteaq.Add(0x10);
|
byteaq.Add(0x10);
|
||||||
|
EnergyBoard3 += 3;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "电交换机2":
|
case "电交换机2":
|
||||||
byteaq.Add(0x11);
|
byteaq.Add(0x11);
|
||||||
|
EnergyBoard4 += 8.4F;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//定义接收工作时长
|
//定义接收工作时长
|
||||||
int w = Convert.ToInt32(datalist[i == 0 ? j : n + j].WorkTime);
|
int w = Convert.ToInt32(datalist[i == 0 ? j : n + j].WorkTime) * 60 * 60;
|
||||||
byteaq.Add((byte)(w & 0xFF));
|
byteaq.Add((byte)(w & 0xFF));
|
||||||
byteaq.Add((byte)((w & 0xFF00) >> 8));
|
byteaq.Add((byte)((w & 0xFF00) >> 8));
|
||||||
byteaq.Add((byte)((w & 0xFF0000) >> 16));
|
byteaq.Add((byte)((w & 0xFF0000) >> 16));
|
||||||
byteaq.Add((byte)((w >> 24) & 0xFF));
|
byteaq.Add((byte)((w >> 24) & 0xFF));
|
||||||
|
|
||||||
//接收循环间隔时长
|
//接收循环间隔时长
|
||||||
d = Convert.ToInt32(datalist[i == 0 ? j : n + j].DurationTime);
|
d = Convert.ToInt32(datalist[i == 0 ? j : n + j].DurationTime) * 60 * 60;
|
||||||
}
|
}
|
||||||
byteaq.Add((byte)(d & 0xFF));
|
byteaq.Add((byte)(d & 0xFF));
|
||||||
byteaq.Add((byte)((d & 0xFF00) >> 8));
|
byteaq.Add((byte)((d & 0xFF00) >> 8));
|
||||||
byteaq.Add((byte)((d & 0xFF0000) >> 16));
|
byteaq.Add((byte)((d & 0xFF0000) >> 16));
|
||||||
byteaq.Add((byte)((d >> 24) & 0xFF));
|
byteaq.Add((byte)((d >> 24) & 0xFF));
|
||||||
|
|
||||||
|
if (EnergyBoard1 > 250)
|
||||||
|
{
|
||||||
|
throw new Exception("当前所下发的时序中电能板1总功耗:" + EnergyBoard1 + "W" + " ,已超过电能板1额定功率250W \n 时序无法下发,请修改设备后重试!!!");
|
||||||
|
}
|
||||||
|
if (EnergyBoard2 > 250)
|
||||||
|
{
|
||||||
|
throw new Exception("当前所下发的时序中电能板2总功耗:" + EnergyBoard2 + "W" + " ,已超过电能板2额定功率250W \n 时序无法下发,请修改设备后重试!!!");
|
||||||
|
}
|
||||||
|
if (EnergyBoard3 > 250)
|
||||||
|
{
|
||||||
|
throw new Exception("当前所下发的时序中电能板3总功耗:" + EnergyBoard3 + "W" + " ,已超过电能板3额定功率250W \n 时序无法下发,请修改设备后重试!!!");
|
||||||
|
}
|
||||||
|
if (EnergyBoard4 > 250)
|
||||||
|
{
|
||||||
|
throw new Exception("当前所下发的时序中电能板4总功耗:" + EnergyBoard4 + "W" + " ,已超过电能板4额定功率250W \n 时序无法下发,请修改设备后重试!!!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return byteaq;
|
return byteaq;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,8 +30,8 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="子时序号" Grid.Row="0" VerticalAlignment="Center" Foreground="#888" />
|
<TextBlock Text="子时序号" Grid.Row="0" VerticalAlignment="Center" Foreground="#888" />
|
||||||
<TextBlock Text="设备编号" Grid.Row="1" VerticalAlignment="Center" Foreground="#888"/>
|
<TextBlock Text="设备编号" Grid.Row="1" VerticalAlignment="Center" Foreground="#888"/>
|
||||||
<TextBlock Text="设备工作时间(s)" Grid.Row="2" VerticalAlignment="Center" Foreground="#888"/>
|
<TextBlock Text="设备工作时长(h)" Grid.Row="2" VerticalAlignment="Center" Foreground="#888"/>
|
||||||
<TextBlock Text="循环间隔时长(s)" Grid.Row="3" VerticalAlignment="Center" Foreground="#888"/>
|
<TextBlock Text="循环间隔时长(h)" Grid.Row="3" VerticalAlignment="Center" Foreground="#888"/>
|
||||||
|
|
||||||
<hc:ComboBox Grid.Row="0" Name="pb" Margin="0,9,0,8" Grid.Column="1" IsEditable="False" ItemsSource="{Binding DeviceNodes}" DisplayMemberPath="Id" SelectedValuePath="Id" SelectedValue="{Binding SequenceGroup}" RenderTransformOrigin="0.498,0.193"/>
|
<hc:ComboBox Grid.Row="0" Name="pb" Margin="0,9,0,8" Grid.Column="1" IsEditable="False" ItemsSource="{Binding DeviceNodes}" DisplayMemberPath="Id" SelectedValuePath="Id" SelectedValue="{Binding SequenceGroup}" RenderTransformOrigin="0.498,0.193"/>
|
||||||
<hc:ComboBox Grid.Row="1" Margin="0,9,0,8" Grid.Column="1" IsEditable="False" ItemsSource="{Binding DeviceNodes}" DisplayMemberPath="DeviceName" SelectedValuePath="DeviceName" SelectedValue="{Binding SensorID}" RenderTransformOrigin="0.498,0.193"/>
|
<hc:ComboBox Grid.Row="1" Margin="0,9,0,8" Grid.Column="1" IsEditable="False" ItemsSource="{Binding DeviceNodes}" DisplayMemberPath="DeviceName" SelectedValuePath="DeviceName" SelectedValue="{Binding SensorID}" RenderTransformOrigin="0.498,0.193"/>
|
||||||
|
|||||||
@ -185,8 +185,8 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备工作时间(s)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备工作时长(h)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="子序列循环间隔时长(s)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子序列循环间隔时长(h)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@ -306,8 +306,8 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备工作时间(s)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备工作时长(h)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="子序列循环间隔时长(s)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子序列循环间隔时长(h)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@ -426,8 +426,8 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备工作时间(s)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备工作时长(h)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="子序列循环间隔时长(s)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子序列循环间隔时长(h)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@ -546,8 +546,8 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备工作时间(s)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备工作时长(h)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="子序列循环间隔时长(s)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子序列循环间隔时长(h)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@ -666,8 +666,8 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子时序号" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备编号(以下设备同一配置依次运行)" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="设备工作时间(s)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="设备工作时长(h)" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="子序列循环间隔时长(s)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="子序列循环间隔时长(h)" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="操作" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user