Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e45fc0ce
由
LN
编写于
2020-01-13 13:51:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
agvClint修改
1 个父辈
dec60dc4
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
64 行增加
和
18 行删除
dll/Client.dll
source/AssemblyLineClient/App.config
source/AssemblyLineClient/AssemblyLineClient.csproj
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
dll/Client.dll
查看文件 @
e45fc0c
此文件类型无法预览
source/AssemblyLineClient/App.config
查看文件 @
e45fc0c
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
<
add
key
=
"DebugDeviceId"
value
=
"301"
/>
<
add
key
=
"DebugDeviceId"
value
=
"301"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"1"
/>
<
add
key
=
"CodeCount"
value
=
"1"
/>
<
add
key
=
"CodeCount"
value
=
"1"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"9"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"9"
/>
</
appSettings
>
</
appSettings
>
...
...
source/AssemblyLineClient/AssemblyLineClient.csproj
查看文件 @
e45fc0c
...
@@ -55,9 +55,6 @@
...
@@ -55,9 +55,6 @@
</PropertyGroup>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<ItemGroup>
<ItemGroup>
<Reference Include="Client">
<HintPath>..\..\..\RC1250-ACPackingStore\dll\Client.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
</Reference>
...
...
source/Common/Setting_Init.cs
查看文件 @
e45fc0c
...
@@ -11,6 +11,7 @@ namespace OnlineStore.Common
...
@@ -11,6 +11,7 @@ namespace OnlineStore.Common
/// </summary>
/// </summary>
public
class
Setting_Init
public
class
Setting_Init
{
{
public
static
string
Agv_Log_Open
=
"Agv_Log_Open"
;
public
static
string
Server_Log_Open
=
"Server_Log_Open"
;
public
static
string
Server_Log_Open
=
"Server_Log_Open"
;
/// <summary>
/// <summary>
/// 系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要
/// 系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
e45fc0c
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<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="Client, Version=1.0.0.
0
, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Client, Version=1.0.0.
1
, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\Client.dll</HintPath>
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
</Reference>
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
e45fc0c
...
@@ -44,11 +44,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -44,11 +44,14 @@ namespace OnlineStore.DeviceLibrary
private
static
void
AgvClient_Ready
(
string
id
,
byte
[]
content
)
private
static
void
AgvClient_Ready
(
string
id
,
byte
[]
content
)
{
{
FeedingEquip
equip
=
getFeedEquip
(
id
);
UpdateAction
(
id
,
AGVAction
.
Ready
);
RFIDData
data
=
new
RFIDData
(
content
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
if
(
equip
==
null
)
{
{
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()+
"] 未找到对应的设备
"
);
LogUtil
.
error
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()+
"] 未找到对应的设备 ,暂不处理
"
);
return
;
return
;
}
}
equip
.
AgvReady
(
id
,
data
);
equip
.
AgvReady
(
id
,
data
);
...
@@ -56,23 +59,42 @@ namespace OnlineStore.DeviceLibrary
...
@@ -56,23 +59,42 @@ namespace OnlineStore.DeviceLibrary
private
static
void
AgvClient_CanEnter
(
string
id
,
byte
[]
content
)
private
static
void
AgvClient_CanEnter
(
string
id
,
byte
[]
content
)
{
{
FeedingEquip
equip
=
getFeedEquip
(
id
);
UpdateAction
(
id
,
AGVAction
.
CanEnter
);
RFIDData
data
=
new
RFIDData
(
content
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_CanEnter ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
if
(
equip
==
null
)
{
{
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备 "
);
string
okName
=
""
;
foreach
(
FeedingEquip
feed
in
LineManager
.
Line
.
FeedingEquipMap
.
Values
)
{
if
(
id
.
Contains
(
feed
.
Config
.
AgvInName
))
{
if
(
feed
.
AgvCanEnter
(
id
,
data
))
{
okName
+=
feed
.
Config
.
AgvInName
;
}
}
}
agvClient
.
IsEnter
(
okName
);
return
;
return
;
}
}
equip
.
AgvCanEnter
(
id
,
data
);
else
{
bool
result
=
equip
.
AgvCanEnter
(
id
,
data
);
agvClient
.
IsEnter
(
equip
.
Config
.
AgvInName
);
}
}
}
private
static
void
AgvClient_Arrive
(
string
id
,
byte
[]
content
)
private
static
void
AgvClient_Arrive
(
string
id
,
byte
[]
content
)
{
{
FeedingEquip
equip
=
getFeedEquip
(
id
);
UpdateAction
(
id
,
AGVAction
.
Arrive
);
RFIDData
data
=
new
RFIDData
(
content
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
if
(
equip
==
null
)
{
{
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备
"
);
LogUtil
.
error
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备 ,暂不处理
"
);
return
;
return
;
}
}
equip
.
AgvArrive
(
id
,
data
);
equip
.
AgvArrive
(
id
,
data
);
...
@@ -124,14 +146,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -124,14 +146,21 @@ namespace OnlineStore.DeviceLibrary
{
{
agvClient
.
MayLeave
(
NodeName
);
agvClient
.
MayLeave
(
NodeName
);
}
}
internal
static
void
IsEnter
(
string
NodeName
,
bool
result
)
{
agvClient
.
IsEnter
(
NodeName
,
result
);
}
private
static
void
AgvClient_Log
(
string
s
)
private
static
void
AgvClient_Log
(
string
s
)
{
{
try
{
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
if
(
isLog
)
{
LogUtil
.
info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
LogUtil
.
info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AgvClient_Log 出错:"
+
ex
.
ToString
());
}
}
public
static
string
GetAction
(
string
NodeName
)
public
static
string
GetAction
(
string
NodeName
)
{
{
...
@@ -141,6 +170,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -141,6 +170,17 @@ namespace OnlineStore.DeviceLibrary
}
}
return
AGVAction
.
None
;
return
AGVAction
.
None
;
}
}
public
static
void
UpdateAction
(
string
name
,
string
action
)
{
if
(
actionMap
.
ContainsKey
(
name
))
{
actionMap
[
name
]
=
action
;
}
else
{
actionMap
.
Add
(
name
,
action
);
}
}
public
static
void
Dispose
()
public
static
void
Dispose
()
{
{
try
try
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
e45fc0c
...
@@ -569,17 +569,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -569,17 +569,24 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
AGV
#
region
AGV
internal
void
AgvCanEnter
(
string
nodeId
,
RFIDData
data
)
internal
bool
AgvCanEnter
(
string
nodeId
,
RFIDData
data
)
{
{
string
logN
=
Name
+
"收到 AgvCanEnter 事件 ["
+
nodeId
+
"] ["
+
data
.
ToData
()
+
"] "
;
string
logN
=
Name
+
"收到 AgvCanEnter 事件 ["
+
nodeId
+
"] ["
+
data
.
ToData
()
+
"] "
;
bool
usable
=
false
;
bool
usable
=
false
;
if
(
nodeId
.
Equals
(
Config
.
AgvInName
))
if
(
nodeId
.
Equals
(
Config
.
AgvInName
))
{
{
if
(
isInSuddenDown
||
isNoAirCheck
)
{
usable
=
false
;
}
else
{
//入料口无料架即可进入
//入料口无料架即可进入
usable
=
(
runStatus
>=
LineRunStatus
.
Runing
usable
=
(
runStatus
>=
LineRunStatus
.
Runing
&&
ProcessShelfEnter
.
Equals
(
false
)
&&
ProcessShelfEnter
.
Equals
(
false
)
&&
IOValue
(
IO_Type
.
SL_Entry_Check
).
Equals
(
IO_VALUE
.
LOW
));
&&
IOValue
(
IO_Type
.
SL_Entry_Check
).
Equals
(
IO_VALUE
.
LOW
));
}
}
}
else
if
(
nodeId
.
Equals
(
Config
.
AgvOutName
))
else
if
(
nodeId
.
Equals
(
Config
.
AgvOutName
))
{
{
//出口有料架才可以进入
//出口有料架才可以进入
...
@@ -588,7 +595,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -588,7 +595,7 @@ namespace OnlineStore.DeviceLibrary
&&
IOValue
(
IO_Type
.
SL_Out_Check
).
Equals
(
IO_VALUE
.
HIGH
));
&&
IOValue
(
IO_Type
.
SL_Out_Check
).
Equals
(
IO_VALUE
.
HIGH
));
}
}
LogUtil
.
info
(
logN
+
":"
+
usable
);
LogUtil
.
info
(
logN
+
":"
+
usable
);
AgvClient
.
IsEnter
(
nodeId
,
usable
)
;
return
usable
;
}
}
internal
void
AgvArrive
(
string
nodeId
,
RFIDData
data
)
internal
void
AgvArrive
(
string
nodeId
,
RFIDData
data
)
...
@@ -652,7 +659,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -652,7 +659,7 @@ namespace OnlineStore.DeviceLibrary
//{
//{
// return AgvClient.GetAction(Config.AgvOutName).Equals(AGVAction.);
// return AgvClient.GetAction(Config.AgvOutName).Equals(AGVAction.);
//}, "等待AGV收到料架");
//}, "等待AGV收到料架");
AgvClient
.
MayLeave
(
Config
.
AgvOutName
);
//
AgvClient.MayLeave(Config.AgvOutName);
//停止转动 ,阻挡上升
//停止转动 ,阻挡上升
IOMove
(
IO_Type
.
SL_OutLine_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_OutLine_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论