807 lines
42 KiB
C#
807 lines
42 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.ObjectModel;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
using SmartX;
|
|
using INT63DC_2C.Forms;
|
|
|
|
namespace INT63DC_2C.Controls
|
|
{
|
|
public partial class ControlMainDisplay6 : UserControl
|
|
{
|
|
#region Field
|
|
private FormMainDisplay m_ParentForm;
|
|
|
|
private Color WeightOverColor = Color.Red;
|
|
private Color WeightStandardColor = Color.Black;
|
|
private Color WeightUnderColor = Color.Red;
|
|
private Color WeightSamplingDataColor = Color.Blue;
|
|
|
|
// Bar
|
|
private Collection<PictureBox> CollectionPictureBoxZero;
|
|
private Collection<SmartLabel> CollectionLabelWeightValue;
|
|
private Collection<SmartProgressBar> CollectionProgressBar;
|
|
private Collection<PictureBox> CollectionPictureBoxBypass;
|
|
// Table
|
|
private Collection<SmartLabel> CollectionLabelWeightValue1;
|
|
private Collection<SmartLabel> CollectionLabelWeightValue2;
|
|
private Collection<SmartLabel> CollectionLabelWeightValue3;
|
|
private Collection<SmartLabel> CollectionLabelWeightValue4;
|
|
private Collection<SmartLabel> CollectionLabelWeightValue5;
|
|
private Collection<SmartLabel> CollectionLabelWeightValue6;
|
|
private Collection<WeightStorageItem> CollectionWeightStorageItem;
|
|
#endregion
|
|
|
|
#region Constructor
|
|
public ControlMainDisplay6(FormMainDisplay parent)
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.ParentForm = parent;
|
|
|
|
this.CreateCollection();
|
|
this.InitializeControl();
|
|
}
|
|
#endregion
|
|
|
|
#region Property
|
|
public FormMainDisplay ParentForm
|
|
{
|
|
get { return this.m_ParentForm; }
|
|
private set { this.m_ParentForm = value; }
|
|
}
|
|
#endregion
|
|
|
|
#region Method
|
|
private void CreateCollection()
|
|
{
|
|
// PictureBoxZero
|
|
this.CollectionPictureBoxZero = new Collection<PictureBox>();
|
|
this.CollectionPictureBoxZero.Clear();
|
|
this.CollectionPictureBoxZero.Add(this.pictureBox1);
|
|
this.CollectionPictureBoxZero.Add(this.pictureBox2);
|
|
this.CollectionPictureBoxZero.Add(this.pictureBox3);
|
|
this.CollectionPictureBoxZero.Add(this.pictureBox4);
|
|
this.CollectionPictureBoxZero.Add(this.pictureBox5);
|
|
this.CollectionPictureBoxZero.Add(this.pictureBox6);
|
|
|
|
// LabelWeightValue
|
|
this.CollectionLabelWeightValue = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue.Clear();
|
|
this.CollectionLabelWeightValue.Add(this.labelWeightValue1);
|
|
this.CollectionLabelWeightValue.Add(this.labelWeightValue2);
|
|
this.CollectionLabelWeightValue.Add(this.labelWeightValue3);
|
|
this.CollectionLabelWeightValue.Add(this.labelWeightValue4);
|
|
this.CollectionLabelWeightValue.Add(this.labelWeightValue5);
|
|
this.CollectionLabelWeightValue.Add(this.labelWeightValue6);
|
|
|
|
// ProgressBar
|
|
this.CollectionProgressBar = new Collection<SmartProgressBar>();
|
|
this.CollectionProgressBar.Clear();
|
|
this.CollectionProgressBar.Add(this.progressBar1);
|
|
this.CollectionProgressBar.Add(this.progressBar2);
|
|
this.CollectionProgressBar.Add(this.progressBar3);
|
|
this.CollectionProgressBar.Add(this.progressBar4);
|
|
this.CollectionProgressBar.Add(this.progressBar5);
|
|
this.CollectionProgressBar.Add(this.progressBar6);
|
|
|
|
// PictureBoxBypass
|
|
this.CollectionPictureBoxBypass = new Collection<PictureBox>();
|
|
this.CollectionPictureBoxBypass.Clear();
|
|
this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass1);
|
|
this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass2);
|
|
this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass3);
|
|
this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass4);
|
|
this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass5);
|
|
this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass6);
|
|
|
|
// WeightStorage
|
|
this.CollectionWeightStorageItem = new Collection<WeightStorageItem>();
|
|
this.CollectionWeightStorageItem.Clear();
|
|
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EquipmentColumns; i++)
|
|
this.CollectionWeightStorageItem.Add(new WeightStorageItem());
|
|
|
|
#region Add Label
|
|
this.CollectionLabelWeightValue1 = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue1.Clear();
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col1Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col2Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col3Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col4Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col5Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col6Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col7Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col8Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col9Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col10Row);
|
|
this.CollectionLabelWeightValue1.Add(this.label1Col5Avg);
|
|
this.CollectionLabelWeightValue1.Add(this.label1AllAvg);
|
|
|
|
this.CollectionLabelWeightValue2 = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue2.Clear();
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col1Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col2Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col3Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col4Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col5Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col6Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col7Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col8Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col9Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col10Row);
|
|
this.CollectionLabelWeightValue2.Add(this.label2Col5Avg);
|
|
this.CollectionLabelWeightValue2.Add(this.label2AllAvg);
|
|
|
|
this.CollectionLabelWeightValue3 = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue3.Clear();
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col1Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col2Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col3Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col4Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col5Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col6Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col7Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col8Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col9Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col10Row);
|
|
this.CollectionLabelWeightValue3.Add(this.label3Col5Avg);
|
|
this.CollectionLabelWeightValue3.Add(this.label3AllAvg);
|
|
|
|
this.CollectionLabelWeightValue4 = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue4.Clear();
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col1Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col2Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col3Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col4Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col5Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col6Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col7Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col8Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col9Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col10Row);
|
|
this.CollectionLabelWeightValue4.Add(this.label4Col5Avg);
|
|
this.CollectionLabelWeightValue4.Add(this.label4AllAvg);
|
|
|
|
this.CollectionLabelWeightValue5 = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue5.Clear();
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col1Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col2Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col3Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col4Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col5Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col6Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col7Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col8Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col9Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col10Row);
|
|
this.CollectionLabelWeightValue5.Add(this.label5Col5Avg);
|
|
this.CollectionLabelWeightValue5.Add(this.label5AllAvg);
|
|
|
|
this.CollectionLabelWeightValue6 = new Collection<SmartLabel>();
|
|
this.CollectionLabelWeightValue6.Clear();
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col1Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col2Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col3Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col4Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col5Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col6Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col7Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col8Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col9Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col10Row);
|
|
this.CollectionLabelWeightValue6.Add(this.label6Col5Avg);
|
|
this.CollectionLabelWeightValue6.Add(this.label6AllAvg);
|
|
#endregion
|
|
}
|
|
private void InitializeControl()
|
|
{
|
|
foreach (PictureBox picture in this.CollectionPictureBoxZero)
|
|
picture.Visible = false;
|
|
|
|
foreach (SmartLabel label in this.CollectionLabelWeightValue)
|
|
label.Text = Helper.StringToDecimalPlaces("0", this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
|
|
foreach (SmartProgressBar bar in this.CollectionProgressBar)
|
|
bar.Value = bar.Minimum;
|
|
|
|
foreach (PictureBox picture in this.CollectionPictureBoxBypass)
|
|
picture.Visible = false;
|
|
|
|
this.SetCount(this.ParentForm.ParentForm.CollectionWeightData);
|
|
|
|
for (int i = 0; i < 12; i++)
|
|
{
|
|
Helper.SetTableLabelProperty(this.CollectionLabelWeightValue1[i]);
|
|
Helper.SetTableLabelProperty(this.CollectionLabelWeightValue2[i]);
|
|
Helper.SetTableLabelProperty(this.CollectionLabelWeightValue3[i]);
|
|
Helper.SetTableLabelProperty(this.CollectionLabelWeightValue4[i]);
|
|
Helper.SetTableLabelProperty(this.CollectionLabelWeightValue5[i]);
|
|
Helper.SetTableLabelProperty(this.CollectionLabelWeightValue6[i]);
|
|
}
|
|
this.UpdateLabelDisplay();
|
|
}
|
|
private void SetCount(Collection<WeightData> weightdatas)
|
|
{
|
|
string value = "";
|
|
|
|
#region Lane 1
|
|
value = weightdatas[0].TotalNGCount.ToString();
|
|
if (this.labelNGCount1.Text != value)
|
|
this.labelNGCount1.Text = value;
|
|
|
|
value = weightdatas[0].PassCount.ToString();
|
|
if (this.labelPassCount1.Text != value)
|
|
this.labelPassCount1.Text = value;
|
|
#endregion
|
|
|
|
#region Lane 2
|
|
value = weightdatas[1].TotalNGCount.ToString();
|
|
if (this.labelNGCount2.Text != value)
|
|
this.labelNGCount2.Text = value;
|
|
|
|
value = weightdatas[1].PassCount.ToString();
|
|
if (this.labelPassCount2.Text != value)
|
|
this.labelPassCount2.Text = value;
|
|
#endregion
|
|
|
|
#region Lane 3
|
|
value = weightdatas[2].TotalNGCount.ToString();
|
|
if (this.labelNGCount3.Text != value)
|
|
this.labelNGCount3.Text = value;
|
|
|
|
value = weightdatas[2].PassCount.ToString();
|
|
if (this.labelPassCount3.Text != value)
|
|
this.labelPassCount3.Text = value;
|
|
#endregion
|
|
|
|
#region Lane 4
|
|
value = weightdatas[3].TotalNGCount.ToString();
|
|
if (this.labelNGCount4.Text != value)
|
|
this.labelNGCount4.Text = value;
|
|
|
|
value = weightdatas[3].PassCount.ToString();
|
|
if (this.labelPassCount4.Text != value)
|
|
this.labelPassCount4.Text = value;
|
|
#endregion
|
|
|
|
#region Lane 5
|
|
value = weightdatas[4].TotalNGCount.ToString();
|
|
if (this.labelNGCount5.Text != value)
|
|
this.labelNGCount5.Text = value;
|
|
|
|
value = weightdatas[4].PassCount.ToString();
|
|
if (this.labelPassCount5.Text != value)
|
|
this.labelPassCount5.Text = value;
|
|
#endregion
|
|
|
|
#region Lane 6
|
|
value = weightdatas[5].TotalNGCount.ToString();
|
|
if (this.labelNGCount6.Text != value)
|
|
this.labelNGCount6.Text = value;
|
|
|
|
value = weightdatas[5].PassCount.ToString();
|
|
if (this.labelPassCount6.Text != value)
|
|
this.labelPassCount6.Text = value;
|
|
#endregion
|
|
|
|
this.ParentForm.SetTotalCount();
|
|
}
|
|
|
|
public void RescaleControl()
|
|
{
|
|
foreach (SmartProgressBar bar in this.CollectionProgressBar)
|
|
{
|
|
Helper.RescaleProgressBar(bar, this.ParentForm.ParentForm.CurrentProductItem.ProgressBarMaximum, this.ParentForm.ParentForm.CurrentProductItem.ProgressBarMinimum);
|
|
bar.Value = bar.Minimum;
|
|
}
|
|
}
|
|
public void Clear()
|
|
{
|
|
foreach (SmartX.SmartLabel label in this.CollectionLabelWeightValue)
|
|
{
|
|
label.Text = Helper.StringToDecimalPlaces("0", this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
label.ForeColor = Color.Black;
|
|
}
|
|
|
|
foreach (SmartX.SmartProgressBar bar in this.CollectionProgressBar)
|
|
bar.Value = bar.Minimum;
|
|
|
|
foreach (WeightData data in this.ParentForm.ParentForm.CollectionWeightData)
|
|
data.ClearCount();
|
|
|
|
foreach (WeightStorageItem weight in this.CollectionWeightStorageItem)
|
|
weight.AllClear();
|
|
|
|
this.SetCount(this.ParentForm.ParentForm.CollectionWeightData);
|
|
this.UpdateLabelDisplay();
|
|
|
|
this.ParentForm.ParentForm.SaveCounterFile1(this.ParentForm.ParentForm.CollectionWeightData, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
|
|
}
|
|
|
|
private void UpdateLabelDisplay()
|
|
{
|
|
this.UpdateLabelDisplayLane1();
|
|
this.UpdateLabelDisplayLane2();
|
|
this.UpdateLabelDisplayLane3();
|
|
this.UpdateLabelDisplayLane4();
|
|
this.UpdateLabelDisplayLane5();
|
|
this.UpdateLabelDisplayLane6();
|
|
}
|
|
private void UpdateLabelDisplayLane1()
|
|
{
|
|
// Lane 1
|
|
this.CollectionWeightStorageItem[0].SetQueueData();
|
|
Helper.SetTableLabelValue(this.label1Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[0]);
|
|
Helper.SetTableLabelValue(this.label1Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[1]);
|
|
Helper.SetTableLabelValue(this.label1Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[2]);
|
|
Helper.SetTableLabelValue(this.label1Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[3]);
|
|
Helper.SetTableLabelValue(this.label1Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[4]);
|
|
Helper.SetTableLabelValue(this.label1Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[5]);
|
|
Helper.SetTableLabelValue(this.label1Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[6]);
|
|
Helper.SetTableLabelValue(this.label1Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[7]);
|
|
Helper.SetTableLabelValue(this.label1Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[8]);
|
|
Helper.SetTableLabelValue(this.label1Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[9]);
|
|
|
|
Helper.SetTableLabelValue(this.label1Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[0].WeightTenAverage());
|
|
Helper.SetTableLabelValue(this.label1AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[0].WeightTotalAverage());
|
|
}
|
|
private void UpdateLabelDisplayLane2()
|
|
{
|
|
// Lane 2
|
|
this.CollectionWeightStorageItem[1].SetQueueData();
|
|
Helper.SetTableLabelValue(this.label2Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[0]);
|
|
Helper.SetTableLabelValue(this.label2Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[1]);
|
|
Helper.SetTableLabelValue(this.label2Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[2]);
|
|
Helper.SetTableLabelValue(this.label2Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[3]);
|
|
Helper.SetTableLabelValue(this.label2Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[4]);
|
|
Helper.SetTableLabelValue(this.label2Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[5]);
|
|
Helper.SetTableLabelValue(this.label2Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[6]);
|
|
Helper.SetTableLabelValue(this.label2Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[7]);
|
|
Helper.SetTableLabelValue(this.label2Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[8]);
|
|
Helper.SetTableLabelValue(this.label2Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[9]);
|
|
|
|
Helper.SetTableLabelValue(this.label2Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[1].WeightTenAverage());
|
|
Helper.SetTableLabelValue(this.label2AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[1].WeightTotalAverage());
|
|
}
|
|
private void UpdateLabelDisplayLane3()
|
|
{
|
|
// Lane 3
|
|
this.CollectionWeightStorageItem[2].SetQueueData();
|
|
Helper.SetTableLabelValue(this.label3Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[0]);
|
|
Helper.SetTableLabelValue(this.label3Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[1]);
|
|
Helper.SetTableLabelValue(this.label3Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[2]);
|
|
Helper.SetTableLabelValue(this.label3Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[3]);
|
|
Helper.SetTableLabelValue(this.label3Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[4]);
|
|
Helper.SetTableLabelValue(this.label3Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[5]);
|
|
Helper.SetTableLabelValue(this.label3Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[6]);
|
|
Helper.SetTableLabelValue(this.label3Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[7]);
|
|
Helper.SetTableLabelValue(this.label3Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[8]);
|
|
Helper.SetTableLabelValue(this.label3Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[9]);
|
|
|
|
Helper.SetTableLabelValue(this.label3Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[2].WeightTenAverage());
|
|
Helper.SetTableLabelValue(this.label3AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[2].WeightTotalAverage());
|
|
}
|
|
private void UpdateLabelDisplayLane4()
|
|
{
|
|
// Lane 4
|
|
this.CollectionWeightStorageItem[3].SetQueueData();
|
|
Helper.SetTableLabelValue(this.label4Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[0]);
|
|
Helper.SetTableLabelValue(this.label4Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[1]);
|
|
Helper.SetTableLabelValue(this.label4Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[2]);
|
|
Helper.SetTableLabelValue(this.label4Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[3]);
|
|
Helper.SetTableLabelValue(this.label4Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[4]);
|
|
Helper.SetTableLabelValue(this.label4Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[5]);
|
|
Helper.SetTableLabelValue(this.label4Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[6]);
|
|
Helper.SetTableLabelValue(this.label4Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[7]);
|
|
Helper.SetTableLabelValue(this.label4Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[8]);
|
|
Helper.SetTableLabelValue(this.label4Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[3].C_StorageItem[9]);
|
|
|
|
Helper.SetTableLabelValue(this.label4Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[3].WeightTenAverage());
|
|
Helper.SetTableLabelValue(this.label4AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[3].WeightTotalAverage());
|
|
}
|
|
private void UpdateLabelDisplayLane5()
|
|
{
|
|
// Lane 5
|
|
this.CollectionWeightStorageItem[4].SetQueueData();
|
|
Helper.SetTableLabelValue(this.label5Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[0]);
|
|
Helper.SetTableLabelValue(this.label5Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[1]);
|
|
Helper.SetTableLabelValue(this.label5Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[2]);
|
|
Helper.SetTableLabelValue(this.label5Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[3]);
|
|
Helper.SetTableLabelValue(this.label5Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[4]);
|
|
Helper.SetTableLabelValue(this.label5Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[5]);
|
|
Helper.SetTableLabelValue(this.label5Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[6]);
|
|
Helper.SetTableLabelValue(this.label5Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[7]);
|
|
Helper.SetTableLabelValue(this.label5Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[8]);
|
|
Helper.SetTableLabelValue(this.label5Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[4].C_StorageItem[9]);
|
|
|
|
Helper.SetTableLabelValue(this.label5Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[4].WeightTenAverage());
|
|
Helper.SetTableLabelValue(this.label5AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[4].WeightTotalAverage());
|
|
}
|
|
private void UpdateLabelDisplayLane6()
|
|
{
|
|
// Lane 6
|
|
this.CollectionWeightStorageItem[5].SetQueueData();
|
|
Helper.SetTableLabelValue(this.label6Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[0]);
|
|
Helper.SetTableLabelValue(this.label6Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[1]);
|
|
Helper.SetTableLabelValue(this.label6Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[2]);
|
|
Helper.SetTableLabelValue(this.label6Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[3]);
|
|
Helper.SetTableLabelValue(this.label6Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[4]);
|
|
Helper.SetTableLabelValue(this.label6Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[5]);
|
|
Helper.SetTableLabelValue(this.label6Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[6]);
|
|
Helper.SetTableLabelValue(this.label6Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[7]);
|
|
Helper.SetTableLabelValue(this.label6Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[8]);
|
|
Helper.SetTableLabelValue(this.label6Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[5].C_StorageItem[9]);
|
|
|
|
Helper.SetTableLabelValue(this.label6Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[5].WeightTenAverage());
|
|
Helper.SetTableLabelValue(this.label6AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
|
|
this.CollectionWeightStorageItem[5].WeightTotalAverage());
|
|
}
|
|
|
|
public void UpdateEquipmentStatusDisplay(DataStore.EquipmentStatus status)
|
|
{
|
|
string temp = "";
|
|
|
|
foreach (SmartX.SmartLabel label in this.CollectionLabelWeightValue)
|
|
{
|
|
temp = Helper.StringToDecimalPlaces("0", this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (label.Text != temp)
|
|
label.Text = temp;
|
|
}
|
|
|
|
foreach (SmartProgressBar bar in this.CollectionProgressBar)
|
|
bar.Value = bar.Minimum;
|
|
}
|
|
public void UpdateCurrentProductDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
|
|
{
|
|
foreach (SmartProgressBar bar in this.CollectionProgressBar)
|
|
bar.Value = bar.Minimum;
|
|
|
|
this.SetCount(this.ParentForm.ParentForm.CollectionWeightData);
|
|
}
|
|
public void UpdateBypassDisplay(Collection<WeightData> weightData)
|
|
{
|
|
for (int i = 0; i < this.CollectionPictureBoxBypass.Count; i++)
|
|
{
|
|
if (weightData[i].IsBypassMode == true)
|
|
this.CollectionPictureBoxBypass[i].Visible = true;
|
|
else
|
|
this.CollectionPictureBoxBypass[i].Visible = false;
|
|
}
|
|
}
|
|
public void UpdateStopWeightDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
|
|
{
|
|
string value = "";
|
|
|
|
if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns > weightDatas.Count)
|
|
return;
|
|
|
|
if (status == DataStore.EquipmentStatus.Stop)
|
|
{
|
|
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EquipmentColumns; i++)
|
|
{
|
|
// 중량
|
|
value = Helper.DoubleToString(weightDatas[i].Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.CollectionLabelWeightValue[i].Text != value)
|
|
this.CollectionLabelWeightValue[i].Text = value;
|
|
if (this.CollectionLabelWeightValue[i].ForeColor != Color.Black)
|
|
this.CollectionLabelWeightValue[i].ForeColor = Color.Black;
|
|
|
|
// 영점표시
|
|
if (weightDatas[i].Status == DataStore.WeightStatus.WeightZero)
|
|
this.CollectionPictureBoxZero[i].Visible = true;
|
|
else
|
|
this.CollectionPictureBoxZero[i].Visible = false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EquipmentColumns; i++)
|
|
{
|
|
// 영점표시
|
|
if (weightDatas[i].Status == DataStore.WeightStatus.WeightZero)
|
|
this.CollectionPictureBoxZero[i].Visible = true;
|
|
else
|
|
this.CollectionPictureBoxZero[i].Visible = false;
|
|
}
|
|
}
|
|
}
|
|
public void UpdateStartWeightDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
|
|
{
|
|
this.UpdateStartWeightDisplay1(status, weightDatas[0]);
|
|
this.UpdateStartWeightDisplay2(status, weightDatas[1]);
|
|
this.UpdateStartWeightDisplay3(status, weightDatas[2]);
|
|
this.UpdateStartWeightDisplay4(status, weightDatas[3]);
|
|
this.UpdateStartWeightDisplay5(status, weightDatas[4]);
|
|
this.UpdateStartWeightDisplay6(status, weightDatas[5]);
|
|
}
|
|
public void UpdateStartWeightDisplay1(DataStore.EquipmentStatus status, WeightData weightData)
|
|
{
|
|
string value = "";
|
|
bool empty = false;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
|
|
return;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
|
|
empty = true;
|
|
|
|
#region Bar
|
|
// Weight
|
|
value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.labelWeightValue1.Text != value)
|
|
this.labelWeightValue1.Text = value;
|
|
|
|
if (empty == false)
|
|
{
|
|
this.labelWeightValue1.ForeColor = Color.Black;
|
|
|
|
value = weightData.PassCount.ToString();
|
|
if (this.labelPassCount1.Text != value)
|
|
this.labelPassCount1.Text = value;
|
|
|
|
value = weightData.TotalNGCount.ToString();
|
|
if (this.labelNGCount1.Text != value)
|
|
this.labelNGCount1.Text = value;
|
|
|
|
Helper.SetProgressBarValue(this.progressBar1, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
}
|
|
else
|
|
{
|
|
this.labelWeightValue1.ForeColor = Color.Gray;
|
|
this.progressBar1.Value = this.progressBar1.Minimum;
|
|
this.progressBar1.BarColor1 = Color.Lime;
|
|
}
|
|
#endregion
|
|
|
|
#region Table
|
|
this.CollectionWeightStorageItem[0].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);
|
|
|
|
this.UpdateLabelDisplayLane1();
|
|
#endregion
|
|
}
|
|
public void UpdateStartWeightDisplay2(DataStore.EquipmentStatus status, WeightData weightData)
|
|
{
|
|
string value = "";
|
|
bool empty = false;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
|
|
return;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
|
|
empty = true;
|
|
|
|
#region Bar
|
|
// Weight
|
|
value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.labelWeightValue2.Text != value)
|
|
this.labelWeightValue2.Text = value;
|
|
|
|
if (empty == false)
|
|
{
|
|
this.labelWeightValue2.ForeColor = Color.Black;
|
|
|
|
value = weightData.PassCount.ToString();
|
|
if (this.labelPassCount2.Text != value)
|
|
this.labelPassCount2.Text = value;
|
|
|
|
value = weightData.TotalNGCount.ToString();
|
|
if (this.labelNGCount2.Text != value)
|
|
this.labelNGCount2.Text = value;
|
|
|
|
Helper.SetProgressBarValue(this.progressBar2, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
}
|
|
else
|
|
{
|
|
this.labelWeightValue2.ForeColor = Color.Gray;
|
|
this.progressBar2.Value = this.progressBar2.Minimum;
|
|
this.progressBar2.BarColor1 = Color.Lime;
|
|
}
|
|
#endregion
|
|
|
|
#region Table
|
|
this.CollectionWeightStorageItem[1].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);
|
|
|
|
this.UpdateLabelDisplayLane2();
|
|
#endregion
|
|
}
|
|
public void UpdateStartWeightDisplay3(DataStore.EquipmentStatus status, WeightData weightData)
|
|
{
|
|
string value = "";
|
|
bool empty = false;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
|
|
return;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
|
|
empty = true;
|
|
|
|
#region Bar
|
|
// Weight
|
|
value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.labelWeightValue3.Text != value)
|
|
this.labelWeightValue3.Text = value;
|
|
|
|
if (empty == false)
|
|
{
|
|
this.labelWeightValue3.ForeColor = Color.Black;
|
|
|
|
value = weightData.PassCount.ToString();
|
|
if (this.labelPassCount3.Text != value)
|
|
this.labelPassCount3.Text = value;
|
|
|
|
value = weightData.TotalNGCount.ToString();
|
|
if (this.labelNGCount3.Text != value)
|
|
this.labelNGCount3.Text = value;
|
|
|
|
Helper.SetProgressBarValue(this.progressBar3, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
}
|
|
else
|
|
{
|
|
this.labelWeightValue3.ForeColor = Color.Gray;
|
|
this.progressBar3.Value = this.progressBar3.Minimum;
|
|
this.progressBar3.BarColor1 = Color.Lime;
|
|
}
|
|
#endregion
|
|
|
|
#region Table
|
|
this.CollectionWeightStorageItem[2].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);
|
|
|
|
this.UpdateLabelDisplayLane3();
|
|
#endregion
|
|
}
|
|
public void UpdateStartWeightDisplay4(DataStore.EquipmentStatus status, WeightData weightData)
|
|
{
|
|
string value = "";
|
|
bool empty = false;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
|
|
return;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
|
|
empty = true;
|
|
|
|
#region Bar
|
|
// Weight
|
|
value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.labelWeightValue4.Text != value)
|
|
this.labelWeightValue4.Text = value;
|
|
|
|
if (empty == false)
|
|
{
|
|
this.labelWeightValue4.ForeColor = Color.Black;
|
|
|
|
value = weightData.PassCount.ToString();
|
|
if (this.labelPassCount4.Text != value)
|
|
this.labelPassCount4.Text = value;
|
|
|
|
value = weightData.TotalNGCount.ToString();
|
|
if (this.labelNGCount4.Text != value)
|
|
this.labelNGCount4.Text = value;
|
|
|
|
Helper.SetProgressBarValue(this.progressBar4, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
}
|
|
else
|
|
{
|
|
this.labelWeightValue4.ForeColor = Color.Gray;
|
|
this.progressBar4.Value = this.progressBar4.Minimum;
|
|
this.progressBar4.BarColor1 = Color.Lime;
|
|
}
|
|
#endregion
|
|
|
|
#region Table
|
|
this.CollectionWeightStorageItem[3].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);
|
|
|
|
this.UpdateLabelDisplayLane4();
|
|
#endregion
|
|
}
|
|
public void UpdateStartWeightDisplay5(DataStore.EquipmentStatus status, WeightData weightData)
|
|
{
|
|
string value = "";
|
|
bool empty = false;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
|
|
return;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
|
|
empty = true;
|
|
|
|
#region Bar
|
|
// Weight
|
|
value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.labelWeightValue5.Text != value)
|
|
this.labelWeightValue5.Text = value;
|
|
|
|
if (empty == false)
|
|
{
|
|
this.labelWeightValue5.ForeColor = Color.Black;
|
|
|
|
value = weightData.PassCount.ToString();
|
|
if (this.labelPassCount5.Text != value)
|
|
this.labelPassCount5.Text = value;
|
|
|
|
value = weightData.TotalNGCount.ToString();
|
|
if (this.labelNGCount5.Text != value)
|
|
this.labelNGCount5.Text = value;
|
|
|
|
Helper.SetProgressBarValue(this.progressBar5, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
}
|
|
else
|
|
{
|
|
this.labelWeightValue5.ForeColor = Color.Gray;
|
|
this.progressBar5.Value = this.progressBar5.Minimum;
|
|
this.progressBar5.BarColor1 = Color.Lime;
|
|
}
|
|
#endregion
|
|
|
|
#region Table
|
|
this.CollectionWeightStorageItem[4].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);
|
|
|
|
this.UpdateLabelDisplayLane5();
|
|
#endregion
|
|
}
|
|
public void UpdateStartWeightDisplay6(DataStore.EquipmentStatus status, WeightData weightData)
|
|
{
|
|
string value = "";
|
|
bool empty = false;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
|
|
return;
|
|
|
|
if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
|
|
empty = true;
|
|
|
|
#region Bar
|
|
// Weight
|
|
value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
if (this.labelWeightValue6.Text != value)
|
|
this.labelWeightValue6.Text = value;
|
|
|
|
if (empty == false)
|
|
{
|
|
this.labelWeightValue6.ForeColor = Color.Black;
|
|
|
|
value = weightData.PassCount.ToString();
|
|
if (this.labelPassCount6.Text != value)
|
|
this.labelPassCount6.Text = value;
|
|
|
|
value = weightData.TotalNGCount.ToString();
|
|
if (this.labelNGCount6.Text != value)
|
|
this.labelNGCount6.Text = value;
|
|
|
|
Helper.SetProgressBarValue(this.progressBar6, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
|
|
}
|
|
else
|
|
{
|
|
this.labelWeightValue6.ForeColor = Color.Gray;
|
|
this.progressBar6.Value = this.progressBar6.Minimum;
|
|
this.progressBar6.BarColor1 = Color.Lime;
|
|
}
|
|
#endregion
|
|
|
|
#region Table
|
|
this.CollectionWeightStorageItem[5].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);
|
|
|
|
this.UpdateLabelDisplayLane6();
|
|
#endregion
|
|
}
|
|
#endregion
|
|
}
|
|
}
|