Example #1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 :
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnExposureTime_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(double.Parse(BtnExposureTime.Text));

            if (DialogResult.OK == objKeyPad.ShowDialog())
            {
                m_objRecipeParameter.objCameraConfig.dExposureTime = objKeyPad.m_dValue;
            }
        }
Example #2
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 :
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnLight1_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(double.Parse(BtnLight1.Text));

            if (DialogResult.OK == objKeyPad.ShowDialog())
            {
                //if( 0 > ( int )objKeyPad.m_dValue ) objKeyPad.m_dValue = 0;
                //else if( 255 < ( int )objKeyPad.m_dValue ) objKeyPad.m_dValue = 255;
                //m_objLightControllerParameter[ ( int )CDefine.enumLightController.LIGHT_CONTROLLER_MAIN ].iIntensity[ ( int )CDefine.enumCamera.CAMERA_1 + ( ( int )m_eCamera * 2 ) ] = ( int )objKeyPad.m_dValue;
            }
        }
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 각도 입력
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnLineDegree_Click(object sender, EventArgs e)
        {
            // rad -> deg
            FormKeyPad objKeyPad = new FormKeyPad(( double )(m_objCreateLineTool.Line.Rotation * (180 / Math.PI)));

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // deg -> rad
                m_objCreateLineTool.Line.Rotation = objKeyPad.m_dResultValue * (Math.PI / 180);
                // 라인 생성 그래픽 받아옴
                GetLine();
            }
        }
        private void BtnSearchLengthBottom_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(( double )m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].dSearchLength);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                if (10 > ( int )objKeyPad.m_dResultValue)
                {
                    objKeyPad.m_dResultValue = 10;
                }
                m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].dSearchLength = objKeyPad.m_dResultValue;
                Reload();
            }
        }
Example #5
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 :
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnLight2_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(double.Parse(BtnLight2.Text));

            if (DialogResult.OK == objKeyPad.ShowDialog())
            {
                //if( 0 > ( int )objKeyPad.m_dValue ) objKeyPad.m_dValue = 0;
                //else if( 255 < ( int )objKeyPad.m_dValue ) objKeyPad.m_dValue = 255;

                //pDocument.m_objProcessMain.m_objLightController[ ( int )CDefine.enumLightController.LIGHT_CONTROLLER_MAIN ].HLSetLightOff();
                //System.Threading.Thread.Sleep( 100 );
                //m_objLightControllerParameter[ ( int )CDefine.enumLightController.LIGHT_CONTROLLER_MAIN ].iIntensity[ ( int )CDefine.enumCamera.CAMERA_POL_A_ALIGN_2 + ( ( int )m_eCamera * 2 ) ] = ( int )objKeyPad.m_dValue;
                //pDocument.m_objProcessMain.m_objLightController[ ( int )CDefine.enumLightController.LIGHT_CONTROLLER_MAIN ].HLSetLightIntensity( m_objLightControllerParameter[ ( int )CDefine.enumLightController.LIGHT_CONTROLLER_MAIN ].iIntensity );
            }
        }
        private void BtnIgnoreNumberBottom_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(( double )m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].iIgnoreNumber);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // 예외 처리 값은 2 > Value
                if (m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].iCalipersNumber <= ( int )objKeyPad.m_dResultValue)
                {
                    objKeyPad.m_dResultValue = m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].iCalipersNumber - 1;
                }
                else if (0 > ( int )objKeyPad.m_dResultValue)
                {
                    objKeyPad.m_dResultValue = 0;
                }
                m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].iIgnoreNumber = ( int )objKeyPad.m_dResultValue;
                Reload();
            }
        }
Example #7
0
        private void BtnResolutionPixel_Click(object sender, EventArgs e)
        {
            var pDocument = CDocument.GetDocument;
            // 버튼 로그 추가
            string strLog = string.Format("[{0}] [{1}]", "BtnResolutionPixel_Click", true);

            pDocument.SetUpdateButtonLog(this, strLog);


            FormKeyPad objKey = new FormKeyPad(m_objCameraParameter.dResolution);

            if (DialogResult.OK == objKey.ShowDialog())
            {
                strLog = string.Format("[{0}] : [{1:F3}]", "Camera Pixel", objKey.m_dResultValue);
                m_dCameraResolutionPixel = objKey.m_dResultValue;
                pDocument.SetUpdateButtonLog(this, strLog);
                GetCameraResolution();
            }
        }
