Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a8f58955
由
LN
编写于
2020-01-16 09:56:21 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
becdfb76
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
87 行增加
和
6 行删除
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/deviceLibrary/RFID/RFID.cs → source/DeviceLibrary/deviceLibrary/RFID/RFIDAuto.cs
source/DeviceLibrary/deviceLibrary/RFID/RFIDAutoReader.cs
source/DeviceLibrary/deviceLibrary/RFID/RFIDReader.cs
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
a8f5895
...
...
@@ -96,7 +96,8 @@
<Compile Include="deviceLibrary\PanasonicServo\ACServerManager.cs" />
<Compile Include="deviceLibrary\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="assemblyLine\EquipBase.cs" />
<Compile Include="deviceLibrary\RFID\RFID.cs" />
<Compile Include="deviceLibrary\RFID\RFIDAuto.cs" />
<Compile Include="deviceLibrary\RFID\RFIDReader.cs" />
<Compile Include="deviceLibrary\RFID\RFIDAutoReader.cs" />
<Compile Include="model\LineAlarm.cs">
<SubType>Code</SubType>
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFID.cs
→
source/DeviceLibrary/deviceLibrary/RFID/RFID
Auto
.cs
查看文件 @
a8f5895
...
...
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace
Asa.RFID
{
public
class
RFID
public
class
RFID
Auto
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"TheRFID"
);
...
...
@@ -29,7 +29,7 @@ namespace Asa.RFID
/// </summary>
public
event
Received_Event
Received
;
public
RFID
(
string
ip
)
public
RFID
Auto
(
string
ip
)
{
this
.
IP
=
ip
;
}
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFIDAutoReader.cs
查看文件 @
a8f5895
...
...
@@ -4,7 +4,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
static
Asa
.
RFID
.
RFID
;
using
static
Asa
.
RFID
.
RFID
Auto
;
namespace
Asa.RFID
{
...
...
@@ -12,7 +12,7 @@ namespace Asa.RFID
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"TheRFID"
);
private
static
Dictionary
<
string
,
RFID
>
rfidMap
=
new
Dictionary
<
string
,
RFID
>();
private
static
Dictionary
<
string
,
RFID
Auto
>
rfidMap
=
new
Dictionary
<
string
,
RFIDAuto
>();
/// <summary>
/// 打开所有
...
...
@@ -30,7 +30,7 @@ namespace Asa.RFID
}
else
{
RFID
rfid
=
new
RFID
(
ip
);
RFID
Auto
rfid
=
new
RFIDAuto
(
ip
);
rfid
.
StartAutoScan
(
OnReceive
);
rfidMap
.
Add
(
ip
,
rfid
);
}
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFIDReader.cs
0 → 100644
查看文件 @
a8f5895
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
static
Asa
.
RFID
.
RFIDAuto
;
namespace
Asa.RFID
{
public
class
RFIDReader
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"TheRFID"
);
private
static
Dictionary
<
string
,
RFIDAuto
>
rfidMap
=
new
Dictionary
<
string
,
RFIDAuto
>();
/// <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
{
RFIDAuto
rfid
=
new
RFIDAuto
(
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
请
注册
或
登录
后发表评论