Ejemplo n.º 1
0
        private void ReadButton_Click(object sender, EventArgs e)
        {
            IntPtr BufferToRead = Marshal.AllocHGlobal(UserDataSize);

            if (BufferToRead == IntPtr.Zero)
            {
                MessageBox.Show("Error in Buffer allocation", "ReadButton_Click");
                return;
            }

            Byte[] DataToBeWrittenArray = new Byte[UserDataSize];

            int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_ReadUserData(
                (uint)0, (uint)DataToBeWrittenArray.Length, DataToBeWrittenArray
                );

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                    RetVal, "PermanentDataStorageForm,GBMSAPI_NET_ReadUserData");
            }

            SaveFileDialog SFDlg = new SaveFileDialog();

            SFDlg.Title = "Open file for saving data";
            if (SFDlg.ShowDialog() != DialogResult.OK)
            {
                MessageBox.Show("Error in Opening File");
                return;
            }
            String fname = SFDlg.FileName;

            File.WriteAllBytes(fname, DataToBeWrittenArray);
        }
Ejemplo n.º 2
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            /////////////////////
            // SAVE FILE
            /////////////////////
            Byte   DeviceID;
            String DeviceSerialNumber;

            // Get Serial Number and ID

            int RetVal = GBMSAPI_NET_DeviceSettingRoutines.GBMSAPI_NET_GetCurrentDevice(
                out DeviceID, out DeviceSerialNumber);

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                    RetVal, "SaveButton_Click,GBMSAPI_GetImageSize");
                return;
            }

            // build file name
            // ver 2.10.0.0: scan area instead of flat/not flat
            //String FName = GBMSAPI_Example_Util.GBMSAPI_Example_GetDevNameFromDevID(DeviceID) + "_" +
            //    (DeviceSerialNumber) + "_" +
            //    ((this.FlatScanArea == true) ? ("FLAT") : ("ROLL")) + ".raw";
            String FName = GBMSAPI_Example_Util.GBMSAPI_Example_GetDevNameFromDevID(DeviceID) + "_" +
                           (DeviceSerialNumber) + "_" +
                           this.GetAreaNameFromCheckedRadioButton() + ".raw";

            // end ver 2.10.0.0: scan area instead of flat/not flat

            // build image array for saving
            Byte [] CalImageArray = new Byte[this.CalibrationImageSX * this.CalibrationImageSY];
            if (CalImageArray == null)
            {
                MessageBox.Show("MEMORY ALLOCATION ERROR in SaveButton_Click(): close application", "HEAVY ERROR");
                return;
            }

            Marshal.Copy(this.CalibrationImage, CalImageArray, 0, CalImageArray.Length);

            // save image on file
            System.IO.FileStream FS = System.IO.File.Create(FName);
            if (FS != null)
            {
                FS.Write(CalImageArray, 0, CalImageArray.Length);
                FS.Close();
                MessageBox.Show("Image saved in " + FName, "Calibration results");
            }
            else
            {
                MessageBox.Show("Cannot save file " + FName, "WARNING");
            }
        }
Ejemplo n.º 3
0
        private void CalibrateDeviceButton_Click(object sender, EventArgs e)
        {
            ////////////////////////////
            // OPEN IMAGE FILE
            ////////////////////////////
            OpenFileDialog OFDlg = new OpenFileDialog();

            OFDlg.Title = "Open Calibration Image";
            if (OFDlg.ShowDialog() != DialogResult.OK)
            {
                MessageBox.Show("Error in Opening File");
                return;
            }
            String fname = OFDlg.FileName;

            Byte [] CalImageBytes = System.IO.File.ReadAllBytes(fname);

            if (CalImageBytes.Length != (CalibrationImageSX) * (CalibrationImageSY))
            {
                MessageBox.Show("Error: file size not correct");
                return;
            }

            ///////////////////////////////
            // CALIBRATE DEVICE
            ///////////////////////////////
            // ver 2.10.0.0: use "2" functions
            //int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_SetCalibrationImage(
            //    this.FlatScanArea, CalImageBytes);
            int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_SetCalibrationImage2(
                this.ScanArea, CalImageBytes);

            // end ver 2.10.0.0: use "2" functions
            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                    RetVal, "CalibrateDeviceButton_Click,GBMSAPI_NET_SetCalibrationImage2");
            }
            else
            {
                MessageBox.Show("Device Calibrated", "Calibration results");
            }

            return;
        }
