protected override void Dispose(bool disposing) { if (disposing) { LogProgram.WriteEndProgram(); this.m_notifyicon.Dispose(); } base.Dispose(disposing); }
public frmConfig() { LogProgram.WriteStartFormConfig(); InitializeComponent(); List <string> portTemp = new List <string>(SerialPort.GetPortNames()); portTemp.Add("NONE"); ports = portTemp.ToArray(); P.ReadTimeout = 1000; InitControls(); UpdateControls(); this.FormClosed += new FormClosedEventHandler(frmConfig_FormClosed); }
public void test(string a) { try { tem = port.ReadExisting(); LogProgram.WriteLog("[Start4: COM]: ", tem); InputData += tem.Trim(); if (tem.StartsWith("")) { File.Create("Step1.txt"); LogProgram.WriteBeginTranfer(); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Đang nhận kết quả từ máy Stago Start 4", System.Windows.Forms.ToolTipIcon.Info); } if (tem.Trim().TrimEnd('\0').EndsWith("")) { File.Create("Step2.txt"); InputData = InputData.TrimStart('').TrimEnd('\0', ''); InputData = InputData.Replace("", "$"); string[] temp = InputData.Split('$'); foreach (string t in temp) { StagoStart4Result re = new StagoStart4Result(t); if (UpdateToSQL(re) == false) { File.Create("Step3.txt"); //LogProgram.WriteSaveFail(re); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Lưu kết quả '" + re.ID + "' từ máy Stago Start 4 không thành công", System.Windows.Forms.ToolTipIcon.Error); } else { //LogProgram.WriteSaveSucess(re); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Đã lưu kết quả '" + re.ID + "' từ máy Stago Start 4", System.Windows.Forms.ToolTipIcon.Info); } } LogProgram.WriteEndTranfer(); tem = ""; InputData = ""; } } catch (Exception ex) { LogProgram.WriteLog("[Start4:] ", ex.ToString()); } }
// MEDILAB //DekaPHAN LAURA //Seq.No: 0001 //Pat.ID: 03122011101 //2011.12.03 8:40 //........................ // BLD NEG // LEU NEG // BIL NEG // UBG NORM // KET NEG // GLU NEG // PRO NEG // pH 6.5 // NIT NEG // SG 1.015 //------------------------ 22 dòng private void DataReceive(object obj, SerialDataReceivedEventArgs e) { try { tem = port.ReadExisting(); InputData += tem; if (tem.StartsWith("")) { LogProgram.WriteBeginTranfer(); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Đang nhận kết quả từ máy Laura Smart", System.Windows.Forms.ToolTipIcon.Info); } if (tem.EndsWith("")) { InputData = InputData.TrimStart('').TrimEnd(''); InputData = InputData.Replace("", "$"); string[] temp = InputData.Split('$'); foreach (string t in temp) { LauraSmartResult re = new LauraSmartResult(t); if (UpdateToSQL(re) == false) { //LogProgram.WriteSaveFail(re); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Lưu kết quả '" + re.ID + "' từ máy Laura Smartkhông thành công", System.Windows.Forms.ToolTipIcon.Error); } else { //LogProgram.WriteSaveSucess(re); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Đã lưu kết quả '" + re.ID + "' từ máy Laura Smart", System.Windows.Forms.ToolTipIcon.Info); } } LogProgram.WriteEndTranfer(); tem = ""; InputData = ""; } } catch (Exception ex) { LogProgram.WriteLog("[Laura]:", ex.ToString()); } }
private void DataReceive(object obj, SerialDataReceivedEventArgs e) { try { tem = port.ReadExisting(); InputDataHuyetHoc += tem; #region Huyết học Mr Khoe if (tem.StartsWith("03")) { LogProgram.WriteBeginTranfer(); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "MKV", "Đang nhận kết quả từ máy Huyet Hoc LH500", System.Windows.Forms.ToolTipIcon.Info); } if (tem.EndsWith("")) { bool okHH = LuKetQuaHuyetHoc(InputDataHuyetHoc); if (okHH == false) { LogProgram.WriteLog("***Fail", "Save Huyet Hoc LH500 Error: " + InputDataHuyetHoc, true); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "mkv", "lưu kết quả từ máy Huyet Hoc LH500 không thành công", System.Windows.Forms.ToolTipIcon.Error); } else { LogProgram.WriteLog("Success", "Save Huyet Hoc LH500 Success"); frmMain.formMain.m_notifyicon.ShowBalloonTip(3, "mkv", "đã lưu kết quả từ máy Huyet Hoc LH500", System.Windows.Forms.ToolTipIcon.Info); } LogProgram.WriteEndTranfer(); tem = ""; InputDataHuyetHoc = ""; } #endregion } catch (Exception ex) { InputDataHuyetHoc = ""; LogProgram.WriteLog("[LH500]:", ex.ToString()); ConnectLab.Au480Connect.SaveErro(ex.ToString() + "-DataReceive", "LH500"); } }
public static void WriteConnectLh500Fail() { LogProgram.WriteLog("***Fail", "Connect to Lh500", true); }
public static void WriteConnectAu480Fail() { LogProgram.WriteLog("***Fail", "Connect to Au480", true); }
public static void WriteConnectServerFail() { LogProgram.WriteLog("***Fail", "Connect to SQL Server", true); }
public static void WriteEndProgram() { LogProgram.WriteLog("Success", "Exit program"); }
public static void WriteEndReloadConfig() { LogProgram.WriteLog("Success", "End reload all config"); }
public static void WriteSaveFail(CD1800Result re) { LogProgram.WriteLog("***Fail", "Save SpecimenID: " + re.SpecimenID + "; Patient: " + re.Patient + "; Sequence: " + re.Sequence, true); }
public static void WriteConnectStart4Success() { LogProgram.WriteLog("Success", "Connect to Stago Start 4"); }
public static void WriteConnectEBLX200Fail() { LogProgram.WriteLog("***Fail", "Connect to ERBA LX 200", true); }
public static void WriteConnectEBLX200Success() { LogProgram.WriteLog("Success", "Connect to ERBA LX 200"); }
public static void WriteConnectCD1800Fail() { LogProgram.WriteLog("***Fail", "Connect to Cell-Dyn 1800", true); }
public static void WriteEndTranfer() { LogProgram.WriteLog("Success", "End recieved from Cell-Dyn 1800 "); }
public static void WriteSaveSucess(CD1800Result re) { LogProgram.WriteLog("Success", "Save SpecimenID: " + re.SpecimenID + "; Patient: " + re.Patient + "; Sequence: " + re.Sequence); }
public static void WriteConnectStart4Fail() { LogProgram.WriteLog("***Fail", "Connect toStago Start 4", true); }
public static void WriteBeginReloadConfig() { LogProgram.WriteLog("Success", "Begin reload all config"); }
public static void WriteConnectLauraSmartSuccess() { LogProgram.WriteLog("Success", "Connect to Laura Smart"); }
public static void WriteStartProgram() { LogProgram.WriteLog("Success", "Start program"); }
public static void WriteConnectLauraSmartFail() { LogProgram.WriteLog("***Fail", "Connect to Laura Smart", true); }
public static void WriteConnectServerSuccess() { LogProgram.WriteLog("Success", "Connect to SQL Server"); }
public static void WriteStartFormConfig() { LogProgram.WriteLog("Success", "Start form config"); }
public static void WriteConnectAu480Success() { LogProgram.WriteLog("Success", "Connect to Au480"); }
public static void WriteCloseFormConfig() { LogProgram.WriteLog("Success", "Close form config"); }
public static void WriteConnectLh500Success() { LogProgram.WriteLog("Success", "Connect to Lh500"); }
public static void WriteSaveConfigSuccess() { LogProgram.WriteLog("Success", "Changed config"); }
public static void WriteConnectCD1800Success() { LogProgram.WriteLog("Success", "Connect to Cell-Dyn 1800"); }
public static void WriteSaveConfigFail() { LogProgram.WriteLog("***Fail", "Changed config"); }