INT63DC_6CH/INT63DC_6CH/Forms/FormConfiguration.cs

951 lines
43 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_ImageDll;
using INT63DC_6CH.DialogForms;
using INT63DC_6CH.In_SerialManager;
namespace INT63DC_6CH.Forms
{
public partial class FormConfiguration : Form
{
#region Field
private FormMain m_ParentForm;
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.groupBoxOption.Text = "Option";
this.labelStaticEmptyWeight.Text = "Empty weight Set";
this.labelStaticChattering.Text = "Chattering";
this.labelStaticBuzzerOnTime.Text = "Buzzer ON time";
this.labelStaticRelayOnTime.Text = "Relay ON time";
this.labelStaticBypass.Text = "Bypass";
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.groupBoxOption.Text = "等等";
this.labelStaticEmptyWeight.Text = "空重设置";
this.labelStaticChattering.Text = "颤振";
this.labelStaticBuzzerOnTime.Text = "蜂鸣器开启时间";
this.labelStaticRelayOnTime.Text = "继电器接通时间";
this.labelStaticBypass.Text = "旁路";
this.groupBoxBypass.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.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.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.groupBoxOption.Text = "Možnosti";
this.labelStaticEmptyWeight.Text = "Nastavení prázdné hmotnosti";
this.labelStaticChattering.Text = "Uklidnění tenzometru";
this.labelStaticBuzzerOnTime.Text = "Zvukový signál - čas";
this.labelStaticRelayOnTime.Text = "Relé - čas";
this.labelStaticBypass.Text = "Vše";
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.labelStaticBypass.Text = "Bypass vše";
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.groupBoxOption.Text = "Möglichkeit";
this.labelStaticEmptyWeight.Text = "Leergewichtseinstellung";
this.labelStaticChattering.Font = font;
this.labelStaticChattering.Text = "Beruhigung des Dehnungsmessers";
this.labelStaticBuzzerOnTime.Text = "Summer-Einschaltzeit";
this.labelStaticRelayOnTime.Text = "Relais-Einschaltzeit";
this.labelStaticBypass.Text = "Bypass-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.labelStaticBypass.Text = "Bypass Alles";
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.groupBoxOption.Text = "オプション設定";
this.labelStaticEmptyWeight.Text = "空重量セット";
this.labelStaticChattering.Text = "チャタリング";
this.labelStaticBuzzerOnTime.Text = "ブザㅡON時間";
this.labelStaticRelayOnTime.Text = "リレㅡON時間";
this.labelStaticBypass.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.labelStaticBypass.Text = "バイパスモㅡド";
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()
{
}
private void DefaultSetting()
{
this.CollectionBypassLabel = new Collection<SmartLabel>();
this.CollectionBypassLabel.Clear();
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.CollectionBypassButton = new Collection<SmartButton>();
this.CollectionBypassButton.Clear();
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);
for (int i = this.ParentForm.SystemConfig.EquipmentColumns; i < 12; i++)
{
this.CollectionBypassLabel[i].Visible = false;
this.CollectionBypassButton[i].Visible = false;
}
// Empty중량설정
this.labelEmptyWeight.Text = Helper.StringToDecimalPlaces(this.ParentForm.SystemConfig.EmptyWeight, this.ParentForm.SystemConfig.DecimalPlaces);
// 채터링
this.labelChattering.Text = this.ParentForm.SystemConfig.Chattering.ToString();
// 부저 ON 시간
this.labelBuzzerOnTime.Text = this.ParentForm.SystemConfig.BuzzerRunTime.ToString();
// 릴레이 ON 시간
this.labelRelayOnTime.Text = this.ParentForm.SystemConfig.RelayRunTime.ToString();
}
public void DisplayRefresh()
{
this.ParentForm.SystemConfig.CurrentForm = DataStore.FormStore.FormConfiguration;
this.buttonSaveBypass.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();
}
}
#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)
{
this.ParentForm.ChildFormMenu.DisplayRefresh();
((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMenu);
}
private void labelChattering_Click(object sender, EventArgs e)
{
string before = "", after = "";
string value = "";
before = this.labelChattering.Text;
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;
this.ParentForm.SystemConfig.Chattering = myKeyPad.IntValue;
after = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelChattering.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6006_Chattering, value);
this.ParentForm.SaveSystemConfigurationFile(this.ParentForm.SystemConfig);
// SetTrackingHistoryData
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.EtcChattering, "", before, after);
}
}
}
private void labelBuzzerOnTime_Click(object sender, EventArgs e)
{
string before = "", after = "";
string value = "";
before = this.labelBuzzerOnTime.Text;
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;
this.ParentForm.SystemConfig.BuzzerRunTime = myKeyPad.IntValue;
after = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelBuzzerOnTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6001_BuzzerOnTime, value);
this.ParentForm.SaveSystemConfigurationFile(this.ParentForm.SystemConfig);
// SetTrackingHistoryData
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.EtcBuzzerRunTime, "", before, after);
}
}
}
private void labelRelayOnTime_Click(object sender, EventArgs e)
{
string before = "", after = "";
string value = "";
before = this.labelRelayOnTime.Text;
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;
this.ParentForm.SystemConfig.RelayRunTime = myKeyPad.IntValue;
after = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.labelRelayOnTime.Text);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6002_RelayOperatingTime, value);
this.ParentForm.SaveSystemConfigurationFile(this.ParentForm.SystemConfig);
// SetTrackingHistoryData
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.EtcRelayRunTime, "", before, after);
}
}
}
private void labelEmptyWeight_Click(object sender, EventArgs e)
{
string before = "", after = "";
string value = "";
before = this.labelEmptyWeight.Text;
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(".", "");
after = myKeyPad.StringValue;
value = Helper.StringZeroFillDigits4(this.ParentForm.SystemConfig.EmptyWeight);
this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._1021_EmptyWeight, value);
this.ParentForm.SaveSystemConfigurationFile(this.ParentForm.SystemConfig);
// SetTrackingHistoryData
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.EtcEmptyWeight, "", before, after);
}
}
}
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)
{
string before = "", after = "", lane = "";
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");
}
}
#region Lane 1
if (this.buttonBypassLane1.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[0].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[0].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "1";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[0].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[0].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "1";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region Lane 2
// Lane 2
if (this.buttonBypassLane2.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[1].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[1].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "2";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[1].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[1].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "2";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region Lane 3
// Lane 3
if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[2].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "3";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[2].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "3";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region Lane 4
// Lane 4
if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[3].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "4";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[3].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "4";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region Lane 5
// Lane 5
if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[4].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "5";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[4].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "5";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region Lane 6
// Lane 6
if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[5].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "6";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[5].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "6";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
if (this.ParentForm.SystemConfig.EquipmentColumns <= 7)
{
#region Lane 7
// Lane 7
if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[6].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "7";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[6].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "7";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
}
if (this.ParentForm.SystemConfig.EquipmentColumns <= 8)
{
#region 8열
// Lane 8
if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[7].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[7].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "8";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[7].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[7].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "8";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
}
if (this.ParentForm.SystemConfig.EquipmentColumns <= 10)
{
#region 9열
if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[8].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[8].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "9";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[8].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[8].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "9";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region 10열
if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[9].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[9].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "10";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[9].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[9].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "10";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
}
if (this.ParentForm.SystemConfig.EquipmentColumns <= 12)
{
#region 11열
if (this.buttonBypassLane11.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[10].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[10].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "11";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[10].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[10].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "11";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
#region 12열
if (this.buttonBypassLane12.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
{
if (this.ParentForm.CollectionWeightData[11].IsBypassMode != true)
{
this.ParentForm.CollectionWeightData[11].IsBypassMode = true;
before = "OFF";
after = "ON";
lane = "12";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
else
{
if (this.ParentForm.CollectionWeightData[11].IsBypassMode != false)
{
this.ParentForm.CollectionWeightData[11].IsBypassMode = false;
before = "ON";
after = "OFF";
lane = "12";
// Part11
if (this.ParentForm.SystemConfig.IsOptPart11 == true)
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
}
}
#endregion
}
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)
{
string before = "", after = "";
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());
before = "OFF";
after = "ON";
}
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());
before = "ON";
after = "OFF";
}
// SetTrackingHistoryData
this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_All, "", before, after);
}
#endregion
}
}