();
+ string[] itemArray1 = new string[20] { "WBC", "Lymph#", "Mid#", "Gran#", "Lymph%", "Mid%", "Gran%", "RBC", "HGB", "MCV", "MCH", "MCHC", "RDW-CV", "RDW-SD", "HCT", "PLT", "MPV", "PDW", "PCT", "P-LCR" };
+ string[] itemArray = new string[20] { "WBC", "LYMC", "MIDC", "GRNC", "LYMR", "MIDR", "GRNR", "RBC", "HGB", "MCV", "MCH", "MCHC", "RDW-CV", "RDW-SD", "HCT", "PLT", "MPV", "PDW", "PCT", "P-LCR" };
+ //string[] resulteArray = deviceDataStr.Split('\n');
+ // deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string[] valArray = deviceDataStr.Split('\n');
+ string sampleNo1 = string.Empty;//样本号
+ for (int A = 0; A < valArray.Length; A++)
+ {
+ if (valArray[A].Contains("ID"))
+ {
+ sampleNo1 = jiexiVal(valArray[A].IndexOf("ID"), "ID", valArray[A]).ToString().TrimStart('0');
+ }
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string keyItem = "" + itemArray[i];
+ if (valArray[A].Contains(keyItem))
+ {
+ string itemStr = itemArray[i] + "";
+ 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 = itemArray1[i];//项目代号 这是屏幕上显示的代号
+ erm1.itemValue = valArray[A].Substring(valArray[A].IndexOf("") + 3, valArray[A].IndexOf("") - valArray[A].IndexOf("") - 3);//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+ }
+ }
+
+ string jsonStr12 = JsonConvert.SerializeObject(ermList);
+ //把血常规的图也传上去
+ List eipmList = new List();
+ int[] array1 = strCount("^Base64^", deviceDataStr);
+ string keyStr = "||||||F";//结束符
+ List imgBase64StrList = jiexiBase64(array1, keyStr, deviceDataStr);//解析出数据中的图片base64
+ //int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ for (int i = 0; i < imgBase64StrList.Count; i++)
+ {
+ string base64Str = imgBase64StrList[i];
+ examImageParaModel EIPM1 = new examImageParaModel();
+ EIPM1.machineCode = MachineCode;
+ EIPM1.machineID = MachineID;
+ EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ EIPM1.sampleNo = sampleNo1;
+ EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ eipmList.Add(EIPM1);
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (eipmList.Count > 0)
+ {
+ baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ //if (bmm2.code == 200)
+ // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ //else
+ // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ }
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "CS-1300B")//迪瑞全自动生化分析仪 CS-1300B
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[16] { "ALT", "AST", "TBIL", "UREA", "CRE-E", "GLU", "TC", "TG", "HDL-C", "LDL-C", "TP", "ALB", "DBIL", "ALP", "GGT", "UA" };
+ //deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string[] valArray = deviceDataStr.Split('\n');
+ string sampleNo1 = string.Empty;//样本号
+ for (int A = 0; A < valArray.Length; A++)
+ {
+ if (valArray[A].Contains("|1200^1300B|"))
+ {
+ // int index3 = jiexisampleNo(valArray[A].IndexOf("|480^480|"), valArray[A]);
+ sampleNo1 = jiexisampleNo(valArray[A].IndexOf("|1200^1300B|"), valArray[A]).ToString();
+ // File.WriteAllText("test1.txt","哈哈哈 " + index3.ToString() + " " + valArray[A] + " 原样字符串:" + deviceDataStr);
+ // MessageBox.Show("哈哈哈 "+index3.ToString()+" "+ valArray[A]+" 原样字符串:"+ deviceDataStr);
+ }
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+
+ if (valArray[A].Contains(itemArray[i]))
+ {
+ string itemStr = itemArray[i] + "^1|";
+ 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 = jiexiItemValue(itemStr, valArray[A]);//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+ }
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "URIT-1500")//优利特尿常规URIT-1500
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[11] { "VC", "WBC", "KET", "NIT", "URO", "BIL", "PRO", "GLU", "SG", "BLD", "pH" };
+ string[] resulteArray = deviceDataStr.Split('\n');
+ for (int i = 0; i < resulteArray.Length; i += 18)
+ {
+ //这里需要判断一下数据是否超过了 当前数据的长度
+ ermList.Clear();
+ if (i + 18 > resulteArray.Length)
+ break;
+ string[] spArray = resulteArray[i + 2].Trim().Split(' ');
+ string sampleNo1 = spArray[0].Trim().Replace("NO.", "").TrimStart('0');
+ string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ examResultMode erm = new examResultMode();
+ erm.machineCode = MachineCode;
+ erm.machineID = MachineID;
+ erm.sampleNo = sampleNo1;
+ erm.testDate = testDate1;
+ erm.chanelNo = "VC";//项目代号
+ erm.itemValue = resulteArray[i + 5].Substring(resulteArray[i + 5].IndexOf("VC") + 2, 6).Trim();//项目结果
+ erm.itemUnit = "mmol/L";
+ ermList.Add(erm);
+
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = sampleNo1;
+ erm1.testDate = testDate1;
+ erm1.chanelNo = "WBC";//项目代号
+ erm1.itemValue = resulteArray[i + 6].Substring(resulteArray[i + 6].IndexOf("WBC") + 3, 6).Trim();//项目结果
+ erm1.itemUnit = "CELL/uL";
+ ermList.Add(erm1);
+
+ examResultMode erm2 = new examResultMode();
+ erm2.machineCode = MachineCode;
+ erm2.machineID = MachineID;
+ erm2.sampleNo = sampleNo1;
+ erm2.testDate = testDate1;
+ erm2.chanelNo = "KET";//项目代号
+ erm2.itemValue = resulteArray[i + 7].Substring(resulteArray[i + 7].IndexOf("KET") + 3, 6).Trim();//项目结果
+ erm2.itemUnit = "mmol/L";
+ ermList.Add(erm2);
+
+ examResultMode erm3 = new examResultMode();
+ erm3.machineCode = MachineCode;
+ erm3.machineID = MachineID;
+ erm3.sampleNo = sampleNo1;
+ erm3.testDate = testDate1;
+ erm3.chanelNo = "NIT";//项目代号
+ erm3.itemValue = resulteArray[i + 8].Substring(resulteArray[i + 8].IndexOf("NIT") + 3, 6).Trim();//项目结果
+ erm3.itemUnit = "Neg";
+ ermList.Add(erm3);
+
+ examResultMode erm4 = new examResultMode();
+ erm4.machineCode = MachineCode;
+ erm4.machineID = MachineID;
+ erm4.sampleNo = sampleNo1;
+ erm4.testDate = testDate1;
+ erm4.chanelNo = "URO";//项目代号
+ string[] sss = resulteArray[i + 9].Split(' ');
+ erm4.itemValue = resulteArray[i + 9].Substring(resulteArray[i + 9].IndexOf("URO") + 3, 6).Trim();//项目结果
+ erm4.itemUnit = "Normal";
+ ermList.Add(erm4);
+
+
+ examResultMode erm5 = new examResultMode();
+ erm5.machineCode = MachineCode;
+ erm5.machineID = MachineID;
+ erm5.sampleNo = sampleNo1;
+ erm5.testDate = testDate1;
+ erm5.chanelNo = "BIL";//项目代号
+ erm5.itemValue = resulteArray[i + 10].Substring(resulteArray[i + 10].IndexOf("BIL") + 3, 6).Trim();//项目结果
+ erm5.itemUnit = "umol/L";
+ ermList.Add(erm5);
+
+
+ examResultMode erm6 = new examResultMode();
+ erm6.machineCode = MachineCode;
+ erm6.machineID = MachineID;
+ erm6.sampleNo = sampleNo1;
+ erm6.testDate = testDate1;
+ erm6.chanelNo = "PRO";//项目代号
+ erm6.itemValue = resulteArray[i + 11].Substring(resulteArray[i + 11].IndexOf("PRO") + 3, 6).Trim();//项目结果
+ erm6.itemUnit = "g/L";
+ ermList.Add(erm6);
+
+ examResultMode erm7 = new examResultMode();
+ erm7.machineCode = MachineCode;
+ erm7.machineID = MachineID;
+ erm7.sampleNo = sampleNo1;
+ erm7.testDate = testDate1;
+ erm7.chanelNo = "GLU";//项目代号
+ erm7.itemValue = resulteArray[i + 12].Substring(resulteArray[i + 12].IndexOf("GLU") + 3, 6).Trim();//项目结果
+ erm7.itemUnit = "mmol/L";
+ ermList.Add(erm7);
+
+ examResultMode erm8 = new examResultMode();
+ erm8.machineCode = MachineCode;
+ erm8.machineID = MachineID;
+ erm8.sampleNo = sampleNo1;
+ erm8.testDate = testDate1;
+ erm8.chanelNo = "SG";//项目代号
+ erm8.itemValue = resulteArray[i + 13].Replace("SG", "").Trim();//项目结果
+ erm8.itemUnit = "";
+ ermList.Add(erm8);
+
+ examResultMode erm9 = new examResultMode();
+ erm9.machineCode = MachineCode;
+ erm9.machineID = MachineID;
+ erm9.sampleNo = sampleNo1;
+ erm9.testDate = testDate1;
+ erm9.chanelNo = "BLD";//项目代号
+ erm9.itemValue = resulteArray[i + 14].Substring(resulteArray[i + 14].IndexOf("BLD") + 3, 6).Trim();//项目结果
+ erm9.itemUnit = "CELL/uL";
+ ermList.Add(erm9);
+
+ examResultMode erm10 = new examResultMode();
+ erm10.machineCode = MachineCode;
+ erm10.machineID = MachineID;
+ erm10.sampleNo = sampleNo1;
+ erm10.testDate = testDate1;
+ erm10.chanelNo = "pH";//项目代号
+ erm10.itemValue = resulteArray[i + 15].Replace("pH", "").Trim();//项目结果
+ erm10.itemUnit = "";
+ ermList.Add(erm10);
+ }
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+ }
+ if (apiOptions.CurrentDevice == "URIT-5180")//优利特血常规 5180
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[31] { "WBC", "LYM%", "MON%", "NEU%", "EOS%", "BASO%", "LYM#", "MON#", "NEU#", "EOS#", "BASO#", "ALY%", "ALY#", "LIC%", "LIC#", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW_CV", "RDW_SD", "PLT", "MPV", "PDW", "PCT", "P_LCR", "P_LCC", "NRBC%", "NRBC#" };
+ //string[] resulteArray = deviceDataStr.Split('\n');
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string sampleNo1 = string.Empty;//样本号
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = itemArray[i] + "||";
+ sampleNo1 = deviceDataStr.Substring(deviceDataStr.IndexOf("|URIT^URIT-5160|||") - 7, 7).TrimStart('0');
+ 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 = jiexiItemValue(itemStr, deviceDataStr);//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+
+ ////把血常规的图也传上去
+ //List eipmList = new List();
+ //int[] array1 = strCount("^Base64^", deviceDataStr);
+ //int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ //for (int i = 0; i < array2.Length; i++)
+ //{
+ // string base64Str = deviceDataStr.Substring(array1[i] + 8, array2[i] - array1[i] - 8);
+ // examImageParaModel EIPM1 = new examImageParaModel();
+ // EIPM1.machineCode = MachineCode;
+ // EIPM1.machineID = MachineID;
+ // EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ // EIPM1.sampleNo = sampleNo1;
+ // EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ // eipmList.Add(EIPM1);
+ //}
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ //if (eipmList.Count > 0)
+ //{
+ // baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ // //if (bmm2.code == 200)
+ // // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ // //else
+ // // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ //}
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "BS-430")//生化BS-430
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[10] { "Glu-G", "TG", "TC", "LDL-C", "HDL-C", "T-Bil-V", "ALT", "AST", "CREA-S", "UREA" };
+ string[] itemArrayC = new string[10] { "葡萄糖(葡萄糖氧化酶法)", "甘油三酯", "总胆固醇", "低密度脂蛋白胆固醇", "高密度脂蛋白胆固醇", "总胆红素(钒酸盐氧化法)", "丙氨酸氨基转移酶", "天门冬氨酸氨基转移酶", "肌酐(肌氨酸氧化酶法)", "尿素" };
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ //string[] valArray = deviceDataStr.Split(',');
+ string[] valArray = deviceDataStr.Split('|');
+ string sampleNo1 = valArray[54];//样本号
+
+ for (int i = 0; i < itemArrayC.Length; i++)
+ {
+ 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];//项目代号
+ // MessageBox.Show(deviceDataStr+"\r\n\r\n :"+ggg[5]);
+ string itemStr = itemArrayC[i] + "|";
+ int index1 = deviceDataStr.IndexOf(itemStr);
+ string valueS = jiexiVal(index1, itemStr, deviceDataStr);
+ double roundedValue = Math.Round(double.Parse(valueS), 2);
+ erm1.itemValue = roundedValue.ToString();//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "DF55-1")//帝迈血常规DF55-1
+ {
+
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[27] { "WBC", "NEU%", "LYM%", "MON%", "EOS%", "BAS%", "NEU#", "LYM#", "MON#", "EOS#", "BAS#", "*ALY%", "*LIC#", "*LIC%", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW-SD", "PLT", "MPV", "PDW", "PCT", "*ALY#", "RDW-CV" };
+
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string sampleNo1 = string.Empty;//样本号
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = string.Empty;
+ if (itemArray[i] == "*LIC#" || itemArray[i] == "*LIC%" || itemArray[i] == "PCT")
+ itemStr = itemArray[i] + "^99MRC||";
+ else
+ itemStr = itemArray[i] + "^LN||";
+ string val1 = jiexiVal(deviceDataStr.IndexOf("OBR|1||"), "OBR|1||", deviceDataStr).ToString();
+ sampleNo1 = val1;
+ 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 jsonStr12 = JsonConvert.SerializeObject(ermList);
+ //把血常规的图也传上去
+ List eipmList = new List();
+ int[] array1 = strCount("^Base64^", deviceDataStr);
+ string keyStr = "||||||F";//结束符
+ List imgBase64StrList = jiexiBase64(array1, keyStr, deviceDataStr);//解析出数据中的图片base64
+ //int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ for (int i = 0; i < imgBase64StrList.Count; i++)
+ {
+ string base64Str = imgBase64StrList[i];
+ examImageParaModel EIPM1 = new examImageParaModel();
+ EIPM1.machineCode = MachineCode;
+ EIPM1.machineID = MachineID;
+ EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ EIPM1.sampleNo = sampleNo1;
+ EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ eipmList.Add(EIPM1);
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (eipmList.Count > 0)
+ {
+ baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ //if (bmm2.code == 200)
+ // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ //else
+ // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ }
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "URIT-1600")//优利特URIT-1600
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[12] { "Vc", "WBC", "KET", "NIT", "URO", "BIL", "PRO", "GLU", "SG", "BLD", "pH", "Color" };
+ // deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ //string[] valArray = deviceDataStr.Split(',');
+ string[] valArray = deviceDataStr.Split('\r');
+ string sampleNo1 = string.Empty;
+ for (int A = 0; A < valArray.Length; A++)
+ {
+ if (valArray[A].Contains("OBR"))
+ {
+ string[] valStrArray = valArray[A].Split('|');
+ sampleNo1 = valStrArray[3].TrimStart('0');
+ }
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ if (valArray[A].Contains(itemArray[i]))
+ {
+ 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];//项目代号
+ string[] reArray = valArray[A].Replace("||", "|").Split('|');
+ erm1.itemValue = reArray[4].Split('^')[0];//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+ }
+ }
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "DH56")//帝迈血常规DH56
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[29] { "WBC", "NEU%", "LYM%", "MON%", "EOS%", "BAS%", "NEU#", "LYM#", "MON#", "EOS#", "BAS#", "*ALY#", "*ALY%", "*LIC#", "*LIC%", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW-CV", "RDW-SD", "PLT", "MPV", "PDW", "PCT", "P-LCR", "P-LCC" };
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string sampleNo1 = string.Empty;//样本号
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = string.Empty;
+ if (itemArray[i] == "*LIC#" || itemArray[i] == "*LIC%" || itemArray[i] == "PCT")
+ itemStr = itemArray[i] + "^99MRC||";
+ else
+ itemStr = itemArray[i] + "^LN||";
+ string val1 = jiexiVal(deviceDataStr.IndexOf("OBR|1||"), "OBR|1||", deviceDataStr).ToString();
+ sampleNo1 = val1;
+ 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 jsonStr12 = JsonConvert.SerializeObject(ermList);
+ ////把血常规的图也传上去
+ //List eipmList = new List();
+ //int[] array1 = strCount("^Base64^", deviceDataStr);
+ //string keyStr = "||||||F";//结束符
+ //List imgBase64StrList = jiexiBase64(array1, keyStr, deviceDataStr);//解析出数据中的图片base64
+ ////int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ //for (int i = 0; i < imgBase64StrList.Count; i++)
+ //{
+ // string base64Str = imgBase64StrList[i];
+ // examImageParaModel EIPM1 = new examImageParaModel();
+ // EIPM1.machineCode = MachineCode;
+ // EIPM1.machineID = MachineID;
+ // EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ // EIPM1.sampleNo = sampleNo1;
+ // EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ // eipmList.Add(EIPM1);
+ //}
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ //if (eipmList.Count > 0)
+ //{
+ // baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ // //if (bmm2.code == 200)
+ // // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ // //else
+ // // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ //}
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "URIT-5380")//优利特血常规URIT-5380
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[25] { "WBC", "LYM%", "MON%", "NEU%", "EOS%", "BASO%", "LYM#", "MON#", "NEU#", "EOS#", "BASO#", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW_SD", "RDW_CV", "PLT", "MPV", "PDW", "PCT", "P_LCR", "P_LCC" };
+ //string[] resulteArray = deviceDataStr.Split('\n');
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string sampleNo1 = string.Empty;//样本号
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = itemArray[i] + "||";
+ //sampleNo1 = deviceDataStr.Substring(deviceDataStr.IndexOf("||Urit^UT5380||||") - 7, 7).TrimStart('0');
+ sampleNo1 = jiexisampleNo(deviceDataStr.IndexOf("||Urit^UT5380||||"), deviceDataStr).ToString();
+ 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 = jiexiItemValue(itemStr, deviceDataStr);//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+
+ //把血常规的图也传上去
+ List eipmList = new List();
+ int[] array1 = strCount("^Base64^", deviceDataStr);
+ int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ for (int i = 0; i < array2.Length; i++)
+ {
+ string base64Str = deviceDataStr.Substring(array1[i] + 8, array2[i] - array1[i] - 8);
+ examImageParaModel EIPM1 = new examImageParaModel();
+ EIPM1.machineCode = MachineCode;
+ EIPM1.machineID = MachineID;
+ EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ EIPM1.sampleNo = sampleNo1;
+ EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ eipmList.Add(EIPM1);
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (eipmList.Count > 0)
+ {
+ baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ //if (bmm2.code == 200)
+ // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ //else
+ // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ }
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "U500")//尿常规U500
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] resulteArray = deviceDataStr.Split('\n');
+ // File.WriteAllText("BT-200.TXT", deviceDataStr);
+ for (int i = 0; i < resulteArray.Length; i += 20)
+ {
+ //这里需要判断一下数据是否超过了 当前数据的长度
+ ermList.Clear();
+ if (i + 20 > resulteArray.Length)
+ break;
+ string[] spArray =resulteArray[3].Trim().Split(' ');
+ string sampleNo1 = resulteArray[3].Trim().Split(' ')[2].Replace("-", "0").TrimStart('0');
+ //string testDate1 = jiexiDate(resulteArray[i + 1], resulteArray[i + 2]);
+ string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ examResultMode erm = new examResultMode();
+ erm.machineCode = MachineCode;
+ erm.machineID = MachineID;
+ erm.sampleNo = sampleNo1;
+ erm.testDate = testDate1;
+ erm.chanelNo = "LEU";//项目代号
+ erm.itemValue = resulteArray[i + 4].Substring(4, 15).Trim();//项目结果//项目结果
+ erm.itemUnit = "";
+ ermList.Add(erm);
+
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = sampleNo1;
+ erm1.testDate = testDate1;
+ erm1.chanelNo = "URO";//项目代号
+ erm1.itemValue = resulteArray[i + 5].Substring(4,11).Trim();//项目结果
+ erm1.itemUnit = "mg/dL";
+ ermList.Add(erm1);
+
+ examResultMode erm2 = new examResultMode();
+ erm2.machineCode = MachineCode;
+ erm2.machineID = MachineID;
+ erm2.sampleNo = sampleNo1;
+ erm2.testDate = testDate1;
+ erm2.chanelNo = "ALB";//项目代号
+ erm2.itemValue = resulteArray[i + 6].Substring(4, 13).Trim();//项目结果
+ erm2.itemUnit = "mg/L";
+ ermList.Add(erm2);
+
+ examResultMode erm3 = new examResultMode();
+ erm3.machineCode = MachineCode;
+ erm3.machineID = MachineID;
+ erm3.sampleNo = sampleNo1;
+ erm3.testDate = testDate1;
+ erm3.chanelNo = "PRO";//项目代号
+ erm3.itemValue = resulteArray[i + 7].Substring(4, 15).Trim();//项目结果
+ erm3.itemUnit = "";
+ ermList.Add(erm3);
+
+ examResultMode erm4 = new examResultMode();
+ erm4.machineCode = MachineCode;
+ erm4.machineID = MachineID;
+ erm4.sampleNo = sampleNo1;
+ erm4.testDate = testDate1;
+ erm4.chanelNo = "BIL";//项目代号
+ erm4.itemValue = resulteArray[i + 8].Substring(5,13).Trim();//项目结果
+ erm4.itemUnit = "";
+ ermList.Add(erm4);
+
+
+ examResultMode erm5 = new examResultMode();
+ erm5.machineCode = MachineCode;
+ erm5.machineID = MachineID;
+ erm5.sampleNo = sampleNo1;
+ erm5.testDate = testDate1;
+ erm5.chanelNo = "GLU";//项目代号
+ erm5.itemValue = resulteArray[i + 9].Substring(4, 15).Trim();//项目结果
+ erm5.itemUnit = "";
+ ermList.Add(erm5);
+
+
+ examResultMode erm6 = new examResultMode();
+ erm6.machineCode = MachineCode;
+ erm6.machineID = MachineID;
+ erm6.sampleNo = sampleNo1;
+ erm6.testDate = testDate1;
+ erm6.chanelNo = "ASC";//项目代号
+ erm6.itemValue = resulteArray[i + 10].Substring(5, 13).Trim();//项目结果
+ erm6.itemUnit = "";
+ ermList.Add(erm6);
+
+ examResultMode erm10 = new examResultMode();
+ erm10.machineCode = MachineCode;
+ erm10.machineID = MachineID;
+ erm10.sampleNo = sampleNo1;
+ erm10.testDate = testDate1;
+ erm10.chanelNo = "SG";//项目代号
+ erm10.itemValue = resulteArray[i + 11].Replace("SG", "").Trim();//项目结果
+ erm10.itemUnit = "";
+ ermList.Add(erm10);
+
+
+ examResultMode erm7 = new examResultMode();
+ erm7.machineCode = MachineCode;
+ erm7.machineID = MachineID;
+ erm7.sampleNo = sampleNo1;
+ erm7.testDate = testDate1;
+ erm7.chanelNo = "KET";//项目代号
+ erm7.itemValue = resulteArray[i + 12].Substring(4, 13).Trim();//项目结果
+ erm7.itemUnit = "";
+ ermList.Add(erm7);
+
+ examResultMode erm8 = new examResultMode();
+ erm8.machineCode = MachineCode;
+ erm8.machineID = MachineID;
+ erm8.sampleNo = sampleNo1;
+ erm8.testDate = testDate1;
+ erm8.chanelNo = "NIT";//项目代号
+ erm8.itemValue = resulteArray[i + 13].Substring(4, 14).Trim();//项目结果
+ erm8.itemUnit = "";
+ ermList.Add(erm8);
+
+ examResultMode erm9 = new examResultMode();
+ erm9.machineCode = MachineCode;
+ erm9.machineID = MachineID;
+ erm9.sampleNo = sampleNo1;
+ erm9.testDate = testDate1;
+ erm9.chanelNo = "CRE";//项目代号
+ erm9.itemValue = resulteArray[i + 14].Substring(4, 12).Trim();//项目结果
+ erm9.itemUnit = "mmol/L";
+ ermList.Add(erm9);
+
+ examResultMode erm11 = new examResultMode();
+ erm11.machineCode = MachineCode;
+ erm11.machineID = MachineID;
+ erm11.sampleNo = sampleNo1;
+ erm11.testDate = testDate1;
+ erm11.chanelNo = "PH";//项目代号
+ erm11.itemValue = resulteArray[i + 15].Replace("PH", "").Trim();//项目结果
+ erm11.itemUnit = "mmol/L";
+ ermList.Add(erm11);
+
+
+ examResultMode erm12 = new examResultMode();
+ erm12.machineCode = MachineCode;
+ erm12.machineID = MachineID;
+ erm12.sampleNo = sampleNo1;
+ erm12.testDate = testDate1;
+ erm12.chanelNo = "BLO";//项目代号
+ erm12.itemValue = resulteArray[i + 16].Substring(4, 15).Trim();//项目结果
+ erm12.itemUnit = "mmol/L";
+ ermList.Add(erm12);
+
+ examResultMode erm13 = new examResultMode();
+ erm13.machineCode = MachineCode;
+ erm13.machineID = MachineID;
+ erm13.sampleNo = sampleNo1;
+ erm13.testDate = testDate1;
+ erm13.chanelNo = "CA";//项目代号
+ erm13.itemValue = resulteArray[i + 17].Substring(4, 12).Trim();//项目结果
+ erm13.itemUnit = "mmol/L";
+ ermList.Add(erm13);
+
+
+ examResultMode erm14 = new examResultMode();
+ erm14.machineCode = MachineCode;
+ erm14.machineID = MachineID;
+ erm14.sampleNo = sampleNo1;
+ erm14.testDate = testDate1;
+ erm14.chanelNo = "P:C";//项目代号
+ erm14.itemValue = resulteArray[i + 18].Substring(4, 8).Trim();//项目结果
+ erm14.itemUnit = "mmol/L";
+ ermList.Add(erm14);
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据提交失败:" + jsonStr, null);
+ }
+
+ }
+
+ if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[26] { "WBC", "NEU%", "LYM%", "MON%", "EOS%", "BAS%", "NEU#", "LYM#", "MON#", "EOS#", "BAS#", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW-SD", "PLT", "MPV", "PDW", "PCT", "RDW-CV", "PLCC", "PLCR" , "Lymphocytosis" };
+ //string[] resulteArray = deviceDataStr.Split('\n');
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string sampleNo1 = string.Empty;//样本号
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = string.Empty;
+ if (itemArray[i] == "*LIC#" || itemArray[i] == "*LIC%" || itemArray[i] == "PCT" || itemArray[i] == "PLCC" || itemArray[i] == "PLCR" || itemArray[i] == "Lymphocytosis")
+ itemStr = itemArray[i] + "^99MRC||";
+ else
+ itemStr = itemArray[i] + "^LN||";
+ string val1 = jiexiVal(deviceDataStr.IndexOf("PID|"), "PID|", deviceDataStr).ToString();
+ sampleNo1 = val1;
+ 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]; //项目代号
+ if (itemArray[i] != "Lymphocytosis")
+ erm1.itemValue = jiexiVal(deviceDataStr.IndexOf(itemStr), itemStr, deviceDataStr).ToString();//项目结果
+ else
+ erm1.itemValue = jiexiItemValue(itemStr, deviceDataStr);
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+ string jsonStr12 = JsonConvert.SerializeObject(ermList);
+ //把血常规的图也传上去
+ List eipmList = new List();
+ int[] array1 = strCount("^Base64^", deviceDataStr);
+ string keyStr = "||||||F";//结束符
+ List imgBase64StrList = jiexiBase64(array1, keyStr, deviceDataStr);//解析出数据中的图片base64
+ //int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ for (int i = 0; i < imgBase64StrList.Count; i++)
+ {
+ string base64Str = imgBase64StrList[i];
+ examImageParaModel EIPM1 = new examImageParaModel();
+ EIPM1.machineCode = MachineCode;
+ EIPM1.machineID = MachineID;
+ EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ EIPM1.sampleNo = sampleNo1;
+ EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ eipmList.Add(EIPM1);
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (eipmList.Count > 0)
+ {
+ baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ //if (bmm2.code == 200)
+ // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ //else
+ // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ }
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "SD1")//斯玛特SD1
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[22] { "ALT", "AST", "ALP", "GGT", "IBIL", "TP", "ALB", "Crea", "UA", "GLU", "TG", "HDL", "LDL", "TB|TB", "TC", "DB", "CHE", "BUN|BUN", "TBA", "A/G", "BUN/CREA", "GLOB" };
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ deviceDataStr = deviceDataStr.Replace("OBX", "。");
+
+ string[] valArray = deviceDataStr.Split('。');
+ string sampleNo1 = string.Empty;//样本号
+ for (int A = 0; A < valArray.Length; A++)
+ {
+ if (valArray[A].Contains("OBR|"))
+ {
+ int index1 = valArray[A].Substring(valArray[A].IndexOf("OBR|"), 20).IndexOf("||")+2;
+ sampleNo1 = jiexisampleNo8(index1, valArray[A].Substring(valArray[A].IndexOf("OBR|"),18)).ToString();
+
+ }
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ if (valArray[A].Contains(itemArray[i]))
+ {
+ string itemStr = itemArray[i];
+ 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 = jiexiItemValueLast(itemStr, valArray[A]);//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ }
+ }
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ if (apiOptions.CurrentDevice == "DF55-2")//帝迈血常规DF55-2
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] itemArray = new string[27] { "WBC", "NEU%", "LYM%", "MON%", "EOS%", "BAS%", "NEU#", "LYM#", "MON#", "EOS#", "BAS#", "*ALY%", "*LIC#", "*LIC%", "RBC", "HGB", "HCT", "MCV", "MCH", "MCHC", "RDW-SD", "PLT", "MPV", "PDW", "PCT", "*ALY#", "RDW-CV" };
+ //string[] resulteArray = deviceDataStr.Split('\n');
+ deviceDataStr = deviceDataStr.Replace("\r", "").Replace("\n", "");
+ string sampleNo1 = string.Empty;//样本号
+ for (int i = 0; i < itemArray.Length; i++)
+ {
+ string itemStr = string.Empty;
+ if (itemArray[i] == "*LIC#" || itemArray[i] == "*LIC%" || itemArray[i] == "PCT")
+ itemStr = itemArray[i] + "^99MRC||";
+ else
+ itemStr = itemArray[i] + "^LN||";
+
+ int index1 = deviceDataStr.Substring(deviceDataStr.IndexOf("OBR|"), 20).IndexOf("||") + 2;
+ sampleNo1 = jiexisampleNo8(index1, deviceDataStr.Substring(deviceDataStr.IndexOf("OBR|"), 18)).ToString();
+
+
+
+
+ //string val1 = jiexiVal(deviceDataStr.IndexOf("PID|"), "PID|", deviceDataStr).ToString();
+ //sampleNo1 = val1;
+ 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 jsonStr12 = JsonConvert.SerializeObject(ermList);
+ //把血常规的图也传上去
+ List eipmList = new List();
+ int[] array1 = strCount("^Base64^", deviceDataStr);
+ string keyStr = "||||||F";//结束符
+ List imgBase64StrList = jiexiBase64(array1, keyStr, deviceDataStr);//解析出数据中的图片base64
+ //int[] array2 = strCount("||||||F||||||", deviceDataStr);
+ for (int i = 0; i < imgBase64StrList.Count; i++)
+ {
+ string base64Str = imgBase64StrList[i];
+ examImageParaModel EIPM1 = new examImageParaModel();
+ EIPM1.machineCode = MachineCode;
+ EIPM1.machineID = MachineID;
+ EIPM1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ EIPM1.sampleNo = sampleNo1;
+ EIPM1.img = "data:image/jpeg;base64," + base64Str;
+ eipmList.Add(EIPM1);
+ }
+
+
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (eipmList.Count > 0)
+ {
+ baseMsgModel bmm2 = apiOptions.CreateInstance().uploadExamImage(eipmList);//传图像List
+ //if (bmm2.code == 200)
+ // dataOutPutShow("图像提交成功:" + jsonStr, null);
+ //else
+ // dataOutPutShow("图像提交失败:" + jsonStr, null);
+ }
+
+ if (bmm1.code == 200)
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+
+
+ if (apiOptions.CurrentDevice == "MA-4210")//华晟源尿常规型号:H-II
+ {
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ List ermList = new List();
+ string[] resulteArray = deviceDataStr.Split('\n');
+ for (int i = 0; i < resulteArray.Length; i += 17)
+ {
+ //这里需要判断一下数据是否超过了 当前数据的长度
+ ermList.Clear();
+ if (i + 17 > resulteArray.Length)
+ break;
+ string[] spArray = resulteArray[i + 1].Trim().Split(' ');
+ string sampleNo1 = spArray[0].Replace("No.", "").TrimStart('0');
+ string testDate1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ examResultMode erm = new examResultMode();
+ erm.machineCode = MachineCode;
+ erm.machineID = MachineID;
+ erm.sampleNo = sampleNo1;
+ erm.testDate = testDate1;
+ erm.chanelNo = "GLU";//项目代号
+ erm.itemValue = resulteArray[i + 4].Substring(4,6).Trim();//项目结果
+ erm.itemUnit = "cells/uL";
+ ermList.Add(erm);
+
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = sampleNo1;
+ erm1.testDate = testDate1;
+ erm1.chanelNo = "URO";//项目代号
+ erm1.itemValue = resulteArray[i + 5].Substring(4, 6).Trim();//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+
+ examResultMode erm2 = new examResultMode();
+ erm2.machineCode = MachineCode;
+ erm2.machineID = MachineID;
+ erm2.sampleNo = sampleNo1;
+ erm2.testDate = testDate1;
+ erm2.chanelNo = "BIL";//项目代号
+ erm2.itemValue = resulteArray[i + 6].Substring(4, 6).Trim();//项目结果
+ erm2.itemUnit = "";
+ ermList.Add(erm2);
+
+ examResultMode erm3 = new examResultMode();
+ erm3.machineCode = MachineCode;
+ erm3.machineID = MachineID;
+ erm3.sampleNo = sampleNo1;
+ erm3.testDate = testDate1;
+ erm3.chanelNo = "KET";//项目代号
+ erm3.itemValue = resulteArray[i + 7].Substring(4, 6).Trim();//项目结果
+ erm3.itemUnit = "";
+ ermList.Add(erm3);
+
+ examResultMode erm4 = new examResultMode();
+ erm4.machineCode = MachineCode;
+ erm4.machineID = MachineID;
+ erm4.sampleNo = sampleNo1;
+ erm4.testDate = testDate1;
+ erm4.chanelNo = "SG";//项目代号
+ erm4.itemValue = resulteArray[i + 8].Substring(3, 16).Trim();//项目结果
+ erm4.itemUnit = "";
+ ermList.Add(erm4);
+
+
+ examResultMode erm5 = new examResultMode();
+ erm5.machineCode = MachineCode;
+ erm5.machineID = MachineID;
+ erm5.sampleNo = sampleNo1;
+ erm5.testDate = testDate1;
+ erm5.chanelNo = "BLD";//项目代号
+ erm5.itemValue = resulteArray[i + 9].Substring(4, 6).Trim();//项目结果
+ erm5.itemUnit = "";
+ ermList.Add(erm5);
+
+
+ examResultMode erm6 = new examResultMode();
+ erm6.machineCode = MachineCode;
+ erm6.machineID = MachineID;
+ erm6.sampleNo = sampleNo1;
+ erm6.testDate = testDate1;
+ erm6.chanelNo = "PH";//项目代号
+ erm6.itemValue = resulteArray[i + 10].Substring(3, 16).Trim();//项目结果
+ erm6.itemUnit = "";
+ ermList.Add(erm6);
+
+ examResultMode erm7 = new examResultMode();
+ erm7.machineCode = MachineCode;
+ erm7.machineID = MachineID;
+ erm7.sampleNo = sampleNo1;
+ erm7.testDate = testDate1;
+ erm7.chanelNo = "PRO";//项目代号
+ erm7.itemValue = resulteArray[i + 11].Substring(4, 6).Trim();//项目结果
+ erm7.itemUnit = "";
+ ermList.Add(erm7);
+
+ examResultMode erm8 = new examResultMode();
+ erm8.machineCode = MachineCode;
+ erm8.machineID = MachineID;
+ erm8.sampleNo = sampleNo1;
+ erm8.testDate = testDate1;
+ erm8.chanelNo = "NIT";//项目代号
+ erm8.itemValue = resulteArray[i + 12].Substring(4, 6).Trim();//项目结果
+ erm8.itemUnit = "";
+ ermList.Add(erm8);
+
+ examResultMode erm9 = new examResultMode();
+ erm9.machineCode = MachineCode;
+ erm9.machineID = MachineID;
+ erm9.sampleNo = sampleNo1;
+ erm9.testDate = testDate1;
+ erm9.chanelNo = "LEU";//项目代号
+ erm9.itemValue = resulteArray[i + 13].Substring(4, 6).Trim();//项目结果
+ erm9.itemUnit = "mmol/L";
+ ermList.Add(erm9);
+
+ examResultMode erm10 = new examResultMode();
+ erm10.machineCode = MachineCode;
+ erm10.machineID = MachineID;
+ erm10.sampleNo = sampleNo1;
+ erm10.testDate = testDate1;
+ erm10.chanelNo = "VC";//项目代号
+ erm10.itemValue = resulteArray[i + 14].Substring(3, 6).Trim();//项目结果
+ erm10.itemUnit = "mmol/L";
+ ermList.Add(erm10);
+
+ examResultMode erm11 = new examResultMode();
+ erm11.machineCode = MachineCode;
+ erm11.machineID = MachineID;
+ erm11.sampleNo = sampleNo1;
+ erm11.testDate = testDate1;
+ erm11.chanelNo = "Color";//项目代号
+ erm11.itemValue = resulteArray[i + 15].Replace("Color:","").Trim();//项目结果
+ erm11.itemUnit = "mmol/L";
+ ermList.Add(erm11);
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ dataOutPutShow("数据提交成功:" + jsonStr, null);
+ else
+ dataOutPutShow("数据提交失败:" + jsonStr, null);
+ }
+
+ }
+
+
+ return rerultJson;
+ }
+
+
+
+
+
+
+ ///
+ /// 从结果字符串中截取 结果
+ ///
+ ///
+ ///
+ ///
+ string jiexiItemValue(string itemStr, string deviceDataStr)
+ {
+ string ItemValueStr = "";
+ string Str1 = deviceDataStr.Substring(deviceDataStr.IndexOf(itemStr) + itemStr.Length, 30);
+ int firstIndex = Str1.IndexOf('|');
+ ItemValueStr= Str1.Substring(0, firstIndex);
+ return ItemValueStr;
+ }
+
+
+ ///
+ /// 从结果字符串中截取 结果
+ ///
+ ///
+ ///
+ ///
+ string jiexiItemValueLast(string itemStr, string deviceDataStr)
+ {
+ string ItemValueStr = "";
+ string Str1 = deviceDataStr.Substring(deviceDataStr.LastIndexOf(itemStr) + itemStr.Length+1, 10);
+ int firstIndex = Str1.IndexOf('|');
+ ItemValueStr = Str1.Substring(0, firstIndex);
+ return ItemValueStr;
+ }
+
+
+ ///
+ /// 从字符串中找到 样本编号
+ ///
+ ///
+ ///
+ ///
+ int jiexisampleNo(int index1, string dataStr)
+ {
+ int val1 = -1;
+ for (int i = 1; i < 100; i++)
+ {
+ try
+ {
+ string str1 = dataStr.Substring(index1 - i, i);
+ val1 = int.Parse(str1);
+ }
+ catch { break; }
+
+ }
+ return val1;
+ }
+
+ ///
+ /// 从字符串中找到 样本编号
+ ///
+ ///
+ ///
+ ///
+ int jiexisampleNo8(int index1, string dataStr)
+ {
+ int val1 = -1;
+ for (int i = 1; i < 100; i++)
+ {
+ try
+ {
+ string str1 = dataStr.Substring(index1, i);
+ val1 = int.Parse(str1);
+ }
+ catch { break; }
+
+ }
+ return val1;
+ }
+ ///
+ /// 从字符串中 解析出数字
+ ///
+ ///
+ ///
+ ///
+ string jiexiVal(int index1,string keyStr, string dataStr)
+ {
+ string val1 ="";
+ for (int i = 1; i < 100; i++)
+ {
+ try
+ {
+ string str1 = dataStr.Substring(index1+ keyStr.Length, i);
+ double valx = double.Parse(str1);
+ val1 = str1;
+ }
+ catch { break; }
+
+ }
+ return val1;
+ }
+
+
+ ///
+ /// 从字符串中 解析出 jiexiBase64 图像
+ ///
+ ///
+ ///
+ ///
+ List jiexiBase64(int[] array1, string keyStr, string dataStr)
+ {
+ List imageBase64List=new List();
+ for (int i = 0; i < array1.Length; i++)
+ {
+ for (int b = array1[i]; b< dataStr.Length; b++)
+ {
+ string str1 = dataStr.Substring(b, keyStr.Length);
+ if(str1== keyStr)
+ {
+ string ImgBase64Str = dataStr.Substring(array1[i]+ 8, b- array1[i]- 8);
+ imageBase64List.Add(ImgBase64Str);
+ break;
+ }
+ }
+ }
+ return imageBase64List;
+ }
+
+ static string jiexiDate(string dateStr,string TimeStr)
+ {
+ string[] spArray = dateStr.Trim().Split(' ');
+ string[] varArray= spArray[2].Trim().Trim('\r').Split('-');
+ return varArray[2]+"-"+ varArray[0]+"-"+ varArray[1]+" "+ TimeStr.Trim().Trim('\r');
+ }
+
+
+ Socket listener;
+ //TcpListener listener = null;
+ ///
+ /// 开启数据接收
+ ///
+ public void startDataReceive()
+ {
+ if (apiOptions.CurrentDevice == "HSYH-II")//华晟源尿常规型号:H-II
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "BT-200")//盛世东唐BT-200尿常规
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "URIT-5181")//优利特血常规5181
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "URIT-1500")//优利特尿常规URIT-1500
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "DF55")//帝迈血常规DF55
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "TCPTEST")//TCP接收测试数据
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "CS-480")//迪瑞全自动生化分析仪 CS-480
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "SL300C")//Senlo生化SL300C
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "BK600")//Senlo生化SL300C
+ {
+ _AccessResult.Change(10000, 10000);//开始循环从access数据库中读取数据,10秒频率
+ }
+ if (apiOptions.CurrentDevice == "BA600")//尿常规 GeniusBA600
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "BA600MY")//煤窑中心卫生院的尿常规 GeniusBA600
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "MC-600")//血常规MAC-600
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "CS-1300B")//迪瑞全自动生化分析仪 CS-1300B
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "URIT-5180")//优利特血常规5180
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "BS-430")//生化BS-430
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "DF55-1")//帝迈血常规DF55
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "URIT-1600")//优利特1600
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "HTSH-4000")//HTSH-4000 全自动生化分析仪
+ {
+ _AccessResult.Change(10000, 10000);//开始循环从access数据库中读取数据,10秒频率
+ }
+ if (apiOptions.CurrentDevice == "DH56")//帝迈血常规DH56
+ {
+ // 设置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毫秒频率
+ }
+ if (apiOptions.CurrentDevice == "URIT-5380")//优利特血常规URIT-5380
+ {
+ // 设置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毫秒频率
+ }
+
+
+ if (apiOptions.CurrentDevice == "U500")//尿常规U500
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "BC-5130")//BC-5130 这个设备是需要主动TCP连接 血常规仪器
+ {
+ // 设置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);
+ //}
+
+ clientSocket = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+ clientSocket.Connect(ipAddress, int.Parse(tcp_port));
+ _tcpResult.Change(0, 10);//开始tcp数据接收,10毫秒频率
+ }
+
+
+ if (apiOptions.CurrentDevice == "SD1")//斯玛特SD1
+ {
+ // 设置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毫秒频率
+ }
+
+ if (apiOptions.CurrentDevice == "DF55-2")//帝迈血常规DF55
+ {
+ // 设置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毫秒频率
+ }
+
+
+
+
+ if (apiOptions.CurrentDevice == "hhh5")//BC-5130
+ {
+ // 设置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毫秒频率
+ }
+
+ if (apiOptions.CurrentDevice == "MA-4210")//MA-4210
+ {
+ SerialPortOption.CreateInstance().IniserialPortOption();//初始化串口
+ SerialPortOption.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ SerialPortOption.CreateInstance().StartDataReadThread();//开启数据接收
+ }
+
+ }
+
+ ///
+ /// 将接收到的数据进行处理并显示在软件界面上
+ ///
+ ///
+ ///
+ void onReData(object o, EventArgs e)
+ {
+ tempData += o.ToString();//把串口数据积累起来
+ dataOutPutShow(o, null);//把数据显示到屏幕上
+ if (apiOptions.CurrentDevice == "HSYH-II")//华晟源尿常规型号:H-II
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "BT-200")//盛世东唐BT-200尿常规
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "URIT-5181")//优利特血常规5181
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "DF55")//帝迈血常规DF55
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+ if (apiOptions.CurrentDevice == "TCPTEST")//tcp数据接收测试
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "CS-480")
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "SL300C")//Senlo生化SL300C
+ _tResult.Change(10000, 10000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "BA600")//尿常规 GeniusBA600
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "MC-600")//血常规MAC-600
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "CS-1300B")//迪瑞全自动生化分析仪 CS-1300B
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "BA600MY")//煤窑中心卫生院的尿常规 GeniusBA600
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "URIT-1500")//优利特尿常规URIT-1500
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "URIT-5180")//优利特血常规5180
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ if (apiOptions.CurrentDevice == "BS-430")//生化BS-430
+ {
+ deviceAnalysisOption(tempData);
+ tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
+ // _tResult.Change(10000, 10000);// 数据处理:延迟5秒开始 5秒计时
+ }
+ if (apiOptions.CurrentDevice == "DF55-1")//帝迈血常规DF55
+ {
+ deviceAnalysisOption(tempData);
+ tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
+ //_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+ if (apiOptions.CurrentDevice == "URIT-1600")//优利特1600
+ {
+ if (tempData.Contains("OBX|12|ST|"))//OBX|12|ST| 为结束符 说明字符串完整了
+ {
+ deviceAnalysisOption(tempData);
+ tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
+ }
+
+ //_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+ if (apiOptions.CurrentDevice == "DH56")//帝迈血常规DH56
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+ if (apiOptions.CurrentDevice == "URIT-5380")//优利特血常规URIT-5380
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+
+ if (apiOptions.CurrentDevice == "U500")//尿常规U500
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+
+ if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+
+
+ if (apiOptions.CurrentDevice == "SD1")//斯玛特SD1
+ {
+ if (tempData.Contains("OBX|22|"))//OBX|22| 为结束符 说明字符串完整了
+ {
+ deviceAnalysisOption(tempData);
+ tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
+ }
+
+ //_tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+
+ if (apiOptions.CurrentDevice == "DF55-2")//帝迈血常规DF55
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+
+ if (apiOptions.CurrentDevice == "hhh5")//BC-5130
+ {
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+ if (apiOptions.CurrentDevice == "MA-4210")//MA-4210
+ _tResult.Change(5000, 5000);// 数据处理:延迟5秒开始 5秒计时
+ }
+
+ ///
+ /// 定时器 定时来处理接收到的累计临时数据
+ ///
+ void TResultTick()
+ {
+ _tResult.Change(-1, 5000);//暂停计时
+ deviceAnalysisOption(tempData);
+ tempData = string.Empty;//执行完以后 将临时积累数据清空 以便接收下一个样本数据
+ }
+
+
+
+ Socket clientSocket;
+
+ int msgindex = 1;
+ ///
+ /// 定时器 定时来处理TCP接收到的累计临时数据
+ ///
+ void tcpResultTick()
+ {
+ byte[] data = new byte[40048];
+ if (apiOptions.CurrentDevice != "BC-5130")//如果设备是 apiOptions.CurrentDevice=== "BC-5130" 这个设备在 启动时就已经主动连上了 "BC-5130" 设备,这里就无需初始化连接 直接跳过
+ {
+ if (clientSocket == null)
+ clientSocket = listener.Accept(); //一旦接受连接,创建一个客户端
+ }
+
+ int recv = clientSocket.Receive(data);
+ if (recv > 0)
+ {
+ string encodingStr = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[5];
+ string stringData = Encoding.GetEncoding(encodingStr).GetString(data);
+ if (apiOptions.CurrentDevice == "SL300C")//Senlo生化SL300C 接收一条数据就需要应答一次
+ {
+ string[] msgArray = stringData.Split('\n');
+ for (int i = 0; i < msgArray.Length; i++)
+ {
+ if (msgArray[i].Contains("MSH|")&& msgArray[i].Contains("||UNICODE||"))
+ {
+ string msgId = msgArray[i].Substring(msgArray[i].IndexOf("R01|") +4, msgArray[i].IndexOf("|P|") -msgArray[i].IndexOf("R01|") - 4);
+ string dateTimeNowStr = DateTime.Now.ToString("yyyyMMddHHmmss");
+ string responseMsg = "MSH|^~\\&|1|1|11|1|"+ dateTimeNowStr + "||ACK^R01|"+ msgId + "|P|2.3.1||||0||UNICODE|||MSA|AA|"+ msgId + "||||0|";
+ byte[] sendBytes = Encoding.Unicode.GetBytes(responseMsg);
+ clientSocket.Send(sendBytes);
+ onReData("应答消息:"+responseMsg, null);//数据处理 并将数据显示在软件界面上
+ }
+ }
+
+ }
+ onReData(stringData, null);//数据处理 并将数据显示在软件界面上
+ }
+ }
+
+
+ void accessResultTick()
+ {
+ if (apiOptions.CurrentDevice == "BK600")
+ {
+ _AccessResult.Change(-1, 10000);//开始循环从access数据库中读取数据,10秒频率
+ if (!File.Exists("uploadedRecord.txt"))
+ File.Create("uploadedRecord.txt");
+ string accessDbPath = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[3];
+ if (!accessDbPath.Contains(".mdb"))
+ accessDbPath = DateTime.Now.ToString("yyyy-MM-dd") + ".mdb";
+ //string sql = "select a.sampleProgramID,b.SampleNo,a.ResultValue as ItemValue,a.EName as ItemCode from sampleProgram a inner join sampleInfo b on a.SampleInfoID=b.SampleInfoID where a.stateS is NULL ";
+ string sql = "select a.sampleProgramID,b.SampleNo,a.ResultValue as ItemValue,a.EName as ItemCode from sampleProgram a inner join sampleInfo b on a.SampleInfoID=b.SampleInfoID";
+ DataTable dt_2=new DataTable();
+ try
+ {
+ dt_2 = accessOptions.CreateInstance(accessDbPath).ExcuteSql(sql);
+ }
+ catch { dt_2 = null; }
+ if(dt_2==null)
+ return;
+ List ermList = new List();
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ string uploadedRecordStr = File.ReadAllText("uploadedRecord.txt");
+ for (int i = 0; i < dt_2.Rows.Count; i++)
+ {
+ if (!uploadedRecordStr.Contains(dt_2.Rows[i]["sampleProgramID"].ToString()))
+ {
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = dt_2.Rows[i]["SampleNo"].ToString();
+ erm1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ erm1.chanelNo = dt_2.Rows[i]["ItemCode"].ToString();//项目代号
+ erm1.itemValue = dt_2.Rows[i]["ItemValue"].ToString();//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ uploadedRecordStr += (dt_2.Rows[i]["sampleProgramID"].ToString() + ",");
+ }
+ }
+ if (ermList.Count > 0)
+ {
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ {
+ //for (int i = 0; i < dt_2.Rows.Count; i++)
+ //{
+ // string sql1 = "update sampleProgram set stateS=1 where sampleProgramID='" + dt_2.Rows[i]["sampleProgramID"].ToString() + "'";
+ // bool flag1 = accessOptions.CreateInstance(accessDbPath).SqlUpdate(sql1);
+ //}
+ File.WriteAllText("uploadedRecord.txt", uploadedRecordStr);//记录写入本地
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ }
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ _AccessResult.Change(10000, 10000);//开始循环从access数据库中读取数据,10秒频率
+ }
+
+ if (apiOptions.CurrentDevice == "HTSH-4000")
+ {
+ _AccessResult.Change(-1, 10000);//开始循环从access数据库中读取数据,10秒频率
+ if (!File.Exists("uploadedRecord.txt"))
+ File.Create("uploadedRecord.txt");
+ string accessDbPath = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[3];
+ if (!accessDbPath.ToLower().Contains(".mdb"))
+ accessDbPath = DateTime.Now.ToString("yyyy-MM-dd") + ".mdb";
+ string CHECKDATE = DateTime.Now.ToString("yyyy-MM-dd");
+ // string CHECKDATE = DateTime.Now.ToString("2024-04-01");
+ //string sql = "SELECT ITEM as ItemCode,cint(Right(str(id), 3)) as SampleNO, `RESULT` as ItemValue FROM `CHECK_RESULT202404` where mid(id,1,4) +'-' + mid(id,5,2) + '-' + mid(id,7,2)='"+ CHECKDATE + "'";
+ string tableName = "CHECK_RESULT" + DateTime.Now.ToString("yyyyMM");
+ //string sql = "SELECT ITEM as ItemCode,id,cint(Right(str(id), 3)) as SampleNO, `RESULT` as ItemValue FROM "+ tableName + " where mid(id,1,4) +'-' + mid(id,5,2) + '-' + mid(id,7,2)='"+ CHECKDATE + "'";
+ string sql = "SELECT ITEM as ItemCode,id,cint(Right(str(id), 3)) as SampleNO, `RESULT` as ItemValue FROM " + tableName + "";
+ DataTable dt_2 = accessOptions.CreateInstance(accessDbPath).ExcuteSql(sql);
+ List ermList = new List();
+ string MachineCode = apiOptions.MachineCode;
+ string MachineID = apiOptions.MachineID;
+ string uploadedRecordStr = File.ReadAllText("uploadedRecord.txt");
+ for (int i = 0; i < dt_2.Rows.Count; i++)
+ {
+ string uploadedRecordId = dt_2.Rows[i]["id"].ToString().Trim() + dt_2.Rows[i]["ItemCode"].ToString().Trim();
+ if (!uploadedRecordStr.Contains(uploadedRecordId))
+ {
+ examResultMode erm1 = new examResultMode();
+ erm1.machineCode = MachineCode;
+ erm1.machineID = MachineID;
+ erm1.sampleNo = dt_2.Rows[i]["SampleNo"].ToString().Trim();
+ erm1.testDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ erm1.chanelNo = dt_2.Rows[i]["ItemCode"].ToString().Trim();//项目代号
+ erm1.itemValue = dt_2.Rows[i]["ItemValue"].ToString().Trim();//项目结果
+ erm1.itemUnit = "";
+ ermList.Add(erm1);
+ uploadedRecordStr += (uploadedRecordId + ",");
+ }
+ }
+ if (ermList.Count > 0)
+ {
+ //将结果提交到LIS系统
+ baseMsgModel bmm1 = apiOptions.CreateInstance().upLoadExamResult(ermList);
+ string jsonStr = JsonConvert.SerializeObject(ermList);
+ if (bmm1.code == 200)
+ {
+ //for (int i = 0; i < dt_2.Rows.Count; i++)
+ //{
+ // string sql1 = "update sampleProgram set stateS=1 where sampleProgramID='" + dt_2.Rows[i]["sampleProgramID"].ToString() + "'";
+ // bool flag1 = accessOptions.CreateInstance(accessDbPath).SqlUpdate(sql1);
+ //}
+ File.WriteAllText("uploadedRecord.txt", uploadedRecordStr);//记录写入本地
+ dataOutPutShow("数据和图像提交成功:" + jsonStr, null);
+ }
+ else
+ dataOutPutShow("数据和图像提交失败:" + jsonStr, null);
+
+ }
+ _AccessResult.Change(10000, 10000);//开始循环从access数据库中读取数据,10秒频率
+ }
+ }
+ ///
+ /// 停止数据接收
+ ///
+ public void stopDataReceive()
+ {
+ if (apiOptions.CurrentDevice == "HSYH-II")//华晟源尿常规型号:H-II
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "BT-200")//盛世东唐BT-200尿常规
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "URIT-5181")//优利特血常规 5181
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "URIT-1500")//优利特尿常规URIT-1500
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "DF55")//帝迈血常规DF55
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "TCPTEST")//tcp数据接收测试
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "CS-480")
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "SL300C")//Senlo生化SL300C
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "BA600")//尿常规 GeniusBA600
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "BA600MY")//煤窑中心卫生院的尿常规 GeniusBA600
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+ if (apiOptions.CurrentDevice == "MC-600")//血常规MAC-600
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+
+ if (apiOptions.CurrentDevice == "CS-1300B")//迪瑞全自动生化分析仪 CS-1300B
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "URIT-5180")//优利特血常规5180
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "BS-430")//生化BS-430
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "DF55-1")//帝迈血常规DF55
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "URIT-1600")//优利特1600
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+
+ if (apiOptions.CurrentDevice == "BK600")//
+ {
+ _AccessResult.Change(-1, 10000);//停止从access数据库中读取数据,10秒频率
+ }
+
+ if (apiOptions.CurrentDevice == "HTSH-4000")//HTSH-4000 全自动生化分析仪
+ {
+ _AccessResult.Change(-1, 10000);//停止从access数据库中读取数据,10秒频率
+ }
+
+ if (apiOptions.CurrentDevice == "DH56")//帝迈血常规DH56
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "URIT-5380")//优利特血常规 URIT-5380
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "U500")//尿常规U500
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+
+ if (apiOptions.CurrentDevice == "BC-5130")//BC-5130
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "SD1")//斯玛特
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "DF55-2")//帝迈血常规DF55
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+ if (apiOptions.CurrentDevice == "hhh5")//BC-5130
+ {
+ _tcpResult.Change(-1, 10);//停止tcp数据接收
+ clientSocket.Close();
+ }
+
+ if (apiOptions.CurrentDevice == "MA-4210")//MA-4210
+ {
+ SerialPortOption.CreateInstance().StopDataReadThread();//开启数据接收
+ }
+
+
+ }
+
+ /////
+ ///// 开启tcp数据接收
+ /////
+ //public void tcpDataReceive()
+ //{
+ // while (true)
+ // {
+ // byte[] data = new byte[1024];//对data清零
+ // Socket clientSocket = listener.Accept(); //一旦接受连接,创建一个客户端
+ // int recv = clientSocket.Receive(data);
+ // if (recv == 0) //如果收到的数据长度小于0,则退出
+ // continue;
+ // string stringData = Encoding.Unicode.GetString(data);
+ // onReData(stringData, null);//将数据显示在软件界面上
+ // }
+ //}
+ }
+}
diff --git a/deviceInfo.cs b/deviceInfo.cs
new file mode 100644
index 0000000..f1b3443
--- /dev/null
+++ b/deviceInfo.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.IO.Ports;
+using System.Linq;
+using System.Net.Mail;
+using System.Runtime.InteropServices;
+using System.Security.AccessControl;
+using System.Text;
+
+namespace FlyDockTool
+{
+ public class deviceInfo
+ {
+ public string MachineCode { get; set; }// 设备型号
+ public string MachineID { get; set; }// 设备后台编号
+ public string MacAddress { get; set; }// 绑定的电脑标志信息
+ public string MacConfigID { get; set; }// 后台设备接口配置编号
+ public string InterFaceCode { get; set; }// 接口类型代码
+ public string ChatSet { get; set; }// 字符集
+ public string AckFlag { get; set; }// 应答ACK = 06H标志
+ public string ResultPath { get; set; }// 结果存储路径
+ public string DbCon { get; set; }// 数据库链接
+ public string DbSql { get; set; }// 数据库Sql语句
+ public string HL7TYPE { get; set; }//HL7协议类型标志
+ public string ChatRoom { get; set; }// HL7协议方式(UDP/TCP)
+ public string HL7IP { get; set; }// HL7协议服务启动IP地址
+ public string HL7Port { get; set; }// HL7协议服务监听端口
+ public string PortName { get; set; }// 串口号
+ public string BaudRate { get; set; }// 波特率
+ public string DataBit { get; set; }//数据位
+ public string Parity { get; set; }//校验位
+ public string StopBits { get; set; }// 停止位
+ public string HexFlag { get; set; }// 数据接收方式
+ public string ImgPath { get; set; }//图像存储路径
+ }
+}
diff --git a/examImageParaModel.cs b/examImageParaModel.cs
new file mode 100644
index 0000000..9d6cf72
--- /dev/null
+++ b/examImageParaModel.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace FlyDockTool
+{
+ public class examImageParaModel
+ {
+ public string machineCode { get; set; }//设备型号
+ public string machineID { get; set; }//设备id
+ public string testDate { get; set; }//检验时间
+ public string sampleNo { get; set; }// 样本号
+ public string img { get; set; }//图片文件
+ }
+}
diff --git a/examResultMode.cs b/examResultMode.cs
new file mode 100644
index 0000000..463bab2
--- /dev/null
+++ b/examResultMode.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace FlyDockTool
+{
+ public class examResultMode
+ {
+ public string machineCode { get; set; }// 设备代码 varchar(50)
+ public string machineID { get; set; }// 设备后台编号 varchar(50) 不能为空
+ public string testDate { get; set; }// 检验日期 Varchar(50)
+ public string sampleNo { get; set; }//样本号 Varchar(50)
+ public string barCode { get; set; }//条码号 Varchar(50)
+ public string itemName { get; set; }//项目名称 Varchar(50)
+ public string itemCode { get; set; }//项目代码 Varchar(50)
+ public string chanelNo { get; set; }//通道号 Varchar(50)
+ public string itemValue { get; set; }//项目结果 Varchar(50)
+ public string itemTips { get; set; }//项目提示 Varchar(50)
+ public string itemRange { get; set; }//参考范围 Varchar(200)
+ public string yangFlag { get; set; }//阳性标志 Tinyint default 0
+ public string itemUnit { get; set; }//项目单位 Varchar(50)
+ public string lowValue { get; set; }//参考下限 Varchar(50)
+ public string highValue { get; set; }//参考上限 Varchar(50)
+
+ }
+}
diff --git a/logo.ico b/logo.ico
new file mode 100644
index 0000000..907795b
Binary files /dev/null and b/logo.ico differ
diff --git a/mainForm.Designer.cs b/mainForm.Designer.cs
new file mode 100644
index 0000000..5513666
--- /dev/null
+++ b/mainForm.Designer.cs
@@ -0,0 +1,219 @@
+namespace FlyDockTool
+{
+ partial class mainForm
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm));
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.lb_currentDeviceInfo = new System.Windows.Forms.Label();
+ this.lb_info = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.btn_start_or_stop = new System.Windows.Forms.Button();
+ this.groupBox3 = new System.Windows.Forms.GroupBox();
+ this.txt_msg = new System.Windows.Forms.TextBox();
+ this.timer_dataShow = new System.Windows.Forms.Timer(this.components);
+ this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
+ this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.groupBox2.SuspendLayout();
+ this.groupBox3.SuspendLayout();
+ this.contextMenuStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox2
+ //
+ this.groupBox2.Controls.Add(this.button1);
+ this.groupBox2.Controls.Add(this.lb_currentDeviceInfo);
+ this.groupBox2.Controls.Add(this.lb_info);
+ this.groupBox2.Controls.Add(this.label1);
+ this.groupBox2.Controls.Add(this.btn_start_or_stop);
+ this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
+ this.groupBox2.Location = new System.Drawing.Point(0, 0);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(1107, 144);
+ this.groupBox2.TabIndex = 1;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "操作";
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(840, 82);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(198, 41);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "获取设备编号";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // lb_currentDeviceInfo
+ //
+ this.lb_currentDeviceInfo.AutoSize = true;
+ this.lb_currentDeviceInfo.Location = new System.Drawing.Point(191, 39);
+ this.lb_currentDeviceInfo.Name = "lb_currentDeviceInfo";
+ this.lb_currentDeviceInfo.Size = new System.Drawing.Size(17, 18);
+ this.lb_currentDeviceInfo.TabIndex = 1;
+ this.lb_currentDeviceInfo.Text = "-";
+ //
+ // lb_info
+ //
+ this.lb_info.AutoSize = true;
+ this.lb_info.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.lb_info.ForeColor = System.Drawing.Color.Blue;
+ this.lb_info.Location = new System.Drawing.Point(212, 82);
+ this.lb_info.Name = "lb_info";
+ this.lb_info.Size = new System.Drawing.Size(18, 24);
+ this.lb_info.TabIndex = 1;
+ this.lb_info.Text = "-";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(78, 39);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(98, 18);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "当前设备:";
+ //
+ // btn_start_or_stop
+ //
+ this.btn_start_or_stop.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.btn_start_or_stop.Location = new System.Drawing.Point(81, 76);
+ this.btn_start_or_stop.Name = "btn_start_or_stop";
+ this.btn_start_or_stop.Size = new System.Drawing.Size(112, 47);
+ this.btn_start_or_stop.TabIndex = 0;
+ this.btn_start_or_stop.Text = "启动";
+ this.btn_start_or_stop.UseVisualStyleBackColor = true;
+ this.btn_start_or_stop.Click += new System.EventHandler(this.btn_start_or_stop_Click);
+ //
+ // groupBox3
+ //
+ this.groupBox3.Controls.Add(this.txt_msg);
+ this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.groupBox3.Location = new System.Drawing.Point(0, 144);
+ this.groupBox3.Name = "groupBox3";
+ this.groupBox3.Size = new System.Drawing.Size(1107, 593);
+ this.groupBox3.TabIndex = 2;
+ this.groupBox3.TabStop = false;
+ this.groupBox3.Text = "数据接收";
+ //
+ // txt_msg
+ //
+ this.txt_msg.BackColor = System.Drawing.Color.Black;
+ this.txt_msg.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.txt_msg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.txt_msg.ForeColor = System.Drawing.Color.GreenYellow;
+ this.txt_msg.Location = new System.Drawing.Point(3, 24);
+ this.txt_msg.Multiline = true;
+ this.txt_msg.Name = "txt_msg";
+ this.txt_msg.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.txt_msg.Size = new System.Drawing.Size(1101, 566);
+ this.txt_msg.TabIndex = 0;
+ //
+ // timer_dataShow
+ //
+ this.timer_dataShow.Enabled = true;
+ this.timer_dataShow.Interval = 1000;
+ //
+ // notifyIcon1
+ //
+ this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
+ this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
+ this.notifyIcon1.Text = "福乐云软硬件数据对接工具正在运行中......请勿关闭";
+ this.notifyIcon1.Visible = true;
+ this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
+ //
+ // contextMenuStrip1
+ //
+ this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
+ this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.显示ToolStripMenuItem,
+ this.退出ToolStripMenuItem});
+ this.contextMenuStrip1.Name = "contextMenuStrip1";
+ this.contextMenuStrip1.Size = new System.Drawing.Size(133, 80);
+ //
+ // 显示ToolStripMenuItem
+ //
+ this.显示ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem";
+ this.显示ToolStripMenuItem.Size = new System.Drawing.Size(132, 38);
+ this.显示ToolStripMenuItem.Text = "显示";
+ this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
+ //
+ // 退出ToolStripMenuItem
+ //
+ this.退出ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
+ this.退出ToolStripMenuItem.Size = new System.Drawing.Size(132, 38);
+ this.退出ToolStripMenuItem.Text = "退出";
+ this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
+ //
+ // mainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1107, 737);
+ this.Controls.Add(this.groupBox3);
+ this.Controls.Add(this.groupBox2);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "mainForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "福乐云软硬件数据对接工具V1.1(2024121101)";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.mainForm_FormClosing);
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.groupBox3.ResumeLayout(false);
+ this.groupBox3.PerformLayout();
+ this.contextMenuStrip1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.GroupBox groupBox3;
+ private System.Windows.Forms.TextBox txt_msg;
+ private System.Windows.Forms.Button btn_start_or_stop;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label lb_currentDeviceInfo;
+ private System.Windows.Forms.Label lb_info;
+ private System.Windows.Forms.Timer timer_dataShow;
+ private System.Windows.Forms.NotifyIcon notifyIcon1;
+ private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem 显示ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
+ private System.Windows.Forms.Button button1;
+ }
+}
+
diff --git a/mainForm.cs b/mainForm.cs
new file mode 100644
index 0000000..fbf2c97
--- /dev/null
+++ b/mainForm.cs
@@ -0,0 +1,145 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Configuration;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Net.Mail;
+using System.Text;
+using System.Web;
+using System.Windows.Forms;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
+
+namespace FlyDockTool
+{
+ public partial class mainForm : Form
+ {
+ public mainForm()
+ {
+ InitializeComponent();
+ }
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ string CurrentDevice= ConfigurationManager.AppSettings["CurrentDevice"];
+ apiOptions.CurrentDevice = CurrentDevice;
+ apiOptions.MacAddress = ConfigurationManager.AppSettings[CurrentDevice].Split(',')[0];
+ apiOptions.MachineCode = ConfigurationManager.AppSettings[CurrentDevice].Split(',')[1];
+ apiOptions.MachineID = ConfigurationManager.AppSettings[CurrentDevice].Split(',')[2];
+ 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"));
+ //deviceAnalysis.CreateInstance().deviceAnalysisOption(resultDataStr);
+ }
+
+ private void btn_start_or_stop_Click(object sender, EventArgs e)
+ {
+ if (btn_start_or_stop.Text == "启动")
+ {
+ //if (MessageBox.Show("确定启动数据接收?","提示",MessageBoxButtons.OKCancel)==DialogResult.OK)
+ //{
+ deviceAnalysis.CreateInstance().startDataReceive();
+ deviceAnalysis.CreateInstance().dataOutPutShow += new EventHandler(onReData);
+ btn_start_or_stop.Text = "停止";
+ timer_dataShow.Enabled = true;
+ //txt_msg.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+" | 设备:"+ apiOptions.MacAddress+ " 数据接收已启动...\r\n");
+ DoData("设备:" + apiOptions.MacAddress + " 数据接收已启动...\r\n");
+ lb_info.Text = "数据接收已启动...";
+ //}
+ }
+ else if (btn_start_or_stop.Text == "停止")
+ {
+ if (MessageBox.Show("确定停止数据接收?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
+ {
+ deviceAnalysis.CreateInstance().stopDataReceive();
+ btn_start_or_stop.Text = "启动";
+ timer_dataShow.Enabled = false;
+ // txt_msg.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " | "+ apiOptions.MacAddress+ " 数据接收已停止...\r\n");
+ DoData("设备:" + apiOptions.MacAddress + " 数据接收已停止...\r\n");
+ lb_info.Text = "数据接收已停止...";
+ }
+ }
+
+ }
+
+
+ private delegate void DoDataDelegate(object txtContent);
+ ///
+ /// 异步赋值
+ ///
+ ///
+ private void DoData(object txtContent)
+ {
+ if (txt_msg.InvokeRequired)
+ {
+ DoDataDelegate d = DoData;
+ txt_msg.Invoke(d, txtContent);
+ }
+ else
+ {
+ txt_msg.AppendText("\r\n" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "接收到数据 : " + txtContent.ToString() + "\r\n");
+ }
+ }
+
+ ///
+ /// 显示串口或者TCP接收到的数据
+ ///
+ ///
+ ///
+ void onReData(object o, EventArgs e)
+ {
+ //txt_msg.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "接收到数据 : " + o.ToString()+ "\r\n");
+ DoData(o);
+ }
+
+ bool isClose = false;
+ private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (!isClose)
+ {
+ e.Cancel = true;
+ this.Hide();
+ }
+ }
+
+ private void notifyIcon1_DoubleClick(object sender, EventArgs e)
+ {
+ this.Show();
+ }
+
+ private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (MessageBox.Show("确定退出该软件?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
+ {
+ isClose = true;
+ Application.Exit();
+ }
+ }
+
+ private void 显示ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ this.Show();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ baseMsgModel bmm = apiOptions.CreateInstance().getMacAddressInfo();
+ if (bmm.code == 200)
+ {
+ List diList = JsonConvert.DeserializeObject>(bmm.data.ToString());
+ string showStr= "计算机名称(MacAddress):" + diList[0].MacAddress+"\r\n";
+ showStr += "设备型号(MachineCode):" + diList[0].MachineCode + "\r\n";
+ showStr += "设备编号(MachineID):" + diList[0].MachineID + "\r\n";
+ MessageBox.Show(showStr);
+ }
+ else
+ MessageBox.Show("未查到设备编号,请先在配置文件中配置MacAddress和MachineCode");
+
+ }
+ }
+}
diff --git a/mainForm.resx b/mainForm.resx
new file mode 100644
index 0000000..cd3a560
--- /dev/null
+++ b/mainForm.resx
@@ -0,0 +1,704 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 248, 17
+
+
+ 452, 17
+
+
+ 611, 14
+
+
+
+
+ AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAAMMOAADDDgAAAAAAAAAA
+ AACtra3/////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////7+
+ //95dO//JR3m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ycf5v+alvP/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////ra2t////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////x8X4/zUu5/8oIOb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8mHub/Xljs//f3/v//////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////62trf//////////////////////////////
+ ///////////////////////////////////////////////////y8f3/r6z2/6ai9f+mo/X/pqP1/6aj
+ 9f+mo/X/pqP1/6aj9f+mo/X/paL0/7+89//7+/////////X1/v9ZU+z/Jh7m/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zUu5//Hxfn/////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////+tra3/////////
+ ////////////////////////////////////////////////////////////////////////+fn+/3Jt
+ 7/8kHOX/Jx/m/ycf5v8nH+b/Jx/m/ycf5v8nH+b/Jx/m/yUd5v88Nej/3t37////////////o6D0/ysj
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8lHeb/fHfw////////////////////
+ ///////////////////////////////////////////////////////////////////////////////+
+ /P/88tz/ra2t////////////////////////////////////////////////////////////////////
+ //////////////////+8uvf/KyPm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KiLm/6Sh
+ 9P///////////+Tj/P9BOun/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/0lC
+ 6v/k4/z/////////////////////////////////////////////////////////////////////////
+ ///////////////////++vL/77tE/62trf//////////////////////////////////////////////
+ ////////////////////////////////////////6+r9/1NN6/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/yYe5v9UTev/8O/9///////8+///fXjw/yce5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8oIOb/l5Pz////////////////////////////////////////////////////
+ /////////////////////////////////////////vrx/+62OP+tra3///////////////////////n5
+ /v+sqfX/kIzy/5GN8v+RjfL/kY3y/5GN8v+RjfL/kY3y/5GM8v+emvT/8/L+//////+bl/P/Jh7m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/NCzn/8fF+P///////////8rI+f8xKef/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx7m/01H6v/u7f3/////////////////////////
+ //////////////////////////////////////////////////////////////768f/utjj/ra2t////
+ ////////////////////////nJjz/yYe5v8lHeb/JR3m/yUd5v8lHeb/JR3m/yUd5v8kHOX/LCXm/7m2
+ 9///////0tD6/zs06P8oIOb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe5v9zbe//+/v/////
+ ///v7/3/WlTs/yYe5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8xKef/vbv3////
+ ////////////////////////////////////////////////////////////////////////////////
+ ///++vH/7rY4/62trf///////////////////////////97c+/88NOj/KCDm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/yYe5v9lX+3/+fj+//39//94c+//JR3m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8nH+b/RT7p/+Lh/P///////////6qn9f8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jh3m/2pk7v/6+v7/////////////////////////////////////////////////////////
+ /////////////////////////vrx/+62OP+tra3////////////////////////////7+/7/eXTv/yce
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/Pjbo/9jX+v//////sa72/y0l5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v+Xk/P////////////a2fv/QDjp/ygg5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ycf5v9AOen/3Nr7////////////////////////////////////
+ //////////////////////////////////////////////768f/utjj/ra2t////////////////////
+ /////////////8PA+P8tJuf/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe5v+Ig/H///////Dw
+ /f9ZU+z/Jh7m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8mHub/Xljs//X0/v///////v7//4aC
+ 8f8mHub/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx7m/4yI8v//////////////
+ ///////////////////////////////////////////////////////////////////++vH/7rY4/62t
+ rf/////////////////////////////////t7f3/VlDr/ycf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8mHub/VE7r/+7t/f//////jYny/yYe5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/zAo
+ 5/+8uff///////////+9u/f/Lyjn/ygg5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe
+ 5v9YUuv/8PD9////////////////////////////////////////////////////////////////////
+ /////////vrx/+62OP+tra3//////////////////////////////////////6Ke9P8nH+b/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ysk5v+sqfX//////9zb+/9BOun/KB/m/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8lHeb/fnnw//7+////////9fX+/2Vf7f8mHub/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/LSXm/7Gu9v//////////////////////////////////////////////
+ //////////////////////////////768f/utjj/ra2t////////////////////////////////////
+ ///W1Pr/PTbo/ygf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8lHeb/cm3v//v7///7+///a2Xu/yYd
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/0I76f/b2fv///////////+5tvf/Libn/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yUd5v93cu///Pz/////////////////////
+ ///////////////////////////////////////////////////++vH/7rY4/62trf//////////////
+ /////////////////////////f3//4R/8f8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zkx
+ 6P/OzPn//////7279/8xKef/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/oJz0////
+ ////////5eT8/0dB6v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/OzTo/9LQ
+ +v///////////////////////////////////////////////////////////////////////vrx/+62
+ OP+tra3////////////////////////////////////////////S0Pr/Ni7o/ygg5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8mHub/k4/y///////v7/3/T0jq/yYe5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jh7m/11X7P/x8P3///////////+VkfP/KB/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/yYe5v+ZlfP/////////////////////////////////////////////////////////
+ //////////////768f/utjj/ra2t////////////////////////////////////////////8/L+/2Ba
+ 7P8mHub/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/1BK6//o6Pz//////5iU8/8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8tJuf/wb74////////////zsz5/zQs5/8oIOb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/VE3r/+vq/f//////////////////////////////
+ ///////////////////////////////////++vH/7rU4/62trf//////////////////////////////
+ //////////////////+ysPb/KyPm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8qIub/tbP2////
+ ///a2fv/OTLo/ygg5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx7m/4B78P/9/f////////n5
+ /v9wa+7/Jh7m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KCDm/ygg5v+3tPf/////////
+ /////////////////////////////////////////////////////////vv1//PMc/+tra3/////////
+ ////////////////////////////////////////4N/7/0Q96f8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jh7m/3Br7v/5+f7/+fn+/3Jt7/8mHub/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg
+ 5v88NOj/29n7////////////sa72/yoi5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/JR3m/y8o
+ 5/9jXe3/urf3////////////////////////////////////////////////////////////////////
+ ////////ra2t//////////////////////////////////////////////////////+Pi/L/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v81Lef/09H6//////++vPf/LCXm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/6Og9P///////////+jo/P9RSuv/Jx/m/ykh5v8pIeb/KSHm/yce
+ 5v8oIOb/QDnp/4SA8f+8uvf/9PT+////////////////////////////////////////////////////
+ /////////////////////v7/+ea6/62trf//////////////////////////////////////////////
+ ////////xsT4/zIq5/8oIOb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KCDm/5aS8///////6un9/1FK
+ 6/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/Jx/m/y8n5/99efD/9vb+////////////j4vy/yUd
+ 5v8oIOb/Jx/m/y8n5/9aVOz/p6T1/9rZ+//8/P//////////////////////////////////////////
+ ////////////////////////////////////////+unD/+uqGf+tra3/////////////////////////
+ //////////////////////////////j4/v9sZu7/Jh7m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe
+ 5v9EPen/4N/7//////+dmfT/Jx/m/ykh5v8pIeb/KCDm/yYe5v8sJOb/QTrp/4WA8f/Myvn/8fH9////
+ /////////////87M+f83L+j/ODHo/3558P/Ixvn/8O/9////////////////////////////////////
+ //////////////////////////////////////////////////////////////rqxv/rqBX/ra2t////
+ ////////////////////////////////////////////////////////p6T1/ygg5v8pIeb/KSHm/ykh
+ 5v8pIeb/KB/m/yUd5v8xKef/UUvr/8vJ+f//////0c/6/zoy6P8mHub/Jh7m/zcw6P9bVOz/q6j1/+Tj
+ /P/8+//////////////////////////////6+v7/tbP2/87M+f/7+///////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ///+/Pj/99ye/62trf///////////////////////////////////////////////////////////+bl
+ /P9NRur/Jx/m/ykh5v8mHub/Jh7m/0E66f9taO7/vbv3//Dw/f/9/f////////z8//99ePD/SEHq/3x3
+ 8P/Pzfn/9PT+//7+////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////+tra3/////////////////////////////////////////
+ ////////////////////////hYHx/yIa5f8tJeb/W1Ts/5CM8v/d2/v//Pz/////////////////////
+ ////////4+L8/9jX+v/v7v3/9PT+//79////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////ra2t////////////////////
+ /////////////////////////////////////////////8zK+f9/evD/s7D2//Hx/f//////////////
+ ////////9PP+/9TT+v+cmPP/l5Pz/42J8v9TTev/SkPq/1VO6/+Pi/L/l5Pz/5+b9P/Y1/r/9vX+////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////////62t
+ rf/////////////////////////////////////////////////////////////////7+///+vr+////
+ //////////////7+///j4vz/mJXz/2Jc7f83MOj/Jx/m/yUd5v8lHeb/Jx7m/ycf5v8mHub/JR3m/yUd
+ 5v8oIOb/OTHo/2di7f+FgPH/y8n5//v6/v//////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //////////////////+tra3/////////////////////////////////////////////////////////
+ /////////////////////////v7//+Ph/P+VkfP/R0Dp/ycf5v8mHub/KCDm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8mHub/JR3m/zYu6P95dO//5OP8//7+////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////ra2t////////////////////////////////////
+ /////////////////////////////////////////v7//7Ct9v9GP+n/KB/m/ycf5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/Jx/m/0xF
+ 6v+dmfT/8fD9////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////62trf//////////////
+ ////////////////////////////////////////////////////////7Oz9/4qG8f83MOj/Jh7m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8nH+b/KCDm/3x38P/y8v7/////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //+tra3/////////////////////////////////////////////////////////////////7ez9/3Fr
+ 7v8mHub/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8mHub/JR3m/yUd5v8lHeb/JR3m/yUd
+ 5v8nHub/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/d3Lv/9rY+///////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////ra2t////////////////////////////////////////////////////
+ ////////7Oz9/3Fs7v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/yYe5v82Luf/W1Xs/4eD
+ 8f+HgvH/h4Lx/4eC8f+GgvH/VlDr/zQs5/8mHub/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYd
+ 5v9TTOv/6un9////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////62trf//////////////////////////////
+ ////////////////////////+fn+/3hz7/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/KSHm/1BJ
+ 6/+WkvP/zsz5//Hx/f///////////////////////////+/v/f/Jx/n/ko7y/0tE6v8oIOb/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KiLm/3x38P/y8v7/////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////+tra3/////////
+ /////////////////////////////////////////v7//66r9v8yKuf/KCDm/ykh5v8pIeb/KSHm/ykh
+ 5v8mHub/NS7n/52a9P/q6f3//v7///////////////////////////////////////////////////7+
+ ///m5fz/mpbz/0hB6v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8oH+b/jIjy////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////ra2t/////////////////////////////////////////////////8/O+f85Muj/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8oIOb/U03r/7Wy9v/9/f//////////////////////////////////////////
+ ///////////////////////////////////Y1vr/Ukzr/yYe5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zoz
+ 6P/Bv/j/////////////////////////////////////////////////////////////////////////
+ /////////////////////////////62trf////////////////////////////////////////////v7
+ //96dvD/Jh7m/ykh5v8pIeb/KSHm/ykh5v8mHub/TEbq/9/e+///////////////////////////////
+ /////////////////////////////////////////////////////////////9jW+v9STOv/Jh7m/ykh
+ 5v8pIeb/KSHm/ykh5v8lHeb/ZF7t//X1/v//////////////////////////////////////////////
+ //////////////////////////////////////////////////+tra3/////////////////////////
+ ///////////////////OzPn/ODHo/ygg5v8pIeb/KSHm/ykh5v8oIOb/NS7n/6+s9v//////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////2Nb6/09J6v8nH+b/KSHm/ykh5v8pIeb/KCDm/y8o5/+7uPf/////////////////////////
+ ////////////////////////////////////////////////////////////////////////ra2t////
+ ///////////////////////////////////7+///enXv/yYe5v8pIeb/KSHm/ykh5v8pIeb/KCDm/5SQ
+ 8v////////////////////////////////////////////b29//t7e3/7e3u/+3t7v/4+Pj/////////
+ //////////////////////////////////+tqvX/KyTm/ykh5v8pIeb/KSHm/ykh5v8mHub/aGLt//r5
+ /v//////////////////////////////////////////////////////////////////////////////
+ /////////////62trf//////////////////////////////////////7+/9/0tE6v8nH+b/KSHm/ykh
+ 5v8pIeb/Jx/m/0hB6v/h4Pz/////////////////////////////////+Pj4/8TExv9ub3T/SElP/0lK
+ UP9JSU//c3N4/62usP/4+Pj/////////////////////////////////7+79/1hS7P8mHub/KSHm/ykh
+ 5v8pIeb/KB/m/z846f/a2fv/////////////////////////////////////////////////////////
+ //////////////////////////////////+tra3//////////////////////////////////////8jG
+ +f81Lef/KCDm/ykh5v8pIeb/KSHm/y4m5/+zsfb/////////////////////////////////9vb2/4qL
+ j/8zNDr/KCkw/ykqMf8pKjH/KSox/ycoL/8wMTf/dXV6/93e3///////////////////////////////
+ //+sqfX/LCTm/ykh5v8pIeb/KSHm/ykh5v8pIeb/qqf1////////////////////////////////////
+ ////////////////////////////////////////////////////////ra2t////////////////////
+ //////////////////+SjvL/Jh7m/ykh5v8pIeb/KSHm/ygg5v84MOj/2Nf6////////////////////
+ ////////9vb2/4mKjf8sLTT/Kisy/yssM/8rLDP/Kywz/yssM/8rLDP/Kisy/yYnLv9mZ2z/9PT1////
+ ////////////////////////7u39/1FL6/8mHub/KSHm/ykh5v8pIeb/JR3m/29q7v/+/v//////////
+ /////////////////////////////////////////////////////////////////////////////62t
+ rf/////////////////////////////////6+v7/X1ns/yYe5v8pIeb/KSHm/ykh5v8mHeb/Y13t//j3
+ /v///////////////////////////6usrv8tLjX/Kisy/yssM/8rLDP/Kywz/yssM/8rLDP/Kywz/yss
+ M/8rLDP/LzA3/52doP////////////////////////////////+HgvH/Jx/m/ykh5v8pIeb/KSHm/yUd
+ 5v9taO7//v7/////////////////////////////////////////////////////////////////////
+ //////////////////+tra3/////////////////////////////////+vr+/19Z7P8mHub/KSHm/ykh
+ 5v8pIeb/Jh7m/4B88P////////////////////////////n5+f9iYmj/KCkw/yssM/8rLDP/Kywz/yss
+ M/8rLDP/Kywz/yssM/8rLDP/Kywz/ygpMP9bXGH/8/Pz////////////////////////////sa72/ygg
+ 5v8pIeb/KSHm/ykh5v8nH+b/SkPq/+Xk/P//////////////////////////////////////////////
+ ////////////////////////////////////////ra2t//////////////////////////////////f3
+ /v9cVuz/Jh7m/ykh5v8pIeb/KSHm/ysj5v+9u/f////////////////////////////T09X/OjtC/yor
+ Mv8rLDP/Kisy/ykqMf8rLDP/Kywz/yssM/8rLDP/Kywz/yssM/8rLDP/NTY9/9PT1f//////////////
+ /////////////7Gu9v8oIOb/KSHm/ykh5v8pIeb/KSDm/zIr5//U0/r/////////////////////////
+ /////////////////////////////////////////////////////////////62trf//////////////
+ ///////////////////Y1vr/PTbo/ygg5v8pIeb/KSHm/ykh5v8rI+b/wL34////////////////////
+ ////////xMTG/y0uNf8rLDP/Kisy/zQ1PP9CQ0n/LS41/yssM/8rLDP/Kywz/yssM/8rLDP/Kywz/zM0
+ O//S0tP///////////////////////////+xrvb/KCDm/ykh5v8pIeb/KSHm/ygg5v8zLOf/1dT6////
+ ////////////////////////////////////////////////////////////////////////////////
+ //+tra3/////////////////////////////////9fT+/1pU7P8mHub/KSHm/ykh5v8pIeb/KyPm/7+8
+ +P///////////////////////////8XGx/8vMDb/Kywz/ywtNP+io6b/1NTV/zs8Q/8qKzL/Kywz/yss
+ M/8rLDP/Kywz/yssM/8yMzr/0dHT////////////////////////////sa72/ygg5v8pIeb/KSHm/ykh
+ 5v8oIOb/Myzn/9XU+v//////////////////////////////////////////////////////////////
+ //////////////7//v/9/v3/ra2t//////////////////////////////////r6/v9fWez/Jh7m/ykh
+ 5v8pIeb/KSHm/ycf5v+GgfH////////////////////////////p6er/TU1T/ygpMf8rLDP/e3yA/6mp
+ rP83OD//Kisy/yssM/8rLDP/Kywz/yssM/8qKzL/REVL/+Dg4f///////////////////////////7Gu
+ 9v8oIOb/KSHm/ykh5v8pIeb/KCDm/zYv6P/X1vr/////////////////////////////////////////
+ ///////////////////////////////////V6MP/gblL/62trf//////////////////////////////
+ ///19P7/WlPs/yYe5v8pIeb/KSHm/ykh5v8lHeb/bGbu//7+/////////////////////////f39/4aH
+ i/8rLDP/Kywz/yorMv8sLTT/Kywz/yssM/8rLDP/Kywz/yssM/8rLDP/Jicu/3Jyd//+/v7/////////
+ //////////////////+NifL/Jx/m/ykh5v8pIeb/KSHm/yYe5v9iXO3/9vb+////////////////////
+ ////////////////////////////////////////////////////////2erJ/1miGP+tra3/////////
+ ////////////////////////vrz3/zIq5/8pIeb/KSHm/ykh5v8pIeb/Jx/m/01G6v/n5vz/////////
+ ///////////////////q6uv/VFRa/ygpMP8rLDP/Kywz/yssM/8rLDP/Kywz/yssM/8rLDP/KCkw/1FS
+ WP/V1df////////////////////////////6+v7/Xljs/yYe5v8pIeb/KSHm/ykh5v8lHeb/bmju//7+
+ //////////////////////////////////////////////////////////////////////////////v9
+ +f/C3aj/ra2t/////////////////////////////////3hz7/8lHeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8uJuf/vbv3/////////////////////////////////8zMzv9JSlD/Jygv/yorMv8rLDP/Kywz/yss
+ M/8qKzL/Jicv/1FSWP/V1df/////////////////////////////////1dT6/z026P8oIOb/KSHm/ykh
+ 5v8pIeb/KSHm/6Wi9P//////////////////////////////////////////////////////////////
+ /////////////////////////////62trf///////////////////////////93c+/9EPen/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/Jh7m/2tl7v/39v7/////////////////////////////////z8/R/2ts
+ cf88PUP/Kisy/ygpMP8nKDD/Njc+/3JzeP/X19j//////////////////////////////////f3//4J9
+ 8P8mHub/KSHm/ykh5v8pIeb/KSHm/y8n5//Fw/j/////////////////////////////////////////
+ //////////////////////////////////////////////////+tra3/////////////////////////
+ //+NifL/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8yKuf/wb/4////////////////////
+ ///////////////////29vb/2trb/6Ojpv+cnaD/nJ2g/8fHyf/4+Pn/////////////////////////
+ /////////////9TS+v88Nej/KCDm/ykh5v8pIeb/KSHm/yYe5v9RSuv/8O/9////////////////////
+ ////////////////////////////////////////////////////////////////////////ra2t////
+ ///////////////////r6v3/SULq/ycf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jh7m/2Fb
+ 7f/n5vz/////////////////////////////////////////////////////////////////////////
+ //////////////////////////////Ly/v9kXu3/Jx/m/ykh5v8pIeb/KSHm/ykh5v8nH+b/jYny////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////62trf//////////////////////1tT6/0dA6v8mHub/Jh7m/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8mHub/eHLv//v7////////////////////////////////////////////////
+ //////////////////////////////////////////////r6/v+Xk/P/LSXm/ygg5v8pIeb/KSHm/ykh
+ 5v8nH+b/Qjvp/9zb+///////////////////////////////////////////////////////////////
+ //////////////////////////////////+tra3///////////////////////39///Z1/v/mpbz/1tV
+ 7P8sJeb/Jh7m/ygg5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zMs5/+IhPH/5+b8////////////////////
+ //////////////////////////////////////////////////////////////r6/v+YlPP/Libn/ygg
+ 5v8pIeb/KSHm/ykh5v8pIeb/Libn/6mm9f/+/v//////////////////////////////////////////
+ ////////////////////////////////////////////////////////ra2t////////////////////
+ ///////////////////v7v3/u7n3/3558P85Muj/Jx/m/ykh5v8pIeb/KSHm/ykh5v8oIOb/JR3m/2Vg
+ 7f/T0fr//Pz//////////////////////////////////////////////////////////////////9/d
+ +/92ce//Lyfn/ygg5v8pIeb/KSHm/ykh5v8pIeb/JR3m/11X7P/x8f3/////////////////////////
+ /////////////////////////////////////////////////////////////////////////////62t
+ rf/////////////////////////////////////////////////8/P//09H6/19Z7P8mHub/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8nH+b/OTLo/3148P/R0Pr/9fT+////////////////////////////////////
+ ///5+f7/5eT8/52Z9P9KROr/Jh7m/ygg5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/0A56f/Dwfj/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //////////////////+tra3/////////////////////////////////////////////////////////
+ ///Dwfj/OjPo/ycf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8mHub/OTHo/19Z7P+UkPL/u7j3/+Lg
+ /P/g3/v/4eD8/7Wy9v+Xk/P/dnHv/0M86f8pIeb/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jh7m/0A5
+ 6f/Cv/j/////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////ra2t////////////////////////////////////
+ /////////////////////////////7e09/85Muj/Jh3m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg
+ 5v8mHub/JR3m/zAo5/87NOj/OzTo/zs06P8uJuf/JR3m/yYe5v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jx/m/zkx6P+lovT/////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////62trf//////////////
+ ////////////////////////////////////////////////////////u7n3/1VP6/8nH+b/KCDm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/KCDm/ygg5v8oIOb/KSDm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/JR3m/0A46f/Cv/j//f3/////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //+tra3/////////////////////////////////////////////////////////////////////////
+ ///n5vz/bGbu/y4m5/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/KCDm/2Re7f/Ixvn/////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////ra2t////////////////////////////////////////////////////
+ //////////////////////////////T0/v+lofT/RD3p/ycf5v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ycf5v8oIOb/SkPq/5qW8//s7P3/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////62trf//////////////////////////////
+ /////////////////////////////////////////////////////////v7//+Hg/P+UkPL/R0Dq/zMr
+ 5/8pIOb/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/y8n5/9MRer/m5fz/+bl
+ /P/+/v//////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////+tra3/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////+Df+//Ixvn/hYDx/0U+6f8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/Mirn/29q
+ 7v+zsfb/5eT8////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+
+
+
+
+ AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAAMMOAADDDgAAAAAAAAAA
+ AACtra3/////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////7+
+ //95dO//JR3m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ycf5v+alvP/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////ra2t////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////x8X4/zUu5/8oIOb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8mHub/Xljs//f3/v//////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////62trf//////////////////////////////
+ ///////////////////////////////////////////////////y8f3/r6z2/6ai9f+mo/X/pqP1/6aj
+ 9f+mo/X/pqP1/6aj9f+mo/X/paL0/7+89//7+/////////X1/v9ZU+z/Jh7m/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zUu5//Hxfn/////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////+tra3/////////
+ ////////////////////////////////////////////////////////////////////////+fn+/3Jt
+ 7/8kHOX/Jx/m/ycf5v8nH+b/Jx/m/ycf5v8nH+b/Jx/m/yUd5v88Nej/3t37////////////o6D0/ysj
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8lHeb/fHfw////////////////////
+ ///////////////////////////////////////////////////////////////////////////////+
+ /P/88tz/ra2t////////////////////////////////////////////////////////////////////
+ //////////////////+8uvf/KyPm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KiLm/6Sh
+ 9P///////////+Tj/P9BOun/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/0lC
+ 6v/k4/z/////////////////////////////////////////////////////////////////////////
+ ///////////////////++vL/77tE/62trf//////////////////////////////////////////////
+ ////////////////////////////////////////6+r9/1NN6/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/yYe5v9UTev/8O/9///////8+///fXjw/yce5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8oIOb/l5Pz////////////////////////////////////////////////////
+ /////////////////////////////////////////vrx/+62OP+tra3///////////////////////n5
+ /v+sqfX/kIzy/5GN8v+RjfL/kY3y/5GN8v+RjfL/kY3y/5GM8v+emvT/8/L+//////+bl/P/Jh7m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/NCzn/8fF+P///////////8rI+f8xKef/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx7m/01H6v/u7f3/////////////////////////
+ //////////////////////////////////////////////////////////////768f/utjj/ra2t////
+ ////////////////////////nJjz/yYe5v8lHeb/JR3m/yUd5v8lHeb/JR3m/yUd5v8kHOX/LCXm/7m2
+ 9///////0tD6/zs06P8oIOb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe5v9zbe//+/v/////
+ ///v7/3/WlTs/yYe5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8xKef/vbv3////
+ ////////////////////////////////////////////////////////////////////////////////
+ ///++vH/7rY4/62trf///////////////////////////97c+/88NOj/KCDm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/yYe5v9lX+3/+fj+//39//94c+//JR3m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8nH+b/RT7p/+Lh/P///////////6qn9f8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jh3m/2pk7v/6+v7/////////////////////////////////////////////////////////
+ /////////////////////////vrx/+62OP+tra3////////////////////////////7+/7/eXTv/yce
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/Pjbo/9jX+v//////sa72/y0l5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v+Xk/P////////////a2fv/QDjp/ygg5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ycf5v9AOen/3Nr7////////////////////////////////////
+ //////////////////////////////////////////////768f/utjj/ra2t////////////////////
+ /////////////8PA+P8tJuf/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe5v+Ig/H///////Dw
+ /f9ZU+z/Jh7m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8mHub/Xljs//X0/v///////v7//4aC
+ 8f8mHub/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx7m/4yI8v//////////////
+ ///////////////////////////////////////////////////////////////////++vH/7rY4/62t
+ rf/////////////////////////////////t7f3/VlDr/ycf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8mHub/VE7r/+7t/f//////jYny/yYe5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/zAo
+ 5/+8uff///////////+9u/f/Lyjn/ygg5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe
+ 5v9YUuv/8PD9////////////////////////////////////////////////////////////////////
+ /////////vrx/+62OP+tra3//////////////////////////////////////6Ke9P8nH+b/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ysk5v+sqfX//////9zb+/9BOun/KB/m/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8lHeb/fnnw//7+////////9fX+/2Vf7f8mHub/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/LSXm/7Gu9v//////////////////////////////////////////////
+ //////////////////////////////768f/utjj/ra2t////////////////////////////////////
+ ///W1Pr/PTbo/ygf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8lHeb/cm3v//v7///7+///a2Xu/yYd
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/0I76f/b2fv///////////+5tvf/Libn/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yUd5v93cu///Pz/////////////////////
+ ///////////////////////////////////////////////////++vH/7rY4/62trf//////////////
+ /////////////////////////f3//4R/8f8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zkx
+ 6P/OzPn//////7279/8xKef/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/oJz0////
+ ////////5eT8/0dB6v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/OzTo/9LQ
+ +v///////////////////////////////////////////////////////////////////////vrx/+62
+ OP+tra3////////////////////////////////////////////S0Pr/Ni7o/ygg5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8mHub/k4/y///////v7/3/T0jq/yYe5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jh7m/11X7P/x8P3///////////+VkfP/KB/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/yYe5v+ZlfP/////////////////////////////////////////////////////////
+ //////////////768f/utjj/ra2t////////////////////////////////////////////8/L+/2Ba
+ 7P8mHub/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/1BK6//o6Pz//////5iU8/8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8tJuf/wb74////////////zsz5/zQs5/8oIOb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/VE3r/+vq/f//////////////////////////////
+ ///////////////////////////////////++vH/7rU4/62trf//////////////////////////////
+ //////////////////+ysPb/KyPm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8qIub/tbP2////
+ ///a2fv/OTLo/ygg5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx7m/4B78P/9/f////////n5
+ /v9wa+7/Jh7m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KCDm/ygg5v+3tPf/////////
+ /////////////////////////////////////////////////////////vv1//PMc/+tra3/////////
+ ////////////////////////////////////////4N/7/0Q96f8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jh7m/3Br7v/5+f7/+fn+/3Jt7/8mHub/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg
+ 5v88NOj/29n7////////////sa72/yoi5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/JR3m/y8o
+ 5/9jXe3/urf3////////////////////////////////////////////////////////////////////
+ ////////ra2t//////////////////////////////////////////////////////+Pi/L/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v81Lef/09H6//////++vPf/LCXm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/6Og9P///////////+jo/P9RSuv/Jx/m/ykh5v8pIeb/KSHm/yce
+ 5v8oIOb/QDnp/4SA8f+8uvf/9PT+////////////////////////////////////////////////////
+ /////////////////////v7/+ea6/62trf//////////////////////////////////////////////
+ ////////xsT4/zIq5/8oIOb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KCDm/5aS8///////6un9/1FK
+ 6/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/Jx/m/y8n5/99efD/9vb+////////////j4vy/yUd
+ 5v8oIOb/Jx/m/y8n5/9aVOz/p6T1/9rZ+//8/P//////////////////////////////////////////
+ ////////////////////////////////////////+unD/+uqGf+tra3/////////////////////////
+ //////////////////////////////j4/v9sZu7/Jh7m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYe
+ 5v9EPen/4N/7//////+dmfT/Jx/m/ykh5v8pIeb/KCDm/yYe5v8sJOb/QTrp/4WA8f/Myvn/8fH9////
+ /////////////87M+f83L+j/ODHo/3558P/Ixvn/8O/9////////////////////////////////////
+ //////////////////////////////////////////////////////////////rqxv/rqBX/ra2t////
+ ////////////////////////////////////////////////////////p6T1/ygg5v8pIeb/KSHm/ykh
+ 5v8pIeb/KB/m/yUd5v8xKef/UUvr/8vJ+f//////0c/6/zoy6P8mHub/Jh7m/zcw6P9bVOz/q6j1/+Tj
+ /P/8+//////////////////////////////6+v7/tbP2/87M+f/7+///////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ///+/Pj/99ye/62trf///////////////////////////////////////////////////////////+bl
+ /P9NRur/Jx/m/ykh5v8mHub/Jh7m/0E66f9taO7/vbv3//Dw/f/9/f////////z8//99ePD/SEHq/3x3
+ 8P/Pzfn/9PT+//7+////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////+tra3/////////////////////////////////////////
+ ////////////////////////hYHx/yIa5f8tJeb/W1Ts/5CM8v/d2/v//Pz/////////////////////
+ ////////4+L8/9jX+v/v7v3/9PT+//79////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////ra2t////////////////////
+ /////////////////////////////////////////////8zK+f9/evD/s7D2//Hx/f//////////////
+ ////////9PP+/9TT+v+cmPP/l5Pz/42J8v9TTev/SkPq/1VO6/+Pi/L/l5Pz/5+b9P/Y1/r/9vX+////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////////62t
+ rf/////////////////////////////////////////////////////////////////7+///+vr+////
+ //////////////7+///j4vz/mJXz/2Jc7f83MOj/Jx/m/yUd5v8lHeb/Jx7m/ycf5v8mHub/JR3m/yUd
+ 5v8oIOb/OTHo/2di7f+FgPH/y8n5//v6/v//////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //////////////////+tra3/////////////////////////////////////////////////////////
+ /////////////////////////v7//+Ph/P+VkfP/R0Dp/ycf5v8mHub/KCDm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8mHub/JR3m/zYu6P95dO//5OP8//7+////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////ra2t////////////////////////////////////
+ /////////////////////////////////////////v7//7Ct9v9GP+n/KB/m/ycf5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/Jx/m/0xF
+ 6v+dmfT/8fD9////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////62trf//////////////
+ ////////////////////////////////////////////////////////7Oz9/4qG8f83MOj/Jh7m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8nH+b/KCDm/3x38P/y8v7/////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //+tra3/////////////////////////////////////////////////////////////////7ez9/3Fr
+ 7v8mHub/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8mHub/JR3m/yUd5v8lHeb/JR3m/yUd
+ 5v8nHub/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/d3Lv/9rY+///////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////ra2t////////////////////////////////////////////////////
+ ////////7Oz9/3Fs7v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/yYe5v82Luf/W1Xs/4eD
+ 8f+HgvH/h4Lx/4eC8f+GgvH/VlDr/zQs5/8mHub/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/yYd
+ 5v9TTOv/6un9////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////62trf//////////////////////////////
+ ////////////////////////+fn+/3hz7/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/KSHm/1BJ
+ 6/+WkvP/zsz5//Hx/f///////////////////////////+/v/f/Jx/n/ko7y/0tE6v8oIOb/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KiLm/3x38P/y8v7/////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////+tra3/////////
+ /////////////////////////////////////////v7//66r9v8yKuf/KCDm/ykh5v8pIeb/KSHm/ykh
+ 5v8mHub/NS7n/52a9P/q6f3//v7///////////////////////////////////////////////////7+
+ ///m5fz/mpbz/0hB6v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8oH+b/jIjy////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////ra2t/////////////////////////////////////////////////8/O+f85Muj/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8oIOb/U03r/7Wy9v/9/f//////////////////////////////////////////
+ ///////////////////////////////////Y1vr/Ukzr/yYe5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zoz
+ 6P/Bv/j/////////////////////////////////////////////////////////////////////////
+ /////////////////////////////62trf////////////////////////////////////////////v7
+ //96dvD/Jh7m/ykh5v8pIeb/KSHm/ykh5v8mHub/TEbq/9/e+///////////////////////////////
+ /////////////////////////////////////////////////////////////9jW+v9STOv/Jh7m/ykh
+ 5v8pIeb/KSHm/ykh5v8lHeb/ZF7t//X1/v//////////////////////////////////////////////
+ //////////////////////////////////////////////////+tra3/////////////////////////
+ ///////////////////OzPn/ODHo/ygg5v8pIeb/KSHm/ykh5v8oIOb/NS7n/6+s9v//////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////2Nb6/09J6v8nH+b/KSHm/ykh5v8pIeb/KCDm/y8o5/+7uPf/////////////////////////
+ ////////////////////////////////////////////////////////////////////////ra2t////
+ ///////////////////////////////////7+///enXv/yYe5v8pIeb/KSHm/ykh5v8pIeb/KCDm/5SQ
+ 8v////////////////////////////////////////////b29//t7e3/7e3u/+3t7v/4+Pj/////////
+ //////////////////////////////////+tqvX/KyTm/ykh5v8pIeb/KSHm/ykh5v8mHub/aGLt//r5
+ /v//////////////////////////////////////////////////////////////////////////////
+ /////////////62trf//////////////////////////////////////7+/9/0tE6v8nH+b/KSHm/ykh
+ 5v8pIeb/Jx/m/0hB6v/h4Pz/////////////////////////////////+Pj4/8TExv9ub3T/SElP/0lK
+ UP9JSU//c3N4/62usP/4+Pj/////////////////////////////////7+79/1hS7P8mHub/KSHm/ykh
+ 5v8pIeb/KB/m/z846f/a2fv/////////////////////////////////////////////////////////
+ //////////////////////////////////+tra3//////////////////////////////////////8jG
+ +f81Lef/KCDm/ykh5v8pIeb/KSHm/y4m5/+zsfb/////////////////////////////////9vb2/4qL
+ j/8zNDr/KCkw/ykqMf8pKjH/KSox/ycoL/8wMTf/dXV6/93e3///////////////////////////////
+ //+sqfX/LCTm/ykh5v8pIeb/KSHm/ykh5v8pIeb/qqf1////////////////////////////////////
+ ////////////////////////////////////////////////////////ra2t////////////////////
+ //////////////////+SjvL/Jh7m/ykh5v8pIeb/KSHm/ygg5v84MOj/2Nf6////////////////////
+ ////////9vb2/4mKjf8sLTT/Kisy/yssM/8rLDP/Kywz/yssM/8rLDP/Kisy/yYnLv9mZ2z/9PT1////
+ ////////////////////////7u39/1FL6/8mHub/KSHm/ykh5v8pIeb/JR3m/29q7v/+/v//////////
+ /////////////////////////////////////////////////////////////////////////////62t
+ rf/////////////////////////////////6+v7/X1ns/yYe5v8pIeb/KSHm/ykh5v8mHeb/Y13t//j3
+ /v///////////////////////////6usrv8tLjX/Kisy/yssM/8rLDP/Kywz/yssM/8rLDP/Kywz/yss
+ M/8rLDP/LzA3/52doP////////////////////////////////+HgvH/Jx/m/ykh5v8pIeb/KSHm/yUd
+ 5v9taO7//v7/////////////////////////////////////////////////////////////////////
+ //////////////////+tra3/////////////////////////////////+vr+/19Z7P8mHub/KSHm/ykh
+ 5v8pIeb/Jh7m/4B88P////////////////////////////n5+f9iYmj/KCkw/yssM/8rLDP/Kywz/yss
+ M/8rLDP/Kywz/yssM/8rLDP/Kywz/ygpMP9bXGH/8/Pz////////////////////////////sa72/ygg
+ 5v8pIeb/KSHm/ykh5v8nH+b/SkPq/+Xk/P//////////////////////////////////////////////
+ ////////////////////////////////////////ra2t//////////////////////////////////f3
+ /v9cVuz/Jh7m/ykh5v8pIeb/KSHm/ysj5v+9u/f////////////////////////////T09X/OjtC/yor
+ Mv8rLDP/Kisy/ykqMf8rLDP/Kywz/yssM/8rLDP/Kywz/yssM/8rLDP/NTY9/9PT1f//////////////
+ /////////////7Gu9v8oIOb/KSHm/ykh5v8pIeb/KSDm/zIr5//U0/r/////////////////////////
+ /////////////////////////////////////////////////////////////62trf//////////////
+ ///////////////////Y1vr/PTbo/ygg5v8pIeb/KSHm/ykh5v8rI+b/wL34////////////////////
+ ////////xMTG/y0uNf8rLDP/Kisy/zQ1PP9CQ0n/LS41/yssM/8rLDP/Kywz/yssM/8rLDP/Kywz/zM0
+ O//S0tP///////////////////////////+xrvb/KCDm/ykh5v8pIeb/KSHm/ygg5v8zLOf/1dT6////
+ ////////////////////////////////////////////////////////////////////////////////
+ //+tra3/////////////////////////////////9fT+/1pU7P8mHub/KSHm/ykh5v8pIeb/KyPm/7+8
+ +P///////////////////////////8XGx/8vMDb/Kywz/ywtNP+io6b/1NTV/zs8Q/8qKzL/Kywz/yss
+ M/8rLDP/Kywz/yssM/8yMzr/0dHT////////////////////////////sa72/ygg5v8pIeb/KSHm/ykh
+ 5v8oIOb/Myzn/9XU+v//////////////////////////////////////////////////////////////
+ //////////////7//v/9/v3/ra2t//////////////////////////////////r6/v9fWez/Jh7m/ykh
+ 5v8pIeb/KSHm/ycf5v+GgfH////////////////////////////p6er/TU1T/ygpMf8rLDP/e3yA/6mp
+ rP83OD//Kisy/yssM/8rLDP/Kywz/yssM/8qKzL/REVL/+Dg4f///////////////////////////7Gu
+ 9v8oIOb/KSHm/ykh5v8pIeb/KCDm/zYv6P/X1vr/////////////////////////////////////////
+ ///////////////////////////////////V6MP/gblL/62trf//////////////////////////////
+ ///19P7/WlPs/yYe5v8pIeb/KSHm/ykh5v8lHeb/bGbu//7+/////////////////////////f39/4aH
+ i/8rLDP/Kywz/yorMv8sLTT/Kywz/yssM/8rLDP/Kywz/yssM/8rLDP/Jicu/3Jyd//+/v7/////////
+ //////////////////+NifL/Jx/m/ykh5v8pIeb/KSHm/yYe5v9iXO3/9vb+////////////////////
+ ////////////////////////////////////////////////////////2erJ/1miGP+tra3/////////
+ ////////////////////////vrz3/zIq5/8pIeb/KSHm/ykh5v8pIeb/Jx/m/01G6v/n5vz/////////
+ ///////////////////q6uv/VFRa/ygpMP8rLDP/Kywz/yssM/8rLDP/Kywz/yssM/8rLDP/KCkw/1FS
+ WP/V1df////////////////////////////6+v7/Xljs/yYe5v8pIeb/KSHm/ykh5v8lHeb/bmju//7+
+ //////////////////////////////////////////////////////////////////////////////v9
+ +f/C3aj/ra2t/////////////////////////////////3hz7/8lHeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8uJuf/vbv3/////////////////////////////////8zMzv9JSlD/Jygv/yorMv8rLDP/Kywz/yss
+ M/8qKzL/Jicv/1FSWP/V1df/////////////////////////////////1dT6/z026P8oIOb/KSHm/ykh
+ 5v8pIeb/KSHm/6Wi9P//////////////////////////////////////////////////////////////
+ /////////////////////////////62trf///////////////////////////93c+/9EPen/Jx/m/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/Jh7m/2tl7v/39v7/////////////////////////////////z8/R/2ts
+ cf88PUP/Kisy/ygpMP8nKDD/Njc+/3JzeP/X19j//////////////////////////////////f3//4J9
+ 8P8mHub/KSHm/ykh5v8pIeb/KSHm/y8n5//Fw/j/////////////////////////////////////////
+ //////////////////////////////////////////////////+tra3/////////////////////////
+ //+NifL/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8yKuf/wb/4////////////////////
+ ///////////////////29vb/2trb/6Ojpv+cnaD/nJ2g/8fHyf/4+Pn/////////////////////////
+ /////////////9TS+v88Nej/KCDm/ykh5v8pIeb/KSHm/yYe5v9RSuv/8O/9////////////////////
+ ////////////////////////////////////////////////////////////////////////ra2t////
+ ///////////////////r6v3/SULq/ycf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jh7m/2Fb
+ 7f/n5vz/////////////////////////////////////////////////////////////////////////
+ //////////////////////////////Ly/v9kXu3/Jx/m/ykh5v8pIeb/KSHm/ykh5v8nH+b/jYny////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////62trf//////////////////////1tT6/0dA6v8mHub/Jh7m/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8mHub/eHLv//v7////////////////////////////////////////////////
+ //////////////////////////////////////////////r6/v+Xk/P/LSXm/ygg5v8pIeb/KSHm/ykh
+ 5v8nH+b/Qjvp/9zb+///////////////////////////////////////////////////////////////
+ //////////////////////////////////+tra3///////////////////////39///Z1/v/mpbz/1tV
+ 7P8sJeb/Jh7m/ygg5v8pIeb/KSHm/ykh5v8pIeb/KCDm/zMs5/+IhPH/5+b8////////////////////
+ //////////////////////////////////////////////////////////////r6/v+YlPP/Libn/ygg
+ 5v8pIeb/KSHm/ykh5v8pIeb/Libn/6mm9f/+/v//////////////////////////////////////////
+ ////////////////////////////////////////////////////////ra2t////////////////////
+ ///////////////////v7v3/u7n3/3558P85Muj/Jx/m/ykh5v8pIeb/KSHm/ykh5v8oIOb/JR3m/2Vg
+ 7f/T0fr//Pz//////////////////////////////////////////////////////////////////9/d
+ +/92ce//Lyfn/ygg5v8pIeb/KSHm/ykh5v8pIeb/JR3m/11X7P/x8f3/////////////////////////
+ /////////////////////////////////////////////////////////////////////////////62t
+ rf/////////////////////////////////////////////////8/P//09H6/19Z7P8mHub/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8nH+b/OTLo/3148P/R0Pr/9fT+////////////////////////////////////
+ ///5+f7/5eT8/52Z9P9KROr/Jh7m/ygg5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/0A56f/Dwfj/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //////////////////+tra3/////////////////////////////////////////////////////////
+ ///Dwfj/OjPo/ycf5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg5v8mHub/OTHo/19Z7P+UkPL/u7j3/+Lg
+ /P/g3/v/4eD8/7Wy9v+Xk/P/dnHv/0M86f8pIeb/Jx/m/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jh7m/0A5
+ 6f/Cv/j/////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////ra2t////////////////////////////////////
+ /////////////////////////////7e09/85Muj/Jh3m/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ygg
+ 5v8mHub/JR3m/zAo5/87NOj/OzTo/zs06P8uJuf/JR3m/yYe5v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/Jx/m/zkx6P+lovT/////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////62trf//////////////
+ ////////////////////////////////////////////////////////u7n3/1VP6/8nH+b/KCDm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/KCDm/ygg5v8oIOb/KSDm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/JR3m/0A46f/Cv/j//f3/////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ //+tra3/////////////////////////////////////////////////////////////////////////
+ ///n5vz/bGbu/y4m5/8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8nH+b/KCDm/2Re7f/Ixvn/////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////ra2t////////////////////////////////////////////////////
+ //////////////////////////////T0/v+lofT/RD3p/ycf5v8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh
+ 5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ycf5v8oIOb/SkPq/5qW8//s7P3/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////62trf//////////////////////////////
+ /////////////////////////////////////////////////////////v7//+Hg/P+UkPL/R0Dq/zMr
+ 5/8pIOb/KCDm/ykh5v8pIeb/KSHm/ykh5v8pIeb/KSHm/ykh5v8pIeb/Jx/m/y8n5/9MRer/m5fz/+bl
+ /P/+/v//////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////+tra3/////////
+ ////////////////////////////////////////////////////////////////////////////////
+ /////////////+Df+//Ixvn/hYDx/0U+6f8nH+b/KSHm/ykh5v8pIeb/KSHm/ykh5v8oIOb/Mirn/29q
+ 7v+zsfb/5eT8////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ ////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+
+
+
\ No newline at end of file
diff --git a/packages.config b/packages.config
new file mode 100644
index 0000000..e521d78
--- /dev/null
+++ b/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/serialPortOption.cs b/serialPortOption.cs
new file mode 100644
index 0000000..1054e3d
--- /dev/null
+++ b/serialPortOption.cs
@@ -0,0 +1,156 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Globalization;
+using System.IO;
+using System.IO.Ports;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace FlyDockTool
+{
+ public class SerialPortOption
+ {
+ ///
+ /// 让此类创建一个串口操作的单例类
+ ///
+ public static SerialPortOption Instance; //申明一个EcgDrawing对象,复制Null
+ public static int BufferBytesLength = 0;
+ private Thread _thSerialPortDataRead; //串口数据读取线程
+ public SerialPort DataReadSerialPort;
+ public DateTime SerialTime;
+ private static readonly object LockHelper = new object();
+ public EventHandler dataOutPutShow;
+ public static SerialPortOption CreateInstance()
+ {
+ if (Instance == null)
+ lock (LockHelper)
+ {
+ if (Instance == null)
+ Instance = new SerialPortOption();
+ }
+ return Instance;
+ }
+
+ ///
+ /// 初始化串口
+ ///
+ public void IniserialPortOption()
+ {
+ //数据读取串口 初始化
+ //CcgDataReadSerialPort = new SerialPort(ConfigHelper.EcgDataComPort, 1500000, Parity.None, 8, StopBits.One)
+
+ // string CurrentDevice = ConfigurationManager.AppSettings["CurrentDevice"];//获取设备信息URL
+ string comName= ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[3];
+ int baudRate= int.Parse(ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[4]);
+ string parity1= ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[5];
+ Parity parity = Parity.None;
+ if (parity1.ToUpper()== "NONE")
+ parity= Parity.None;
+ if (parity1.ToUpper() == "EVEN")
+ parity = Parity.Even;
+ int databits= int.Parse(ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[6]);
+ StopBits SB = StopBits.One;
+ string sb1 = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[7];
+ if (sb1== "1")
+ SB = StopBits.One;
+ if (sb1.ToUpper() == "NONE")
+ SB = StopBits.None;
+ if (sb1.ToUpper() == "2")
+ SB = StopBits.Two;
+ DataReadSerialPort = new SerialPort(comName, baudRate, parity, databits, SB)
+ {
+ RtsEnable = false,
+ ReadBufferSize = 4096000,
+ ReadTimeout = 3000,
+ ReceivedBytesThreshold = 1
+ };
+ SerialTime = DateTime.Now;
+ }
+
+ ///
+ /// 下发AD启动指令
+ ///
+ public void writeStartAD_Command()
+ {
+ byte[] EcgStart = { 0xBB, 0x44, 0xAA, 0x55, 0xCC, 0x01, 0x00, 0x00, 0xCB, 0x02 };
+ if (!DataReadSerialPort.IsOpen)
+ DataReadSerialPort.Open();
+ DataReadSerialPort.Write(EcgStart, 0, EcgStart.Length);
+ }
+
+ ///
+ /// 下发AD停止命令
+ ///
+ public void writeStopAD_Command()
+ {
+ byte[] EcgEnd = { 0xBB, 0x44, 0xAA, 0x55, 0x02, 0x00, 0x00, 0xCC, 0x02 };
+ if (!DataReadSerialPort.IsOpen)
+ {
+ DataReadSerialPort.Open();
+ }
+ DataReadSerialPort.Write(EcgEnd, 0, EcgEnd.Length);
+ }
+
+ ///
+ /// 终止串口数据读取的线程
+ ///
+ public void StopDataReadThread()
+ {
+ _thSerialPortDataRead.Abort();
+ }
+
+ ///
+ /// 开启串口数据读取的线程
+ ///
+ public void StartDataReadThread()
+ {
+ _thSerialPortDataRead = new Thread(DataRead)
+ {
+ IsBackground = true,
+ Priority = ThreadPriority.Highest
+ };
+ _thSerialPortDataRead.Start();
+ }
+
+ ///
+ /// 读取串口数据
+ ///
+ private void DataRead()
+ {
+ while (true)
+ {
+ try
+ {
+ if (!DataReadSerialPort.IsOpen)
+ {
+ DataReadSerialPort.Open();
+ }
+ BufferBytesLength = DataReadSerialPort.BytesToRead;
+ if (BufferBytesLength > 0)
+ {
+ var buffer = new byte[BufferBytesLength];
+ DataReadSerialPort.Read(buffer, 0, BufferBytesLength);
+ string encodingStr = "UTF-8";
+ try
+ {
+ encodingStr = ConfigurationManager.AppSettings[apiOptions.CurrentDevice].Split(',')[8];
+ }
+ catch { }
+ string ReDataStr = Encoding.GetEncoding(encodingStr).GetString(buffer);
+ dataOutPutShow(ReDataStr, null);
+ }
+ }
+ catch { }
+ Thread.Sleep(1000);//睡眠1秒
+ }
+ }
+
+
+
+
+ }
+}
\ No newline at end of file