Ejemplo n.º 4
0
        private void SetScanArea(UInt32 scanA)
        {
            this.ScanArea = scanA;
            UInt32 ImSX, ImSY;
            int    RetVal = GBMSAPI_NET_DeviceCharacteristicsRoutines.GBMSAPI_NET_GetCalibrationImageSize2(
                this.ScanArea, out ImSX, out ImSY
                );

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(RetVal,
                                                                  "FlatAreaRadioButton_CheckedChanged,GBMSAPI_NET_GetCalibrationImageSize");
                return;
            }

            CalibrationImageSX = (int)ImSX;
            CalibrationImageSY = (int)ImSY;

            if (GBMSAPI_Example_Globals.CalibrationBuffer != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(GBMSAPI_Example_Globals.CalibrationBuffer);
            }
            if (GBMSAPI_Example_Globals.DummyCalibrationBuffer != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(GBMSAPI_Example_Globals.DummyCalibrationBuffer);
            }

            GBMSAPI_Example_Globals.CalibrationBuffer      = Marshal.AllocHGlobal((int)(CalibrationImageSX * CalibrationImageSY));
            GBMSAPI_Example_Globals.DummyCalibrationBuffer = Marshal.AllocHGlobal((int)(CalibrationImageSX * CalibrationImageSY));
            if (GBMSAPI_Example_Globals.CalibrationBuffer == IntPtr.Zero ||
                GBMSAPI_Example_Globals.DummyCalibrationBuffer == IntPtr.Zero)
            {
                MessageBox.Show("CalibrationForm, SetScanArea: Memory allocation failed", "FATAL ERROR");
                return;
            }
            this.CalibrationImage = (GBMSAPI_Example_Globals.CalibrationBuffer);

            this.ImSXTextBox.Text = "" + CalibrationImageSX;
            this.ImSYTextBox.Text = "" + CalibrationImageSY;

            this.DiagnosticListBox.Items.Clear();
            this.CalibrationImagePictureBox.Image = this.OriginalImage;

            this.SaveButton.Enabled = false;
        }
Ejemplo n.º 5
0
        private void WriteButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog OFDlg = new OpenFileDialog();

            OFDlg.Title = "Open file containing data";
            if (OFDlg.ShowDialog() != DialogResult.OK)
            {
                MessageBox.Show("Error in Opening File");
                return;
            }
            String fname = OFDlg.FileName;

            Byte[] DataToBeWrittenArray = File.ReadAllBytes(fname);

            if (DataToBeWrittenArray.Length > (UserDataSize - 1))             // I need at least a byte at the end of the buffer for CRC calculation
            {
                MessageBox.Show("Warning: Data To be written too much long; they will be truncated to the " + UserDataSize + "-th byte");
            }

            int BytesToBeWritten;

            if (DataToBeWrittenArray.Length > (UserDataSize - 1))
            {
                BytesToBeWritten = (UserDataSize - 1);
            }
            else
            {
                BytesToBeWritten = DataToBeWrittenArray.Length;
            }

            int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_WriteUserData(
                (uint)0, (uint)BytesToBeWritten, DataToBeWrittenArray
                );

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                    RetVal, "PermanentDataStorageForm,GBMSAPI_WriteUserData");
            }
            else
            {
                MessageBox.Show("Written " + BytesToBeWritten + "bytes");
            }
        }
Ejemplo n.º 6
0
        private void SetFactoryCalibrationButton_Click(object sender, EventArgs e)
        {
            ///////////////////////////////
            // CALIBRATE DEVICE
            ///////////////////////////////
            // ver 2.10.0.0: use "2" functions
            //int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_SetCalibrationImage(this.FlatScanArea, null);
            int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_SetCalibrationImage2(
                GBMSAPI_NET_ScanAreas.GBMSAPI_NET_SA_FULL_FRAME, null);

            // end ver 2.10.0.0: use "2" functions
            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                    RetVal, "SetFactoryCalibrationButton_Click,GBMSAPI_GetImageSize");
                return;
            }

            MessageBox.Show("Device Calibrated", "Calibration results");
        }
Ejemplo n.º 7
0
        public PermanentDataStorageForm()
        {
            InitializeComponent();

            int RetVal, Appoggio;

            RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_GetUserDataSize(out Appoggio);

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(RetVal, "GBMSAPI_NET_GetUserDataSize");

                this.Close();
            }
            else
            {
                UserDataSize = Appoggio;
                this.StorageSizeLabel.Text = "Available bytes = " + UserDataSize;
            }
        }
