Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a36a5372
由
LN
编写于
2019-10-31 17:15:18 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
c25d1b3f
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
162 行增加
和
74 行删除
doc/RC1250佳世达IO配置10-10.xlsx
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblymanager/StoreServerManager.cs
doc/RC1250佳世达IO配置10-10.xlsx
查看文件 @
a36a537
此文件类型无法预览
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
查看文件 @
a36a537
...
...
@@ -219,7 +219,7 @@ namespace OnlineStore.DeviceLibrary
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
TrayManager
.
UpdateTrayCode
(
currMoveTrayNum
,
code
);
//从服务器获取库位号
string
result
=
StoreServerManager
.
CodeReceived
(
Name
,
currMoveTrayNum
,
code
,
LastHeight
,
LastWidth
);
string
result
=
StoreServerManager
.
CodeReceived
(
Name
,
currMoveTrayNum
,
LastCodeList
,
LastHeight
,
LastWidth
);
if
(!
result
.
Equals
(
""
))
{
LogUtil
.
error
(
result
);
}
InStoreLog
(
" SecondStoreMove=MO_12_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"
);
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
a36a537
...
...
@@ -750,80 +750,80 @@ namespace OnlineStore.DeviceLibrary
#
region
扫码枪代码
/// <summary>
/// 是否已经扫码
/// </summary>
private
bool
IsScanCode
=
false
;
private
string
CodeMsg
=
""
;
private
static
string
ACCode
=
""
;
public
void
GetCameraCode
()
{
if
(
IsInScan
())
{
LogUtil
.
info
(
"上次扫码还未执行完毕,请稍后!"
);
return
;
}
Task
.
Factory
.
StartNew
(
delegate
{
///
//
<summary>
///
//
是否已经扫码
///
//
</summary>
//
private bool IsScanCode = false;
//
private string CodeMsg = "";
//
private static string ACCode = "";
//
public void GetCameraCode()
//
{
//
if (IsInScan())
//
{
//
LogUtil.info("上次扫码还未执行完毕,请稍后!");
//
return;
//
}
//
Task.Factory.StartNew(delegate
//
{
IsScanCode
=
true
;
LastScanTime
=
DateTime
.
Now
;
//
IsScanCode = true;
//
LastScanTime = DateTime.Now;
DateTime
date
=
DateTime
.
Now
;
// IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
//
DateTime date = DateTime.Now;
//
// IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
if
(
codeList
.
Count
<=
0
)
{
codeList
=
CodeManager
.
CameraScan
();
}
List
<
string
>
list
=
new
List
<
string
>();
string
outMsg
=
""
;
string
message
=
""
;
int
height
=
GetHeight
();
int
width
=
GetWidth
();
//= 1 + 123.4x100.5 - 7x12 = CODE
foreach
(
string
str
in
codeList
)
{
if
(
list
.
Contains
(
str
.
Trim
()))
{
continue
;
}
list
.
Add
(
str
.
Trim
());
//string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
string
code
=
width
+
"x"
+
height
+
"%3D"
+
str
.
Trim
();
message
=
message
+
code
+
spiltStr
;
}
if
(!
outMsg
.
Equals
(
""
))
{
CodeMsg
=
"盘尺寸错误,清理二维码【"
+
message
+
"】"
;
LogUtil
.
error
(
"盘尺寸错误,清理二维码【"
+
message
+
"】"
);
message
=
""
;
}
// KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
onCodeReceived
(
message
,
height
,
width
);
IsScanCode
=
false
;
});
}
//
List<string> codeList = CodeManager.CameraScan();
//
if (codeList.Count <= 0)
//
{
//
codeList = CodeManager.CameraScan();
//
}
//
List<string> list = new List<string>();
//
string outMsg = "";
//
string message = "";
//
int height = GetHeight();
//
int width = GetWidth();
//
//= 1 + 123.4x100.5 - 7x12 = CODE
//
foreach (string str in codeList)
//
{
//
if (list.Contains(str.Trim()))
//
{
//
continue;
//
}
//
list.Add(str.Trim());
//
//string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
//
string code = width + "x" + height + "%3D" + str.Trim();
//
message = message + code + spiltStr;
//
}
//
if (!outMsg.Equals(""))
//
{
//
CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
//
LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
//
message = "";
//
}
//
// KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
//
onCodeReceived( message,height,width);
//
IsScanCode = false;
//
});
//
}
private
string
spiltStr
=
"%23%23"
;
//
private string spiltStr = "%23%23";
private
DateTime
LastScanTime
=
DateTime
.
Now
;
private
bool
IsInScan
()
{
if
(!
IsScanCode
)
{
return
false
;
}
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
if
(
span
.
TotalSeconds
>
60
)
{
//大于60秒表示超时了,可以重新开始扫码
return
false
;
}
return
true
;
}
//
private DateTime LastScanTime = DateTime.Now;
//
private bool IsInScan()
//
{
//
if (!IsScanCode)
//
{
//
return false;
//
}
//
TimeSpan span = DateTime.Now - LastScanTime;
//
if (span.TotalSeconds > 60)
//
{
//
//大于60秒表示超时了,可以重新开始扫码
//
return false;
//
}
//
return true;
//
}
/// <summary>
...
...
source/DeviceLibrary/assemblymanager/StoreServerManager.cs
查看文件 @
a36a537
...
...
@@ -9,11 +9,24 @@ namespace OnlineStore.DeviceLibrary
{
public
class
StoreServerManager
{
public
static
string
CodeReceived
(
string
deviceName
,
int
trayNum
,
string
codeStr
,
int
height
,
int
width
)
private
static
string
spiltStr
=
"%23%23"
;
public
static
string
CodeReceived
(
string
deviceName
,
int
trayNum
,
List
<
string
>
codeList
,
int
height
,
int
width
)
{
string
msg
=
""
;
try
{
string
codeStr
=
""
;
foreach
(
string
str
in
codeList
)
{
if
(
codeStr
.
Equals
(
""
))
{
codeStr
=
str
;
}
else
{
codeStr
+=
spiltStr
+
str
;
}
}
if
(
String
.
IsNullOrEmpty
(
codeStr
))
{
return
msg
=
deviceName
+
"托盘【"
+
trayNum
+
"】 没有扫码到条码"
;
...
...
@@ -26,6 +39,7 @@ namespace OnlineStore.DeviceLibrary
//http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid
//code: 条码内容
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
)
+
"?cids="
+
LineServer
.
GetAllCID
()
+
"&code=%3D"
+
codeStr
;
LogUtil
.
info
(
deviceName
+
"托盘【"
+
trayNum
+
"】 收到条码<< "
+
codeStr
+
",获取入库PosID:"
+
server
);
...
...
@@ -58,7 +72,7 @@ namespace OnlineStore.DeviceLibrary
//判断盘是否过高(7*8的盘需要判断,如果盘过高,不让盘通过,直接显示报警信息)
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
//根据库位号查找移栽
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
//取盘号
string
wareNum
=
serverResult
.
barcode
;
...
...
@@ -73,14 +87,14 @@ namespace OnlineStore.DeviceLibrary
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
if
(
LineManager
.
Line
.
IsReviceInPosId
(
moveEquip
,
posId
))
{
LineManager
.
Line
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
LineManager
.
Line
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
moveEquip
.
WarnMsg
=
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
;
return
msg
=(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
return
msg
=
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
}
LineServer
.
CheckInStorePos
(
storeId
,
param
);
//StartInStoreMove(param);
TrayManager
.
UpdateTrayInfo
(
trayCode
,
true
,
1
,
codeStr
,
posId
,
plateH
,
plateW
);
TrayManager
.
UpdateTrayInfo
(
trayCode
,
true
,
1
,
codeStr
,
posId
,
plateH
,
plateW
);
}
}
}
...
...
@@ -91,5 +105,79 @@ namespace OnlineStore.DeviceLibrary
return
""
;
}
///// <summary>
///// 是否已经扫码
///// </summary>
//private bool IsScanCode = false;
//private string CodeMsg = "";
//private static string ACCode = "";
//public void GetCameraCode()
//{
// if (IsInScan())
// {
// LogUtil.info("上次扫码还未执行完毕,请稍后!");
// return;
// }
// Task.Factory.StartNew(delegate
// {
// IsScanCode = true;
// LastScanTime = DateTime.Now;
// DateTime date = DateTime.Now;
// // IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
// List<string> codeList = CodeManager.CameraScan();
// if (codeList.Count <= 0)
// {
// codeList = CodeManager.CameraScan();
// }
// List<string> list = new List<string>();
// string outMsg = "";
// string message = "";
// int height = GetHeight();
// int width = GetWidth();
// //= 1 + 123.4x100.5 - 7x12 = CODE
// foreach (string str in codeList)
// {
// if (list.Contains(str.Trim()))
// {
// continue;
// }
// list.Add(str.Trim());
// //string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
// string code = width + "x" + height + "%3D" + str.Trim();
// message = message + code + spiltStr;
// }
// if (!outMsg.Equals(""))
// {
// CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
// LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
// message = "";
// }
// // KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
// onCodeReceived(message, height, width);
// IsScanCode = false;
// });
//}
//
//private DateTime LastScanTime = DateTime.Now;
//private bool IsInScan()
//{
// if (!IsScanCode)
// {
// return false;
// }
// TimeSpan span = DateTime.Now - LastScanTime;
// if (span.TotalSeconds > 60)
// {
// //大于60秒表示超时了,可以重新开始扫码
// return false;
// }
// return true;
//}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论