using System; using System.Linq; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using SmartX; using INT_LKD.DataStore; using INT_LKD.Forms; namespace INT_LKD.Controls.MainDisplay { public partial class ControlMainStatus10 : UserControl { #region Field private FormMainDisplay m_ParentForm; private Collection CollectionLabelPressureWorking; private Collection CollectionLabelLeakRatePerSec; private Collection CollectionLabelDisplacement; private Collection CollectionLabelSbAlarm; private Collection CollectionLabelNumber; private Collection CollectionLabelDispAlarm; private Collection CollectionControlResult; private Color ColorSensorNormal; private Color ColorSensorError; private Color ColorNumberSelected; private Color ColorNumberUnSelected; #endregion #region Constructor public ControlMainStatus10(FormMainDisplay parent) { InitializeComponent(); this.ParentForm = parent; this.Initialize(); this.InitializeData(); this.InitializeDesign(); } #endregion #region Property public FormMainDisplay ParentForm { get { return this.m_ParentForm; } set { this.m_ParentForm = value; } } #endregion #region Method private void Initialize() { this.ColorSensorNormal = Color.FromArgb(39, 200, 64); this.ColorSensorError = Color.FromArgb(254, 70, 70); this.ColorNumberSelected = Color.Teal; this.ColorNumberUnSelected = Color.FromArgb(80, 92, 118); this.CollectionLabelPressureWorking = new Collection(); this.CollectionLabelPressureWorking.Clear(); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking1); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking2); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking3); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking4); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking5); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking6); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking7); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking8); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking9); this.CollectionLabelPressureWorking.Add(this.labelPressureWorking10); this.CollectionLabelDisplacement = new Collection(); this.CollectionLabelDisplacement.Clear(); this.CollectionLabelDisplacement.Add(this.labelDisplacement1); this.CollectionLabelDisplacement.Add(this.labelDisplacement2); this.CollectionLabelDisplacement.Add(this.labelDisplacement3); this.CollectionLabelDisplacement.Add(this.labelDisplacement4); this.CollectionLabelDisplacement.Add(this.labelDisplacement5); this.CollectionLabelDisplacement.Add(this.labelDisplacement6); this.CollectionLabelDisplacement.Add(this.labelDisplacement7); this.CollectionLabelDisplacement.Add(this.labelDisplacement8); this.CollectionLabelDisplacement.Add(this.labelDisplacement9); this.CollectionLabelDisplacement.Add(this.labelDisplacement10); this.CollectionLabelLeakRatePerSec = new Collection(); this.CollectionLabelLeakRatePerSec.Clear(); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec1); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec2); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec3); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec4); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec5); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec6); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec7); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec8); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec9); this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec10); this.CollectionLabelSbAlarm = new Collection(); this.CollectionLabelSbAlarm.Clear(); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm1); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm2); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm3); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm4); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm5); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm6); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm7); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm8); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm9); this.CollectionLabelSbAlarm.Add(this.labelSbAlarm10); this.CollectionLabelNumber = new Collection(); this.CollectionLabelNumber.Clear(); this.CollectionLabelNumber.Add(this.labelNumber1); this.CollectionLabelNumber.Add(this.labelNumber2); this.CollectionLabelNumber.Add(this.labelNumber3); this.CollectionLabelNumber.Add(this.labelNumber4); this.CollectionLabelNumber.Add(this.labelNumber5); this.CollectionLabelNumber.Add(this.labelNumber6); this.CollectionLabelNumber.Add(this.labelNumber7); this.CollectionLabelNumber.Add(this.labelNumber8); this.CollectionLabelNumber.Add(this.labelNumber9); this.CollectionLabelNumber.Add(this.labelNumber10); this.CollectionLabelDispAlarm = new Collection(); this.CollectionLabelDispAlarm.Clear(); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm1); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm2); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm3); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm4); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm5); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm6); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm7); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm8); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm9); this.CollectionLabelDispAlarm.Add(this.labeldispAlarm10); this.CollectionControlResult = new Collection(); for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++) this.CollectionControlResult.Add(new ControlMainResult10(this.ParentForm)); for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++) { this.Controls.Add(this.CollectionControlResult[i]); this.CollectionControlResult[i].BringToFront(); this.CollectionControlResult[i].Visible = false; } this.CollectionControlResult[0].Location = new Point(16, 69); this.CollectionControlResult[1].Location = new Point(161, 69); this.CollectionControlResult[2].Location = new Point(16, 181); this.CollectionControlResult[3].Location = new Point(161, 181); this.CollectionControlResult[4].Location = new Point(16, 293); this.CollectionControlResult[5].Location = new Point(161, 293); this.CollectionControlResult[6].Location = new Point(16, 405); this.CollectionControlResult[7].Location = new Point(161, 405); this.CollectionControlResult[8].Location = new Point(16, 517); this.CollectionControlResult[9].Location = new Point(161, 517); } public void InitializeData() { for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++) { this.CollectionControlResult[i].Visible = false; this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[i], "0.0"); this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[i], "0.0"); this.SetLabelDisplacement(this.CollectionLabelDisplacement[i], "0.00/0.00"); this.CollectionLabelSbAlarm[i].Visible = false; this.CollectionLabelDispAlarm[i].Visible = false; this.SetLabelNumberColor(i, this.ColorNumberUnSelected); } } public void InitializeDesign() { switch (this.ParentForm.ParentForm.SystemConfig.LANGUAGE) { case Define.E_LanguageID.Chinese: this.labelTitleStatusResult.Text = "地位 / 结果"; break; default: this.labelTitleStatusResult.Text = "Status / Result"; break; } } private void SetLabelNumberColor(int index, Color c) { if (this.CollectionLabelNumber[index].BackGroundColor != c) { this.CollectionLabelNumber[index].BackGroundColor = c; this.CollectionLabelSbAlarm[index].BackGroundColor = c; } } private void SetLabelPressureWorking(SmartLabel label, string data) { label.Text = string.Format("{0}", data); } private void SetLabelLeakRatePerSec(SmartLabel label, string data) { label.Text = string.Format("{0}", data); } private void SetLabelDisplacement(SmartLabel label, string data) { label.Text = string.Format("{0}", data); } public void UpdateDisplayRecipeData(Recipe data) { if (data.DISP_JUDG_ENABLE == false) { for (int i = 0; i < this.CollectionLabelDisplacement.Count; i++) this.CollectionLabelDisplacement[i].TextColor = Color.Gray; } else { for (int i = 0; i < this.CollectionLabelDisplacement.Count; i++) this.CollectionLabelDisplacement[i].TextColor = Color.White; } } // 진행상태 데이터 public void UpdateDisplayProcessStatus(Define.E_ProcessStatus status) { switch (status) { case Define.E_ProcessStatus._0_None: break; case Define.E_ProcessStatus._1_Ready: break; case Define.E_ProcessStatus._2_ProductEntry: this.InitializeData(); break; case Define.E_ProcessStatus._3_MoveToLeak: break; case Define.E_ProcessStatus._4_MoveToCheck: break; case Define.E_ProcessStatus._5_ChamberMerge: break; case Define.E_ProcessStatus._6_VacuumStart: break; case Define.E_ProcessStatus._7_VacuumHold: break; case Define.E_ProcessStatus._8_Judgment: break; case Define.E_ProcessStatus._9_VacuumBreak: break; case Define.E_ProcessStatus._10_ChamberRelease: break; case Define.E_ProcessStatus._11_MoveToReady: break; default: break; } } public void UpdateDisplayProcessStatus1(Define.E_ProcessStatus status) { if (this.ParentForm.ParentForm.CurrentSystemStatus.EquipmentStatus == Define.E_EquipmentStatus.Start) { this.SetLabelNumberColor(8, this.ColorNumberUnSelected); this.SetLabelNumberColor(9, this.ColorNumberUnSelected); this.SetLabelNumberColor(0, this.ColorNumberSelected); this.SetLabelNumberColor(1, this.ColorNumberSelected); } } public void UpdateDisplayProcessStatus2(Define.E_ProcessStatus status) { } public void UpdateDisplayProcessStatus3(Define.E_ProcessStatus status) { if (this.ParentForm.ParentForm.CurrentSystemStatus.EquipmentStatus == Define.E_EquipmentStatus.Start) { this.SetLabelNumberColor(0, this.ColorNumberUnSelected); this.SetLabelNumberColor(1, this.ColorNumberUnSelected); this.SetLabelNumberColor(2, this.ColorNumberSelected); this.SetLabelNumberColor(3, this.ColorNumberSelected); } } public void UpdateDisplayProcessStatus4(Define.E_ProcessStatus status) { } public void UpdateDisplayProcessStatus5(Define.E_ProcessStatus status) { if (this.ParentForm.ParentForm.CurrentSystemStatus.EquipmentStatus == Define.E_EquipmentStatus.Start) { this.SetLabelNumberColor(2, this.ColorNumberUnSelected); this.SetLabelNumberColor(3, this.ColorNumberUnSelected); this.SetLabelNumberColor(4, this.ColorNumberSelected); this.SetLabelNumberColor(5, this.ColorNumberSelected); } } public void UpdateDisplayProcessStatus6(Define.E_ProcessStatus status) { } public void UpdateDisplayProcessStatus7(Define.E_ProcessStatus status) { if (this.ParentForm.ParentForm.CurrentSystemStatus.EquipmentStatus == Define.E_EquipmentStatus.Start) { this.SetLabelNumberColor(4, this.ColorNumberUnSelected); this.SetLabelNumberColor(5, this.ColorNumberUnSelected); this.SetLabelNumberColor(6, this.ColorNumberSelected); this.SetLabelNumberColor(7, this.ColorNumberSelected); } } public void UpdateDisplayProcessStatus8(Define.E_ProcessStatus status) { } public void UpdateDisplayProcessStatus9(Define.E_ProcessStatus status) { if (this.ParentForm.ParentForm.CurrentSystemStatus.EquipmentStatus == Define.E_EquipmentStatus.Start) { this.SetLabelNumberColor(6, this.ColorNumberUnSelected); this.SetLabelNumberColor(7, this.ColorNumberUnSelected); this.SetLabelNumberColor(8, this.ColorNumberSelected); this.SetLabelNumberColor(9, this.ColorNumberSelected); } } public void UpdateDisplayProcessStatus10(Define.E_ProcessStatus status) { } // 차압센서 데이터 public void UpdateDisplayDiffData1(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[0], data.DiffData.SecBuf); } public void UpdateDisplayDiffData2(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[1], data.DiffData.SecBuf); } public void UpdateDisplayDiffData3(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[2], data.DiffData.SecBuf); } public void UpdateDisplayDiffData4(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[3], data.DiffData.SecBuf); } public void UpdateDisplayDiffData5(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[4], data.DiffData.SecBuf); } public void UpdateDisplayDiffData6(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[5], data.DiffData.SecBuf); } public void UpdateDisplayDiffData7(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[6], data.DiffData.SecBuf); } public void UpdateDisplayDiffData8(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[7], data.DiffData.SecBuf); } public void UpdateDisplayDiffData9(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[8], data.DiffData.SecBuf); } public void UpdateDisplayDiffData10(LeakData1 data) { this.SetLabelLeakRatePerSec(this.CollectionLabelLeakRatePerSec[9], data.DiffData.SecBuf); } // 변위센서 데이터 public void UpdateDisplayDispData1(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[0], value); } public void UpdateDisplayDispData2(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[1], value); } public void UpdateDisplayDispData3(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[2], value); } public void UpdateDisplayDispData4(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[3], value); } public void UpdateDisplayDispData5(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[4], value); } public void UpdateDisplayDispData6(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[5], value); } public void UpdateDisplayDispData7(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[6], value); } public void UpdateDisplayDispData8(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[7], value); } public void UpdateDisplayDispData9(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[8], value); } public void UpdateDisplayDispData10(LeakData1 data) { string value = ""; value = string.Format("{0}/{1}", data.DispData.MData, data.DispData.MDataMax); this.SetLabelDisplacement(this.CollectionLabelDisplacement[9], value); } // 압력센서 데이터 public void UpdateDisplayPresData1(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[0], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData2(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[1], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData3(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[2], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData4(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[3], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData5(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[4], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData6(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[5], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData7(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[6], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData8(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[7], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData9(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[8], data.PresData.WorkingChamber.Trim()); } public void UpdateDisplayPresData10(LeakData1 data) { this.SetLabelPressureWorking(this.CollectionLabelPressureWorking[9], data.PresData.WorkingChamber.Trim()); } // 판정결과 public void UpdateDisplayJudgmentData1(LeakData1 data) { this.CollectionControlResult[0].SetResult(data.Judgment); this.CollectionControlResult[0].Visible = true; } public void UpdateDisplayJudgmentData2(LeakData1 data) { this.CollectionControlResult[1].SetResult(data.Judgment); this.CollectionControlResult[1].Visible = true; } public void UpdateDisplayJudgmentData3(LeakData1 data) { this.CollectionControlResult[2].SetResult(data.Judgment); this.CollectionControlResult[2].Visible = true; } public void UpdateDisplayJudgmentData4(LeakData1 data) { this.CollectionControlResult[3].SetResult(data.Judgment); this.CollectionControlResult[3].Visible = true; } public void UpdateDisplayJudgmentData5(LeakData1 data) { this.CollectionControlResult[4].SetResult(data.Judgment); this.CollectionControlResult[4].Visible = true; } public void UpdateDisplayJudgmentData6(LeakData1 data) { this.CollectionControlResult[5].SetResult(data.Judgment); this.CollectionControlResult[5].Visible = true; } public void UpdateDisplayJudgmentData7(LeakData1 data) { this.CollectionControlResult[6].SetResult(data.Judgment); this.CollectionControlResult[6].Visible = true; } public void UpdateDisplayJudgmentData8(LeakData1 data) { this.CollectionControlResult[7].SetResult(data.Judgment); this.CollectionControlResult[7].Visible = true; } public void UpdateDisplayJudgmentData9(LeakData1 data) { this.CollectionControlResult[8].SetResult(data.Judgment); this.CollectionControlResult[8].Visible = true; } public void UpdateDisplayJudgmentData10(LeakData1 data) { this.CollectionControlResult[9].SetResult(data.Judgment); this.CollectionControlResult[9].Visible = true; } #endregion } }