Ejemplo n.º 8
0
        /**************************************
        * Display management
        **************************************/
        public static void DisplayImageEvaluationParameters()
        {
            uint LcdFeatures;
            int  RetVal =
                GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_GetLcdFeatures(out LcdFeatures);

            if ((GBMSAPI_Example_Globals.DisplayOptionMask &
                 GBMSAPI_NET_DisplayOptions.GBMSAPI_NET_DO_FINAL_SCREEN) != 0
                // stop screen enabled after acquisition
                )
            {
                UInt32 ObjToScanType = GBMSAPI_NET_ScanObjectsUtilities.GBMSAPI_NET_GetTypeFromObject(
                    GBMSAPI_Example_Globals.ObjToScan);

                // set image evaluation parameters
                if (
                    // VER 3.1.0.0: check all rolled objects
                    (GBMSAPI_Example_Util.IsRolled(ObjToScanType))
                    // end VER 3.1.0.0: check all rolled objects
                    )
                {
                    // ARTEFACTS
                    RetVal =
                        GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetArtefactLimitOnStopScreen
                        (
                            7,
                            GBMSAPI_NET_LimitsDirection.GBMSAPI_NET_VILCD_SMALLER_THAN_LIMIT_DIRECTION
                        );
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                            RetVal, "WAIT_PREVIEW_END_STATUS");
                    }
                    if ((LcdFeatures & GBMSAPI_NET_DisplayFeatures.GBMSAPI_NET_VILCD_LF_INTERMEDIATE_LIMIT) != 0)
                    {
                        RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetArtefactIntermediateLimitOnStopScreen(14);
                        if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                        {
                            GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                                RetVal,
                                "WAIT_PREVIEW_END_STATUS, GBMSAPI_NET_VUI_LCD_SetArtefactIntermediateLimitOnStopScreen");
                        }
                    }

                    int ArtefactSize;
                    ArtefactSize = (int)(GBMSAPI_Example_Globals.RolledArtefactSize);

                    RetVal =
                        GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetArtefactOnStopScreen
                            (ArtefactSize);
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                            RetVal, "WAIT_PREVIEW_END_STATUS");
                    }
                    #region 质量评估说明
                    /////////////////////
                    // 质量评估算法
                    /////////////////////
                    // Quality parameter should be got by using the GBNFIQ or the
                    // GBFINIMG libraries (FULL-ENHANCED package), not included in
                    // the basic version of the GBMSAPI. Therefore quality will
                    // be calculated by dividing contrast value by 2,56, in order
                    // to have a value ranging from 0 (lowest) to 100 (highest)
                    RetVal =
                        GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetQualityLimitOnStopScreen(
                            95,
                            GBMSAPI_NET_LimitsDirection.GBMSAPI_NET_VILCD_GREATER_THAN_LIMIT_DIRECTION
                            );
                    if ((LcdFeatures & GBMSAPI_NET_DisplayFeatures.GBMSAPI_NET_VILCD_LF_INTERMEDIATE_LIMIT) != 0)
                    {
                        RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetQualityIntermediateLimitOnStopScreen(90);
                        if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                        {
                            GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                                RetVal,
                                "WAIT_PREVIEW_END_STATUS, GBMSAPI_NET_VUI_LCD_SetQualityIntermediateLimitOnStopScreen");
                        }
                    }
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                            RetVal, "WAIT_PREVIEW_END_STATUS");
                    }
                    Byte QualityToShow = (Byte)(((double)GBMSAPI_Example_Globals.ImageContrast) / 2.56);
                    RetVal =
                        GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetQualityOnStopScreen
                            (QualityToShow);
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                            RetVal, "WAIT_PREVIEW_END_STATUS");
                    }
                }
                else if ((GBMSAPI_NET_ScanObjectsUtilities.GBMSAPI_NET_GetTypeFromObject(
                              GBMSAPI_Example_Globals.ObjToScan) !=
                          GBMSAPI_NET_ScannableBiometricTypes.GBMSAPI_NET_SBT_PHOTO))
                {
                    // CONTRAST
                    RetVal =
                        GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetContrastLimitOnStopScreen
                            (230);
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                            RetVal, "WAIT_PREVIEW_END_STATUS");
                    }
                    if ((LcdFeatures & GBMSAPI_NET_DisplayFeatures.GBMSAPI_NET_VILCD_LF_INTERMEDIATE_LIMIT) != 0)
                    {
                        RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetContrastIntermediateLimitOnStopScreen(200);
                        if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                        {
                            GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                                RetVal,
                                "WAIT_PREVIEW_END_STATUS, GBMSAPI_NET_VUI_LCD_SetContrastIntermediateLimitOnStopScreen");
                        }
                    }
                    RetVal =
                        GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetContrastValueOnStopScreen
                            (GBMSAPI_Example_Globals.ImageContrast);
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                            RetVal, "WAIT_PREVIEW_END_STATUS");
                    }
                    // COMPLETENESS
                    if ((GBMSAPI_NET_ScanObjectsUtilities.GBMSAPI_NET_GetTypeFromObject(
                             GBMSAPI_Example_Globals.ObjToScan) ==
                         GBMSAPI_NET_ScannableBiometricTypes.GBMSAPI_NET_SBT_FLAT_LOWER_HALF_PALM))
                    {
                        RetVal =
                            GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetCompletenessLimitOnStopScreen
                                (90);
                        if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                        {
                            GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                                RetVal, "WAIT_PREVIEW_END_STATUS");
                        }
                        if ((LcdFeatures & GBMSAPI_NET_DisplayFeatures.GBMSAPI_NET_VILCD_LF_INTERMEDIATE_LIMIT) != 0)
                        {
                            RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetCompletenessIntermediateLimitOnStopScreen(60);
                            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                            {
                                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                                    RetVal,
                                    "WAIT_PREVIEW_END_STATUS, GBMSAPI_NET_VUI_LCD_SetContrastIntermediateLimitOnStopScreen");
                            }
                        }
                        RetVal =
                            GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetCompletenessValueOnStopScreen
                                (GBMSAPI_Example_Globals.HalfLowerPalmCompleteness);
                        if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                        {
                            GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                                RetVal, "WAIT_PREVIEW_END_STATUS");
                        }
                    }
                }

                RetVal =
                    GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_EnableOKButtonOnStopScreen();
                if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                {
                    GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                        RetVal, "WAIT_PREVIEW_END_STATUS");
                }
                // show message
                RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_SetPreloadedMessageOnStopScreen(
                    GBMSAPI_NET_PreloadedGeneralMessages.GBMSAPI_NET_VILCD_MSG_ACQUISITION_SUCCESSFUL,
                    GBMSAPI_NET_PreloadedMessagesArea.GBMSAPI_NET_VILCD_MSG_AREA);
                if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                {
                    GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                        RetVal, "WAIT_PREVIEW_END_STATUS");
                }
            }
            else
            {
                RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_VUI_LCD_EnableStartButtonOnLogoScreen();
                if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                {
                    GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                        RetVal, "WAIT_PREVIEW_END_STATUS");
                }
            }
            #endregion
        }
