Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-VMILineClient
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 92c43c5a
由
张东亮
编写于
2021-01-07 09:27:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
init
1 个父辈
82f8c8fa
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
63 行增加
和
33 行删除
RC1250-VMILineClient.sln → VMILineClient-3D.sln
dll/Asa.RFID.HiStation.dll
dll/Asa.RFID.IReadAll.dll
dll/Asa.RFID.dll
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/RFIDManager.cs
source/VMILineClient/App.config
RC1250-VMILineClient
.sln
→
VMILineClient-3D
.sln
查看文件 @
92c43c5
文件被删除
dll/Asa.RFID.HiStation.dll
0 → 100644
查看文件 @
92c43c5
此文件类型无法预览
dll/Asa.RFID.IReadAll.dll
0 → 100644
查看文件 @
92c43c5
此文件类型无法预览
dll/Asa.RFID.dll
deleted
100644 → 0
查看文件 @
82f8c8f
此文件类型无法预览
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
92c43c5
...
...
@@ -39,18 +39,15 @@
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID">
<HintPath>..\..\dll\Asa.RFID.dll</HintPath>
<Reference Include="Asa.RFID.HiStation">
<HintPath>..\..\dll\Asa.RFID.HiStation.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID.IReadAll">
<HintPath>..\..\dll\Asa.RFID.IReadAll.dll</HintPath>
</Reference>
<Reference Include="Client">
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="halcondotnet">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="HFReader9CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\RFID\HFReader9CSharp.dll</HintPath>
...
...
source/DeviceLibrary/RFIDManager.cs
查看文件 @
92c43c5
...
...
@@ -5,16 +5,23 @@ using System.Collections.Concurrent;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
RFIDManager
{
private
static
ReadAll
readAll
=
new
ReadAll
(
"TheRFID"
)
;
private
static
Asa
.
RFID
.
ReadAll
read
;
private
static
bool
IsOpen
=
false
;
// private static ConcurrentDictionary<string, string> LastRfidMap = new ConcurrentDictionary<string, string>();
public
static
void
Open
(
string
[]
iparray
)
public
static
bool
IsAuto
=
false
;
/// <summary>
/// 是否连接
/// </summary>
public
static
bool
IsConnected
{
get
;
set
;
}
=
false
;
private
static
Dictionary
<
string
,
string
>
LastRfidMap
=
new
Dictionary
<
string
,
string
>();
public
static
void
Open
(
string
[]
ip
)
{
if
(
IsOpen
)
{
...
...
@@ -22,15 +29,9 @@ namespace OnlineStore.DeviceLibrary
}
try
{
int
port
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
RfidServer_Port
);
if
(
port
<=
0
)
{
port
=
13001
;
}
// readAll.Received += ReadAll_Received;
// readAll.Log += ReadAll_Log;
LogUtil
.
info
(
"RFID Server Open,port="
+
port
);
readAll
.
Start
(
port
);
read
=
new
ReadAll
(
"TheRFID"
);
read
.
Received
+=
Read_Received
;
read
.
Start
(
13001
);
IsOpen
=
true
;
}
catch
(
Exception
ex
)
...
...
@@ -39,7 +40,27 @@ namespace OnlineStore.DeviceLibrary
}
}
private
static
string
lastStr
=
""
;
private
static
void
Read_Received
(
string
ip
,
string
id
)
{
try
{
if
(
LastRfidMap
.
ContainsKey
(
ip
))
{
LastRfidMap
[
ip
]
=
id
;
}
else
{
LastRfidMap
.
Add
(
ip
,
id
);
}
}
catch
(
ObjectDisposedException
ex
)
{
//程序刚退出,又回传数据
}
}
private
static
void
ReadAll_Log
(
string
ip
,
string
log
)
{
string
str
=
"RFID : ["
+
ip
+
"] "
+
log
;
...
...
@@ -51,20 +72,21 @@ namespace OnlineStore.DeviceLibrary
lastStr
=
str
;
}
public
static
RFIDData
ReadRFID
(
string
ip
,
bool
isClear
=
fals
e
)
public
static
RFIDData
ReadRFID
(
string
ip
,
bool
isClear
=
tru
e
)
{
try
{
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
))
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
)
&&
read
!=
null
)
{
string
outValue
=
readAll
.
Read
(
ip
);
if
(
isClear
)
{
read
All
.
Clear
(
ip
);
read
.
Clear
(
ip
);
}
Thread
.
Sleep
(
100
);
string
outValue
=
read
.
Read
(
ip
);
RFIDData
data
=
new
RFIDData
(
outValue
);
return
data
;
}
}
...
...
@@ -80,10 +102,15 @@ namespace OnlineStore.DeviceLibrary
{
try
{
readAll
.
Stop
();
if
(
IsOpen
)
{
read
.
Stop
();
IsOpen
=
false
;
}
}
catch
(
Exception
ex
)
{
IsOpen
=
false
;
LogUtil
.
error
(
"关闭RFID出错:"
+
ex
.
ToString
());
}
}
...
...
source/VMILineClient/App.config
查看文件 @
92c43c5
...
...
@@ -8,7 +8,7 @@
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"VMI总仓进出料架缓存线"
/>
<!--
Server
address
-->
<
add
key
=
"http.server"
value
=
"http://10.85.16
0.25
/myproject/"
/>
<
add
key
=
"http.server"
value
=
"http://10.85.16
2.124
/myproject/"
/>
<!--
storeType
-->
<
add
key
=
"store_count"
value
=
"1"
/>
<!--
start
one
store
config
-->
...
...
@@ -19,7 +19,7 @@
<
add
key
=
"DIMS"
value
=
"60"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
<!--
AGV
调度服务器地址-->
<
add
key
=
"AgvServerIp"
value
=
"1
92.168.103.12
"
/>
<
add
key
=
"AgvServerIp"
value
=
"1
0.85.162.40
"
/>
<!--是否调试状态-->
<
add
key
=
"IsInDebug"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"1"
/>
...
...
@@ -29,8 +29,11 @@
<
file
type
=
"log4net.Util.PatternString"
value
=
"logs/vmiLine.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"10"
/>
<!-- 切割最多文件数 -->
<
param
name
=
"MaximumFileSize"
value
=
"100MB"
/>
<!-- 每个文件的大小 -->
<
param
name
=
"RollingStyle"
value
=
"Size"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
...
...
@@ -39,8 +42,11 @@
<
file
value
=
"logs/TheRFID-vmi.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
param
name
=
"MaxSizeRollBackups"
value
=
"10"
/>
<!-- 切割最多文件数 -->
<
param
name
=
"MaximumFileSize"
value
=
"100MB"
/>
<!-- 每个文件的大小 -->
<
param
name
=
"RollingStyle"
value
=
"Size"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论