added port handling and pipline change sync wth ui

- added port hash map
- putting port into hashmap from camera class
- added sending port from full settings and camera change 
- nt pipe change now sends pipe name to ui
This commit is contained in:
ori agranat
2019-09-21 18:52:28 +03:00
parent 4c315ac554
commit d97f3c1e1a
5 changed files with 14 additions and 6 deletions

View File

@@ -65,7 +65,10 @@ public class CameraProcess implements Runnable {
camera.setExposure(pipeline.exposure);
camera.setBrightness(pipeline.brightness);
//TODO Send Pipeline change using websocket to client
HashMap<String,Object> pipeChange = new HashMap<>();
pipeChange.put("curr_pipeline",ntPipelineIndex);
Server.handler.broadcastMessage(pipeChange);
} else {
ntPipelineEntry.setString("pipeline" + camera.getCurrentPipelineIndex());
}
@@ -113,7 +116,6 @@ public class CameraProcess implements Runnable {
ntTimeStampEntry.setNumber(TimeStamp);
}
// TODO: Separate video output to separate function, maybe even second thread
private PipelineResult runVisionProcess(Mat inputImage, Mat outputImage) {
var pipelineResult = new PipelineResult();
@@ -155,7 +157,6 @@ public class CameraProcess implements Runnable {
}
pipelineResult.Pitch = camera.getCamVals().CalculatePitch(finalRect.center.y, pipelineResult.CalibratedY);
pipelineResult.Yaw = camera.getCamVals().CalculateYaw(finalRect.center.x, pipelineResult.CalibratedX);
// TODO Send pitch yaw distance and Raw Point using websockets to client for calib calc
drawContour(outputImage, finalRect);
}
}