型号:BC-5120
This commit is contained in:
parent
733a00ca82
commit
7d22089afb
@ -63,9 +63,12 @@
|
||||
|
||||
<!--BS-330E-->
|
||||
<add key="BS-330E" value="PC-202106061449,BS-330E,121,127.0.0.1,5600,GB18030" />
|
||||
|
||||
<!-- BC-5120 -->
|
||||
<add key="BC-5120" value="PC-202106061449,BC-5120,121,127.0.0.1,5600,GB18030" />
|
||||
|
||||
<add key="MA-4210" value="wstwsy-PC,MA-4210,90,COM1,9600,NONE,8,1" />
|
||||
<add key="CurrentDevice" value="BS-330E" />
|
||||
<add key="CurrentDevice" value="BC-5120" />
|
||||
|
||||
</appSettings>
|
||||
</configuration>
|
||||
|
@ -2174,6 +2174,52 @@ namespace FlyDockTool
|
||||
else
|
||||
dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
|
||||
|
||||
}
|
||||
if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
|
||||
{
|
||||
string MachineCode = apiOptions.MachineCode;
|
||||
string MachineID = apiOptions.MachineID;
|
||||
deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
|
||||
//string[] resulteArray = deviceDataStr.Split('\n');
|
||||
string sampleNo1 = string.Empty;//样本号
|
||||
|
||||
List<examResultMode> ermList = new List<examResultMode>();
|
||||
string[] itemArray = new string[] { "WBC", "BAS#", "BAS%", "NEU#", "NEU%", "EOS#", "EOS%", "LYM#", "LYM%", "MON#", "MON%", "RBC", "HGB", "MCV", "MCH", "MCHC", "RDW-CV", "RDW-SD", "HCT", "PLT", "MPV", "PDW", "PCT", "PLCC", "PLCR" };
|
||||
string[] itemArray_2 = new string[] { "PCT", "PLCC", "PLCR" };
|
||||
|
||||
for (int i = 0; i < itemArray.Length; i++)
|
||||
{
|
||||
string itemStr = string.Empty;
|
||||
if (itemArray_2.Contains(itemArray[i]))
|
||||
itemStr = itemArray[i] + "^99MRC||";
|
||||
else
|
||||
itemStr = itemArray[i] + "^LN||";
|
||||
|
||||
string val1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR"), 30);
|
||||
sampleNo1 = val1.Split('|')[3];
|
||||
string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
examResultMode erm1 = new examResultMode();
|
||||
erm1.machineCode = MachineCode;
|
||||
erm1.machineID = MachineID;
|
||||
erm1.sampleNo = sampleNo1;
|
||||
erm1.testDate = testDate1;
|
||||
erm1.chanelNo = itemArray[i];//项目代号
|
||||
//项目结果
|
||||
erm1.itemValue = jiexiVal(deviceDataStr.IndexOf(itemStr), itemStr, deviceDataStr).ToString();
|
||||
erm1.itemUnit = "";
|
||||
ermList.Add(erm1);
|
||||
}
|
||||
|
||||
string jsonStr = JsonConvert.SerializeObject(ermList);
|
||||
|
||||
//将结果提交到LIS系统
|
||||
baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
|
||||
if (bmm1.code == 200)
|
||||
dataOutPutShow("数据提交成功:" + jsonStr, null);
|
||||
else
|
||||
dataOutPutShow("数据提交失败:" + jsonStr, null);
|
||||
|
||||
}
|
||||
return rerultJson;
|
||||
}
|
||||
@ -2670,7 +2716,22 @@ namespace FlyDockTool
|
||||
}
|
||||
_tcpResult.Change(0, 10);//开始tcp数据接收,10毫秒频率
|
||||
}
|
||||
|
||||
if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
|
||||
{
|
||||
// 设置IP地址和端口号
|
||||
string tcp_ip = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[3];
|
||||
string tcp_port = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[4];
|
||||
IPAddress ipAddress = IPAddress.Parse(tcp_ip);
|
||||
// IPAddress ipAddress = IPAddress.Any;
|
||||
//// 创建一个监听Socket
|
||||
if (listener == null)
|
||||
{
|
||||
listener = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
|
||||
listener.Bind(new IPEndPoint(ipAddress, int.Parse(tcp_port)));
|
||||
listener.Listen(10000);
|
||||
}
|
||||
_tcpResult.Change(0, 10);//开始tcp数据接收,10毫秒频率
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -2800,6 +2861,10 @@ namespace FlyDockTool
|
||||
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
|
||||
}
|
||||
}
|
||||
if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
|
||||
{
|
||||
_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -3128,6 +3193,11 @@ namespace FlyDockTool
|
||||
_tcpResult.Change(-1, 10);//停止tcp数据接收
|
||||
clientSocket.Close();
|
||||
}
|
||||
if (apiOptions.CurrentDevice == "BC-5120")//BC-5120
|
||||
{
|
||||
_tcpResult.Change(-1, 10);//停止tcp数据接收
|
||||
clientSocket.Close();
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user