You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using HighRFIDSendCardDemo;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.Common
|
|
|
|
|
{
|
|
|
|
|
public class HIDMode
|
|
|
|
|
{
|
|
|
|
|
DeviceClass deviceClass = new DeviceClass();
|
|
|
|
|
public HIDMode()
|
|
|
|
|
{
|
|
|
|
|
deviceClass.isConnectedFunc = ConnectStart;
|
|
|
|
|
deviceClass.pushTagData = GetTag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ConnectStart(bool Start)
|
|
|
|
|
{
|
|
|
|
|
if (Start)
|
|
|
|
|
{
|
|
|
|
|
//button1.Text = "DisConnect";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//button1.Text = "Monitor";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GetTag(Tag tag)
|
|
|
|
|
{
|
|
|
|
|
//this.Invoke(new Action(() => {
|
|
|
|
|
// int flag = 0;
|
|
|
|
|
// foreach (ListViewItem viewitem in listView1.Items)
|
|
|
|
|
// {
|
|
|
|
|
// if (viewitem.SubItems[1].Text == tag.UID)
|
|
|
|
|
// {
|
|
|
|
|
// viewitem.SubItems[2].Text = (int.Parse(viewitem.SubItems[2].Text) + 1).ToString();
|
|
|
|
|
// viewitem.SubItems[3].Text = System.DateTime.Now.ToString();
|
|
|
|
|
// flag = 1;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (flag == 0)
|
|
|
|
|
// {
|
|
|
|
|
// System.Windows.Forms.ListViewItem EPCitem = new System.Windows.Forms.ListViewItem((listView1.Items.Count + 1).ToString());
|
|
|
|
|
// EPCitem.SubItems.Add(tag.UID);
|
|
|
|
|
// EPCitem.SubItems.Add("1");
|
|
|
|
|
|
|
|
|
|
// DateTime TimeNow_temp = System.DateTime.Now;
|
|
|
|
|
// string TimeNow_str = TimeNow_temp.ToString();
|
|
|
|
|
// EPCitem.SubItems.Add(TimeNow_str);
|
|
|
|
|
// listView1.Items.Add(EPCitem);
|
|
|
|
|
// }
|
|
|
|
|
//}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|