Esempio n. 1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 폼 초기화
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public bool InitializeForm()
        {
            bool bReturn = false;

            do
            {
                var pDocument = CDocument.GetDocument;
                m_iCameraCount = ( int )CDefine.enumCamera.CAMERA_FINAL;
                // 검사 결과 ( 디스플레이 & 데이터 갱신 )
                m_delegateUpdateDisplayResultVIDI    = new DelegateUpdateDisplay(UpdateDisplayResultVIDI);
                m_delegateUpdateDisplayResultMeasure = new DelegateUpdateDisplay(UpdateDisplayResultMeasure);
                m_delegateUpdateDisplayOriginal      = new DelegateUpdateDisplay(UpdateDisplayOriginal);
                m_delegateUpdateDisplayPMS           = new DelegateUpdateDisplay(UpdateDisplayPMS);
                m_delegateUpdateResult = new DelegateUpdateResult(UpdateResult);
                // 라이브 결과 ( 디스플레이 )
                m_delegateUpdateDisplayLive = new DelegateUpdateDisplayLive(UpdateDisplayLive);
                // 이미지 저장
                m_delegateSaveImage = new DelegateSaveImage(SaveImage);
                // 리스트 로그
                m_objListLog = new ListBox[m_iCameraCount];
                m_objListLog[( int )CDefine.enumCamera.CAMERA_1] = this.listLogInputTray1;

                // 디스플레이 화면 생성
                {
                    m_iDisplayIndex   = ( int )enumDisplayIndex.DISPLAY_FINAL;
                    m_objPanelDisplay = new Panel[m_iDisplayIndex];
                    m_objPanelDisplay[( int )enumDisplayIndex.PMS]      = this.panelDisplayPMS;
                    m_objPanelDisplay[( int )enumDisplayIndex.ORIGIN_1] = this.panelDisplayOriginalImage1;
                    m_objPanelDisplay[( int )enumDisplayIndex.ORIGIN_2] = this.panelDisplayOriginalImage2;
                    m_objPanelDisplay[( int )enumDisplayIndex.ORIGIN_3] = this.panelDisplayOriginalImage3;
                    m_objPanelDisplay[( int )enumDisplayIndex.ORIGIN_4] = this.panelDisplayOriginalImage4;

                    m_objPanelDisplay[( int )enumDisplayIndex.VIDI_1]    = this.panelDisplayVidi1;
                    m_objPanelDisplay[( int )enumDisplayIndex.VIDI_2]    = this.panelDisplayVidi2;
                    m_objPanelDisplay[( int )enumDisplayIndex.VIDI_3]    = this.panelDisplayVidi3;
                    m_objPanelDisplay[( int )enumDisplayIndex.MEASURE_1] = this.panelDisplayVidi4;
                    m_objPanelDisplay[( int )enumDisplayIndex.MEASURE_2] = this.panelDisplayVidi5;
                    m_objPanelDisplay[( int )enumDisplayIndex.MEASURE_3] = this.panelDisplayVidi6;

                    // 폼 디스플레이 생성
                    m_objFormDisplay     = new Form[m_iDisplayIndex];
                    m_objDisplaySize     = new Size[m_iDisplayIndex];
                    m_objDisplayLocation = new Point[m_iDisplayIndex];

                    string[] strDisplayName = new string[m_objFormDisplay.Length];
                    strDisplayName[( int )enumDisplayIndex.PMS]      = enumDisplayIndex.PMS.ToString();
                    strDisplayName[( int )enumDisplayIndex.ORIGIN_1] = enumDisplayIndex.ORIGIN_1.ToString();
                    strDisplayName[( int )enumDisplayIndex.ORIGIN_2] = enumDisplayIndex.ORIGIN_2.ToString();
                    strDisplayName[( int )enumDisplayIndex.ORIGIN_3] = enumDisplayIndex.ORIGIN_3.ToString();
                    strDisplayName[( int )enumDisplayIndex.ORIGIN_4] = enumDisplayIndex.ORIGIN_4.ToString();

                    strDisplayName[( int )enumDisplayIndex.VIDI_1]    = enumDisplayIndex.VIDI_1.ToString();
                    strDisplayName[( int )enumDisplayIndex.VIDI_2]    = enumDisplayIndex.VIDI_2.ToString();
                    strDisplayName[( int )enumDisplayIndex.VIDI_3]    = enumDisplayIndex.VIDI_3.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_1] = enumDisplayIndex.MEASURE_1.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_2] = enumDisplayIndex.MEASURE_2.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_3] = enumDisplayIndex.MEASURE_3.ToString();

                    for (int iLoopCount = 0; iLoopCount < m_objFormDisplay.Length; iLoopCount++)
                    {
                        // 디스플레이 화면 생성 & 초기화
                        CFormDisplay objForm     = new CFormDisplay();
                        int          iImageIndex = 0;
                        if (( int )enumDisplayIndex.VIDI_1 > iLoopCount && ( int )enumDisplayIndex.PMS < iLoopCount)
                        {
                            iImageIndex = iLoopCount - ( int )enumDisplayIndex.ORIGIN_1;
                        }
                        else if (( int )enumDisplayIndex.VIDI_1 <= iLoopCount && ( int )enumDisplayIndex.MEASURE_1 > iLoopCount)
                        {
                            iImageIndex = iLoopCount - ( int )enumDisplayIndex.VIDI_1;
                        }
                        else if (( int )enumDisplayIndex.MEASURE_1 <= iLoopCount)
                        {
                            iImageIndex = iLoopCount - ( int )enumDisplayIndex.MEASURE_1;
                        }


                        objForm.Initialize(( int )CDefine.enumCamera.CAMERA_1, string.Format("{0}", strDisplayName[iLoopCount]), false, iImageIndex);
                        objForm.SetDisplayIndex(iLoopCount);

                        objForm.Visible = true;
                        objForm.SetTimer(true);
                        // 사이즈 조정
                        Panel objPanel = m_objPanelDisplay[iLoopCount];
                        objForm.SetSize(objPanel.Location.X, objPanel.Location.Y, objPanel.Width, objPanel.Height, true);
                        // 디스플레이 사이즈 변경 이벤트 추가
                        objForm.EventChangeSizeDisplay += new CFormDisplay.DelegateChangeSizeDisplay(ChangeDisplaySize);
                        // 패널에 화면 붙임
                        SetFormDockStyle(objForm, objPanel);
                        m_objFormDisplay[iLoopCount] = objForm;
                        // 원본 패널 사이즈 및 위치 저장
                        m_objDisplaySize[iLoopCount]     = m_objPanelDisplay[iLoopCount].Size;
                        m_objDisplayLocation[iLoopCount] = m_objPanelDisplay[iLoopCount].Location;
                    }
                }

                // 디스플레이 확대 화면 생성
                m_objFormDisplayChangeSize = new CFormDisplayChangeSize();

                // 버튼 색상 정의
                SetButtonColor();
                // 초기화 언어 변경
                SetChangeLanguage();
                // 버튼 이벤트 로그 정의
                SetButtonEventChange();
                // 타이머 외부에서 제어
                timer.Interval = 100;
                timer.Enabled  = false;

                bReturn = true;
            } while(false);

            return(bReturn);
        }
