ecef缓存在device类里,单位改为mm
This commit is contained in:
parent
edd0882302
commit
097a6b97bc
@ -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;
|
||||
|
||||
}
|
||||
|
||||
@ -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<double[]>{
|
||||
@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<double[]>{
|
||||
@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<double[]>{
|
||||
@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 ++;
|
||||
|
||||
@ -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)。
|
||||
*
|
||||
* <p>该方法将给定的纬度、经度和高程(LLA)转换为 WGS84 参考系下的 ECEF 坐标。
|
||||
* 转换过程中使用了 WGS84 椭球体模型常数。</p>
|
||||
*
|
||||
* <p>使用的公式参考自:
|
||||
* <a href="https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates">
|
||||
* 地理坐标转换 - 维基百科</a></p>
|
||||
*
|
||||
* @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)转换为地理坐标(纬度、经度、海拔)。
|
||||
*
|
||||
* <p>该方法将给定的 ECEF 坐标转换为 WGS84 参考系下的地理坐标(LLA)。
|
||||
* 转换过程中使用了 WGS84 椭球体模型常数。</p>
|
||||
*
|
||||
* <p>使用的公式参考自:
|
||||
* <a href="https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates">
|
||||
* 地理坐标转换 - 维基百科</a></p>
|
||||
*
|
||||
* @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)坐标。
|
||||
*
|
||||
* <p>该方法将给定的两个 ECEF 坐标(基准站和流动站)转换为以基准站为原点的 ENU 坐标。
|
||||
* 转换过程中使用了 WGS84 参考系。</p>
|
||||
*
|
||||
* <p>使用的公式参考自:
|
||||
* <a href="https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates">
|
||||
* 地理坐标转换 - 维基百科</a></p>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -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());
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -51,6 +51,9 @@ public class Device {
|
||||
Double latitude;
|
||||
Double longitude;
|
||||
Double altitude;
|
||||
Double ecefx;
|
||||
Double ecefy;
|
||||
Double ecefz;
|
||||
|
||||
Double iPose;
|
||||
Double iPosn;
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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: "<div>{{d.model==0?'G505':'G510'}}</div>"},
|
||||
{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;
|
||||
}
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
|
||||
@ -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}
|
||||
];
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
|
||||
@ -25,9 +25,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">设备名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" id="name" placeholder="请输入设备名称" value="" class="layui-input">
|
||||
<label class="layui-form-label required">使用状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="opmode" id="opmode" lay-verify="required" lay-search="">
|
||||
<option value="0">正常</option>
|
||||
<option value="1">维护</option>
|
||||
<option value="2">停用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,7 +39,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">设备类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="devicetype" id="devicetype" lay-verify="required" lay-search="">
|
||||
<select name="devicetype" id="devicetype" lay-verify="required" lay-search="" lay-filter="device_type">
|
||||
<option value="0">监测站</option>
|
||||
<option value="1">基准站</option>
|
||||
</select>
|
||||
@ -47,8 +51,35 @@
|
||||
<input type="number" name="parentid" id="parentid" placeholder="请输入关联基准站编号" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">型号</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="model" id="model" lay-verify="required" lay-search="" lay-filter="device_model">
|
||||
<option value="0">G505</option>
|
||||
<option value="1">G510</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="ecef_div">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">ECEF X</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="ecefx" id="ecefx" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">Y</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="ecefy" id="ecefy" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">Z</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="ecefz" id="ecefz" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
@ -68,6 +99,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">所属部门</label>
|
||||
@ -92,13 +125,15 @@
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">使用状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="opmode" id="opmode" lay-verify="required" lay-search="">
|
||||
<option value="0">正常</option>
|
||||
<option value="1">维护</option>
|
||||
<option value="2">停用</option>
|
||||
</select>
|
||||
<label class="layui-form-label required">断面</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sector" id="sector" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">工点名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" id="name" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -150,7 +185,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block" style="float:right" >
|
||||
@ -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();
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user