Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f7c25fd2
由
LN
编写于
2020-09-24 10:40:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
叉子前进前增加验证。
1 个父辈
536c7edc
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
52 行增加
和
29 行删除
source/ACSingleStore/FrmStoreBox.cs
source/Common/util/LogUtil.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
f7c25fd
...
...
@@ -252,7 +252,7 @@ namespace OnlineStore.ACSingleStore
string
msg
=
"等待入库:"
;
foreach
(
string
s
in
list
)
{
msg
+=
s
+
"
\t
"
;
msg
+=
s
+
"
"
;
}
lblWarnMsg
.
Text
=
msg
;
}
...
...
source/Common/util/LogUtil.cs
查看文件 @
f7c25fd
...
...
@@ -32,20 +32,20 @@ namespace OnlineStore.Common
return
;
}
log
.
Info
(
log
.
Logger
.
Name
+
" - "
+
msg
);
log
.
Info
(
msg
);
AddToBox
(
msg
,
Color
.
Black
);
//clear();
}
public
static
void
info
(
ILog
log
,
string
msg
,
Color
color
)
{
log
.
Info
(
log
.
Logger
.
Name
+
" - "
+
msg
);
log
.
Info
(
msg
);
AddToBox
(
msg
,
color
);
}
public
static
void
debug
(
ILog
log
,
string
msg
,
Color
color
)
{
log
.
Debug
(
log
.
Logger
.
Name
+
" - "
+
msg
);
log
.
Debug
(
msg
);
if
(
debug_opened
)
{
AddToBox
(
msg
,
color
);
...
...
@@ -53,7 +53,7 @@ namespace OnlineStore.Common
}
public
static
void
debug
(
ILog
log
,
string
msg
)
{
log
.
Debug
(
log
.
Logger
.
Name
+
" - "
+
msg
);
log
.
Debug
(
msg
);
if
(
debug_opened
)
{
AddToBox
(
msg
,
Color
.
Gray
);
...
...
@@ -93,7 +93,7 @@ namespace OnlineStore.Common
}
public
static
void
error
(
ILog
log
,
string
errorMsg
)
{
log
.
Error
(
log
.
Logger
.
Name
+
" - "
+
errorMsg
);
log
.
Error
(
errorMsg
);
AddToBox
(
errorMsg
,
Color
.
Red
);
}
private
static
void
AddToBox
(
string
msg
,
Color
color
)
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
f7c25fd
...
...
@@ -406,16 +406,24 @@ namespace OnlineStore.DeviceLibrary
OpenAndCloseSTB
(
portName
,
slvAddr
);
}
public
static
bool
isInPosition
(
ConfigMoveAxis
Axis
,
int
PPosition
)
public
static
bool
isInPosition
(
ConfigMoveAxis
Axis
,
int
PPosition
,
bool
isLog
=
false
)
{
int
outCount
=
ACServerManager
.
GetActualtPosition
(
Axis
.
DeviceName
,
Axis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
-
PPosition
);
int
errorCount
=
Math
.
Abs
(
outCount
-
PPosition
);
if
(
errorCount
<=
Axis
.
CanErrorCountMin
)
{
if
(
isLog
)
{
LogUtil
.
info
(
"【"
+
Axis
.
GetNameStr
()
+
"】isInPosition【"
+
PPosition
+
"】,当前实时位置:【"
+
outCount
+
"】 return true"
);
}
return
true
;
}
else
{
if
(
isLog
)
{
LogUtil
.
info
(
"【"
+
Axis
.
GetNameStr
()
+
"】isInPosition【"
+
PPosition
+
"】,当前实时位置:【"
+
outCount
+
"】 return false"
);
}
return
false
;
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
f7c25fd
...
...
@@ -344,9 +344,25 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_02_InOutAxisHome
);
OpenDoor
();
InOutBackToP1
(
moveP
.
InOut_P1
);
}
}
private
void
SI_05_DeviceToDoor
()
{
if
(!
ACServerManager
.
isInPosition
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P1
,
true
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_03_ReturnHome
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
InStoreLog
(
"入库:SI_03已结束,发现升降轴不在待机点,重新运动 升降轴到P1 ["
+
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P1
+
"] "
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
return
;
}
if
(!
ACServerManager
.
isInPosition
(
Config
.
Middle_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
Middle_P1
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_03_ReturnHome
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
InStoreLog
(
"入库:SI_03已结束,发现旋转轴不在待机点,重新运动 旋转轴到P1 ["
+
StoreMove
.
MoveParam
.
MoveP
.
Middle_P1
+
"]"
);
ACAxisMove
(
Config
.
Middle_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
return
;
}
if
(
DoorIsOpen
())
{
//判断仓门是否打开
...
...
@@ -412,39 +428,38 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
CodeMsg
);
}
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_03_ReturnHome
);
InStoreLog
(
"入库:SI_03 所有轴回到待机点,升降轴到P1 ["
+
moveP
.
UpDown_P1
+
"],旋转轴到P1 ["
+
moveP
.
Middle_P1
+
"],,压紧轴到P3 ["
+
moveP
.
ComPress_P3
+
"]"
);
InStoreLog
(
"入库:SI_03 所有轴回到待机点,升降轴到P1 ["
+
moveP
.
UpDown_P1
+
"],旋转轴到P1 ["
+
moveP
.
Middle_P1
+
"],,压紧轴到P3 ["
+
moveP
.
ComPress_P3
+
"]
,打开仓门
"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_03_ReturnHome
)
{
if
(!
ACServerManager
.
isInPosition
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_03_ReturnHome
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
InStoreLog
(
"入库:SI_03已结束,发现升降轴不在待机点,重新运动 升降轴到P1 ["
+
moveP
.
UpDown_P1
+
"] "
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
return
;
}
else
{
InStoreLog
(
"入库:SI_03 升降轴已在P1["
+
moveP
.
UpDown_P1
+
"]"
);
}
if
(!
ACServerManager
.
isInPosition
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_03_ReturnHome
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
InStoreLog
(
"入库:SI_03已结束,发现旋转轴不在待机点,重新运动 旋转轴到P1 ["
+
moveP
.
Middle_P1
+
"]"
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
return
;
}
if
(
IsHasCompress_Axis
)
else
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_04_CompressWare
);
InStoreLog
(
"入库:SI_04_CompressWare 压紧轴至P3(压紧前点)["
+
moveP
.
ComPress_P3
+
"] 开始"
);
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
OpenDoor
();
InStoreLog
(
"入库:SI_03 旋转轴已在P1 ["
+
moveP
.
Middle_P1
+
"]"
);
}
else
OpenDoor
();
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_03_ReturnHome
)
{
//if (IsHasCompress_Axis)
//{
//StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
//InStoreLog("入库:SI_04_CompressWare 压紧轴至P3(压紧前点)[" + moveP.ComPress_P3 + "] 开始");
//ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
//OpenDoor();
//}
//else
{
SI_05_DeviceToDoor
();
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论