Example #8
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 레포트 저장 기간
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void btnPeriodReport_Click(object sender, EventArgs e)
        {
            var pDocument = CDocument.GetDocument;
            // 버튼 로그 추가
            string strLog = string.Format("[{0}] [{1}]", "btnPeriodReport_Click", true);

            pDocument.SetUpdateButtonLog(this, strLog);

            FormKeyPad objKeyPad = new FormKeyPad(m_objSystemParameter.iPeriodDatabase);

            if (DialogResult.OK == objKeyPad.ShowDialog())
            {
                m_objSystemParameter.iPeriodDatabase = ( int )objKeyPad.m_dResultValue;
                strLog = string.Format("[{0}] [iPeriodReport : {1:F3}] [{2}]", "btnPeriodReport_Click", m_objSystemParameter.iPeriodDatabase, false);
            }

            // 버튼 로그 추가
            pDocument.SetUpdateButtonLog(this, strLog);
        }
Example #9
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 캘리퍼 대비 필터 절반 크기 픽셀 선택
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnFilterHalfSizePixels_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(( double )m_objFindLineTool.RunParams.CaliperRunParams.FilterHalfSizeInPixels);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // 예외 처리 값은 1 > Value
                if (1 <= ( int )objKeyPad.m_dResultValue)
                {
                    m_objFindLineTool.RunParams.CaliperRunParams.FilterHalfSizeInPixels = ( int )objKeyPad.m_dResultValue;
                }
                else
                {
                    var pDocument = CDocument.GetDocument;
                    // 캘리퍼 대비 필터 절반 크기 픽셀 수는 1 보다 작은 수를 설정할 수 없습니다.
                    pDocument.SetMessage(CDefine.enumAlarmType.ALARM_WARNING, 10103);
                }
            }
        }
        private void BtnFilterHalfSizePixelsBottom_Click(object sender, EventArgs e)
        {
            int        iValue    = 0;
            FormKeyPad objKeyPad = new FormKeyPad(( double )m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].iFilter);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // 예외 처리 값은 2 > Value
                if (1 > ( int )objKeyPad.m_dResultValue)
                {
                    iValue = 1;
                }
                else
                {
                    iValue = ( int )objKeyPad.m_dResultValue;
                }
                m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineBottom[m_iPositionCrop].iFilter = iValue;
                Reload();
            }
        }
        private void BtnContrastThresholdTop_Click(object sender, EventArgs e)
        {
            int        iValue    = 0;
            FormKeyPad objKeyPad = new FormKeyPad(( double )m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineTop[m_iPositionCrop].iThreshold);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // 예외 처리 값은 2 > Value
                if (1 > ( int )objKeyPad.m_dResultValue)
                {
                    iValue = 1;
                }
                else
                {
                    iValue = ( int )objKeyPad.m_dResultValue;
                }
                m_objRecipeParameter.objInspectionParameter[m_iPositionInspection].objFindLineTop[m_iPositionCrop].iThreshold = iValue;
                Reload();
            }
        }
Example #12
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 캘리퍼 대비 임계값 선택
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnContrastThreshold_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(m_objFindLineTool.RunParams.CaliperRunParams.ContrastThreshold);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // 예외 처리 값은 0 > Value
                if (0.0 <= objKeyPad.m_dResultValue)
                {
                    int iValue = ( int )objKeyPad.m_dResultValue;                     // 버림
                    m_objFindLineTool.RunParams.CaliperRunParams.ContrastThreshold = ( double )iValue;
                }
                else
                {
                    var pDocument = CDocument.GetDocument;
                    // 대비 임계값은 0 보다 작은 수를 설정할 수 없습니다.
                    pDocument.SetMessage(CDefine.enumAlarmType.ALARM_WARNING, 10102);
                }
            }
        }
Example #13
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 캘리퍼 결과 무시할 수 선택
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnIgnoreNumber_Click(object sender, EventArgs e)
        {
            FormKeyPad objKeyPad = new FormKeyPad(( int )m_objFindLineTool.RunParams.NumToIgnore);

            if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
            {
                // 예외 처리 값은 0 > Value
                if (0 <= ( int )objKeyPad.m_dResultValue)
                {
                    m_objFindLineTool.RunParams.NumToIgnore = ( int )objKeyPad.m_dResultValue;
                    // 파인드 라인 그래픽 받아옴
                    GetFindLine();
                }
                else
                {
                    var pDocument = CDocument.GetDocument;
                    // 캘리퍼 결과 무시할 수는 0 보다 작은 수를 설정할 수 없습니다.
                    pDocument.SetMessage(CDefine.enumAlarmType.ALARM_WARNING, 10101);
                }
            }
        }
Example #14
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 생성 PPID 입력 받음
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnCreatePPID_Click(object sender, EventArgs e)
        {
            var    pDocument = CDocument.GetDocument;
            Button objButton = sender as Button;
            // 버튼 로그 추가
            string strLog = string.Format("[{0}] [{1}]", "BtnCreatePPID_Click", true);

            pDocument.SetUpdateButtonLog(this, strLog);

            pDocument.SetUpdateButtonLog(this, strLog);
            FormKeyPad objKeyboard = new FormKeyPad(0);

            if (System.Windows.Forms.DialogResult.OK == objKeyboard.ShowDialog())
            {
                if (0 > objKeyboard.m_dResultValue)
                {
                    objKeyboard.m_dResultValue = 0;
                }
                objButton.Text = (( int )objKeyboard.m_dResultValue).ToString();
            }
            // 버튼 로그 추가
            strLog = string.Format("[{0}] [Create PPID : {1}] [{2}]", "BtnCreatePPID_Click", objButton.Text, false);
            pDocument.SetUpdateButtonLog(this, strLog);
        }
