mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
added json serializer and de serializer
This commit is contained in:
@@ -57,22 +57,10 @@ public class VisionManager {
|
||||
// Gson gson = new GsonBuilder().registerTypeAdapter(USBCameraProcess.class, new CameraDeserializer());
|
||||
// }
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
public void PipelineSerializer(List<CVPipelineSettings> list, Path path) throws IOException {
|
||||
File pipelineFile = new File(path.toString());
|
||||
ObjectMapper objectMapper = new ObjectMapper().enableDefaultTyping();
|
||||
objectMapper.writeValue(pipelineFile,list);
|
||||
}
|
||||
|
||||
public List<CVPipelineSettings> PipelineDESerializer(Path path) throws IOException {
|
||||
File pipelineFile = new File(path.toString());
|
||||
ObjectMapper objectMapper = new ObjectMapper().enableDefaultTyping();
|
||||
List<CVPipelineSettings> list = Arrays.asList(objectMapper.readValue(pipelineFile, CVPipelineSettings[].class));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void initializeProcesses() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user