Пример #1
0
        private void ScanCard()
        {
            int lRet = 0;
            int w1, h1, w2, h2;

            w1 = h1 = w2 = h2 = 0;
            if (true)
            {
                pid_Card = new A8ScannerReaderImporter.Id_Card();
                lRet     = A8ScannerReaderImporter.IO_ReadRFIDInfo(ref pid_Card);
                if (lRet == 0)
                {
                    this.txtInfo.Text += ByteToString(pid_Card.id_Name) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_Sex) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_Born) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_Code) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_NewAddr) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_Home) + "\r\n";

                    this.txtInfo.Text += ByteToString(pid_Card.id_ValidPeriod) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_RegOrg) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_Home) + "\r\n";
                    this.txtInfo.Text += ByteToString(pid_Card.id_ValidPeriod) + "\r\n";
                    int g_DPI = (optDPI300.Checked ? 300 : 600);
                    lRet = A8ScannerReaderImporter.IO_GetImgFromUnit(g_DPI, "Picture1.bmp", ref w1, ref h1, "Picture2.bmp", ref w2, ref h2);
                    if (lRet == 0)
                    {
                        if (chkToJpg.Checked)
                        {
                            lRet = A8ScannerReaderImporter.BmpToJpeg(@"Picture1.bmp", @"Picture1.jpg");
                            if (lRet == 0)
                            {
                                File.Delete("Picture1.bmp");
                            }

                            lRet = A8ScannerReaderImporter.BmpToJpeg(@"Picture2.bmp", @"Picture2.jpg");
                            if (lRet == 0)
                            {
                                File.Delete(@"Picture2.bmp");
                            }
                        }
                        MessageBox.Show("Get Image From Unit Success.");
                    }
                    else
                    {
                        MessageBox.Show("Get Image From Unit Failed.");
                    }
                }
            }
            else
            {
                MessageBox.Show("请插入二代身份证");
            }
        }
Пример #2
0
        private void btnA8DisableSuckCard_Click(object sender, EventArgs e)
        {
            int lRet = 0;

            lRet = A8ScannerReaderImporter.IO_CancelSuckCard();
            if (lRet == 0)
            {
                MessageBox.Show("IO_CancelSuckCard OK.");
            }
            else
            {
                MessageBox.Show("IO_CancelSuckCard error.");
            }
        }
Пример #3
0
        private void btnA8ResetDevice_Click(object sender, EventArgs e)
        {
            int lRet = 0;

            lRet = A8ScannerReaderImporter.IO_ResetDevice();
            if (lRet == 0)
            {
                MessageBox.Show("IO_ResetDevice OK.");
            }
            else
            {
                MessageBox.Show("IO_ResetDevice error.");
            }
        }
Пример #4
0
        private void btnA8SetCalibdata_Click(object sender, EventArgs e)
        {
            int lRet = 0;

            lRet = A8ScannerReaderImporter.IO_SetCalibdata();
            if (lRet == 0)
            {
                MessageBox.Show("IO_SetCalibData Success.");
            }
            else
            {
                MessageBox.Show("IO_SetCalibData Failed.");
            }
        }
Пример #5
0
        private void btnA8SensorStatus_Click(object sender, EventArgs e)
        {
            int  lRet    = 0;
            long lStatus = 0;

            lRet = A8ScannerReaderImporter.IO_GetSensorStatus(ref lStatus);
            if (lRet != 0)
            {
                txtInfo.Text = "IO_GetSensorStatus:" + lRet.ToString();
                return;
            }

            txtInfo.Text = "IO_GetSensorStatus:" + lRet.ToString() + "\r\n" + GetStatusMeans(lStatus);
        }
Пример #6
0
        private void btnA8GetMode_Click(object sender, EventArgs e)
        {
            int lRet = 0;

            lRet = A8ScannerReaderImporter.IO_GetScanModeA8(ref modeA8);
            if (lRet == 0)
            {
                txtInfo.Text = "mode_d = " + modeA8.mode_d.ToString() + "\r\n" + "mode_d_r = " + modeA8.mode_d_r.ToString() + "\r\n" + "mode_u = " + modeA8.mode_u.ToString() + "\r\n" + "mode_u_r = " + modeA8.mode_u_r.ToString() + "\r\n" + "atuo_reverse = " + modeA8.atuo_reverse.ToString();
            }
            else
            {
                MessageBox.Show("Get scan mode failed.");
            }
        }
