Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1de1acb1
由
LN
编写于
2020-01-02 17:56:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
4d18eddc
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
67 行增加
和
34 行删除
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
source/DeviceLibrary/deviceLibrary/RFID/RFID.cs
source/DeviceLibrary/deviceLibrary/RFID/RFIDReader.cs
source/DeviceLibrary/model/TrayInfo.cs
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
1de1acb
...
@@ -39,10 +39,6 @@
...
@@ -39,10 +39,6 @@
<Reference Include="Asa.IOModule.AIOBOX">
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
</Reference>
<Reference Include="Asa.RFID, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath>
</Reference>
<Reference Include="Client">
<Reference Include="Client">
<HintPath>..\..\dll\Client.dll</HintPath>
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
</Reference>
...
@@ -52,6 +48,10 @@
...
@@ -52,6 +48,10 @@
<Reference Include="halcondotnet">
<Reference Include="halcondotnet">
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
<HintPath>..\..\dll\halcondotnet.dll</HintPath>
</Reference>
</Reference>
<Reference Include="HFReader9CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<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>
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
1de1acb
...
@@ -1040,7 +1040,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1040,7 +1040,7 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
NeedSaveParam
&&
LineManager
.
Line
.
runStatus
>=
LineRunStatus
.
HomeMoving
&&
LineManager
.
Line
.
CanProcessLine
())
if
(
NeedSaveParam
&&
LineManager
.
Line
.
runStatus
>=
LineRunStatus
.
HomeMoving
&&
LineManager
.
Line
.
CanProcessLine
())
{
{
Log
Info
(
" 【"
+
info
.
ToStr
()
+
"】不需要出入库"
);
Log
Util
.
debug
(
" 【"
+
info
.
ToStr
()
+
"】不需要出入库"
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
1de1acb
...
@@ -203,8 +203,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -203,8 +203,11 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
TopCylinder_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
TopCylinder_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_After
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_After
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpDownCylinder_Up
,
IO_VALUE
.
LOW
);
if
(
UseAxis
.
Equals
(
false
))
IOMove
(
IO_Type
.
UpDownCylinder_Down
,
IO_VALUE
.
LOW
);
{
IOMove
(
IO_Type
.
UpDownCylinder_Up
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpDownCylinder_Down
,
IO_VALUE
.
LOW
);
}
IOMove
(
IO_Type
.
ClampCylinder_Slack
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
ClampCylinder_Slack
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
ClampCylinder_Tighten
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
ClampCylinder_Tighten
,
IO_VALUE
.
LOW
);
runStatus
=
LineRunStatus
.
Wait
;
runStatus
=
LineRunStatus
.
Wait
;
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
查看文件 @
1de1acb
...
@@ -184,8 +184,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -184,8 +184,11 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
TopCylinder_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
TopCylinder_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_After
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
BeforeAfterCylinder_After
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpDownCylinder_Up
,
IO_VALUE
.
LOW
);
if
(
UseAxis
.
Equals
(
false
))
IOMove
(
IO_Type
.
UpDownCylinder_Down
,
IO_VALUE
.
LOW
);
{
IOMove
(
IO_Type
.
UpDownCylinder_Up
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpDownCylinder_Down
,
IO_VALUE
.
LOW
);
}
IOMove
(
IO_Type
.
ClampCylinder_Slack
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
ClampCylinder_Slack
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
ClampCylinder_Tighten
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
ClampCylinder_Tighten
,
IO_VALUE
.
LOW
);
runStatus
=
LineRunStatus
.
Wait
;
runStatus
=
LineRunStatus
.
Wait
;
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
1de1acb
...
@@ -245,7 +245,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -245,7 +245,14 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
MO_14_TopCylinder_Down
();
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
CheckLog
(
"放托盘(放开阻挡)"
+
MoveInfo
.
SLog
+
" 托盘 【"
+
currTrayNum
+
"】直接放行"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_14_TopCylinder_Down
);
if
(
Config
.
SidesWayNum
<=
0
)
{
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
}
//MO_14_TopCylinder_Down();
}
}
}
}
else
else
...
...
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
查看文件 @
1de1acb
...
@@ -13,19 +13,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -13,19 +13,19 @@ namespace OnlineStore.DeviceLibrary
{
{
public
class
RFIDManager
public
class
RFIDManager
{
{
public
static
Asa
.
RFID
.
ReaderAll
RfidReader
=
new
ReaderAll
();
// public static Asa.RFID.RFIDReader RfidReader = new RFIDReader
();
private
static
int
DefaultTrayNum
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultTrayNum
);
private
static
int
DefaultTrayNum
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultTrayNum
);
static
RFIDManager
()
static
RFIDManager
()
{
{
RfidReader
.
GetValue
+=
RfidReader_GetValue
;
//
RfidReader.GetValue += RfidReader_GetValue;
}
}
public
static
void
Open
(
string
[]
iparray
)
public
static
void
Open
(
string
[]
iparray
)
{
{
string
path
=
Application
.
StartupPath
+
@"\logs\rfid\"
;
string
path
=
Application
.
StartupPath
+
@"\logs\rfid\"
;
RFIDManager
.
RfidReader
.
LogPath
=
path
;
//
RFIDManager.RfidReader.LogPath = path;
// string[] rfidArray = rfidList.ToArray();
// string[] rfidArray = rfidList.ToArray();
//连接rfip
//连接rfip
RFID
Manager
.
RfidReader
.
Open
(
iparray
);
RFID
Reader
.
Open
(
null
,
iparray
);
}
}
private
static
void
RfidReader_GetValue
(
string
s
)
private
static
void
RfidReader_GetValue
(
string
s
)
...
@@ -95,16 +95,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -95,16 +95,25 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
)
&&
LineManager
.
Line
.
rfidList
.
Contains
(
ip
))
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
)
&&
LineManager
.
Line
.
rfidList
.
Contains
(
ip
))
{
{
byte
[]
bdata
=
RfidReader
.
Read
(
ip
);
byte
[]
bdata
=
null
;
if
(
isClear
)
{
bdata
=
RFIDReader
.
ReadAndClear
(
ip
);
}
else
{
bdata
=
RFIDReader
.
Read
(
ip
);
}
if
(
bdata
==
null
)
if
(
bdata
==
null
)
{
{
LogUtil
.
error
(
"RFID [ "
+
ip
+
" ] 读到数据=null"
);
LogUtil
.
error
(
"RFID [ "
+
ip
+
" ] 读到数据=null"
);
}
}
RFIDData
data
=
new
RFIDData
(
bdata
);
RFIDData
data
=
new
RFIDData
(
bdata
);
if
(
isClear
)
//
if (isClear)
{
//
{
Rfid
Reader
.
Clear
(
ip
);
// RFID
Reader.Clear(ip);
}
//
}
return
data
;
return
data
;
}
}
}
}
...
@@ -134,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -134,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
R
fidReader
.
Close
();
R
FIDReader
.
CloseAll
();
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"关闭RFID出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"关闭RFID出错:"
+
ex
.
ToString
());
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFID.cs
查看文件 @
1de1acb
...
@@ -9,7 +9,7 @@ namespace Asa.RFID
...
@@ -9,7 +9,7 @@ namespace Asa.RFID
{
{
public
class
RFID
public
class
RFID
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"
TheRFID
"
);
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"
RollingLogFileAppender
"
);
private
string
IP
=
""
;
private
string
IP
=
""
;
private
byte
addr
;
private
byte
addr
;
...
@@ -35,10 +35,21 @@ namespace Asa.RFID
...
@@ -35,10 +35,21 @@ namespace Asa.RFID
public
int
StopAutoScan
()
public
int
StopAutoScan
()
{
{
LOGGER
.
Info
(
"Close RFID ["
+
IP
+
"]"
);
try
IsConnect
=
false
;
{
byte
scanMode
=
0
;
IsConnect
=
false
;
return
SetAutoScanMode
(
addr
,
scanMode
);
byte
scanMode
=
0
;
int
ErrCode
=
SetAutoScanMode
(
addr
,
scanMode
);
LOGGER
.
Info
(
"Close RFID ["
+
IP
+
"] ScanMode:"
+
ErrCode
);
ErrCode
=
ReaderA
.
StaticClassReaderA
.
CloseNetPort
(
portIndex
);
LOGGER
.
Info
(
"Close RFID ["
+
IP
+
"]:"
+
ErrCode
);
return
ErrCode
;
}
catch
(
Exception
e
)
{
LOGGER
.
Error
(
"Close RFID["
+
IP
+
"] has error"
,
e
);
}
return
-
1
;
}
}
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFIDReader.cs
查看文件 @
1de1acb
...
@@ -10,9 +10,9 @@ namespace Asa.RFID
...
@@ -10,9 +10,9 @@ namespace Asa.RFID
{
{
public
class
RFIDReader
public
class
RFIDReader
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"
TheRFID
"
);
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
"
RollingLogFileAppender
"
);
private
Dictionary
<
string
,
RFID
>
rfidMap
=
new
Dictionary
<
string
,
RFID
>();
private
static
Dictionary
<
string
,
RFID
>
rfidMap
=
new
Dictionary
<
string
,
RFID
>();
/// <summary>
/// <summary>
/// 打开所有
/// 打开所有
...
@@ -20,13 +20,13 @@ namespace Asa.RFID
...
@@ -20,13 +20,13 @@ namespace Asa.RFID
/// <param name="ipArr"></param>
/// <param name="ipArr"></param>
/// <param name="OnReceive"></param>
/// <param name="OnReceive"></param>
/// <param name="ip"></param>
/// <param name="ip"></param>
public
void
Open
(
Received_Event
OnReceive
,
params
string
[]
ipArr
)
public
static
void
Open
(
Received_Event
OnReceive
,
params
string
[]
ipArr
)
{
{
foreach
(
var
ip
in
ipArr
)
foreach
(
var
ip
in
ipArr
)
{
{
if
(
rfidMap
.
ContainsKey
(
ip
))
if
(
rfidMap
.
ContainsKey
(
ip
))
{
{
rfidMap
[
ip
].
St
op
AutoScan
(
OnReceive
);
rfidMap
[
ip
].
St
art
AutoScan
(
OnReceive
);
}
}
else
else
{
{
...
@@ -42,7 +42,7 @@ namespace Asa.RFID
...
@@ -42,7 +42,7 @@ namespace Asa.RFID
/// </summary>
/// </summary>
/// <param name="ip"></param>
/// <param name="ip"></param>
/// <returns></returns>
/// <returns></returns>
public
byte
[]
ReadAndClear
(
string
ip
)
public
static
byte
[]
ReadAndClear
(
string
ip
)
{
{
if
(
rfidMap
.
ContainsKey
(
ip
))
if
(
rfidMap
.
ContainsKey
(
ip
))
{
{
...
@@ -56,7 +56,7 @@ namespace Asa.RFID
...
@@ -56,7 +56,7 @@ namespace Asa.RFID
/// </summary>
/// </summary>
/// <param name="ip"></param>
/// <param name="ip"></param>
/// <returns></returns>
/// <returns></returns>
public
byte
[]
Read
(
string
ip
)
public
static
byte
[]
Read
(
string
ip
)
{
{
if
(
rfidMap
.
ContainsKey
(
ip
))
if
(
rfidMap
.
ContainsKey
(
ip
))
{
{
...
@@ -64,12 +64,12 @@ namespace Asa.RFID
...
@@ -64,12 +64,12 @@ namespace Asa.RFID
}
}
return
null
;
return
null
;
}
}
/// <summary>
/// <summary>
/// 关闭所有
/// 关闭所有
/// </summary>
/// </summary>
public
void
CloseAll
()
public
static
void
CloseAll
()
{
{
foreach
(
var
rfid
in
rfidMap
.
Values
)
foreach
(
var
rfid
in
rfidMap
.
Values
)
{
{
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
1de1acb
...
@@ -39,7 +39,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -39,7 +39,7 @@ namespace OnlineStore.DeviceLibrary
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
return
"托盘 ["
+
TrayCode
+
"] ["
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
LastUpdateTime
)
+
"] ["
+
(
IsFull
?
"有料"
:
"空"
)
+
"] ["
+
type
+
"]"
;
return
"托盘 ["
+
TrayCode
+
"] ["
+
LastUpdateTime
.
ToLongTimeString
(
)
+
"] ["
+
(
IsFull
?
"有料"
:
"空"
)
+
"] ["
+
type
+
"]"
;
}
}
/// <summary>
/// <summary>
/// 夹具编码值(1-32?)
/// 夹具编码值(1-32?)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论