public static PressureManager Instance() { if (m_Manager == null) { m_Manager = new PressureManager(); } return(m_Manager); }
public void ReadGrasebyPumpPressureSettings(PumpID pid, Misc.OcclusionLevel level) { string section = string.Empty; #region section switch (pid) { case PumpID.GrasebyC6: section = "GrasebyC6"; break; case PumpID.Graseby2000: section = "Graseby2000"; break; case PumpID.Graseby2100: section = "Graseby2100"; break; case PumpID.GrasebyC6T: section = "GrasebyC6T"; break; case PumpID.WZ50C6: section = "WZ50C6"; break; case PumpID.WZ50C6T: section = "WZ50C6T"; break; case PumpID.GrasebyF6: section = "GrasebyF6_1"; break; case PumpID.GrasebyF6_2: section = "GrasebyF6_2"; break; case PumpID.WZS50F6: section = "WZS50F6_1"; break; case PumpID.WZS50F6_2: section = "WZS50F6_2"; break; default: section = "GrasebyC6"; break; } #endregion string val = GetString(section, level.ToString()).Trim(); string[] arrSyringeSizePValue = val.Split('|'); if (arrSyringeSizePValue.Length == 0) { return; } int size = 0; float p = 0; foreach (string pair in arrSyringeSizePValue) { string[] arrSizePValuePair = pair.Trim().Split(','); if (arrSizePValuePair.Length != 2) { continue; } if (int.TryParse(arrSizePValuePair[0].Trim(), out size) && float.TryParse(arrSizePValuePair[1].Trim(), out p)) { PressureManager.Instance().Add(pid, level, size, p); } } }
private void Detail_VisibleChanged(object sender, EventArgs e) { PumpID pid = PumpID.None; if (this.m_Channel == 1) { switch (m_LocalPid) { case PumpID.GrasebyF6_2: pid = PumpID.GrasebyF6; break; case PumpID.WZS50F6_2: pid = PumpID.WZS50F6; break; default: pid = m_LocalPid; break; } } else { pid = m_LocalPid; } if (this.Visible) { lbP0.Text = "P0=" + this.m_P0.ToString("F0"); PressureCalibrationParameter para = null; para = m_CaliParameters.Find((x) => { return(x.m_SyringeSize == 10); }); if (para != null) { lbL10Right.Text = (para.m_PressureL * 100).ToString("F0"); lbC10Right.Text = (para.m_PressureC * 100).ToString("F0"); lbH10Right.Text = (para.m_PressureH * 100).ToString("F0"); lbL10Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 10, Misc.OcclusionLevel.L).ToString("F2"); lbC10Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 10, Misc.OcclusionLevel.C).ToString("F2"); lbH10Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 10, Misc.OcclusionLevel.H).ToString("F2"); } para = m_CaliParameters.Find((x) => { return(x.m_SyringeSize == 20); }); if (para != null) { lbL20Right.Text = (para.m_PressureL * 100).ToString("F0"); lbC20Right.Text = (para.m_PressureC * 100).ToString("F0"); lbH20Right.Text = (para.m_PressureH * 100).ToString("F0"); lbL20Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 20, Misc.OcclusionLevel.L).ToString("F2"); lbC20Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 20, Misc.OcclusionLevel.C).ToString("F2"); lbH20Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 20, Misc.OcclusionLevel.H).ToString("F2"); } para = m_CaliParameters.Find((x) => { return(x.m_SyringeSize == 30); }); if (para != null) { lbL30Right.Text = (para.m_PressureL * 100).ToString("F0"); lbC30Right.Text = (para.m_PressureC * 100).ToString("F0"); lbH30Right.Text = (para.m_PressureH * 100).ToString("F0"); lbL30Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 30, Misc.OcclusionLevel.L).ToString("F2"); lbC30Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 30, Misc.OcclusionLevel.C).ToString("F2"); lbH30Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 30, Misc.OcclusionLevel.H).ToString("F2"); } para = m_CaliParameters.Find((x) => { return(x.m_SyringeSize == 50); }); if (para != null) { lbL50Right.Text = (para.m_PressureL * 100).ToString("F0"); lbC50Right.Text = (para.m_PressureC * 100).ToString("F0"); lbH50Right.Text = (para.m_PressureH * 100).ToString("F0"); lbL50Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 50, Misc.OcclusionLevel.L).ToString("F2"); lbC50Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 50, Misc.OcclusionLevel.C).ToString("F2"); lbH50Left.Text = PressureManager.Instance().GetMidBySizeLevel(pid, 50, Misc.OcclusionLevel.H).ToString("F2"); } } }