136 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			C#
		
	
			
		
		
	
	
			136 lines
		
	
	
		
			5.1 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.IO;
 | |
| using System.Net.Sockets;
 | |
| using System.Text;
 | |
| using System.Threading;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| using ITC81DB_2H_ImageDll;
 | |
| using ITC81DB_0H.DialogForms;
 | |
| using ITC81DB_0H.Forms;
 | |
| using ITC81DB_2H.Datastore;
 | |
| 
 | |
| namespace ITC81DB_0H
 | |
| {
 | |
|     public partial class ControlConfiMULTiJET : UserControl
 | |
|     {
 | |
|         #region Field
 | |
|         private FormMenu m_ParentForm; 
 | |
|         #endregion
 | |
| 
 | |
|         #region Constructor
 | |
|         public ControlConfiMULTiJET(FormMenu parent)
 | |
|         {
 | |
|             InitializeComponent();
 | |
| 
 | |
|             this.ParentForm = parent;
 | |
| 
 | |
|             this.InitializeDesign();
 | |
|             this.DefaultSetting();
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region Property
 | |
|         public FormMenu ParentForm
 | |
|         {
 | |
|             get { return this.m_ParentForm; }
 | |
|             private set { this.m_ParentForm = value; }
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|         #region Method
 | |
|         public void InitializeDesign()
 | |
|         {
 | |
|             Class1 images = new Class1();
 | |
| 
 | |
|             if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.English)
 | |
|             {
 | |
|                 this.smartGroupBox1.Image = new Bitmap(images.GetImage(Class1.ButtonImages.engBackgroundBottomAddOn));
 | |
|             }
 | |
|             else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Chinese)
 | |
|             {
 | |
|                 this.smartGroupBox1.Image = new Bitmap(images.GetImage(Class1.ButtonImages.chnBackgroundBottomAddOn));
 | |
|             }
 | |
|             else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Czech)
 | |
|             {
 | |
|             }
 | |
|             else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Russian)
 | |
|             {
 | |
|                 this.smartGroupBox1.Image = new Bitmap(images.GetImage(Class1.ButtonImages.rusBackgroundBottomAddOn));
 | |
|             }
 | |
|             else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.German)
 | |
|             {
 | |
|                 this.smartGroupBox1.Image = new Bitmap(images.GetImage(Class1.ButtonImages.gerBackgroundBottomAddOn));
 | |
|             }
 | |
|             else if (this.ParentForm.ParentForm.SystemConfig1.Language == Define.E_LanguageID.Spanish)
 | |
|             {
 | |
|                 this.smartGroupBox1.Image = new Bitmap(images.GetImage(Class1.ButtonImages.engBackgroundBottomAddOn));
 | |
|             }
 | |
|             else
 | |
|             {
 | |
|                 this.smartGroupBox1.Image = new Bitmap(images.GetImage(Class1.ButtonImages.korBackgroundBottomAddOn));
 | |
|             }
 | |
|         }
 | |
|         private void DefaultSetting()
 | |
|         {
 | |
|         }
 | |
| 
 | |
|         public void DisplayRefresh(Define.E_MenuBottomConfiguration menu)
 | |
|         {
 | |
|             if (menu == Define.E_MenuBottomConfiguration.SerialCOM1)
 | |
|             {
 | |
|                 this.labelSlaveAddress.Text = this.ParentForm.ParentForm.SystemConfig3.MULTiJETSlaveAddressCOM1.ToString();
 | |
|             }
 | |
|             else if (menu == Define.E_MenuBottomConfiguration.SerialCOM3)
 | |
|             {
 | |
|                 this.labelSlaveAddress.Text = this.ParentForm.ParentForm.SystemConfig3.MULTiJETSlaveAddressCOM3.ToString();
 | |
|             }
 | |
|             else if (menu == Define.E_MenuBottomConfiguration.SerialCOM4)
 | |
|             {
 | |
|                 this.labelSlaveAddress.Text = this.ParentForm.ParentForm.SystemConfig3.MULTiJETSlaveAddressCOM4.ToString();
 | |
|             }
 | |
|         }
 | |
|         #endregion
 | |
|         
 | |
|         #region Event Handler
 | |
|         private void labelSlaveAddress_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             string value = "";
 | |
|             DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSlaveAddress.Text, 3, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language);
 | |
| 
 | |
|             if (myKeyPad.ShowDialog() == DialogResult.OK)
 | |
|             {
 | |
|                 if (myKeyPad.IntValue < 1 || myKeyPad.IntValue > 255)
 | |
|                 {
 | |
|                     // 입력범위를 확인하세요
 | |
|                     DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language);
 | |
|                     myMsg.ShowDialog();
 | |
|                 }
 | |
|                 else
 | |
|                 {
 | |
|                     this.labelSlaveAddress.Text = myKeyPad.StringValue;
 | |
| 
 | |
|                     Define.E_MenuBottomConfiguration temp = this.ParentForm.CurrentConfigurationMenu();
 | |
| 
 | |
|                     if (temp == Define.E_MenuBottomConfiguration.SerialCOM1)
 | |
|                         this.ParentForm.ParentForm.SystemConfig3.MULTiJETSlaveAddressCOM1 = myKeyPad.IntValue;
 | |
|                     else if (temp == Define.E_MenuBottomConfiguration.SerialCOM3)
 | |
|                         this.ParentForm.ParentForm.SystemConfig3.MULTiJETSlaveAddressCOM3 = myKeyPad.IntValue;
 | |
|                     else if (temp == Define.E_MenuBottomConfiguration.SerialCOM4)
 | |
|                         this.ParentForm.ParentForm.SystemConfig3.MULTiJETSlaveAddressCOM4 = myKeyPad.IntValue;
 | |
| 
 | |
|                     this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
|         #endregion
 | |
| 
 | |
|     }
 | |
| }
 |