Ejemplo n.º 9
0
        private void UpdateListButton_Click(object sender, EventArgs e)
        {
            this.Enabled   = true;
            Cursor.Current = Cursors.WaitCursor;
            Application.DoEvents();
            try
            {
                this.DeviceTypeComboBox.Items.Clear();
                ////////////////////////////////
                ///// 获取设备列表存到数组中,最多存储127个设备。GBMSAPI_NET_MAX_PLUGGED_DEVICE_NUM=127常量
                ////////////////////////////////
                GBMSAPI_NET_DeviceInfoStruct[] AttachedDeviceList = new GBMSAPI_NET_DeviceInfoStruct[
                    GBMSAPI_NET_DeviceInfoConstants.GBMSAPI_NET_MAX_PLUGGED_DEVICE_NUM];
                Console.WriteLine(GBMSAPI_NET_DeviceInfoConstants.GBMSAPI_NET_MAX_PLUGGED_DEVICE_NUM);
                for (int i = 0; i < GBMSAPI_NET_DeviceInfoConstants.GBMSAPI_NET_MAX_PLUGGED_DEVICE_NUM; i++)
                {
                    AttachedDeviceList[i] = new GBMSAPI_NET_DeviceInfoStruct();
                }

                int  AttachedDeviceNumber;
                uint USBErrorCode;

                int RetVal = GBMSAPI_NET_DeviceSettingRoutines.GBMSAPI_NET_GetAttachedDeviceList(
                    AttachedDeviceList, out AttachedDeviceNumber, out USBErrorCode);
                Console.WriteLine(AttachedDeviceNumber);
                if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR || AttachedDeviceNumber <= 0)
                {
                    if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                    {
                        GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(RetVal, USBErrorCode, "UpdateListButton_Click");
                        MessageBox.Show("Error in GBMSAPI_NET_GetAttachedDeviceList function: " + RetVal);
                    }
                    return;
                }
                // Console.WriteLine(RetVal);
                ////////////////////////////////
                //// Store device list 存储设备列表
                ////////////////////////////////
                for (int i = 0; i < AttachedDeviceNumber; i++)
                {
                    String StrToAdd = GBMSAPI_Example_Util.GBMSAPI_Example_GetDevNameFromDevID(
                        AttachedDeviceList[i].DeviceID);
                    StrToAdd += " " + (AttachedDeviceList[i].DeviceSerialNumber);//获取设备型号
                    this.DeviceTypeComboBox.Items.Add(StrToAdd);
                }
                if (AttachedDeviceNumber > 0)
                {
                    this.DeviceTypeComboBox.SelectedIndex = 0;//指定索引号为0
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in UpdateListButton_Click function: " + ex.Message);
                this.Close();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                this.Enabled   = true;
            }
        }
