diff --git a/photon-client/package-lock.json b/photon-client/package-lock.json index f5f9bbaa8..7d9e8eaca 100644 --- a/photon-client/package-lock.json +++ b/photon-client/package-lock.json @@ -12282,9 +12282,8 @@ } }, "vue-native-websocket": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/vue-native-websocket/-/vue-native-websocket-2.0.14.tgz", - "integrity": "sha512-oK8+xG1gmqRs4JngHGwEc4zWoRjsdMB20Sz8pemkh4lW2Vr2676/cDRtd30aGnO2xF7Oxf003wS5JO0kypUsCw==", + "version": "git+https://github.com/PhotonVision/vue-native-websocket.git#7a327918e03b215b6899b0d648c5130ece1fa912", + "from": "git+https://github.com/PhotonVision/vue-native-websocket.git#7a32791", "dependencies": { "abbrev": { "version": "1.0.9", diff --git a/photon-client/package.json b/photon-client/package.json index 3acef2efc..eb03563c0 100644 --- a/photon-client/package.json +++ b/photon-client/package.json @@ -17,7 +17,7 @@ "msgpack5": "^4.2.1", "vue": "^2.6.11", "vue-axios": "^2.1.5", - "vue-native-websocket": "^2.0.14", + "vue-native-websocket": "git+https://github.com/PhotonVision/vue-native-websocket.git#7a32791", "vue-router": "^3.3.2", "vuetify": "^2.2.34", "vuex": "^3.4.0" diff --git a/photon-client/src/App.vue b/photon-client/src/App.vue index 71b073edf..a0411a0a0 100644 --- a/photon-client/src/App.vue +++ b/photon-client/src/App.vue @@ -25,11 +25,10 @@ - - mdi-view-dashboard @@ -38,11 +37,22 @@ Dashboard + + + mdi-camera + + + Cameras + + - mdi-settings @@ -79,6 +89,24 @@ Advanced Mode + + + + + mdi-wifi + + + mdi-wifi-off + + + + {{ $store.state.backendConnected ? "Connected" : "Trying to connect..." }} + + @@ -123,6 +151,8 @@ logView }, data: () => ({ + // Used so that we can switch back to the previously selected pipeline after camera calibration + previouslySelectedIndex: null, timer: undefined, isLogger: false, log: "", @@ -138,11 +168,16 @@ }, compact: { get() { - return this.$store.state.compactMode === undefined ? this.$vuetify.breakpoint.smAndDown : this.$store.state.compactMode || this.$vuetify.breakpoint.smAndDown; + if (this.$store.state.compactMode === undefined) { + return this.$vuetify.breakpoint.smAndDown; + } else { + return this.$store.state.compactMode || this.$vuetify.breakpoint.smAndDown; + } }, set(value) { // compactMode is the user's preference for compact mode; it overrides screen size this.$store.commit("compactMode", value); + localStorage.setItem("compactMode", value); }, } }, @@ -165,6 +200,7 @@ } }); + this.$options.sockets.onmessage = (data) => { try { let message = this.$msgPack.decode(data.data); @@ -176,13 +212,24 @@ } catch (error) { console.error('error: ' + data.data + " , " + error); } + }; + this.$options.sockets.onopen = () => { + this.$store.state.backendConnected = true; + }; + + let closed = () => { + this.$store.state.backendConnected = false; } + this.$options.sockets.onclose = closed; + this.$options.sockets.onerror = closed; + + this.$connect(); }, methods: { handleMessage(key, value) { if (key === "logMessage") { - console.log(value) - this.logMessage(value, 0) + console.log("[FROM BACKEND]" + value); + this.logMessage(value, 0); } else if (key === "updatePipelineResult") { this.$store.commit('mutatePipelineResults', value) } else if (this.$store.state.hasOwnProperty(key)) { @@ -192,7 +239,7 @@ } else { switch (key) { default: { - console.log(value); + console.error("Unknown message from backend: " + value); } } } @@ -215,6 +262,16 @@ const colors = ["\u001b[31m", "\u001b[32m", "\u001b[33m", "\u001b[34m"] const reset = "\u001b[0m" this.log += `${colors[level]}${message}${reset}\n` + }, + switchToDriverMode() { + this.previouslySelectedIndex = this.$store.getters.currentPipelineIndex; + this.handleInputWithIndex('currentPipeline', -1) + }, + rollbackPipelineIndex() { + if (this.previouslySelectedIndex !== null) { + this.handleInputWithIndex('currentPipeline', this.previouslySelectedIndex) + } + this.previouslySelectedIndex = null; } } }; @@ -225,6 +282,21 @@ + + \ No newline at end of file diff --git a/photon-client/src/assets/eyedropper.svg b/photon-client/src/assets/eyedropper.svg new file mode 100644 index 000000000..1736213b9 --- /dev/null +++ b/photon-client/src/assets/eyedropper.svg @@ -0,0 +1,68 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/photon-client/src/assets/noStream.jpg b/photon-client/src/assets/noStream.jpg new file mode 100644 index 000000000..b3b4f09b2 Binary files /dev/null and b/photon-client/src/assets/noStream.jpg differ diff --git a/photon-client/src/components/common/cv-image.vue b/photon-client/src/components/common/cv-image.vue index 199665297..a044a3563 100644 --- a/photon-client/src/components/common/cv-image.vue +++ b/photon-client/src/components/common/cv-image.vue @@ -1,8 +1,9 @@ s - \ No newline at end of file diff --git a/photon-client/src/components/common/cv-number-input.vue b/photon-client/src/components/common/cv-number-input.vue index f0bbc39d2..efbbfe43d 100644 --- a/photon-client/src/components/common/cv-number-input.vue +++ b/photon-client/src/components/common/cv-number-input.vue @@ -4,8 +4,11 @@ dense align="center" > - - {{ name }} + + @@ -24,13 +29,15 @@ \ No newline at end of file diff --git a/photon-client/src/views/SettingsViews/General.vue b/photon-client/src/views/SettingsViews/General.vue index cb128429b..3aa0f2006 100644 --- a/photon-client/src/views/SettingsViews/General.vue +++ b/photon-client/src/views/SettingsViews/General.vue @@ -1,86 +1,55 @@ - \ No newline at end of file diff --git a/photon-client/src/views/SettingsViews/Lighting.vue b/photon-client/src/views/SettingsViews/Lighting.vue new file mode 100644 index 000000000..960e3d16a --- /dev/null +++ b/photon-client/src/views/SettingsViews/Lighting.vue @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/photon-client/src/views/SettingsViews/Networking.vue b/photon-client/src/views/SettingsViews/Networking.vue new file mode 100644 index 000000000..3de8e1e07 --- /dev/null +++ b/photon-client/src/views/SettingsViews/Networking.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/photon-server/src/main/resources/web/index.html b/photon-server/src/main/resources/web/index.html index f008dfd12..988f55e6a 100644 --- a/photon-server/src/main/resources/web/index.html +++ b/photon-server/src/main/resources/web/index.html @@ -1 +1 @@ -

UI has not been copied!

\ No newline at end of file +

UI has not been copied!