예제 #1
0
        private void Button_CAPTURE_FOV_SET_Click(object sender, EventArgs e)
        {
            int nColStart = 0;
            int nRowStart = 0;
            int nColSize  = 0;
            int nRowSize  = 0;

            KSJApiBase.KSJ_ADDRESSMODE ColAddressMode = KSJApiBase.KSJ_ADDRESSMODE.KSJ_SKIPNONE;
            KSJApiBase.KSJ_ADDRESSMODE RowAddressMode = KSJApiBase.KSJ_ADDRESSMODE.KSJ_SKIPNONE;

            nColStart = Convert.ToInt32(TextBox_CAPTURE_COL_START.Text);
            nRowStart = Convert.ToInt32(TextBox_CAPTURE_ROW_START.Text);
            nColSize  = Convert.ToInt32(TextBox_CAPTURE_COL_SIZE.Text);
            nRowSize  = Convert.ToInt32(TextBox_CAPTURE_ROW_SIZE.Text);

            KSJApiBase.KSJ_CaptureSetFieldOfView(m_nDeviceCurSel, nColStart, nRowStart, nColSize, nRowSize, ColAddressMode, RowAddressMode);

            // User may not set FOV correctly, ksjapi will correct it!
            KSJApiBase.KSJ_CaptureGetFieldOfView(m_nDeviceCurSel, ref nColStart, ref nRowStart, ref nColSize, ref nRowSize, ref ColAddressMode, ref RowAddressMode);
            TextBox_PREVIEW_COL_START.Text = nColStart.ToString();
            TextBox_PREIVEW_ROW_START.Text = nRowStart.ToString();
            TextBox_PREIVEW_COL_SIZE.Text  = nColSize.ToString();
            TextBox_PREIVEW_ROW_SIZE.Text  = nRowSize.ToString();
        }
예제 #2
0
        public void UpdateInterface()
        {
            if (m_nDeviceCurSel == -1)
            {
                return;
            }

            // Initial Exposure Time
            int nMin = 0;
            int nMax = 0;
            int nCur = 0;

            KSJApiBase.KSJ_GetParamRange(m_nDeviceCurSel, KSJApiBase.KSJ_PARAM.KSJ_EXPOSURE, ref nMin, ref nMax);
            KSJApiBase.KSJ_GetParam(m_nDeviceCurSel, KSJApiBase.KSJ_PARAM.KSJ_EXPOSURE, ref nCur);
            NumericUpDown_EXPOSURE_TIME_MS.Minimum = nMin;
            NumericUpDown_EXPOSURE_TIME_MS.Maximum = nMax;
            NumericUpDown_EXPOSURE_TIME_MS.Value   = nCur;
            string szText = String.Format("{0}-{1} ms ({2}sec, {3}min)", nMin, nMax, (float)nMin / 1000.0f, (float)nMax / 60000.0f);

            Label_EXPOSURE_TIME_RANGE.Text = szText;

            KSJApiBase.KSJ_GetParamRange(m_nDeviceCurSel, KSJApiBase.KSJ_PARAM.KSJ_EXPOSURE_LINES, ref nMin, ref nMax);
            KSJApiBase.KSJ_GetParam(m_nDeviceCurSel, KSJApiBase.KSJ_PARAM.KSJ_EXPOSURE_LINES, ref nCur);
            NumericUpDown_EXPOSURE_LINES.Minimum = nMin;
            NumericUpDown_EXPOSURE_LINES.Maximum = nMax;
            NumericUpDown_EXPOSURE_LINES.Value   = nCur;
            szText = String.Format("{0}-{1} Lines", nMin, nMax);
            Label_EXPOSURE_LINES_RANGE.Text = szText;

            // GAIN, Because R,G,B Gain has same range.
            KSJApiBase.KSJ_GetParamRange(m_nDeviceCurSel, KSJApiBase.KSJ_PARAM.KSJ_RED, ref nMin, ref nMax);
            KSJApiBase.KSJ_GetParam(m_nDeviceCurSel, KSJApiBase.KSJ_PARAM.KSJ_RED, ref nCur);
            NumericUpDown_GAIN.Minimum = nMin;
            NumericUpDown_GAIN.Maximum = nMax;
            NumericUpDown_GAIN.Value   = nCur;
            szText = String.Format("{0}-{1} Lines", nMin, nMax);
            Label_GAIN_RANGE.Text = szText;

            // FOV
            int nColStart = 0;
            int nRowStart = 0;
            int nColSize  = 0;
            int nRowSize  = 0;

            KSJApiBase.KSJ_ADDRESSMODE ColAddressMode = KSJApiBase.KSJ_ADDRESSMODE.KSJ_SKIPNONE;
            KSJApiBase.KSJ_ADDRESSMODE RowAddressMode = KSJApiBase.KSJ_ADDRESSMODE.KSJ_SKIPNONE;
            KSJApiBase.KSJ_PreviewGetDefaultFieldOfView(m_nDeviceCurSel, ref nColStart, ref nRowStart, ref nColSize, ref nRowSize, ref ColAddressMode, ref RowAddressMode);
            // Preview, Capture they are same, so you should get one is ok!
            szText = String.Format("{0}-{1} Lines", nColSize, nRowSize);
            Label_FOV_RANGE.Text = szText;

            TextBox_PREVIEW_COL_START.Text = nColStart.ToString();
            TextBox_PREIVEW_ROW_START.Text = nRowStart.ToString();
            TextBox_PREIVEW_COL_SIZE.Text  = nColSize.ToString();
            TextBox_PREIVEW_ROW_SIZE.Text  = nRowSize.ToString();

            KSJApiBase.KSJ_CaptureGetDefaultFieldOfView(m_nDeviceCurSel, ref nColStart, ref nRowStart, ref nColSize, ref nRowSize, ref ColAddressMode, ref RowAddressMode);
            TextBox_CAPTURE_COL_START.Text = nColStart.ToString();
            TextBox_CAPTURE_ROW_START.Text = nRowStart.ToString();
            TextBox_CAPTURE_COL_SIZE.Text  = nColSize.ToString();
            TextBox_CAPTURE_ROW_SIZE.Text  = nRowSize.ToString();
        }
예제 #3
0
 public static extern int KSJ_CaptureGetFieldOfViewEx(int nChannel, ref int pnColStart, ref int pnRowStart, ref int pnColSize, ref int pnRowSize, ref KSJApiBase.KSJ_ADDRESSMODE pColAddressMode, ref KSJApiBase.KSJ_ADDRESSMODE pRowAddressMode, ref byte pwMultiFrameNum);
예제 #4
0
 public static extern int KSJ_CaptureSetFieldOfViewEx(int nChannel, int nColStart, int nRowStart, int nColSize, int nRowSize, KSJApiBase.KSJ_ADDRESSMODE ColAddressMode, KSJApiBase.KSJ_ADDRESSMODE RowAddressMode, byte wMultiFrameNum);