Example #1
0
        private void InitializeDevice()
        {
            m_FPM = new SGFingerPrintManager();

            Int32           error;
            SGFPMDeviceName device_name = SGFPMDeviceName.DEV_AUTO;
            Int32           device_id   = (Int32)SGFPMPortAddr.USB_AUTO_DETECT;

            m_SecurityLevel = SGFPMSecurityLevel.NORMAL;

            m_DeviceOpened = false;


            error = m_FPM.Init(device_name);
            if (error != (Int32)SGFPMError.ERROR_NONE)
            {
                error = m_FPM.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);
            }

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                m_FPM.CloseDevice();
                error = m_FPM.OpenDevice(device_id);
            }
            else
            {
                throw new ApplicationException("Unable to initialize scanner. Kindly check the connection");
            }

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
                m_FPM.GetDeviceInfo(pInfo);
                m_ImageWidth  = pInfo.ImageWidth;
                m_ImageHeight = pInfo.ImageHeight;
                m_Dpi         = pInfo.ImageDPI;
                serialNo      = pInfo.DeviceID;
            }

            error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ISO19794);
            error = m_FPM.GetMaxTemplateSize(ref max_template_size);

            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.OpenDevice(device_id);
                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_DeviceOpened = true;
                }
            }
        }
Example #2
0
        public MatcherInitResult Initialize()
        {
            MatcherInitResult result = new MatcherInitResult();

            m_SecurityLevel    = SGFPMSecurityLevel.NORMAL;
            sourceMatch        = null;
            m_ImageWidth       = 260;
            m_ImageHeight      = 300;
            m_Dpi              = 500;
            fingerprintManager = new SGFingerPrintManager();

            //SGFPMDeviceName device_name = SGFPMDeviceName.DEV_UNKNOWN;
            int error = fingerprintManager.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                result.Message = "Initialization Success";
                result.Success = true;
            }
            else
            {
                result.Message = "Init() Error " + error;
                return(result);
            }

            if (m_useAnsiTemplate)
            {
                // Set template format to ANSI 378
                error = fingerprintManager.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);
            }
            else
            {
                // Set template format to ISO 19794-2
                error = fingerprintManager.SetTemplateFormat(SGFPMTemplateFormat.ISO19794);
            }

            Int32 max_template_size = 0;

            error = fingerprintManager.GetMaxTemplateSize(ref max_template_size);

            //m_RegMin1 = new Byte[max_template_size];
            //m_RegMin2 = new Byte[max_template_size];
            //m_VrfMin = new Byte[max_template_size];

            _isInitialized = true;
            return(result);
        }
