private void GetTagId()
        {
            List <string> listUsbDevicePath = CLReader.GetUsbHidDeviceList();

            if (listUsbDevicePath.Count > 0)
            {
                ConnIDs = listUsbDevicePath[0];
                if (CLReader.CreateUsbConn(ConnIDs, Handle, RFIDPrg))
                {
                    // MessageBox.Show("Connected");
                    // btnGetTagId .Text = "Ok";
                    eReadType eRType = new eReadType();
                    eRType     = eReadType.Single;
                    antennaNum = eAntennaNo._1;

                    int TID = 0;
                    TID = CLReader._Tag6C.GetEPC_TID(ConnIDs, antennaNum, eRType);
                    System.Threading.Thread.Sleep(1000);
                    if (TID != 0)
                    {
                        //  MessageBox.Show(TID.ToString());
                    }
                }
                else
                {
                    MessageBox.Show("Not connected");
                }
            }
            else
            {
                MessageBox.Show("No USB connections Found");
            }
            CLReader.CloseConn(ConnIDs);
            CLReader.CloseAllConnect();
        }
예제 #2
0
        private void btnConnectUSB_Click(object sender, EventArgs e)
        {
            List <string> listUsbDevicePath = CLReader.GetUsbHidDeviceList();

            comboBox1.DataSource = listUsbDevicePath;
            int i = listUsbDevicePath.Count;

            textBox3.Text = i.ToString();

            if (listUsbDevicePath.Count > 0)
            {
                ConnIDs = listUsbDevicePath[0];
                if (CLReader.CreateUsbConn(ConnIDs, Handle, RFIDPrg))
                {
                    MessageBox.Show("Connected");
                    eReadType eRType = new eReadType();
                    eRType     = eReadType.Inventory;
                    antennaNum = eAntennaNo._1;

                    int TID = 0;
                    TID = CLReader._Tag6C.GetEPC_TID(ConnIDs, antennaNum, eRType);
                    if (TID != 0)
                    {
                        MessageBox.Show("Data Read");
                    }
                }
                else
                {
                    MessageBox.Show("Not connected");
                }
            }
            else
            {
                MessageBox.Show("No USB connections Found");
            }

            CLReader.CloseConn(ConnIDs);
            CLReader.CloseAllConnect();

            btnReturnButton.Visible = true;
            //this.Close();
        }
예제 #3
0
        /// <summary>
        /// 开始读卡
        /// </summary>
        public void StartReadEpc(bool IsTid = false)
        {
            this.readType = (eReadType)singleOrWhile;
            //var st = CLReader._Tag6C.GetEPC(ConnID, this.antNo, readType);
            antNo = antNo | (eAntennaNo)15;
            var st2 = -1;

            if (IsTid)
            {
                CLReader._Config.Stop(ConnID);
                st2 = CLReader._Tag6C.GetEPC_TID(ConnID, antNo, readType);
            }
            else
            {
                ClouReaderAPI.CLReader.RFID_OPTION.StopReader(ConnID);
                st2 = CLReader._Tag6C.GetEPC(ConnID, antNo, readType);
            }

            CLReader.DIC_CONNECT[ConnID].ProcessCount = 0;
            IsStartRead = true;
        }
예제 #4
0
        public void AddNewStudent()
        {
            txtName.ReadOnly                   = false;
            txtClass.ReadOnly                  = false;
            txtRollNos.ReadOnly                = false;
            txtClassTeacher.ReadOnly           = false;
            txtClassTeacherContactNos.ReadOnly = false;
            txtGuardianName.ReadOnly           = false;
            txtGuardiancontactNumber.ReadOnly  = false;
            txtHomeAddress.ReadOnly            = false;
            txtSiblingInformation.ReadOnly     = false;
            txtJoinedSchoolDate.ReadOnly       = false;
            txtBloodGroup.ReadOnly             = false;
            txtWarnings.ReadOnly               = false;
            txtNotes.ReadOnly                  = false;
            txtEntryTime.ReadOnly              = false;
            txtExitTime.ReadOnly               = false;
            txtDate.ReadOnly                   = false;
            txtLastNotedLocation.ReadOnly      = false;
            txtAttendenceInDays.ReadOnly       = false;
            txtGender.ReadOnly                 = false;
            txtAadharNos.ReadOnly              = false;

            panel3.Visible        = false;
            btnSaveNExit.Visible  = true;
            isAddingNewStudent    = true;
            GetRFID_panel.Visible = true;

            if (GetRFID_panel.Visible == true)
            {
                #region READRFID

                //Show RFID reading first.
                GetRFID_panel.Width  = 800;
                GetRFID_panel.Height = 800;

                //Disable exit button and background.
                btnExitButton.Visible = false;

                ProgramCLUSB  RFIDPrg           = new ProgramCLUSB();
                List <string> listUsbDevicePath = new List <string>();

                string     ConnIDs    = "";
                eAntennaNo antennaNum = eAntennaNo._1;
                eReadType  eRType     = eReadType.Single;


                try
                {
                    listUsbDevicePath = CLReader.GetUsbHidDeviceList();
                }
                catch (Exception eee)
                {
                    MessageBox.Show(eee.ToString());
                }



                if (listUsbDevicePath.Count > 0)
                {
                    ConnIDs = listUsbDevicePath[0];

                    if (CLReader.CreateUsbConn(ConnIDs, Handle, RFIDPrg))
                    {
                        MessageBox.Show("Connected");


                        int TID = 0;

                        TID = CLReader._Tag6C.GetEPC_TID(ConnIDs, antennaNum, eRType);


                        if (TID > 0)
                        {
                            MessageBox.Show("Data Read");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Not connected");
                    }
                }
                else
                {
                    MessageBox.Show("No USB connections Found");
                }


                scanID.Text = "ID of Tag =" + TagRead;

                CLReader.CloseConn(ConnIDs);
                CLReader.CloseAllConnect();
                btnExitButton.Visible = true;
                txtStudentId.Text     = TagRead;



                btnSaveNExit.Visible = true;
                btnSaveNExit.Enabled = true;
            }


            #endregion
        }