From f3eea5c9136e13a229f522101674c3c5ab66995c Mon Sep 17 00:00:00 2001 From: ori agranat Date: Sat, 26 Oct 2019 23:41:45 +0300 Subject: [PATCH 1/6] code cleanup and initial work --- .../chameleonvision/web/ServerHandler.java | 6 +- chameleon-client/src/store.js | 15 ++-- chameleon-client/src/views/Camera.vue | 56 ++++++++------ .../src/views/CameraViewes/OutputTab.vue | 73 +++++++------------ .../OutputViewes/DualCalibration.vue | 65 +++++++++++++++++ .../OutputViewes/SingleCalibration.vue | 30 ++++++++ 6 files changed, 165 insertions(+), 80 deletions(-) create mode 100644 chameleon-client/src/views/CameraViewes/OutputViewes/DualCalibration.vue create mode 100644 chameleon-client/src/views/CameraViewes/OutputViewes/SingleCalibration.vue diff --git a/Main/src/main/java/com/chameleonvision/web/ServerHandler.java b/Main/src/main/java/com/chameleonvision/web/ServerHandler.java index f50188d34..1d024e278 100644 --- a/Main/src/main/java/com/chameleonvision/web/ServerHandler.java +++ b/Main/src/main/java/com/chameleonvision/web/ServerHandler.java @@ -53,6 +53,7 @@ public class ServerHandler { setField(SettingsManager.GeneralSettings, e.getKey(), e.getValue()); } SettingsManager.saveSettings(); + sendFullSettings(); break; } case "cameraSettings": { @@ -61,6 +62,7 @@ public class ServerHandler { CameraManager.getCurrentCamera().setStreamDivisor((Integer) camSettings.get("streamDivisor")); CameraManager.getCurrentCamera().setCamVideoMode((Integer) camSettings.get("resolution"), true); SettingsManager.saveSettings(); + sendFullSettings(); break; } case "changeCameraName": { @@ -118,9 +120,7 @@ public class ServerHandler { case "currentPipeline": { var cam = CameraManager.getCurrentCamera(); cam.setCurrentPipelineIndex((Integer) entry.getValue()); - HashMap tmp = new HashMap<>(); - tmp.put("pipeline", getOrdinalPipeline()); - broadcastMessage(tmp); + sendFullSettings(); try { cam.setBrightness(cam.getCurrentPipeline().brightness); cam.setExposure(cam.getCurrentPipeline().exposure); diff --git a/chameleon-client/src/store.js b/chameleon-client/src/store.js index 6a382b0ed..85e05e73b 100644 --- a/chameleon-client/src/store.js +++ b/chameleon-client/src/store.js @@ -33,7 +33,8 @@ export default new Vuex.Store({ targetGrouping:0, targetIntersection:0, sortMode:0, - isBinary:0 + isBinary:0, + calibrationMode:0 }, cameraSettings:{}, resolutionList:[], @@ -54,7 +55,12 @@ export default new Vuex.Store({ currentPipelineIndex: set('currentPipelineIndex'), cameraList: set('cameraList'), pipelineList: set('pipelineList'), - point:set('point') + point:set('point'), + setPipeValues(state,obj){ + for(let i in obj){ + Vue.set(state.pipeline,i,obj[i]); + } + } }, actions: { settings: state => state.settings, @@ -67,10 +73,5 @@ export default new Vuex.Store({ cameraList: state =>state.cameraList, pipelineList: state =>state.pipelineList, point: state =>state.point, - setPipeValues(state,obj){ - for(let i in obj){ - Vue.set(state.pipeline,i,obj[i]); - } - } } }) diff --git a/chameleon-client/src/views/Camera.vue b/chameleon-client/src/views/Camera.vue index 917bc92f1..3a2fabd9d 100644 --- a/chameleon-client/src/views/Camera.vue +++ b/chameleon-client/src/views/Camera.vue @@ -4,52 +4,63 @@
- - + +
- +
- - + +
- - + + - + - + - + - + - +
- - + +
@@ -66,7 +77,7 @@
- +
@@ -78,7 +89,7 @@
- + No Cameras Are connected
{{point}}
@@ -90,14 +101,15 @@ Duplicate Pipeline - - - + + + - + Duplicate Cancels @@ -213,7 +225,7 @@ import CVinput from '../components/cv-input' checkCameraName(){ if(this.newCameraName !== this.cameraList[this.currentCameraIndex]){ for(let cam in this.cameraList){ - if(this.newCameraName == this.cameraList[cam]){ + if(this.newCameraName === this.cameraList[cam]){ return "Camera by that name already Exists" } } @@ -285,7 +297,7 @@ import CVinput from '../components/cv-input' return this.$store.state.pipeline; } }, - steamAdress: { + streamAddress: { get: function(){ return "http://"+location.hostname + ":"+ this.$store.state.port +"/stream.mjpg"; } diff --git a/chameleon-client/src/views/CameraViewes/OutputTab.vue b/chameleon-client/src/views/CameraViewes/OutputTab.vue index 822c87947..9a983acfd 100644 --- a/chameleon-client/src/views/CameraViewes/OutputTab.vue +++ b/chameleon-client/src/views/CameraViewes/OutputTab.vue @@ -1,19 +1,13 @@ diff --git a/chameleon-client/src/views/Settings.vue b/chameleon-client/src/views/Settings.vue index 955341178..763e67c22 100644 --- a/chameleon-client/src/views/Settings.vue +++ b/chameleon-client/src/views/Settings.vue @@ -2,12 +2,13 @@
- + General Cameras
- +
@@ -15,28 +16,28 @@
-
+ \ No newline at end of file diff --git a/chameleon-client/src/views/SettingsViewes/Cameras.vue b/chameleon-client/src/views/SettingsViewes/Cameras.vue index 9ee8ec314..926c69e50 100644 --- a/chameleon-client/src/views/SettingsViewes/Cameras.vue +++ b/chameleon-client/src/views/SettingsViewes/Cameras.vue @@ -1,69 +1,69 @@ \ No newline at end of file diff --git a/chameleon-client/src/views/SettingsViewes/General.vue b/chameleon-client/src/views/SettingsViewes/General.vue index 733cd7078..87b28c56e 100644 --- a/chameleon-client/src/views/SettingsViewes/General.vue +++ b/chameleon-client/src/views/SettingsViewes/General.vue @@ -1,46 +1,46 @@ \ No newline at end of file