Exemplo n.º 1
0
 private void rb_HF_CheckedChanged(object sender, EventArgs e)
 {
     if (rb_HF.Checked)
     {
         _RFIDDevice = new HFISO15693();
         _RFIDDevice.Close();
         string strLog = string.Empty;
         _RFIDDevice.Open(ref strLog);
     }
 }
Exemplo n.º 2
0
        private void WriteTag_Load(object sender, EventArgs e)
        {
            SetLabelStatus(statusType.START);


            //_RFIDDevice = new HFISO15693();
            _RFIDDevice = new UHFISO18000();
            string strLog = string.Empty;

            _RFIDDevice.Open(ref strLog);
            WriteLog(lrtxtLog, strLog, ReaderInfo.readerConnerted ? 0 : 1);
            chkbox_burningTag.Checked = ReaderInfo.readerConnerted;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 打开RFID读写器
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOpenReader_Click(object sender, EventArgs e)
        {
            openState = (openState ^ true);
            this.btnOpenReader.Text = openState ? "Close Reader" : "Open Reader";
            if (openState)
            {
                try
                {
                    int count = rfidWriterList.Count;
                    if (count <= 0 && rfidWriterList == null)
                    {
                        throw new Exception("从数据库中获取数据失败");
                    }
                    else
                    {
                        //根据不同类型的Reader,ReaderFactory实例化不通过的Reader
                        ReaderFactory readerFact = new ReaderFactory();

                        reader = readerFact.MakeReader(rfidWriterList[0].RFidreaderType);
                        reader.Open(rfidWriterList[0].RFidreaderIP);

                        this.readerLB.Items.Add(Convert.ToString(rfidWriterList[0].RFidreaderID + " " + rfidWriterList[0].RFidreaderIP + " " + rfidWriterList[0].RFidreaderType));
                    }

                    //Reader打开之前不可用
                    this.btnWrite.Enabled  = true;
                    this.btnReadM4.Enabled = true;
                    this.lockBTN.Enabled   = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("打开读写器失败:" + ex.Message);
                }
            }
            else
            {
                this.readerLB.Items.Clear();
                this.reader.CleanBuffer();
                this.reader.Close();

                //Reader关闭之后不可用
                this.btnWrite.Enabled  = false;
                this.btnReadM4.Enabled = false;
                this.lockBTN.Enabled   = false;
            }
        }
Exemplo n.º 4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (CheckLicense() == false)
            {
                MessageBox.Show("请升级软件"); return;
            }
            assemblyobj = CreateWc("http://10.60.3.27/PMSService/DataService.asmx");
            //初始化读取描述
            //获取间隔时间
            List <string> TimeList = new List <string>();

            string[] aryTime = new Jsonhelp().readjson("ReadTime", BasicConfigInfo.path).ToString().Split('|');
            foreach (var a in aryTime)
            {
                TimeList.Add(a);
            }
            ddlinternalTime.DataSource = TimeList;

            //初始化cefsharp
            try
            {
                DbUtility   dbhelp = new DbUtility(System.Configuration.ConfigurationManager.ConnectionStrings["cloudConn"].ToString(), DbProviderType.MySql);
                CefSettings seting = new CefSettings();
                //seting.CefCommandLineArgs.Add("disable-gpu", "1");
                //Cef.EnableHighDPISupport();
                Cef.Initialize(seting);
                String page = string.Format(@"{0}\IVCurve\IVCurve.html", Application.StartupPath);
                //ChromiumWebBrowser myBrowser = new ChromiumWebBrowser(page);
                myBrowser = new ChromiumWebBrowser(page);
                //this.Controls.Add(myBrowser);
                myBrowser.Dock = DockStyle.Fill;
                gbxCurve.Controls.Add(myBrowser);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            //panel1.Controls.Add(myBrowser);
            objRFID = new UHFISO18000();
            string res = "";

            objRFID.Open(ref res);
            Log(res, 1);
        }
Exemplo n.º 5
0
        public void initReaderList()
        {
            //  List<RFIDReader> rfidreaderlist = new List<RFIDReader>();
            //  //连接数据库,获取所有reader的基本信息
            ////  RFIDReaderList createrredaerlist = new RFIDReaderList();
            //  XMLReaderConvertor xmlreaderlist = new XMLReaderConvertor();
            //  rfidreaderlist = xmlreaderlist.getRFIDReaderList();

            //rfidreaderlist的个数
            int count = rfidreaderlist.Count;

            if (count <= 0 && rfidreaderlist == null)
            {
                throw new Exception("从数据库中获取数据失败");
            }
            else
            {
                //根据不同类型的Reader,ReaderFactory实例化不通过的Reader
                ReaderFactory readerFact = new ReaderFactory();
                for (int i = 0; i < count; i++)
                {
                    //实例化reader
                    RFIDInterface reader = readerFact.MakeReader(rfidreaderlist[i].RFidreaderType);
                    //打开reader
                    //reader.ip = rfidreaderlist[i].RFidreaderIP;  //2014.2.17:设置IP
                    //System.Diagnostics.Stopwatch stopwatch = new Stopwatch();
                    //stopwatch.Start();
                    reader.Open(rfidreaderlist[i].RFidreaderIP);
                    //stopwatch.Stop();

                    reconnectThread.AlertState.Add(rfidreaderlist[i].RFidreaderIP, false);  //2014.2.24,对话框状态

                    this.readerListBox.Items.Add(Convert.ToString(rfidreaderlist[i].RFidreaderID + " " + rfidreaderlist[i].RFidreaderIP + " " + rfidreaderlist[i].RFidreaderType));

                    this.Xtreaderlist.Add(new XtiveReaderInitClass(reader, false));

                    //TimeSpan timespan = stopwatch.Elapsed;
                    //System.Console.WriteLine(rfidreaderlist[i].RFidreaderIP+" "+timespan.TotalMilliseconds);
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 打开RFID读写器
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOpenReader_Click(object sender, EventArgs e)
        {
            openState = (openState ^ true);
            this.btnOpenReader.Text = openState ? "Close Reader" : "Open Reader";
            if (openState)
            {
                try
                {
                    int count = rfidWriterList.Count;
                    if (count <= 0 && rfidWriterList == null)
                    {
                        throw new Exception("从数据库中获取数据失败");
                    }
                    else
                    {
                        //根据不同类型的Reader,ReaderFactory实例化不通过的Reader
                        ReaderFactory readerFact = new ReaderFactory();

                        reader = readerFact.MakeReader(rfidWriterList[0].RFidreaderType);
                        reader.Open(rfidWriterList[0].RFidreaderIP);

                        this.readerLB.Items.Add(Convert.ToString(rfidWriterList[0].RFidreaderID + " " + rfidWriterList[0].RFidreaderIP + " " + rfidWriterList[0].RFidreaderType));
                    }

                    //Reader打开之前不可用
                    this.btnWrite.Enabled = true;
                    this.btnReadM4.Enabled = true;
                    this.lockBTN.Enabled = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("打开读写器失败:" + ex.Message);
                }
            }
            else
            {
                this.readerLB.Items.Clear();
                this.reader.CleanBuffer();
                this.reader.Close();

                //Reader关闭之后不可用
                this.btnWrite.Enabled = false;
                this.btnReadM4.Enabled = false;
                this.lockBTN.Enabled = false;
            }
        }