From 55a82c6a50274054671114df45f7072690bbbaa9 Mon Sep 17 00:00:00 2001 From: YuanHongbin <975559679@qq.com> Date: Fri, 15 May 2026 15:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=8D=E7=A7=BB=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E4=BC=A0=E6=84=9F=E5=99=A8=E7=BB=93=E6=9E=84=E4=BD=93?= =?UTF-8?q?=E5=8F=8A=E8=A7=A3=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/GateWay/MDK/GateWay.uvoptx | 161 ++++++++------ Project/GateWay/MDK/GateWay.uvprojx | 262 +---------------------- Project/GateWay/source/User/Inc/Public.h | 19 +- Project/GateWay/source/User/Src/Public.c | 19 +- 4 files changed, 126 insertions(+), 335 deletions(-) diff --git a/Project/GateWay/MDK/GateWay.uvoptx b/Project/GateWay/MDK/GateWay.uvoptx index 4243e47..3727ed7 100644 --- a/Project/GateWay/MDK/GateWay.uvoptx +++ b/Project/GateWay/MDK/GateWay.uvoptx @@ -428,43 +428,94 @@ - + + + 0 + 0 + 1598 + 1 +
83604
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\source\Module\DebugCmd\DebugCmd.c + + \\GateWay\../source/Module/DebugCmd/DebugCmd.c\1598 +
+ + 1 + 0 + 460 + 1 +
59254
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\source\User\Src\Public.c + + \\GateWay\../source/User/Src/Public.c\460 +
+ + 2 + 0 + 466 + 1 +
59314
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\source\User\Src\Public.c + + \\GateWay\../source/User/Src/Public.c\466 +
+ + 3 + 0 + 416 + 1 +
109936
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\source\Module\SX127x\sx127x.c + + \\GateWay\../source/Module/SX127x/sx127x.c\416 +
+ + 4 + 0 + 415 + 1 +
109924
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\source\Module\SX127x\sx127x.c + + \\GateWay\../source/Module/SX127x/sx127x.c\415 +
+
0 1 GateWay,0x0A - - 1 - 1 - sData - - - 2 - 1 - CatOne.Status - - - 3 - 1 - CatOneEthTxBuff - - - 4 - 1 - CatOneEthTxLen,0x0A - - - 5 - 1 - SCPara->RS485RxBuff - - - 6 - 1 - argv[1],0x0A - @@ -946,7 +997,7 @@ - Debug + SdCard 0 0 0 @@ -958,34 +1009,14 @@ 0 0 0 - ..\source\Module\Debug\Debug.c - Debug.c - 0 - 0 - - - - - SdCard - 0 - 0 - 0 - 0 - - 6 - 33 - 1 - 0 - 0 - 0 ..\source\Module\SDCard\sd_card.c sd_card.c 0 0 - 6 - 34 + 5 + 33 1 0 0 @@ -1004,8 +1035,8 @@ 0 0 - 7 - 35 + 6 + 34 1 0 0 @@ -1016,8 +1047,8 @@ 0 - 7 - 36 + 6 + 35 1 0 0 @@ -1028,8 +1059,8 @@ 0 - 7 - 37 + 6 + 36 1 0 0 @@ -1040,8 +1071,8 @@ 0 - 7 - 38 + 6 + 37 1 0 0 @@ -1055,13 +1086,13 @@ sx127x - 0 + 1 0 0 0 - 8 - 39 + 7 + 38 1 0 0 diff --git a/Project/GateWay/MDK/GateWay.uvprojx b/Project/GateWay/MDK/GateWay.uvprojx index 3291f4d..e18a2db 100644 --- a/Project/GateWay/MDK/GateWay.uvprojx +++ b/Project/GateWay/MDK/GateWay.uvprojx @@ -595,136 +595,6 @@ - - Debug - - - 0 - 0 - 0 - 0 - 0 - 0 - 2 - 2 - 2 - 2 - 11 - - - 1 - - - - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 0 - 0 - 2 - 2 - 2 - 2 - 2 - - - - - - - - - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 0 - - - - - - - - - - - - Debug.c - 1 - ..\source\Module\Debug\Debug.c - - - 2 - 0 - 0 - 0 - 0 - 0 - 2 - 2 - 2 - 2 - 11 - - - 1 - - - - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 0 - 0 - 2 - 2 - 2 - 2 - 2 - - - - - - - - - - - - SdCard @@ -1397,7 +1267,7 @@ --diag_suppress=186,66 __DEBUG,HC32F460,USE_DEVICE_DRIVER_LIB,JEUA,BOOT_ENABLE - ..\..\..\driver\inc;..\..\..\mcu\common;..\source\User\Inc;..\source\Module\Debug;..\source\Module\SDCard;..\source\Module\FatFS\source;..\source\Module\SX127x;..\source\Module\DebugCmd + ..\..\..\driver\inc;..\..\..\mcu\common;..\source\User\Inc;..\source\Module\Debug;..\source\Module\SDCard;..\source\Module\FatFS\source;..\source\Module\sx127x;..\source\Module\DebugCmd @@ -1651,136 +1521,6 @@ - - Debug - - - 0 - 0 - 0 - 0 - 0 - 0 - 2 - 2 - 2 - 2 - 11 - - - 1 - - - - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 0 - 0 - 2 - 2 - 2 - 2 - 2 - - - - - - - - - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 0 - - - - - - - - - - - - Debug.c - 1 - ..\source\Module\Debug\Debug.c - - - 2 - 0 - 0 - 0 - 0 - 0 - 2 - 2 - 2 - 2 - 11 - - - 1 - - - - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 0 - 2 - 2 - 2 - 2 - 2 - 0 - 0 - 2 - 2 - 2 - 2 - 2 - - - - - - - - - - - - SdCard diff --git a/Project/GateWay/source/User/Inc/Public.h b/Project/GateWay/source/User/Inc/Public.h index 22ad5e0..c4025e5 100644 --- a/Project/GateWay/source/User/Inc/Public.h +++ b/Project/GateWay/source/User/Inc/Public.h @@ -99,6 +99,7 @@ typedef enum { SURFACE_STRESS, //0x0014 表面应力 PRESSURE, //0x0015 压力 MICROWAVE_DISPLACE, //0x0016 微波位移 + DISPLACEMENT = 0x0020, //0x0020 位移监测传感器 }SensorType_m; typedef struct {//主设备固定包头 @@ -124,7 +125,19 @@ typedef struct { int16_t PitchAngle; //俯仰角偏斜 (范围±900)单位0.1° int16_t RollAngle; //横滚角偏斜 (范围±900)单位0.1° int16_t YawAngle; //偏航角偏斜 (范围0~3600)单位0.1° -}__attribute__((packed))LaserTracingType_t; +}__attribute__((packed))LaserTracingType_T; + +typedef struct {//0x0020 位移计 + int16_t PitchAngle; //俯仰角偏斜(范围±900)单位0.1° + int16_t RollAngle; //横滚角偏斜(范围±900)单位0.1° + int16_t YawAngle; //偏航角偏斜(范围0~3600)单位0.1° + float Altitude; //海拔()单位cm + int16_t Distance; //1轴应力值转位移(范围±300,单位0.1mm) +}__attribute__ ((packed))Displacement_T,*DisplacementDp; + +typedef struct { + int Distance; +}__attribute__((packed))LaserDistanceSensorType_t; typedef struct { uint8_t CommDevAddr[6]; //通讯单元地址 @@ -134,10 +147,6 @@ typedef struct { uint8_t ERTime; //紧急上报时长 }__attribute__((packed))SvrDownLPDevConfigPara_t; -typedef struct { - int Distance; -}__attribute__((packed))LaserDistanceSensorType_t; - typedef struct { uint8_t AlarmType; uint8_t AlarmState; diff --git a/Project/GateWay/source/User/Src/Public.c b/Project/GateWay/source/User/Src/Public.c index 4642dcd..421b5c3 100644 --- a/Project/GateWay/source/User/Src/Public.c +++ b/Project/GateWay/source/User/Src/Public.c @@ -298,8 +298,8 @@ int CommUintOrgData(GateWayPara GateWay, CommUnitPara CUPara, CommUnitData CUDat case FORCE_3D: break; case LASER_TRACING: - memcpy(&sData[Len], CUData->Data[i], sizeof(LaserTracingType_t)); - Len += sizeof(LaserTracingType_t); + memcpy(&sData[Len], CUData->Data[i], sizeof(LaserTracingType_T)); + Len += sizeof(LaserTracingType_T); break; case WATER_LEVEL: break; @@ -327,6 +327,10 @@ int CommUintOrgData(GateWayPara GateWay, CommUnitPara CUPara, CommUnitData CUDat break; case MICROWAVE_DISPLACE: break; + case DISPLACEMENT: + memcpy(&sData[Len], CUData->Data[i], sizeof(Displacement_T)); + Len += sizeof(Displacement_T); + break; } SensorN++; } @@ -374,8 +378,8 @@ void DebugDisplaySensorData(int SensorIdx, uint16_t SensorType, uint8_t *SensorD break; } case LASER_TRACING: { - LaserTracingType_t Sensor; - memcpy((uint8_t *)&Sensor, SensorData, sizeof(LaserTracingType_t)); + LaserTracingType_T Sensor; + memcpy((uint8_t *)&Sensor, SensorData, sizeof(LaserTracingType_T)); MAIN_DBG_LOG("Sensor%d Type %04x: PitchAngle=%04d, RollAngle=%04d, YawAngle=%04d\r\n", SensorIdx, SensorType, Sensor.PitchAngle, Sensor.RollAngle, Sensor.YawAngle); break; @@ -419,6 +423,13 @@ void DebugDisplaySensorData(int SensorIdx, uint16_t SensorType, uint8_t *SensorD case MICROWAVE_DISPLACE: { break; } + case DISPLACEMENT: { + Displacement_T Sensor; + memcpy((uint8_t *)&Sensor, SensorData, sizeof(Displacement_T)); + MAIN_DBG_LOG("Sensor%d Type %04x: PitchAngle=%04d, RollAngle=%04d, YawAngle=%04d, Altitude=%06f, Distance=%04d\r\n", + SensorIdx, SensorType, Sensor.PitchAngle, Sensor.RollAngle, Sensor.YawAngle, Sensor.Altitude, Sensor.Distance); + break; + } default: break; }