diff --git a/app.config b/app.config index a07c10f..b4f6fa7 100644 --- a/app.config +++ b/app.config @@ -59,7 +59,8 @@ - + + diff --git a/deviceAnalysis.cs b/deviceAnalysis.cs index 49a738e..c8ca486 100644 --- a/deviceAnalysis.cs +++ b/deviceAnalysis.cs @@ -1998,7 +1998,7 @@ namespace FlyDockTool ermList.Clear(); if (i + 15 > resulteArray.Length) break; - string[] spArray = resulteArray[3].Trim().Split(' '); + string[] spArray = resulteArray[2].Trim().Split(' '); string sampleNo1 = spArray[2].Substring(0,1).TrimStart('0'); // string sampleNo1 = resulteArray[2].Trim().Split(' ')[1]; .Replace("-", "0").TrimStart('0') //string testDate1 = jiexiDate(resulteArray[i + 1], resulteArray[i + 2]); @@ -2009,7 +2009,7 @@ namespace FlyDockTool erm.sampleNo = sampleNo1; erm.testDate = testDate1; erm.chanelNo = "LEU";//项目代号 - erm.itemValue = resulteArray[i + 4].Substring(4, 15).Trim();//项目结果//项目结果 + erm.itemValue = resulteArray[i + 3].Substring(4, 15).Trim();//项目结果//项目结果 erm.itemUnit = ""; ermList.Add(erm); @@ -2019,7 +2019,7 @@ namespace FlyDockTool erm1.sampleNo = sampleNo1; erm1.testDate = testDate1; erm1.chanelNo = "NIT";//项目代号 - erm1.itemValue = resulteArray[i + 5].Substring(4, 11).Trim();//项目结果 + erm1.itemValue = resulteArray[i + 4].Substring(4, 11).Trim();//项目结果 erm1.itemUnit = ""; ermList.Add(erm1); @@ -2029,7 +2029,7 @@ namespace FlyDockTool erm2.sampleNo = sampleNo1; erm2.testDate = testDate1; erm2.chanelNo = "URO";//项目代号 - erm2.itemValue = resulteArray[i + 6].Substring(4, 13).Trim();//项目结果 + erm2.itemValue = resulteArray[i + 5].Substring(4, 13).Trim();//项目结果 erm2.itemUnit = ""; ermList.Add(erm2); @@ -2039,7 +2039,7 @@ namespace FlyDockTool erm3.sampleNo = sampleNo1; erm3.testDate = testDate1; erm3.chanelNo = "PRO";//项目代号 - erm3.itemValue = resulteArray[i + 7].Substring(4, 15).Trim();//项目结果 + erm3.itemValue = resulteArray[i + 6].Substring(5, 15).Trim();//项目结果 erm3.itemUnit = ""; ermList.Add(erm3); @@ -2049,7 +2049,7 @@ namespace FlyDockTool erm4.sampleNo = sampleNo1; erm4.testDate = testDate1; erm4.chanelNo = "pH";//项目代号 - erm4.itemValue = resulteArray[i + 8].Substring(4, 12).Trim();//项目结果 + erm4.itemValue = resulteArray[i + 7].Substring(4, 12).Trim();//项目结果 erm4.itemUnit = ""; ermList.Add(erm4); @@ -2060,7 +2060,7 @@ namespace FlyDockTool erm5.sampleNo = sampleNo1; erm5.testDate = testDate1; erm5.chanelNo = "BLO";//项目代号 - erm5.itemValue = resulteArray[i + 9].Substring(4, 15).Trim();//项目结果 + erm5.itemValue = resulteArray[i + 8].Substring(4, 15).Trim();//项目结果 erm5.itemUnit = ""; ermList.Add(erm5); @@ -2071,7 +2071,7 @@ namespace FlyDockTool erm6.sampleNo = sampleNo1; erm6.testDate = testDate1; erm6.chanelNo = "SG";//项目代号 - erm6.itemValue = resulteArray[i + 10].Substring(4, 13).Trim();//项目结果 + erm6.itemValue = resulteArray[i + 9].Substring(4, 13).Trim();//项目结果 erm6.itemUnit = ""; ermList.Add(erm6); @@ -2081,7 +2081,7 @@ namespace FlyDockTool erm10.sampleNo = sampleNo1; erm10.testDate = testDate1; erm10.chanelNo = "KET";//项目代号 - erm10.itemValue = resulteArray[i + 11].Substring(4, 15).Trim();//项目结果 + erm10.itemValue = resulteArray[i + 10].Substring(4, 15).Trim();//项目结果 erm10.itemUnit = ""; ermList.Add(erm10); @@ -2092,7 +2092,7 @@ namespace FlyDockTool erm7.sampleNo = sampleNo1; erm7.testDate = testDate1; erm7.chanelNo = "BIL";//项目代号 - erm7.itemValue = resulteArray[i + 12].Substring(4, 13).Trim();//项目结果 + erm7.itemValue = resulteArray[i + 11].Substring(4, 13).Trim();//项目结果 erm7.itemUnit = ""; ermList.Add(erm7); @@ -2102,7 +2102,7 @@ namespace FlyDockTool erm8.sampleNo = sampleNo1; erm8.testDate = testDate1; erm8.chanelNo = "GLU";//项目代号 - erm8.itemValue = resulteArray[i + 13].Substring(4, 14).Trim();//项目结果 + erm8.itemValue = resulteArray[i + 12].Substring(4, 14).Trim();//项目结果 erm8.itemUnit = ""; ermList.Add(erm8); @@ -2112,7 +2112,7 @@ namespace FlyDockTool erm9.sampleNo = sampleNo1; erm9.testDate = testDate1; erm9.chanelNo = "ASC";//项目代号 - erm9.itemValue = resulteArray[i + 14].Substring(4, 12).Trim();//项目结果 + erm9.itemValue = resulteArray[i + 13].Substring(4, 12).Trim();//项目结果 erm9.itemUnit = ""; ermList.Add(erm9); diff --git a/mainForm.cs b/mainForm.cs index 2092d94..5483232 100644 --- a/mainForm.cs +++ b/mainForm.cs @@ -24,6 +24,8 @@ namespace FlyDockTool private void Form1_Load(object sender, EventArgs e) { + + string CurrentDevice= ConfigurationManager.AppSettings["CurrentDevice"]; apiOptions.CurrentDevice = CurrentDevice; apiOptions.MacAddress = ConfigurationManager.AppSettings[CurrentDevice].Split(',')[0]; @@ -32,11 +34,11 @@ namespace FlyDockTool lb_currentDeviceInfo.Text = CurrentDevice; btn_start_or_stop_Click(null,null);//启动数据接收 - ////测试代码 测试完毕后注释调一下两行代码 - //string resultDataStr = File.ReadAllText(@"C:\Users\Administrator\Desktop\察哈尔右翼中旗\黄羊城\尿常规MA-4210\尿常规MA-4210.txt", Encoding.GetEncoding("GB18030")); + //测试代码 测试完毕后注释调一下两行代码 + //string resultDataStr = File.ReadAllText(@"D:\工作\接受数据工具 list\尿常规U120\尿常规U120.txt", Encoding.GetEncoding("GB18030")); //deviceAnalysis.CreateInstance().deviceAnalysisOption(resultDataStr); - + } private void btn_start_or_stop_Click(object sender, EventArgs e)