Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d311146a
由
LN
编写于
2019-06-10 17:03:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
压紧轴回原点增加自动重复运动功能
1 个父辈
2d7428e5
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
50 行增加
和
18 行删除
source/ACSingleStore/记录.txt
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/ShuoKe/ShuoKeController.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/ACSingleStore/记录.txt
查看文件 @
d311146
...
@@ -75,7 +75,10 @@
...
@@ -75,7 +75,10 @@
FA开头的二维码,默认为7*32
FA开头的二维码,默认为7*32
20190606
进入IO界面需要一直读取测高值。
压紧轴回原点增加自动重复运动功能。
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
d311146
...
@@ -37,10 +37,10 @@
...
@@ -37,10 +37,10 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="CodeLibrary">
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
<HintPath>..\..\
..\RC32-SZBOSCH-ACSingleStore\
dll\CodeLibrary.dll</HintPath>
</Reference>
</Reference>
<Reference Include="halcondotnet">
<Reference Include="halcondotnet">
<HintPath>
C:\Program Files\MVTec\HALCON-12.0\bin\dotnet35
\halcondotnet.dll</HintPath>
<HintPath>
..\..\..\RC32-SZBOSCH-ACSingleStore\dll
\halcondotnet.dll</HintPath>
</Reference>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
...
...
source/DeviceLibrary/ShuoKe/ShuoKeController.cs
查看文件 @
d311146
...
@@ -309,16 +309,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -309,16 +309,28 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
public
static
bool
IsHomeMoveEnd
(
int
slvAddr
,
DateTime
time
,
out
string
msg
)
{
//public static bool IsHomeMoveEnd(int slvAddr, DateTime time, out string msg)
ShuoKeInfo
shuokeInfo
=
GetStatus
(
slvAddr
);
//{
msg
=
" IsInMove【"
+
shuokeInfo
.
IsInMove
+
"】Org【"
+
shuokeInfo
.
Org
+
"】"
;
// ShuoKeInfo shuokeInfo = GetStatus(slvAddr);
if
(
shuokeInfo
.
IsInMove
.
Equals
(
0
)
&&
shuokeInfo
.
Org
.
Equals
(
0
)&&
shuokeInfo
.
UpdateTime
>
time
)
// msg = " IsInMove【" + shuokeInfo.IsInMove + "】Org【" + shuokeInfo.Org + "】";
{
// if (shuokeInfo.IsInMove .Equals(0) && shuokeInfo.Org.Equals(0)&&shuokeInfo.UpdateTime>time)
return
true
;
// {
}
// return true;
return
false
;
// }
}
// //如果是运动结束状态,但原点未到达,直接重新开始运动
// else if (shuokeInfo.IsInMove.Equals(0) && shuokeInfo.Org.Equals(1) && shuokeInfo.UpdateTime > time)
// {
// TimeSpan span = DateTime.Now - lastRHomeTime;
// if (span.TotalSeconds > 3)
// {
// LogUtil.error("【" + PortName + "】已经停止运动但不在原点,重新回原点");
// lastRHomeTime = DateTime.Now;
// HomeMove(slvAddr);
// }
// }
// return false;
//}
#
endregion
#
endregion
...
@@ -343,7 +355,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -343,7 +355,7 @@ namespace OnlineStore.DeviceLibrary
}
}
// <param name="homeType">0=反方向,1=正方向</param>
// <param name="homeType">0=反方向,1=正方向</param>
public
static
void
HomeMove
(
int
slvAddr
,
byte
homeType
)
public
static
void
HomeMove
(
int
slvAddr
,
byte
homeType
=
1
)
{
{
string
fangx
=
homeType
.
Equals
(
0
)
?
"反方向"
:
"正方向"
;
string
fangx
=
homeType
.
Equals
(
0
)
?
"反方向"
:
"正方向"
;
LogUtil
.
info
(
"压紧轴原点返回:"
+
fangx
);
LogUtil
.
info
(
"压紧轴原点返回:"
+
fangx
);
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
d311146
using
HalconDotNet
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
d311146
...
@@ -209,7 +209,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -209,7 +209,7 @@ namespace OnlineStore.DeviceLibrary
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
}
}
private
static
DateTime
lastComRHomeTime
=
DateTime
.
Now
;
private
bool
ShuoKeIsEnd
(
WaitResultInfo
wait
,
out
string
msg
)
private
bool
ShuoKeIsEnd
(
WaitResultInfo
wait
,
out
string
msg
)
{
{
//bool result = false;
//bool result = false;
...
@@ -217,7 +217,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -217,7 +217,25 @@ namespace OnlineStore.DeviceLibrary
if
(
wait
.
IsHomeMove
)
if
(
wait
.
IsHomeMove
)
{
{
return
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
,
out
msg
);
//return ShuoKeControls.IsHomeMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime, out msg);
ShuoKeInfo
shuokeInfo
=
ShuoKeControls
.
GetStatus
(
wait
.
SlvAddr
);
msg
=
" IsInMove【"
+
shuokeInfo
.
IsInMove
+
"】Org【"
+
shuokeInfo
.
Org
+
"】"
;
if
(
shuokeInfo
.
IsInMove
.
Equals
(
0
)
&&
shuokeInfo
.
Org
.
Equals
(
0
)
)
{
return
true
;
}
//如果是运动结束状态,但原点未到达,直接重新开始运动
else
if
(
shuokeInfo
.
IsInMove
.
Equals
(
0
)
&&
shuokeInfo
.
Org
.
Equals
(
1
)
)
{
TimeSpan
span
=
DateTime
.
Now
-
lastComRHomeTime
;
if
(
span
.
TotalSeconds
>
3
&&
(
StoreMove
.
CanWhileCount
>
0
))
{
lastComRHomeTime
=
DateTime
.
Now
;
StoreMove
.
CanWhileCount
--;
LogUtil
.
error
(
"压紧轴 已经停止运动但不在原点,重新回原点,剩余重新运动次数"
+
StoreMove
.
CanWhileCount
);
ShuoKeControls
.
HomeMove
(
wait
.
SlvAddr
);
}
}
}
}
else
else
{
{
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
d311146
using
CodeLibrary
;
using
CodeLibrary
;
using
HalconDotNet
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -164,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -164,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
H
alconDotNet
.
H
Object
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
foreach
(
string
codeType
in
codeTypeList
)
foreach
(
string
codeType
in
codeTypeList
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论