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;