Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO827-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 317ea9ce
由
LN
编写于
2021-04-19 08:59:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
工单料去掉getSize处理
1 个父辈
0223cd3f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
88 行增加
和
88 行删除
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
317ea9c
...
...
@@ -66,37 +66,37 @@ namespace OnlineStore.DeviceLibrary
InOutParam
param
=
tray
.
InoutPar
;
if
(
tray
.
InOrOutStore
.
Equals
(
2
))
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
//紧急料,分盘料,直接返回
if
(
param
.
cutReel
||
param
.
urgentReel
)
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
}
bool
isNg
=
false
;
//工单料获取尺寸
int
robotIndex
=
0
;
string
code
=
SecondMoveInfo
.
MoveParam
.
WareCode
;
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
code
,
out
LastWidth
,
out
isNg
);
LogUtil
.
info
(
Name
+
"["
+
currTrayNum
+
"] ["
+
code
+
"] 获取尺寸【"
+
LastWidth
+
"】【"
+
result
+
"】"
);
if
(
LastWidth
>
0
)
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
}
else
if
(
isNg
)
{
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
,
result
);
LogInfo
(
"更新工单出库料["
+
currTrayNum
+
"] ["
+
code
+
"]为NG料:"
+
result
);
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
param
=
tray
.
InoutPar
;
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
}
else
{
LogUtil
.
info
(
Name
+
"["
+
currTrayNum
+
"] ["
+
tray
.
ToStr
()
+
"] 获取尺寸失败,托盘继续流转"
);
}
//if (param.cutReel || param.urgentReel)
//{
//return true;
//}
//bool isNg = false;
////工单料获取尺寸
//int robotIndex = 0;
//string code = SecondMoveInfo.MoveParam.WareCode;
//string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth, out isNg);
//LogUtil.info(Name + "[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
//if (LastWidth > 0)
//{
// SecondMoveInfo.MoveParam = param.Clone();
// return true;
//}
//else if (isNg)
//{
// TrayManager.UpdateInStoreNG(currTrayNum, true, result);
// LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
// tray = TrayManager.GetTrayInfo(currTrayNum);
// param = tray.InoutPar;
// SecondMoveInfo.MoveParam = param.Clone();
// return true;
//}
//else
//{
// LogUtil.info(Name + "[" + currTrayNum + "] [" + tray.ToStr() + "] 获取尺寸失败,托盘继续流转");
//}
}
else
if
(
param
.
IsNG
)
{
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
317ea9c
...
...
@@ -63,64 +63,64 @@ namespace OnlineStore.DeviceLibrary
}
return
codeStr
;
}
public
static
string
GetTraySize
(
string
deviceName
,
int
robotIndex
,
string
codeStr
,
out
int
outSize
,
out
bool
isNg
)
{
outSize
=
0
;
isNg
=
false
;
string
msg
=
""
;
try
{
if
(
String
.
IsNullOrEmpty
(
codeStr
))
{
return
msg
=
deviceName
+
"未扫到条码"
;
}
string
logName
=
$
"GetTraySize [{robotIndex }] [{codeStr}] :"
;
if
(
string
.
IsNullOrEmpty
(
serverAddr
))
{
LogUtil
.
error
(
deviceName
+
$
"{logName}未找到服务器地址"
);
return
msg
;
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"robotIndex"
,
robotIndex
.
ToString
());
// 参数: robotIndex = 机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3
paramMap
.
Add
(
"barcode"
,
codeStr
);
// barcode = 扫到的条码
string
server
=
GetAddr
(
Addr_getSize
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
bool
isTimeOut
=
false
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
,
Encoding
.
UTF8
,
5000
,
out
isTimeOut
);
LogUtil
.
info
(
"GetTraySize "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
if
(
isTimeOut
)
{
return
msg
=
"获取尺寸超时"
;
}
//返回: { "code": 0, "msg":"ok", data: 7}
ServerData
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
ServerData
>(
resultStr
);
if
(
serverResult
==
null
)
{
return
msg
=
"没有收到服务器反馈"
;
}
else
if
(
serverResult
.
code
.
Equals
(
0
).
Equals
(
false
))
{
// code: 0为正常,其他为异常,
//code不是0,直接NG
isNg
=
true
;
return
msg
=
$
" [{ serverResult.code}]:"
+
serverResult
.
msg
;
}
if
(!
serverResult
.
data
.
Equals
(
""
))
{
// data:料盘直径,= 7时升起气缸
outSize
=
Convert
.
ToInt32
(
serverResult
.
data
);
LogUtil
.
info
(
deviceName
+
$
"{ logName} 获得尺寸:"
+
outSize
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" "
,
ex
);
}
return
""
;
}
//
public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize, out bool isNg)
//
{
//
outSize = 0;
//
isNg = false;
//
string msg = "";
//
try
//
{
//
if (String.IsNullOrEmpty(codeStr))
//
{
//
return msg = deviceName + "未扫到条码";
//
}
//
string logName = $"GetTraySize [{robotIndex }] [{codeStr}] :";
//
if (string.IsNullOrEmpty(serverAddr))
//
{
//
LogUtil.error(deviceName + $"{logName}未找到服务器地址");
//
return msg;
//
}
//
Dictionary<string, string> paramMap = new Dictionary<string, string>();
//
paramMap.Add("robotIndex", robotIndex.ToString());// 参数: robotIndex = 机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3
//
paramMap.Add("barcode", codeStr);// barcode = 扫到的条码
//
string server = GetAddr(Addr_getSize, paramMap);
//
DateTime startTime = DateTime.Now;
//
bool isTimeOut = false;
//
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 5000, out isTimeOut);
//
LogUtil.info("GetTraySize " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
//
if (isTimeOut)
//
{
//
return msg = "获取尺寸超时";
//
}
//
//返回: { "code": 0, "msg":"ok", data: 7}
//
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
//
if (serverResult == null)
//
{
//
return msg = "没有收到服务器反馈";
//
}
//
else if (serverResult.code.Equals(0).Equals(false))
//
{
//
// code: 0为正常,其他为异常,
//
//code不是0,直接NG
//
isNg = true;
//
return msg = $" [{ serverResult.code}]:" + serverResult.msg;
//
}
//
if (!serverResult.data.Equals(""))
//
{
//
// data:料盘直径,= 7时升起气缸
//
outSize = Convert.ToInt32(serverResult.data);
//
LogUtil.info(deviceName + $"{ logName} 获得尺寸:" + outSize);
//
}
//
}
//
catch (Exception ex)
//
{
//
LogUtil.error(deviceName + " ", ex);
//
}
//
return "";
//
}
public
static
string
UpdateTrayLoc
(
string
deviceName
,
string
barcode
,
string
status
,
string
locInfo
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论