Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e7e4c3f2
由
LN
编写于
2019-11-08 14:27:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
自动出库功能修改
1 个父辈
cc4ed631
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
52 行增加
和
16 行删除
source/ACSingleStore/App.config
source/Common/Setting_Init.cs
source/Common/util/HttpHelper.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/acSingleStore/StoreManager.cs
source/ACSingleStore/App.config
查看文件 @
e7e4c3f
...
@@ -49,6 +49,8 @@
...
@@ -49,6 +49,8 @@
<!--配置文件的表头格式,
0
=中文,
1
=英文-->
<!--配置文件的表头格式,
0
=中文,
1
=英文-->
<
add
key
=
"LibNameType"
value
=
"0"
/>
<
add
key
=
"LibNameType"
value
=
"0"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<!--自动出入库时使用-->
<
add
key
=
"LOC"
value
=
"1"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/Common/Setting_Init.cs
查看文件 @
e7e4c3f
...
@@ -98,5 +98,6 @@ namespace OnlineStore.Common
...
@@ -98,5 +98,6 @@ namespace OnlineStore.Common
public
static
string
LibNameType
=
"LibNameType"
;
public
static
string
LibNameType
=
"LibNameType"
;
public
static
string
DefaultPWD
=
"DefaultPWD"
;
public
static
string
DefaultPWD
=
"DefaultPWD"
;
public
static
string
LOC
=
"LOC"
;
}
}
}
}
source/Common/util/HttpHelper.cs
查看文件 @
e7e4c3f
...
@@ -138,13 +138,13 @@ namespace OnlineStore.Common
...
@@ -138,13 +138,13 @@ namespace OnlineStore.Common
{
{
try
try
{
{
LogUtil
.
info
(
LOGGER
,
"HTTP GET FROM: "
+
url
);
LogUtil
.
debug
(
LOGGER
,
"HTTP GET FROM: "
+
url
);
var
wc
=
new
WebClient
{
Encoding
=
encoding
};
var
wc
=
new
WebClient
{
Encoding
=
encoding
};
var
readStream
=
wc
.
OpenRead
(
url
);
var
readStream
=
wc
.
OpenRead
(
url
);
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
{
{
var
result
=
sr
.
ReadToEnd
();
var
result
=
sr
.
ReadToEnd
();
LogUtil
.
info
(
LOGGER
,
"receive << "
+
result
);
LogUtil
.
debug
(
LOGGER
,
"receive << "
+
result
);
return
result
;
return
result
;
}
}
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
e7e4c3f
...
@@ -1207,7 +1207,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1207,7 +1207,8 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
DateTime
preProTime
=
DateTime
.
Now
;
private
DateTime
preProTime
=
DateTime
.
Now
;
private
void
AutoResetProcess
()
private
void
AutoResetProcess
()
{
{
try
try
...
@@ -1279,25 +1280,41 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1279,25 +1280,41 @@ namespace OnlineStore.DeviceLibrary
{
{
//获取出库的库位号
//获取出库的库位号
string
readId
=
""
;
string
readId
=
""
;
//[{"LOC":"1","RI":"A100007","QTY":1000,"PN":"pn"},{"LOC":"2","RI":"A100015","QTY":1000,"PN":"pn"}]
//http://[SMD-BOX-IP]:[SMD-BOX-Port]/rest/api/v2/mes/inventory
//http://[SMD-BOX-IP]:[SMD-BOX-Port]/rest/api/v2/mes/inventory
string
result
=
HttpHelper
.
Post
(
StoreManager
.
GetAPI
(
""
,
StoreManager
.
api_inventory
));
//http://localhost/myproject/rest/api/v2/mes/inventory?LOC=1
int
LOC
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
LOC
);
if
(
LOC
<=
0
)
{
LOC
=
1
;
}
string
result
=
HttpHelper
.
Get
(
StoreManager
.
GetAPI
(
""
,
StoreManager
.
api_inventory
)
+
"?LOC="
+
LOC
);
if
(!
String
.
IsNullOrEmpty
(
result
))
if
(!
String
.
IsNullOrEmpty
(
result
))
{
{
string
[]
rArray
=
result
.
Split
(
'}'
);
List
<
APIInfo
>
apilist
=
JsonHelper
.
DeserializeJsonToList
<
APIInfo
>(
result
);
foreach
(
string
obj
in
rArray
)
foreach
(
APIInfo
a
in
apilist
)
{
{
string
[]
objArray
=
obj
.
Split
(
','
);
if
(
a
.
LOC
.
Equals
(
LOC
))
if
(
objArray
.
Length
>=
4
)
{
{
string
rId
=
objArray
[
1
];
readId
=
a
.
RI
;
if
(
rId
.
Length
>
7
)
LogUtil
.
debug
(
"自动出入库:查找到:RI: "
+
readId
);
{
readId
=
rId
.
Substring
(
6
,
rId
.
Length
-
7
);
LogUtil
.
debug
(
"自动出入库:查找到:RI: "
+
readId
);
break
;
}
}
}
}
}
//string[] rArray = result.Split('}');
//foreach (string obj in rArray)
//{
// string[] objArray = obj.Split(',');
// if (objArray.Length >= 4)
// {
// string rId = objArray[1];
// if (rId.Length > 7)
// {
// readId = rId.Substring(6, rId.Length - 7);
// LogUtil.debug("自动出入库:查找到:RI: " + readId);
// break;
// }
// }
//}
}
}
if
(
readId
.
Equals
(
""
))
if
(
readId
.
Equals
(
""
))
{
{
...
@@ -1938,7 +1955,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1938,7 +1955,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
if
(
autoNext
)
autoMsg
=
"自动出库:"
+
posId
;
if
(
autoNext
)
{
autoMsg
=
"自动出库:"
+
posId
;
}
}
}
else
else
{
{
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
e7e4c3f
...
@@ -233,6 +233,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -233,6 +233,7 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"目标["
+
targetPosition
+
"]当前["
+
outCount
+
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"目标["
+
targetPosition
+
"]当前["
+
outCount
+
"],误差过大,重新运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
"],误差过大,重新运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
StoreMove
.
CanWhileCount
--;
StoreMove
.
CanWhileCount
--;
}
}
...
...
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
e7e4c3f
...
@@ -152,5 +152,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -152,5 +152,17 @@ namespace OnlineStore.DeviceLibrary
}
}
return
host
;
return
host
;
}
}
}
public
class
APIInfo
{
//[{"LOC":"1","RI":"A100007","QTY":1000,"PN":"pn"},{"LOC":"2","RI":"A100015","QTY":1000,"PN":"pn"}]
public
int
LOC
=
1
;
public
string
RI
=
""
;
public
string
QTY
=
""
;
public
string
PN
=
""
;
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论