Commit 53eda596 顾剑亮

修改bug

1 个父辈 c064edb2
正在显示 35 个修改的文件 包含 51 行增加21 行删除
此文件类型无法预览
...@@ -11,6 +11,16 @@ namespace Asa.RFID ...@@ -11,6 +11,16 @@ namespace Asa.RFID
public System.Net.Sockets.Socket Socket; public System.Net.Sockets.Socket Socket;
public System.Threading.Thread ListenNet; public System.Threading.Thread ListenNet;
public Client(string ip)
{
Loop = false;
IP = ip;
IsConn = false;
Buffer = null;
Socket = null;
ListenNet = null;
}
public Client(string ip, System.Net.Sockets.Socket socket, System.Threading.Thread listenNet) public Client(string ip, System.Net.Sockets.Socket socket, System.Threading.Thread listenNet)
{ {
Loop = true; Loop = true;
......
...@@ -2,9 +2,24 @@ ...@@ -2,9 +2,24 @@
namespace Asa.RFID namespace Asa.RFID
{ {
/// <summary> public class Device
/// RFID读卡器类型 {
/// </summary> public string IP { set; get; }
public string Value { set; get; }
public Device(string ip, string value)
{
IP = ip;
Value = value;
}
public Device(string ip)
{
IP = ip;
Value = "";
}
}
public enum DeviceType public enum DeviceType
{ {
/// <summary> /// <summary>
...@@ -16,4 +31,11 @@ namespace Asa.RFID ...@@ -16,4 +31,11 @@ namespace Asa.RFID
/// </summary> /// </summary>
HaoBin HaoBin
} }
public enum ReadMode
{
Client,
Server
}
} }
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Asa.RFID.ReadAll.xml</DocumentationFile> <DocumentationFile>
</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -31,6 +32,9 @@ ...@@ -31,6 +32,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
...@@ -48,9 +52,9 @@ ...@@ -48,9 +52,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Client.cs" /> <Compile Include="Client.cs" />
<Compile Include="Device.cs" />
<Compile Include="ReadAll.cs" /> <Compile Include="ReadAll.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Type.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
......
C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\Asa.RFID.HaoBin.xml C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\Asa.RFID.HaoBin.xml
C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\Asa.RFID.HaoBin.dll C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\Asa.RFID.HaoBin.dll
C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\Asa.RFID.HaoBin.pdb C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\Asa.RFID.HaoBin.pdb
C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\RFID_HaoBin.csprojAssemblyReference.cache
C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\RFID_HaoBin.csproj.CoreCompileInputs.cache C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\RFID_HaoBin.csproj.CoreCompileInputs.cache
C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\Asa.RFID.HaoBin.dll C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\Asa.RFID.HaoBin.dll
C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\Asa.RFID.HaoBin.pdb C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\Asa.RFID.HaoBin.pdb
C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\HFReader9CSharp.dll C:\Neotel\Program\RFID\RFID_HaoBin\bin\Debug\HFReader9CSharp.dll
C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\RFID_HaoBin.csproj.CopyComplete C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\RFID_HaoBin.csproj.CopyComplete
C:\Neotel\Program\RFID\RFID_HaoBin\obj\Debug\RFID_HaoBin.csproj.AssemblyReference.cache
...@@ -4,7 +4,6 @@ C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\RFID_Debug.pdb ...@@ -4,7 +4,6 @@ C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\RFID_Debug.pdb
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\Asa.RFID.HaoBin.dll C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\Asa.RFID.HaoBin.dll
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\Asa.RFID.HaoBin.pdb C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\Asa.RFID.HaoBin.pdb
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\Asa.RFID.HaoBin.xml C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\Asa.RFID.HaoBin.xml
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_HaoBin_Debug.csprojAssemblyReference.cache
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\Asa.RFID.FrmMain.resources C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\Asa.RFID.FrmMain.resources
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\Asa.RFID.Properties.Resources.resources C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\Asa.RFID.Properties.Resources.resources
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_HaoBin_Debug.csproj.GenerateResource.cache C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_HaoBin_Debug.csproj.GenerateResource.cache
...@@ -13,3 +12,4 @@ C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_HaoBin_Debug.csproj.Copy ...@@ -13,3 +12,4 @@ C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_HaoBin_Debug.csproj.Copy
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_Debug.exe C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_Debug.exe
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_Debug.pdb C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_Debug.pdb
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\HFReader9CSharp.dll C:\Neotel\Program\RFID\RFID_HaoBin_Debug\bin\Debug\HFReader9CSharp.dll
C:\Neotel\Program\RFID\RFID_HaoBin_Debug\obj\Debug\RFID_HaoBin_Debug.csproj.AssemblyReference.cache
...@@ -128,9 +128,9 @@ namespace Asa.RFID ...@@ -128,9 +128,9 @@ namespace Asa.RFID
public void Init() public void Init()
{ {
_dataMode = false; _dataMode = false;
//设备地址1,波特率,禁止AFI,盘点超时时间(20*5ms),命令触发,操作模式,寄存器地址,寄存器数量,触发时间(10*5ms),输出格式,数据帧枕头,记录保持时间(9*5ms) //设备地址1,波特率,禁止AFI,盘点超时时间(100*5ms),命令触发,操作模式,寄存器地址,寄存器数量,触发时间(10*5ms),输出格式,数据帧枕头,记录保持时间(9*5ms)
short[] address = new short[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; short[] address = new short[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
short[] value = new short[] { 1, 2, 0, 20, 1, 1, 0x20, 4, 10, 1, 0x1234, 9 }; short[] value = new short[] { 1, 2, 0, 100, 1, 1, 0x20, 4, 20, 1, 0x1234, 19 };
for (int i = 0; i < address.Length; i++) for (int i = 0; i < address.Length; i++)
{ {
Write(address[i], value[i]); Write(address[i], value[i]);
......
...@@ -12,7 +12,7 @@ namespace Test ...@@ -12,7 +12,7 @@ namespace Test
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
private Asa.RFID.ReadAll read; //private Asa.RFID.ReadAll read;
public Form1() public Form1()
{ {
...@@ -21,21 +21,15 @@ namespace Test ...@@ -21,21 +21,15 @@ namespace Test
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
read = new Asa.RFID.ReadAll("log"); //read = new Asa.RFID.ReadAll("log");
read.Type = Asa.RFID.DeviceType.HaoBin; //read.Type = Asa.RFID.DeviceType.HaoBin;
read.Received += Read_Received; //read.Received += Read_Received;
read.Start(); //read.Start();
}
private void Read_Received(string ip, string id)
{
string s = string.Format("{0}: {1}\r\n", ip, id);
Invoke(new Action(() => { textBox1.AppendText(s); }));
} }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{ {
read.Stop(); //read.Stop();
} }
} }
} }
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!