INT69DB_2A/INT69DB_2A/Forms/FormMainDisplay.cs

2787 lines
138 KiB
C#

using System;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using SmartX;
using INT69DB_2A_ImageDll;
using INT69DB_2A.Controls;
using INT69DB_2A.DialogForms;
using INT69DB_2A.Part11_UserManager;
namespace INT69DB_2A.Forms
{
public partial class FormMainDisplay : Form
{
#region Field
private FormMain m_ParentForm;
private Color ColorButtonAccessTrue;
private Color ColorButtonAccessFalse;
private DataStore.FormMainDisplayStore MainDisplay;
private ControlMainDisplayDotGraph2 MainDisplayDotGraph2;
private ControlMainDisplayDotGraph3 MainDisplayDotGraph3;
private ControlMainDisplayDotGraph4 MainDisplayDotGraph4;
private ControlMainDisplayDotGraph5 MainDisplayDotGraph5;
private ControlMainDisplayDotGraph6 MainDisplayDotGraph6;
private ControlMainDisplayDotGraph7 MainDisplayDotGraph7;
private ControlMainDisplayDotGraph8 MainDisplayDotGraph8;
private ControlMainDisplayDotGraph10 MainDisplayDotGraph10;
private ControlMainDisplayEachBarGraph2 MainDisplayEachBarGraph2;
private ControlMainDisplayEachBarGraph3 MainDisplayEachBarGraph3;
private ControlMainDisplayEachBarGraph4 MainDisplayEachBarGraph4;
private ControlMainDisplayEachBarGraph5 MainDisplayEachBarGraph5;
private ControlMainDisplayEachBarGraph6 MainDisplayEachBarGraph6;
private ControlMainDisplayEachBarGraph7 MainDisplayEachBarGraph7;
private ControlMainDisplayEachBarGraph8 MainDisplayEachBarGraph8;
private ControlMainDisplayEachBarGraph10 MainDisplayEachBarGraph10;
private ControlMainDisplayTable2 MainDisplayTable2;
private ControlMainDisplayTable3 MainDisplayTable3;
private ControlMainDisplayTable4 MainDisplayTable4;
private ControlMainDisplayTable5 MainDisplayTable5;
private ControlMainDisplayTable6 MainDisplayTable6;
private ControlMainDisplayTable7 MainDisplayTable7;
private ControlMainDisplayTable8 MainDisplayTable8;
private ControlMainDisplayTable10 MainDisplayTable10;
#endregion
#region Constructor
public FormMainDisplay(FormMain parent)
{
InitializeComponent();
this.ParentForm = parent;
this.InitializeDesign();
this.InitializeControl();
this.DefaultSetting();
}
#endregion
#region Property
public FormMain ParentForm
{
get { return this.m_ParentForm; }
private set { this.m_ParentForm = value; }
}
#endregion
#region Method
/// <summary>
/// 언어별 화면 디자인
/// </summary>
private void InitializeDesign()
{
ImageDll images = new ImageDll();
if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Korean)
{
if (this.ParentForm.SystemConfig.IsLogin == false)
{
this.buttonMenu.Location = new Point(597, 545);
this.buttonMenu.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.korFormMainDisplayMenuBigDisable));
this.buttonMenu.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.korFormMainDisplayMenuBigDown));
this.buttonMenu.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.korFormMainDisplayMenuBigUp));
}
}
else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.English)
{
this.groupBoxSorter.Text = "Sorter settings";
this.labelStaticSorterDelayTime.Text = "Delay";
this.labelStaticSorterRunTime.Text = "Run";
this.groupBoxConveyor.Text = "Conveyor settings";
this.labelStaticRejectConveyor.Text = "Reject conveyor";
this.labelStaticRejectConveyorDelayTime.Text = "Delay";
this.labelStaticRejectConveyorRunTime.Text = "Run";
this.labelStaticFeedingConveyor.Text = "Feeding conveyor";
this.labelStaticFeedingDelayTime.Text = "Delay";
this.labelStaticFeedingRunTime.Text = "Run";
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBypassCountUp));
this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayLoginDisable));
this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayLogoutUp));
this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayLoginUp));
if (this.ParentForm.SystemConfig.IsLogin == false)
{
this.buttonMenu.Location = new Point(597, 545);
this.buttonMenu.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayMenuBigDisable));
this.buttonMenu.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayMenuBigDown));
this.buttonMenu.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayMenuBigUp));
}
else
{
this.buttonMenu.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayMenuDisable));
this.buttonMenu.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayMenuDown));
this.buttonMenu.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainDisplayMenuUp));
}
this.buttonOver.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainOverDisable));
this.buttonOver.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainOverDown));
this.buttonOver.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainOverUp));
this.buttonPass.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainPassDisable));
this.buttonPass.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainPassDown));
this.buttonPass.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainPassUp));
this.buttonTare.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainTareDisable));
this.buttonTare.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainTareDown));
this.buttonTare.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainTareUp));
this.buttonUnder.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainUnderDisable));
this.buttonUnder.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainUnderDown));
this.buttonUnder.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engFormMainUnderUp));
}
else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Chinese)
{
//this.labelScreen.Text = "屏幕";
this.labelStaticTotalCount.Text = "总共";
this.smartLabel3.Text = "不良";
this.smartLabel5.Text = "速度";
this.labelTitleBypass.Text = "旁路";
this.groupBoxSorter.Text = "筛选设定";
this.labelStaticSorterDelayTime.Text = "延迟时间";
this.labelStaticSorterRunTime.Text = "运行时间";
this.groupBoxConveyor.Text = "输送带设置";
this.labelStaticRejectConveyor.Text = "筛选输送带";
this.labelStaticRejectConveyorDelayTime.Text = "延迟时间";
this.labelStaticRejectConveyorRunTime.Text = "运行时间";
this.labelStaticFeedingConveyor.Text = "进料输送带";
this.labelStaticFeedingDelayTime.Text = "延迟时间";
this.labelStaticFeedingRunTime.Text = "运行时间";
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBypassCountUp));
this.buttonBypassDirection.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBypassOccasionDown));
this.buttonBypassDirection.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBypassOccasionUp));
this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayLoginDisable));
this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayLogoutUp));
this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayLoginUp));
if (this.ParentForm.SystemConfig.IsLogin == false)
{
this.buttonMenu.Location = new Point(597, 545);
this.buttonMenu.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayMenuBigDisable));
this.buttonMenu.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayMenuBigDown));
this.buttonMenu.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayMenuBigUp));
}
else
{
this.buttonMenu.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayMenuDisable));
this.buttonMenu.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayMenuDown));
this.buttonMenu.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainDisplayMenuUp));
}
this.buttonOver.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainOverDisable));
this.buttonOver.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainOverDown));
this.buttonOver.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainOverUp));
this.buttonPass.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainPassDisable));
this.buttonPass.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainPassDown));
this.buttonPass.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainPassUp));
this.buttonTare.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainTareDisable));
this.buttonTare.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainTareDown));
this.buttonTare.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainTareUp));
this.buttonUnder.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainUnderDisable));
this.buttonUnder.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainUnderDown));
this.buttonUnder.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnFormMainUnderUp));
}
else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Czech)
{
}
else
{
}
}
private void InitializeControl()
{
if (this.ParentForm.IsBootingComplete == false)
this.buttonProductNo.Text = "**";
else
this.buttonProductNo.Text = this.ParentForm.SystemConfig.ProductNumber.ToString();
this.buttonUnder.Text = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.UnderRange, this.ParentForm.SystemConfig.DecimalPlaces);
this.buttonPass.Text = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.PassRange, this.ParentForm.SystemConfig.DecimalPlaces);
this.buttonOver.Text = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.OverRange, this.ParentForm.SystemConfig.DecimalPlaces);
this.buttonTare.Text = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.TareRange, this.ParentForm.SystemConfig.DecimalPlaces);
this.labelProductName.Text = this.ParentForm.CurrentProductItem.Name;
this.labelLotNo.Text = this.ParentForm.CurrentProductItem.LotNo;
this.labelProductionSpeed.Text = "0";
this.buttonCut.Visible = this.ParentForm.SystemConfig.IsCutView;
this.pictureBoxUSBBackOn.Visible = this.ParentForm.SystemConfig.IsDataBackup;
if (this.ParentForm.SystemConfig.Serial3Mode == 0)
this.labelIconSerial3.Visible = false;
else
this.labelIconSerial3.Visible = true;
if (this.ParentForm.SystemConfig.Serial3Mode == 4)
this.buttonPrint.Visible = true;
else
this.buttonPrint.Visible = false;
this.labelIconBypassMode.Visible = this.ParentForm.SystemConfig.IsBypassMode;
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
this.MainDisplayEachBarGraph2 = new ControlMainDisplayEachBarGraph2(this);
this.Controls.Add(this.MainDisplayEachBarGraph2);
this.MainDisplayEachBarGraph2.BringToFront();
this.MainDisplayEachBarGraph2.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph2 = new ControlMainDisplayDotGraph2(this);
this.Controls.Add(this.MainDisplayDotGraph2);
this.MainDisplayDotGraph2.BringToFront();
this.MainDisplayDotGraph2.Location = new Point(0, 63);
this.MainDisplayTable2 = new ControlMainDisplayTable2(this);
this.Controls.Add(this.MainDisplayTable2);
this.MainDisplayTable2.BringToFront();
this.MainDisplayTable2.Location = new Point(0, 63);
break;
case 3:
this.MainDisplayEachBarGraph3 = new ControlMainDisplayEachBarGraph3(this);
this.Controls.Add(this.MainDisplayEachBarGraph3);
this.MainDisplayEachBarGraph3.BringToFront();
this.MainDisplayEachBarGraph3.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph3 = new ControlMainDisplayDotGraph3(this);
this.Controls.Add(this.MainDisplayDotGraph3);
this.MainDisplayDotGraph3.BringToFront();
this.MainDisplayDotGraph3.Location = new Point(0, 63);
this.MainDisplayTable3 = new ControlMainDisplayTable3(this);
this.Controls.Add(this.MainDisplayTable3);
this.MainDisplayTable3.BringToFront();
this.MainDisplayTable3.Location = new Point(0, 63);
break;
case 4:
this.MainDisplayEachBarGraph4 = new ControlMainDisplayEachBarGraph4(this);
this.Controls.Add(this.MainDisplayEachBarGraph4);
this.MainDisplayEachBarGraph4.BringToFront();
this.MainDisplayEachBarGraph4.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph4 = new ControlMainDisplayDotGraph4(this);
this.Controls.Add(this.MainDisplayDotGraph4);
this.MainDisplayDotGraph4.BringToFront();
this.MainDisplayDotGraph4.Location = new Point(0, 63);
this.MainDisplayTable4 = new ControlMainDisplayTable4(this);
this.Controls.Add(this.MainDisplayTable4);
this.MainDisplayTable4.BringToFront();
this.MainDisplayTable4.Location = new Point(0, 63);
break;
case 5:
this.MainDisplayEachBarGraph5 = new ControlMainDisplayEachBarGraph5(this);
this.Controls.Add(this.MainDisplayEachBarGraph5);
this.MainDisplayEachBarGraph5.BringToFront();
this.MainDisplayEachBarGraph5.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph5 = new ControlMainDisplayDotGraph5(this);
this.Controls.Add(this.MainDisplayDotGraph5);
this.MainDisplayDotGraph5.BringToFront();
this.MainDisplayDotGraph5.Location = new Point(0, 63);
this.MainDisplayTable5 = new ControlMainDisplayTable5(this);
this.Controls.Add(this.MainDisplayTable5);
this.MainDisplayTable5.BringToFront();
this.MainDisplayTable5.Location = new Point(0, 63);
break;
case 6:
this.MainDisplayEachBarGraph6 = new ControlMainDisplayEachBarGraph6(this);
this.Controls.Add(this.MainDisplayEachBarGraph6);
this.MainDisplayEachBarGraph6.BringToFront();
this.MainDisplayEachBarGraph6.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph6 = new ControlMainDisplayDotGraph6(this);
this.Controls.Add(this.MainDisplayDotGraph6);
this.MainDisplayDotGraph6.BringToFront();
this.MainDisplayDotGraph6.Location = new Point(0, 63);
this.MainDisplayTable6 = new ControlMainDisplayTable6(this);
this.Controls.Add(this.MainDisplayTable6);
this.MainDisplayTable6.BringToFront();
this.MainDisplayTable6.Location = new Point(0, 63);
break;
case 7:
this.MainDisplayEachBarGraph7 = new ControlMainDisplayEachBarGraph7(this);
this.Controls.Add(this.MainDisplayEachBarGraph7);
this.MainDisplayEachBarGraph7.BringToFront();
this.MainDisplayEachBarGraph7.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph7 = new ControlMainDisplayDotGraph7(this);
this.Controls.Add(this.MainDisplayDotGraph7);
this.MainDisplayDotGraph7.BringToFront();
this.MainDisplayDotGraph7.Location = new Point(0, 63);
this.MainDisplayTable7 = new ControlMainDisplayTable7(this);
this.Controls.Add(this.MainDisplayTable7);
this.MainDisplayTable7.BringToFront();
this.MainDisplayTable7.Location = new Point(0, 63);
break;
case 8:
this.MainDisplayEachBarGraph8 = new ControlMainDisplayEachBarGraph8(this);
this.Controls.Add(this.MainDisplayEachBarGraph8);
this.MainDisplayEachBarGraph8.BringToFront();
this.MainDisplayEachBarGraph8.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph8 = new ControlMainDisplayDotGraph8(this);
this.Controls.Add(this.MainDisplayDotGraph8);
this.MainDisplayDotGraph8.BringToFront();
this.MainDisplayDotGraph8.Location = new Point(0, 63);
this.MainDisplayTable8 = new ControlMainDisplayTable8(this);
this.Controls.Add(this.MainDisplayTable8);
this.MainDisplayTable8.BringToFront();
this.MainDisplayTable8.Location = new Point(0, 63);
break;
case 10:
this.MainDisplayEachBarGraph10 = new ControlMainDisplayEachBarGraph10(this);
this.Controls.Add(this.MainDisplayEachBarGraph10);
this.MainDisplayEachBarGraph10.BringToFront();
this.MainDisplayEachBarGraph10.Location = new Point(0, 63);
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.MainDisplayDotGraph10 = new ControlMainDisplayDotGraph10(this);
this.Controls.Add(this.MainDisplayDotGraph10);
this.MainDisplayDotGraph10.BringToFront();
this.MainDisplayDotGraph10.Location = new Point(0, 63);
this.MainDisplayTable10 = new ControlMainDisplayTable10(this);
this.Controls.Add(this.MainDisplayTable10);
this.MainDisplayTable10.BringToFront();
this.MainDisplayTable10.Location = new Point(0, 63);
break;
default:
break;
}
this.UpdateDisplay(this.MainDisplay);
}
private void DefaultSetting()
{
this.RescaleControl();
this.ColorButtonAccessTrue = Color.Black;
this.ColorButtonAccessFalse = Color.DimGray;
this.panelSetting.Location = new Point(60, 91);
this.panelSetting.Visible = false;
this.panelSubMenu.Location = new Point(10, 489);
this.panelSubMenu.Visible = false;
this.panelSubMenu.BringToFront();
this.groupBoxSorter.Visible = false;
this.groupBoxConveyor.Location = new Point(this.groupBoxSorter.Location.X, this.groupBoxSorter.Location.Y);
this.groupBoxConveyor.Visible = true;
if (this.ParentForm.SystemConfig.IsDischargeConveyor == false)
{
this.labelDischargeConveyorDelayTime.Enabled = false;
this.labelDischargeConveyorOperatingTime.Enabled = false;
this.labelStaticRejectConveyorDelayTime.ForeColor = Color.Gray;
this.labelStaticRejectConveyorRunTime.ForeColor = Color.Gray;
this.labelDischargeConveyorDelayTime.ForeColor = Color.Gray;
this.labelDischargeConveyorOperatingTime.ForeColor = Color.Gray;
}
if (this.ParentForm.SystemConfig.IsFeedingConveyor == false)
{
this.labelFeedingConveyorDelayTime.Enabled = false;
this.labelFeedingConveyorOperatingTime.Enabled = false;
this.labelStaticFeedingDelayTime.ForeColor = Color.Gray;
this.labelStaticFeedingRunTime.ForeColor = Color.Gray;
this.labelFeedingConveyorDelayTime.ForeColor = Color.Gray;
this.labelFeedingConveyorOperatingTime.ForeColor = Color.Gray;
}
// Login
if (this.ParentForm.SystemConfig.IsLogin == true)
this.UpdateDisplayUser(this.ParentForm.SystemConfig.CurrentUser);
else
{
this.buttonUser.Visible = false;
this.labelUserID.Visible = false;
this.labelUserLevel.Visible = false;
}
// Ethernet
if (this.ParentForm.SystemConfig.EthernetMode == 0)
{
this.pictureBoxEthernetConnection.Visible = false;
this.pictureBoxEthernetDisconnection.Visible = false;
}
else
{
this.pictureBoxEthernetConnection.Visible = false;
this.pictureBoxEthernetDisconnection.Visible = true;
}
}
private void Login()
{
DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm);
if (logOn.ShowDialog() == DialogResult.OK)
{
this.DisplayRefresh();
this.buttonUser.ButtonDown();
//this.ParentForm.TimerAutomaticLogout(true, this.ParentForm.SystemConfig.AutomaticLogout);
// Part 11
if (this.ParentForm.SystemConfig.IsPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Login, "");
}
else
{
this.buttonUser.ButtonUp();
}
}
private bool UI_Invoke(ThreadStart invoker)
{
try
{
if (this.InvokeRequired)
{
if (this.IsDisposed)
return true;
this.Invoke(invoker);
}
else
{
invoker();
}
return true;
}
catch (Exception e)
{
return false;
}
}
private void UpdateDisplay(DataStore.FormMainDisplayStore displayForm)
{
if (displayForm == DataStore.FormMainDisplayStore.FormMainDisplayBarGraph)
{
#region BarGraph
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.Visible = true;
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.Visible = false;
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.Visible = false;
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.Visible = true;
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.Visible = false;
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.Visible = false;
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.Visible = true;
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.Visible = false;
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.Visible = false;
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.Visible = true;
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.Visible = false;
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.Visible = false;
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.Visible = true;
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.Visible = false;
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.Visible = false;
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.Visible = true;
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.Visible = false;
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.Visible = false;
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.Visible = true;
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.Visible = false;
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.Visible = false;
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.Visible = true;
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.Visible = false;
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.Visible = false;
break;
default:
break;
}
this.UpdateDisplayButton(SmartButton.BUTSTATUS.DOWN, SmartButton.BUTSTATUS.UP, SmartButton.BUTSTATUS.UP);
#endregion
}
else if (displayForm == DataStore.FormMainDisplayStore.FormMainDisplayDotGraph)
{
#region DotGraph
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.Visible = false;
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.Visible = true;
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.Visible = false;
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.Visible = false;
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.Visible = true;
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.Visible = false;
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.Visible = false;
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.Visible = true;
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.Visible = false;
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.Visible = false;
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.Visible = true;
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.Visible = false;
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.Visible = false;
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.Visible = true;
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.Visible = false;
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.Visible = false;
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.Visible = true;
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.Visible = false;
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.Visible = false;
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.Visible = true;
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.Visible = false;
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.Visible = false;
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.Visible = true;
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.Visible = false;
break;
default:
break;
}
this.UpdateDisplayButton(SmartButton.BUTSTATUS.UP, SmartButton.BUTSTATUS.DOWN, SmartButton.BUTSTATUS.UP);
#endregion
}
else if (displayForm == DataStore.FormMainDisplayStore.FormMainDisplayTable)
{
#region Table
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.Visible = false;
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.Visible = false;
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.Visible = true;
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.Visible = false;
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.Visible = false;
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.Visible = true;
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.Visible = false;
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.Visible = false;
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.Visible = true;
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.Visible = false;
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.Visible = false;
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.Visible = true;
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.Visible = false;
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.Visible = false;
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.Visible = true;
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.Visible = false;
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.Visible = false;
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.Visible = true;
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.Visible = false;
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.Visible = false;
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.Visible = true;
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.Visible = false;
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.Visible = false;
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.Visible = true;
break;
default:
break;
}
this.UpdateDisplayButton(SmartButton.BUTSTATUS.UP, SmartButton.BUTSTATUS.UP, SmartButton.BUTSTATUS.DOWN);
#endregion
}
}
private void UpdateDisplayButton(SmartButton.BUTSTATUS buttonBar, SmartButton.BUTSTATUS buttonDot, SmartButton.BUTSTATUS buttonTable)
{
if (buttonBar == SmartButton.BUTSTATUS.DOWN)
this.buttonBarGraphForm.ButtonDown();
else
this.buttonBarGraphForm.ButtonUp();
if (buttonDot == SmartButton.BUTSTATUS.DOWN)
this.buttonDotGraphForm.ButtonDown();
else
this.buttonDotGraphForm.ButtonUp();
if (buttonTable == SmartButton.BUTSTATUS.DOWN)
this.buttonTableForm.ButtonDown();
else
this.buttonTableForm.ButtonUp();
}
private void UpdateDisplayUser(UserItem user)
{
string id = "", group = "";
switch (user.Status)
{
case DataStore.UserStatus.None:
break;
case DataStore.UserStatus.Level1:
id = user.ID;
group = this.ParentForm.SystemConfig.User_Level1_Name;
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;
this.buttonUser.ButtonDown();
this.buttonProductNo.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayProductNo;
this.buttonSubMenu.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplaySubMenu;
this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayClear;
this.buttonUnder.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting;
this.buttonPass.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting;
this.buttonOver.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting;
this.buttonTare.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayWeightSetting;
this.buttonMenu.Enabled = true;
break;
case DataStore.UserStatus.Level2:
id = user.ID;
group = this.ParentForm.SystemConfig.User_Level2_Name;
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;
this.buttonUser.ButtonDown();
this.buttonProductNo.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayProductNo;
this.buttonSubMenu.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplaySubMenu;
this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayClear;
this.buttonUnder.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting;
this.buttonPass.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting;
this.buttonOver.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting;
this.buttonTare.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayWeightSetting;
this.buttonMenu.Enabled = true;
break;
case DataStore.UserStatus.Level3:
id = user.ID;
group = this.ParentForm.SystemConfig.User_Level3_Name;
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;
this.buttonUser.ButtonDown();
this.buttonProductNo.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayProductNo;
this.buttonSubMenu.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplaySubMenu;
this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayClear;
this.buttonUnder.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonPass.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonOver.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonTare.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonMenu.Enabled = true;
break;
case DataStore.UserStatus.Admin:
id = user.ID;
group = "admin";
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;
this.buttonUser.ButtonDown();
this.buttonProductNo.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayProductNo;
this.buttonSubMenu.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplaySubMenu;
this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayClear;
this.buttonUnder.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonPass.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonOver.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonTare.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayWeightSetting;
this.buttonMenu.Enabled = true;
break;
case DataStore.UserStatus.Developer:
id = user.ID;
group = user.Status.ToString();
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;
this.buttonUser.ButtonDown();
this.buttonProductNo.Enabled = true;
this.buttonSubMenu.Enabled = true;
this.buttonClear.Enabled = true;
this.buttonUnder.Enabled = true;
this.buttonPass.Enabled = true;
this.buttonOver.Enabled = true;
this.buttonTare.Enabled = true;
this.buttonMenu.Enabled = true;
break;
case DataStore.UserStatus.NotLogin:
id = "";
group = "";
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;
this.buttonProductNo.Enabled = true;
this.buttonSubMenu.Enabled = true;
this.buttonClear.Enabled = true;
this.buttonUnder.Enabled = true;
this.buttonPass.Enabled = true;
this.buttonOver.Enabled = true;
this.buttonTare.Enabled = true;
this.buttonMenu.Enabled = true;
break;
case DataStore.UserStatus.LogOff:
id = "Log Off";
group = "";
if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOff;
this.buttonUser.ButtonUp();
this.buttonProductNo.Enabled = false;
this.buttonSubMenu.Enabled = false;
this.buttonClear.Enabled = false;
this.buttonUnder.Enabled = false;
this.buttonPass.Enabled = false;
this.buttonOver.Enabled = false;
this.buttonTare.Enabled = false;
this.buttonMenu.Enabled = false;
break;
default:
break;
}
if (this.labelUserLevel.Text != group)
this.labelUserLevel.Text = group;
if (this.labelUserID.Text != id)
this.labelUserID.Text = id;
}
public void RescaleControl()
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.RescaleControl();
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.RescaleControl();
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.RescaleControl();
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.RescaleControl();
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.RescaleControl();
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.RescaleControl();
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.RescaleControl();
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.RescaleControl();
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.RescaleControl();
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.RescaleControl();
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.RescaleControl();
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.RescaleControl();
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.RescaleControl();
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.RescaleControl();
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.RescaleControl();
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.RescaleControl();
break;
default:
break;
}
}
public void ProductChange(int productNumber)
{
this.buttonProductNo.Text = "**";
this.ParentForm.TransferProductParameter(productNumber);
}
public void Clear()
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.Clear();
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.Clear();
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.Clear();
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.Clear();
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.Clear();
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.Clear();
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.Clear();
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.Clear();
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.Clear();
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.Clear();
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.Clear();
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.Clear();
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.Clear();
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.Clear();
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.Clear();
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.Clear();
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.Clear();
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.Clear();
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.Clear();
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.Clear();
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.Clear();
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.Clear();
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.Clear();
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.Clear();
break;
default:
break;
}
}
public void IconEthernetVisible(bool enable)
{
this.pictureBoxEthernetConnection.Visible = enable;
this.pictureBoxEthernetDisconnection.Visible = enable;
}
public void TimerServer(bool value)
{
if (value == false)
{
if (this.timerServer.Enabled == true)
this.timerServer.Enabled = false;
}
else
{
if (this.timerServer.Enabled == false)
this.timerServer.Enabled = true;
}
}
public void SetTotalCount()
{
int toTalAll = 0, toTalPass = 0, toTalNG = 0;
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
toTalAll += this.ParentForm.CollectionWeightData[i].TotalCount;
toTalPass += this.ParentForm.CollectionWeightData[i].PassCount;
toTalNG += this.ParentForm.CollectionWeightData[i].TotalNGCount;
}
// Total All Count
// Total Pass Count
if (this.labelStaticTotalCount.Text == "Pass")
{
if (this.labelTotalCount.Text != toTalPass.ToString())
this.labelTotalCount.Text = toTalPass.ToString();
}
else
{
if (this.labelTotalCount.Text != toTalAll.ToString())
this.labelTotalCount.Text = toTalAll.ToString();
}
// Total NG Count
if (this.labelNGCount.Text != toTalNG.ToString())
this.labelNGCount.Text = toTalNG.ToString();
}
public void Part11AutomaticLogoutReset()
{
UserManager.UserManager_AutoLogoutTimeoutReset();
}
public void Logout()
{
this.ParentForm.SystemConfig.CurrentUser.Status = DataStore.UserStatus.LogOff;
this.buttonUser.ButtonUp();
this.DisplayRefresh();
// Part 11
if (this.ParentForm.SystemConfig.IsPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Logout, "");
}
public void CallBackUserListLoginTimeoutDataEvent(UserManager.UserMgr_login_timeout_t user)
{
string code = "", message1 = "", message2 = "";
int warningTime = 0;
if (user.remainder_time != 0)
{
switch (this.ParentForm.SystemConfig.Language)
{
case DataStore.LanguageID.Korean:
code = "로그인";
message1 = "잠시 후에 로그아웃 됩니다";
message2 = "";
break;
case DataStore.LanguageID.English:
code = "Login";
message1 = "You will be logged out after a while";
message2 = "";
break;
case DataStore.LanguageID.Chinese:
code = "Login";
message1 = "You will be logged out after a while";
message2 = "";
break;
case DataStore.LanguageID.Czech:
code = "Login";
message1 = "You will be logged out after a while";
message2 = "";
break;
case DataStore.LanguageID.German:
code = "Login";
message1 = "You will be logged out after a while";
message2 = "";
break;
default:
break;
}
warningTime = this.ParentForm.FlagAutomaticLogoutWarningTime - 2;
this.UI_Invoke(delegate
{
DialogFormMessage msg = new DialogFormMessage(DataStore.MessageBoxIcon.Asterisk, code, message1, message2, warningTime);
msg.ShowDialog();
});
}
else
{
switch (this.ParentForm.SystemConfig.Language)
{
case DataStore.LanguageID.Korean:
code = "Login";
message1 = "자동 로그아웃 되었습니다";
message2 = "";
break;
case DataStore.LanguageID.English:
code = "Login";
message1 = "automatically logged out";
message2 = "";
break;
case DataStore.LanguageID.Chinese:
code = "Login";
message1 = "automatically logged out";
message2 = "";
break;
case DataStore.LanguageID.Czech:
code = "Login";
message1 = "automatically logged out";
message2 = "";
break;
case DataStore.LanguageID.German:
code = "Login";
message1 = "automatically logged out";
message2 = "";
break;
default:
break;
}
// User Logout
UserManager.UserManager_UserLogout();
this.UI_Invoke(delegate
{
this.Logout();
});
this.UI_Invoke(delegate
{
DialogFormMessage msg = new DialogFormMessage(DataStore.MessageBoxIcon.Asterisk, code, message1, message2, 0);
msg.ShowDialog();
});
}
}
public void UpdateCurrentProductDisplay(DataStore.EquipmentStatus status, ProductItem pItem, JudgmentSetItem jItem,Collection<WeightData> weightDatas)
{
string value = "";
value = pItem.Number.ToString();
if (this.buttonProductNo.Text != value)
this.buttonProductNo.Text = value;
value = pItem.Name;
if (this.labelProductName.Text != value)
this.labelProductName.Text = value;
value = pItem.LotNo;
if (this.labelLotNo.Text != value)
this.labelLotNo.Text = value;
value = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.UnderRange, this.ParentForm.SystemConfig.DecimalPlaces);
if (this.buttonUnder.Text != value)
this.buttonUnder.Text = value;
value = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.PassRange, this.ParentForm.SystemConfig.DecimalPlaces);
if (this.buttonPass.Text != value)
this.buttonPass.Text = value;
value = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.OverRange, this.ParentForm.SystemConfig.DecimalPlaces);
if (this.buttonOver.Text != value)
this.buttonOver.Text = value;
value = Helper.StringToDecimalPlaces(this.ParentForm.CurrentProductItem.TareRange, this.ParentForm.SystemConfig.DecimalPlaces);
if (this.buttonTare.Text != value)
this.buttonTare.Text = value;
value = jItem.Sorter1DelayTime.ToString();
if (this.labelSorterDelayTime.Text != value)
this.labelSorterDelayTime.Text = value;
value = jItem.Sorter1RunTime.ToString();
if (this.labelSorterRunTime.Text != value)
this.labelSorterRunTime.Text = value;
value = jItem.RejectConveyorDelayTime.ToString();
if (this.labelDischargeConveyorDelayTime.Text != value)
this.labelDischargeConveyorDelayTime.Text = value;
value = jItem.RejectConveyorRunTime.ToString();
if (this.labelDischargeConveyorOperatingTime.Text != value)
this.labelDischargeConveyorOperatingTime.Text = value;
value = jItem.FeedingConveyorDelayTime.ToString();
if (this.labelFeedingConveyorDelayTime.Text != value)
this.labelFeedingConveyorDelayTime.Text = value;
value = jItem.FeedingConveyorRunTime.ToString();
if (this.labelFeedingConveyorOperatingTime.Text != value)
this.labelFeedingConveyorOperatingTime.Text = value;
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateCurrentProductDisplay(status, weightDatas);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateCurrentProductDisplay(status, weightDatas);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateCurrentProductDisplay(status, weightDatas);
break;
default:
break;
}
this.RescaleControl();
}
public void UpdateEquipmentStatusDisplay(DataStore.EquipmentStatus status)
{
if (status == DataStore.EquipmentStatus.Start)
{
#region Start
this.pictureBoxStart.Visible = true;
this.pictureBoxStop.Visible = false;
this.buttonProductNo.Enabled = false;
this.labelProductName.Enabled = false;
#endregion
}
else
{
#region Stop
this.ParentForm.SaveCounterFile(this.ParentForm.CollectionWeightData, this.ParentForm.SystemConfig.ProductNumber - 1);
this.pictureBoxStart.Visible = false;
this.pictureBoxStop.Visible = true;
this.buttonProductNo.Enabled = true;
this.labelProductName.Enabled = true;
if (this.panelSetting.Visible == true)
this.panelSetting.Visible = false;
#endregion
}
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.UpdateEquipmentStatusDisplay(status);
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateEquipmentStatusDisplay(status);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateEquipmentStatusDisplay(status);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateEquipmentStatusDisplay(status);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateEquipmentStatusDisplay(status);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateEquipmentStatusDisplay(status);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateEquipmentStatusDisplay(status);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateEquipmentStatusDisplay(status);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateEquipmentStatusDisplay(status);
break;
default:
break;
}
}
public void UpdateStopWeightDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.UpdateStopWeightDisplay(status, weightDatas);
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateStopWeightDisplay(status, weightDatas);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateStopWeightDisplay(status, weightDatas);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStopWeightDisplay(status, weightDatas);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStopWeightDisplay(status, weightDatas);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStopWeightDisplay(status, weightDatas);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStopWeightDisplay(status, weightDatas);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStopWeightDisplay(status, weightDatas);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStopWeightDisplay(status, weightDatas);
break;
default:
break;
}
}
public void UpdateUpdateStartWeightDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
{
string value = "";
value = weightDatas[0].ProductionSpeed.ToString();
if (this.labelProductionSpeed.Text != value)
this.labelProductionSpeed.Text = value;
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.UpdateStartWeightDisplay(status, weightDatas);
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateStartWeightDisplay(status, weightDatas);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateStartWeightDisplay(status, weightDatas);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStartWeightDisplay(status, weightDatas);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay(status, weightDatas);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay(status, weightDatas);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay(status, weightDatas);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay(status, weightDatas);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay(status, weightDatas);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay1(DataStore.EquipmentStatus status, WeightData weightData)
{
string value = "";
if (this.ParentForm.SystemConfig.EquipmentMode == 2)
{
value = weightData.ProductionSpeed.ToString();
if (this.labelProductionSpeed.Text != value)
this.labelProductionSpeed.Text = value;
}
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.UpdateStartWeightDisplay1(status, weightData);
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateStartWeightDisplay1(status, weightData);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateStartWeightDisplay1(status, weightData);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStartWeightDisplay1(status, weightData);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay1(status, weightData);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay1(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay1(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay1(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay1(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay2(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
if (this.MainDisplayEachBarGraph2 != null)
this.MainDisplayEachBarGraph2.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph2 != null)
this.MainDisplayDotGraph2.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable2 != null)
this.MainDisplayTable2.UpdateStartWeightDisplay2(status, weightData);
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateStartWeightDisplay2(status, weightData);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateStartWeightDisplay2(status, weightData);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStartWeightDisplay2(status, weightData);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay2(status, weightData);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay2(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay2(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay2(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay2(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay3(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
if (this.MainDisplayEachBarGraph3 != null)
this.MainDisplayEachBarGraph3.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph3 != null)
this.MainDisplayDotGraph3.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable3 != null)
this.MainDisplayTable3.UpdateStartWeightDisplay3(status, weightData);
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateStartWeightDisplay3(status, weightData);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStartWeightDisplay3(status, weightData);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay3(status, weightData);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay3(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay3(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay3(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay3(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay4(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
if (this.MainDisplayEachBarGraph4 != null)
this.MainDisplayEachBarGraph4.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayDotGraph4 != null)
this.MainDisplayDotGraph4.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayTable4 != null)
this.MainDisplayTable4.UpdateStartWeightDisplay4(status, weightData);
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStartWeightDisplay4(status, weightData);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay4(status, weightData);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay4(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay4(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay4(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay4(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay5(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
if (this.MainDisplayEachBarGraph5 != null)
this.MainDisplayEachBarGraph5.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayDotGraph5 != null)
this.MainDisplayDotGraph5.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayTable5 != null)
this.MainDisplayTable5.UpdateStartWeightDisplay5(status, weightData);
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay5(status, weightData);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay5(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay5(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay5(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay5(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay6(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
if (this.MainDisplayEachBarGraph6 != null)
this.MainDisplayEachBarGraph6.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayDotGraph6 != null)
this.MainDisplayDotGraph6.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayTable6 != null)
this.MainDisplayTable6.UpdateStartWeightDisplay6(status, weightData);
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay6(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay6(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay6(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay6(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay7(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
if (this.MainDisplayEachBarGraph7 != null)
this.MainDisplayEachBarGraph7.UpdateStartWeightDisplay7(status, weightData);
if (this.MainDisplayDotGraph7 != null)
this.MainDisplayDotGraph7.UpdateStartWeightDisplay7(status, weightData);
if (this.MainDisplayTable7 != null)
this.MainDisplayTable7.UpdateStartWeightDisplay7(status, weightData);
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay7(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay7(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay7(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay7(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay7(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay7(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay8(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
if (this.MainDisplayEachBarGraph8 != null)
this.MainDisplayEachBarGraph8.UpdateStartWeightDisplay8(status, weightData);
if (this.MainDisplayDotGraph8 != null)
this.MainDisplayDotGraph8.UpdateStartWeightDisplay8(status, weightData);
if (this.MainDisplayTable8 != null)
this.MainDisplayTable8.UpdateStartWeightDisplay8(status, weightData);
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay8(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay8(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay8(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay9(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay9(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay9(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay9(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateUpdateStartWeightDisplay10(DataStore.EquipmentStatus status, WeightData weightData)
{
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 10:
if (this.MainDisplayEachBarGraph10 != null)
this.MainDisplayEachBarGraph10.UpdateStartWeightDisplay10(status, weightData);
if (this.MainDisplayDotGraph10 != null)
this.MainDisplayDotGraph10.UpdateStartWeightDisplay10(status, weightData);
if (this.MainDisplayTable10 != null)
this.MainDisplayTable10.UpdateStartWeightDisplay10(status, weightData);
break;
default:
break;
}
this.SetTotalCount();
}
public void UpdateDisplayTime()
{
this.labelTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
public void UpdateEthernetStatusDisplay(bool status)
{
if (status == true)
{
this.pictureBoxEthernetConnection.Visible = true;
this.pictureBoxEthernetDisconnection.Visible = false;
if (this.ParentForm.SystemConfig.EthernetOperationMode == 1) // 중량선별기 : Server
this.ParentForm.TimerPingEnabled(2000, true);
//// 로그
//if (this.ParentForm.IsCommunicationLogOpen == true)
// this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("Connection icon ({0:yyyy-MM-dd HH:mm:ss})", DateTime.Now));
}
else
{
this.pictureBoxEthernetConnection.Visible = false;
this.pictureBoxEthernetDisconnection.Visible = true;
if (this.ParentForm.SystemConfig.EthernetOperationMode == 1) // 중량선별기 : Server
this.ParentForm.TimerPingEnabled(false);
//// 로그
//if (this.ParentForm.IsCommunicationLogOpen == true)
// this.ParentForm.smartFileCommunicationLog.WriteString(string.Format("Disconnection icon ({0:yyyy-MM-dd HH:mm:ss})", DateTime.Now));
}
}
public void DisplayRefresh()
{
this.ParentForm.SystemConfig.CurrentForm = DataStore.FormStore.FormMainDisplay;
if (this.ParentForm.EquipmentStatus == DataStore.EquipmentStatus.Stop)
{
this.buttonProductNo.Text = "**";
// 전체 파라미터 메인보드 Write
this.ParentForm.TransferProductParameter(this.ParentForm.SystemConfig.ProductNumber);
}
this.pictureBoxUSBBackOn.Visible = this.ParentForm.SystemConfig.IsDataBackup;
if (this.ParentForm.SystemConfig.Serial3Mode == 0)
this.labelIconSerial3.Visible = false;
else
this.labelIconSerial3.Visible = true;
if (this.ParentForm.SystemConfig.Serial3Mode == 4)
this.buttonPrint.Visible = true;
else
this.buttonPrint.Visible = false;
this.IconEthernetVisible(this.ParentForm.SystemConfig.IsEthernetEnable);
// Ethernet
if (this.ParentForm.SystemConfig.IsEthernetEnable == true)
{
if (this.ParentForm.SystemConfig.EthernetOperationMode == 2)
this.ParentForm.EthernetClientDisconnect();
else
{
if (this.ParentForm.smartTCPMultiServer.IsStart == false)
this.ParentForm.smartTCPMultiServer.Start();
}
}
else
{
if (this.ParentForm.SystemConfig.EthernetOperationMode == 2)
this.ParentForm.EthernetClientDisconnect();
else
{
if (this.ParentForm.smartTCPMultiServer.IsStart == true)
this.ParentForm.smartTCPMultiServer.Stop();
}
}
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsPart11 == true)
this.Part11AutomaticLogoutReset();
this.labelIconBypassMode.Visible = this.ParentForm.SystemConfig.IsBypassMode;
this.UpdateDisplayUser(this.ParentForm.SystemConfig.CurrentUser);
this.buttonSubMenu.ButtonUp();
this.panelSubMenu.Visible = false;
this.buttonCut.Visible = this.ParentForm.SystemConfig.IsCutView;
}
#endregion
#region Event Handler
private void pictureBoxStart_Click(object sender, EventArgs e)
{
}
private void pictureBoxStop_Click(object sender, EventArgs e)
{
}
private void buttonProductNo_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.buttonProductNo.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(280, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 1000)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.ProductChange(myKeyPad.IntValue);
}
}
}
private void buttonUnder_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.buttonUnder.Text, 5, this.ParentForm.SystemConfig.DecimalPlaces, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(270, 70);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue > Helper.StringToWeight(this.ParentForm.CurrentProductItem.PassRange, this.ParentForm.SystemConfig.DecimalPlaces))
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.ParentForm.CurrentProductItem.UnderRange = myKeyPad.StringValue.Replace(".", "");
this.buttonUnder.Text = myKeyPad.StringValue;
this.RescaleControl();
this.ParentForm.SaveProductFile(this.ParentForm.CurrentProductItem, this.ParentForm.SystemConfig.ProductNumber - 1);
this.ParentForm.Update30000ModbusData();
this.ParentForm.ModbusCommonDataSend();
value = Helper.StringZeroFillDigits7(this.ParentForm.CurrentProductItem.UnderRange);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._2002_UnderRange, value);
// FeedBack Range Setting
this.ParentForm.CurrentFeedBackRangeItem.SetRange(int.Parse(this.ParentForm.CurrentProductItem.OverRange),
int.Parse(this.ParentForm.CurrentProductItem.PassRange), int.Parse(this.ParentForm.CurrentProductItem.UnderRange));
}
}
}
private void buttonPass_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.buttonPass.Text, 5, this.ParentForm.SystemConfig.DecimalPlaces, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(270, 70);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if ((myKeyPad.doubleValue > Helper.StringToWeight(this.ParentForm.CurrentProductItem.OverRange, this.ParentForm.SystemConfig.DecimalPlaces))
|| (myKeyPad.doubleValue < Helper.StringToWeight(this.ParentForm.CurrentProductItem.UnderRange, this.ParentForm.SystemConfig.DecimalPlaces)))
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.ParentForm.CurrentProductItem.PassRange = myKeyPad.StringValue.Replace(".", "");
this.buttonPass.Text = myKeyPad.StringValue;
this.RescaleControl();
this.ParentForm.SaveProductFile(this.ParentForm.CurrentProductItem, this.ParentForm.SystemConfig.ProductNumber - 1);
this.ParentForm.Update30000ModbusData();
this.ParentForm.ModbusCommonDataSend();
value = Helper.StringZeroFillDigits7(this.ParentForm.CurrentProductItem.PassRange);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._2003_PassRange, value);
}
}
}
private void buttonOver_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.buttonOver.Text, 5, this.ParentForm.SystemConfig.DecimalPlaces, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(270, 70);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < Helper.StringToWeight(this.ParentForm.CurrentProductItem.PassRange, this.ParentForm.SystemConfig.DecimalPlaces))
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.ParentForm.CurrentProductItem.OverRange = myKeyPad.StringValue.Replace(".", "");
this.buttonOver.Text = myKeyPad.StringValue;
this.RescaleControl();
this.ParentForm.SaveProductFile(this.ParentForm.CurrentProductItem, this.ParentForm.SystemConfig.ProductNumber - 1);
this.ParentForm.Update30000ModbusData();
this.ParentForm.ModbusCommonDataSend();
value = Helper.StringZeroFillDigits7(this.ParentForm.CurrentProductItem.OverRange);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._2004_OverRange, value);
// FeedBack Range Setting
this.ParentForm.CurrentFeedBackRangeItem.SetRange(int.Parse(this.ParentForm.CurrentProductItem.OverRange),
int.Parse(this.ParentForm.CurrentProductItem.PassRange), int.Parse(this.ParentForm.CurrentProductItem.UnderRange));
}
}
}
private void buttonTare_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.buttonTare.Text, 5, this.ParentForm.SystemConfig.DecimalPlaces, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(270, 70);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 999.99)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.ParentForm.CurrentProductItem.TareRange = myKeyPad.StringValue.Replace(".", "");
this.buttonTare.Text = myKeyPad.StringValue;
this.ParentForm.SaveProductFile(this.ParentForm.CurrentProductItem, this.ParentForm.SystemConfig.ProductNumber - 1);
this.ParentForm.Update30000ModbusData();
this.ParentForm.ModbusCommonDataSend();
value = Helper.StringZeroFillDigits7(this.ParentForm.CurrentProductItem.TareRange);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._2005_TareRange, value);
}
}
}
private void buttonScaleZero_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
this.ParentForm.TransferData(CommunicationCommand.Zero, CommunicationID.SubBoardAll);
}
private void buttonClear_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormYesNo myDlg = new DialogFormYesNo(this.ParentForm.SystemConfig.Language, 8);
if (myDlg.ShowDialog() == DialogResult.Yes)
{
this.Clear();
}
}
private void buttonMenu_Click(object sender, EventArgs e)
{
if (this.ParentForm.EquipmentStatus == DataStore.EquipmentStatus.Stop)
{
// Automatic Logout Pause
if (this.ParentForm.SystemConfig.IsLogin == true)
UserManager.UserManager_AutoLogoutTimeoutPause();
this.ParentForm.ChildFormMenu.DisplayRefresh();
((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMenu);
}
else
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
this.panelSetting.BringToFront();
this.panelSetting.Visible = true;
}
}
private void buttonDisplay_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
SmartButton button = sender as SmartButton;
if (button == null)
return;
if (button == this.buttonBarGraphForm)
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
else if (button == this.buttonDotGraphForm)
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayDotGraph;
else if (button == this.buttonTableForm)
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayTable;
else
this.MainDisplay = DataStore.FormMainDisplayStore.FormMainDisplayBarGraph;
this.UpdateDisplay(this.MainDisplay);
}
private void buttonUser_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
if (this.ParentForm.SystemConfig.CurrentUser.Status == DataStore.UserStatus.LogOff)
{
this.Login();
}
else
{
DialogFormYesNo msg = new DialogFormYesNo(this.ParentForm.SystemConfig.Language, 12);
if (msg.ShowDialog() == DialogResult.Yes)
{
this.Logout();
}
}
}
private void labelSorterDelayTime_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorterDelayTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(300, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelSorterDelayTime.Text = myKeyPad.StringValue;
this.ParentForm.CurrentJudgmentSetItem.Sorter1DelayTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelSorterDelayTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._5102_Sorter1DelayTime, value);
this.ParentForm.SaveJudgmentSetFile(this.ParentForm.CurrentJudgmentSetItem, this.ParentForm.SystemConfig.ProductNumber - 1);
}
}
}
private void labelSorterRunTime_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorterRunTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(300, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelSorterRunTime.Text = myKeyPad.StringValue;
this.ParentForm.CurrentJudgmentSetItem.Sorter1RunTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelSorterRunTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._5103_Sorter1RunTime, value);
this.ParentForm.SaveJudgmentSetFile(this.ParentForm.CurrentJudgmentSetItem, this.ParentForm.SystemConfig.ProductNumber - 1);
}
}
}
private void labelDischargeConveyorDelayTime_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDischargeConveyorDelayTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(300, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelDischargeConveyorDelayTime.Text = myKeyPad.StringValue;
this.ParentForm.CurrentJudgmentSetItem.RejectConveyorDelayTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelDischargeConveyorDelayTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._5009_DischargeConveyorDelayTime, value);
this.ParentForm.SaveJudgmentSetFile(this.ParentForm.CurrentJudgmentSetItem, this.ParentForm.SystemConfig.ProductNumber - 1);
}
}
}
private void labelDischargeConveyorOperatingTime_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDischargeConveyorOperatingTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(300, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelDischargeConveyorOperatingTime.Text = myKeyPad.StringValue;
this.ParentForm.CurrentJudgmentSetItem.RejectConveyorRunTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelDischargeConveyorOperatingTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._5010_DischargeConveyorRunTime, value);
this.ParentForm.SaveJudgmentSetFile(this.ParentForm.CurrentJudgmentSetItem, this.ParentForm.SystemConfig.ProductNumber - 1);
}
}
}
private void labelFeedingConveyorDelayTime_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelFeedingConveyorDelayTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(300, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelFeedingConveyorDelayTime.Text = myKeyPad.StringValue;
this.ParentForm.CurrentJudgmentSetItem.FeedingConveyorDelayTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelFeedingConveyorDelayTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._5007_FeedingConveyorDelayTime, value);
this.ParentForm.SaveJudgmentSetFile(this.ParentForm.CurrentJudgmentSetItem, this.ParentForm.SystemConfig.ProductNumber - 1);
}
}
}
private void labelFeedingConveyorOperatingTime_Click(object sender, EventArgs e)
{
string value = "";
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelFeedingConveyorOperatingTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
myKeyPad.Location = new Point(300, 90);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelFeedingConveyorOperatingTime.Text = myKeyPad.StringValue;
this.ParentForm.CurrentJudgmentSetItem.FeedingConveyorRunTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelFeedingConveyorOperatingTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._5008_FeedingConveyorRunTime, value);
this.ParentForm.SaveJudgmentSetFile(this.ParentForm.CurrentJudgmentSetItem, this.ParentForm.SystemConfig.ProductNumber - 1);
}
}
}
private void labelTotalCount_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
lock (this)
{
if (this.labelStaticTotalCount.Text != "Total")
this.labelStaticTotalCount.Text = "Total";
else
this.labelStaticTotalCount.Text = "Pass";
this.SetTotalCount();
}
}
private void buttonSubMenu_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
if (this.buttonSubMenu.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
this.panelSubMenu.BringToFront();
this.panelSubMenu.Visible = true;
}
else
this.panelSubMenu.Visible = false;
}
private void buttonBypassDirection_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
if (this.buttonBypassDirection.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.SystemConfig.IsBypassDirectionPass = false;
else
this.ParentForm.SystemConfig.IsBypassDirectionPass = true;
}
private void buttonBypassOnce_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
if (this.buttonBypassOnce.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
this.ParentForm.SystemConfig.IsBypassOnce = false;
this.buttonBypassRun.Mode = SmartButton.BUTTONMODE.PUSH;
}
else
{
this.ParentForm.SystemConfig.IsBypassOnce = true;
this.buttonBypassRun.Mode = SmartButton.BUTTONMODE.NORMAL;
}
}
private void buttonBypassRun_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
if (this.ParentForm.SystemConfig.IsBypassOnce == true)
{
if (this.ParentForm.SystemConfig.IsBypassDirectionPass == true)
this.ParentForm.TransferData(CommunicationCommand.BypassOnce, CommunicationID.MainBoard);
else
this.ParentForm.TransferData(CommunicationCommand.ByNGOnce, CommunicationID.MainBoard);
}
else
{
if (this.buttonBypassRun.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
this.buttonBypassDirection.Enabled = false;
this.buttonBypassOnce.Enabled = false;
if (this.ParentForm.SystemConfig.IsBypassDirectionPass == true)
this.ParentForm.TransferData(CommunicationCommand.BypassON, CommunicationID.MainBoard);
else
this.ParentForm.TransferData(CommunicationCommand.ByNGON, CommunicationID.MainBoard);
}
else
{
this.buttonBypassDirection.Enabled = true;
this.buttonBypassOnce.Enabled = true;
if (this.ParentForm.SystemConfig.IsBypassDirectionPass == true)
this.ParentForm.TransferData(CommunicationCommand.BypassOFF, CommunicationID.MainBoard);
else
this.ParentForm.TransferData(CommunicationCommand.ByNGOFF, CommunicationID.MainBoard);
}
}
}
private void buttonPrint_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
if (this.buttonPrint.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
this.ParentForm.SystemConfig.IsPrintPerProductEnable = true;
this.ParentForm.PrintingHeadLine();
}
else
{
this.ParentForm.SystemConfig.IsPrintPerProductEnable = false;
this.ParentForm.serialPort3.Write("\n\n\n\n");
}
}
private void buttonClose_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
this.panelSetting.Visible = false;
}
private void buttonCut_Click(object sender, EventArgs e)
{
// Automatic Logout Reset
if (this.ParentForm.SystemConfig.IsLogin == true)
this.Part11AutomaticLogoutReset();
this.ParentForm.TransferData(CommunicationCommand.CutInpupt, CommunicationID.MainBoard);
}
private void timerServer_Tick(object sender, EventArgs e)
{
if (this.ParentForm.smartTCPMultiServer.IsStart == true)
{
if (this.ParentForm.smartTCPMultiServer.ClientInfoList == null)
{
this.UpdateEthernetStatusDisplay(false);
}
else
{
this.UpdateEthernetStatusDisplay(true);
}
}
}
#endregion
}
}