Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 188f217a
由
LN
编写于
2020-03-17 11:37:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
托盘检测优化。扫码增加验证。
1 个父辈
6c44dde4
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
54 行增加
和
56 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/记录.txt
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/AssemblyLineClient/App.config
查看文件 @
188f217
...
...
@@ -27,7 +27,7 @@
<!--摄像机名称列表配置,用
#分割-->
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898519)#GigE:MV-CE100-30GC (00C95305929)"
/>
<!--二维码类型列表配置,用
#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<
add
key
=
"CodeType"
value
=
"
QR Code#Data Matrix ECC 200
"
/>
<
add
key
=
"CodeType"
value
=
"
Data Matrix ECC 200#QR Code
"
/>
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
...
...
@@ -56,6 +56,7 @@
<
add
key
=
"DefaultTrayNum"
value
=
"0"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"0"
/>
<
add
key
=
"NeedCheckTray"
value
=
"0"
/>
</
appSettings
>
<!-- <
log4net
> -->
<!-- <
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
> -->
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
188f217
20200317
1.托盘检测的还会报警。
2.伺服问题?测高不准确。
3.条码扫一种类型后,判断有有效条码则不再扫码。
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
188f217
...
...
@@ -247,13 +247,13 @@ namespace OnlineStore.DeviceLibrary
protected
override
void
BaseTimerProcess
()
{
if
(
IOValue
(
IO_Type
.
DLine_SuddenStop
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
DLine_SuddenStop
).
Equals
(
IO_VALUE
.
LOW
)
&&
(!
isInSuddenDown
)
)
{
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
Task
.
Factory
.
StartNew
(
delegate
{
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
DLine_SuddenStop
).
Equals
(
IO_VALUE
.
LOW
))
{
SetWarnMsg
(
Name
+
"收到急停信号,急停报警"
);
Alarm
(
LineAlarmType
.
SuddenStop
);
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
188f217
...
...
@@ -422,19 +422,6 @@ namespace OnlineStore.DeviceLibrary
if
(!
wait
.
IsEnd
)
{
//if (wait.IoType.Equals(IO_Type.ClampCylinder_Slack) && wait.IoValue.Equals(IO_VALUE.HIGH) && span.TotalMilliseconds > 6000)
//{
// LogInfo("未检测到:ClampCylinder_Slack=HIGH,超过6秒钟,默认下一步骤");
// wait.IsEnd = true;
//}
//else if (wait.IoType.Equals(IO_Type.SL_MoveCylinder_Tighten) && wait.IoValue.Equals(IO_VALUE.HIGH) && span.TotalMilliseconds > 6000)
//{
// LogInfo("未检测到:SL_MoveCylinder_Tighten=HIGH,超过6秒钟,默认下一步骤");
// wait.IsEnd = true;
//}
//else
//{
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
//一分钟还未检测到
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
alarmType
<=
LineAlarmType
.
IoSingleTimeOut
)
...
...
@@ -468,10 +455,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
msg
);
}
}
if
(!
moveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W003_Time
))
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
188f217
...
...
@@ -326,13 +326,13 @@ namespace OnlineStore.DeviceLibrary
protected
override
void
BaseTimerProcess
()
{
if
(
IOValue
(
IO_Type
.
SL_SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SL_SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
)
&&
(!
isInSuddenDown
)
)
{
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
Task
.
Factory
.
StartNew
(
delegate
{
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
S
L_S
uddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
SetWarnMsg
(
Name
+
"收到急停信号,急停报警"
);
if
(
isInSuddenDown
.
Equals
(
false
))
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
188f217
...
...
@@ -129,10 +129,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
msg
);
}
}
if
(!
checkWaitInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W003_Time
))
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
...
...
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
188f217
...
...
@@ -412,6 +412,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
"第"
+
i
+
"次获取"
+
portName
+
"_"
+
slvAddr
+
"的实时位置"
+
result
);
}
Thread
.
Sleep
(
100
);
}
return
result
;
}
...
...
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
188f217
...
...
@@ -93,34 +93,13 @@ namespace OnlineStore.DeviceLibrary
}
public
static
void
CloseAllCamera
()
{
//BaslerCamera.Instance.Close();
//HIKCamera.Instance.Close();
Camera
.
_cam
.
CloseAll
();
}
//public static Bitmap GetCamerImage(string cameraName)
//{
// Bitmap bitm = null;
// try
// {
// bitm= Camera._cam.GrabOneImage(cameraName);
// //Camera._cam.Close(cameraName);
// }
// catch (Exception ex)
// {
// LogUtil.error(" 【" + cameraName + "】获取图片出错:", ex);
// }
// return bitm;
//}
private
static
int
ScanCount
=
0
;
private
static
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
,
string
deviceName
,
bool
isSaveImg
=
false
)
{
//if (codeCount < 1)
//{
// codeCount = 1;
//}
List
<
string
>
codeList
=
new
List
<
string
>();
if
(
cameraList
==
null
||
cameraList
.
Count
<=
0
)
{
...
...
@@ -137,9 +116,9 @@ namespace OnlineStore.DeviceLibrary
ScanCount
++;
DateTime
startTime
=
DateTime
.
Now
;
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】开始取图片"
);
//using (Bitmap bitmap = GetCamerImage(cameraName))
//{
HalconDotNet
.
HObject
ho_Image
=
null
;
bool
findRightCode
=
false
;
try
{
ho_Image
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
);
...
...
@@ -149,10 +128,7 @@ namespace OnlineStore.DeviceLibrary
CloseCamera
(
cameraName
);
continue
;
}
//LogUtil.info(deviceName + " 【" + cameraName + "】取图片完成,开始转换并扫码");
//bit = new Bitmap(bitmap);
//LogUtil.info(deviceName + " 【" + cameraName + "】new Bitmap(bitmap);完成");
//ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bit);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
string
r
=
""
;
...
...
@@ -174,14 +150,23 @@ namespace OnlineStore.DeviceLibrary
{
codeList
.
Add
(
str
);
r
=
r
+
"##"
+
str
;
if
(!
findRightCode
)
{
findRightCode
=
IsRightCode
(
str
);
}
}
}
if
(
findRightCode
)
{
break
;
}
}
if
(
String
.
IsNullOrEmpty
(
r
))
{
// SaveImageToFile(deviceName, cameraName, bit);
}
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】"
+
ScanCount
+
" :"
+
r
);
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】
["
+
findRightCode
+
"]
"
+
ScanCount
+
" :"
+
r
);
}
catch
(
AccessViolationException
e
)
{
...
...
@@ -195,21 +180,12 @@ namespace OnlineStore.DeviceLibrary
}
finally
{
//if (bitmap != null)
//{
// bitmap.Dispose();
//}
//if (bit != null)
//{
// bit.Dispose();
//}
if
(
ho_Image
!=
null
)
{
ho_Image
.
Dispose
();
}
}
}
//}
}
catch
(
AccessViolationException
e
)
{
...
...
@@ -244,6 +220,29 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"保存"
+
deviceName
+
" 【"
+
cameraName
+
"】的图片到【"
+
dire
+
iamgeName
+
"】出错"
+
ex
.
ToString
());
}
}
private
static
bool
IsRightCode
(
string
code
)
{
//分号分割后长度=4,L,E,B,R
try
{
string
[]
strarray
=
code
.
Split
(
';'
);
if
(
strarray
.
Length
==
4
)
{
if
(
strarray
[
0
].
StartsWith
(
"L"
)
&&
strarray
[
1
].
StartsWith
(
"E"
)
&&
strarray
[
2
].
StartsWith
(
"B"
)
&&
strarray
[
3
].
StartsWith
(
"R"
))
{
return
true
;
}
}
}
catch
(
Exception
ex
)
{
}
return
false
;
}
public
static
string
GetCodeParamFilePath
(
string
codePath
)
{
string
appPath
=
Application
.
StartupPath
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论