Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c4e81548
由
LN
编写于
2020-01-11 20:39:38 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
rfid修改
1 个父辈
ae9b7319
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
85 行增加
和
3 行删除
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/device/RFID/RFID.cs
source/DeviceLibrary/device/RFID/RFIDReader.cs
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
c4e8154
...
@@ -48,13 +48,13 @@
...
@@ -48,13 +48,13 @@
<Reference Include="halcondotnet">
<Reference Include="halcondotnet">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath>
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath>
</Reference>
</Reference>
<Reference Include="HFReader9CSharp">
<HintPath>..\..\dll\RFID\HFReader9CSharp.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath>
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="RFIDLibrary">
<HintPath>..\..\dll\RFID\RFIDLibrary.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing" />
...
@@ -82,7 +82,9 @@
...
@@ -82,7 +82,9 @@
<Compile Include="device\PanasonicServo\ACCMDManager.cs" />
<Compile Include="device\PanasonicServo\ACCMDManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="device\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="device\RFID\RFID.cs" />
<Compile Include="device\RFID\RFIDManager.cs" />
<Compile Include="device\RFID\RFIDManager.cs" />
<Compile Include="device\RFID\RFIDReader.cs" />
<Compile Include="store\AutoInoutInfo.cs" />
<Compile Include="store\AutoInoutInfo.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<Compile Include="store\LineAlarm.cs">
...
...
source/DeviceLibrary/device/RFID/RFID.cs
0 → 100644
查看文件 @
c4e8154
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/device/RFID/RFIDReader.cs
0 → 100644
查看文件 @
c4e8154
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
static
Asa
.
RFID
.
RFID
;
namespace
Asa.RFID
{
public
class
RFIDReader
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"TheRFID"
);
private
static
Dictionary
<
string
,
RFID
>
rfidMap
=
new
Dictionary
<
string
,
RFID
>();
/// <summary>
/// 打开所有
/// </summary>
/// <param name="ipArr"></param>
/// <param name="OnReceive"></param>
/// <param name="ip"></param>
public
static
void
Open
(
Received_Event
OnReceive
,
params
string
[]
ipArr
)
{
foreach
(
var
ip
in
ipArr
)
{
if
(
rfidMap
.
ContainsKey
(
ip
))
{
rfidMap
[
ip
].
StartAutoScan
(
OnReceive
);
}
else
{
RFID
rfid
=
new
RFID
(
ip
);
rfid
.
StartAutoScan
(
OnReceive
);
rfidMap
.
Add
(
ip
,
rfid
);
}
}
}
/// <summary>
/// 获取最后读到的标签并清理
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public
static
byte
[]
ReadAndClear
(
string
ip
)
{
if
(
rfidMap
.
ContainsKey
(
ip
))
{
return
rfidMap
[
ip
].
ReadAndClear
();
}
return
null
;
}
/// <summary>
/// 获取最后读到的标签
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
public
static
byte
[]
Read
(
string
ip
)
{
if
(
rfidMap
.
ContainsKey
(
ip
))
{
return
rfidMap
[
ip
].
Read
();
}
return
null
;
}
/// <summary>
/// 关闭所有
/// </summary>
public
static
void
CloseAll
()
{
foreach
(
var
rfid
in
rfidMap
.
Values
)
{
rfid
.
StopAutoScan
();
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论