Exemple #1
0
        private void GenericAcquisitionComponent_Load(object sender, EventArgs e)
        {
            tabControlOptions.Enabled = false;
            buttonEnroll.Enabled      = false;
            buttonVerify.Enabled      = false;

            GenericAcqComponent = new MorphoAcquisitionComponent();
            DeviceType[] availableTypes = GenericAcqComponent.CheckAvailableComponents();

            if ((availableTypes == null) || (availableTypes.Length == 0))
            {
                ComponentTypes.Items.Add(DeviceType.NO_DEVICE);
            }

            foreach (DeviceType item in availableTypes)
            {
                ComponentTypes.Items.Add(item);
            }

            SetDropDownAutoWidth(ComponentTypes);

            GenericAcqComponent = null;

            foreach (FingerEventStatus item in Enum.GetValues(typeof(FingerEventStatus)))
            {
                comboBoxFingerPosition.Items.Add(item.ToString());
            }

            SetDropDownAutoWidth(comboBoxFingerPosition);
            comboBoxFingerPosition.SelectedIndex = 0;
        }
Exemple #2
0
        private void buttonCreateObject_Click(object sender, EventArgs e)
        {
            if (ComponentTypes.SelectedItem == null)
            {
                MessageBox.Show("No component was selected.\nPlease choose a component from the list.", "Sample generic acquisition component", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                string l_x_DeviceName = ComponentTypes.SelectedItem.ToString();

                if (Enum.IsDefined(typeof(DeviceType), l_x_DeviceName))
                {
                    CurrentComponentType = (DeviceType)Enum.Parse(typeof(DeviceType), l_x_DeviceName, true);
                }
                else
                {
                    CurrentComponentType = DeviceType.NO_DEVICE;
                }

                GenericAcqComponent       = new MorphoAcquisitionComponent(this.CurrentComponentType);
                CurrentDeviceLayoutConfig = DeviceLayoutConfigMap[this.CurrentComponentType];

                this.tabControlOptions.Enabled = true;
                this.buttonEnroll.Enabled      = true;
                this.buttonVerify.Enabled      = true;

                this.buttonRefreshDevice_Click(this, EventArgs.Empty);

                this.groupBoxMorphoAccess.Enabled = (CurrentDeviceLayoutConfig.Type == DeviceType.ACTIVE_MACI);
                this.groupBoxMorphoSmart.Enabled  = (CurrentDeviceLayoutConfig.Type != DeviceType.ACTIVE_MACI);

                this.comboBoxCoderAlgo.Enabled                = true;
                this.comboBoxFPFormat.Enabled                 = true;
                this.comboBoxFVPFormat.Enabled                = true;
                this.checkBoxConsolidate.Enabled              = true;
                this.comboBoxSecurityLevel.Enabled            = true;
                this.comboBoxAcquisitionModeStrategy.Enabled  = true;
                this.checkBoxShowLiveQualityThreshold.Enabled = true;

                this.comboBoxCoderAlgo.Items.Clear();
                this.comboBoxFPFormat.Items.Clear();
                this.comboBoxFVPFormat.Items.Clear();
                this.comboBoxSecurityLevel.Items.Clear();
                this.comboBoxAcquisitionModeStrategy.Items.Clear();

                this.comboBoxCoderAlgo.Items.AddRange(CurrentDeviceLayoutConfig.CoderAlgorithms.Firsts);
                this.comboBoxFPFormat.Items.AddRange(CurrentDeviceLayoutConfig.FPTemplateFormats.Firsts);
                this.comboBoxFVPFormat.Items.AddRange(CurrentDeviceLayoutConfig.FVPTemplateFormats.Firsts);
                this.comboBoxSecurityLevel.Items.AddRange(CurrentDeviceLayoutConfig.SecurityLevels.Firsts);
                this.comboBoxAcquisitionModeStrategy.Items.AddRange(CurrentDeviceLayoutConfig.AcquisitionModeStrategies.Firsts);

                SetDropDownAutoWidth(this.comboBoxCoderAlgo);
                SetDropDownAutoWidth(this.comboBoxFPFormat);
                SetDropDownAutoWidth(this.comboBoxFVPFormat);
                SetDropDownAutoWidth(this.comboBoxSecurityLevel);
                SetDropDownAutoWidth(this.comboBoxAcquisitionModeStrategy);

                this.comboBoxCoderAlgo.SelectedItem               = CurrentDeviceLayoutConfig.CoderAlgorithmDefaultValue;
                this.comboBoxFPFormat.SelectedItem                = CurrentDeviceLayoutConfig.FPTemplateDefaultValue;
                this.comboBoxFVPFormat.SelectedItem               = CurrentDeviceLayoutConfig.FVPTemplateDefaultValue;
                this.checkBoxConsolidate.Checked                  = CurrentDeviceLayoutConfig.ConsolidateDefaultValue;
                this.comboBoxSecurityLevel.SelectedItem           = CurrentDeviceLayoutConfig.SecurityLevelDefaultValue;
                this.comboBoxAcquisitionModeStrategy.SelectedItem = CurrentDeviceLayoutConfig.AcquisitionModeStrategyDefaultValue;
                this.checkBoxShowLiveQualityThreshold.Checked     = CurrentDeviceLayoutConfig.ShowLiveQualityThresholdDefaultValue;

                this.comboBoxFVPFormat.Enabled                = CurrentDeviceLayoutConfig.FVPTemplatesSupported;
                this.checkBoxConsolidate.Enabled              = CurrentDeviceLayoutConfig.ConsolidateSupported;
                this.comboBoxSecurityLevel.Enabled            = CurrentDeviceLayoutConfig.SecurityLevelSupported;
                this.comboBoxAcquisitionModeStrategy.Enabled  = CurrentDeviceLayoutConfig.AcquisitionModeStrategySupported;
                this.checkBoxShowLiveQualityThreshold.Enabled = CurrentDeviceLayoutConfig.ShowLiveQualityThresholdSupported;

                this.InitDialog();
            }
            catch (Exception exc)
            {
                this.tabControlOptions.Enabled                = false;
                this.buttonEnroll.Enabled                     = false;
                this.buttonVerify.Enabled                     = false;
                this.comboBoxSecurityLevel.Enabled            = false;
                this.comboBoxAcquisitionModeStrategy.Enabled  = false;
                this.groupBoxMorphoAccess.Enabled             = false;
                this.groupBoxMorphoSmart.Enabled              = false;
                this.comboBoxFVPFormat.Enabled                = false;
                this.checkBoxShowLiveQualityThreshold.Enabled = true;
                this.checkBoxConsolidate.Enabled              = true;

                MessageBox.Show(exc.Message, exc.GetType().ToString());
            }
        }
Exemple #3
0
        private void InitAcquisition(ref MorphoAcquisitionComponent AcqComponent)
        {
            // For Active_MACI, device name are: "TCP;IP_Address=<value>;Port=<value>"
            if (this.CurrentComponentType == DeviceType.ACTIVE_MACI)
            {
                AcqComponent.DeviceName = "TCP;IP_Address=" + textBoxIP.AddressText + ";Port=" + textBoxPort.Text + ";Application=APPLICATION_" + comboBoxGen.SelectedItem.ToString();
            }
            else
            {
                if (comboBoxDevice.Items.Count > 0)
                {
                    AcqComponent.DeviceName = comboBoxDevice.SelectedItem.ToString();
                }
                else
                {
                    throw new Exception("No device name was assigned.");
                }
            }

            try
            {
                AcqComponent.CoderAlgorithm = CurrentDeviceLayoutConfig.CoderAlgorithms[this.comboBoxCoderAlgo.SelectedItem.ToString()];
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                if (this.comboBoxFPFormat.SelectedItem.ToString() != DeviceLayoutConfig.NoneItemString)
                {
                    AcqComponent.TemplateFormat = CurrentDeviceLayoutConfig.FPTemplateFormats[this.comboBoxFPFormat.SelectedItem.ToString()];
                }
                else if ((this.comboBoxFVPFormat.Enabled) && (this.comboBoxFVPFormat.SelectedItem.ToString() != DeviceLayoutConfig.NoneItemString))
                {
                    AcqComponent.TemplateFormat = CurrentDeviceLayoutConfig.FVPTemplateFormats[this.comboBoxFVPFormat.SelectedItem.ToString()];
                }
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.JuvenileMode = checkBoxJuvenile.Checked;
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.LiveQualityThreshold = int.Parse(textBoxLiveQualityThreshold.Text);
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.RetryAcquisition = checkBoxRetry.Checked;
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.AcceptBadQualityEnrollment = checkBoxAccept.Checked;
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.ShowLiveQualityBar = checkBoxShowLiveQualityBar.Checked;
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.ShowLiveQualityThreshold = checkBoxShowLiveQualityThreshold.Checked;
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.Timeout = ushort.Parse(textBoxTimeout.Text);
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.TimeoutQualityCoder = Convert.ToInt32(textBoxShowQualityDuration.Text);
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.ExtSecurityLevel = CurrentDeviceLayoutConfig.SecurityLevels[comboBoxSecurityLevel.SelectedItem.ToString()];
            }
            catch (MethodNotImplementedException) { }
            catch (NullReferenceException) { }

            try
            {
                AcqComponent.AcquisitionModeStrategy = CurrentDeviceLayoutConfig.AcquisitionModeStrategies[comboBoxAcquisitionModeStrategy.SelectedItem.ToString()];
            }
            catch { }

            GenericAcqComponent.LiveImage = checkBoxLiveImage.Checked;

            if (radioButtonCultureFr.Checked)
            {
                AcqComponent.SetCulture("fr-FR");
            }
            else if (radioButtonCulturePt.Checked)
            {
                AcqComponent.SetCulture("pt-PT");
            }
            else if (radioButtonCultureEs.Checked)
            {
                AcqComponent.SetCulture("es-ES");
            }
            else if (radioButtonCultureEn.Checked)
            {
                AcqComponent.SetCulture("en-US");
            }
            else if (radioButtonCultureAr.Checked)
            {
                AcqComponent.SetCulture("ar-SA");
            }
            else if (radioButtonCultureIt.Checked)
            {
                AcqComponent.SetCulture("it-IT");
            }
            else if (radioButtonCultureDe.Checked)
            {
                AcqComponent.SetCulture("de-DE");
            }
            else if (radioButtonCultureDefault.Checked)
            {
                AcqComponent.SetCulture("en-US");
            }
        }