|
|
|
@ -22,6 +22,7 @@ import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.http.HttpResponse; |
|
|
|
import org.apache.http.client.methods.HttpGet; |
|
|
|
import org.apache.http.impl.client.CloseableHttpClient; |
|
|
|
@ -71,16 +72,13 @@ public class IvsDeviceController { |
|
|
|
ruleItem.put("usefReflectedTemp", false);//写死 |
|
|
|
ruleItem.put("alarmSettingList", alarmSettingListEx);//写死 |
|
|
|
radiometryRuleExList.add(ruleItem); |
|
|
|
|
|
|
|
// 设置 configItem |
|
|
|
configItem.put("radiometryRuleExList", radiometryRuleExList); |
|
|
|
|
|
|
|
List<Map<String, Object>> radiometryRuleList = new ArrayList<>(); |
|
|
|
JSONObject radiometryRule = new JSONObject(); |
|
|
|
Map<String, Object> localParam = new HashMap<>(); |
|
|
|
List<Map<String, Object>> alarmSettingList = new ArrayList<>(); |
|
|
|
Map<String, Object> alarmSetting = new HashMap<>(); |
|
|
|
|
|
|
|
radiometryRule.put("areaSubType", 1);//区域测温的子类型 1:矩形 |
|
|
|
radiometryRule.put("enable", 1);//使能 |
|
|
|
radiometryRule.put("meterType", 3);//区域 |
|
|
|
@ -88,13 +86,11 @@ public class IvsDeviceController { |
|
|
|
radiometryRule.put("ruleId", 12);//自己取最大没人用的 |
|
|
|
radiometryRule.put("samplePeriod", 3);// |
|
|
|
radiometryRule.put("name", tempConfiguration.getName());//传 定义一个名字 |
|
|
|
|
|
|
|
//设置localParam |
|
|
|
localParam.put("enable", 1); |
|
|
|
localParam.put("objectDistance", 4); |
|
|
|
localParam.put("objectEmissivity", 0.9700000286102295); |
|
|
|
localParam.put("refalectedTemp", 25); |
|
|
|
|
|
|
|
//设置alarmSettingList |
|
|
|
alarmSetting.put("alarmCondition", 1); |
|
|
|
alarmSetting.put("duration", 30); |
|
|
|
@ -104,17 +100,12 @@ public class IvsDeviceController { |
|
|
|
alarmSetting.put("resultType", 2); |
|
|
|
alarmSetting.put("threshold", 20.1); |
|
|
|
alarmSettingList.add(alarmSetting); |
|
|
|
|
|
|
|
radiometryRule.put("alarmSettingList", alarmSettingList); |
|
|
|
radiometryRule.put("localParam", localParam); |
|
|
|
// |
|
|
|
radiometryRule.put("polygonList", tempConfiguration.getPolygonList()); |
|
|
|
|
|
|
|
radiometryRuleList.add(radiometryRule); |
|
|
|
configItem.put("radiometryRuleList", radiometryRuleList); |
|
|
|
|
|
|
|
|
|
|
|
json.put("deviceCode", tempConfiguration.getCameraCode());//传 |
|
|
|
json.put("deviceCode", tempConfiguration.getCameraCode().split("#")[0]);//传 |
|
|
|
json.put("configType", 500);//写死500 |
|
|
|
json.put("configItem", configItem); |
|
|
|
System.out.println(json); |
|
|
|
@ -138,7 +129,7 @@ public class IvsDeviceController { |
|
|
|
*/ |
|
|
|
@PostMapping("/temper") |
|
|
|
public String temper(@RequestBody Temp temp) { |
|
|
|
String cameraCode = temp.getCameraCode(); //cameraCode摄像机编码 |
|
|
|
String cameraCode = temp.getCameraCode().split("#")[0]; //cameraCode摄像机编码 |
|
|
|
int presetId = temp.getPresetId(); //预设位ID |
|
|
|
int ruleId = 12; //规则ID 暂时写死取12就行 |
|
|
|
// int meterType = temp.getMeterType(); |
|
|
|
@ -157,6 +148,8 @@ public class IvsDeviceController { |
|
|
|
return "0"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping({"channelsnap"}) |
|
|
|
public ResponseEntity<InputStreamResource> channelSnap(IvsDevChanSnapVo ivsDevChanSnapVo) throws Exception { |
|
|
|
if (version.equals("1800")) { |
|
|
|
@ -298,11 +291,17 @@ public class IvsDeviceController { |
|
|
|
|
|
|
|
@GetMapping({"channellist"}) |
|
|
|
public SipbDeviceListView channelList(IvsDevChanListVo ivsDevChanListVo) { |
|
|
|
if(version.equals("1800")){ |
|
|
|
ivsDevChanListVo.setDeviceType(2); |
|
|
|
} |
|
|
|
return ivsCommonService.get(UriUtils.parse(IvsConst.URI_DEVICE_LIST, ivsDevChanListVo), SipbDeviceListView.class); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping({"channellistJson"}) |
|
|
|
public JSONObject channelListJson(IvsDevChanListVo ivsDevChanListVo) { |
|
|
|
if(version.equals("1800")){ |
|
|
|
ivsDevChanListVo.setDeviceType(2); |
|
|
|
} |
|
|
|
return ivsCommonService.getResultJson(UriUtils.parse(IvsConst.URI_DEVICE_LIST, ivsDevChanListVo)); |
|
|
|
} |
|
|
|
|
|
|
|
|