Ejemplo n.º 10
0
        // end ver 3.1.0.0: option mask
        public Boolean GetAcquisitionOptions(
            out uint ObjToScan,
            out uint OptionMask,
            out uint DisplayOptionMask,
            out Byte ContrastLimitToDisplay,
            out Byte CompletenessLimitToDisplay,
            out uint ClipRegionW,
            out uint ClipRegionH,
            out uint RollPreviewTimeout,
            out Byte ArtefactCleaningDepth,
            out Byte ContrastIntermediateLimitToDisplay,
            out Byte CompletenessIntermediateLimitToDisplay,
            // ver 2.10.0.0
            out bool RollAreaStandardGa,
            // end ver 2.10.0.0
            // ver 3.2.0.0
            out bool EnableRollCompositionBlock,
            // end ver 3.2.0.0
            // ver 4.0.0.0
            out int HwFfdStrictnessThreshold,
            out int SwFfdStrictnessThreshold
            // end ver 4.0.0.0
            )
        {
            ObjToScan                              = 0;
            OptionMask                             = 0;
            DisplayOptionMask                      = 0;
            ContrastLimitToDisplay                 = 0;
            CompletenessLimitToDisplay             = 0;
            ClipRegionW                            = 0;
            ClipRegionH                            = 0;
            RollPreviewTimeout                     = 0;
            ArtefactCleaningDepth                  = 0;
            ContrastIntermediateLimitToDisplay     = 0;
            CompletenessIntermediateLimitToDisplay = 0;
            RollAreaStandardGa                     = false;
            // ver 3.2.0.0
            EnableRollCompositionBlock = false;
            // end ver 3.2.0.0
            // ver 4.0.0.0
            HwFfdStrictnessThreshold = -1;
            SwFfdStrictnessThreshold = -1;
            // end ver 4.0.0.0

            try
            {
                // ver 2.10.0.0
                /////////////////////////////
                // ROLL AREA STANDARD
                /////////////////////////////
                if (this.RollStandardCheckBox.Enabled && this.RollStandardCheckBox.Checked)
                {
                    RollAreaStandardGa = true;
                }
                else
                {
                    RollAreaStandardGa = false;
                }
                // end ver 2.10.0.0
                /////////////////////////////
                // GET OBJECT TO SCAN
                /////////////////////////////
                String ObjToScanName = (String)(this.ObjectToScanComboBox.SelectedItem);
                ObjToScan = GBMSAPI_Example_Util.GetObjectToScanIDFromName(ObjToScanName);

                /////////////////////////////
                // GET OPTION MASK
                /////////////////////////////
                uint dummyFrOpt;
                GetOptionMask(out OptionMask, out dummyFrOpt);

                /////////////////////////////////////
                // GET DISPLAY OPTION MASK
                /////////////////////////////////////
                DisplayOptionMask = 0;

                uint ExternalDevicesMask;
                int  RetVal = GBMSAPI_NET_DeviceCharacteristicsRoutines.GBMSAPI_NET_GetOptionalExternalEquipment(out ExternalDevicesMask);

                if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                {
                    GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                        RetVal, "GetAcquisitionOptions,GBMSAPI_NET_GetOptionalExternalEquipment");
                    return(false);
                }

                if ((ExternalDevicesMask & GBMSAPI_NET_OptionalExternalEquipment.GBMSAPI_NET_OED_VUI_LCD) != 0)
                {
                    // Stop screen after acquisition
                    if (this.StopScreenAfterAcquisitionCheckBox.Enabled == true &&
                        this.StopScreenAfterAcquisitionCheckBox.Checked == true)
                    {
                        (DisplayOptionMask) |= GBMSAPI_NET_DisplayOptions.GBMSAPI_NET_DO_FINAL_SCREEN;
                    }

                    // customized contrast
                    if (this.ShowCustomizedContrastCheckBox.Enabled == true &&
                        this.ShowCustomizedContrastCheckBox.Checked == true)
                    {
                        // read limit value
                        try
                        {
                            Byte ContrastLimit = Byte.Parse(this.ContrastLimitTextBox.Text);
                            ContrastLimitToDisplay = ContrastLimit;
                        }
                        catch (Exception ReadEx)
                        {
                            if ((ReadEx.GetType()).ToString() == ((new ArgumentNullException()).GetType()).ToString() ||
                                (ReadEx.GetType()).ToString() == ((new FormatException()).GetType()).ToString() ||
                                (ReadEx.GetType()).ToString() == ((new OverflowException()).GetType()).ToString()
                                )
                            {
                                // default value
                                ContrastLimitToDisplay = 120;
                            }
                            else
                            {
                                MessageBox.Show("Exception in GetAcquisitionOptions: " + ReadEx.Message);
                                ObjToScan                  = 0;
                                OptionMask                 = 0;
                                DisplayOptionMask          = 0;
                                ContrastLimitToDisplay     = 0;
                                CompletenessLimitToDisplay = 0;
                                ClipRegionW                = 0;
                                ClipRegionH                = 0;
                                RollPreviewTimeout         = 0;
                                ArtefactCleaningDepth      = 0;
                                return(false);
                            }
                        }
                        (DisplayOptionMask) |= GBMSAPI_NET_DisplayOptions.GBMSAPI_NET_DO_CUSTOMIZED_CONTRAST;
                    }

                    // customized completeness
                    if (this.ShowCustomizedCompletenessCheckBox.Enabled == true && this.ShowCustomizedCompletenessCheckBox.Checked == true)
                    {
                        // read limit value
                        try
                        {
                            Byte CompletenessLimit = Byte.Parse(this.CompletenessLimitTextBox.Text);
                            CompletenessLimitToDisplay = CompletenessLimit;
                        }
                        catch (Exception ReadEx)
                        {
                            if ((ReadEx.GetType()).ToString() == ((new ArgumentNullException()).GetType()).ToString() ||
                                (ReadEx.GetType()).ToString() == ((new FormatException()).GetType()).ToString() ||
                                (ReadEx.GetType()).ToString() == ((new OverflowException()).GetType()).ToString()
                                )
                            {
                                // default value
                                CompletenessLimitToDisplay = 90;
                            }
                            else
                            {
                                MessageBox.Show("Exception in GetAcquisitionOptions: " + ReadEx.Message);
                                ObjToScan                  = 0;
                                OptionMask                 = 0;
                                DisplayOptionMask          = 0;
                                ContrastLimitToDisplay     = 0;
                                CompletenessLimitToDisplay = 0;
                                ClipRegionW                = 0;
                                ClipRegionH                = 0;
                                RollPreviewTimeout         = 0;
                                ArtefactCleaningDepth      = 0;
                                return(false);
                            }
                        }
                        (DisplayOptionMask) |= GBMSAPI_NET_DisplayOptions.GBMSAPI_NET_DO_CUSTOMIZED_COMPLETENESS;
                    }
                }
                #region »ñÈ¡²Ã¼ôÊý¾Ý
                ///////////////////////////////////////
                // GET CLIP DATA
                ///////////////////////////////////////
                ClipRegionW = 0;
                ClipRegionH = 0;
                if (this.ClipEnableCheckBox.Enabled == true &&
                    this.ClipEnableCheckBox.Checked == true)
                {
                    // read clip values
                    try
                    {
                        UInt32 ClipSizeX = UInt32.Parse(this.ClipRegionSizeXTextBox.Text);
                        UInt32 ClipSizeY = UInt32.Parse(this.ClipRegionSizeYTextBox.Text);
                        ClipRegionW = ClipSizeX;
                        ClipRegionH = ClipSizeY;
                    }
                    catch (Exception ReadEx)
                    {
                        if ((ReadEx.GetType()).ToString() == ((new ArgumentNullException()).GetType()).ToString() ||
                            (ReadEx.GetType()).ToString() == ((new FormatException()).GetType()).ToString() ||
                            (ReadEx.GetType()).ToString() == ((new OverflowException()).GetType()).ToString()
                            )
                        {
                            // default value
                            ClipRegionW = 0;
                            ClipRegionH = 0;
                        }
                        else
                        {
                            MessageBox.Show("Exception in GetAcquisitionOptions: " + ReadEx.Message);
                            ObjToScan                  = 0;
                            OptionMask                 = 0;
                            DisplayOptionMask          = 0;
                            ContrastLimitToDisplay     = 0;
                            CompletenessLimitToDisplay = 0;
                            ClipRegionW                = 0;
                            ClipRegionH                = 0;
                            RollPreviewTimeout         = 0;
                            ArtefactCleaningDepth      = 0;
                            return(false);
                        }
                    }
                }
                #endregion
                ///////////////////////////////////////////
                // GET ROLL OPTIONS
                ///////////////////////////////////////////
                // Roll Preview Timeout
                RollPreviewTimeout = 0;
                if (this.AutomaticRollPreviewTimeoutTextBox.Enabled == true)
                {
                    // read timeout
                    try
                    {
                        UInt32 Timeout = UInt32.Parse(this.AutomaticRollPreviewTimeoutTextBox.Text);
                        RollPreviewTimeout = Timeout;
                    }
                    catch (Exception ReadEx)
                    {
                        if ((ReadEx.GetType()).ToString() == ((new ArgumentNullException()).GetType()).ToString() ||
                            (ReadEx.GetType()).ToString() == ((new FormatException()).GetType()).ToString() ||
                            (ReadEx.GetType()).ToString() == ((new OverflowException()).GetType()).ToString()
                            )
                        {
                            // default value
                            RollPreviewTimeout = 0;
                        }
                        else
                        {
                            MessageBox.Show("Exception in GetAcquisitionOptions: " + ReadEx.Message);
                            ObjToScan                  = 0;
                            OptionMask                 = 0;
                            DisplayOptionMask          = 0;
                            ContrastLimitToDisplay     = 0;
                            CompletenessLimitToDisplay = 0;
                            ClipRegionW                = 0;
                            ClipRegionH                = 0;
                            RollPreviewTimeout         = 0;
                            ArtefactCleaningDepth      = 0;
                            return(false);
                        }
                    }
                }
                // Artefact Cleaning Depth
                ArtefactCleaningDepth = 0;
                if (this.ArtefactCleaningDepthTextBox.Enabled == true)
                {
                    // read Clean Depth
                    try
                    {
                        Byte CleanDepth = Byte.Parse(this.ArtefactCleaningDepthTextBox.Text);
                        if (CleanDepth > GBMSAPI_NET_CleaningDepth.GBMSAPI_NET_ARTEFACT_CLEANING_DEPTH_MAX &&
                            CleanDepth != GBMSAPI_NET_CleaningDepth.GBMSAPI_NET_ARTEFACT_CLEANING_DEPTH_UNLIMITED)
                        {
                            MessageBox.Show("Clean depth greater than maximum allowed value; will be automatically set to max", "Warning");
                            CleanDepth = GBMSAPI_NET_CleaningDepth.GBMSAPI_NET_ARTEFACT_CLEANING_DEPTH_MAX;
                        }
                        ArtefactCleaningDepth = CleanDepth;
                    }
                    catch (Exception ReadEx)
                    {
                        if ((ReadEx.GetType()).ToString() == ((new ArgumentNullException()).GetType()).ToString() ||
                            (ReadEx.GetType()).ToString() == ((new FormatException()).GetType()).ToString() ||
                            (ReadEx.GetType()).ToString() == ((new OverflowException()).GetType()).ToString()
                            )
                        {
                            // default value
                            ArtefactCleaningDepth = 0;
                        }
                        else
                        {
                            MessageBox.Show("Exception in GetAcquisitionOptions: " + ReadEx.Message);
                            ObjToScan                  = 0;
                            OptionMask                 = 0;
                            DisplayOptionMask          = 0;
                            ContrastLimitToDisplay     = 0;
                            CompletenessLimitToDisplay = 0;
                            ClipRegionW                = 0;
                            ClipRegionH                = 0;
                            RollPreviewTimeout         = 0;
                            ArtefactCleaningDepth      = 0;
                            return(false);
                        }
                    }
                }

                // ver 3.2.0.0
                // EnableRollCompositionBlock
                if (this.cbEnableRollCompositionBlock.Checked)
                {
                    EnableRollCompositionBlock = true;
                }
                // end ver 3.2.0.0

                ///////////////////////////////////////////
                // GET FFD OPTIONS
                ///////////////////////////////////////////
                // ver 4.0.0.0
                if (this.gbHwFfdSettings.Enabled)
                {
                    if (this.rbHwFfdHighStrictness.Checked)
                    {
                        HwFfdStrictnessThreshold = GBMSAPI_NET_HwAntifakeStrictnessThresholds.GBMSAPI_NET_HW_ANTIFAKE_THRESHOLD_HIGH_STRICTNESS;
                    }
                    else if (this.rbHwFfdMediumStrictness.Checked)
                    {
                        HwFfdStrictnessThreshold = GBMSAPI_NET_HwAntifakeStrictnessThresholds.GBMSAPI_NET_HW_ANTIFAKE_THRESHOLD_MEDIUM_STRICTNESS;
                    }
                    else if (this.rbHwFfdLowStrictness.Checked)
                    {
                        HwFfdStrictnessThreshold = GBMSAPI_NET_HwAntifakeStrictnessThresholds.GBMSAPI_NET_HW_ANTIFAKE_THRESHOLD_LOW_STRICTNESS;
                    }
                    else if (this.rbHwFfdPersonalizedStrictness.Checked)
                    {
                        int dummyFfdStrictTh;
                        if (int.TryParse(this.tbHwFfdPersonalizedStrictValue.Text, out dummyFfdStrictTh))
                        {
                            // ver 4.1.0: max value for hw ffd threshold set to 150
                            if (dummyFfdStrictTh >= 10 && dummyFfdStrictTh <= 150)
                            {
                                HwFfdStrictnessThreshold = dummyFfdStrictTh;
                            }
                        }
                    }
                }
                if (this.gbSwFfdSettings.Enabled)
                {
                    int dummyFfdStrictTh;
                    if (int.TryParse(this.tbSwFfdThreshold.Text, out dummyFfdStrictTh))
                    {
                        if (dummyFfdStrictTh >= 0 && dummyFfdStrictTh <= 100)
                        {
                            SwFfdStrictnessThreshold = dummyFfdStrictTh;
                        }
                    }
                }
                // end ver 4.0.0.0

                ///////////////////////////
                //// RETURN OK
                ///////////////////////////
                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in GetAcquisitionOptions function: " + ex.Message);
                ObjToScan                  = 0;
                OptionMask                 = 0;
                DisplayOptionMask          = 0;
                ContrastLimitToDisplay     = 0;
                CompletenessLimitToDisplay = 0;
                ClipRegionW                = 0;
                ClipRegionH                = 0;
                RollPreviewTimeout         = 0;
                ArtefactCleaningDepth      = 0;
                EnableRollCompositionBlock = false;

                return(false);
            }
        }
