feat:解析设备ID
This commit is contained in:
parent
1294cc8d4f
commit
3125dc946e
@ -97,6 +97,13 @@ public class TcpRtkServer implements CommandLineRunner {
|
|||||||
rtkData.setLatitude(Double.parseDouble(parts[4]));
|
rtkData.setLatitude(Double.parseDouble(parts[4]));
|
||||||
rtkData.setLongitude(Double.parseDouble(parts[5]));
|
rtkData.setLongitude(Double.parseDouble(parts[5]));
|
||||||
rtkData.setHeight(Double.parseDouble(parts[6]));
|
rtkData.setHeight(Double.parseDouble(parts[6]));
|
||||||
|
|
||||||
|
// 获取设备ID (最后一个字段)
|
||||||
|
if (parts.length > 10) {
|
||||||
|
rtkData.setDeviceId(parts[parts.length - 1]);
|
||||||
|
logger.debug("设置设备ID: {}", parts[parts.length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
latestData.set(rtkData);
|
latestData.set(rtkData);
|
||||||
logger.debug("Parsed $POS data: {}", rtkData);
|
logger.debug("Parsed $POS data: {}", rtkData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -110,6 +117,13 @@ public class TcpRtkServer implements CommandLineRunner {
|
|||||||
if (rtkData != null) {
|
if (rtkData != null) {
|
||||||
String[] parts = message.split(",");
|
String[] parts = message.split(",");
|
||||||
rtkData.setZtd(Double.parseDouble(parts[5]));
|
rtkData.setZtd(Double.parseDouble(parts[5]));
|
||||||
|
|
||||||
|
// 获取设备ID (最后一个字段)
|
||||||
|
if (parts.length > 6) {
|
||||||
|
rtkData.setDeviceId(parts[parts.length - 1]);
|
||||||
|
logger.debug("设置设备ID: {}", parts[parts.length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
latestData.set(rtkData);
|
latestData.set(rtkData);
|
||||||
logger.debug("Updated $TROP data: ZTD={}", parts[5]);
|
logger.debug("Updated $TROP data: ZTD={}", parts[5]);
|
||||||
}
|
}
|
||||||
@ -134,6 +148,13 @@ public class TcpRtkServer implements CommandLineRunner {
|
|||||||
|
|
||||||
rtkData.setZtdGradientNorth(north);
|
rtkData.setZtdGradientNorth(north);
|
||||||
rtkData.setZtdGradientEast(east);
|
rtkData.setZtdGradientEast(east);
|
||||||
|
|
||||||
|
// 获取设备ID (最后一个字段)
|
||||||
|
if (parts.length > 7) {
|
||||||
|
rtkData.setDeviceId(parts[parts.length - 1]);
|
||||||
|
logger.debug("设置设备ID: {}", parts[parts.length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
latestData.set(rtkData);
|
latestData.set(rtkData);
|
||||||
logger.info("成功解析$TRPG数据: North={}, East={}", north, east);
|
logger.info("成功解析$TRPG数据: North={}, East={}", north, east);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@ -169,6 +190,14 @@ public class TcpRtkServer implements CommandLineRunner {
|
|||||||
RtkData rtkData = latestData.get();
|
RtkData rtkData = latestData.get();
|
||||||
if (rtkData != null) {
|
if (rtkData != null) {
|
||||||
rtkData.setSatelliteInfo(message);
|
rtkData.setSatelliteInfo(message);
|
||||||
|
|
||||||
|
// 获取设备ID (最后一个字段)
|
||||||
|
String[] parts = message.split(",");
|
||||||
|
if (parts.length > 1) {
|
||||||
|
rtkData.setDeviceId(parts[parts.length - 1]);
|
||||||
|
logger.debug("设置设备ID: {}", parts[parts.length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
latestData.set(rtkData);
|
latestData.set(rtkData);
|
||||||
logger.debug("Updated $SATE data");
|
logger.debug("Updated $SATE data");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,9 @@ public class RtkData {
|
|||||||
@Column(name = "pwv")
|
@Column(name = "pwv")
|
||||||
private Double pwv;
|
private Double pwv;
|
||||||
|
|
||||||
|
@Column(name = "device_id")
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
@Transient // 不存入数据库的临时字段
|
@Transient // 不存入数据库的临时字段
|
||||||
private Double surfacePressure;
|
private Double surfacePressure;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user