This commit is contained in:
wxt
2026-01-06 17:30:28 +08:00
parent 79efc9d94a
commit 8dd02885a0
5 changed files with 310 additions and 84 deletions

View File

@@ -358,7 +358,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
else if (value2 != null && value2.Length > 0 && value2[0])
{
classify = "I3x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 192, 2);
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 190, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 308, 4);
if (yhlocation != null && yhlocation.Length >= 3)
@@ -381,25 +381,51 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
}
else if (value3 != null && value3.Length > 0 && value3[0])
{
classify = "I2x";
classify = "I2x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 190, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 304, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
//costtime = time[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 90, 2);
costtime = time[0];//总测试时长
}
else if (value4 != null && value4.Length > 0 && value4[0])
{
classify = "I1x";
yh = 0;
classify = "I1x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 190, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
yy = 0;
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 314, 2);
if (yhlocation != null && yhlocation.Length >= 1)
{
yy = yhlocation[0];
//costtime = time[0];
{
yh = c.UshortToFloat(yhlocation[1], yhlocation[0]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 90, 2);
costtime = time[0];//总测试时长
}
}
@@ -410,52 +436,102 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
bool[] value6 = await ReadModbusCoilAsync(121, 1);
bool[] value7 = await ReadModbusCoilAsync(131, 1);
bool[] value8 = await ReadModbusCoilAsync(141, 1);
ushort[] time2 = _modbusMaster?.ReadHoldingRegisters(1, 92, 2);
if (value5 != null && value5.Length > 0 && value5[0])
{
classify = "I4x";
classify = "I4x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 192, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 300, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time2[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 92, 2);
costtime = time[0];//总测试时长
}
else if (value6 != null && value6.Length > 0 && value6[0])
{
classify = "I3x";
classify = "I3x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 192, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 308, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time2[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 92, 2);
costtime = time[0];//总测试时长
}
else if (value7 != null && value7.Length > 0 && value7[0])
{
classify = "I2x";
classify = "I2x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 192, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 304, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time2[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 92, 2);
costtime = time[0];//总测试时长
}
else if (value8 != null && value8.Length > 0 && value8[0])
{
classify = "I1x";
yh = 0;
classify = "I1x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 192, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
yy = 0;
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 314, 2);
if (yhlocation != null && yhlocation.Length >= 1)
{
yy = yhlocation[0];
costtime = time2[0];
yh = c.UshortToFloat(yhlocation[1], yhlocation[0]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 92, 2);
costtime = time[0];//总测试时长
}
}
@@ -466,52 +542,102 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
bool[] value10 = await ReadModbusCoilAsync(122, 1);
bool[] value11 = await ReadModbusCoilAsync(132, 1);
bool[] value12 = await ReadModbusCoilAsync(142, 1);
ushort[] time3 = _modbusMaster?.ReadHoldingRegisters(1, 96, 2);
if (value9 != null && value9.Length > 0 && value9[0])
{
classify = "I4x";
classify = "I4x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 194, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 300, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time3[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 94, 2);
costtime = time[0];//总测试时长
}
else if (value10 != null && value10.Length > 0 && value10[0])
{
classify = "I3x";
classify = "I3x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 194, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 308, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time3[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 94, 2);
costtime = time[0];//总测试时长
}
else if (value11 != null && value11.Length > 0 && value11[0])
{
classify = "I2x";
classify = "I2x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 194, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 304, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time3[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 94, 2);
costtime = time[0];//总测试时长
}
else if (value12 != null && value12.Length > 0 && value12[0])
{
classify = "I1x";
yh = 0;
classify = "I1x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 194, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
yy = 0;
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 314, 2);
if (yhlocation != null && yhlocation.Length >= 1)
{
yy = yhlocation[0];
costtime = time3[0];
yh = c.UshortToFloat(yhlocation[1], yhlocation[0]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 94, 2);
costtime = time[0];//总测试时长
}
}
if (uiLabel10.Text != null && uiLabel10.Text.Trim() == "4")
@@ -520,52 +646,102 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
bool[] value14 = await ReadModbusCoilAsync(123, 1);
bool[] value15 = await ReadModbusCoilAsync(133, 1);
bool[] value16 = await ReadModbusCoilAsync(143, 1);
ushort[] time4 = _modbusMaster?.ReadHoldingRegisters(1, 96, 2);
if (value13 != null && value13.Length > 0 && value13[0])
{
classify = "I4x";
classify = "I4x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 196, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 300, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time4[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 96, 2);
costtime = time[0];//总测试时长
}
else if (value14 != null && value14.Length > 0 && value14[0])
{
classify = "I3x";
classify = "I4x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 196, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 308, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time4[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 96, 2);
costtime = time[0];//总测试时长
}
else if (value15 != null && value15.Length > 0 && value15[0])
{
classify = "I2x";
classify = "I2x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 196, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 304, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time4[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 96, 2);
costtime = time[0];//总测试时长
}
else if (value16 != null && value16.Length > 0 && value16[0])
{
classify = "I1x";
yh = 0;
classify = "I1x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 196, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
yy = 0;
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 314, 2);
if (yhlocation != null && yhlocation.Length >= 1)
{
yy = yhlocation[0];
costtime = time4[0];
yh = c.UshortToFloat(yhlocation[1], yhlocation[0]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 96, 2);
costtime = time[0];//总测试时长
}
}
@@ -575,52 +751,102 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
bool[] value18 = await ReadModbusCoilAsync(124, 1);
bool[] value19 = await ReadModbusCoilAsync(134, 1);
bool[] value20 = await ReadModbusCoilAsync(144, 1);
ushort[] time5 = _modbusMaster?.ReadHoldingRegisters(1, 98, 2);
if (value17 != null && value17.Length > 0 && value17[0])
{
classify = "I4x";
classify = "I4x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 198, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 300, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time5[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 98, 2);
costtime = time[0];//总测试时长
}
else if (value18 != null && value18.Length > 0 && value18[0])
{
classify = "I3x";
classify = "I3x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 198, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 308, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time5[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 98, 2);
costtime = time[0];//总测试时长
}
else if (value19 != null && value19.Length > 0 && value19[0])
{
classify = "I2x";
classify = "I2x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 198, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 304, 4);
if (yhlocation != null && yhlocation.Length >= 3)
{
yh = yhlocation[0];
yy = yhlocation[2];
costtime = time5[0];
yy = c.UshortToFloat(yhlocation[1], yhlocation[0]); //余焰
yh = c.UshortToFloat(yhlocation[3], yhlocation[2]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 98, 2);
costtime = time[0];//总测试时长
}
else if (value20 != null && value20.Length > 0 && value20[0])
{
classify = "I1x";
yh = 0;
classify = "I1x";//分类
ushort[] fire = _modbusMaster?.ReadHoldingRegisters(1, 198, 2);
firetime = c.UshortToFloat(fire[1], fire[0]);//点火时间
yy = 0;
ushort[] yhlocation = _modbusMaster?.ReadHoldingRegisters(1, 314, 2);
if (yhlocation != null && yhlocation.Length >= 1)
{
yy = yhlocation[0];
costtime = time5[0];
yh = c.UshortToFloat(yhlocation[1], yhlocation[0]);//余辉
}
bool[] fire1 = await ReadModbusCoilAsync(280, 1);
bool[] fire2 = await ReadModbusCoilAsync(281, 1);
if (fire1 != null && fire1.Length > 0 && fire1[0])
{
iszixi = true;//自熄
}
else if (fire2 != null && fire2.Length > 0 && fire2[0])
{
iszixi = false;
}
ushort[] time = _modbusMaster?.ReadHoldingRegisters(1, 98, 2);
costtime = time[0];//总测试时长
}
}
@@ -631,7 +857,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
reportList.Add(new PrimaryIgnitionModel
{
costTime = costtime,
//FireDate = DateTime.Now,
FireDate = firetime,
Iszixi = false,
O2 = selectedO2Text,
result = classify,
@@ -894,7 +1120,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
ma?.BtnClickFunctionForNew(Function.ButtonType., 54, 1);//清除
}
private void SwitchToForm<T>() where T : Form, new()
private void SwitchToForm(Func<Form> formCreator)
{
using (Form form = formCreator())
{