Ejemplo n.º 11
0
        public CalibrationForm()
        {
            InitializeComponent();

            // ver 2.10.0.0: use "2" functions
            UInt32 scanA;
            int    RetVal = GBMSAPI_NET_DeviceCharacteristicsRoutines.GBMSAPI_NET_GetSupportedScanAreas(out scanA);

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(RetVal, "CalibrationForm,GBMSAPI_NET_GetSupportedScanAreas");
                return;
            }
            this.rbFullFrameArea.Enabled    = false;
            this.rbRollIqsArea.Enabled      = false;
            this.rbRollGaArea.Enabled       = false;
            this.rbRolledThenarArea.Enabled = false;
            this.rbRolledJointArea.Enabled  = false;
            if ((scanA & GBMSAPI_NET_ScanAreas.GBMSAPI_NET_SA_FULL_FRAME) != 0)
            {
                this.rbFullFrameArea.Enabled = true;
            }
            if ((scanA & GBMSAPI_NET_ScanAreas.GBMSAPI_NET_SA_ROLL_IQS) != 0)
            {
                this.rbRollIqsArea.Enabled = true;
            }
            if ((scanA & GBMSAPI_NET_ScanAreas.GBMSAPI_NET_SA_ROLL_GA) != 0)
            {
                this.rbRollGaArea.Enabled = true;
            }
            if ((scanA & GBMSAPI_NET_ScanAreas.GBMSAPI_NET_SA_ROLL_THENAR) != 0)
            {
                this.rbRolledThenarArea.Enabled = true;
            }
            if ((scanA & GBMSAPI_NET_ScanAreas.GBMSAPI_NET_SA_ROLL_JOINT) != 0)
            {
                this.rbRolledJointArea.Enabled = true;
            }

            if (this.rbFullFrameArea.Enabled)
            {
                rbFullFrameArea.Checked = true;
                this.rbFullFrameArea_CheckedChanged(null, null);
            }
            else if (this.rbRollIqsArea.Enabled)
            {
                rbRollIqsArea.Checked = true;
                this.rbRollIqsArea_CheckedChanged(null, null);
            }
            else if (this.rbRollGaArea.Enabled)
            {
                rbRollGaArea.Checked = true;
                this.rbRollGaArea_CheckedChanged(null, null);
            }
            else if (this.rbRolledThenarArea.Enabled)
            {
                rbRolledThenarArea.Checked = true;
                this.rbRolledThenarArea_CheckedChanged(null, null);
            }
            else if (this.rbRolledJointArea.Enabled)
            {
                rbRolledJointArea.Checked = true;
                this.rbRolledJointArea_CheckedChanged(null, null);
            }
            else
            {
                MessageBox.Show("NO SCANNABLE AREAS AVAILABLE", "HEAVY ERROR!!!!");
                return;
            }
            // end ver 2.10.0.0: use "2" functions
            this.OriginalImage = this.CalibrationImagePictureBox.Image;
        }
