67 lines
2.8 KiB
C#
67 lines
2.8 KiB
C#
using CoreUnit.Common;
|
|
using System;
|
|
using System.Reflection;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CoreUnit.Scanner.UserControl
|
|
{
|
|
public partial class ScannerParamSettingUserCtrl : System.Windows.Forms.UserControl
|
|
{
|
|
ScannerUnit m_scannerUnit = null;
|
|
public ScannerParamSettingUserCtrl()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
#region 사용자 정의 함수
|
|
public void Initialize(ScannerUnit scannerUnit)
|
|
{
|
|
m_scannerUnit = scannerUnit;
|
|
paramSettingPropertyGrid.SelectedObject = m_scannerUnit.ScannerUnitParamObj;
|
|
}
|
|
#endregion
|
|
|
|
private void ParamSettingUserCtrl_Load(object sender, EventArgs e)
|
|
{
|
|
}
|
|
|
|
private void btnResetScannerParam_Click(object sender, EventArgs e)
|
|
{
|
|
try {
|
|
DialogResult result = CoreUnit.Control.Dialog.MessageDlg.messageDlg.RunDlg("스캐너 변수값을 파일 저장값으로 초기화 하시겠습니까?", false, Control.Dialog.MessageDlg.DialogMode.MODAL);
|
|
if (result == DialogResult.Yes) {
|
|
m_scannerUnit.Load();
|
|
paramSettingPropertyGrid.SelectedObject = m_scannerUnit.ScannerUnitParamObj;
|
|
}
|
|
} catch (Exception ex) {
|
|
UtilUnit.logUnit.SetLog(LogUnit.eLogType.ALARM, MethodBase.GetCurrentMethod().Name, ex.Message);
|
|
}
|
|
}
|
|
|
|
private void btnSaveScannerParam_Click(object sender, EventArgs e)
|
|
{
|
|
try {
|
|
DialogResult result = CoreUnit.Control.Dialog.MessageDlg.messageDlg.RunDlg("변경된 스캐너 변수값을 저장하시겠습니까?(변수값 변경 후에는 보드 초기화 작업을 실행하여야 시스템에 적용됩니다.)", false, Control.Dialog.MessageDlg.DialogMode.MODAL);
|
|
if (result == DialogResult.Yes) {
|
|
m_scannerUnit.Save();
|
|
}
|
|
} catch (Exception ex) {
|
|
UtilUnit.logUnit.SetLog(LogUnit.eLogType.ALARM, MethodBase.GetCurrentMethod().Name, ex.Message);
|
|
}
|
|
}
|
|
|
|
private void btnInitializeScanBoard_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult result = CoreUnit.Control.Dialog.MessageDlg.messageDlg.RunDlg("스캐너 보드 초기화 작업을 진행하시겠습니까?(변수값 변경후에는 보드 초기화 작업을 실행하여야 시스템에 적용됩니다.)", false, Control.Dialog.MessageDlg.DialogMode.MODAL);
|
|
if (result == DialogResult.Yes) {
|
|
try {
|
|
m_scannerUnit.Open();
|
|
m_scannerUnit.Initialize();
|
|
} catch (Exception ex) {
|
|
UtilUnit.logUnit.SetLog(LogUnit.eLogType.ALARM, MethodBase.GetCurrentMethod().Name, ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|