Example #15
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : PLC 버튼 클릭 ( 입력 )
        //설명 :
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        private void BtnInputName_Click(object sender, EventArgs e)
        {
            Button BtnSelected = ( Button )sender;
            string strValue    = BtnSelected.Text;

            try {
                var pDocument = CDocument.GetDocument;
                // 현재 유저 정보 받음
                CUserInformation objUserInformation = pDocument.GetUserInformation();
                if (false == pDocument.m_objConfig.GetSystemParameter().bVidiTeachMode)
                {
                    if (( int )objUserInformation.m_eAuthorityLevel < ( int )pDocument.m_objAuthorityParameter.m_objLevelForm[( int )CDefine.FormView.FORM_VIEW_IO].eLevelWrite)
                    {
                        return;
                    }
                    if (CDefine.enumSimulationMode.SIMULATION_MODE_OFF == pDocument.m_objConfig.GetSystemParameter().eSimulationModePLC)
                    {
                        return;
                    }
                }


                if (CDefine.enumSimulationMode.SIMULATION_MODE_OFF == pDocument.m_objConfig.GetSystemParameter().eSimulationModePLC)
                {
                    if (CDefine.enumRunMode.RUN_MODE_START == pDocument.GetRunMode())
                    {
                        return;
                    }
                }

                // 데이터 입력란이기때문에 주소의 버튼이름을 가져온다 인덱스는 동일하기때문에 인덱스를 제외하고 버튼이름을 변경한다
                string strBtnName = BtnSelected.Name.Replace("BtnInputName", "BtnInputAddress");

                for (int iLoopCount = 0; iLoopCount < this.Controls.Count; iLoopCount++)
                {
                    if (strBtnName == this.Controls[iLoopCount].Name)
                    {
                        strBtnName = this.Controls[iLoopCount].Text;
                    }
                }

                strBtnName.Replace(" ", "");
                // PLC 접근 이름을 가져온다 Split( : ) 하는 이유는 이름이 설정되어 있지 않는 경우는 다이렉트 주소를 표시하기 때문에 다이렉트 주소가 이름이 되기때문
                string[] strNamePLC = strBtnName.Split(':');

                // 이름, 주소가 있는지 판단하여 진행
                if (1 < strNamePLC.Count())
                {
                    strBtnName = strNamePLC[1];
                }
                else
                {
                    strBtnName = strNamePLC[0];
                }

                bool bResult = false;
                if (CConfig.CPLCInitializeParameter.CPLCParameter.enumPLCCommunicationType.TYPE_WORD_IN == m_objPLCParameter.objPLCParameter[strBtnName].eCommunicationType)
                {
                    FormKeyPad objKeyPad = new FormKeyPad(double.Parse(strValue));
                    if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
                    {
                        m_objPLC.HLWriteWordFromPLC(strBtnName, ( short )objKeyPad.m_dResultValue);
                    }
                }
                else if (CConfig.CPLCInitializeParameter.CPLCParameter.enumPLCCommunicationType.TYPE_BIT_IN == m_objPLCParameter.objPLCParameter[strBtnName].eCommunicationType)
                {
                    bResult = m_objPLC.HLGetInterfacePLC().bInterfacePlcBitIn[m_objPLCParameter.objPLCParameter[strBtnName].iInOutIndex];
                    if (false == bResult)
                    {
                        m_objPLC.HLWriteBitFromPLC(strBtnName, true);
                    }
                    else
                    {
                        m_objPLC.HLWriteBitFromPLC(strBtnName, false);
                    }
                }
                else
                {
                    FormKeyPad objKeyPad = new FormKeyPad(double.Parse(strValue));
                    if (System.Windows.Forms.DialogResult.OK == objKeyPad.ShowDialog())
                    {
                        m_objPLC.HLWriteWordFromPLC(strBtnName, objKeyPad.m_dResultValue);
                        //if( false == strBtnName.Contains( "_T_" ) ) {
                        //    m_objPLC.HLWriteWordFromPLC( strBtnName, objKeyPad.m_dResultValue );
                        //} else {
                        //    m_objPLC.HLWriteWordFromPLC( strBtnName, objKeyPad.m_dResultValue * 10 );
                        //}
                    }
                }
            } catch (Exception ex) {
                System.Diagnostics.Trace.WriteLine(ex.StackTrace);
            }
        }