Ejemplo n.º 12
0
        // end ver 2.10.0.0: use "2" functions
        private void GetNewCalibrationImageButton_Click(object sender, EventArgs e)
        {
            try
            {
                uint    CalibrationDiagnostic;
                Byte [] CalImageArray;

                // ver 2.10.0.0: use "2" functions
                //int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_GetCalibrationImage(
                //    FlatScanArea,out CalImageArray,out CalibrationDiagnostic);
                int RetVal = GBMSAPI_NET_AuxiliaryRoutines.GBMSAPI_NET_GetCalibrationImage2(
                    this.ScanArea, out CalImageArray, out CalibrationDiagnostic);
                // end ver 2.10.0.0: use "2" functions

                if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
                {
                    GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(
                        RetVal, "GetNewCalibrationImageButton_Click,GBMSAPI_GetImageSize");
                    return;
                }

                Marshal.Copy(CalImageArray, 0, this.CalibrationImage, CalImageArray.Length);

                // show diagnostic
                this.Diagnostic = CalibrationDiagnostic;
                this.DiagnosticListBox.Items.Clear();
                if (CalibrationDiagnostic != 0)
                {
                    List <String> DiagList = GBMSAPI_Example_Util.GetDiagStringsFromDiagMask(CalibrationDiagnostic);
                    if ((DiagList != null) && (DiagList.Count > 0))
                    {
                        for (int i = 0; i < DiagList.Count; i++)
                        {
                            this.DiagnosticListBox.Items.Add(DiagList[i]);
                        }
                    }
                }

                // be aware of stride
                int    stride;
                IntPtr BmpBuffer;
                if ((CalibrationImageSX % 4) != 0)
                {
                    stride = CalibrationImageSX - (CalibrationImageSX % 4);

                    Byte [] Dest; Byte [] Src;
                    Dest = new Byte[stride * CalibrationImageSY];
                    Src  = new Byte[CalibrationImageSX * CalibrationImageSY];

                    if (Dest == null || Src == null)
                    {
                        MessageBox.Show("Error in memory allocation in GetNewCalibrationImageButton_Click");
                    }

                    Marshal.Copy(GBMSAPI_Example_Globals.CalibrationBuffer, Src, 0, Src.Length);
                    Marshal.Copy(GBMSAPI_Example_Globals.DummyCalibrationBuffer, Dest, 0, Dest.Length);

                    int DestOffset = 0, SrcOffset = 0;
                    for (int i = 0; i < CalibrationImageSY;
                         i++, DestOffset += stride, SrcOffset += CalibrationImageSX)
                    {
                        Buffer.BlockCopy(Src, SrcOffset, Dest, DestOffset, stride);
                    }

                    Marshal.Copy(Dest, 0, GBMSAPI_Example_Globals.DummyCalibrationBuffer, Dest.Length);

                    BmpBuffer = GBMSAPI_Example_Globals.DummyCalibrationBuffer;
                }
                else
                {
                    stride    = CalibrationImageSX;
                    BmpBuffer = GBMSAPI_Example_Globals.CalibrationBuffer;
                }

                // draw image
                this.CalibrationImagePictureBox.Image = new Bitmap(
                    CalibrationImageSX, CalibrationImageSY,
                    stride,
                    System.Drawing.Imaging.PixelFormat.Format8bppIndexed,
                    BmpBuffer
                    );

                System.Drawing.Imaging.ColorPalette pal = this.CalibrationImagePictureBox.Image.Palette;
                for (int i = 0; i < pal.Entries.Length; i++)
                {
                    pal.Entries[i] = Color.FromArgb(255, i, i, i);
                }
                this.CalibrationImagePictureBox.Image.Palette = pal;
                this.CalibrationImagePictureBox.SizeMode      = PictureBoxSizeMode.StretchImage;

                this.SaveButton.Enabled = true;

                this.Update();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception in GetNewCalibrationImageButton_Click: " + ex.Message);
            }
        }
