package com.anyun.h264.model;
|
|
/**
|
* 水印信息数据模型
|
* 包含车牌、学员、教练、经度、纬度、驾校、车速等信息
|
*/
|
public class WatermarkInfo {
|
/** 车牌号 */
|
private String plateNumber;
|
|
/** 学员姓名 */
|
private String student;
|
|
/** 教练姓名 */
|
private String coach;
|
|
/** 经度 */
|
private Double longitude;
|
|
/** 纬度 */
|
private Double latitude;
|
|
/** 驾校名称 */
|
private String drivingSchool;
|
|
/** 车速(单位:km/h) */
|
private Double speed;
|
|
public WatermarkInfo() {
|
}
|
|
public String getPlateNumber() {
|
return plateNumber;
|
}
|
|
public void setPlateNumber(String plateNumber) {
|
this.plateNumber = plateNumber;
|
}
|
|
public String getStudent() {
|
return student;
|
}
|
|
public void setStudent(String student) {
|
this.student = student;
|
}
|
|
public String getCoach() {
|
return coach;
|
}
|
|
public void setCoach(String coach) {
|
this.coach = coach;
|
}
|
|
public Double getLongitude() {
|
return longitude;
|
}
|
|
public void setLongitude(Double longitude) {
|
this.longitude = longitude;
|
}
|
|
public Double getLatitude() {
|
return latitude;
|
}
|
|
public void setLatitude(Double latitude) {
|
this.latitude = latitude;
|
}
|
|
public String getDrivingSchool() {
|
return drivingSchool;
|
}
|
|
public void setDrivingSchool(String drivingSchool) {
|
this.drivingSchool = drivingSchool;
|
}
|
|
public Double getSpeed() {
|
return speed;
|
}
|
|
public void setSpeed(Double speed) {
|
this.speed = speed;
|
}
|
|
/**
|
* 格式化水印信息为显示文本
|
* @return 格式化的水印文本
|
*/
|
public String formatWatermarkText() {
|
StringBuilder sb = new StringBuilder();
|
|
if (plateNumber != null && !plateNumber.isEmpty()) {
|
sb.append("车牌:").append(plateNumber);
|
}
|
|
if (student != null && !student.isEmpty()) {
|
if (sb.length() > 0) sb.append(" ");
|
sb.append("学员:").append(student);
|
}
|
|
if (coach != null && !coach.isEmpty()) {
|
if (sb.length() > 0) sb.append(" ");
|
sb.append("教练:").append(coach);
|
}
|
|
if (longitude != null && latitude != null) {
|
if (sb.length() > 0) sb.append(" ");
|
sb.append("位置:").append(String.format("%.6f,%.6f", latitude, longitude));
|
}
|
|
if (drivingSchool != null && !drivingSchool.isEmpty()) {
|
if (sb.length() > 0) sb.append(" ");
|
sb.append("驾校:").append(drivingSchool);
|
}
|
|
if (speed != null) {
|
if (sb.length() > 0) sb.append(" ");
|
sb.append("车速:").append(String.format("%.1f", speed)).append("km/h");
|
}
|
|
return sb.toString();
|
}
|
|
@Override
|
public String toString() {
|
return "WatermarkInfo{" +
|
"plateNumber='" + plateNumber + '\'' +
|
", student='" + student + '\'' +
|
", coach='" + coach + '\'' +
|
", longitude=" + longitude +
|
", latitude=" + latitude +
|
", drivingSchool='" + drivingSchool + '\'' +
|
", speed=" + speed +
|
'}';
|
}
|
}
|