Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-HCSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2efb4cde
由
LN
编写于
2020-11-25 13:55:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
点位调试功能优化,自动出入库bug修改
1 个父辈
c7937a15
全部展开
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
103 行增加
和
69 行删除
source/DeviceLibrary/acSingleStore/BoxAutoPoint.cs
source/DeviceLibrary/acSingleStore/BoxBean_Partial.cs
source/DeviceLibrary/bean/StoreStep.cs
source/HCSingleStore/positionTool/FrmTool.Designer.cs
source/HCSingleStore/positionTool/FrmTool.cs
source/HCSingleStore/positionTool/FrmTool.resx
source/HCSingleStore/记录.txt
source/HuichuanLibrary/HCBoardManager.cs
source/HuichuanLibrary/HCBoardManager_Axis.cs
source/DeviceLibrary/acSingleStore/BoxAutoPoint.cs
查看文件 @
2efb4cd
...
...
@@ -87,39 +87,60 @@ namespace OnlineStore.DeviceLibrary
{
if
(
HomeIsEnd
(
box
.
Config
.
UpDown_Axis
))
{
CurrStep
=(
StoreMoveStep
.
AP_03_MiddleMove
);
if
(
paramInfo
.
UpdownStartPosition
.
Equals
(
0
))
{
CurrStep
=
(
StoreMoveStep
.
AP_04_MiddleMove
);
ConfigMoveAxis
axis
=
box
.
Config
.
Middle_Axis
;
int
p
=
paramInfo
.
GetCurrMiddleP
();
LogUtil
.
info
(
LogName
+
CurrStep
+
" "
+
currIndex
+
":旋转轴移动到目标位置:"
+
p
);
AxisManager
.
instance
.
AbsMove
(
axis
.
DeviceName
,
(
short
)
axis
.
GetAxisValue
(),
p
,
box
.
Config
.
MiddleAxis_P1_Speed
,
axis
.
AddSpeed
,
axis
.
DelSpeed
);
}
else
{
CurrStep
=
(
StoreMoveStep
.
AP_03_UpdownMove
);
ConfigMoveAxis
iaxis
=
box
.
Config
.
UpDown_Axis
;
LogUtil
.
info
(
LogName
+
CurrStep
+
" "
+
currIndex
+
":升降轴移动到开始位置:"
+
paramInfo
.
UpdownStartPosition
);
AxisManager
.
instance
.
AbsMove
(
iaxis
.
DeviceName
,
(
short
)
iaxis
.
GetAxisValue
(),
paramInfo
.
UpdownStartPosition
,
box
.
Config
.
UpDownAxis_P1_Speed
,
iaxis
.
AddSpeed
,
iaxis
.
DelSpeed
);
}
}
}
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_03_UpdownMove
))
{
if
(
AbsMoveIsEnd
(
box
.
Config
.
UpDown_Axis
,
paramInfo
.
UpdownStartPosition
))
{
CurrStep
=
(
StoreMoveStep
.
AP_04_MiddleMove
);
ConfigMoveAxis
axis
=
box
.
Config
.
Middle_Axis
;
int
p
=
paramInfo
.
GetCurrMiddleP
();
LogUtil
.
info
(
LogName
+
CurrStep
+
" "
+
currIndex
+
":旋转轴移动到目标位置:"
+
p
);
AxisManager
.
instance
.
AbsMove
(
axis
.
DeviceName
,
(
short
)
axis
.
GetAxisValue
(),
p
,
box
.
Config
.
MiddleAxis_P1_Speed
,
axis
.
AddSpeed
,
axis
.
DelSpeed
);
}
}
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_0
3
_MiddleMove
))
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_0
4
_MiddleMove
))
{
int
p
=
paramInfo
.
GetCurrMiddleP
();
if
(
AbsMoveIsEnd
(
box
.
Config
.
Middle_Axis
,
p
))
{
CurrStep
=(
StoreMoveStep
.
AP_0
4
_InoutToP
);
CurrStep
=(
StoreMoveStep
.
AP_0
5
_InoutToP
);
ConfigMoveAxis
iaxis
=
box
.
Config
.
InOut_Axis
;
LogUtil
.
info
(
LogName
+
CurrStep
+
" "
+
currIndex
+
":进出轴移动到目标位置:"
+
paramInfo
.
InoutTargetPosition
);
AxisManager
.
instance
.
AbsMove
(
iaxis
.
DeviceName
,
(
short
)
iaxis
.
GetAxisValue
(),
paramInfo
.
InoutTargetPosition
,
box
.
Config
.
InOutAxis_P1_Speed
,
iaxis
.
AddSpeed
,
iaxis
.
DelSpeed
);
}
}
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_0
4
_InoutToP
))
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_0
5
_InoutToP
))
{
if
(
AbsMoveIsEnd
(
box
.
Config
.
InOut_Axis
,
paramInfo
.
InoutTargetPosition
))
{
CurrStep
=(
StoreMoveStep
.
AP_0
5
_UpdownMove
);
CurrStep
=(
StoreMoveStep
.
AP_0
6
_UpdownMove
);
ConfigMoveAxis
axis
=
box
.
Config
.
UpDown_Axis
;
LogUtil
.
info
(
LogName
+
CurrStep
+
" "
+
currIndex
+
":升降轴移动到目标位置:"
+
paramInfo
.
UpdownTargetPosition
);
AxisManager
.
instance
.
AbsMove
(
axis
.
DeviceName
,
(
short
)
axis
.
GetAxisValue
(),
paramInfo
.
UpdownTargetPosition
,
paramInfo
.
UpdownSpeed
,
axis
.
AddSpeed
,
axis
.
DelSpeed
);
toolTimer
.
Interval
=
50
;
}
}
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_0
5
_UpdownMove
))
else
if
(
CurrStep
.
Equals
(
StoreMoveStep
.
AP_0
6
_UpdownMove
))
{
try
{
...
...
@@ -286,7 +307,7 @@ namespace OnlineStore.DeviceLibrary
{
string
msgStr
=
"请确认以下对点位参数,点击“确定”按钮开始自动校准点位:\r\n"
;
msgStr
+=
" 进出轴前进位置:"
+
InoutTargetPosition
+
"\r\n"
;
msgStr
+=
" 升降轴目标位置:"
+
UpdownTargetPosition
+
",速度:"
+
UpdownSpeed
+
"\r\n"
;
msgStr
+=
" 升降轴
开始位置:"
+
UpdownStartPosition
+
",
目标位置:"
+
UpdownTargetPosition
+
",速度:"
+
UpdownSpeed
+
"\r\n"
;
msgStr
+=
" 旋转轴位置列表:"
;
foreach
(
int
mP
in
MiddlePositionList
)
...
...
source/DeviceLibrary/acSingleStore/BoxBean_Partial.cs
查看文件 @
2efb4cd
...
...
@@ -939,7 +939,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private
string
autoInoutCode
=
"AUTOINOUT"
;
private
void
InOutEndProcess
(
StoreMoveType
storeMoveType
)
private
void
InOutEndProcess
(
StoreMoveType
storeMoveType
)
{
try
{
...
...
@@ -952,49 +952,47 @@ namespace OnlineStore.DeviceLibrary
}
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
InStore
))
{
int
newIndex
=
autoPositionIndex
-
1
;
int
newIndex
=
autoPositionIndex
;
if
(
newIndex
<
0
)
{
if
(
AutoStartIndex
>=
0
&&
AutoStartIndex
<
PositionNumList
.
Count
)
{
newIndex
=
AutoStartIndex
;
LogUtil
.
info
(
Name
+
"下一个索引不存在,重新开始自动出入库,索引【"
+
AutoStartIndex
+
"】"
);
LogUtil
.
info
(
Name
+
"下一个索引不存在,重新开始自动出入库,索引【"
+
AutoStartIndex
+
"】"
);
}
else
{
autoNext
=
false
;
autoMsg
=
"自动出入库结束!"
;
LogUtil
.
info
(
Name
+
"下一个索引不存在,自动 出入库结束!"
);
LogUtil
.
info
(
Name
+
"下一个索引不存在,自动 出入库结束!"
);
return
;
}
}
else
{
autoPositionIndex
=
newIndex
;
string
posid
=
PositionNumList
[
autoPositionIndex
];
InOutPosInfo
inoutinfo
=
new
InOutPosInfo
(
autoInoutCode
,
posid
);
//判断是否需要重置
if
(
CurrInOutACount
>=
Config
.
Box_ResetACount
)
{
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutACount
+
"次,需要重置BOX,先把出库信息存入排队列表中"
);
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutACount
+
"次,需要重置BOX,先把出库信息存入排队列表中"
);
Reset
(
false
);
autoMsg
=
"自动出库:"
+
posid
;
AddWaitOutInfo
(
inoutinfo
);
}
else
if
(
CurrInOutCount
>=
Config
.
Box_ResetMCount
)
{
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutCount
+
"次,需要重置BOX旋转轴,先把出库信息存入排队列表中"
);
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutCount
+
"次,需要重置BOX旋转轴,先把出库信息存入排队列表中"
);
//ResetMiddleAxis(false);
autoMsg
=
"自动出库:"
+
posid
;
AddWaitOutInfo
(
inoutinfo
);
}
else
{
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
);
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
);
autoMsg
=
"自动出库:"
+
posid
;
StartOutStoreMove
(
new
InOutParam
(
inoutinfo
));
}
}
}
else
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
OutStore
))
{
int
newIndex
=
autoPositionIndex
-
autoJiange
;
...
...
@@ -1003,46 +1001,28 @@ namespace OnlineStore.DeviceLibrary
if
(
AutoStartIndex
>=
0
&&
AutoStartIndex
<
PositionNumList
.
Count
)
{
newIndex
=
AutoStartIndex
;
LogUtil
.
info
(
Name
+
"下一个索引不存在,重新开始自动出入库,索引【"
+
AutoStartIndex
+
"】"
);
LogUtil
.
info
(
Name
+
"下一个索引不存在,重新开始自动出入库,索引【"
+
AutoStartIndex
+
"】"
);
}
else
{
autoNext
=
false
;
autoMsg
=
"自动出入库结束!"
;
LogUtil
.
info
(
Name
+
"下一个索引不存在,自动 出入库结束!"
);
LogUtil
.
info
(
Name
+
"下一个索引不存在,自动 出入库结束!"
);
return
;
}
}
else
{
autoPositionIndex
=
newIndex
;
string
posid
=
PositionNumList
[
newIndex
];
InOutPosInfo
inoutinfo
=
new
InOutPosInfo
(
autoInoutCode
,
posid
);
//判断是否需要重置
if
(
CurrInOutACount
>=
Config
.
Box_ResetACount
)
{
LogUtil
.
info
(
Name
+
"自动进入下一个入库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutACount
+
"次,需要重置BOX,先把入库信息存入排队列表中"
);
Reset
(
false
);
autoMsg
=
"自动入库:"
+
posid
;
AddWaitOutInfo
(
inoutinfo
);
}
else
if
(
CurrInOutCount
>=
Config
.
Box_ResetMCount
)
{
LogUtil
.
info
(
Name
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutCount
+
"次,需要重置BOX旋转轴,先把出库信息存入排队列表中"
);
//ResetMiddleAxis(false);
autoMsg
=
"自动入库:"
+
posid
;
AddWaitOutInfo
(
inoutinfo
);
}
else
{
LogUtil
.
info
(
Name
+
"自动进入下一个入库:posid="
+
posid
);
LogUtil
.
info
(
Name
+
"自动进入下一个入库:posid="
+
posid
);
autoMsg
=
"自动入库:"
+
posid
;
StartInStoreMove
(
new
InOutParam
(
inoutinfo
));
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
ex
.
ToString
());
LogUtil
.
error
(
" InOutEndProcess Error "
+
ex
.
ToString
());
}
}
...
...
source/DeviceLibrary/bean/StoreStep.cs
查看文件 @
2efb4cd
...
...
@@ -393,21 +393,25 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
AP_02_UpdownHome
,
/// <summary>
/// 位置校准:升降轴移动到开始位置
/// </summary>
AP_03_UpdownMove
,
/// <summary>
/// 校准位置:旋转轴选择到对应位置
/// </summary>
AP_0
3
_MiddleMove
,
AP_0
4
_MiddleMove
,
/// <summary>
/// 校准位置:进出轴到前进位置
/// </summary>
AP_0
4
_InoutToP
,
AP_0
5
_InoutToP
,
/// <summary>
/// 校准位置:升降轴开始匀速移动到目标位置
/// </summary>
AP_0
5
_UpdownMove
,
AP_0
6
_UpdownMove
,
/// <summary>
/// 校准位置:保存当前列位置
/// </summary>
AP_0
6
_SaveAndNext
,
AP_0
7
_SaveAndNext
,
#
endregion
}
...
...
source/HCSingleStore/positionTool/FrmTool.Designer.cs
查看文件 @
2efb4cd
此文件的差异被折叠,
点击展开。
source/HCSingleStore/positionTool/FrmTool.cs
查看文件 @
2efb4cd
...
...
@@ -21,6 +21,8 @@ namespace OnlineStore.ACSingleStore
{
private
BoxAutoPoint
autoP
;
private
string
LogName
=
"自动对点位"
;
private
string
DefaultfilePath
=
""
;
private
bool
IsStart
=
false
;
private
BoxBean
Box
=
null
;
//private PToolInfo workInfo = new PToolInfo();
...
...
@@ -29,10 +31,16 @@ namespace OnlineStore.ACSingleStore
InitializeComponent
();
this
.
Box
=
box
;
autoP
=
new
BoxAutoPoint
(
box
);
DefaultfilePath
=
Application
.
StartupPath
+
@"\" + box.Name + @"
position
\
";
if
(!
Directory
.
Exists
(
DefaultfilePath
))
{
Directory
.
CreateDirectory
(
DefaultfilePath
);
LogUtil
.
info
(
LogName
+
"创建位置保存文件夹:"
+
DefaultfilePath
);
}
lblFileP
.
Text
=
DefaultfilePath
;
this
.
Text
=
name
+
"_自动对点位 "
;
LogName
=
this
.
Text
;
txtUpdownStart
.
Text
=
0.
ToString
();
FrmTool
.
CheckForIllegalCrossThreadCalls
=
false
;
}
private
int
P3Offset
=
0
;
...
...
@@ -114,7 +122,8 @@ namespace OnlineStore.ACSingleStore
group3
.
Enabled
=
!
isStart
;
group4
.
Enabled
=
!
isStart
;
group5
.
Enabled
=
true
;
group6
.
Enabled
=
!
isStart
;
//group6.Enabled = !isStart ;
group6
.
Enabled
=
true
;
btnStart
.
Enabled
=
!
isStart
;
btnStop
.
Enabled
=
isStart
;
axisJogControl1
.
Enabled
=
!
isStart
;
...
...
@@ -143,7 +152,7 @@ namespace OnlineStore.ACSingleStore
{
workMoveStatus
(
false
);
}
if
(
lblFileP
.
Text
.
Equals
(
""
)
)
if
(
!
IsStart
)
{
lblMoveInfo
.
Text
=
"请按步骤确认位置信息,然后点击“开始校对位置”按钮启动位置校准"
;
}
...
...
@@ -182,8 +191,15 @@ namespace OnlineStore.ACSingleStore
private
void
btnOpenFolder_Click
(
object
sender
,
EventArgs
e
)
{
if
(
IsStart
)
{
System
.
Diagnostics
.
Process
.
Start
(
"Explorer.exe"
,
autoP
.
paramInfo
.
FileTargetPath
);
}
else
{
System
.
Diagnostics
.
Process
.
Start
(
"Explorer.exe"
,
DefaultfilePath
);
}
}
private
void
btnExit_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -269,13 +285,14 @@ namespace OnlineStore.ACSingleStore
txtInout
.
Focus
();
return
;
}
int
speed
=
FormUtil
.
GetIntValue
(
txtSpeed
);
if
(
speed
<=
(
0
)
)
int
SPostion
=
FormUtil
.
GetIntValue
(
txtUpdownStart
);
if
(
SPostion
<
0
)
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
"请输入正确的速度"
)
,
"提示"
);
txt
Speed
.
Focus
();
MessageBox
.
Show
(
"请输入正确的升降轴开始位置"
,
"提示"
);
txt
UpdownStart
.
Focus
();
return
;
}
txtUpdownStart
.
Text
=
SPostion
.
ToString
();
int
TPostion
=
FormUtil
.
GetIntValue
(
txtTargetPosition
);
if
(
TPostion
<=
0
)
{
...
...
@@ -283,7 +300,13 @@ namespace OnlineStore.ACSingleStore
txtTargetPosition
.
Focus
();
return
;
}
int
speed
=
FormUtil
.
GetIntValue
(
txtSpeed
);
if
(
speed
<=
(
0
))
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
"请输入正确的速度"
),
"提示"
);
txtSpeed
.
Focus
();
return
;
}
P3Offset
=
FormUtil
.
GetIntValue
(
txtP3Offset
);
P4Offset
=
FormUtil
.
GetIntValue
(
txtP4Offset
);
P5Offset
=
FormUtil
.
GetIntValue
(
txtP5Offset
);
...
...
@@ -293,6 +316,7 @@ namespace OnlineStore.ACSingleStore
autoP
.
paramInfo
=
new
PToolInfo
();
autoP
.
paramInfo
.
InoutTargetPosition
=
inoutP
;
autoP
.
paramInfo
.
UpdownStartPosition
=
SPostion
;
autoP
.
paramInfo
.
UpdownTargetPosition
=
TPostion
;
autoP
.
paramInfo
.
UpdownSpeed
=
speed
;
autoP
.
paramInfo
.
MiddlePositionList
=
new
List
<
int
>();
...
...
@@ -324,10 +348,10 @@ namespace OnlineStore.ACSingleStore
autoP
.
paramInfo
.
LastValue
=
IO_VALUE
.
LOW
;
string
date
=
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmm"
);
string
filePath
=
Application
.
StartupPath
+
@"\position\"
+ date + @"
\
";
string
filePath
=
DefaultfilePath
+
date
+
@"\"
;
if
(
Directory
.
Exists
(
filePath
))
{
DialogResult
result
=
MessageBox
.
Show
(
"文件夹【"
+
filePath
+
"】已存在,将
清除文件夹内容,是否确定清除
?"
,
DialogResult
result
=
MessageBox
.
Show
(
"文件夹【"
+
filePath
+
"】已存在,将
覆盖文件夹内容,是否确定继续
?"
,
"确认提示"
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
);
if
(!
result
.
Equals
(
DialogResult
.
OK
))
{
...
...
@@ -346,7 +370,8 @@ namespace OnlineStore.ACSingleStore
autoP
.
StopMove
();
LogUtil
.
info
(
LogName
+
"开始校对位置:"
+
msg
+
" 启动定时器 "
);
autoP
.
Start
();
lblFileP
.
Text
=
"目标文件夹:"
+
filePath
;
lblFileP
.
Text
=
filePath
;
IsStart
=
true
;
}
}
...
...
source/HCSingleStore/positionTool/FrmTool.resx
查看文件 @
2efb4cd
...
...
@@ -126,15 +126,6 @@
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_position.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
...
...
source/HCSingleStore/记录.txt
查看文件 @
2efb4cd
...
...
@@ -58,3 +58,11 @@
自动复位有问题。
保存位置弹出提示框。
20201025
1.点位调试:左右侧BOX位置分文件夹保存。
2.点位调试:增加升降轴开始位置,方便仓门列的库位调试。
3.点位调试:打开文件夹默认可用。
4.自动出入库修改。
source/HuichuanLibrary/HCBoardManager.cs
查看文件 @
2efb4cd
...
...
@@ -426,6 +426,11 @@ namespace HuichuanLibrary
Console
.
WriteLine
(
BoardName
()
+
msg
);
HCLogUtil
.
info
(
BoardName
()
+
msg
);
}
private
static
void
DebugLog
(
string
msg
)
{
Console
.
WriteLine
(
BoardName
()
+
msg
);
HCLogUtil
.
debug
(
BoardName
()
+
msg
);
}
}
public
class
AxisSts
{
...
...
source/HuichuanLibrary/HCBoardManager_Axis.cs
查看文件 @
2efb4cd
...
...
@@ -255,7 +255,7 @@ namespace HuichuanLibrary
}
else
{
Show
Log
(
" Axis["
+
axisNo
+
"] StartPtpMove "
+
ptpType
+
" OK"
);
Debug
Log
(
" Axis["
+
axisNo
+
"] StartPtpMove "
+
ptpType
+
" OK"
);
return
true
;
}
}
...
...
@@ -274,7 +274,7 @@ namespace HuichuanLibrary
}
else
{
Show
Log
(
" Axis["
+
axisNo
+
"] SetSingleAxMvPara OK"
);
Debug
Log
(
" Axis["
+
axisNo
+
"] SetSingleAxMvPara OK"
);
return
true
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论