Ejemplo n.º 13
0
        private void SetButton_Click(object sender, EventArgs e)
        {
            uint IndicatorMask = 0x0000;
            int  Color = 0, RetVal;
            bool Blink;

            // check blink
            if (BlinkCheckBox.Checked)
            {
                Blink = true;
            }
            else
            {
                Blink = false;
            }

            // check Color
            if (GreenRadioButton.Checked)
            {
                Color = GBMSAPI_NET_LEDColors.GBMSAPI_NET_COLOR_GREEN;
            }
            if (RedRadioButton.Checked)
            {
                Color = GBMSAPI_NET_LEDColors.GBMSAPI_NET_COLOR_RED;
            }
            if (YellowRadioButton.Checked)
            {
                Color = GBMSAPI_NET_LEDColors.GBMSAPI_NET_COLOR_YELLOW;
            }
            if (OffRadioButton.Checked)
            {
                Color = GBMSAPI_NET_LEDColors.GBMSAPI_NET_COLOR_OFF;
            }

            // set indicator mask
            if (RightThumbCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_THUMB_RIGHT;
            }
            if (RightIndexCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_INDEX_RIGHT;
            }
            if (RightMiddleCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_MIDDLE_RIGHT;
            }
            if (RightRingCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_RING_RIGHT;
            }
            if (RightLittleCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_LITTLE_RIGHT;
            }
            if (LeftThumbCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_THUMB_LEFT;
            }
            if (LeftIndexCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_INDEX_LEFT;
            }
            if (LeftMiddleCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_MIDDLE_LEFT;
            }
            if (LeftRingCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_RING_LEFT;
            }
            if (LeftLittleCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_LITTLE_LEFT;
            }
            if (RollIndicationCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_ROLL;
            }
            if (StatusCheckBox.Checked)
            {
                IndicatorMask |= GBMSAPI_NET_LEDMaskValues.GBMSAPI_NET_VIL_STATUS;
            }


            RetVal = GBMSAPI_NET_ExternalDevicesControlRoutines.GBMSAPI_NET_SetFingerIndicatorVUIState(IndicatorMask, Color, Blink);

            if (RetVal != GBMSAPI_NET_ErrorCodes.GBMSAPI_NET_ERROR_CODE_NO_ERROR)
            {
                GBMSAPI_Example_Util.GBMSAPI_Example_ManageErrors(RetVal, "SetButton_Click,GBMSAPI_SetFingerIndicatorVUIState");
                return;
            }

            return;
        }