ITC81DB_2H/ITC81DB_0H/Controls/MainDisplay/ControlMainDisplayMenu.cs

769 lines
37 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using SmartX;
using ITC81DB.DialogForms;
using ITC81DB.Forms;
using ITC81DB_ImageDll;
namespace ITC81DB.Controls
{
public partial class ControlMainDisplayMenu : UserControl
{
#region Field
private FormMainDisplay m_ParentForm;
#endregion
#region Constructor
public ControlMainDisplayMenu(FormMainDisplay parent)
{
InitializeComponent();
this.ParentForm = parent;
this.InitializeDesign();
this.DefaultSetting();
}
#endregion
#region Property
public FormMainDisplay ParentForm
{
get { return this.m_ParentForm; }
set { this.m_ParentForm = value; }
}
#endregion
#region Method
public void InitializeDesign()
{
Class1 images = new Class1();
if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.English)
{
this.buttonBypassDirection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korBypassOccasionDown));
this.buttonBypassDirection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korBypassOccasionUp));
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engBypassCountUp));
this.labelTitleBypass.Text = "Bypass";
this.labelTitleSorterSettings.Text = "Sorter settings";
this.labelTitleAutoZero.Text = "Auto Zero";
this.labelTitleSorterA.Text = "Sorter A";
this.labelTitleSorterB.Text = "Sorter B";
this.labelTitleSorterMode.Text = "Mode";
this.labelTitleSorterDelayTime.Text = "Delay time";
this.labelTitleSorterRunTime.Text = "Run time";
this.labelTitleMode1Time.Text = "Time";
this.labelTitleMode1Range.Text = "Range";
this.labelTitleMode1Variate.Text = "Variation";
this.labelTitleDryContact.Text = "Dry Contact";
this.radioButtonMode1High.Text = "High";
this.radioButtonMode1Middle.Text = "Middle";
this.radioButtonMode1Low.Text = "Low";
this.radioButtonMode1UserSetting.Text = "User Setting";
this.labelTitleDryContact.Text = "Latch control";
this.comboBoxSorterA.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterA.Items.Clear();
this.comboBoxSorterA.Items.Add("None");
this.comboBoxSorterA.Items.Add("Over");
this.comboBoxSorterA.Items.Add("Under");
this.comboBoxSorterA.Items.Add("NG");
this.comboBoxSorterA.SelectedIndex = 1;
this.comboBoxSorterA.SelectedIndexChanged += new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterB.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
this.comboBoxSorterB.Items.Clear();
this.comboBoxSorterB.Items.Add("None");
this.comboBoxSorterB.Items.Add("Over");
this.comboBoxSorterB.Items.Add("Under");
this.comboBoxSorterB.Items.Add("NG");
this.comboBoxSorterB.SelectedIndex = 2;
this.comboBoxSorterB.SelectedIndexChanged += new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Chinese)
{
this.buttonBypassDirection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnBypassOccasionDown));
this.buttonBypassDirection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnBypassOccasionUp));
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnBypassCountUp));
this.labelTitleBypass.Text = "旁路";
this.labelTitleSorterSettings.Text = "筛选设定";
this.labelTitleAutoZero.Text = "自动零点跟踪";
this.labelTitleSorterA.Text = "分类机A";
this.labelTitleSorterB.Text = "分类机B";
this.labelTitleSorterMode.Text = "模式";
this.labelTitleSorterDelayTime.Text = "延迟时间";
this.labelTitleSorterRunTime.Text = "运行时间";
this.labelTitleMode1Time.Text = "时间";
this.labelTitleMode1Range.Text = "范围";
this.labelTitleMode1Variate.Text = "变化";
this.labelTitleDryContact.Text = "Dry Contact";
this.radioButtonMode1High.Text = "高";
this.radioButtonMode1Middle.Text = "中间";
this.radioButtonMode1Low.Text = "低";
this.radioButtonMode1UserSetting.Text = "用户设置";
this.labelTitleDryContact.Text = "闩锁控制";
this.comboBoxSorterA.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterA.Items.Clear();
this.comboBoxSorterA.Items.Add("不使用");
this.comboBoxSorterA.Items.Add("超过");
this.comboBoxSorterA.Items.Add("低于");
this.comboBoxSorterA.Items.Add("不良");
this.comboBoxSorterA.SelectedIndex = 1;
this.comboBoxSorterA.SelectedIndexChanged += new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterB.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
this.comboBoxSorterB.Items.Clear();
this.comboBoxSorterB.Items.Add("不使用");
this.comboBoxSorterB.Items.Add("超过");
this.comboBoxSorterB.Items.Add("低于");
this.comboBoxSorterB.Items.Add("不良");
this.comboBoxSorterB.SelectedIndex = 2;
this.comboBoxSorterB.SelectedIndexChanged += new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Czech)
{
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Russian)
{
this.buttonBypassDirection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusBypassOccasionDown));
this.buttonBypassDirection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusBypassOccasionUp));
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusBypassCountUp));
this.labelTitleBypass.Text = "Транспортера";
this.labelTitleSorterSettings.Text = "Настройка сортировки";
this.labelTitleAutoZero.Text = "Автоотслеживание нуля";
this.labelTitleSorterA.Font = this.labelTitleSorterB.Font = new Font("새굴림", 9, FontStyle.Regular);
this.labelTitleSorterA.Text = "Сортировщик А";
this.labelTitleSorterB.Text = "Сортировщик В";
this.labelTitleSorterMode.Text = "Режим";
this.labelTitleSorterDelayTime.Text = "задержки";
this.labelTitleSorterRunTime.Text = "выполнения";
this.labelTitleMode1Time.Text = "Время";
this.labelTitleMode1Range.Text = "Диапазон";
this.labelTitleMode1Variate.Text = "Регулировка";
this.labelTitleDryContact.Text = "Сухой контакт";
this.radioButtonMode1High.Text = "Высокий";
this.radioButtonMode1Middle.Text = "Средний";
this.radioButtonMode1Low.Text = "Низкий";
this.radioButtonMode1UserSetting.Text = "Настройки пользователя";
this.labelTitleDryContact.Text = "контроль защелки";
this.comboBoxSorterA.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterA.Items.Clear();
this.comboBoxSorterA.Items.Add("Нет");
this.comboBoxSorterA.Items.Add("Много");
this.comboBoxSorterA.Items.Add("Мало");
this.comboBoxSorterA.Items.Add("Дефект");
this.comboBoxSorterA.SelectedIndex = 1;
this.comboBoxSorterA.SelectedIndexChanged += new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterB.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
this.comboBoxSorterB.Items.Clear();
this.comboBoxSorterB.Items.Add("Нет");
this.comboBoxSorterB.Items.Add("Много");
this.comboBoxSorterB.Items.Add("Мало");
this.comboBoxSorterB.Items.Add("Дефект");
this.comboBoxSorterB.SelectedIndex = 2;
this.comboBoxSorterB.SelectedIndexChanged += new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
}
else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German)
{
this.buttonBypassDirection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerBypassOccasionDown));
this.buttonBypassDirection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerBypassOccasionUp));
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerBypassCountUp));
this.labelTitleBypass.Text = "Bypass";
this.labelTitleSorterSettings.Text = "Sortierereinstellung";
this.labelTitleAutoZero.Text = "Automatische Nullung";
this.labelTitleSorterA.Text = "Sortierer A";
this.labelTitleSorterB.Text = "Sortierer B";
this.labelTitleSorterMode.Text = "Modus";
this.labelTitleSorterDelayTime.Text = "Vezögerung";
this.labelTitleSorterRunTime.Text = "Laufzeit";
this.labelTitleMode1Time.Text = "Zeit";
this.labelTitleMode1Range.Text = "Bereich";
this.labelTitleMode1Variate.Text = "Unterschied";
this.labelTitleDryContact.Text = "Trockener Kontakt";
this.radioButtonMode1High.Text = "Hoch";
this.radioButtonMode1Middle.Text = "Mitte";
this.radioButtonMode1Low.Text = "Niedrig";
this.radioButtonMode1UserSetting.Text = "Benutzereinstellungen";
this.labelTitleDryContact.Text = "Verriegelungssteuerung";
this.comboBoxSorterA.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterA.Items.Clear();
this.comboBoxSorterA.Items.Add("Keiner");
this.comboBoxSorterA.Items.Add("Max.");
this.comboBoxSorterA.Items.Add("Min.");
this.comboBoxSorterA.Items.Add("Schlecht");
this.comboBoxSorterA.SelectedIndex = 1;
this.comboBoxSorterA.SelectedIndexChanged += new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterB.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
this.comboBoxSorterB.Items.Clear();
this.comboBoxSorterB.Items.Add("Keiner");
this.comboBoxSorterB.Items.Add("Max.");
this.comboBoxSorterB.Items.Add("Min.");
this.comboBoxSorterB.Items.Add("Schlecht");
this.comboBoxSorterB.SelectedIndex = 2;
this.comboBoxSorterB.SelectedIndexChanged += new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
}
else
{
this.buttonBypassDirection.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korBypassOccasionDown));
this.buttonBypassDirection.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korBypassOccasionUp));
this.buttonBypassOnce.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korBypassCountDown));
this.buttonBypassOnce.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korBypassCountUp));
this.labelTitleBypass.Text = "Bypass";
this.labelTitleSorterSettings.Text = "선별기 설정";
this.labelTitleAutoZero.Text = "자동 영점";
this.labelTitleSorterA.Text = "선별부 A";
this.labelTitleSorterB.Text = "선별부 B";
this.labelTitleSorterMode.Text = "모드";
this.labelTitleSorterDelayTime.Text = "지연시간";
this.labelTitleSorterRunTime.Text = "동작시간";
this.labelTitleMode1Time.Text = "시간";
this.labelTitleMode1Range.Text = "범위";
this.labelTitleMode1Variate.Text = "변량";
this.labelTitleDryContact.Text = "Dry Contact";
this.radioButtonMode1High.Text = "High";
this.radioButtonMode1Middle.Text = "Middle";
this.radioButtonMode1Low.Text = "Low";
this.radioButtonMode1UserSetting.Text = "User Setting";
this.labelTitleDryContact.Text = "시건장치 제어";
this.comboBoxSorterA.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterA.Items.Clear();
this.comboBoxSorterA.Items.Add("사용안함");
this.comboBoxSorterA.Items.Add("과량");
this.comboBoxSorterA.Items.Add("경량");
this.comboBoxSorterA.Items.Add("불량");
this.comboBoxSorterA.SelectedIndex = 1;
this.comboBoxSorterA.SelectedIndexChanged += new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterB.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
this.comboBoxSorterB.Items.Clear();
this.comboBoxSorterB.Items.Add("사용안함");
this.comboBoxSorterB.Items.Add("과량");
this.comboBoxSorterB.Items.Add("경량");
this.comboBoxSorterB.Items.Add("불량");
this.comboBoxSorterB.SelectedIndex = 2;
this.comboBoxSorterB.SelectedIndexChanged += new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
}
}
private void DefaultSetting()
{
this.comboBoxMode1Variate.SelectedIndexChanged -= new EventHandler(this.comboBoxMode1Variate_SelectedIndexChanged);
this.comboBoxMode1Variate.Items.Clear();
this.comboBoxMode1Variate.Items.Add(0.1);
this.comboBoxMode1Variate.Items.Add(0.2);
this.comboBoxMode1Variate.Items.Add(0.5);
this.comboBoxMode1Variate.Items.Add(1.0);
this.comboBoxMode1Variate.SelectedIndex = 0;
this.comboBoxMode1Variate.SelectedIndexChanged += new EventHandler(this.comboBoxMode1Variate_SelectedIndexChanged);
this.UpdateDryContactControl(this.ParentForm.ParentForm.CurrentSystemParameter3);
}
private void ControlEnableMode1(bool time, bool range, bool variate)
{
if (time == true)
{
if (this.labelMode1Time.ForeColor != Color.Black)
this.labelMode1Time.ForeColor = Color.Black;
}
else
{
if (this.labelMode1Time.ForeColor != Color.DarkGray)
this.labelMode1Time.ForeColor = Color.DarkGray;
}
if (range == true)
{
if (this.labelMode1Range.ForeColor != Color.Black)
this.labelMode1Range.ForeColor = Color.Black;
}
else
{
if (this.labelMode1Range.ForeColor != Color.DarkGray)
this.labelMode1Range.ForeColor = Color.DarkGray;
}
if (this.labelMode1Time.Enabled != time)
this.labelMode1Time.Enabled = time;
if (this.labelMode1Range.Enabled != range)
this.labelMode1Range.Enabled = range;
if (this.comboBoxMode1Variate.Enabled != variate)
this.comboBoxMode1Variate.Enabled = variate;
}
private void UpdateDisplayUser(UserItem user)
{
switch (user.Group)
{
case DataStore.UserGroup.LogOut:
this.groupBoxSorter.Enabled = false;
this.groupBoxAutoZero.Enabled = false;
break;
case DataStore.UserGroup.Level1Operator:
this.groupBoxSorter.Enabled = false;
this.groupBoxAutoZero.Enabled = false;
break;
case DataStore.UserGroup.Level2Engineer:
this.groupBoxSorter.Enabled = true;
this.groupBoxAutoZero.Enabled = true;
break;
case DataStore.UserGroup.Level3Manager:
this.groupBoxSorter.Enabled = true;
this.groupBoxAutoZero.Enabled = true;
break;
case DataStore.UserGroup.Level4Developer:
this.groupBoxSorter.Enabled = true;
this.groupBoxAutoZero.Enabled = true;
break;
default:
this.groupBoxSorter.Enabled = false;
this.groupBoxAutoZero.Enabled = false;
break;
}
}
public void UpdateDryContactControl(SystemParameter3 item)
{
if (item.ExternalOut1Mode == "10" || item.ExternalOut2Mode == "10" || item.ExternalOut3Mode == "10" || item.ExternalOut4Mode == "10")
{
this.labelTitleDryContact.Visible = true;
this.buttonDry1.Visible = true;
this.buttonDry2.Visible = true;
this.buttonDry3.Visible = true;
this.buttonDry4.Visible = true;
}
else
{
this.labelTitleDryContact.Visible = false;
this.buttonDry1.Visible = false;
this.buttonDry2.Visible = false;
this.buttonDry3.Visible = false;
this.buttonDry4.Visible = false;
}
if (item.ExternalOut1Mode == "10")
this.buttonDry1.Enabled = true;
else
this.buttonDry1.Enabled = false;
if (item.ExternalOut2Mode == "10")
this.buttonDry2.Enabled = true;
else
this.buttonDry2.Enabled = false;
if (item.ExternalOut3Mode == "10")
this.buttonDry3.Enabled = true;
else
this.buttonDry3.Enabled = false;
if (item.ExternalOut4Mode == "10")
this.buttonDry4.Enabled = true;
else
this.buttonDry4.Enabled = false;
}
public void UpdateControl(JudgmentSetItem item, SystemParameter4 parameter)
{
int iValue = 0;
string value = "";
#region Sorter
this.comboBoxSorterA.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterA_SelectedIndexChanged);
this.comboBoxSorterB.SelectedIndexChanged -= new EventHandler(this.comboBoxSorterB_SelectedIndexChanged);
// 선별기A 모드
iValue = item.Sorter1Mode;
if (this.comboBoxSorterA.SelectedIndex != iValue)
this.comboBoxSorterA.SelectedIndex = iValue;
// 선별기A 지연시간
iValue = item.Sorter1DelayTime;
if (this.labelSorterADelayTime.Text != iValue.ToString())
this.labelSorterADelayTime.Text = iValue.ToString();
// 선별기A 동작시간
iValue = item.Sorter1RunTime;
if (this.labelSorterARunTime.Text != iValue.ToString())
this.labelSorterARunTime.Text = iValue.ToString();
// 선별기B 모드
iValue = item.Sorter2Mode;
if (this.comboBoxSorterB.SelectedIndex != iValue)
this.comboBoxSorterB.SelectedIndex = iValue;
// 선별기B 지연시간
iValue = item.Sorter2DelayTime;
if (this.labelSorterBDelayTime.Text != iValue.ToString())
this.labelSorterBDelayTime.Text = iValue.ToString();
// 선별기B 동작시간
iValue = item.Sorter2RunTime;
if (this.labelSorterBRunTime.Text != iValue.ToString())
this.labelSorterBRunTime.Text = iValue.ToString();
#endregion
#region AutoZero
// Mode 1
//this.UpdateZero1ParameterDisplay(parameter);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress.ParameterRead4901, "");
#endregion
}
public void UpdateZero1ParameterDisplay(SystemParameter4 item)
{
int iValue = 0;
string value = "";
// Mode 1
iValue = int.Parse(item.MainAutoZero1Mode.Trim());
if (iValue == 4)
{
this.ControlEnableMode1(true, true, true);
this.radioButtonMode1UserSetting.Checked = true;
}
else
{
this.ControlEnableMode1(false, false, false);
if (iValue == 1)
this.radioButtonMode1Low.Checked = true;
else if (iValue == 2)
this.radioButtonMode1Middle.Checked = true;
else if (iValue == 3)
this.radioButtonMode1High.Checked = true;
}
// Mode1 Time
value = item.MainAutoZero1Time.Trim();
if (this.labelMode1Time.Text != value)
this.labelMode1Time.Text = value;
// Mode1 Range
value = item.MainAutoZero1Range.Trim();
if (this.labelMode1Range.Text != value)
this.labelMode1Range.Text = value;
// Mode1 Variate
iValue = int.Parse(item.MainAutoZero1Variate.Trim());
this.comboBoxMode1Variate.SelectedIndexChanged -= new EventHandler(this.comboBoxMode1Variate_SelectedIndexChanged);
this.comboBoxMode1Variate.SelectedIndex = iValue;
this.comboBoxMode1Variate.SelectedIndexChanged += new EventHandler(this.comboBoxMode1Variate_SelectedIndexChanged);
}
public void DisplayRefresh(SystemStatus status)
{
this.UpdateDisplayUser(status.CurrentUser);
this.UpdateControl(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.CurrentSystemParameter4);
}
#endregion
#region Event Handler
private void comboBoxSorterA_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void labelSorterDelayTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorterADelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else
{
this.labelSorterADelayTime.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.CurrentJudgmentSetItem.Sorter1DelayTime = myKeyPad.IntValue;
this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig1.ProductNumber - 1);
value = Helper.StringZeroFillDigits4(this.labelSorterADelayTime.Text);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Sorter1DelayTime, value);
}
}
}
private void labelSorterRunTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorterARunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else
{
this.labelSorterARunTime.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.CurrentJudgmentSetItem.Sorter1RunTime = myKeyPad.IntValue;
this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig1.ProductNumber - 1);
value = Helper.StringZeroFillDigits4(this.labelSorterARunTime.Text);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Sorter1RunTime, value);
}
}
}
private void comboBoxSorterB_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void labelSorterBDelayTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorterBDelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else
{
this.labelSorterBDelayTime.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.CurrentJudgmentSetItem.Sorter2DelayTime = myKeyPad.IntValue;
this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig1.ProductNumber - 1);
value = Helper.StringZeroFillDigits4(this.labelSorterBDelayTime.Text);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Sorter2DelayTime, value);
}
}
}
private void labelSorterBRunTime_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorterBRunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else
{
this.labelSorterBRunTime.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.CurrentJudgmentSetItem.Sorter2RunTime = myKeyPad.IntValue;
this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig1.ProductNumber - 1);
value = Helper.StringZeroFillDigits4(this.labelSorterBRunTime.Text);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Sorter2RunTime, value);
}
}
}
private void radioButtonMode1_Click(object sender, EventArgs e)
{
string value = "";
SmartRadioButton button = sender as SmartRadioButton;
if (button == null)
return;
if (button == this.radioButtonMode1Low)
value = "0001";
else if (button == this.radioButtonMode1Middle)
value = "0002";
else if (button == this.radioButtonMode1High)
value = "0003";
else if (button == this.radioButtonMode1UserSetting)
value = "0004";
this.ParentForm.ParentForm.CurrentSystemParameter4.LCDAutoZero1Mode = value;
this.ParentForm.ParentForm.SaveSystemParameter4File(this.ParentForm.ParentForm.CurrentSystemParameter4);
this.ParentForm.ParentForm.TransferParameter4();
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress.ParameterRead4901, "");
}
private void comboBoxMode1Variate_SelectedIndexChanged(object sender, EventArgs e)
{
string value = "";
value = Helper.StringZeroFillDigits4(this.comboBoxMode1Variate.SelectedIndex.ToString());
this.ParentForm.ParentForm.CurrentSystemParameter4.LCDAutoZero1Variate = value;
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Zero1Variate, value);
this.ParentForm.ParentForm.SaveSystemParameter4File(this.ParentForm.ParentForm.CurrentSystemParameter4);
}
private void labelMode1Range_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelMode1Range.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else
{
this.labelMode1Range.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.CurrentSystemParameter4.LCDAutoZero1Range = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentSystemParameter4.LCDAutoZero1Range);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Zero1Range, value);
this.ParentForm.ParentForm.SaveSystemParameter4File(this.ParentForm.ParentForm.CurrentSystemParameter4);
}
}
}
private void labelMode1Time_Click(object sender, EventArgs e)
{
string value = "";
DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelMode1Time.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
if (myKeyPad.ShowDialog() == DialogResult.OK)
{
if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
{
// 입력범위를 확인하세요
DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
myMsg.ShowDialog();
}
else
{
this.labelMode1Time.Text = myKeyPad.StringValue;
this.ParentForm.ParentForm.CurrentSystemParameter4.LCDAutoZero1Time = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentSystemParameter4.LCDAutoZero1Time);
this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Zero1Time, value);
this.ParentForm.ParentForm.SaveSystemParameter4File(this.ParentForm.ParentForm.CurrentSystemParameter4);
}
}
}
private void buttonBypassDirection_Click(object sender, EventArgs e)
{
if (this.buttonBypassDirection.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
this.ParentForm.ParentForm.SystemConfig2.IsBypassDirectionPass = false;
else
this.ParentForm.ParentForm.SystemConfig2.IsBypassDirectionPass = true;
}
private void buttonBypassOnce_Click(object sender, EventArgs e)
{
if (this.buttonBypassOnce.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
this.ParentForm.ParentForm.SystemConfig2.IsBypassOnce = false;
this.buttonBypassRun.Mode = SmartButton.BUTTONMODE.PUSH;
}
else
{
this.ParentForm.ParentForm.SystemConfig2.IsBypassOnce = true;
this.buttonBypassRun.Mode = SmartButton.BUTTONMODE.NORMAL;
}
}
private void buttonBypassRun_Click(object sender, EventArgs e)
{
if (this.ParentForm.ParentForm.SystemConfig2.IsBypassOnce == true)
{
if (this.ParentForm.ParentForm.SystemConfig2.IsBypassDirectionPass == true)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.BypassOnce, CommunicationID.MainBoard);
else
this.ParentForm.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.ParentForm.SystemConfig2.IsBypassDirectionPass == true)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.BypassON, CommunicationID.MainBoard);
else
this.ParentForm.ParentForm.TransferData(CommunicationCommand.ByNGON, CommunicationID.MainBoard);
}
else
{
this.buttonBypassDirection.Enabled = true;
this.buttonBypassOnce.Enabled = true;
if (this.ParentForm.ParentForm.SystemConfig2.IsBypassDirectionPass == true)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.BypassOFF, CommunicationID.MainBoard);
else
this.ParentForm.ParentForm.TransferData(CommunicationCommand.ByNGOFF, CommunicationID.MainBoard);
}
}
}
private void buttonDryContact_Click(object sender, EventArgs e)
{
SmartX.SmartButton button = sender as SmartX.SmartButton;
if (button == null)
return;
if (button == this.buttonDry1)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.Output, CommunicationID.SubBoard1);
else if (button == this.buttonDry2)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.Output, CommunicationID.SubBoard2);
else if (button == this.buttonDry3)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.Output, CommunicationID.SubBoard3);
else if (button == this.buttonDry4)
this.ParentForm.ParentForm.TransferData(CommunicationCommand.Output, CommunicationID.SubBoard4);
}
#endregion
}
}