Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO827-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0d1fe10f
由
LN
编写于
2021-06-29 17:25:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库料放到托盘上时先调用GetLocation判断是否可放
1 个父辈
45eb003b
全部展开
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
171 行增加
和
72 行删除
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/server/BoxInfo.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
0d1fe10
...
@@ -315,11 +315,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -315,11 +315,11 @@ namespace OnlineStore.DeviceLibrary
//前进后退气缸后退以后才可以出库
//前进后退气缸后退以后才可以出库
else
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Busy
)
&&
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
else
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Busy
)
&&
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
{
if
(
move
.
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
MO_6
0
_CylinderDown
))
if
(
move
.
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
MO_6
4
_CylinderDown
))
{
{
return
true
;
return
true
;
}
}
else
if
(
move
.
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_
59
_CylinderAfter
)
&&
move
.
MoveInfo
.
IsInWait
.
Equals
(
false
)
else
if
(
move
.
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_
63
_CylinderAfter
)
&&
move
.
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
move
.
CylinderIsOk
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
))
&&
move
.
CylinderIsOk
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
))
{
{
return
true
;
return
true
;
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
0d1fe10
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
0d1fe10
...
@@ -63,64 +63,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -63,64 +63,6 @@ namespace OnlineStore.DeviceLibrary
}
}
return
codeStr
;
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
UpdateTrayLoc
(
string
deviceName
,
string
barcode
,
string
status
,
string
locInfo
)
public
static
string
UpdateTrayLoc
(
string
deviceName
,
string
barcode
,
string
status
,
string
locInfo
)
...
@@ -563,6 +505,52 @@ namespace OnlineStore.DeviceLibrary
...
@@ -563,6 +505,52 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
static
string
Addr_getLocation
=
"/rest/api/qisda/device/getLocation"
;
public
static
bool
GetLocation
(
string
barcode
)
{
//加参数: onMoving=true 如果返回的code是99,则停留在横移上,下个可放托盘继续判断
//getLocation这个接口传入barcode和rfid列表会分配料架
try
{
string
currRFID
=
""
;
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
7
);
if
(
box
!=
null
&&
LineServer
.
BoxConnected
(
7
))
{
currRFID
=
box
.
GetRfids
();
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"barcode"
,
barcode
);
paramMap
.
Add
(
"rfid"
,
currRFID
);
paramMap
.
Add
(
"onMoving"
,
true
.
ToString
());
string
url
=
GetAddr
(
Addr_getLocation
,
paramMap
);
string
logName
=
"http :URL:"
+
url
;
DateTime
startTime
=
DateTime
.
Now
;
string
json
=
HttpHelper
.
Post
(
url
,
""
,
10000
);
LogUtil
.
info
(
logName
+
": Response:"
+
json
+
",耗时【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】"
);
RfidData
data
=
JsonHelper
.
DeserializeJsonToObject
<
RfidData
>(
json
);
if
(
data
==
null
)
{
return
false
;
}
else
if
(
data
.
code
.
Equals
(
99
))
{
return
false
;
}
else
{
return
true
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"http error : "
+
ex
.
ToString
());
}
return
false
;
}
//14.异常看板
//14.异常看板
// > 地址:
// > 地址:
...
@@ -650,7 +638,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -650,7 +638,7 @@ namespace OnlineStore.DeviceLibrary
public
InOutParam
Param
=
null
;
public
InOutParam
Param
=
null
;
}
}
public
class
RfidData
public
class
RfidData
{
{
//Response:{"code":0,"msg":"ok","data":{"w":"7","realRfid":"","h":"8","rfid":"1-2F","usedRfidList":"F102","rfidLoc":"11","barcode":"985022*35030377*0822*3000*08220350"}}
//{"code":0,"msg":"ok","data":"7"}
//{"code":0,"msg":"ok","data":"7"}
public
int
code
{
get
;
set
;
}
public
int
code
{
get
;
set
;
}
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
0d1fe10
...
@@ -323,50 +323,55 @@ namespace OnlineStore.DeviceLibrary
...
@@ -323,50 +323,55 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 移栽装置出库处理。上下气缸1下降
/// 移栽装置出库处理。上下气缸1下降
/// </summary>
/// </summary>
MO_5
2
_CylinderDown
,
MO_5
3
_CylinderDown
,
/// <summary>
/// <summary>
/// 移栽装置出库处理。上下气缸1下降后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作
/// 移栽装置出库处理。上下气缸1下降后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作
/// </summary>
/// </summary>
MO_5
3
_DownWait
,
MO_5
4
_DownWait
,
/// <summary>
/// <summary>
/// 移栽装置出库处理。 夹料气缸1夹紧
/// 移栽装置出库处理。 夹料气缸1夹紧
/// </summary>
/// </summary>
MO_5
4
_CylinderOpen
,
MO_5
5
_CylinderOpen
,
/// <summary>
/// <summary>
/// 移栽装置出库处理。 上下气缸1上升
/// 移栽装置出库处理。 上下气缸1上升
/// </summary>
/// </summary>
MO_5
5
_CylinderUp
,
MO_5
6
_CylinderUp
,
/// <summary>
/// <summary>
/// 移栽出库:开始重抓一次
/// 移栽出库:开始重抓一次
/// </summary>
/// </summary>
MO_5
6
_ResetClamp
,
MO_5
7
_ResetClamp
,
/// <summary>
/// <summary>
/// 移栽出库。 等待夹爪有料
/// 移栽出库。 等待夹爪有料
/// </summary>
/// </summary>
MO_57_WaitHasReel
,
MO_58_WaitHasReel
,
/// <summary>
/// 移栽出库:判断料盘能否放到托盘
/// </summary>
MO_61_WaitCanPut
,
/// <summary>
/// <summary>
/// 移栽出库:开始等待托盘
/// 移栽出库:开始等待托盘
/// </summary>
/// </summary>
MO_
58
_WaitTray
,
MO_
62
_WaitTray
,
/// <summary>
/// <summary>
/// 移栽装置出库处理。 前后气缸1后退
/// 移栽装置出库处理。 前后气缸1后退
/// </summary>
/// </summary>
MO_
59
_CylinderAfter
,
MO_
63
_CylinderAfter
,
/// <summary>
/// <summary>
/// 移载(流水线)装置出库处理,上下气缸1下降
/// 移载(流水线)装置出库处理,上下气缸1下降
/// </summary>
/// </summary>
MO_6
0
_CylinderDown
,
MO_6
4
_CylinderDown
,
/// <summary>
/// <summary>
/// 移载(流水线)装置出库处理,夹料气缸1放松
/// 移载(流水线)装置出库处理,夹料气缸1放松
/// </summary>
/// </summary>
MO_6
1
_CylinderRelax
,
MO_6
5
_CylinderRelax
,
/// <summary>
/// <summary>
/// 移载(流水线)装置出库处理,上下气缸1上升
/// 移载(流水线)装置出库处理,上下气缸1上升
/// </summary>
/// </summary>
MO_6
2
_CylinderUp
,
MO_6
6
_CylinderUp
,
#
region
入料模块,紧急出料移栽处理
#
region
入料模块,紧急出料移栽处理
...
...
source/DeviceLibrary/server/BoxInfo.cs
查看文件 @
0d1fe10
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
...
@@ -85,5 +86,110 @@ namespace OnlineStore.DeviceLibrary
...
@@ -85,5 +86,110 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
string
rfids
=
""
;
public
string
rfids
=
""
;
private
char
rfidSpilt
=
';'
;
public
string
GetRfids
()
{
string
str
=
""
;
string
[]
array
=
rfids
.
Split
(
rfidSpilt
);
if
(
array
!=
null
&&
array
.
Length
>
0
)
{
foreach
(
string
obj
in
array
)
{
string
realRfid
=
obj
;
string
xuniRfid
=
""
;
if
(
obj
.
Contains
(
","
))
{
string
[]
rarray
=
obj
.
Split
(
','
);
if
(
rarray
.
Length
==
2
)
{
realRfid
=
rarray
[
0
];
xuniRfid
=
rarray
[
1
];
}
}
str
+=
realRfid
+
rfidSpilt
;
}
}
str
=
str
.
Substring
(
0
,
str
.
Length
-
1
);
return
str
;
}
//internal bool HasRightRFID(OutWareInfo wareInfo, out string TargetRfid)
//{
// TargetRfid = "";
// string[] rfidArray = rfids.Split(rfidSpilt);
// if (rfidArray == null || rfidArray.Length <= 0)
// {
// return false;
// }
// foreach (string obj in rfidArray)
// {
// string realRfid = obj;
// string xuniRfid = "";
// if (obj.Contains(","))
// {
// string[] rarray = obj.Split(',');
// if (rarray.Length == 2)
// {
// realRfid = rarray[0];
// xuniRfid = rarray[1];
// }
// }
// if (realRfid.Equals(wareInfo.realRFID))
// {
// TargetRfid = obj;
// return true;
// }
// else if (String.IsNullOrEmpty(wareInfo.realRFID))
// {
// if ((!xuniRfid.Equals("")) && xuniRfid.Equals(wareInfo.rfid))
// {
// TargetRfid = obj;
// return true;
// }
// if (!String.IsNullOrEmpty(wareInfo.usedRfidList))
// {
// string[] array = wareInfo.usedRfidList.Split(',');
// //若料架已使用过,直接返回false
// if (array.Contains(realRfid))
// {
// return false;
// }
// }
// if (xuniRfid.Equals(""))
// {
// TargetRfid = obj;
// return true;
// }
// }
// }
// return false;
//}
//public Dictionary<string, string> GetRfidMap()
//{
// Dictionary<string, string> map = new Dictionary<string, string>();
// string[] array = rfids.Split(rfidSpilt);
// if (array != null && array.Length > 0)
// {
// foreach (string obj in array)
// {
// string realRfid = obj;
// string xuniRfid = "";
// if (obj.Contains("-"))
// {
// string[] rarray = obj.Split('-');
// if (rarray.Length == 2)
// {
// realRfid = rarray[0];
// xuniRfid = rarray[1];
// }
// }
// map.Add(realRfid, xuniRfid);
// }
// }
// return map;
//}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论