private void m_lsvList_ItemActivate(object sender, System.EventArgs e) { clsDeviceSampleDataKey objKey = (clsDeviceSampleDataKey)this.m_lsvList.SelectedItems[0].Tag; clsDeviceReslutVO[] objDeviceResultArr = null; this.m_objController.m_mthGetDeviceData(objKey.strDeviceID, objKey.strDeviceSampleID, objKey.strCheckDate, objKey.intResultBeginIndex, objKey.intResultEndIndex, out objDeviceResultArr); if (objDeviceResultArr != null) { this.m_mthShowMessage(false, objKey, objDeviceResultArr); } }
public void m_mthShowWithSample(clsDeviceSampleDataKey p_objKey) { if (p_objKey == null) { return; } for (int i = 0; i < this.m_lsvList.Items.Count; i++) { if (this.m_lsvList.Items[i].Tag.ToString() == p_objKey.ToString()) { this.m_lsvList.Items[i].Focused = true; this.m_lsvList.Items[i].EnsureVisible(); this.m_lsvList.Items[i].Selected = true; m_lsvList_ItemActivate(this.m_lsvList, null); break; } } }
public void m_mthShowMessage(bool p_blnAdd, clsDeviceSampleDataKey p_objDSDKey, object[] p_objResultVOArr) { string strCommingDate; if (p_blnAdd) { ListViewItem lvi = new ListViewItem(p_objDSDKey.strDeviceName); lvi.SubItems.Add(p_objDSDKey.strDeviceSampleID); lvi.SubItems.Add(p_objDSDKey.strCheckDate); this.m_lsvList.Items.Add(lvi); lvi.Selected = true; lvi.Focused = true; lvi.EnsureVisible(); lvi.Tag = p_objDSDKey; strCommingDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); p_objDSDKey.strCommingDateTime = strCommingDate; } else { strCommingDate = p_objDSDKey.strCommingDateTime; } string strSeq; string strItemName; string strResult; string strFlag; string strRefrange; this.m_txtWindow.Clear(); m_txtWindow.AppendText("Device data comming in " + strCommingDate + " ......\r\n"); m_txtWindow.AppendText("Device Name: " + p_objDSDKey.strDeviceName + " Device Sample ID: " + p_objDSDKey.strDeviceSampleID + " CheckDate: " + p_objDSDKey.strCheckDate + "\r\n\r\n"); m_txtWindow.AppendText("Seq. ItemName Result Flag ReferanceRange\r\n"); m_txtWindow.AppendText("--------------------------------------------------------------------------\r\n"); for (int i = 0; i < p_objResultVOArr.Length; i++) //clsLIS_Device_Test_ResultVO[] { strSeq = i.ToString().PadRight(8); if (p_objResultVOArr[i] is clsLIS_Device_Test_ResultVO) { clsLIS_Device_Test_ResultVO objTestResult = (clsLIS_Device_Test_ResultVO)p_objResultVOArr[i]; strItemName = objTestResult.strDevice_Check_Item_Name; if (strItemName != null) { strItemName = strItemName.PadRight(20); } else { strItemName = " "; } if (objTestResult.strResult != null) { strResult = objTestResult.strResult.PadRight(12); } else { strResult = " "; } if (objTestResult.strAbnormal_Flag != null) { strFlag = objTestResult.strAbnormal_Flag.PadRight(8); } else { strFlag = " "; } strRefrange = objTestResult.strRefRange; } else { clsDeviceReslutVO objResult = (clsDeviceReslutVO)p_objResultVOArr[i]; strItemName = objResult.m_strDeviceCheckItemName; if (strItemName != null) { strItemName = strItemName.PadRight(20); } else { strItemName = " "; } if (objResult.m_strResult != null) { strResult = objResult.m_strResult.PadRight(12); } else { strResult = " "; } if (objResult.m_strAbnormalFlag != null) { strFlag = objResult.m_strAbnormalFlag.PadRight(8); } else { strFlag = " "; } strRefrange = objResult.m_strRefRange; } m_txtWindow.AppendText(strSeq); m_txtWindow.AppendText(strItemName); m_txtWindow.AppendText(strResult); m_txtWindow.AppendText(strFlag); m_txtWindow.AppendText(strRefrange + "\r\n"); } m_txtWindow.AppendText("--------------------------------------------------------------------------\r\n"); if ((!this.Visible) || (this.WindowState == FormWindowState.Minimized)) { // frmMessageNotify frm = new frmMessageNotify(); // frm.m_frmRealWindow = this; // frm.m_lblDevice.Text = p_objDSDKey.strDeviceName; // frm.m_lnkDeviceSample.Text = p_objDSDKey.strDeviceSampleID; // frm.TopMost = true; // frm.m_objKey = p_objDSDKey; // frm.Show(); } else { // this.Show(); this.Activate(); } }
/// <summary> /// 调用仪器的数据解析文件解析数据,然后将数据入库同时实时显示数据 xing.chen添加注释 /// </summary> /// <param name="objDataAnalyzer">解析文件类对象</param> /// <param name="strData_Received">接收的数据</param> /// <param name="strInstrument_ID">仪器id</param> /// <param name="strInstrument_Name">仪器名</param> public void DigitalSerial_DataComing(com.digitalwave.iCare.middletier.LIS.infLISDataAnalysis objDataAnalyzer, string strData_Received, string strInstrument_ID, string strInstrument_Name) { try { if (objDataAnalyzer != null) { string[] strIntactDataList = objDataAnalyzer.strGetIntactData(strData_Received); if (strIntactDataList != null) { for (int j = 0; j < strIntactDataList.Length; j++) { string strIntactData = strIntactDataList[j]; System.Collections.ArrayList arlResult = null; //xing.chen add test code testLog.Log2File(@"D:\logInfo.txt", "Data Analysis", DateTime.Now.ToLongTimeString()); ////testLog.Log2File(@"D:\code\log.txt", strIntactData, DateTime.Now.ToLongTimeString()); //testLog.Log2File(@"D:\logInfo.txt", strIntactData, DateTime.Now.ToLongTimeString()); long lngRes = objDataAnalyzer.lngDataAnalysis(strIntactData, out arlResult); // int z=0; // while(z<arlResult.Count) // { // if(((clsLIS_Device_Test_ResultVO)arlResult[z]).intIsGraphResult == 1) // { // arlResult.RemoveAt(z); // } // else // { // z++; // } // } com.digitalwave.iCare.ValueObject.clsLIS_Device_Test_ResultVO[] colDevice_Test_Results = (clsLIS_Device_Test_ResultVO[])arlResult.ToArray(typeof(com.digitalwave.iCare.ValueObject.clsLIS_Device_Test_ResultVO)); if (arlResult != null) { try { //string str = arlResult.Count.ToString() + " 123"; //testLog.Log2File(@"D:\logInfo.txt", str, DateTime.Now.ToLongTimeString()); for (int i = 0; i < colDevice_Test_Results.Length; i++) { colDevice_Test_Results[i].strDevice_ID = strInstrument_ID; } com.digitalwave.iCare.middletier.LIS.clsLIS_Svc objLIS_Svc = (clsLIS_Svc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.LIS.clsLIS_Svc)); lngRes = 0; System.Collections.ArrayList arlOut = null; //xing.chen add test code testLog.Log2File(@"D:\logInfo.txt", "Data insert database", DateTime.Now.ToLongTimeString()); lngRes = objLIS_Svc.lngAddLabResult(arlResult, out arlOut); if (lngRes > 0) { arlResult = arlOut; } } catch (Exception ex) { string srr = ex.Message; } #region 显示实时信息 if (lngRes > 0) { //xing.chen add test code testLog.Log2File(@"D:\logInfo.txt", "Data Show", DateTime.Now.ToLongTimeString()); colDevice_Test_Results = (clsLIS_Device_Test_ResultVO[])arlResult.ToArray(typeof(com.digitalwave.iCare.ValueObject.clsLIS_Device_Test_ResultVO)); clsDeviceSampleDataKey objKey = new clsDeviceSampleDataKey(); objKey.intResultBeginIndex = colDevice_Test_Results[0].intIndex; objKey.intResultEndIndex = colDevice_Test_Results[colDevice_Test_Results.Length - 1].intIndex; objKey.strDeviceID = strInstrument_ID; objKey.strDeviceName = strInstrument_Name; objKey.strDeviceSampleID = colDevice_Test_Results[0].strDevice_Sample_ID; objKey.strCheckDate = colDevice_Test_Results[0].strCheck_Date; m_objViewer.m_mthShowMessage(objKey, colDevice_Test_Results); } #endregion } } } } } catch { } }