////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 폼 변경 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void SetChangeForm(CDefine.FormViewSetup eForm) { var pDocument = CDocument.GetDocument; do { // 현재 폼이 이전 폼과 같으면 건너뜀 if (m_eCurrentForm == eForm) { break; } // 현재 폼 Invisible if (CDefine.FormViewSetup.FORM_VIEW_SETUP_FINAL != m_eCurrentForm) { m_stForm[( int )m_eCurrentForm].m_IForm.SetVisible(false); m_stForm[( int )m_eCurrentForm].m_IForm.SetTimer(false); } // 생성이 되어 있지 않으면 생성 if (null == m_stForm[( int )eForm].m_IForm) { switch (eForm) { case CDefine.FormViewSetup.FORM_VIEW_SETUP_VISION_ALIGN: if (CDefine.enumCameraType.CAMERA_3D == pDocument.m_objConfig.GetSystemParameter().eCameraType&& CDefine.enumMachineType.PROCESS_150 == pDocument.m_objConfig.GetSystemParameter().eMachineType) { m_stForm[( int )eForm] = new structureForm(new CFormSetupVisionGocator() as CFormInterface); } else { m_stForm[( int )eForm] = new structureForm(new CFormSetupVision() as CFormInterface); } break; case CDefine.FormViewSetup.FORM_VIEW_SETUP_CAMERA: m_stForm[( int )eForm] = new structureForm(new CFormSetupCamera() as CFormInterface); break; default: break; } // 패널에 생성된 화면 붙임 SetFormDockStyle(m_stForm[( int )eForm].m_objForm, this.panelFormView); m_stForm[( int )eForm].m_IForm.SetVisible(true); m_stForm[( int )eForm].m_IForm.SetTimer(true); m_stForm[( int )eForm].m_IForm.SetChangeLanguage(); } // 생성 되어 있으면 Visible else { m_stForm[( int )eForm].m_IForm.SetVisible(true); m_stForm[( int )eForm].m_IForm.SetTimer(true); m_stForm[( int )eForm].m_IForm.SetChangeLanguage(); } m_eCurrentForm = eForm; } while(false); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //생성 : //추가 : //목적 : 버튼 클릭 이벤트 정의 //설명 : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void ButtonMenu_Click(object sender, EventArgs e) { var pDocument = CDocument.GetDocument; var pFormCommon = CFormCommon.GetFormCommon; Button objButton = sender as Button; try { var objRegex = new Regex(@"\[(.+)\]"); if (true == objRegex.IsMatch(objButton.Name)) { string strText = objRegex.Match(objButton.Name).Groups[1].Value; CDefine.FormViewSetup eFormView = (CDefine.FormViewSetup)Convert.ToInt32(strText); // 버튼 로그 추가 string strLog = string.Format("[{0}] [Form Change : {1} -> {2}]", "ButtonMenu_Click", m_eCurrentForm.ToString(), eFormView.ToString()); pDocument.SetUpdateButtonLog(this, strLog); SetChangeForm(eFormView); } } catch (Exception ex) { Trace.WriteLine(ex.Message); } }