Esempio n. 2
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 초기화
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private bool Initialize()
        {
            bool bReturn   = false;
            var  pDocument = CDocument.GetDocument;

            do
            {
                InitializeForm();
                m_delegateUpdateDisplayResult        = new DelegateUpdateDisplay(UpdateDisplayResult);
                m_delegateUpdateDisplayResultHistory = new DelegateUpdateDisplayHistory(UpdateDisplayResultHistory);

                // 디스플레이 화면 생성
                {
                    m_iDisplayIndex       = ( int )enumDisplayIndex.DISPLAY_FINAL;
                    m_objPanelDisplayLeft = new Panel[m_iDisplayIndex];
                    m_objPanelDisplayLeft[( int )enumDisplayIndex.OIRGINAL] = this.panelDisplayPosition22;

                    m_objPanelDisplayLeft[( int )enumDisplayIndex.MEASURE_1] = this.panelDisplayMeasure11;
                    m_objPanelDisplayLeft[( int )enumDisplayIndex.MEASURE_2] = this.panelDisplayMeasure12;
                    m_objPanelDisplayLeft[( int )enumDisplayIndex.MEASURE_3] = this.panelDisplayMeasure13;
                    m_objPanelDisplayLeft[( int )enumDisplayIndex.MEASURE_4] = this.panelDisplayMeasure14;
                    m_objPanelDisplayLeft[( int )enumDisplayIndex.MEASURE_5] = this.panelDisplayMeasure15;
                    m_objPanelDisplayLeft[( int )enumDisplayIndex.MEASURE_6] = this.panelDisplayMeasure16;

                    // 폼 디스플레이 생성
                    m_objFormDisplayLeft = new Form[m_iDisplayIndex];

                    string[] strDisplayName = new string[m_objFormDisplayLeft.Length];
                    strDisplayName[( int )enumDisplayIndex.OIRGINAL]  = enumDisplayIndex.OIRGINAL.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_1] = enumDisplayIndex.MEASURE_1.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_2] = enumDisplayIndex.MEASURE_2.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_3] = enumDisplayIndex.MEASURE_3.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_4] = enumDisplayIndex.MEASURE_4.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_5] = enumDisplayIndex.MEASURE_5.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_6] = enumDisplayIndex.MEASURE_6.ToString();

                    for (int iLoopCount = 0; iLoopCount < m_objFormDisplayLeft.Length; iLoopCount++)
                    {
                        // 디스플레이 화면 생성 & 초기화
                        CFormDisplay objForm     = new CFormDisplay();
                        int          iImageIndex = 0;
                        if (( int )enumDisplayIndex.OIRGINAL == iLoopCount)
                        {
                            iImageIndex = iLoopCount;
                        }
                        else if (( int )enumDisplayIndex.MEASURE_1 <= iLoopCount)
                        {
                            iImageIndex = iLoopCount - ( int )enumDisplayIndex.MEASURE_1;
                        }


                        objForm.Initialize(( int )CDefine.enumCamera.CAMERA_1, string.Format("{0}", strDisplayName[iLoopCount]), false, iImageIndex);
                        objForm.UseMeasureInfo3D();

                        objForm.Visible = true;
                        objForm.SetTimer(true);
                        // 사이즈 조정
                        Panel objPanel = m_objPanelDisplayLeft[iLoopCount];
                        objForm.SetSize(objPanel.Location.X, objPanel.Location.Y, objPanel.Width, objPanel.Height, false, false);
                        // 패널에 화면 붙임
                        SetFormDockStyle(objForm, objPanel);
                        m_objFormDisplayLeft[iLoopCount] = objForm;
                    }
                }

                // 디스플레이 화면 생성
                {
                    m_iDisplayIndex        = ( int )enumDisplayIndex.DISPLAY_FINAL;
                    m_objPanelDisplayRight = new Panel[m_iDisplayIndex];
                    m_objPanelDisplayRight[( int )enumDisplayIndex.OIRGINAL] = this.panelDisplayPosition24;

                    m_objPanelDisplayRight[( int )enumDisplayIndex.MEASURE_1] = this.panelDisplayMeasure21;
                    m_objPanelDisplayRight[( int )enumDisplayIndex.MEASURE_2] = this.panelDisplayMeasure22;
                    m_objPanelDisplayRight[( int )enumDisplayIndex.MEASURE_3] = this.panelDisplayMeasure23;
                    m_objPanelDisplayRight[( int )enumDisplayIndex.MEASURE_4] = this.panelDisplayMeasure24;
                    m_objPanelDisplayRight[( int )enumDisplayIndex.MEASURE_5] = this.panelDisplayMeasure25;
                    m_objPanelDisplayRight[( int )enumDisplayIndex.MEASURE_6] = this.panelDisplayMeasure26;

                    // 폼 디스플레이 생성
                    m_objFormDisplayRight = new Form[m_iDisplayIndex];

                    string[] strDisplayName = new string[m_objFormDisplayRight.Length];
                    strDisplayName[( int )enumDisplayIndex.OIRGINAL]  = enumDisplayIndex.OIRGINAL.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_1] = enumDisplayIndex.MEASURE_1.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_2] = enumDisplayIndex.MEASURE_2.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_3] = enumDisplayIndex.MEASURE_3.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_4] = enumDisplayIndex.MEASURE_4.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_5] = enumDisplayIndex.MEASURE_5.ToString();
                    strDisplayName[( int )enumDisplayIndex.MEASURE_6] = enumDisplayIndex.MEASURE_6.ToString();

                    for (int iLoopCount = 0; iLoopCount < m_objFormDisplayRight.Length; iLoopCount++)
                    {
                        // 디스플레이 화면 생성 & 초기화
                        CFormDisplay objForm     = new CFormDisplay();
                        int          iImageIndex = 0;
                        if (( int )enumDisplayIndex.OIRGINAL == iLoopCount)
                        {
                            iImageIndex = iLoopCount;
                        }
                        else if (( int )enumDisplayIndex.MEASURE_1 <= iLoopCount)
                        {
                            iImageIndex = iLoopCount - ( int )enumDisplayIndex.MEASURE_1;
                        }


                        objForm.Initialize(( int )CDefine.enumCamera.CAMERA_1, string.Format("{0}", strDisplayName[iLoopCount]), false, iImageIndex);
                        objForm.SetDisplayIndex(iLoopCount);

                        objForm.Visible = true;
                        objForm.SetTimer(true);
                        // 사이즈 조정
                        Panel objPanel = m_objPanelDisplayRight[iLoopCount];
                        objForm.SetSize(objPanel.Location.X, objPanel.Location.Y, objPanel.Width, objPanel.Height, false, false);
                        // 패널에 화면 붙임
                        SetFormDockStyle(objForm, objPanel);
                        m_objFormDisplayRight[iLoopCount] = objForm;
                    }
                }

                bReturn = true;
            } while(false);

            return(bReturn);
        }