Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO908-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a8152993
由
LN
编写于
2021-08-22 09:21:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
放料到料串完成发送putfinish
1 个父辈
201a4cf0
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
93 行增加
和
1 行删除
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/manager/SServerManager.cs
source/DeviceLibrary/storeBean/EquipBase.cs
source/DeviceLibrary/storeBean/inputBean/InputEquip_InStore.cs
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
a815299
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
<Reference Include="System.Core" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.DataSetExtensions" />
...
...
source/DeviceLibrary/manager/SServerManager.cs
查看文件 @
a815299
...
@@ -6,6 +6,7 @@ using System.Linq;
...
@@ -6,6 +6,7 @@ using System.Linq;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Web.Script.Serialization
;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
...
@@ -641,6 +642,93 @@ namespace OnlineStore.DeviceLibrary
...
@@ -641,6 +642,93 @@ namespace OnlineStore.DeviceLibrary
}
}
return
msg
;
return
msg
;
}
}
private
static
string
Addr_ShelfFinish
=
"/rest/api/qisda/device/putShelfFinished"
;
public
static
ShelfTaskInfo
ShelfFinish
(
string
rfid
,
string
barcode
=
""
,
string
rfidLoc
=
""
,
string
robotIndex
=
"1"
)
{
ShelfTaskInfo
task
=
new
ShelfTaskInfo
();
task
.
rfid
=
rfid
;
DateTime
startTime
=
DateTime
.
Now
;
try
{
string
api
=
Addr_ShelfFinish
;
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"barcode"
,
barcode
);
paramMap
.
Add
(
"rfid"
,
rfid
);
paramMap
.
Add
(
"rfidLoc"
,
rfidLoc
);
paramMap
.
Add
(
"robotIndex"
,
robotIndex
);
//string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
string
url
=
GetAddr
(
api
,
paramMap
);
LogUtil
.
debug
(
"http :URL:"
+
url
);
string
json
=
HttpHelper
.
Post
(
url
,
""
,
10000
);
if
(
barcode
!=
""
)
{
LogUtil
.
info
(
"http :URL:"
+
url
+
" :Response:"
+
json
+
" 耗时["
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"]"
);
}
else
{
LogUtil
.
debug
(
"http :URL:"
+
url
+
" :Response:"
+
json
);
}
if
(
string
.
IsNullOrWhiteSpace
(
json
))
return
task
;
//行 2234: [2021 - 04 - 07 15:09:31,412][9]INFO - http :URL:
//http://192.168.100.14/myproject/rest/api/qisda/device/putShelfFinished?barcode=640253A*34005600000309*QG00006*5000*23C4&rfid=F103&rfidLoc=8&robotIndex=1 :
//Response:{"code":0,"msg":"ok","data":{"smallTask":"0","cutPackageTask":"0","packageTask":"0","bigTask":"0","smallEmpty":"0","bigEmpty":"5","packageEmpty":"0","rfid":"F103","usedRfidList":"F106,F105,F103","barcode":"640253A*34005600000309*QG00006*5000*23C4","cutTask":"0"}} 耗时[00:00:00.1]
JavaScriptSerializer
serializer
=
new
JavaScriptSerializer
();
Dictionary
<
string
,
object
>
obj
=
(
Dictionary
<
string
,
object
>)
serializer
.
DeserializeObject
(
json
);
if
(!
obj
.
TryGetValue
(
"code"
,
out
object
value
))
return
task
;
if
(
value
.
ToString
()
!=
"0"
)
{
if
(
obj
.
TryGetValue
(
"msg"
,
out
value
))
LogUtil
.
error
(
"http"
+
api
+
": "
+
value
.
ToString
());
return
task
;
}
if
(!
obj
.
TryGetValue
(
"data"
,
out
value
))
return
task
;
Dictionary
<
string
,
object
>
dict
=
(
Dictionary
<
string
,
object
>)
value
;
if
(
dict
==
null
)
{
LogUtil
.
info
(
"http"
+
api
+
": data=null"
);
return
task
;
}
if
(
dict
.
TryGetValue
(
"bigEmpty"
,
out
value
))
int
.
TryParse
(
value
.
ToString
(),
out
task
.
bigEmpty
);
if
(
dict
.
TryGetValue
(
"smallEmpty"
,
out
value
))
int
.
TryParse
(
value
.
ToString
(),
out
task
.
smallEmpty
);
if
(
dict
.
TryGetValue
(
"usedRfidList"
,
out
value
))
task
.
usedRfidList
=
value
.
ToString
();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"http error : "
+
ex
.
ToString
());
}
return
task
;
}
}
public
class
ShelfTaskInfo
{
public
string
rfid
=
""
;
public
int
bigEmpty
=
-
1
;
public
int
smallEmpty
=
-
1
;
//public int packageEmpty = -1;
public
string
usedRfidList
=
""
;
public
bool
IsValid
()
{
if
(
bigEmpty
!=
-
1
&&
smallEmpty
!=
-
1
)
{
return
true
;
}
return
false
;
}
public
string
ToStr
()
{
return
" "
+
rfid
+
"剩余位置: 小料="
+
smallEmpty
+
",大料="
+
bigEmpty
+
",已使用料架="
+
usedRfidList
+
" "
;
}
}
}
public
class
AlarmMsg
public
class
AlarmMsg
{
{
...
...
source/DeviceLibrary/storeBean/EquipBase.cs
查看文件 @
a815299
...
@@ -138,7 +138,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -138,7 +138,6 @@ namespace OnlineStore.DeviceLibrary
//取新的Io状态
//取新的Io状态
IO_VALUE
fuweiValue
=
IOValue
(
IO_Type
.
Reset_BTN
);
IO_VALUE
fuweiValue
=
IOValue
(
IO_Type
.
Reset_BTN
);
IO_VALUE
lastFuwei
=
DILastValueMap
[
IO_Type
.
Reset_BTN
];
IO_VALUE
lastFuwei
=
DILastValueMap
[
IO_Type
.
Reset_BTN
];
addLastDI
(
IO_Type
.
Reset_BTN
,
fuweiValue
);
bool
isAutoStart
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
)
==
1
;
bool
isAutoStart
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
)
==
1
;
//收到复位信号后启动
//收到复位信号后启动
...
@@ -152,6 +151,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -152,6 +151,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"启动失败,等待下次启动"
);
LogUtil
.
error
(
"启动失败,等待下次启动"
);
}
}
}
}
addLastDI
(
IO_Type
.
Reset_BTN
,
fuweiValue
);
return
;
return
;
}
}
}
}
...
...
source/DeviceLibrary/storeBean/inputBean/InputEquip_InStore.cs
查看文件 @
a815299
...
@@ -845,14 +845,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -845,14 +845,17 @@ namespace OnlineStore.DeviceLibrary
if
(
shelf
.
Equals
(
1
))
if
(
shelf
.
Equals
(
1
))
{
{
BatchMove_A
.
ReelPutOk
();
BatchMove_A
.
ReelPutOk
();
SServerManager
.
ShelfFinish
(
BatchMove_A
.
CurrShelf
.
ShelfRfid
,
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
);
}
}
else
else
{
{
BatchMove_B
.
ReelPutOk
();
BatchMove_B
.
ReelPutOk
();
SServerManager
.
ShelfFinish
(
BatchMove_B
.
CurrShelf
.
ShelfRfid
,
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
);
}
}
MoveInfo
.
NextMoveStep
(
StepEnum
.
IO32_UpdownToP1
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
IO32_UpdownToP1
);
MoveLog
(
$
"出库->料串 {MoveInfo.SLog}: 升降轴到P1(待机点){Config.Updown_P1}"
);
MoveLog
(
$
"出库->料串 {MoveInfo.SLog}: 升降轴到P1(待机点){Config.Updown_P1}"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
Updown_P1
,
Config
.
Updown_P1_Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
Updown_P1
,
Config
.
Updown_P1_Speed
);
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IO32_UpdownToP1
))
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IO32_UpdownToP1
))
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论