From 4e4d003c99ef176e71f8421b46298e8ff1fab78b Mon Sep 17 00:00:00 2001 From: "HJB\\13752" <13752551070@163.com> Date: Wed, 25 Mar 2026 13:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E6=AC=A1=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E7=9A=84=E6=8C=89=E9=94=AE=EF=BC=8C=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=8E=89=E6=89=8B=E5=8A=A8=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=8E=A2?= =?UTF-8?q?=E8=BE=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/FSM/Src/fsm_state_control.c | 68 ++++++++++++------- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/DetectionThickness/DetectionWithThickness/Core/FSM/Src/fsm_state_control.c b/DetectionThickness/DetectionWithThickness/Core/FSM/Src/fsm_state_control.c index 163ab7f..0e36be7 100644 --- a/DetectionThickness/DetectionWithThickness/Core/FSM/Src/fsm_state_control.c +++ b/DetectionThickness/DetectionWithThickness/Core/FSM/Src/fsm_state_control.c @@ -292,13 +292,27 @@ int thicknessDataCollection_Continuous_control() } + + int thicknessDataCollection_Single_control() { + static uint8_t Single_thickness_flag = 0; + uint8_t Single_thickness_res = 1; - if (P_MK32->CH9_SF == 1000) //按下 + if (P_MK32->CH4_SA == 1000) //按下 { - thicknessDataCollection_Single_Sensor(); - return 1; + Single_thickness_flag = 1; + } + + if(Single_thickness_flag == 1) + { + Single_thickness_res = thicknessDataCollection_Single_Sensor(); + if(Single_thickness_res == 0) + { + Single_thickness_flag = 0; + Single_thickness_res = 1; + return 1; + } } else { @@ -308,14 +322,16 @@ int thicknessDataCollection_Single_control() - - - - - - - - +// if (P_MK32->CH9_SF == 1000) //按下 +// { +// thicknessDataCollection_Single_Sensor(); +// return 1; +// } +// else +// { +// thicknessDataCollection_Single_Reset(); +// return 0; +// } } @@ -395,21 +411,21 @@ int LGUB500_Distance_Limit_Handle() // return 0; // } - - if(GV.sensor_lgub500.InstanceDistance/10.0 > GV.PV.LGUB500_UpperLimit_mm)/*大于上限停*/ - { - IV.RunMode = Move_Halt; - IV.RobotMoveSpeed = 0; - fsm_state_set(¤t_robot_move_state, &robot_halt_state); - return 1; - } - else if(GV.sensor_lgub500.InstanceDistance/10.0 < GV.PV.LGUB500_LowerLimit_mm)/*小于下线停*/ - { - IV.RunMode = Move_Halt; - IV.RobotMoveSpeed = 0; - fsm_state_set(¤t_robot_move_state, &robot_halt_state); - return 1; - } +// 注释以下代码,删除手动模式下探边功能 +// if(GV.sensor_lgub500.InstanceDistance/10.0 > GV.PV.LGUB500_UpperLimit_mm)/*大于上限停*/ +// { +// IV.RunMode = Move_Halt; +// IV.RobotMoveSpeed = 0; +// fsm_state_set(¤t_robot_move_state, &robot_halt_state); +// return 1; +// } +// else if(GV.sensor_lgub500.InstanceDistance/10.0 < GV.PV.LGUB500_LowerLimit_mm)/*小于下线停*/ +// { +// IV.RunMode = Move_Halt; +// IV.RobotMoveSpeed = 0; +// fsm_state_set(¤t_robot_move_state, &robot_halt_state); +// return 1; +// } else { return 0;