diff --git a/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDevice.java b/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDevice.java index 311705d9..3ecb7ed2 100644 --- a/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDevice.java +++ b/sec-api/src/main/java/com/imdroid/secapi/dto/GnssDevice.java @@ -22,6 +22,9 @@ public class GnssDevice { public static final short OP_MODE_CHECK = 1; public static final short OP_MODE_UNUSE = 2; + public static final short MODEL_G505 = 0; //F9P + public static final short MODEL_G510 = 1; //博通 + @TableId(value = "id", type = IdType.AUTO) private Long id; private Integer tenantid; @@ -48,4 +51,13 @@ public class GnssDevice { private Double iposn; //初始位置 private Double iposd; //初始位置 + private Double ecefx; + private Double ecefy; + private Double ecefz; + + private String sector;//桩号 + private String appver; + private String imei; + private Short model; + } diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/FocusCalculator3.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/FocusCalculator3.java index 762cb795..5f1ee2ab 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/FocusCalculator3.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/FocusCalculator3.java @@ -1,44 +1,81 @@ package com.imdroid.sideslope.bd; +import com.imdroid.sideslope.sal.Device; + import java.time.LocalDateTime; import java.util.*; +import static com.imdroid.sideslope.bd.GeoCoordConverterUtil.*; /** * 博通:用GGA绝对坐标代替相对位置 */ public class FocusCalculator3 extends FocusCalculator1{ + Device bsDevice; + public FocusCalculator3(Device bsDevice){ + super(); + this.bsDevice = bsDevice; + } - final static long scale = 100000000L;//地球1°:111km,放大到mm乘以100,000,000 static class EComparator implements Comparator{ @Override public int compare(double[] point1, double[] point2) { - return (int) ((point1[0] - point2[0])*100); + return Double.compare(point1[1], point2[1]); + //return (int) ((point1[0] - point2[0])*100); } } static class NComparator implements Comparator{ @Override public int compare(double[] point1, double[] point2) { - return (int) ((point1[1] - point2[1])*100); + return Double.compare(point1[1], point2[1]); + //return (int) ((point1[1] - point2[1])*100); } } static class DComparator implements Comparator{ @Override public int compare(double[] point1, double[] point2) { - return (int) ((point1[2] - point2[2])*100); + return Double.compare(point1[1], point2[1]); + //return (int) ((point1[2] - point2[2])*100); } } @Override public void addGGA(Gga gga) { if(gga == null) return; + double[] end; - double[] xyz = new double[]{gga.getLongitude()*scale, gga.getLatitude()*scale, gga.getAltitude()*1000, gga.getQuality()}; + // 测站的GGA - 测站 LLA 数据 + LLA_Coordinate rover_lla = new LLA_Coordinate(gga.getLatitude(),gga.getLongitude(),gga.getAltitude()); + // 测站 LLA 坐标转 ECEF 坐标,单位米 + ECEF_Coordinate rover_ecef = LLA2ECEF(rover_lla); + + if(bsDevice==null || bsDevice.getEcefx()==null){ + end = new double[]{ + rover_ecef.getECEF_X()*1000, + rover_ecef.getECEF_Y()*1000, + rover_ecef.getECEF_Z()*1000, + gga.getQuality()}; + } + else { + // 查询测站的绑定的基站 + ECEF_Coordinate reference_ecef = new ECEF_Coordinate(bsDevice.getEcefx(), bsDevice.getEcefy(), bsDevice.getEcefz()); + + // 以基站为站心的 ENU 坐标 + ENU_Coordinate difference_enu = ECEF2ENU(reference_ecef, rover_ecef); + + System.out.println("DIFF ENU:" + difference_enu.ENU_E + " " + difference_enu.ENU_N + " " + difference_enu.ENU_U); + end = new double[]{ + difference_enu.ENU_E*1000, + difference_enu.ENU_N*1000, + difference_enu.ENU_U*1000, + gga.getQuality()}; + } if(gga.isFixed()) { counterFixedResult++; - pointList.add(xyz); + //pointList.add(xyz); + pointList.add(end); } else if(gga.getQuality() == 5) counterNoFixed++; else counterNoB562 ++; diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/GeoCoordConverterUtil.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/GeoCoordConverterUtil.java new file mode 100644 index 00000000..6f0fd951 --- /dev/null +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/bd/GeoCoordConverterUtil.java @@ -0,0 +1,302 @@ +package com.imdroid.sideslope.bd; + +import static java.lang.Math.*; + +public class GeoCoordConverterUtil { + // WGS84 模型常量 + public static final double WGS84_A = 6378137.0; + public static final double WGS84_B = 6356752.3142; + public static final double WGS84_F = (1.0 / 298.257223563); + public static final double WGS84_E2 = 0.00669437999014; + public static final double EPSILON = 1e-12; + + public static class LLA_Coordinate { + double Latitude; + double Longitude; + double Altitude; + + public double getLatitude() { + return Latitude; + } + + public void setLatitude(double latitude) { + Latitude = latitude; + } + + public double getLongitude() { + return Longitude; + } + + public void setLongitude(double longitude) { + Longitude = longitude; + } + + public double getAltitude() { + return Altitude; + } + + public void setAltitude(double altitude) { + Altitude = altitude; + } + + public LLA_Coordinate(double latitude, double longitude, double altitude) { + if (Double.isNaN(latitude) || Double.isNaN(longitude) || Double.isNaN(altitude)) { + throw new IllegalArgumentException("Invalid LLA coordinates: NaN values are not allowed."); + } + if (Double.isInfinite(latitude) || Double.isInfinite(longitude) || Double.isInfinite(altitude)) { + throw new IllegalArgumentException("Invalid LLA coordinates: Infinite values are not allowed."); + } + if (latitude < -90.0 || latitude > 90.0) { + throw new IllegalArgumentException("Invalid latitude value: must be between -90 and 90 degrees."); + } + if (longitude < -180.0 || longitude > 180.0) { + throw new IllegalArgumentException("Invalid longitude value: must be between -180 and 180 degrees."); + } + + this.Latitude = latitude; + this.Longitude = longitude; + this.Altitude = altitude; + } + public String toString() { + return "LLA_Coordinate{" + + "Latitude=" + Latitude + + ", Longitude=" + Longitude + + ", Altitude=" + Altitude + + '}'; + } + + } + + public static class ECEF_Coordinate{ + double ECEF_X; + double ECEF_Y; + double ECEF_Z; + + public double getECEF_X() { + return ECEF_X; + } + + public double getECEF_Y() { + return ECEF_Y; + } + + public double getECEF_Z() { + return ECEF_Z; + } + + public void setECEF_X(double ECEF_X) { + this.ECEF_X = ECEF_X; + } + + public void setECEF_Y(double ECEF_Y) { + this.ECEF_Y = ECEF_Y; + } + + public void setECEF_Z(double ECEF_Z) { + this.ECEF_Z = ECEF_Z; + } + + public ECEF_Coordinate(double ecefX, double ecefY, double ecefZ) { + if (Double.isNaN(ecefX) || Double.isNaN(ecefY) || Double.isNaN(ecefZ)) { + throw new IllegalArgumentException("Invalid ECEF coordinates: NaN values are not allowed."); + } + if (Double.isInfinite(ecefX) || Double.isInfinite(ecefY) || Double.isInfinite(ecefZ)) { + throw new IllegalArgumentException("Invalid ECEF coordinates: Infinite values are not allowed."); + } + + this.ECEF_X = ecefX; + this.ECEF_Y = ecefY; + this.ECEF_Z = ecefZ; + } + + public String toString() { + return "ECEF_Coordinate{" + + "ECEF_X=" + ECEF_X + + ", ECEF_Y=" + ECEF_Y + + ", ECEF_Z=" + ECEF_Z + + '}'; + } + + } + + public static class ENU_Coordinate{ + double ENU_E; + double ENU_N; + double ENU_U; + public ENU_Coordinate(double E, double N, double U) { + if (Double.isNaN(E) || Double.isNaN(N) || Double.isNaN(U)) { + throw new IllegalArgumentException("Invalid ENU coordinates: NaN values are not allowed."); + } + if (Double.isInfinite(E) || Double.isInfinite(N) || Double.isInfinite(U)) { + throw new IllegalArgumentException("Invalid ENU coordinates: Infinite values are not allowed."); + } + + this.ENU_E = E; + this.ENU_N = N; + this.ENU_U = U; + } + + public String toString() { + return "ENU_Coordinate{" + + "ENU_E=" + ENU_E + + ", ENU_N=" + ENU_N + + ", ENU_U=" + ENU_U + + '}'; + } + + public double getENU_E() { + return ENU_E; + } + + public void setENU_E(double ENU_E) { + this.ENU_E = ENU_E; + } + + public double getENU_N() { + return ENU_N; + } + + public void setENU_N(double ENU_N) { + this.ENU_N = ENU_N; + } + + public double getENU_U() { + return ENU_U; + } + + public void setENU_U(double ENU_U) { + this.ENU_U = ENU_U; + } + } + + + /** + * 将地理坐标(纬度、经度、海拔)转换为地心地固坐标(ECEF)。 + * + *

该方法将给定的纬度、经度和高程(LLA)转换为 WGS84 参考系下的 ECEF 坐标。 + * 转换过程中使用了 WGS84 椭球体模型常数。

+ * + *

使用的公式参考自: + * + * 地理坐标转换 - 维基百科

+ * + * @param LLA 要转换的地理坐标。纬度和经度以度为单位,海拔以米为单位。 + * @return 一个 {@link ECEF_Coordinate} 对象,表示转换后的 ECEF 坐标。X、Y 和 Z 的值以米为单位。 + */ + public static ECEF_Coordinate LLA2ECEF(LLA_Coordinate LLA){ + // 度转弧度 + double lat_rad = LLA.Latitude * PI / 180.0; + double lon_rad = LLA.Longitude * PI / 180.0; + + // 中间变量 + double N = WGS84_A / sqrt(1.0 - WGS84_E2 * sin(lat_rad) * sin(lat_rad)); + + //结果 + double x = (N + LLA.Altitude) * cos(lat_rad) * cos(lon_rad); + double y = (N + LLA.Altitude) * cos(lat_rad) * sin(lon_rad); + double z = ((1.0 - WGS84_E2) * N + LLA.Altitude) * sin(lat_rad); + + return new ECEF_Coordinate(x, y, z); + } + + /** + * 将地心地固坐标(ECEF)转换为地理坐标(纬度、经度、海拔)。 + * + *

该方法将给定的 ECEF 坐标转换为 WGS84 参考系下的地理坐标(LLA)。 + * 转换过程中使用了 WGS84 椭球体模型常数。

+ * + *

使用的公式参考自: + * + * 地理坐标转换 - 维基百科

+ * + * @param ECEF 要转换的 ECEF 坐标。X、Y 和 Z 的值以米为单位。 + * @return 一个 {@link LLA_Coordinate} 对象,表示转换后的地理坐标。纬度和经度以度为单位,海拔以米为单位。 + */ + public static LLA_Coordinate ECEF2LLA(ECEF_Coordinate ECEF){ + + double X = ECEF.ECEF_X; + double Y = ECEF.ECEF_Y; + double Z = ECEF.ECEF_Z; + + if (X == 0 && Y == 0) { + double lat = Z > 0 ? 90.0 : -90.0; + double lon = 0.0; + double h = abs(Z) - WGS84_A * sqrt(1 - WGS84_E2); + + return new LLA_Coordinate(lat, lon, h); + } + + // 公式涉及的中间变量 + double lambda = atan2(Y, X); + double phi; + double h; + double N; + double p = sqrt(X*X + Y*Y); + // 第一个猜测 h≈0 开始,然后更新 N + double phi_new = atan2(Z, p*(1-WGS84_E2)); + // 迭代公式 + do { + phi = phi_new; + N = WGS84_A / sqrt(1 - WGS84_E2 * sin(phi) * sin(phi)); + h = p / cos(phi) - N; + phi_new = atan2(Z, (1-(WGS84_E2*N)/(N+h))*p); + } while (abs(phi_new - phi) > EPSILON); + + double lat = phi_new * 180.0 / PI; + double lon = lambda * 180.0 / PI; + + return new LLA_Coordinate(lat, lon, h); + } + + /** + * 将地心地固(ECEF)坐标转换为东-北-天(ENU)坐标。 + * + *

该方法将给定的两个 ECEF 坐标(基准站和流动站)转换为以基准站为原点的 ENU 坐标。 + * 转换过程中使用了 WGS84 参考系。

+ * + *

使用的公式参考自: + * + * 地理坐标转换 - 维基百科

+ * + * @param referenceStationECEF 基准站的 ECEF 坐标。X、Y 和 Z 的值以米为单位。 + * @param roverStationECEF 流动站的 ECEF 坐标。X、Y 和 Z 的值以米为单位。 + * @return 一个 {@link ENU_Coordinate} 对象,表示转换后的 ENU 坐标。E、N 和 U 的值以米为单位。 + */ + public static ENU_Coordinate ECEF2ENU(ECEF_Coordinate referenceStationECEF, ECEF_Coordinate roverStationECEF) { + ECEF_Coordinate differenceECEF = new ECEF_Coordinate(0,0,0); + differenceECEF.ECEF_X = roverStationECEF.ECEF_X - referenceStationECEF.ECEF_X; + differenceECEF.ECEF_Y = roverStationECEF.ECEF_Y - referenceStationECEF.ECEF_Y; + differenceECEF.ECEF_Z = roverStationECEF.ECEF_Z - referenceStationECEF.ECEF_Z; + // 得到计算中所需要的 基站的 LLA + LLA_Coordinate referenceStationLLA = ECEF2LLA(referenceStationECEF); + + // 将经纬度转换为弧度,用于三角函数计算 + double lat = referenceStationLLA.Latitude * Math.PI / 180; + double lon = referenceStationLLA.Longitude * Math.PI / 180; + + double sin_lat = Math.sin(lat); + double cos_lat = Math.cos(lat); + double sin_lon = Math.sin(lon); + double cos_lon = Math.cos(lon); + + // 构建计算中所用到的矩阵S + double[][] S = { + {-sin_lon, cos_lon, 0}, + {-sin_lat * cos_lon, -sin_lat * sin_lon, cos_lat}, + {cos_lat * cos_lon, cos_lat * sin_lon, sin_lat} + }; + + ENU_Coordinate enu = new ENU_Coordinate(0,0,0); + enu.ENU_E = S[0][0] * differenceECEF.ECEF_X + S[0][1] * differenceECEF.ECEF_Y + S[0][2] * differenceECEF.ECEF_Z; + enu.ENU_N = S[1][0] * differenceECEF.ECEF_X + S[1][1] * differenceECEF.ECEF_Y + S[1][2] * differenceECEF.ECEF_Z; + enu.ENU_U = S[2][0] * differenceECEF.ECEF_X + S[2][1] * differenceECEF.ECEF_Y + S[2][2] * differenceECEF.ECEF_Z; + + return enu; + } + + + + + + +} diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/calc/SingleLineGNSSCalcService.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/calc/SingleLineGNSSCalcService.java index da25e37b..2287063c 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/calc/SingleLineGNSSCalcService.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/calc/SingleLineGNSSCalcService.java @@ -85,7 +85,8 @@ public class SingleLineGNSSCalcService implements GNSSDataCalcService { focusCalculator = calculatorMap.computeIfAbsent(deviceId,s -> new FocusCalculator4()); } else if(groupCalc!=null && groupCalc.getVer() == 3){ - focusCalculator = calculatorMap.computeIfAbsent(deviceId,s -> new FocusCalculator3()); + Device bsDevice = deviceService.findByDeviceId(device.getParentId()); + focusCalculator = calculatorMap.computeIfAbsent(deviceId,s -> new FocusCalculator3(bsDevice)); } else if(groupCalc!=null && groupCalc.getVer() == 2){ focusCalculator = calculatorMap.computeIfAbsent(deviceId,s -> new FocusCalculator2()); diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/message/D3F0SelfCheckMessage.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/message/D3F0SelfCheckMessage.java index 099d6183..e4080df6 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/message/D3F0SelfCheckMessage.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/message/D3F0SelfCheckMessage.java @@ -21,6 +21,7 @@ public class D3F0SelfCheckMessage extends BaseMessage { GnssStatusMsg statusMsg = new GnssStatusMsg(); String firmwareVersion; String imei; + String auxInfo; @Override public void decodeBody(ByteBuf src) { @@ -41,7 +42,7 @@ public class D3F0SelfCheckMessage extends BaseMessage { int ver = src.readUnsignedShort(); short verType = (short) ((ver >> 12) & 0xF); firmwareVersion = ((ver >> 8) & 0xF) + "." + ((ver >> 4) & 0xF) + "." + (ver & 0xF); - if (verType > 0) firmwareVersion = firmwareVersion + " type:" + verType; + if (verType > 0) auxInfo = " type:" + verType; if(src.readableBytes()>=4) { statusMsg.setTemperature((float) (src.readUnsignedShort() / 10)); @@ -52,8 +53,8 @@ public class D3F0SelfCheckMessage extends BaseMessage { imei = src.readCharSequence(15, StandardCharsets.UTF_8).toString(); } if(src.readableBytes()>=3){ - firmwareVersion = firmwareVersion + - " bVer:"+src.readUnsignedByte() + + auxInfo = auxInfo + + " blVer:"+src.readUnsignedByte() + " reboot:"+src.readUnsignedShort(); } diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/DbDeviceServiceImpl.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/DbDeviceServiceImpl.java index b284ffbf..1708ac3f 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/DbDeviceServiceImpl.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/DbDeviceServiceImpl.java @@ -39,6 +39,9 @@ public class DbDeviceServiceImpl implements DeviceService { device.setIPose(gnssDevice.getIpose()); device.setIPosn(gnssDevice.getIposn()); device.setIPosd(gnssDevice.getIposd()); + device.setEcefx(gnssDevice.getEcefx()); + device.setEcefy(gnssDevice.getEcefy()); + device.setEcefz(gnssDevice.getEcefz()); return device; } @@ -61,6 +64,9 @@ public class DbDeviceServiceImpl implements DeviceService { device.setIPose(gnssDevice.getIpose()); device.setIPosn(gnssDevice.getIposn()); device.setIPosd(gnssDevice.getIposd()); + device.setEcefx(gnssDevice.getEcefx()); + device.setEcefy(gnssDevice.getEcefy()); + device.setEcefz(gnssDevice.getEcefz()); deviceList.add(device); } return deviceList; diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/Device.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/Device.java index 02347d0b..f897fb99 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/Device.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/sal/Device.java @@ -51,6 +51,9 @@ public class Device { Double latitude; Double longitude; Double altitude; + Double ecefx; + Double ecefy; + Double ecefz; Double iPose; Double iPosn; diff --git a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/DataPersistServiceImpl.java b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/DataPersistServiceImpl.java index ee893cfb..da822f2c 100644 --- a/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/DataPersistServiceImpl.java +++ b/sec-beidou-rtcm/src/main/java/com/imdroid/sideslope/service/DataPersistServiceImpl.java @@ -29,6 +29,8 @@ public class DataPersistServiceImpl implements DataPersistService { private GnssMsgMapper msgMapper; @Autowired WarningService warningService; + @Autowired + GnssDeviceMapper deviceMapper; @Override public GnssStatus getDeviceState(String deviceId) @@ -75,13 +77,28 @@ public class DataPersistServiceImpl implements DataPersistService { if(new_flag) deviceStateRepository.insert(deviceState); else deviceStateRepository.updateById(deviceState); + // 检查版本号 + boolean needSave = false; + GnssDevice gnssDevice = deviceMapper.queryByDeviceId(message.getId()); + if(gnssDevice != null){ + String appVer = gnssDevice.getAppver(); + if(appVer==null || !appVer.equals(message.getFirmwareVersion())){ + gnssDevice.setAppver(message.getFirmwareVersion()); + needSave = true; + } + String imei = gnssDevice.getImei(); + if(imei==null || !imei.equals(message.getImei())){ + gnssDevice.setImei(message.getImei()); + needSave = true; + } + } + + if(needSave){ + deviceMapper.updateById(gnssDevice); + } + // 保存消息摘要 - if(message.getImei()!=null) { - saveMsg(message, "IMEI:" + message.getImei() + ", ver:" + message.getFirmwareVersion()); - } - else{ - saveMsg(message, "ver:" + message.getFirmwareVersion()); - } + saveMsg(message, message.getAuxInfo()); } catch (Exception e) { e.printStackTrace(); } diff --git a/sec-beidou/src/main/resources/application.properties b/sec-beidou/src/main/resources/application.properties index 1d107400..22c57f7c 100644 --- a/sec-beidou/src/main/resources/application.properties +++ b/sec-beidou/src/main/resources/application.properties @@ -2,9 +2,9 @@ #spring.datasource.url=jdbc:mysql://192.168.101.54:3306/beidou?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true #spring.datasource.username=beidou #spring.datasource.password=Passw0rd#123! -#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/beidou?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true -spring.datasource.url=jdbc:mysql://139.9.51.237:3306/beidou?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true -spring.datasource.username=radmin +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/beidou?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true +#spring.datasource.url=jdbc:mysql://139.9.51.237:3306/beidou?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true +spring.datasource.username=admin spring.datasource.password=DBMgr_2022 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.properties.hibernate.hbm2ddl.auto=update diff --git a/sec-beidou/src/main/resources/db/schema.sql b/sec-beidou/src/main/resources/db/schema.sql index 645f6136..72d7ed28 100644 --- a/sec-beidou/src/main/resources/db/schema.sql +++ b/sec-beidou/src/main/resources/db/schema.sql @@ -60,6 +60,13 @@ CREATE TABLE IF NOT EXISTS `gnssdevices` ( `ipose` double DEFAULT NULL COMMENT '初始位置东E', `iposn` double DEFAULT NULL COMMENT '初始位置北N', `iposd` double DEFAULT NULL COMMENT '初始位置天D', + `ecefx` double DEFAULT NULL COMMENT '初始位置X', + `ecefy` double DEFAULT NULL COMMENT '初始位置Y', + `ecefz` double DEFAULT NULL COMMENT '初始位置Z', + `section` varchar(64) DEFAULT NULL COMMENT '桩号', + `appver` varchar(16) DEFAULT NULL COMMENT '固件版本', + `imei` varchar(16) DEFAULT NULL, + `model` smallint DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/sec-beidou/src/main/resources/templates/page/gnss_dev_cfg.html b/sec-beidou/src/main/resources/templates/page/gnss_dev_cfg.html index e69d5526..7ee3fca6 100644 --- a/sec-beidou/src/main/resources/templates/page/gnss_dev_cfg.html +++ b/sec-beidou/src/main/resources/templates/page/gnss_dev_cfg.html @@ -85,22 +85,26 @@ form = layui.form, table = layui.table; var cfg_cols = [ - {field: 'deviceid', title: '设备号', sort: true}, - {field: 'name', title: '设备名称'}, - {field: 'devicetype', title: '类型',templet: '#typeTrans'}, - {field: 'parentid', title: '基站编号', sort: true}, - {field: 'tenantname', title: '所属组织'}, - {field: 'project_id', title: '项目号', sort: true}, - {field: 'group_id', title: '基本参数组', sort: true}, - {field: 'calc_group_id', title: '解算参数组', sort: true}, - {field: 'fwd_group_id', title: '推送组'}, - {field: 'fwd_group_id2', title: '推送2'}, - {field: 'opmode', title: '使用状态',templet: '#modeTrans'}, - {field: 'syn', title: '参数同步',templet: '#synTrans'}, - {title: '操作', toolbar: '#currentTableBar', align: "center", minWidth: 120} + {field: 'deviceid', title: '设备号', width: 100, sort: true}, + {field: 'project_id', title: '项目号', width: 120, sort: true}, + {field: 'sector', title: '桩号', width: 120, sort: true}, + {field: 'name', title: '设备名称', width: 80}, + {field: 'devicetype', title: '类型', width: 80,templet: '#typeTrans'}, + {field: 'group_id', title: '基本参数组', width: 60, sort: true}, + {field: 'calc_group_id', title: '解算参数组', width: 60, sort: true}, + {field: 'parentid', title: '基站编号', width: 80, sort: true}, + {field: 'tenantname', title: '所属组织', width: 120}, + {field: 'fwd_group_id', title: '推送组', width: 80}, + {field: 'fwd_group_id2', title: '推送2', width: 80}, + {field: 'opmode', title: '使用状态', width: 80,templet: '#modeTrans'}, + {field: 'syn', title: '参数同步', width: 80,templet: '#synTrans'}, + {field: 'model', title: '型号', width: 80,templet: "
{{d.model==0?'G505':'G510'}}
"}, + {field: 'appver', title: '固件版本', width: 80}, + {field: 'imei', title: 'IMEI', width: 100}, + {title: '操作', toolbar: '#currentTableBar', fixed: "right", width: 120} ]; if([[${role}]] == "USER") { - cfg_cols[12].hide = true; + cfg_cols[15].hide = true; } /** * 初始化表单,要加上,不然刷新部分组件可能会不加载 diff --git a/sec-beidou/src/main/resources/templates/page/gnss_status.html b/sec-beidou/src/main/resources/templates/page/gnss_status.html index 27156463..73278088 100644 --- a/sec-beidou/src/main/resources/templates/page/gnss_status.html +++ b/sec-beidou/src/main/resources/templates/page/gnss_status.html @@ -105,7 +105,7 @@ {field: 'satelliteinuse', title: '使用卫星数'}, {field: 'longitude', title: '经度'}, {field: 'latitude', title: '纬度'}, - {title: '操作', toolbar: '#currentTableBar', align: "center"} + {title: '操作', toolbar: '#currentTableBar', fixed: "right", width: 80} ]; /** * 初始化表单,要加上,不然刷新部分组件可能会不加载 diff --git a/sec-beidou/src/main/resources/templates/page/table/gnss_add_dev.html b/sec-beidou/src/main/resources/templates/page/table/gnss_add_dev.html index 9a988cf8..831eba5f 100644 --- a/sec-beidou/src/main/resources/templates/page/table/gnss_add_dev.html +++ b/sec-beidou/src/main/resources/templates/page/table/gnss_add_dev.html @@ -25,9 +25,13 @@
- -
- + +
+
@@ -35,7 +39,7 @@
- @@ -47,8 +51,35 @@
- - +
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
@@ -68,6 +99,8 @@
+ +
@@ -92,13 +125,15 @@
- -
- + +
+ +
+
+
+ +
+
@@ -150,7 +185,6 @@
-
@@ -210,9 +244,26 @@ return false; }); + form.on('select(device_type)', function (data) { + setEcefEditor(); + }); + form.on('select(device_model)', function (data) { + setEcefEditor(); + }); }); + function setEcefEditor(){ + var $ = layui.$; + console.log($('#devicetype').val(), $('#model').val()); + if($('#devicetype').val()==1 && $('#model').val()==1){ + $('#ecef_div').show(); + } + else { + $('#ecef_div').hide(); + } + } + function setParams(data){ var form = layui.form, $ = layui.$; @@ -234,6 +285,12 @@ $('#ipose').val(data.ipose); $('#iposn').val(data.iposn); $('#iposd').val(data.iposd); + $('#ecefx').val(data.ecefx); + $('#ecefy').val(data.ecefy); + $('#ecefz').val(data.ecefz); + $('#model').val(data.model); + $('#sector').val(data.sector); + setEcefEditor(); form.render(); }