INT_PT002/INT_PT002/Controls/System/ControlMenuSystemStatus1.cs

692 lines
25 KiB
C#

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_PT002.Forms;
using INT_PT002.DataStore;
namespace INT_PT002.Controls
{
public partial class ControlMenuSystemStatus1 : UserControl
{
#region Field
private FormMenu m_ParentForm;
private Color ColorProgressOn;
private Color ColorProgressOff;
private Color ColorResultPass;
private Color ColorResultNG;
private Color ColorResultNone;
private Collection<SmartLabel> CollectionLabelResult;
private Collection<SmartLabel> CollectionLabelProgress;
private Collection<SmartLabel> CollectionDiffSecDiff;
private Collection<SmartLabel> CollectionPressureWork;
private Collection<SmartLabel> CollectionPressureMaster;
#endregion
#region Constructor
public ControlMenuSystemStatus1(FormMenu parent)
{
InitializeComponent();
this.ParentForm = parent;
this.Initialize();
this.InitializeData();
}
#endregion
#region Property
public FormMenu ParentForm
{
get { return this.m_ParentForm; }
private set { this.m_ParentForm = value; }
}
#endregion
#region Method
private void Initialize()
{
this.smartGroupBox1.Text = "System > Equipment";
this.ColorProgressOff = Color.Azure;
this.ColorProgressOn = Color.Lime;
this.ColorResultPass = Color.Green;
this.ColorResultNG = Color.Red;
this.ColorResultNone = Color.White;
this.CollectionLabelProgress = new Collection<SmartLabel>();
this.CollectionLabelProgress.Clear();
this.CollectionLabelProgress.Add(this.labelProgress1);
this.CollectionLabelProgress.Add(this.labelProgress2);
this.CollectionLabelProgress.Add(this.labelProgress3);
this.CollectionLabelProgress.Add(this.labelProgress4);
this.CollectionLabelProgress.Add(this.labelProgress5);
this.CollectionLabelProgress.Add(this.labelProgress6);
this.CollectionLabelProgress.Add(this.labelProgress7);
this.CollectionLabelProgress.Add(this.labelProgress8);
this.CollectionLabelProgress.Add(this.labelProgress9);
this.CollectionLabelProgress.Add(this.labelProgress10);
this.CollectionLabelProgress.Add(this.labelProgress11);
this.CollectionLabelResult = new Collection<SmartLabel>();
this.CollectionLabelResult.Add(this.labelResult1);
this.CollectionLabelResult.Add(this.labelResult2);
this.CollectionLabelResult.Add(this.labelResult3);
this.CollectionLabelResult.Add(this.labelResult4);
this.CollectionLabelResult.Add(this.labelResult5);
this.CollectionLabelResult.Add(this.labelResult6);
this.CollectionLabelResult.Add(this.labelResult7);
this.CollectionLabelResult.Add(this.labelResult8);
this.CollectionLabelResult.Add(this.labelResult9);
this.CollectionLabelResult.Add(this.labelResult10);
this.CollectionDiffSecDiff = new Collection<SmartLabel>();
this.CollectionDiffSecDiff.Add(this.labelMesDiffSecDiff1);
this.CollectionDiffSecDiff.Add(this.labelMesDiffSecDiff2);
this.CollectionPressureWork = new Collection<SmartLabel>();
this.CollectionPressureWork.Add(this.labelMesPressureWork1);
this.CollectionPressureWork.Add(this.labelMesPressureWork2);
this.CollectionPressureMaster = new Collection<SmartLabel>();
this.CollectionPressureMaster.Add(this.labelMesPressureMaster1);
this.CollectionPressureMaster.Add(this.labelMesPressureMaster2);
}
private void InitializeData()
{
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
{
this.CollectionLabelResult[i].Text = "-";
this.CollectionLabelResult[i].TextColor = this.ColorResultNone;
this.CollectionLabelResult[i].Visible = false;
this.CollectionDiffSecDiff[i].Text = "0.00";
this.CollectionPressureWork[i].Text = "0.0";
this.CollectionPressureMaster[i].Text = "0.0";
}
// Measuring : 1 Lane
this.labelMesDispRData1.Text = "0.00";
this.labelMesDispMData1.Text = "0.00";
this.labelMesDispMDataDiff1.Text = "0.00";
this.labelMesDispSTD1.Text = "0.00";
this.labelMesDiffMadc1.Text = "0.00";
this.labelMesDiffSecDiff1.Text = "0.00";
this.labelMesDiffSecSum1.Text = "0.00";
this.labelMesDiffMean1.Text = "0.00";
this.labelMesPressureMaster1.Text = "0.0";
this.labelMesPressureWork1.Text = "0.0";
// Measuring : 2 Lane
this.labelMesDispRData2.Text = "0.00";
this.labelMesDispMData2.Text = "0.00";
this.labelMesDispMDataDiff2.Text = "0.00";
this.labelMesDispSTD2.Text = "0.00";
this.labelMesDiffMadc2.Text = "0.00";
this.labelMesDiffSecDiff2.Text = "0.00";
this.labelMesDiffSecSum2.Text = "0.00";
this.labelMesDiffMean2.Text = "0.00";
this.labelMesPressureMaster2.Text = "0.0";
this.labelMesPressureWork2.Text = "0.0";
this.smartDraw1.Chart.PutDataAllClear();
this.smartDraw2.Chart.PutDataAllClear();
}
private void GetJudgmentResult(Define.E_JudgmentStatus judg, SmartLabel label2)
{
string value = "";
switch (judg)
{
case Define.E_JudgmentStatus.None:
value = "-";
label2.TextColor = this.ColorResultNone;
label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
break;
case Define.E_JudgmentStatus.Pass:
value = "Pass";
label2.TextColor = this.ColorResultPass;
label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
break;
case Define.E_JudgmentStatus.Ng:
value = "Leak";
label2.TextColor = this.ColorResultNG;
label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
break;
case Define.E_JudgmentStatus.Error:
value = "Empty";
label2.TextColor = this.ColorResultNone;
label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
break;
default:
break;
}
if (label2.Text != value)
label2.Text = value;
}
public void UpdateProcessStatusDisplay(Define.E_ProcessStatus status)
{
switch (status)
{
case Define.E_ProcessStatus._0_None:
break;
case Define.E_ProcessStatus._1_Ready:
this.labelProgress11.BackColor = this.ColorProgressOff;
this.labelProgress1.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._2_ProductEntry:
this.labelProgress1.BackColor = this.ColorProgressOff;
this.labelProgress2.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._3_MoveToLeak:
this.labelProgress2.BackColor = this.ColorProgressOff;
this.labelProgress3.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._4_MoveToCheck:
this.labelProgress3.BackColor = this.ColorProgressOff;
this.labelProgress4.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._5_ChamberMerge:
this.labelProgress4.BackColor = this.ColorProgressOff;
this.labelProgress5.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._6_VacuumStart:
this.labelProgress5.BackColor = this.ColorProgressOff;
this.labelProgress6.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._7_VacuumHold:
this.labelProgress6.BackColor = this.ColorProgressOff;
this.labelProgress7.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._8_Judgment:
this.labelProgress7.BackColor = this.ColorProgressOff;
this.labelProgress8.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._9_VacuumBreak:
this.labelProgress8.BackColor = this.ColorProgressOff;
this.labelProgress9.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._10_ChamberRelease:
this.labelProgress9.BackColor = this.ColorProgressOff;
this.labelProgress10.BackColor = this.ColorProgressOn;
break;
case Define.E_ProcessStatus._11_MoveToReady:
this.labelProgress10.BackColor = this.ColorProgressOff;
this.labelProgress11.BackColor = this.ColorProgressOn;
break;
default:
break;
}
}
private void UpdateDisplayDotGraphDiff(SmartDraw draw, DiffData diff)
{
int iValue = 0;
double dValue = 0.0;
// 값 표시 범위
// 15.000 ~ -2.000 (17.000 ~ 0)
// 그래프 영역 높이 102
// 17000 / 102 = 166.666666~
//dValue = (int.Parse(data.CurrentValueSign + data.CurrentValue) + 2000) / 166.66666;
if (dValue > 110)
dValue = 110;
if (dValue < 1)
dValue = 1;
iValue = int.Parse(string.Format("{0:f0}", dValue));
draw.Chart.PutData(iValue);
}
private void UpdateDisplayDotGraphDisp(SmartDraw draw, DispData disp)
{
int iValue = 0;
double dValue = 0.0;
// 값 표시 범위
// 15.000 ~ -2.000 (17.000 ~ 0)
// 그래프 영역 높이 102
// 17000 / 102 = 166.666666~
//dValue = (int.Parse(data.CurrentValueSign + data.CurrentValue) + 2000) / 166.66666;
if (dValue > 110)
dValue = 110;
if (dValue < 1)
dValue = 1;
iValue = int.Parse(string.Format("{0:f0}", dValue));
draw.Chart.PutData(iValue);
}
public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
{
if (status == Define.E_EquipmentStatus.Start)
{
#region Start
//this.labelStart.Visible = true;
//this.labelStop.Visible = false;
#endregion
}
else
{
#region Stop
//this.labelStart.Visible = false;
//this.labelStop.Visible = true;
#endregion
}
}
public void UpdateDisplayAlarmView(AlarmList alarm)
{
}
// 차압센서 데이터
public void UpdateDisplayDiffData(Collection<DiffData> datas)
{
string value = "";
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
{
value = datas[i].SecBufDiff;
if (this.CollectionDiffSecDiff[i].Text != value)
this.CollectionDiffSecDiff[i].Text = value;
}
}
public void UpdateDisplayDiffData1(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[0].Text != value)
this.CollectionDiffSecDiff[0].Text = value;
//Measuring : 2 Lane
}
public void UpdateDisplayDiffData2(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[1].Text != value)
this.CollectionDiffSecDiff[1].Text = value;
}
public void UpdateDisplayDiffData3(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[2].Text != value)
this.CollectionDiffSecDiff[2].Text = value;
}
public void UpdateDisplayDiffData4(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[3].Text != value)
this.CollectionDiffSecDiff[3].Text = value;
}
public void UpdateDisplayDiffData5(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[4].Text != value)
this.CollectionDiffSecDiff[4].Text = value;
}
public void UpdateDisplayDiffData6(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[5].Text != value)
this.CollectionDiffSecDiff[5].Text = value;
}
public void UpdateDisplayDiffData7(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[6].Text != value)
this.CollectionDiffSecDiff[6].Text = value;
}
public void UpdateDisplayDiffData8(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[7].Text != value)
this.CollectionDiffSecDiff[7].Text = value;
}
public void UpdateDisplayDiffData9(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[8].Text != value)
this.CollectionDiffSecDiff[8].Text = value;
}
public void UpdateDisplayDiffData10(LeakData1 data)
{
string value = "";
value = data.DiffData.SecBufDiff;
if (this.CollectionDiffSecDiff[9].Text != value)
this.CollectionDiffSecDiff[9].Text = value;
}
// 변위센서 데이터
public void UpdateDisplayDispData(Collection<DispData> datas)
{
}
public void UpdateDisplayDispData1(LeakData1 data)
{
}
public void UpdateDisplayDispData2(LeakData1 data)
{
}
public void UpdateDisplayDispData3(LeakData1 data)
{
}
public void UpdateDisplayDispData4(LeakData1 data)
{
}
public void UpdateDisplayDispData5(LeakData1 data)
{
}
public void UpdateDisplayDispData6(LeakData1 data)
{
}
public void UpdateDisplayDispData7(LeakData1 data)
{
}
public void UpdateDisplayDispData8(LeakData1 data)
{
}
public void UpdateDisplayDispData9(LeakData1 data)
{
}
public void UpdateDisplayDispData10(LeakData1 data)
{
}
// 압력센서 데이터
public void UpdateDisplayPresData(Collection<PressureData> datas)
{
string value = "";
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
{
value = datas[i].WorkingChamber;
if (this.CollectionPressureWork[i].Text != value)
this.CollectionPressureWork[i].Text = value;
value = datas[i].MasterChamber;
if (this.CollectionPressureMaster[i].Text != value)
this.CollectionPressureMaster[i].Text = value;
}
}
public void UpdateDisplayPresData1(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[0].Text != value)
this.CollectionPressureWork[0].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[0].Text != value)
this.CollectionPressureMaster[0].Text = value;
}
public void UpdateDisplayPresData2(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[1].Text != value)
this.CollectionPressureWork[1].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[1].Text != value)
this.CollectionPressureMaster[1].Text = value;
}
public void UpdateDisplayPresData3(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[2].Text != value)
this.CollectionPressureWork[2].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[2].Text != value)
this.CollectionPressureMaster[2].Text = value;
}
public void UpdateDisplayPresData4(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[3].Text != value)
this.CollectionPressureWork[3].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[3].Text != value)
this.CollectionPressureMaster[3].Text = value;
}
public void UpdateDisplayPresData5(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[4].Text != value)
this.CollectionPressureWork[4].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[4].Text != value)
this.CollectionPressureMaster[4].Text = value;
}
public void UpdateDisplayPresData6(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[5].Text != value)
this.CollectionPressureWork[5].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[5].Text != value)
this.CollectionPressureMaster[5].Text = value;
}
public void UpdateDisplayPresData7(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[6].Text != value)
this.CollectionPressureWork[6].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[6].Text != value)
this.CollectionPressureMaster[6].Text = value;
}
public void UpdateDisplayPresData8(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[7].Text != value)
this.CollectionPressureWork[7].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[7].Text != value)
this.CollectionPressureMaster[7].Text = value;
}
public void UpdateDisplayPresData9(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[8].Text != value)
this.CollectionPressureWork[8].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[8].Text != value)
this.CollectionPressureMaster[8].Text = value;
}
public void UpdateDisplayPresData10(LeakData1 data)
{
string value = "";
value = data.PresData.WorkingChamber;
if (this.CollectionPressureWork[9].Text != value)
this.CollectionPressureWork[9].Text = value;
value = data.PresData.MasterChamber;
if (this.CollectionPressureMaster[9].Text != value)
this.CollectionPressureMaster[9].Text = value;
}
// 판정결과
public void UpdateDisplayJudgmentData(LeakData datas)
{
this.timerOn.Stop();
this.timerOff.Stop();
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
{
this.GetJudgmentResult(datas.CollJudgment[i], this.CollectionLabelResult[i]);
this.CollectionLabelResult[i].Visible = true;
}
}
public void UpdateDisplayJudgmentData1(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[0]);
this.CollectionLabelResult[0].Visible = true;
}
public void UpdateDisplayJudgmentData2(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[1]);
this.CollectionLabelResult[1].Visible = true;
}
public void UpdateDisplayJudgmentData3(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[2]);
this.CollectionLabelResult[2].Visible = true;
}
public void UpdateDisplayJudgmentData4(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[3]);
this.CollectionLabelResult[3].Visible = true;
}
public void UpdateDisplayJudgmentData5(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[4]);
this.CollectionLabelResult[4].Visible = true;
}
public void UpdateDisplayJudgmentData6(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[5]);
this.CollectionLabelResult[5].Visible = true;
}
public void UpdateDisplayJudgmentData7(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[6]);
this.CollectionLabelResult[6].Visible = true;
}
public void UpdateDisplayJudgmentData8(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[7]);
this.CollectionLabelResult[7].Visible = true;
}
public void UpdateDisplayJudgmentData9(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[8]);
this.CollectionLabelResult[8].Visible = true;
}
public void UpdateDisplayJudgmentData10(LeakData1 data)
{
this.timerOn.Stop();
this.timerOff.Stop();
this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[9]);
this.CollectionLabelResult[9].Visible = true;
}
public void DisplayRefresh()
{
this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplayMode = Define.E_DisplayModeStore.Equipment;
this.ParentForm.ParentForm.SetDisplayMode(Define.E_EquipmentMode.Normal);
this.InitializeData();
}
#endregion
#region Event Handler
private void buttonInspection_Click(object sender, EventArgs e)
{
this.InitializeData();
this.ParentForm.ParentForm.TransferData(CommunicationCommand.CutInpupt, CommunicationID.MainBoard);
}
private void timerOn_Tick(object sender, EventArgs e)
{
this.timerOn.Stop();
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
this.CollectionLabelResult[i].Visible = false;
this.timerOff.Start();
}
private void timerOff_Tick(object sender, EventArgs e)
{
this.timerOff.Stop();
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
this.CollectionLabelResult[i].Visible = true;
this.timerOn.Start();
}
#endregion
}
}