Example #3
0
        private void NuevaEntradaSalidaBitacora_Load(object sender, EventArgs e)
        {
            comboBox1.SelectedIndex = 0;
            comboBox2.SelectedIndex = 0;
            string appPath2 = Path.GetDirectoryName(Application.ExecutablePath);
            ///create the connection string
            string connString = @"Data Source= " + appPath2 + @"\DBBIT.s3db ;Version=3;";

            //create the database query
            string query = "SELECT * FROM Entradas";

            //create an OleDbDataAdapter to execute the query
            System.Data.SQLite.SQLiteDataAdapter dAdapter = new System.Data.SQLite.SQLiteDataAdapter(query, connString);

            //create a command builder
            System.Data.SQLite.SQLiteCommandBuilder cBuilder = new System.Data.SQLite.SQLiteCommandBuilder(dAdapter);

            //create a DataTable to hold the query results
            DataTable dTable = new DataTable();

            //fill the DataTable
            dAdapter.Fill(dTable);
            dAdapter.Update(dTable);


            if (dTable.Rows.Count != 0)
            {
                DataRow Row     = dTable.Rows[dTable.Rows.Count - 1];
                string  num     = Row["Numero"].ToString();
                int     autonum = Int32.Parse(num);
                label1.Text = (autonum + 1).ToString();
            }
            else
            {
                label1.Text = "1";
            }



            //create the database query
            query = "SELECT * FROM Salidas";

            //create an OleDbDataAdapter to execute the query
            dAdapter = new System.Data.SQLite.SQLiteDataAdapter(query, connString);

            //create a command builder
            cBuilder = new System.Data.SQLite.SQLiteCommandBuilder(dAdapter);

            //create a DataTable to hold the query results
            dTable = new DataTable();
            //fill the DataTable
            dAdapter.Fill(dTable);
            dAdapter.Update(dTable);


            if (dTable.Rows.Count != 0)
            {
                DataRow Row     = dTable.Rows[dTable.Rows.Count - 1];
                string  num     = Row["Numero"].ToString();
                int     autonum = Int32.Parse(num);
                label12.Text = (autonum + 1).ToString();
            }
            else
            {
                label12.Text = "1";
            }

            m_ImageWidth  = 260;
            m_ImageHeight = 300;
            m_Dpi         = 500;
            m_FPM         = new SGFingerPrintManager();
            Int32           error;
            SGFPMDeviceName device_name = SGFPMDeviceName.DEV_UNKNOWN;
            Int32           device_id   = (Int32)SGFPMPortAddr.USB_AUTO_DETECT;

            device_name = SGFPMDeviceName.DEV_AUTO;

            m_DeviceOpened = false;

            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.Init(device_name);
            }
            else
            {
                error = m_FPM.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);
            }

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
                m_FPM.GetDeviceInfo(pInfo);
                m_ImageWidth         = pInfo.ImageWidth;
                m_ImageHeight        = pInfo.ImageHeight;
                StatusBar.Text       = "Initialization Success";
                pictureBox1.Visible  = true;
                progressBar1.Visible = true;
                button3.Visible      = true;
                button4.Visible      = false;
            }
            else
            {
                StatusBar.Text = "Init() Error " + error;
                return;
            }

            // Set template format to ANSI 378
            error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);

            // Get Max template size
            Int32 max_template_size = 0;

            error = m_FPM.GetMaxTemplateSize(ref max_template_size);

            m_RegMin1 = new Byte[max_template_size];
            m_RegMin2 = new Byte[max_template_size];
            m_VrfMin  = new Byte[max_template_size];

            // OpenDevice if device is selected
            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.OpenDevice(device_id);
                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_DeviceOpened = true;
                }
                else
                {
                    StatusBar.Text = "OpenDevice() Error : " + error;
                }
            }
        }
Example #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            Int32           error;
            SGFPMDeviceName device_name = SGFPMDeviceName.DEV_UNKNOWN;
            Int32           device_id   = (Int32)SGFPMPortAddr.USB_AUTO_DETECT;

            m_DeviceOpened = false;

            // Get device name
            if (comboBox2.Text == "DEV_FDU03 : 0")
            {
                device_name = SGFPMDeviceName.DEV_FDU03;
            }

            else if (comboBox2.Text == "Auto Selection")
            {
                device_name = SGFPMDeviceName.DEV_AUTO;
            }

            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.Init(device_name);

                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_FPM.CloseDevice();
                    error = m_FPM.OpenDevice(device_id);
                }

                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
                    m_FPM.GetDeviceInfo(pInfo);
                    m_ImageWidth  = pInfo.ImageWidth;
                    m_ImageHeight = pInfo.ImageHeight;
                }
            }
            else
            {
                error = m_FPM.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);
            }

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                EnableButtons(true);
                textBox5.Text = "Initialization Success";
            }
            else
            {
                EnableButtons(false);
                textBox5.Text = "Init() Error " + error;
                return;
            }

            if (m_useAnsiTemplate)
            {
                // Set template format to ANSI 378
                error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);
            }
            else
            {
                // Set template format to ISO 19794-2
                error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ISO19794);
            }

            // Get Max template size
            Int32 max_template_size = 0;

            error = m_FPM.GetMaxTemplateSize(ref max_template_size);

            m_RegMin1 = new Byte[max_template_size];
            m_RegMin2 = new Byte[max_template_size];
            m_VrfMin  = new Byte[max_template_size];

            // OpenDevice if device is selected
            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.OpenDevice(device_id);
                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_DeviceOpened = true;
                }
                else
                {
                    textBox4.Text = "OpenDevice() Error : " + error;
                    EnableButtons(false);
                }
            }
        }
