Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 371a409a
由
LN
编写于
2024-12-05 11:14:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
折叠门光栅处理。
1 个父辈
e40760ab
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
84 行增加
和
10 行删除
DeviceLibrary/DeviceLibrary/CylinderManger.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_String.cs
TheMachine/IOControls.cs
TheMachineNView/IOControls.cs
DeviceLibrary/DeviceLibrary/CylinderManger.cs
查看文件 @
371a409
...
...
@@ -42,7 +42,22 @@ namespace DeviceLibrary
Resume
();
LogUtil
.
info
(
$
"{Name},设置{High}=Low"
);
}
public
bool
NeedStop
()
{
if
(
currentIOvalue
==
IO_VALUE
.
None
)
{
return
false
;
}
else
if
(
currentIOvalue
==
IO_VALUE
.
HIGH
&&
IOManager
.
IOValue
(
High
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
false
;
}
else
if
(
currentIOvalue
==
IO_VALUE
.
LOW
&&
IOManager
.
IOValue
(
Low
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
false
;
}
return
true
;
}
public
void
Pause
()
{
LogUtil
.
info
(
$
"{Name},停止运行"
);
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
371a409
...
...
@@ -66,6 +66,7 @@ namespace DeviceLibrary
public
LineRunMonitor
Line
;
public
CylinderManger
SingleDoor
;
public
CylinderManger
FlipDoor
;
public
CylinderManger
CyStringDoor
;
public
LiftMonitor
MotorFlipDoorA
;
public
LiftMonitor
MotorFlipDoorB
;
public
LiftMonitor
StringDoor
;
...
...
@@ -157,14 +158,17 @@ namespace DeviceLibrary
var
sf
=
""
;
if
(
Setting_Init
.
StringDoor_X08IsStringDoor_SafetyLightCurtains
)
sf
=
IO_Type
.
AGV_OnPosition
;
StringDoor
=
new
LiftMonitor
(
IO_Type
.
StringDoor_Open
,
IO_Type
.
StringDoor_Close
,
sf
,
IO_Type
.
StringDoor_Axis_Break
,
new
AxisBean
(
Config
.
StringDoor_Axis
,
Name
),
Config
.
StringDoorLength
,
Config
.
StringDoorLength_speed
,
0
,
"折叠门"
,
true
);
StringDoor
=
new
LiftMonitor
(
IO_Type
.
StringDoor_Open
,
IO_Type
.
StringDoor_Close
,
sf
,
IO_Type
.
StringDoor_Axis_Break
,
new
AxisBean
(
Config
.
StringDoor_Axis
,
Name
),
Config
.
StringDoorLength
,
Config
.
StringDoorLength_speed
,
0
,
"折叠门"
,
true
);
StringDoor
.
DownOverTimeMS
=
Setting_Init
.
StringDoor_DownOverTimeMS
;
StringDoor
.
UpOverTimeMS
=
Setting_Init
.
StringDoor_UpOverTimeMS
;
StringDoor
.
ResumeWaitTimeSec
=
5
;
LogUtil
.
info
(
"加载料串门类型为:步进"
);
}
else
{
LogUtil
.
info
(
"加载料串门类型为:气缸"
);
CyStringDoor
=
new
CylinderManger
(
$
"折叠门"
,
IO_Type
.
StringDoor_Open
,
IO_Type
.
StringDoor_Close
);
}
if
(!
Setting_Init
.
StringDoor_X08IsStringDoor_SafetyLightCurtains
)
{
RobotManage
.
Config
.
DIList
.
Remove
(
IO_Type
.
AGV_OnPosition
);
...
...
@@ -820,7 +824,8 @@ namespace DeviceLibrary
if
(
Setting_Init
.
StringDoor_X08IsStringDoor_SafetyLightCurtains
)
{
//IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.LOW) &&
if
(
IOValue
(
IO_Type
.
AGV_OnPosition
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
StringDoor_Close
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
AGV_OnPosition
).
Equals
(
IO_VALUE
.
LOW
))
//if (IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.LOW))
{
Msg
.
add
(
crc
.
GetString
(
L
.
stringDoorSafety
,
"料串门光栅被遮挡"
),
MsgLevel
.
warning
);
if
(
lastStringSafetyStatus
)
...
...
@@ -855,6 +860,10 @@ namespace DeviceLibrary
{
StringDoor
.
ResumeSingle
();
}
else
{
CyStringDoor
.
Resume
();
}
lastStringSafetyStatus
=
true
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
371a409
...
...
@@ -797,7 +797,8 @@ namespace DeviceLibrary
}
else
{
CylinderMove
(
moveInfo
,
IO_Type
.
StringDoor_Close
,
IO_Type
.
StringDoor_Open
,
IO_VALUE
.
HIGH
);
//CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.HIGH);
CyStringDoor
.
ToHigh
(
moveInfo
);
}
}
public
void
StringDoorClose
(
MoveInfo
moveInfo
)
...
...
@@ -813,7 +814,8 @@ namespace DeviceLibrary
}
else
{
CylinderMove
(
moveInfo
,
IO_Type
.
StringDoor_Close
,
IO_Type
.
StringDoor_Open
,
IO_VALUE
.
LOW
);
//CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
CyStringDoor
.
ToLow
(
moveInfo
);
}
}
public
void
StringDoorPause
()
...
...
@@ -829,9 +831,10 @@ namespace DeviceLibrary
}
else
{
IOMove
(
IO_Type
.
StringDoor_Close
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StringDoor_Open
,
IO_VALUE
.
LOW
);
CyStringDoor
.
Pause
();
//IOMove(IO_Type.StringDoor_Close, IO_VALUE.LOW);
//IOMove(IO_Type.StringDoor_Open, IO_VALUE.LOW);
}
}
}
}
}
\ No newline at end of file
TheMachine/IOControls.cs
查看文件 @
371a409
...
...
@@ -33,16 +33,19 @@ namespace TheMachine
private
void
btn_linerun_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"点击按钮:"
+
btn_linerun
.
Text
);
RobotManage
.
mainMachine
.
Line
.
LineRun
(
"n"
,
false
,
999
);
}
private
void
btn_linerev_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"点击按钮:"
+
btn_linerev
.
Text
);
RobotManage
.
mainMachine
.
Line
.
LineRun
(
"n"
,
true
,
999
);
}
private
void
btn_linestop_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"点击按钮:"
+
btn_linestop
.
Text
);
RobotManage
.
mainMachine
.
Line
.
LineStop
(
"n"
);
}
...
...
TheMachineNView/IOControls.cs
查看文件 @
371a409
...
...
@@ -6,9 +6,11 @@ using System;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Diagnostics
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
...
...
@@ -29,8 +31,38 @@ namespace TheMachineNView
public
IOControls
()
{
InitializeComponent
();
ioControllerTimer
=
new
System
.
Threading
.
Timer
(
new
TimerCallback
(
IOPRocess
),
null
,
0
,
1000
);
GC
.
KeepAlive
(
ioControllerTimer
);
}
private
void
IOPRocess
(
object
state
)
{
if
(
RobotManage
.
mainMachine
!=
null
&&
RobotManage
.
mainMachine
.
runStatus
.
Equals
(
RunStatus
.
Stop
))
{
if
(
IOManager
.
IOValue
(
IO_Type
.
AGV_OnPosition
).
Equals
(
IO_VALUE
.
LOW
))
{
//如果折叠门再打开状态
if
(
RobotManage
.
mainMachine
.
CyStringDoor
!=
null
&&
RobotManage
.
mainMachine
.
CyStringDoor
.
NeedStop
())
{
RobotManage
.
mainMachine
.
CyStringDoor
.
Pause
();
}
}
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(
RobotManage
.
mainMachine
.
SingleDoor
!=
null
&&
RobotManage
.
mainMachine
.
SingleDoor
.
NeedStop
())
{
RobotManage
.
mainMachine
.
SingleDoor
.
Pause
();
}
}
}
}
System
.
Threading
.
Timer
ioControllerTimer
;
private
void
btn_linerun_Click
(
object
sender
,
EventArgs
e
)
{
RobotManage
.
mainMachine
.
Line
.
LineRun
(
"n"
,
false
,
999
);
...
...
@@ -64,23 +96,35 @@ namespace TheMachineNView
private
void
btn_stringdooropen_Click
(
object
sender
,
EventArgs
e
)
{
//判断光栅是否关闭
if
(
IOManager
.
IOValue
(
IO_Type
.
AGV_OnPosition
).
Equals
(
IO_VALUE
.
LOW
))
{
MessageBox
.
Show
(
crc
.
GetString
(
"OpeartionFail"
,
"操作失败"
));
return
;
}
LogUtil
.
info
(
"手动控制:折叠门门打开"
);
RobotManage
.
mainMachine
.
StringDoorOpen
(
null
);
}
private
void
btn_stringdoorclose_Click
(
object
sender
,
EventArgs
e
)
{
//判断光栅是否关闭
if
(
IOManager
.
IOValue
(
IO_Type
.
AGV_OnPosition
).
Equals
(
IO_VALUE
.
LOW
))
{
MessageBox
.
Show
(
crc
.
GetString
(
"OpeartionFail"
,
"操作失败"
));
return
;
}
LogUtil
.
info
(
"手动控制:折叠门门关闭"
);
RobotManage
.
mainMachine
.
StringDoorClose
(
null
);
}
private
void
btn_ngdooropen_Click
(
object
sender
,
EventArgs
e
)
{
{
RobotManage
.
mainMachine
.
OpenSingleDoor
(
null
);
}
private
void
btn_ngdoorclose_Click
(
object
sender
,
EventArgs
e
)
{
{
RobotManage
.
mainMachine
.
CloseSingleDoor
(
null
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论