Added command handling for camera name, pipeline name pipeline duplication

This commit is contained in:
Banks Troutman
2019-10-24 15:20:15 -04:00
parent 0ce7d7465c
commit 7b48c9f964
7 changed files with 86 additions and 27 deletions

View File

@@ -16,10 +16,10 @@ public class CameraDeserializer implements JsonDeserializer<Camera> {
var jsonObj = jsonElement.getAsJsonObject();
var camFOV = jsonObj.get("FOV").getAsDouble();
var camName = jsonObj.get("name").getAsString();
var camNickname = jsonObj.get("nickname").getAsString();
var videoModeIndex = jsonObj.get("resolution").getAsInt();
var divisor = StreamDivisor.values()[jsonObj.get("streamDivisor").getAsInt()];
var pipelines = jsonObj.get("pipelines");
HashMap<Integer, Pipeline> actualPipelines = new HashMap<>();
ObjectMapper mapper = new ObjectMapper();
@@ -31,6 +31,8 @@ public class CameraDeserializer implements JsonDeserializer<Camera> {
e.printStackTrace();
}
return actualPipelines != null ? new Camera(camName, camFOV, actualPipelines, videoModeIndex,divisor) : new Camera(camName, camFOV, videoModeIndex, divisor);
var newCamera = actualPipelines != null ? new Camera(camName, camFOV, actualPipelines, videoModeIndex, divisor) : new Camera(camName, camFOV, videoModeIndex, divisor);
newCamera.setNickname(camNickname != null ? camNickname : "");
return newCamera;
}
}