diff --git a/Paint_UDPV2_02/.gitignore b/Paint_UDPV2_02/.gitignore new file mode 100644 index 0000000..3df573f --- /dev/null +++ b/Paint_UDPV2_02/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/Paint_UDPV2_02/Core/FSM/Src/fsm_state_control.c b/Paint_UDPV2_02/Core/FSM/Src/fsm_state_control.c index f32f395..1724c22 100644 --- a/Paint_UDPV2_02/Core/FSM/Src/fsm_state_control.c +++ b/Paint_UDPV2_02/Core/FSM/Src/fsm_state_control.c @@ -39,8 +39,11 @@ int CH13_S2_Value ; int32_t speed_selection=0; //旋钮速度0-30 int paintOffCount=0; //5° 计数 超过1s 关枪 uint8_t angle_protect_lock=0; //作业时角度偏差过5°,停车标记位 + + int32_t power_on_lock = 0; /*上电锁*/ uint8_t error = 99; + int32_t serial_udp_disconnect_count=0;//串口网口断联一段时间后(15s)变为手动固定速度 @@ -428,7 +431,7 @@ void IV_control() IV.Left_Motor_Err = GV.LeftMotor.Motor_Fault; IV.Right_Motor_Err = GV.RightMotor.Motor_Fault; IV.TimeStamp = SystemTimeMiliCount; - IV.STM_Version = 201; + IV.STM_Version = 202; } /* 测试喷枪控制* */ void PaintGunControl() diff --git a/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.o b/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.o index b5eacde..9915033 100644 Binary files a/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.o and b/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.o differ diff --git a/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.su b/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.su index b98247e..ec3a3b8 100644 --- a/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.su +++ b/Paint_UDPV2_02/Debug/Core/FSM/Src/fsm_state_control.su @@ -1,13 +1,13 @@ -../Core/FSM/Src/fsm_state_control.c:47:6:Fsm_Init 8 static -../Core/FSM/Src/fsm_state_control.c:66:6:GF_Dispatch 8 static -../Core/FSM/Src/fsm_state_control.c:183:6:MoveControl 8 static -../Core/FSM/Src/fsm_state_control.c:217:9:MotorErrorDetect 4 static -../Core/FSM/Src/fsm_state_control.c:235:6:paintrobot_forwards 8 static -../Core/FSM/Src/fsm_state_control.c:254:6:paintrobot_backwards 8 static -../Core/FSM/Src/fsm_state_control.c:277:6:paint_joysticker_manual_control 16 static -../Core/FSM/Src/fsm_state_control.c:315:6:serial_udp_disconnect_control 16 static -../Core/FSM/Src/fsm_state_control.c:353:5:Move_Halt_AngleError 8 static -../Core/FSM/Src/fsm_state_control.c:399:6:PV_Data_Reading 12 static -../Core/FSM/Src/fsm_state_control.c:417:6:IV_control 16 static -../Core/FSM/Src/fsm_state_control.c:434:6:PaintGunControl 8 static -../Core/FSM/Src/fsm_state_control.c:456:6:AbnormalDetect 8 static +../Core/FSM/Src/fsm_state_control.c:50:6:Fsm_Init 8 static +../Core/FSM/Src/fsm_state_control.c:69:6:GF_Dispatch 8 static +../Core/FSM/Src/fsm_state_control.c:186:6:MoveControl 8 static +../Core/FSM/Src/fsm_state_control.c:220:9:MotorErrorDetect 4 static +../Core/FSM/Src/fsm_state_control.c:238:6:paintrobot_forwards 8 static +../Core/FSM/Src/fsm_state_control.c:257:6:paintrobot_backwards 8 static +../Core/FSM/Src/fsm_state_control.c:280:6:paint_joysticker_manual_control 16 static +../Core/FSM/Src/fsm_state_control.c:318:6:serial_udp_disconnect_control 16 static +../Core/FSM/Src/fsm_state_control.c:356:5:Move_Halt_AngleError 8 static +../Core/FSM/Src/fsm_state_control.c:402:6:PV_Data_Reading 12 static +../Core/FSM/Src/fsm_state_control.c:420:6:IV_control 16 static +../Core/FSM/Src/fsm_state_control.c:437:6:PaintGunControl 8 static +../Core/FSM/Src/fsm_state_control.c:459:6:AbnormalDetect 8 static diff --git a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.bin b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.bin index e2104ad..2cfd435 100644 Binary files a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.bin and b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.bin differ diff --git a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.elf b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.elf index 7fefeb5..8645695 100644 Binary files a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.elf and b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.elf differ diff --git a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.list b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.list index 24d3bae..d7b14d3 100644 --- a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.list +++ b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.list @@ -25,9 +25,9 @@ Idx Name Size VMA LMA File off Algn ALLOC 10 .ARM.attributes 0000002e 00000000 00000000 00040208 2**0 CONTENTS, READONLY - 11 .debug_info 0005e586 00000000 00000000 00040236 2**0 + 11 .debug_info 0005e587 00000000 00000000 00040236 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS - 12 .debug_abbrev 0000d17d 00000000 00000000 0009e7bc 2**0 + 12 .debug_abbrev 0000d17d 00000000 00000000 0009e7bd 2**0 CONTENTS, READONLY, DEBUGGING, OCTETS 13 .debug_aranges 00003788 00000000 00000000 000ab940 2**3 CONTENTS, READONLY, DEBUGGING, OCTETS @@ -23165,7 +23165,7 @@ void fsm_state_init(transition_t* p_this,transition_state_t* inti_state) ... 08029728 : -uint8_t error = 99; + int32_t serial_udp_disconnect_count=0;//串口网口断联一段时间后(15s)变为手动固定速度 @@ -24417,9 +24417,9 @@ void IV_control() 8029fec: 4615 mov r5, r2 8029fee: 4b0a ldr r3, [pc, #40] ; (802a018 ) 8029ff0: e9c3 4508 strd r4, r5, [r3, #32] - IV.STM_Version = 201; + IV.STM_Version = 202; 8029ff4: 4b08 ldr r3, [pc, #32] ; (802a018 ) - 8029ff6: 22c9 movs r2, #201 ; 0xc9 + 8029ff6: 22ca movs r2, #202 ; 0xca 8029ff8: 62da str r2, [r3, #44] ; 0x2c } 8029ffa: bf00 nop diff --git a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.map b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.map index 73ba9f8..f0db9d6 100644 --- a/Paint_UDPV2_02/Debug/Paint_UDPV2_02.map +++ b/Paint_UDPV2_02/Debug/Paint_UDPV2_02.map @@ -42654,7 +42654,7 @@ LOAD d:/st/stm32cubeide_1.10.1/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.ext LOAD d:/st/stm32cubeide_1.10.1/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard\libm.a LOAD d:/st/stm32cubeide_1.10.1/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m+dp/hard\libgcc.a -.debug_info 0x0000000000000000 0x5e586 +.debug_info 0x0000000000000000 0x5e587 .debug_info 0x0000000000000000 0x528 ./Core/BASE/Protobuf/PSource/bsp_CV.pb.o .debug_info 0x0000000000000528 0x3e5 ./Core/BASE/Protobuf/PSource/bsp_Cmd.pb.o .debug_info 0x000000000000090d 0x392 ./Core/BASE/Protobuf/PSource/bsp_Error.pb.o @@ -42696,67 +42696,67 @@ LOAD d:/st/stm32cubeide_1.10.1/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.ext .debug_info 0x0000000000018f69 0x169d ./Core/BASE/Src/MSP/msp_WH_LTE_7S0.o .debug_info 0x000000000001a606 0xae2 ./Core/FSM/Src/change_line_control.o .debug_info 0x000000000001b0e8 0x195 ./Core/FSM/Src/fsm_state.o - .debug_info 0x000000000001b27d 0xe3a ./Core/FSM/Src/fsm_state_control.o - .debug_info 0x000000000001c0b7 0x16bc ./Core/FSM/Src/motors.o - .debug_info 0x000000000001d773 0x28d ./Core/FSM/Src/motors_power_action.o - .debug_info 0x000000000001da00 0x273 ./Core/FSM/Src/paint_gun_action.o - .debug_info 0x000000000001dc73 0xe62 ./Core/FSM/Src/robot_move_actions.o - .debug_info 0x000000000001ead5 0x120e ./Core/Src/adc.o - .debug_info 0x000000000001fce3 0x867 ./Core/Src/dma.o - .debug_info 0x000000000002054a 0x15d4 ./Core/Src/fdcan.o - .debug_info 0x0000000000021b1e 0x6c5 ./Core/Src/gpio.o - .debug_info 0x00000000000221e3 0x13fa ./Core/Src/i2c.o - .debug_info 0x00000000000235dd 0x1fa ./Core/Src/iwdg.o - .debug_info 0x00000000000237d7 0x2f94 ./Core/Src/main.o - .debug_info 0x000000000002676b 0x1060 ./Core/Src/quadspi.o - .debug_info 0x00000000000277cb 0x4a4 ./Core/Src/stm32h7xx_hal_msp.o - .debug_info 0x0000000000027c6f 0x2886 ./Core/Src/stm32h7xx_it.o - .debug_info 0x000000000002a4f5 0x6ee ./Core/Src/syscalls.o - .debug_info 0x000000000002abe3 0x175 ./Core/Src/sysmem.o - .debug_info 0x000000000002ad58 0xd07 ./Core/Src/system_stm32h7xx.o - .debug_info 0x000000000002ba5f 0x1167 ./Core/Src/tim.o - .debug_info 0x000000000002cbc6 0x18e3 ./Core/Src/usart.o - .debug_info 0x000000000002e4a9 0x22 ./Core/Startup/startup_stm32h743vgtx.o - .debug_info 0x000000000002e4cb 0x648 ./Drivers/BSP/Components/lan8742/lan8742.o - .debug_info 0x000000000002eb13 0x15d7 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.o - .debug_info 0x00000000000300ea 0x1f9c ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.o - .debug_info 0x0000000000032086 0x116d ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.o - .debug_info 0x00000000000331f3 0xcd5 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.o - .debug_info 0x0000000000033ec8 0x2b55 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.o - .debug_info 0x0000000000036a1d 0x2dae ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.o - .debug_info 0x00000000000397cb 0xd28 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.o - .debug_info 0x000000000003a4f3 0x23b3 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.o - .debug_info 0x000000000003c8a6 0xe39 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.o - .debug_info 0x000000000003d6df 0x21e ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_iwdg.o - .debug_info 0x000000000003d8fd 0x109d ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.o - .debug_info 0x000000000003e99a 0x1392 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.o - .debug_info 0x000000000003fd2c 0xf4a ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.o - .debug_info 0x0000000000040c76 0x12b4 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.o - .debug_info 0x0000000000041f2a 0x2dd1 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.o - .debug_info 0x0000000000044cfb 0x18f4 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.o - .debug_info 0x00000000000465ef 0x4c42 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.o - .debug_info 0x000000000004b231 0x100b ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.o - .debug_info 0x000000000004c23c 0x60e ./LWIP/App/lwip.o - .debug_info 0x000000000004c84a 0x2fba ./LWIP/Target/ethernetif.o - .debug_info 0x000000000004f804 0x3af ./Middlewares/Third_Party/LwIP/src/core/def.o - .debug_info 0x000000000004fbb3 0x665 ./Middlewares/Third_Party/LwIP/src/core/inet_chksum.o - .debug_info 0x0000000000050218 0xeb ./Middlewares/Third_Party/LwIP/src/core/init.o - .debug_info 0x0000000000050303 0x516 ./Middlewares/Third_Party/LwIP/src/core/ip.o - .debug_info 0x0000000000050819 0x590 ./Middlewares/Third_Party/LwIP/src/core/mem.o - .debug_info 0x0000000000050da9 0x636 ./Middlewares/Third_Party/LwIP/src/core/memp.o - .debug_info 0x00000000000513df 0xcde ./Middlewares/Third_Party/LwIP/src/core/netif.o - .debug_info 0x00000000000520bd 0x18bc ./Middlewares/Third_Party/LwIP/src/core/pbuf.o - .debug_info 0x0000000000053979 0x1ebf ./Middlewares/Third_Party/LwIP/src/core/tcp.o - .debug_info 0x0000000000055838 0x162a ./Middlewares/Third_Party/LwIP/src/core/tcp_in.o - .debug_info 0x0000000000056e62 0x1a8c ./Middlewares/Third_Party/LwIP/src/core/tcp_out.o - .debug_info 0x00000000000588ee 0xd03 ./Middlewares/Third_Party/LwIP/src/core/timeouts.o - .debug_info 0x00000000000595f1 0xf53 ./Middlewares/Third_Party/LwIP/src/core/udp.o - .debug_info 0x000000000005a544 0xf08 ./Middlewares/Third_Party/LwIP/src/core/ipv4/etharp.o - .debug_info 0x000000000005b44c 0x9c3 ./Middlewares/Third_Party/LwIP/src/core/ipv4/icmp.o - .debug_info 0x000000000005be0f 0xa66 ./Middlewares/Third_Party/LwIP/src/core/ipv4/ip4.o - .debug_info 0x000000000005c875 0x715 ./Middlewares/Third_Party/LwIP/src/core/ipv4/ip4_addr.o - .debug_info 0x000000000005cf8a 0xe7a ./Middlewares/Third_Party/LwIP/src/core/ipv4/ip4_frag.o - .debug_info 0x000000000005de04 0x782 ./Middlewares/Third_Party/LwIP/src/netif/ethernet.o + .debug_info 0x000000000001b27d 0xe3b ./Core/FSM/Src/fsm_state_control.o + .debug_info 0x000000000001c0b8 0x16bc ./Core/FSM/Src/motors.o + .debug_info 0x000000000001d774 0x28d ./Core/FSM/Src/motors_power_action.o + .debug_info 0x000000000001da01 0x273 ./Core/FSM/Src/paint_gun_action.o + .debug_info 0x000000000001dc74 0xe62 ./Core/FSM/Src/robot_move_actions.o + .debug_info 0x000000000001ead6 0x120e ./Core/Src/adc.o + .debug_info 0x000000000001fce4 0x867 ./Core/Src/dma.o + .debug_info 0x000000000002054b 0x15d4 ./Core/Src/fdcan.o + .debug_info 0x0000000000021b1f 0x6c5 ./Core/Src/gpio.o + .debug_info 0x00000000000221e4 0x13fa ./Core/Src/i2c.o + .debug_info 0x00000000000235de 0x1fa ./Core/Src/iwdg.o + .debug_info 0x00000000000237d8 0x2f94 ./Core/Src/main.o + .debug_info 0x000000000002676c 0x1060 ./Core/Src/quadspi.o + .debug_info 0x00000000000277cc 0x4a4 ./Core/Src/stm32h7xx_hal_msp.o + .debug_info 0x0000000000027c70 0x2886 ./Core/Src/stm32h7xx_it.o + .debug_info 0x000000000002a4f6 0x6ee ./Core/Src/syscalls.o + .debug_info 0x000000000002abe4 0x175 ./Core/Src/sysmem.o + .debug_info 0x000000000002ad59 0xd07 ./Core/Src/system_stm32h7xx.o + .debug_info 0x000000000002ba60 0x1167 ./Core/Src/tim.o + .debug_info 0x000000000002cbc7 0x18e3 ./Core/Src/usart.o + .debug_info 0x000000000002e4aa 0x22 ./Core/Startup/startup_stm32h743vgtx.o + .debug_info 0x000000000002e4cc 0x648 ./Drivers/BSP/Components/lan8742/lan8742.o + .debug_info 0x000000000002eb14 0x15d7 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.o + .debug_info 0x00000000000300eb 0x1f9c ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.o + .debug_info 0x0000000000032087 0x116d ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.o + .debug_info 0x00000000000331f4 0xcd5 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.o + .debug_info 0x0000000000033ec9 0x2b55 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.o + .debug_info 0x0000000000036a1e 0x2dae ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.o + .debug_info 0x00000000000397cc 0xd28 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.o + .debug_info 0x000000000003a4f4 0x23b3 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.o + .debug_info 0x000000000003c8a7 0xe39 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.o + .debug_info 0x000000000003d6e0 0x21e ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_iwdg.o + .debug_info 0x000000000003d8fe 0x109d ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.o + .debug_info 0x000000000003e99b 0x1392 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_qspi.o + .debug_info 0x000000000003fd2d 0xf4a ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.o + .debug_info 0x0000000000040c77 0x12b4 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.o + .debug_info 0x0000000000041f2b 0x2dd1 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.o + .debug_info 0x0000000000044cfc 0x18f4 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.o + .debug_info 0x00000000000465f0 0x4c42 ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.o + .debug_info 0x000000000004b232 0x100b ./Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.o + .debug_info 0x000000000004c23d 0x60e ./LWIP/App/lwip.o + .debug_info 0x000000000004c84b 0x2fba ./LWIP/Target/ethernetif.o + .debug_info 0x000000000004f805 0x3af ./Middlewares/Third_Party/LwIP/src/core/def.o + .debug_info 0x000000000004fbb4 0x665 ./Middlewares/Third_Party/LwIP/src/core/inet_chksum.o + .debug_info 0x0000000000050219 0xeb ./Middlewares/Third_Party/LwIP/src/core/init.o + .debug_info 0x0000000000050304 0x516 ./Middlewares/Third_Party/LwIP/src/core/ip.o + .debug_info 0x000000000005081a 0x590 ./Middlewares/Third_Party/LwIP/src/core/mem.o + .debug_info 0x0000000000050daa 0x636 ./Middlewares/Third_Party/LwIP/src/core/memp.o + .debug_info 0x00000000000513e0 0xcde ./Middlewares/Third_Party/LwIP/src/core/netif.o + .debug_info 0x00000000000520be 0x18bc ./Middlewares/Third_Party/LwIP/src/core/pbuf.o + .debug_info 0x000000000005397a 0x1ebf ./Middlewares/Third_Party/LwIP/src/core/tcp.o + .debug_info 0x0000000000055839 0x162a ./Middlewares/Third_Party/LwIP/src/core/tcp_in.o + .debug_info 0x0000000000056e63 0x1a8c ./Middlewares/Third_Party/LwIP/src/core/tcp_out.o + .debug_info 0x00000000000588ef 0xd03 ./Middlewares/Third_Party/LwIP/src/core/timeouts.o + .debug_info 0x00000000000595f2 0xf53 ./Middlewares/Third_Party/LwIP/src/core/udp.o + .debug_info 0x000000000005a545 0xf08 ./Middlewares/Third_Party/LwIP/src/core/ipv4/etharp.o + .debug_info 0x000000000005b44d 0x9c3 ./Middlewares/Third_Party/LwIP/src/core/ipv4/icmp.o + .debug_info 0x000000000005be10 0xa66 ./Middlewares/Third_Party/LwIP/src/core/ipv4/ip4.o + .debug_info 0x000000000005c876 0x715 ./Middlewares/Third_Party/LwIP/src/core/ipv4/ip4_addr.o + .debug_info 0x000000000005cf8b 0xe7a ./Middlewares/Third_Party/LwIP/src/core/ipv4/ip4_frag.o + .debug_info 0x000000000005de05 0x782 ./Middlewares/Third_Party/LwIP/src/netif/ethernet.o .debug_abbrev 0x0000000000000000 0xd17d .debug_abbrev 0x0000000000000000 0x126 ./Core/BASE/Protobuf/PSource/bsp_CV.pb.o diff --git a/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.bin b/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.bin index 9b3c327..c678a57 100644 Binary files a/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.bin and b/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.bin differ diff --git a/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.lock b/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.lock index 6f260b0..8d7cea5 100644 Binary files a/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.lock and b/PaintingappV2.02/.gradle/8.2/executionHistory/executionHistory.lock differ diff --git a/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.bin b/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.bin index 8653b4f..575b96d 100644 Binary files a/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.bin and b/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.bin differ diff --git a/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.lock b/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.lock index edb6b63..1688d0e 100644 Binary files a/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.lock and b/PaintingappV2.02/.gradle/8.2/fileHashes/fileHashes.lock differ diff --git a/PaintingappV2.02/.gradle/8.2/fileHashes/resourceHashesCache.bin b/PaintingappV2.02/.gradle/8.2/fileHashes/resourceHashesCache.bin index afa9ca7..aeb52fe 100644 Binary files a/PaintingappV2.02/.gradle/8.2/fileHashes/resourceHashesCache.bin and b/PaintingappV2.02/.gradle/8.2/fileHashes/resourceHashesCache.bin differ diff --git a/PaintingappV2.02/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/PaintingappV2.02/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 3c9bb0f..a342621 100644 Binary files a/PaintingappV2.02/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/PaintingappV2.02/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/PaintingappV2.02/.gradle/buildOutputCleanup/outputFiles.bin b/PaintingappV2.02/.gradle/buildOutputCleanup/outputFiles.bin index 70cd808..f0ec6bb 100644 Binary files a/PaintingappV2.02/.gradle/buildOutputCleanup/outputFiles.bin and b/PaintingappV2.02/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/PaintingappV2.02/.gradle/file-system.probe b/PaintingappV2.02/.gradle/file-system.probe index 7f9828a..510490f 100644 Binary files a/PaintingappV2.02/.gradle/file-system.probe and b/PaintingappV2.02/.gradle/file-system.probe differ diff --git a/PaintingappV2.02/.idea/vcs.xml b/PaintingappV2.02/.idea/vcs.xml index 94a25f7..288b36b 100644 --- a/PaintingappV2.02/.idea/vcs.xml +++ b/PaintingappV2.02/.idea/vcs.xml @@ -1,6 +1,7 @@ + \ No newline at end of file diff --git a/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/MainActivity.java b/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/MainActivity.java index 3ebeac9..8ba5a95 100644 --- a/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/MainActivity.java +++ b/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/MainActivity.java @@ -44,6 +44,8 @@ public class MainActivity extends AppCompatActivity { public static BspPV.PV_struct_define _toSendPV; + + private AlertDialog techWarningDialog; Timer timer = new Timer(); public MyDataHelper myDataHelper = new MyDataHelper(this); @@ -467,21 +469,41 @@ public class MainActivity extends AppCompatActivity { isAlarmDialogShowed = true; } } + else { + // 未超时 → 取消弹窗,恢复状态(只执行一次) + dismissTechWarningDialog(); // 关闭弹窗 + isAlarmDialogShowed = false; + + } } - // 科技蓝警告弹窗 + // 通讯失败开启弹窗 private void showTechWarningDialog() { + + // 防止重复弹 + if (techWarningDialog != null && techWarningDialog.isShowing()) { + return; + } View dialogView = getLayoutInflater().inflate(R.layout.dialog_custom_warning, null); - AlertDialog dialog = new AlertDialog.Builder(MainActivity.this) + techWarningDialog = new AlertDialog.Builder(MainActivity.this) .setView(dialogView) .setCancelable(false) .create(); - if (dialog.getWindow() != null) { - dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent); + if (techWarningDialog.getWindow() != null) { + techWarningDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent); + } + techWarningDialog.show(); + dialogView.findViewById(R.id.btn_confirm).setOnClickListener(v -> { + techWarningDialog.dismiss(); + } ); + } + //通讯恢复自动关闭弹窗 + private void dismissTechWarningDialog() { + if (techWarningDialog != null && techWarningDialog.isShowing()) { + techWarningDialog.dismiss(); } - dialog.show(); - dialogView.findViewById(R.id.btn_confirm).setOnClickListener(v -> dialog.dismiss()); + techWarningDialog = null; // 置空,避免内存泄漏/复用旧引用 } @Override protected void onStart() { diff --git a/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/MyDataHelper.java b/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/MyDataHelper.java index d6e17d0..10840c1 100644 --- a/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/MyDataHelper.java +++ b/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/MyDataHelper.java @@ -151,13 +151,13 @@ public class MyDataHelper extends SQLiteOpenHelper { cursor.close(); //数据超过 500 条,就删除最早的 200 条 - if (count > 100) { + if (count > 50) { sqliteDatabase.beginTransaction(); String deleteQuery = "DELETE FROM " + Error_TABLE_NAME + " WHERE " + Error_COLUMN_Iime_ID + " IN (SELECT " + Error_COLUMN_Iime_ID + " FROM " + Error_TABLE_NAME - + " ORDER BY " + Error_COLUMN_Iime_ID + " ASC LIMIT 50)"; + + " ORDER BY " + Error_COLUMN_Iime_ID + " ASC LIMIT 25)"; sqliteDatabase.execSQL(deleteQuery); sqliteDatabase.setTransactionSuccessful(); sqliteDatabase.endTransaction(); diff --git a/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/ReceiivedIVHandler.java b/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/ReceiivedIVHandler.java index 1131b5b..1501145 100644 --- a/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/ReceiivedIVHandler.java +++ b/PaintingappV2.02/app/src/main/java/com/example/paintingappv2_02/services/ReceiivedIVHandler.java @@ -22,8 +22,8 @@ public class ReceiivedIVHandler { // 心跳检测相关 public static long lastReceiveTime = System.currentTimeMillis(); // 最后一次收到数据的时间 public static final long TIME_OUT = 5000; // 超时时间:2秒没收到数据就算离线 - public static boolean isAlarmDialogShowed = false; // 防止弹窗重复弹出 + public static boolean isAlarmDialogShowed =false; public static void midToast(String str, int showTime, com.example.paintingappv2_02.MainActivity MainActivity) { Toast toast = Toast.makeText(MainActivity, str, showTime); toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0); //设置显示位置 @@ -52,8 +52,7 @@ public class ReceiivedIVHandler { try { - lastReceiveTime = System.currentTimeMillis(); - isAlarmDialogShowed = false; // 收到数据,重置弹窗标记 + lastReceiveTime = System.currentTimeMillis(); _toReceiveIV_Variable = BspIV.IV_struct_define.parseFrom(bytes);//单片机新数据到来 if (_toReceiveIV_Variable != null) { @@ -258,7 +257,7 @@ public class ReceiivedIVHandler { } sb.append(motorName) - .append(":") + .append(":0x") .append(errorCode); } } diff --git a/PaintingappV2.02/app/src/main/res/layout/activity_main.xml b/PaintingappV2.02/app/src/main/res/layout/activity_main.xml index 79780b7..38e4f8f 100644 --- a/PaintingappV2.02/app/src/main/res/layout/activity_main.xml +++ b/PaintingappV2.02/app/src/main/res/layout/activity_main.xml @@ -59,7 +59,7 @@ android:layout_height="match_parent" android:layout_weight="2" android:gravity="center" - android:text="2.01" + android:text="2.02" android:textColor="@color/navy_blue" android:textSize="20sp" android:textStyle="bold" /> diff --git a/PaintingappV2.02/app/src/main/res/layout/dialog_custom_warning.xml b/PaintingappV2.02/app/src/main/res/layout/dialog_custom_warning.xml index 26f2497..ca92dd0 100644 --- a/PaintingappV2.02/app/src/main/res/layout/dialog_custom_warning.xml +++ b/PaintingappV2.02/app/src/main/res/layout/dialog_custom_warning.xml @@ -39,7 +39,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="设备受干扰或未通电,请断电后重启机器人" + android:text="设备受干扰或未通电,请等待一会!" android:textSize="15sp" android:textColor="#B0BEC5" android:gravity="center"/> diff --git a/版本记录.docx b/版本记录.docx index 4dc9889..778fa40 100644 Binary files a/版本记录.docx and b/版本记录.docx differ