using System; using System.Linq; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using ITC81DB.Forms; using ITC81DB_ImageDll; namespace ITC81DB.Controls { public partial class ControlMainListForRFID : UserControl { #region Field private FormMainDisplay m_ParentForm; #endregion #region Constructor public ControlMainListForRFID(FormMainDisplay parent) { InitializeComponent(); this.ParentForm = parent; this.InitializeDesign(); this.DefaultSetting(); } #endregion #region Property public FormMainDisplay ParentForm { get { return this.m_ParentForm; } private set { this.m_ParentForm = value; } } #endregion #region Method public void InitializeDesign() { Class1 images = new Class1(); if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.English) { this.labelTitleTotalCount.Text = "Total"; this.labelStaticProductNumber.Text = "No"; this.labelStaticTime.Text = "Time"; this.labelStaticWeight.Text = "Weight"; this.labelStaticGrade.Text = "Grade"; this.labelStaticTAG.Text = "TAG"; } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Chinese) { this.labelTitleTotalCount.Text = "总共计数"; this.labelStaticProductNumber.Text = "编号"; this.labelStaticTime.Text = "时间"; this.labelStaticWeight.Text = "重量"; this.labelStaticGrade.Text = "等级"; this.labelStaticTAG.Text = "标签"; } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Czech) { } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Russian) { this.labelTitleTotalCount.Text = "Итоги"; this.labelStaticProductNumber.Text = "№"; this.labelStaticTime.Text = "Время"; this.labelStaticWeight.Text = "Вес"; this.labelStaticGrade.Text = "Сортировка"; this.labelStaticTAG.Text = "Тег"; } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German) { this.labelTitleTotalCount.Text = "Insgesamt"; this.labelStaticProductNumber.Text = "Nr."; this.labelStaticTime.Text = "Zeit"; this.labelStaticWeight.Text = "Gewicht"; this.labelStaticGrade.Text = "Ergebnis"; this.labelStaticTAG.Text = "Etikett"; } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Spanish) { this.labelTitleTotalCount.Text = "Total"; this.labelStaticProductNumber.Text = "No"; this.labelStaticTime.Text = "Tiempo"; this.labelStaticWeight.Text = "Peso"; this.labelStaticGrade.Text = "Calificación"; this.labelStaticTAG.Text = "TAG"; } else { this.labelTitleTotalCount.Text = "전체수량"; this.labelStaticProductNumber.Text = "품번"; this.labelStaticTime.Text = "시간"; this.labelStaticWeight.Text = "중량"; this.labelStaticGrade.Text = "등급"; this.labelStaticTAG.Text = "TAG"; } } private void DefaultSetting() { } public void UpdateEquipmentStatusDisplay(DataStore.EquipmentStatus status) { } public void UpdateCurrentProductDisplay(DataStore.EquipmentStatus status, ProductItem pItem, WeightData wData) { //this.Clear(); } public void UpdateStartWeightDisplay(DataStore.EquipmentStatus status, ProductItem pItem, WeightData wData, string tag) { string value = "", time = "", weight = "", no = "", total = ""; total = wData.TotalCount.ToString(); no = pItem.Number.ToString(); time = string.Format(@"{0:HH:mm:ss}", DateTime.Now); weight = Helper.DoubleToString(wData.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces); if(wData.Weight == this.ParentForm.ParentForm.OverloadWeight) value = string.Format("{0,12}{1,12}{2,15}{3,13}{4,15}{5,40}", total, no, time, wData.JudgmentStatus, "O.L", tag); else value = string.Format("{0,12}{1,12}{2,15}{3,13}{4,15}{5,40}", total, no, time, wData.JudgmentStatus, weight, tag); if (this.smartListBox.Items.Count >= 100) this.smartListBox.RemoveItem(0); this.smartListBox.AddItem(value); this.smartListBox.ScrollDown(); } public void Clear() { this.smartListBox.ClearAll(); } public void DisplayRefresh(SystemStatus status) { } #endregion #region Event Handler private void buttonListUp_Click(object sender, EventArgs e) { if (this.smartListBox.ViewStartItemIndex / 9 > 0) this.smartListBox.ScrollUp(161); else this.smartListBox.ScrollUp(); this.smartListBox.SelectItemIndex = -1; } private void buttonListDown_Click(object sender, EventArgs e) { if (this.smartListBox.ViewRemainCount / 9 > 0) this.smartListBox.ScrollDown(161); else this.smartListBox.ScrollDown(); this.smartListBox.SelectItemIndex = -1; } private void buttonListRapidDown_Click(object sender, EventArgs e) { this.smartListBox.ScrollDown(this.smartListBox.ViewRemainCount / 9 * 161); for (int i = 0; i < this.smartListBox.ViewRemainCount % 9; i++) this.smartListBox.ScrollDown(); this.smartListBox.SelectItemIndex = -1; } #endregion } }