Example #5
0
        private void button4_Click(object sender, EventArgs e)
        {
            m_ImageWidth  = 260;
            m_ImageHeight = 300;
            m_Dpi         = 500;
            m_FPM         = new SGFingerPrintManager();
            Int32           error;
            SGFPMDeviceName device_name = SGFPMDeviceName.DEV_UNKNOWN;
            Int32           device_id   = (Int32)SGFPMPortAddr.USB_AUTO_DETECT;

            device_name = SGFPMDeviceName.DEV_AUTO;

            m_DeviceOpened = false;

            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.Init(device_name);
            }
            else
            {
                error = m_FPM.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);
            }

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
                m_FPM.GetDeviceInfo(pInfo);
                m_ImageWidth         = pInfo.ImageWidth;
                m_ImageHeight        = pInfo.ImageHeight;
                StatusBar.Text       = "Initialization Success";
                pictureBox1.Visible  = true;
                progressBar1.Visible = true;
                button3.Visible      = true;
                button4.Visible      = false;
            }
            else
            {
                StatusBar.Text = "Init() Error " + error;
                return;
            }

            // Set template format to ANSI 378
            error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);

            // Get Max template size
            Int32 max_template_size = 0;

            error = m_FPM.GetMaxTemplateSize(ref max_template_size);

            m_RegMin1 = new Byte[max_template_size];
            m_RegMin2 = new Byte[max_template_size];
            m_VrfMin  = new Byte[max_template_size];

            // OpenDevice if device is selected
            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.OpenDevice(device_id);
                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_DeviceOpened = true;
                }
                else
                {
                    StatusBar.Text = "OpenDevice() Error : " + error;
                }
            }
        }
        private void NuevaEntradaSalidaBitacora_Load(object sender, EventArgs e)
        {
            comboBox1.SelectedIndex = 0;
            comboBox2.SelectedIndex = 0;
            string appPath2 = Path.GetDirectoryName(Application.ExecutablePath);
            ///create the connection string
            string connString = @"Data Source= " + appPath2 + @"\DBBIT.s3db ;Version=3;";

            //create the database query
            string query = "SELECT * FROM Entradas";

            //create an OleDbDataAdapter to execute the query
            System.Data.SQLite.SQLiteDataAdapter dAdapter = new System.Data.SQLite.SQLiteDataAdapter(query, connString);

            //create a command builder
            System.Data.SQLite.SQLiteCommandBuilder cBuilder = new System.Data.SQLite.SQLiteCommandBuilder(dAdapter);

            //create a DataTable to hold the query results
            DataTable dTable = new DataTable();
            //fill the DataTable
            dAdapter.Fill(dTable);
            dAdapter.Update(dTable);

            if (dTable.Rows.Count != 0)
            {
                DataRow Row = dTable.Rows[dTable.Rows.Count - 1];
                string num = Row["Numero"].ToString();
                int autonum = Int32.Parse(num);
                label1.Text = (autonum + 1).ToString();
            }
            else
            {
                label1.Text = "1";
            }

            //create the database query
            query = "SELECT * FROM Salidas";

            //create an OleDbDataAdapter to execute the query
            dAdapter = new System.Data.SQLite.SQLiteDataAdapter(query, connString);

            //create a command builder
            cBuilder = new System.Data.SQLite.SQLiteCommandBuilder(dAdapter);

            //create a DataTable to hold the query results
            dTable = new DataTable();
            //fill the DataTable
            dAdapter.Fill(dTable);
            dAdapter.Update(dTable);

            if (dTable.Rows.Count != 0)
            {
                DataRow Row = dTable.Rows[dTable.Rows.Count - 1];
                string num = Row["Numero"].ToString();
                int autonum = Int32.Parse(num);
                label12.Text = (autonum + 1).ToString();
            }
            else
            {
                label12.Text = "1";
            }

            m_ImageWidth = 260;
            m_ImageHeight = 300;
            m_Dpi = 500;
            m_FPM = new SGFingerPrintManager();
            Int32 error;
            SGFPMDeviceName device_name = SGFPMDeviceName.DEV_UNKNOWN;
            Int32 device_id = (Int32)SGFPMPortAddr.USB_AUTO_DETECT;
            device_name = SGFPMDeviceName.DEV_AUTO;

            m_DeviceOpened = false;

            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
                error = m_FPM.Init(device_name);
            else
                error = m_FPM.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
                m_FPM.GetDeviceInfo(pInfo);
                m_ImageWidth = pInfo.ImageWidth;
                m_ImageHeight = pInfo.ImageHeight;
                StatusBar.Text = "Initialization Success";
                pictureBox1.Visible = true;
                progressBar1.Visible = true;
                button3.Visible = true;
                button4.Visible = false;
            }
            else
            {
                StatusBar.Text = "Init() Error " + error;
                return;
            }

            // Set template format to ANSI 378
            error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);

            // Get Max template size
            Int32 max_template_size = 0;
            error = m_FPM.GetMaxTemplateSize(ref max_template_size);

            m_RegMin1 = new Byte[max_template_size];
            m_RegMin2 = new Byte[max_template_size];
            m_VrfMin = new Byte[max_template_size];

            // OpenDevice if device is selected
            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.OpenDevice(device_id);
                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_DeviceOpened = true;

                }
                else
                {
                    StatusBar.Text = "OpenDevice() Error : " + error;
                }
            }
        }
        private void button5_Click(object sender, EventArgs e)
        {
            m_SecurityLevel = SGFPMSecurityLevel.NORMAL;
            m_StoredTemplate = null;
            m_ImageWidth = 260;
            m_ImageHeight = 300;
            m_Dpi = 500;
            m_FPM = new SGFingerPrintManager();

            Int32 error;
            SGFPMDeviceName device_name = SGFPMDeviceName.DEV_UNKNOWN;
            Int32 device_id = (Int32)SGFPMPortAddr.USB_AUTO_DETECT;
            device_name = SGFPMDeviceName.DEV_AUTO;

            m_DeviceOpened = false;

            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
                error = m_FPM.Init(device_name);
            else
                error = m_FPM.InitEx(m_ImageWidth, m_ImageHeight, m_Dpi);

            if (error == (Int32)SGFPMError.ERROR_NONE)
            {
                SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
                m_FPM.GetDeviceInfo(pInfo);
                m_ImageWidth = pInfo.ImageWidth;
                m_ImageHeight = pInfo.ImageHeight;
                StatusBar.Text = "Initialization Success";

                this.Height = 453;
                this.Width = 820;

                pictureBox1.Enabled = true;
                pictureBox2.Enabled = true;
                PB1.Enabled = true;
                PB2.Enabled = true;
                button3.Enabled = true;
                button4.Enabled = true;

                button1.Enabled = false;
                textBox2.Enabled = false;

                button5.Enabled = false;
                button5.Visible = false;

                button6.Visible = true;
                button6.Enabled = true;
            }
            else
            {
                StatusBar.Text = "Init() Error " + error;
                return;
            }

            // Set template format to ANSI 378
            error = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);

            // Get Max template size
            Int32 max_template_size = 0;
            error = m_FPM.GetMaxTemplateSize(ref max_template_size);

            m_RegMin1 = new Byte[max_template_size];
            m_RegMin2 = new Byte[max_template_size];
            m_VrfMin = new Byte[max_template_size];

            // OpenDevice if device is selected
            if (device_name != SGFPMDeviceName.DEV_UNKNOWN)
            {
                error = m_FPM.OpenDevice(device_id);
                if (error == (Int32)SGFPMError.ERROR_NONE)
                {
                    m_DeviceOpened = true;
                }
                else
                {
                    StatusBar.Text = "OpenDevice() Error : " + error;
                }
            }
        }