INT63DC_2C/INT63DC_2C/Forms/FormConfiguration.cs

1597 lines
83 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.Windows.Forms;
using SmartX;
using INT63DC_2C.DialogForms;
using INT63DC_ImageDll;
using INT63DC_2C.SerialManger;
namespace INT63DC_2C.Forms
{
public partial class FormConfiguration : Form
{
#region Field
private FormMain m_ParentForm;
private Collection<SmartLabel> CollectionZeroParameterRangeLabel;
private Collection<SmartLabel> CollectionZeroParameterTimeLabel;
private Collection<SmartLabel> CollectionZeroParameterVariateLabel;
private Collection<SmartLabel> CollectionMaxWeightLabel;
private Collection<SmartLabel> CollectionBalanceWeightLabel;
private Collection<SmartLabel> CollectionDigitLabel;
private Collection<SmartLabel> CollectionFilterLabel;
private Collection<SmartLabel> CollectionBypassLabel;
private Collection<SmartButton> CollectionBypassButton;
#endregion
#region Constructor
public FormConfiguration(FormMain parent)
{
InitializeComponent();
this.ParentForm = parent;
this.InitializeControl();
this.DefaultSetting();
}
#endregion
#region Property
public FormMain ParentForm
{
get { return this.m_ParentForm; }
private set { this.m_ParentForm = value; }
}
#endregion
#region Method
private void InitializeDesign()
{
ImageDll images = new ImageDll();
Font font = new Font("New Gulim", 8F, FontStyle.Regular);
switch (this.ParentForm.SystemConfig.Language)
{
case DataStore.LanguageID.Korean:
break;
case DataStore.LanguageID.English:
#region English
this.labelTitle.Text = "Configuration";
this.groupBoxAutoZero.Text = "Auto zero";
this.labelStaticTime.Text = "Time";
this.labelStaticRange.Text = "Range";
this.labelStaticVariable.Text = "Variable";
this.labelStaticMode.Text = "Mode";
this.groupBoxOption.Text = "Option";
this.labelStaticEmptyWeight.Text = "Empty weight Set";
this.labelStaticChattering.Text = "Chattering";
this.labelStaticDecimalPoint.Text = "Decimal point";
this.labelStaticBuzzerOnTime.Text = "Buzzer ON time";
this.labelStaticRelayOnTime.Text = "Relay ON time";
this.labelStaticBypass.Text = "Bypass";
this.labelStaticEXT1DelayTime.Text = "EXT DelayTime";
this.labelStaticEXT1RunTime.Text = "EXT RunTime";
this.groupBoxComm.Text = "Communication";
this.labelStaticCommunicationSpeed.Text = "Speed";
this.labelStaticCommunicationMode.Text = "Mode";
this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engScreenDisable));
this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engScreenDown));
this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engScreenUp));
this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackDisable));
this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackDown));
this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackUp));
#endregion
break;
case DataStore.LanguageID.Chinese:
#region Chinese
this.labelTitle.Text = "选项";
this.groupBoxAutoZero.Text = "自动零点跟踪";
this.labelStaticTime.Text = "时间";
this.labelStaticRange.Text = "范围";
this.labelStaticVariable.Text = "变化";
this.labelStaticMode.Text = "模式";
this.groupBoxOption.Text = "等等";
this.labelStaticEmptyWeight.Text = "空重设置";
this.labelStaticChattering.Text = "颤振";
this.labelStaticBuzzerOnTime.Text = "蜂鸣器开启时间";
this.labelStaticRelayOnTime.Text = "继电器接通时间";
this.labelStaticDecimalPoint.Text = "小数点";
this.labelStaticBypass.Text = "旁路";
this.labelStaticEXT1DelayTime.Text = "外部输出延迟时间";
this.labelStaticEXT1RunTime.Text = "外部输出运转时间";
this.groupBoxComm.Text = "通信";
this.labelStaticCommunicationSpeed.Text = "波特率";
this.labelStaticCommunicationMode.Text = "模式";
this.groupBoxBypass.Text = "旁路";
this.buttonSend.Text = "发送";
this.buttonSave3.Text = this.buttonSaveBypass.Text = "保存";
this.labelTitleLine1.Text = "列1";
this.labelTitleLine2.Text = "列2";
this.labelTitleLine3.Text = "列3";
this.labelTitleLine4.Text = "列4";
this.labelTitleLine5.Text = "列5";
this.labelTitleLine6.Text = "列6";
this.labelTitleLine7.Text = "列7";
this.labelTitleLine8.Text = "列8";
this.labelTitleLine9.Text = "列9";
this.labelTitleLine10.Text = "列10";
this.labelTitleLine11.Text = "列11";
this.labelTitleLine12.Text = "列12";
this.labelTitleLine13.Text = "列13";
this.labelTitleLine14.Text = "列14";
this.labelTitleLine15.Text = "列15";
this.labelTitleLine16.Text = "列16";
this.buttonBypassLane1.DownImage = this.buttonBypassLane2.DownImage = this.buttonBypassLane3.DownImage =
this.buttonBypassLane4.DownImage = this.buttonBypassLane5.DownImage = this.buttonBypassLane6.DownImage =
this.buttonBypassLane7.DownImage = this.buttonBypassLane8.DownImage = this.buttonBypassLane9.DownImage =
this.buttonBypassLane10.DownImage = this.buttonBypassLane11.DownImage = this.buttonBypassLane12.DownImage =
this.buttonBypassMode.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnEnable));
this.buttonBypassLane1.UpImage = this.buttonBypassLane2.UpImage = this.buttonBypassLane3.UpImage =
this.buttonBypassLane4.UpImage = this.buttonBypassLane5.UpImage = this.buttonBypassLane6.UpImage =
this.buttonBypassLane7.UpImage = this.buttonBypassLane8.UpImage = this.buttonBypassLane9.UpImage =
this.buttonBypassLane10.UpImage = this.buttonBypassLane11.UpImage = this.buttonBypassLane12.UpImage =
this.buttonBypassMode.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnDisable));
this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnScreenDisable));
this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnScreenDown));
this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnScreenUp));
this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackDisable));
this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackDown));
this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackUp));
#endregion
break;
case DataStore.LanguageID.Czech:
#region Czech
this.labelTitle.Text = "Předvolby";
this.groupBoxAutoZero.Text = "Automatické nulování";
this.labelStaticTime.Text = "Čas";
this.labelStaticRange.Text = "Rozsah";
this.labelStaticVariable.Text = "Rozdíl";
this.labelStaticMode.Text = "Režim";
this.groupBoxOption.Text = "Možnosti";
this.labelStaticEmptyWeight.Text = "Nastavení prázdné hmotnosti";
this.labelStaticChattering.Text = "Uklidnění tenzometru";
this.labelStaticDecimalPoint.Text = "Počet desettiných míst";
this.labelStaticBuzzerOnTime.Text = "Zvukový signál - čas";
this.labelStaticRelayOnTime.Text = "Relé - čas";
this.labelStaticBypass.Text = "Vše";
this.labelStaticEXT1DelayTime.Text = "zpoždění externího výstupu";
this.labelStaticEXT1RunTime.Text = "provozu externího výstupu";
this.groupBoxComm.Text = "Nastavení komunikace";
this.labelStaticCommunicationMode.Text = "Režim";
this.labelTitleLine1.Text = "Řada 1";
this.labelTitleLine2.Text = "Řada 2";
this.labelTitleLine3.Text = "Řada 3";
this.labelTitleLine4.Text = "Řada 4";
this.labelTitleLine5.Text = "Řada 5";
this.labelTitleLine6.Text = "Řada 6";
this.labelTitleLine7.Text = "Řada 7";
this.labelTitleLine8.Text = "Řada 8";
this.labelTitleLine9.Text = "Řada 9";
this.labelTitleLine10.Text = "Řada 10";
this.labelTitleLine11.Text = "Řada 11";
this.labelTitleLine12.Text = "Řada 12";
this.labelTitleLine13.Text = "Řada 13";
this.labelTitleLine14.Text = "Řada 14";
this.labelTitleLine15.Text = "Řada 15";
this.labelTitleLine16.Text = "Řada 16";
this.labelStaticBypass.Text = "Bypass vše";
this.buttonSave3.Text = this.buttonSaveBypass.Text = "Uložit";
this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeScreenDisable));
this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeScreenDown));
this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeScreenUp));
this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackDisable));
this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackDown));
this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackUp));
this.buttonBypassLane1.DownImage = this.buttonBypassLane2.DownImage = this.buttonBypassLane3.DownImage =
this.buttonBypassLane4.DownImage = this.buttonBypassLane5.DownImage = this.buttonBypassLane6.DownImage =
this.buttonBypassLane7.DownImage = this.buttonBypassLane8.DownImage = this.buttonBypassLane9.DownImage =
this.buttonBypassLane10.DownImage = this.buttonBypassLane11.DownImage = this.buttonBypassLane12.DownImage =
this.buttonBypassMode.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeEnable));
this.buttonBypassLane1.UpImage = this.buttonBypassLane2.UpImage = this.buttonBypassLane3.UpImage =
this.buttonBypassLane4.UpImage = this.buttonBypassLane5.UpImage = this.buttonBypassLane6.UpImage =
this.buttonBypassLane7.UpImage = this.buttonBypassLane8.UpImage = this.buttonBypassLane9.UpImage =
this.buttonBypassLane10.UpImage = this.buttonBypassLane11.UpImage = this.buttonBypassLane12.UpImage =
this.buttonBypassMode.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeDisable));
#endregion
break;
case DataStore.LanguageID.German:
#region German
this.labelTitle.Text = "Konfiguration";
this.groupBoxAutoZero.Text = "automatische Nullung";
this.labelStaticTime.Text = "Zeit";
this.labelStaticRange.Text = "Bereich";
this.labelStaticVariable.Text = "Unterschied";
this.labelStaticMode.Text = "Modus";
this.groupBoxOption.Text = "Möglichkeit";
this.labelStaticEmptyWeight.Text = "Leergewichtseinstellung";
this.labelStaticChattering.Font = font;
this.labelStaticChattering.Text = "Beruhigung des Dehnungsmessers";
this.labelStaticDecimalPoint.Text = "Dezimalpunkt";
this.labelStaticBuzzerOnTime.Text = "Summer-Einschaltzeit";
this.labelStaticRelayOnTime.Text = "Relais-Einschaltzeit";
this.labelStaticBypass.Text = "Bypass-Modus";
this.labelStaticEXT1DelayTime.Font = font;
this.labelStaticEXT1DelayTime.Text = "Externe Ausgangsverzögerungszeit";
this.labelStaticEXT1RunTime.Font = font;
this.labelStaticEXT1RunTime.Text = "Betriebszeit der externen Ausgabe";
this.groupBoxComm.Text = "Kommunikationseinstellung";
this.labelStaticCommunicationSpeed.Text = "Baudrate";
this.labelStaticCommunicationMode.Text = "Modus";
this.labelTitleLine1.Text = "Reihe 1";
this.labelTitleLine2.Text = "Reihe 2";
this.labelTitleLine3.Text = "Reihe 3";
this.labelTitleLine4.Text = "Reihe 4";
this.labelTitleLine5.Text = "Reihe 5";
this.labelTitleLine6.Text = "Reihe 6";
this.labelTitleLine7.Text = "Reihe 7";
this.labelTitleLine8.Text = "Reihe 8";
this.labelTitleLine9.Text = "Reihe 9";
this.labelTitleLine10.Text = "Reihe 10";
this.labelTitleLine11.Text = "Reihe 11";
this.labelTitleLine12.Text = "Reihe 12";
this.labelTitleLine13.Text = "Reihe 13";
this.labelTitleLine14.Text = "Reihe 14";
this.labelTitleLine15.Text = "Reihe 15";
this.labelTitleLine16.Text = "Reihe 16";
this.labelStaticBypass.Text = "Bypass Alles";
this.buttonSend.Text = "Senden";
this.tabPage1.Text = "Automatische Nullung";
this.tabPage2.Text = "Kalibrierung";
this.tabPage3.Text = "Tascheneinstellung";
this.buttonZeroRange.Text = "Bereich Z";
this.buttonZeroTime.Text = "Zeit Z";
this.buttonZeroVariate.Text = "Unterschied Z";
this.buttonBalanceWeight.Text = "Waage G.";
this.buttonMaxWeight.Text = "Maximalgewicht";
this.buttonDigit.Text = "Ziffer";
this.buttonSave3.Text = this.buttonSaveBypass.Text = "Speichern";
this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerScreenDisable));
this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerScreenDown));
this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerScreenUp));
this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackDisable));
this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackDown));
this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackUp));
this.buttonBypassLane1.DownImage = this.buttonBypassLane2.DownImage = this.buttonBypassLane3.DownImage =
this.buttonBypassLane4.DownImage = this.buttonBypassLane5.DownImage = this.buttonBypassLane6.DownImage =
this.buttonBypassLane7.DownImage = this.buttonBypassLane8.DownImage = this.buttonBypassLane9.DownImage =
this.buttonBypassLane10.DownImage = this.buttonBypassLane11.DownImage = this.buttonBypassLane12.DownImage =
this.buttonBypassMode.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerEnable));
this.buttonBypassLane1.UpImage = this.buttonBypassLane2.UpImage = this.buttonBypassLane3.UpImage =
this.buttonBypassLane4.UpImage = this.buttonBypassLane5.UpImage = this.buttonBypassLane6.UpImage =
this.buttonBypassLane7.UpImage = this.buttonBypassLane8.UpImage = this.buttonBypassLane9.UpImage =
this.buttonBypassLane10.UpImage = this.buttonBypassLane11.UpImage = this.buttonBypassLane12.UpImage =
this.buttonBypassMode.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerDisable));
#endregion
break;
case DataStore.LanguageID.Japanese:
this.labelTitle.Text = "構成";
this.groupBoxAutoZero.Text = "オㅡトゼロ";
this.labelStaticTime.Text = "時間";
this.labelStaticRange.Text = "範囲";
this.labelStaticVariable.Text = "変化";
this.labelStaticMode.Text = "モード";
this.groupBoxOption.Text = "オプション設定";
this.labelStaticEmptyWeight.Text = "空重量セット";
this.labelStaticChattering.Text = "チャタリング";
this.labelStaticDecimalPoint.Text = "小数点";
this.labelStaticBuzzerOnTime.Text = "ブザㅡON時間";
this.labelStaticRelayOnTime.Text = "リレㅡON時間";
this.labelStaticBypass.Text = "バイパスモㅡド";
this.labelStaticEXT1DelayTime.Text = "外部出力遅延時間";
this.labelStaticEXT1RunTime.Text = "外部出力 運転時間";
this.groupBoxComm.Text = "通信";
this.labelStaticCommunicationSpeed.Text = "ボㅡレㅡト";
this.labelStaticCommunicationMode.Text = "モㅡド";
this.labelTitleLine1.Text = "レㅡン 1";
this.labelTitleLine2.Text = "レㅡン 2";
this.labelTitleLine3.Text = "レㅡン 3";
this.labelTitleLine4.Text = "レㅡン 4";
this.labelTitleLine5.Text = "レㅡン 5";
this.labelTitleLine6.Text = "レㅡン 6";
this.labelTitleLine7.Text = "レㅡン 7";
this.labelTitleLine8.Text = "レㅡン 8";
this.labelTitleLine9.Text = "レㅡン 9";
this.labelTitleLine10.Text = "レㅡン 10";
this.labelTitleLine11.Text = "レㅡン 11";
this.labelTitleLine12.Text = "レㅡン 12";
this.labelTitleLine13.Text = "レㅡン 13";
this.labelTitleLine14.Text = "レㅡン 14";
this.labelTitleLine15.Text = "レㅡン 15";
this.labelTitleLine16.Text = "レㅡン 16";
this.labelStaticBypass.Text = "バイパスモㅡド";
this.buttonSave3.Text = this.buttonSaveBypass.Text = "保存";
this.buttonSend.Text = "送信";
this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnScreenDisable));
this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnScreenDown));
this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnScreenUp));
this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackDisable));
this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackDown));
this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackUp));
break;
default:
break;
}
}
private void InitializeControl()
{
this.panelSpecialMenu.Location = new Point(0, 80);
this.panelSpecialMenu.Visible = false;
this.labelZeroParameterTime.Text = "-";
this.labelZeroParameterRange.Text = "-";
this.labelChattering.Text = "-";
this.labelBuzzerOnTime.Text = "-";
this.labelRelayOnTime.Text = "-";
this.comboBoxZeroParameterVariate.Items.Clear();
this.comboBoxZeroParameterVariate.SelectedIndexChanged -= new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
this.comboBoxZeroParameterVariate.Items.Add("0.05");
this.comboBoxZeroParameterVariate.Items.Add("0.1");
this.comboBoxZeroParameterVariate.Items.Add("0.2");
this.comboBoxZeroParameterVariate.Items.Add("0.5");
this.comboBoxZeroParameterVariate.Items.Add("1.0");
this.comboBoxZeroParameterVariate.Items.Add("1.2");
this.comboBoxZeroParameterVariate.SelectedIndex = 0;
this.comboBoxZeroParameterVariate.SelectedIndexChanged += new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
this.comboBoxZeroParameterMode.Items.Clear();
this.comboBoxZeroParameterMode.SelectedIndexChanged -= new EventHandler(this.comboBoxZeroParameterMode_SelectedIndexChanged);
switch (this.ParentForm.SystemConfig.Language)
{
case DataStore.LanguageID.Korean:
case DataStore.LanguageID.English:
this.comboBoxZeroParameterMode.Items.Add("Mode1");
this.comboBoxZeroParameterMode.Items.Add("Mode2");
break;
case DataStore.LanguageID.Chinese:
this.comboBoxZeroParameterMode.Items.Add("模式1");
this.comboBoxZeroParameterMode.Items.Add("模式2");
break;
case DataStore.LanguageID.Czech:
this.comboBoxZeroParameterMode.Items.Add("Režim1");
this.comboBoxZeroParameterMode.Items.Add("Režim2");
break;
case DataStore.LanguageID.German:
this.comboBoxZeroParameterMode.Items.Add("Modus1");
this.comboBoxZeroParameterMode.Items.Add("Modus2");
break;
case DataStore.LanguageID.Japanese:
this.comboBoxZeroParameterMode.Items.Add("モード1");
this.comboBoxZeroParameterMode.Items.Add("モード2");
break;
default:
break;
}
this.comboBoxZeroParameterMode.SelectedIndex = 0;
this.comboBoxZeroParameterMode.SelectedIndexChanged += new EventHandler(this.comboBoxZeroParameterMode_SelectedIndexChanged);
this.comboBoxDecimalPlaces.Items.Clear();
this.comboBoxDecimalPlaces.SelectedIndexChanged -= new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
this.comboBoxDecimalPlaces.Items.Add("0");
this.comboBoxDecimalPlaces.Items.Add("0.0");
this.comboBoxDecimalPlaces.Items.Add("0.00");
this.comboBoxDecimalPlaces.Items.Add("0.000");
this.comboBoxDecimalPlaces.SelectedIndex = 0;
this.comboBoxDecimalPlaces.SelectedIndexChanged += new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
this.comboBoxSerial3BaudRate.Items.Clear();
this.comboBoxSerial3BaudRate.SelectedIndexChanged -= new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3BaudRate.Items.Add(9600);
this.comboBoxSerial3BaudRate.Items.Add(19200);
this.comboBoxSerial3BaudRate.Items.Add(38400);
this.comboBoxSerial3BaudRate.Items.Add(115200);
this.comboBoxSerial3BaudRate.SelectedIndex = 0;
this.comboBoxSerial3BaudRate.SelectedIndexChanged += new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3Mode.Items.Clear();
this.comboBoxSerial3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3Mode.Items.Add("-");
this.comboBoxSerial3Mode.Items.Add("STD1");
this.comboBoxSerial3Mode.Items.Add("STD2");
this.comboBoxSerial3Mode.SelectedIndex = 0;
this.comboBoxSerial3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
}
private void DefaultSetting()
{
string value = "";
this.CollectionZeroParameterRangeLabel = new Collection<SmartLabel>();
this.CollectionZeroParameterTimeLabel = new Collection<SmartLabel>();
this.CollectionZeroParameterVariateLabel = new Collection<SmartLabel>();
this.CollectionMaxWeightLabel = new Collection<SmartLabel>();
this.CollectionBalanceWeightLabel = new Collection<SmartLabel>();
this.CollectionDigitLabel = new Collection<SmartLabel>();
this.CollectionFilterLabel = new Collection<SmartLabel>();
this.CollectionBypassLabel = new Collection<SmartLabel>();
this.CollectionBypassButton = new Collection<SmartButton>();
this.CollectionZeroParameterRangeLabel.Clear();
this.CollectionZeroParameterTimeLabel.Clear();
this.CollectionZeroParameterVariateLabel.Clear();
this.CollectionMaxWeightLabel.Clear();
this.CollectionBalanceWeightLabel.Clear();
this.CollectionDigitLabel.Clear();
this.CollectionFilterLabel.Clear();
this.CollectionBypassLabel.Clear();
this.CollectionBypassButton.Clear();
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange1);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange2);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange3);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange4);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange5);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange6);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange7);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange8);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange9);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange10);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange11);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange12);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange13);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange14);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange15);
this.CollectionZeroParameterRangeLabel.Add(this.labelZeroRange16);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime1);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime2);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime3);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime4);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime5);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime6);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime7);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime8);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime9);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime10);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime11);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime12);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime13);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime14);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime15);
this.CollectionZeroParameterTimeLabel.Add(this.labelZeroTime16);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate1);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate2);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate3);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate4);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate5);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate6);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate7);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate8);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate9);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate10);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate11);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate12);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate13);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate14);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate15);
this.CollectionZeroParameterVariateLabel.Add(this.labelZeroVariate16);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight1);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight2);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight3);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight4);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight5);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight6);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight7);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight8);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight9);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight10);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight11);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight12);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight13);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight14);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight15);
this.CollectionMaxWeightLabel.Add(this.labelMaxWeight16);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight1);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight2);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight3);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight4);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight5);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight6);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight7);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight8);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight9);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight10);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight11);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight12);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight13);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight14);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight15);
this.CollectionBalanceWeightLabel.Add(this.labelBalanceWeight16);
this.CollectionDigitLabel.Add(this.labelDigit1);
this.CollectionDigitLabel.Add(this.labelDigit2);
this.CollectionDigitLabel.Add(this.labelDigit3);
this.CollectionDigitLabel.Add(this.labelDigit4);
this.CollectionDigitLabel.Add(this.labelDigit5);
this.CollectionDigitLabel.Add(this.labelDigit6);
this.CollectionDigitLabel.Add(this.labelDigit7);
this.CollectionDigitLabel.Add(this.labelDigit8);
this.CollectionDigitLabel.Add(this.labelDigit9);
this.CollectionDigitLabel.Add(this.labelDigit10);
this.CollectionDigitLabel.Add(this.labelDigit11);
this.CollectionDigitLabel.Add(this.labelDigit12);
this.CollectionDigitLabel.Add(this.labelDigit13);
this.CollectionDigitLabel.Add(this.labelDigit14);
this.CollectionDigitLabel.Add(this.labelDigit15);
this.CollectionDigitLabel.Add(this.labelDigit16);
this.CollectionFilterLabel.Add(this.labelFilter1);
this.CollectionFilterLabel.Add(this.labelFilter2);
this.CollectionFilterLabel.Add(this.labelFilter3);
this.CollectionFilterLabel.Add(this.labelFilter4);
this.CollectionFilterLabel.Add(this.labelFilter5);
this.CollectionFilterLabel.Add(this.labelFilter6);
this.CollectionFilterLabel.Add(this.labelFilter7);
this.CollectionFilterLabel.Add(this.labelFilter8);
this.CollectionFilterLabel.Add(this.labelFilter9);
this.CollectionFilterLabel.Add(this.labelFilter10);
this.CollectionFilterLabel.Add(this.labelFilter11);
this.CollectionFilterLabel.Add(this.labelFilter12);
this.CollectionFilterLabel.Add(this.labelFilter13);
this.CollectionFilterLabel.Add(this.labelFilter14);
this.CollectionFilterLabel.Add(this.labelFilter15);
this.CollectionFilterLabel.Add(this.labelFilter16);
this.CollectionBypassLabel.Add(this.labelTitleLine1);
this.CollectionBypassLabel.Add(this.labelTitleLine2);
this.CollectionBypassLabel.Add(this.labelTitleLine3);
this.CollectionBypassLabel.Add(this.labelTitleLine4);
this.CollectionBypassLabel.Add(this.labelTitleLine5);
this.CollectionBypassLabel.Add(this.labelTitleLine6);
this.CollectionBypassLabel.Add(this.labelTitleLine7);
this.CollectionBypassLabel.Add(this.labelTitleLine8);
this.CollectionBypassLabel.Add(this.labelTitleLine9);
this.CollectionBypassLabel.Add(this.labelTitleLine10);
this.CollectionBypassLabel.Add(this.labelTitleLine11);
this.CollectionBypassLabel.Add(this.labelTitleLine12);
this.CollectionBypassLabel.Add(this.labelTitleLine13);
this.CollectionBypassLabel.Add(this.labelTitleLine14);
this.CollectionBypassLabel.Add(this.labelTitleLine15);
this.CollectionBypassLabel.Add(this.labelTitleLine16);
this.CollectionBypassButton.Add(this.buttonBypassLane1);
this.CollectionBypassButton.Add(this.buttonBypassLane2);
this.CollectionBypassButton.Add(this.buttonBypassLane3);
this.CollectionBypassButton.Add(this.buttonBypassLane4);
this.CollectionBypassButton.Add(this.buttonBypassLane5);
this.CollectionBypassButton.Add(this.buttonBypassLane6);
this.CollectionBypassButton.Add(this.buttonBypassLane7);
this.CollectionBypassButton.Add(this.buttonBypassLane8);
this.CollectionBypassButton.Add(this.buttonBypassLane9);
this.CollectionBypassButton.Add(this.buttonBypassLane10);
this.CollectionBypassButton.Add(this.buttonBypassLane11);
this.CollectionBypassButton.Add(this.buttonBypassLane12);
this.CollectionBypassButton.Add(this.buttonBypassLane13);
this.CollectionBypassButton.Add(this.buttonBypassLane14);
this.CollectionBypassButton.Add(this.buttonBypassLane15);
this.CollectionBypassButton.Add(this.buttonBypassLane16);
for (int i = 0; i < 16; i++)
{
this.CollectionZeroParameterRangeLabel[i].Text = "";
this.CollectionZeroParameterTimeLabel[i].Text = "";
this.CollectionZeroParameterVariateLabel[i].Text = "";
this.CollectionMaxWeightLabel[i].Text = "";
this.CollectionBalanceWeightLabel[i].Text = "";
this.CollectionDigitLabel[i].Text = "";
this.CollectionFilterLabel[i].Text = "";
}
for (int i = this.ParentForm.SystemConfig.EquipmentColumns; i < 16; i++)
{
this.CollectionZeroParameterRangeLabel[i].Visible = false;
this.CollectionZeroParameterTimeLabel[i].Visible = false;
this.CollectionZeroParameterVariateLabel[i].Visible = false;
this.CollectionMaxWeightLabel[i].Visible = false;
this.CollectionBalanceWeightLabel[i].Visible = false;
this.CollectionDigitLabel[i].Visible = false;
this.CollectionFilterLabel[i].Visible = false;
this.CollectionBypassLabel[i].Visible = false;
this.CollectionBypassButton[i].Visible = false;
}
this.comboBoxDecimalPlaces.SelectedIndexChanged -= new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
this.comboBoxDecimalPlaces.SelectedIndex = this.ParentForm.SystemConfig.DecimalPlaces;
this.comboBoxDecimalPlaces.SelectedIndexChanged += new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
this.comboBoxSerial3BaudRate.SelectedIndexChanged -= new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3BaudRate.SelectedIndex = this.ParentForm.SystemConfig.Serial3BaudRate;
this.comboBoxSerial3BaudRate.SelectedIndexChanged += new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3Mode.SelectedIndex = this.ParentForm.SystemConfig.Serial3Mode;
this.comboBoxSerial3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
if (this.comboBoxSerial3Mode.SelectedIndex == 1)
{
this.labelProtocolDescriptionCOM3_1.Text = "STX[1],ID[5],NO[4],";
this.labelProtocolDescriptionCOM3_2.Text = "{GRD[1],WEIGHT[6]} * n,CHK8[2],ETX[1]";
}
else if (this.comboBoxSerial3Mode.SelectedIndex == 2)
{
this.labelProtocolDescriptionCOM3_1.Text = "STX[1],ID[5],NO[4],UNDER[6],PASS[6],OVER[6],";
this.labelProtocolDescriptionCOM3_2.Text = "TARE[6],{GRD[1],WEIGHT[6]} * n,CHK8[2],ETX[1]";
}
else
{
this.labelProtocolDescriptionCOM3_1.Text = "";
this.labelProtocolDescriptionCOM3_2.Text = "";
}
if (this.ParentForm.SystemConfig.Serial3Mode != 0)
this.buttonSend.Enabled = true;
else
this.buttonSend.Enabled = false;
// Empty중량설정
if (this.ParentForm.SystemConfig.EmptyWeight == "")
value = "0";
else
value = this.ParentForm.SystemConfig.EmptyWeight;
this.labelEmptyWeight.Text = Helper.StringToDecimalPlaces(value, this.ParentForm.SystemConfig.DecimalPlaces);
}
public void UpdateZeroParameterRangeDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
this.CollectionZeroParameterRangeLabel[i].Text = values[i];
}
public void UpdateZeroParameterTimeDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
this.CollectionZeroParameterTimeLabel[i].Text = values[i];
}
public void UpdateZeroParameterVariateDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
{
if (values[i].Trim() == "0")
this.CollectionZeroParameterVariateLabel[i].Text = "0.05";
else if (values[i].Trim() == "1")
this.CollectionZeroParameterVariateLabel[i].Text = "0.1";
else if (values[i].Trim() == "2")
this.CollectionZeroParameterVariateLabel[i].Text = "0.2";
else if (values[i].Trim() == "3")
this.CollectionZeroParameterVariateLabel[i].Text = "0.5";
else if (values[i].Trim() == "4")
this.CollectionZeroParameterVariateLabel[i].Text = "1";
}
}
public void UpdateZeroParameterDisplay(DataStore.EquipmentStatus status, ZeroParameterItem item)
{
int iValue = 0;
string sValue = "";
sValue = item.Time.Trim();
if (this.labelZeroParameterTime.Text != sValue)
this.labelZeroParameterTime.Text = sValue;
sValue = item.Range.Trim();
if (this.labelZeroParameterRange.Text != sValue)
this.labelZeroParameterRange.Text = sValue;
iValue = int.Parse(item.Variate.Trim());
this.comboBoxZeroParameterVariate.SelectedIndexChanged -= new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
this.comboBoxZeroParameterVariate.SelectedIndex = iValue;
this.comboBoxZeroParameterVariate.SelectedIndexChanged += new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
}
public void UpdateOptionParameterDisplay(DataStore.EquipmentStatus status, OptionParameterItem item)
{
string value = "";
value = item.Chattering.Trim();
if (this.labelChattering.Text != value)
this.labelChattering.Text = value;
value = item.BuzzerOnTime.Trim();
if (this.labelBuzzerOnTime.Text != value)
this.labelBuzzerOnTime.Text = value;
value = item.RelayOnTime.Trim();
if (this.labelRelayOnTime.Text != value)
this.labelRelayOnTime.Text = value;
}
public void UpdateBalanceWeightDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
this.CollectionBalanceWeightLabel[i].Text = values[i];
}
public void UpdateMaxWeightDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
this.CollectionMaxWeightLabel[i].Text = values[i];
}
public void UpdateDigitDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
this.CollectionDigitLabel[i].Text = values[i];
}
public void UpdateFilterDisplay(DataStore.EquipmentStatus status, Collection<string> values)
{
if (values == null || values.Count == 0)
return;
for (int i = 0; i < values.Count; i++)
this.CollectionFilterLabel[i].Text = values[i];
}
public void DisplayRefresh()
{
string value = "";
//switch (this.ParentForm.SystemConfig.CurrentUser.Group)
//{
// case DataStore.UserGroup.Level3Manager:
// case DataStore.UserGroup.Level4Developer:
// this.buttonScreen.Visible = true;
// break;
// default:
// this.buttonScreen.Visible = false;
// break;
//}
this.ParentForm.SystemConfig.CurrentForm = DataStore.FormStore.FormConfiguration;
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoard1, CommunicationAddress._4901_ParameterRead4901, "");
this.timerInterval.Enabled = true;
this.buttonSave3.Enabled = false;
this.buttonSaveBypass.Enabled = false;
this.comboBoxDecimalPlaces.SelectedIndexChanged -= new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
this.comboBoxDecimalPlaces.SelectedIndex = this.ParentForm.SystemConfig.DecimalPlaces;
this.comboBoxDecimalPlaces.SelectedIndexChanged += new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
this.comboBoxSerial3BaudRate.SelectedIndexChanged -= new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3BaudRate.SelectedItem = this.ParentForm.SystemConfig.Serial3BaudRate;
this.comboBoxSerial3BaudRate.SelectedIndexChanged += new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.comboBoxSerial3Mode.SelectedIndex = this.ParentForm.SystemConfig.Serial3Mode;
this.comboBoxSerial3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSerial3_SelectedIndexChanged);
this.labelEXT1DelayTime.Text = this.ParentForm.SystemConfig.EXT1_DelayTime.ToString();
this.labelEXT1RunTime.Text = this.ParentForm.SystemConfig.EXT1_RunTime.ToString();
if (this.ParentForm.SystemConfig.Serial3Mode != 0)
this.buttonSend.Enabled = true;
else
this.buttonSend.Enabled = false;
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
if (this.ParentForm.CollectionWeightData[i].IsBypassMode == true)
this.CollectionBypassButton[i].ButtonDown();
else
this.CollectionBypassButton[i].ButtonUp();
}
// Empty중량설정
if (this.ParentForm.SystemConfig.EmptyWeight == "")
value = "0";
else
value = this.ParentForm.SystemConfig.EmptyWeight;
this.labelEmptyWeight.Text = Helper.StringToDecimalPlaces(value, this.ParentForm.SystemConfig.DecimalPlaces);
}
#endregion
#region Override Member
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.InitializeDesign();
}
#endregion
#region Event Handler
private void buttonBack_Click(object sender, EventArgs e)
{
if (this.panelSpecialMenu.Visible == true)
this.panelSpecialMenu.Visible = false;
this.ParentForm.ChildFormMenu.DisplayRefresh();
((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMenu);
}
private void labelZeroParameterTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelZeroParameterTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelZeroParameterTime.Text = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelZeroParameterTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._4001_ZeroTime, value);
}
}
}
private void labelZeroParameterRange_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelZeroParameterRange.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
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.labelZeroParameterRange.Text = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelZeroParameterRange.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._4002_ZeroRange, value);
}
}
}
private void labelChattering_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelChattering.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 500)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelChattering.Text = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelChattering.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6006_Chattering, value);
}
}
}
private void labelBuzzerOnTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelBuzzerOnTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelBuzzerOnTime.Text = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelBuzzerOnTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6001_BuzzerOnTime, value);
}
}
}
private void labelRelayOnTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelRelayOnTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelRelayOnTime.Text = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelRelayOnTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6002_RelayOperatingTime, value);
}
}
}
private void labelEXT1DelayTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelEXT1DelayTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
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.labelEXT1DelayTime.Text = myKeyPad.StringValue;
this.ParentForm.SystemConfig.EXT1_DelayTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelEXT1DelayTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5202_EXT1DelayTime, value);
this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);
}
}
}
private void labelEXT1RunTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelEXT1RunTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);
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.labelEXT1RunTime.Text = myKeyPad.StringValue;
this.ParentForm.SystemConfig.EXT1_RunTime = myKeyPad.IntValue;
value = Helper.StringZeroFillDigits4(this.labelEXT1RunTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5203_EXT1RunTime, value);
this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);
}
}
}
private void labelEmptyWeight_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelEmptyWeight.Text, 4, this.ParentForm.SystemConfig.DecimalPlaces, false, this.ParentForm.SystemConfig.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.SystemConfig.Language);
myMsg.ShowDialog();
}
else
{
this.labelEmptyWeight.Text = myKeyPad.StringValue;
this.ParentForm.SystemConfig.EmptyWeight = myKeyPad.StringValue.Replace(".", "");
value = Helper.StringZeroFillDigits4(this.ParentForm.SystemConfig.EmptyWeight);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._1021_EmptyWeight, value);
this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);
}
}
}
private void comboBoxZeroParameterVariate_SelectedIndexChanged(object sender, EventArgs e)
{
string value = "";
value = Helper.StringZeroFillDigits4(this.comboBoxZeroParameterVariate.SelectedIndex.ToString());
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._4003_ZeroVariate, value);
}
private void comboBoxZeroParameterMode_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void comboBoxDecimalPlaces_SelectedIndexChanged(object sender, EventArgs e)
{
this.ParentForm.SystemConfig.DecimalPlaces = this.comboBoxDecimalPlaces.SelectedIndex;
this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);
}
private void timerInterval_Tick(object sender, EventArgs e)
{
this.timerInterval.Enabled = false;
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress._6901_ParameterRead6901, "");
}
private void comboBoxSerial3_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.comboBoxSerial3Mode.SelectedIndex == 1)
{
this.labelProtocolDescriptionCOM3_1.Text = "STX[1],ID[5],NO[4],";
this.labelProtocolDescriptionCOM3_2.Text = "{GRD[1],WEIGHT[6]} * n,CHK8[2],ETX[1]";
}
else if (this.comboBoxSerial3Mode.SelectedIndex == 2)
{
this.labelProtocolDescriptionCOM3_1.Text = "STX[1],ID[5],NO[4],UNDER[6],PASS[6],OVER[6],";
this.labelProtocolDescriptionCOM3_2.Text = "TARE[6],{GRD[1],WEIGHT[6]} * n,CHK8[2],ETX[1]";
}
else
{
if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Chinese)
{
this.labelProtocolDescriptionCOM3_1.Text = "COM3协议说明";
this.labelProtocolDescriptionCOM3_2.Text = "COM3协议说明";
}
else
{
this.labelProtocolDescriptionCOM3_1.Text = "COM3 Protocol Description";
this.labelProtocolDescriptionCOM3_2.Text = "COM3 Protocol Description";
}
}
this.buttonSave3.Enabled = true;
}
private void buttonSend_Click(object sender, EventArgs e)
{
if (this.ParentForm.SystemConfig.Serial3Mode == 1)
this.ParentForm.SerialCH3STD1(this.ParentForm.CollectionWeightData);
else if (this.ParentForm.SystemConfig.Serial3Mode == 2)
this.ParentForm.SerialCH3STD2(this.ParentForm.CollectionWeightData);
}
private void buttonSave3_Click(object sender, EventArgs e)
{
int baudrate = 9600;
this.ParentForm.SystemConfig.Serial3BaudRate = this.comboBoxSerial3BaudRate.SelectedIndex;
this.ParentForm.SystemConfig.Serial3Mode = this.comboBoxSerial3Mode.SelectedIndex;
this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);
SerialMgrComm.serialPortClose("COM3:");
if (this.ParentForm.SystemConfig.Serial3Mode != 0)
{
// BaudRate
switch (this.ParentForm.SystemConfig.Serial3BaudRate)
{
case 0:
baudrate = 9600;
break;
case 1:
baudrate = 19200;
break;
case 2:
baudrate = 38400;
break;
case 3:
baudrate = 115200;
break;
default:
baudrate = 9600;
break;
}
SerialMgrComm.serialPortOpen("COM3:", baudrate, 0, 0, 8);
this.buttonSend.Enabled = true;
}
else
this.buttonSend.Enabled = false;
this.buttonSave3.Enabled = false;
}
private void buttonBypassLane_Click(object sender, EventArgs e)
{
int iTemp = 0;
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
if (this.CollectionBypassButton[i].ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
iTemp++;
}
}
if (iTemp == this.ParentForm.SystemConfig.EquipmentColumns)
this.buttonBypassMode.ButtonDown();
else
this.buttonBypassMode.ButtonUp();
this.buttonSaveBypass.Enabled = true;
}
private void buttonSaveBypass_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
if (this.ParentForm.SystemConfig.IsWeightViewForward == true)
{
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
if (this.CollectionBypassButton[i].ButtonStatus == SmartButton.BUTSTATUS.DOWN)
sb.Append("1");
else
sb.Append("0");
}
}
else
{
for (int i = 1; i <= this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
if (this.CollectionBypassButton[this.ParentForm.SystemConfig.EquipmentColumns - i].ButtonStatus == SmartButton.BUTSTATUS.DOWN)
sb.Append("1");
else
sb.Append("0");
}
}
if (this.buttonBypassLane1.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[0].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[0].IsBypassMode = false;
if (this.buttonBypassLane2.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[1].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[1].IsBypassMode = false;
switch (this.ParentForm.SystemConfig.EquipmentColumns)
{
case 3:
#region 3
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
#endregion
break;
case 4:
#region 4
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
#endregion
break;
case 5:
#region 5
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
#endregion
break;
case 6:
#region 6
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
#endregion
break;
case 7:
#region 7
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[6].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[6].IsBypassMode = false;
#endregion
break;
case 8:
#region 8
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[6].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[6].IsBypassMode = false;
if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[7].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[7].IsBypassMode = false;
#endregion
break;
case 10:
#region 10
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[6].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[6].IsBypassMode = false;
if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[7].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[7].IsBypassMode = false;
if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[8].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[8].IsBypassMode = false;
if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[9].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[9].IsBypassMode = false;
#endregion
break;
case 12:
#region 12
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[6].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[6].IsBypassMode = false;
if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[7].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[7].IsBypassMode = false;
if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[8].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[8].IsBypassMode = false;
if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[9].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[9].IsBypassMode = false;
if (this.buttonBypassLane11.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[10].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[10].IsBypassMode = false;
if (this.buttonBypassLane12.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[11].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[11].IsBypassMode = false;
#endregion
break;
case 16:
#region 16
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[6].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[6].IsBypassMode = false;
if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[7].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[7].IsBypassMode = false;
if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[8].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[8].IsBypassMode = false;
if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[9].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[9].IsBypassMode = false;
if (this.buttonBypassLane11.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[10].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[10].IsBypassMode = false;
if (this.buttonBypassLane12.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[11].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[11].IsBypassMode = false;
if (this.buttonBypassLane13.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[12].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[12].IsBypassMode = false;
if (this.buttonBypassLane14.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[13].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[13].IsBypassMode = false;
if (this.buttonBypassLane15.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[14].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[14].IsBypassMode = false;
if (this.buttonBypassLane16.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.CollectionWeightData[15].IsBypassMode = true;
else
this.ParentForm.CollectionWeightData[15].IsBypassMode = false;
#endregion
break;
default:
break;
}
this.ParentForm.SystemConfig.IsBypassMode = false;
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
if (this.ParentForm.CollectionWeightData[i].IsBypassMode == true)
{
this.ParentForm.SystemConfig.IsBypassMode = true;
break;
}
}
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._1201_Bypass, sb.ToString());
this.buttonSaveBypass.Enabled = false;
}
private void buttonBypassMode_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
if (this.buttonBypassMode.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
sb.Append("1");
this.CollectionBypassButton[i].ButtonDown();
}
this.ParentForm.SystemConfig.IsBypassMode = true;
for (int i = 0; i < this.ParentForm.CollectionWeightData.Count; i++)
this.ParentForm.CollectionWeightData[i].IsBypassMode = true;
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._1201_Bypass, sb.ToString());
}
else
{
for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
{
sb.Append("0");
this.CollectionBypassButton[i].ButtonUp();
}
this.ParentForm.SystemConfig.IsBypassMode = false;
for (int i = 0; i < this.ParentForm.CollectionWeightData.Count; i++)
this.ParentForm.CollectionWeightData[i].IsBypassMode = false;
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._1201_Bypass, sb.ToString());
}
}
private void buttonScreen_Click(object sender, EventArgs e)
{
if (this.panelSpecialMenu.Visible == false)
{
this.panelSpecialMenu.Visible = true;
this.panelSpecialMenu.BringToFront();
}
else
this.panelSpecialMenu.Visible = false;
}
#endregion
#region SpecialFunction Menu
private void buttonZeroRange_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._4002_ZeroRange, "");
}
private void buttonZeroVariate_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._4003_ZeroVariate, "");
}
private void buttonZeroTime_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._4001_ZeroTime, "");
}
private void buttonDigit_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._3003_Digit, "");
}
private void buttonMaxWeight_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._3001_MaxWeight, "");
}
private void buttonBalanceWeight_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._3002_BalanceWeight, "");
}
private void buttonFilter_Click(object sender, EventArgs e)
{
this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._5001_Filter, "");
}
#endregion
}
}