Commit 4fa9a9cb authored by wangjunqiang's avatar wangjunqiang

添加自动校准进度反馈地址

parent 9de2ecab
...@@ -100,7 +100,8 @@ namespace GcDevicePc.Common ...@@ -100,7 +100,8 @@ namespace GcDevicePc.Common
{ {
ushort[] s = new ushort[2]; ushort[] s = new ushort[2];
float[] f = new float[2]; float[] f = new float[2];
if (address >= 17 && address <= 22)
if (address >= 17 && address <= 22) //信号输出
{ {
if (address == 17 || address == 18) if (address == 17 || address == 18)
f[0] = float.Parse(globaldata.m_dpbuffer.ShowList.showDet.fDetValue.ToString("0.000")); f[0] = float.Parse(globaldata.m_dpbuffer.ShowList.showDet.fDetValue.ToString("0.000"));
...@@ -112,7 +113,7 @@ namespace GcDevicePc.Common ...@@ -112,7 +113,7 @@ namespace GcDevicePc.Common
Buffer.BlockCopy(f, 0, s, 2, 2); Buffer.BlockCopy(f, 0, s, 2, 2);
value = s[(address - signalddress) % 2]; value = s[(address - signalddress) % 2];
} }
else if (address >= 23 && listnum > 0) else if (address >= 23 && listnum > 0) //组分输出
{ {
int readnum = (address - baseaddress) / 2; int readnum = (address - baseaddress) / 2;
if (readnum <= listnum - 1) if (readnum <= listnum - 1)
...@@ -134,14 +135,52 @@ namespace GcDevicePc.Common ...@@ -134,14 +135,52 @@ namespace GcDevicePc.Common
} }
} }
if (address >= 2 && address < 20) //分析仪状态
if (address >= 0 && address < 20)
{ {
switch (address) switch (address)
{ {
case 2: case 0: //进度数目
{
if ((ushort)SharedSpace.Data.typesint == 2 || (ushort)SharedSpace.Data.typesint == 3)
{
value = globaldata.m_hmibuffer.gcinfo.batno;
}
else
{
value = 0;
}
}
break;
case 1: //进度
{
if ((ushort) SharedSpace.Data.typesint == 2 || (ushort) SharedSpace.Data.typesint == 3)
{
value = (ushort)(SharedSpace.MControl.dateend/SharedSpace.MControl.zhouqi);
}
else
{ {
value = (ushort)SharedSpace.Data.typesint; value = 0;
} }
}
break;
case 2: // 0-正在采样(默认) 1-手动 2-定时 3-校准成功 4-校准失败 5-校准成功(正在采样) 6-校准失败(正在采样)
{
if (!SharedSpace.MControl.SetOut && !SharedSpace.MControl.SetRun)
{
if ((ushort) SharedSpace.Data.typesint == 3)
value = 5;
else if ((ushort) SharedSpace.Data.typesint == 4)
value = 6;
else
value = (ushort) SharedSpace.Data.typesint;
}
else
{
value = (ushort) SharedSpace.Data.typesint;
}
}
break; break;
case 3: case 3:
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment