| | |
| | | // 卫星可数 |
| | | private String differentialAge; |
| | | // 差分时间 |
| | | private String selfCheckStatus = "-1"; |
| | | // 割草机自检状态 |
| | | |
| | | private static final double METERS_PER_DEGREE_LAT = 111320.0d; |
| | | |
| | |
| | | target.positioningStatus = properties.getProperty("positioningStatus", "-1"); |
| | | target.satelliteCount = properties.getProperty("satelliteCount", "-1"); |
| | | target.differentialAge = properties.getProperty("differentialAge", "-1"); |
| | | target.selfCheckStatus = properties.getProperty("selfCheckStatus", "-1"); |
| | | } |
| | | |
| | | private void applyDefaults(Device target) { |
| | |
| | | target.positioningStatus = "-1"; |
| | | target.satelliteCount = "-1"; |
| | | target.differentialAge = "-1"; |
| | | target.selfCheckStatus = "-1"; |
| | | } |
| | | |
| | | public static synchronized Device initializeActiveDevice(String mowerId) { // 根据设备ID初始化活跃设备 |
| | |
| | | case "differentialAge": |
| | | this.differentialAge = value; |
| | | return true; |
| | | case "selfCheckStatus": |
| | | this.selfCheckStatus = value; |
| | | return true; |
| | | default: |
| | | System.err.println("未知字段: " + fieldName); |
| | | return false; |
| | |
| | | this.differentialAge = differentialAge; |
| | | } |
| | | |
| | | public String getSelfCheckStatus() { // 获取自检状态 |
| | | return selfCheckStatus; |
| | | } |
| | | |
| | | public void setSelfCheckStatus(String selfCheckStatus) { // 设置自检状态 |
| | | this.selfCheckStatus = selfCheckStatus; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { // 输出对象信息 |
| | | return "Device{" + |
| | |
| | | ", positioningStatus='" + positioningStatus + '\'' + |
| | | ", satelliteCount='" + satelliteCount + '\'' + |
| | | ", differentialAge='" + differentialAge + '\'' + |
| | | ", selfCheckStatus='" + selfCheckStatus + '\'' + |
| | | '}'; |
| | | } |
| | | } |