Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b8bc7b17
由
LN
编写于
2020-02-28 14:06:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出料料架修改,增加 realRfid ,表示真实的料架号
1 个父辈
e404a5c7
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
86 行增加
和
20 行删除
dll/Client.dll
dll/Client.xml
source/ACPackingStore/FrmStore.cs
source/ACPackingStore/记录.txt
source/Common/bean/Bean.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/store/InOutParam.cs
dll/Client.dll
查看文件 @
b8bc7b1
此文件类型无法预览
dll/Client.xml
查看文件 @
b8bc7b1
...
...
@@ -273,7 +273,12 @@
</member>
<member
name=
"P:Asa.Client2.SendLog"
>
<summary>
仅发送命令的代码日志
发送命令的日志是否打印,不影响其他日志
</summary>
</member>
<member
name=
"P:Asa.Client2.SendSleep"
>
<summary>
发送命令的时间间隔(单位:秒)
</summary>
</member>
<member
name=
"M:Asa.Client2.Connect"
>
...
...
source/ACPackingStore/FrmStore.cs
查看文件 @
b8bc7b1
...
...
@@ -353,12 +353,17 @@ namespace OnlineStore.ACPackingStore
Process
[]
processes
=
Process
.
GetProcesses
();
long
totalMemery
=
0
;
StringBuilder
sbResult
=
new
StringBuilder
();
int
interval
=
1000
;
var
prevCpuTime
=
TimeSpan
.
Zero
;
foreach
(
Process
process
in
processes
)
{
if
(
process
.
ProcessName
.
EndsWith
(
"ACPackingStore"
))
{
sbResult
.
AppendFormat
(
DateTime
.
Now
.
ToLongTimeString
()
+
", 名称:{0} 内存大小:{1}M "
,
process
.
ProcessName
,
process
.
PrivateMemorySize64
/
1024
/
1024F
);
totalMemery
+=
process
.
PrivateMemorySize64
/
1024
;
double
value
=
(
process
.
TotalProcessorTime
-
prevCpuTime
).
TotalMilliseconds
/
interval
/
Environment
.
ProcessorCount
;
sbResult
.
AppendFormat
(
" CPU : "
+
Math
.
Round
(
value
,
2
)
+
"%"
);
// string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString();
LogUtil
.
info
(
sbResult
.
ToString
());
}
...
...
source/ACPackingStore/记录.txt
查看文件 @
b8bc7b1
...
...
@@ -80,6 +80,8 @@ agv客户端启动时需要设置状态为none。
20200225
出库送料架逻辑修改,出库增加参数:taskCount
20200228
出料料架修改,增加 realRfid ,表示真实的料架号
...
...
source/Common/bean/Bean.cs
查看文件 @
b8bc7b1
...
...
@@ -232,5 +232,9 @@ namespace OnlineStore.Common
///当前料放完,料架已满,也把料架放出去
/// </summary>
public
static
string
taskCount
=
"taskCount"
;
/// <summary>
/// 真实料架号,可能为空
/// </summary>
public
static
string
realRfid
=
"realRfid"
;
}
}
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
b8bc7b1
...
...
@@ -811,7 +811,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_01_DeviceBack
)
{
//判断是否需要送出料架,是否需要进入料架,是否可以直接开始
if
(
CurrShelfID
.
Equals
(
""
))
if
(
MoveInfo
.
MoveParam
.
rfid
.
Equals
(
""
))
{
SO_03_ToBagPosition
();
}
...
...
@@ -827,22 +827,25 @@ namespace OnlineStore.DeviceLibrary
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
IsRightShelfId
(
CurrShelfID
,
MoveInfo
.
MoveParam
.
rfid
))
if
(
IsRightShelfId
(
CurrShelfID
,
MoveInfo
.
MoveParam
.
r
ealR
fid
))
{
LogUtil
.
error
(
"入库,当前料架【"
+
CurrShelfID
+
"】和目标料架【"
+
MoveInfo
.
MoveParam
.
rfid
+
","
+
MoveInfo
.
MoveParam
.
realRfid
+
"】 是同一个料架,开始取料"
);
SO_03_ToBagPosition
();
return
;
}
else
{
LogUtil
.
error
(
"入库,当前料架【"
+
CurrShelfID
+
"】和目标料架【"
+
MoveInfo
.
MoveParam
.
rfid
+
"】不是同一个料架,送出当前料架,稍后重新出库"
);
LogUtil
.
error
(
"入库,当前料架【"
+
CurrShelfID
+
"】和目标料架【"
+
MoveInfo
.
MoveParam
.
rfid
+
"
,"
+
MoveInfo
.
MoveParam
.
realRfid
+
"
】不是同一个料架,送出当前料架,稍后重新出库"
);
//送出料架,并且记录出库信息,等会重新出库
StartShelfOut
();
//重新记录
LogInfo
(
" 执行出库【"
+
MoveInfo
.
MoveParam
.
ToStr
()
+
"】失败,料架号不一致,加入等待队列"
);
waitOutStoreList
.
Enqueue
(
MoveInfo
.
MoveParam
);
return
;
}
}
else
if
(
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
MoveInfo
.
MoveParam
.
NeedEnterShelf
)
||
(!
MoveInfo
.
MoveParam
.
ShelfPosID
.
Equals
(
""
)))
else
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
(!
MoveInfo
.
MoveParam
.
rfid
.
Equals
(
""
)))
{
string
rfid
=
MoveInfo
.
MoveParam
.
rfid
;
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_00_ReadyShelf
);
...
...
@@ -1028,25 +1031,33 @@ namespace OnlineStore.DeviceLibrary
}
}
private
bool
IsRightShelfId
(
string
currShelfID
,
string
rfid
)
private
bool
IsRightShelfId
(
string
currShelfID
,
string
r
ealR
fid
)
{
if
(
String
.
IsNullOrEmpty
(
currShelfID
)
||
String
.
IsNullOrEmpty
(
rfid
)
)
if
(
String
.
IsNullOrEmpty
(
currShelfID
)
)
{
return
tru
e
;
return
fals
e
;
}
string
theTarget
=
rfid
.
Trim
().
PadLeft
(
3
,
'0'
);
string
num
=
theTarget
.
Substring
(
0
,
2
);
string
type
=
theTarget
.
Substring
(
2
,
1
);
if
(
currShelfID
.
Equals
(
type
+
num
))
if
(
String
.
IsNullOrEmpty
(
realRfid
))
{
return
true
;
return
true
;
}
else
if
(
num
.
Equals
(
"00"
))
if
(
currShelfID
.
Equals
(
realRfid
))
{
return
true
;
}
//string theTarget = realRfid.Trim().PadLeft(3, '0');
//string num = theTarget.Substring(0, 2);
//string type = theTarget.Substring(2, 1);
//if (currShelfID.Equals(type + num))
//{
// return true;
//}
//else if (num.Equals("00"))
//{
// return true;
//}
return
false
;
}
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
查看文件 @
b8bc7b1
...
...
@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
...
...
@@ -210,6 +211,35 @@ namespace OnlineStore.DeviceLibrary
}
return
mark
;
}
private
void
LogCPU
()
{
try
{
Process
[]
processes
=
Process
.
GetProcesses
();
long
totalMemery
=
0
;
StringBuilder
sbResult
=
new
StringBuilder
();
int
interval
=
1000
;
var
prevCpuTime
=
TimeSpan
.
Zero
;
foreach
(
Process
process
in
processes
)
{
if
(
process
.
ProcessName
.
EndsWith
(
"ACPackingStore"
))
{
sbResult
.
AppendFormat
(
DateTime
.
Now
.
ToLongTimeString
()
+
Name
+
", 名称:{0} 内存大小:{1}M "
,
process
.
ProcessName
,
process
.
PrivateMemorySize64
/
1024
/
1024F
);
totalMemery
+=
process
.
PrivateMemorySize64
/
1024
;
double
value
=
(
process
.
TotalProcessorTime
-
prevCpuTime
).
TotalMilliseconds
/
interval
/
Environment
.
ProcessorCount
;
sbResult
.
AppendFormat
(
" CPU : "
+
Math
.
Round
(
value
,
2
)
+
"%"
);
// string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString();
LogUtil
.
info
(
sbResult
.
ToString
());
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"LogM Error: "
+
ex
.
ToString
());
}
}
private
void
ShelfOutProcess
()
{
string
moveName
=
"送出空料架"
;
...
...
@@ -219,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
{
moveName
=
"送出出库料架"
;
}
LogCPU
();
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_01_TopDown
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_02_LocatinDown
);
...
...
@@ -516,6 +546,7 @@ namespace OnlineStore.DeviceLibrary
string
rfid
=
data
.
ContainsKey
(
ParamDefine
.
rfid
)
?
data
[
ParamDefine
.
rfid
]
:
""
;
int
rfidLoc
=
FormUtil
.
GetIntData
(
data
,
ParamDefine
.
rfidLoc
);
string
barcode
=
data
.
ContainsKey
(
ParamDefine
.
barcode
)
?
data
[
ParamDefine
.
barcode
]
:
""
;
string
realRfid
=
data
.
ContainsKey
(
ParamDefine
.
realRfid
)
?
data
[
ParamDefine
.
realRfid
]
:
""
;
int
taskCount
=
FormUtil
.
GetIntData
(
data
,
ParamDefine
.
taskCount
,
0
);
//urgentReel: true 表示紧急料,需要出到料串上
...
...
@@ -533,7 +564,7 @@ namespace OnlineStore.DeviceLibrary
index
++;
string
plateW
=
plateWArray
[
index
];
string
plateH
=
plateHArray
[
index
];
InOutParam
inoutParam
=
new
InOutParam
(
barcode
,
posId
,
""
,
plateW
,
plateH
,
urgentReel
,
cutReel
,
smallReel
,
rfid
,
rfidLoc
,
taskCount
);
InOutParam
inoutParam
=
new
InOutParam
(
barcode
,
posId
,
""
,
plateW
,
plateH
,
urgentReel
,
cutReel
,
smallReel
,
rfid
,
rfidLoc
,
taskCount
,
realRfid
);
//根据发送的posId获取位置列表
ACBoxPosition
position
=
CSVPositionReader
<
ACBoxPosition
>.
GetPositon
(
posId
);
if
(
position
==
null
)
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
b8bc7b1
...
...
@@ -33,13 +33,14 @@ namespace OnlineStore.DeviceLibrary
agvClient
.
Ready
+=
AgvClient_Ready
;
agvClient
.
CloseDoor
+=
AgvClient_CloseDoor
;
agvClient
.
EnterShelf
+=
AgvClient_EnterShelf
;
agvClient
.
SendLog
=
true
;
}
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
//foreach (string key in NodeList)
//{
// actionMap.Add(key, Asa.ClientAction.None);
//}
agvClient
.
SendSleep
=
10
;
agvClient
.
Connect
();
foreach
(
string
str
in
NodeList
)
{
...
...
source/DeviceLibrary/store/InOutParam.cs
查看文件 @
b8bc7b1
...
...
@@ -21,7 +21,7 @@ namespace OnlineStore.DeviceLibrary
this
.
WareCode
=
""
;
MoveP
=
null
;
}
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
,
string
platew
=
""
,
string
plateh
=
""
,
bool
urgentReel
=
false
,
bool
cutReel
=
false
,
bool
smallReel
=
false
,
string
rfid
=
""
,
int
rfidLoc
=
0
,
int
taskCount
=
0
)
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
,
string
platew
=
""
,
string
plateh
=
""
,
bool
urgentReel
=
false
,
bool
cutReel
=
false
,
bool
smallReel
=
false
,
string
rfid
=
""
,
int
rfidLoc
=
0
,
int
taskCount
=
0
,
string
realRfid
=
""
)
{
this
.
ShelfPosID
=
ShelfPosID
;
WareCode
=
wareNo
;
...
...
@@ -35,6 +35,7 @@ namespace OnlineStore.DeviceLibrary
this
.
rfid
=
rfid
;
this
.
rfidLoc
=
rfidLoc
;
this
.
taskCount
=
taskCount
;
this
.
realRfid
=
realRfid
;
}
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
,
LineMoveP
linePosition
)
{
...
...
@@ -50,6 +51,8 @@ namespace OnlineStore.DeviceLibrary
this
.
rfid
=
""
;
this
.
rfidLoc
=
0
;
this
.
taskCount
=
0
;
this
.
realRfid
=
""
;
}
/// <summary>
/// 物品二维码信息
...
...
@@ -115,6 +118,10 @@ namespace OnlineStore.DeviceLibrary
public
int
taskCount
{
get
;
set
;
}
/// <summary>
/// 真实料架号
/// </summary>
public
string
realRfid
{
get
;
set
;
}
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary>
/// <returns></returns>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论