Пример #7
0
        private void btnA8DeviceStatus_Click(object sender, EventArgs e)
        {
            int    lRet    = 0;
            long   lStatus = 0;
            string result  = string.Empty;

            lRet = A8ScannerReaderImporter.IO_GetDeviceStatus(ref lStatus);
            if (lRet == 0)
            {
                switch (lStatus)
                {
                case 0:
                    result = "--ready";
                    break;

                case 1:
                    result = "--busy";
                    break;

                case 2:
                    result = "--calibrating";
                    break;

                case 3:
                    result = "--reversed";
                    break;

                case 4:
                    result = "--scanning";
                    break;

                case 5:
                    result = "--testing motor";
                    break;

                case 6:
                    result = "--communication error";
                    break;

                default:
                    break;
                }
                txtInfo.Text = result;
            }
            else
            {
                MessageBox.Show("IO_GetDeviceStauts Error");
            }
        }
Пример #8
0
        private void btnA8GetVersion_Click(object sender, EventArgs e)
        {
            int    lRet       = 0;
            string strVersion = string.Empty;

            lRet = A8ScannerReaderImporter.IO_GetVersion(strVersion);
            if (lRet == 0)
            {
                txtInfo.Text = strVersion;
            }
            else
            {
                MessageBox.Show("IO_GetVersion Failed.");
            }
        }
Пример #9
0
        private void btnA8GetChipID_Click(object sender, EventArgs e)
        {
            int  lRet = 0;
            long lID  = 0;

            lRet = A8ScannerReaderImporter.IO_GetChipID(ref lID);
            if (lRet == 0)
            {
                lID          = lID / 65536;
                txtInfo.Text = Convert.ToString(lID, 16);
            }
            else
            {
                MessageBox.Show("IO_GetChipID Failed.");
            }
        }
Пример #10
0
        private void btnA8SetMode_Click(object sender, EventArgs e)
        {
            int lRet = 0;

            modeA8.mode_d       = 7;
            modeA8.mode_d_r     = 7;
            modeA8.mode_u       = 7;
            modeA8.mode_u_r     = 7;
            modeA8.atuo_reverse = 0;

            lRet = A8ScannerReaderImporter.IO_SetScanModeA8(ref modeA8);
            if (lRet == 0)
            {
                MessageBox.Show("Set scan mode OK.");
            }
            else
            {
                MessageBox.Show("Set scan mode Failed.");
            }
        }
Пример #11
0
        private void btnA8OpenDevice_Click(object sender, EventArgs e)
        {
            int lRet = 0; bool result = false;

            lRet = A8ScannerReaderImporter.IO_HasScanner("IVS-600DS");
            A8ScannerReaderImporter.Sleep(100);
            if (lRet == 1)
            {
                modeA8.mode_d       = 7;
                modeA8.mode_d_r     = 7;
                modeA8.mode_u       = 7;
                modeA8.mode_u_r     = 7;
                modeA8.atuo_reverse = 0;
                lRet = A8ScannerReaderImporter.IO_SetScanModeA8(ref modeA8);
                A8ScannerReaderImporter.Sleep(100);
                if (lRet == 0)
                {
                    lRet = A8ScannerReaderImporter.IO_GetCalibData(ref CalibData);
                    if (lRet == 0)
                    {
                        btnA8OpenDevice.Enabled = false;
                        MessageBox.Show("Open Device Success.");
                    }
                    else
                    {
                        A8ScannerReaderImporter.IO_CloseDevice();
                        MessageBox.Show("Get Calib Status Failed.");
                    }
                }
                else
                {
                    A8ScannerReaderImporter.IO_CloseDevice();
                    MessageBox.Show("Set Scanmode Error." + lRet.ToString());
                }
            }
            else
            {
                A8ScannerReaderImporter.IO_CloseDevice();
                MessageBox.Show("Open Device Failed.");
            }
        }
Пример #12
0
 private void btnA8Beep_Click(object sender, EventArgs e)
 {
     A8ScannerReaderImporter.IO_Beep(1000);
 }