This commit is contained in:
lishuang 2024-12-13 09:33:58 +08:00
parent 64eb1c2c79
commit d417c0be0c
4 changed files with 31 additions and 8 deletions

View File

@ -16,7 +16,7 @@ namespace FlyDockTool
//测试11111 都是对的收到大大大 //测试11111 都是对的收到大大大
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new mainForm()); ; Application.Run(new mainForm()); ;//888888999
} }
} }
} }

View File

@ -1644,6 +1644,7 @@ namespace FlyDockTool
if (apiOptions.CurrentDevice == "BC-5130")//BC-5130 if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
{ {
string MachineCode = apiOptions.MachineCode; string MachineCode = apiOptions.MachineCode;
string MachineID = apiOptions.MachineID; string MachineID = apiOptions.MachineID;
List<examResultMode> ermList = new List<examResultMode>(); List<examResultMode> ermList = new List<examResultMode>();
@ -1658,8 +1659,9 @@ namespace FlyDockTool
itemStr = itemArray[i] + "^99MRC||"; itemStr = itemArray[i] + "^99MRC||";
else else
itemStr = itemArray[i] + "^LN||"; itemStr = itemArray[i] + "^LN||";
string val1 = jiexiVal(deviceDataStr.IndexOf("PID|"), "PID|", deviceDataStr).ToString();
sampleNo1 = val1; string val1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR"),30);
sampleNo1 = val1.Split('|')[3];
string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
examResultMode erm1 = new examResultMode(); examResultMode erm1 = new examResultMode();
erm1.machineCode = MachineCode; erm1.machineCode = MachineCode;
@ -2466,8 +2468,14 @@ namespace FlyDockTool
/// <param name="e"></param> /// <param name="e"></param>
void onReData(object o, EventArgs e) void onReData(object o, EventArgs e)
{ {
tempData += o.ToString();//把串口数据积累起来 if (o.ToString().Length > 2)
dataOutPutShow(o, null);//把数据显示到屏幕上 {
tempData += o.ToString();//把串口数据积累起来
//MessageBox.Show(o.ToString().Length.ToString());
dataOutPutShow(o, null);//把数据显示到屏幕上
}
if (apiOptions.CurrentDevice == "HSYH-II")//华晟源尿常规型号H-II if (apiOptions.CurrentDevice == "HSYH-II")//华晟源尿常规型号H-II
_tResult.Change(5000, 5000);// 数据处理延迟5秒开始 5秒计时 _tResult.Change(5000, 5000);// 数据处理延迟5秒开始 5秒计时
if (apiOptions.CurrentDevice == "BT-200")//盛世东唐BT-200尿常规 if (apiOptions.CurrentDevice == "BT-200")//盛世东唐BT-200尿常规
@ -2498,6 +2506,8 @@ namespace FlyDockTool
_tResult.Change(5000, 5000);// 数据处理延迟5秒开始 5秒计时 _tResult.Change(5000, 5000);// 数据处理延迟5秒开始 5秒计时
if (apiOptions.CurrentDevice == "BS-430")//生化BS-430 if (apiOptions.CurrentDevice == "BS-430")//生化BS-430
{ {
//File.WriteAllText("deviceDataLog.txt", deviceDataStr, Encoding.GetEncoding("GB18030"));
deviceAnalysisOption(tempData); deviceAnalysisOption(tempData);
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据 tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
// _tResult.Change(10000, 10000);// 数据处理延迟5秒开始 5秒计时 // _tResult.Change(10000, 10000);// 数据处理延迟5秒开始 5秒计时
@ -2532,7 +2542,14 @@ namespace FlyDockTool
if (apiOptions.CurrentDevice == "BC-5130")//BC-5130 if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
{ {
_tResult.Change(5000, 5000);// 数据处理延迟5秒开始 5秒计时 // _tResult.Change(5000, 5000);// 数据处理延迟5秒开始 5秒计时
if (tempData.Contains("OBX|30|")|| tempData.Contains("OBX|29|"))//OBX|12|ST| 为结束符 说明字符串完整了
{
// MessageBox.Show(tempData);
deviceAnalysisOption(tempData);
tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
}
} }
@ -2590,8 +2607,12 @@ namespace FlyDockTool
int recv = clientSocket.Receive(data); int recv = clientSocket.Receive(data);
if (recv > 0) if (recv > 0)
{ {
byte[] data1=new byte[recv];
for (int i = 0;i<recv;i++)
data1[i] = data[i];
string encodingStr = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[5]; string encodingStr = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[5];
string stringData = Encoding.GetEncoding(encodingStr).GetString(data); string stringData = Encoding.GetEncoding(encodingStr).GetString(data1);
if (apiOptions.CurrentDevice == "SL300C")//Senlo生化SL300C 接收一条数据就需要应答一次 if (apiOptions.CurrentDevice == "SL300C")//Senlo生化SL300C 接收一条数据就需要应答一次
{ {
string[] msgArray = stringData.Split('\n'); string[] msgArray = stringData.Split('\n');

2
mainForm.Designer.cs generated
View File

@ -188,7 +188,7 @@
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "mainForm"; this.Name = "mainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "福乐云软硬件数据对接工具V1.1(2024121101)"; this.Text = "福乐云软硬件数据对接工具V1.1(2024121214)";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mainForm_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mainForm_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);

View File

@ -35,6 +35,8 @@ namespace FlyDockTool
////测试代码 测试完毕后注释调一下两行代码 ////测试代码 测试完毕后注释调一下两行代码
//string resultDataStr = File.ReadAllText(@"C:\Users\Administrator\Desktop\察哈尔右翼中旗\黄羊城\尿常规MA-4210\尿常规MA-4210.txt", Encoding.GetEncoding("GB18030")); //string resultDataStr = File.ReadAllText(@"C:\Users\Administrator\Desktop\察哈尔右翼中旗\黄羊城\尿常规MA-4210\尿常规MA-4210.txt", Encoding.GetEncoding("GB18030"));
//deviceAnalysis.CreateInstance().deviceAnalysisOption(resultDataStr); //deviceAnalysis.CreateInstance().deviceAnalysisOption(resultDataStr);
} }
private void btn_start_or_stop_Click(object sender, EventArgs e) private void btn_start_or_stop_Click(object sender, EventArgs e)