Merge branch 'dev' into class-abstraction

# Conflicts:
#	.gitignore
#	Main/src/main/java/com/chameleonvision/vision/camera/Camera.java
#	Main/src/main/java/com/chameleonvision/vision/camera/CameraSerializer.java
#	Main/src/main/java/com/chameleonvision/vision/enums/StreamDivisor.java
#	Main/src/main/java/com/chameleonvision/vision/process/CameraProcess.java
#	Main/src/main/java/com/chameleonvision/vision/process/VisionProcess.java
#	Main/src/main/java/com/chameleonvision/web/Server.java
#	Main/src/main/java/com/chameleonvision/web/SocketHandler.java
This commit is contained in:
Banks Troutman
2019-11-27 17:40:24 -05:00
15 changed files with 275 additions and 82 deletions

View File

@@ -61,7 +61,6 @@
}
},
data: () => ({
saveSnackbar: false,
timer: undefined
}),
created() {
@@ -78,6 +77,16 @@
console.error('error: ' + data.data + " , " + error);
}
}
},
computed: {
saveSnackbar: {
get() {
return this.$store.state.saveBar;
},
set(value) {
this.$store.commit("saveBar", value);
}
}
}
};
</script>

View File

@@ -5,11 +5,22 @@ import store from './store'
import vuetify from './plugins/vuetify';
import VueNativeSock from 'vue-native-websocket';
import msgPack from 'msgpack5';
import axios from 'axios';
import VueAxios from "vue-axios";
Vue.config.productionTip = false;
// Vue.use(VueNativeSock,'ws://' + location.host + '/websocket',{format: 'json'});
Vue.use(VueNativeSock, 'ws://' + location.hostname + ':8888/websocket');
if (process.env.NODE_ENV === "production"){
Vue.prototype.$address = location.host;
} else if (process.env.NODE_ENV === "development"){
Vue.prototype.$address = location.hostname + ":5800";
}
Vue.use(VueNativeSock, 'ws://' + Vue.prototype.$address + '/websocket');
Vue.use(VueAxios, axios);
Vue.prototype.$msgPack = msgPack(true);
Vue.mixin({
methods: {
handleInput(key, value) {

View File

@@ -48,7 +48,8 @@ export default new Vuex.Store({
currentPipelineIndex: 0,
cameraList: [],
pipelineList: [],
point: {}
point: {},
saveBar: false
},
mutations: {
settings: set('settings'),
@@ -66,7 +67,8 @@ export default new Vuex.Store({
Vue.set(state.pipeline, i, obj[i]);
}
},
driverMode: set('driverMode')
driverMode: set('driverMode'),
saveBar: set("saveBar")
},
actions: {
settings: state => state.settings,
@@ -79,6 +81,7 @@ export default new Vuex.Store({
cameraList: state => state.cameraList,
pipelineList: state => state.pipelineList,
point: state => state.point,
driverMode: state => state.driverMode
driverMode: state => state.driverMode,
saveBar: state => state.saveBar
}
})

View File

@@ -3,7 +3,7 @@
<CVselect name="Camera" :list="cameraList" v-model="currentCameraIndex"/>
<CVselect name="Resolution" v-model="cameraSettings.resolution" :list="resolutionList"/>
<CVselect name="Stream Resolution" v-model="cameraSettings.streamDivisor"
:list="['1:1','1:2','1:4','1:6']"/>
:list="streamResolutionList"/>
<CVnumberinput name="Diagonal FOV" v-model="cameraSettings.fov"/>
<v-btn style="margin-top:10px" small color="#4baf62" @click="sendCameraSettings">Save Camera Settings</v-btn>
</div>
@@ -24,12 +24,18 @@
},
methods: {
sendCameraSettings() {
this.handleInput('cameraSettings', this.cameraSettings);
const self = this;
this.axios.post("http://" + this.$address + "/api/settings/camera", this.cameraSettings).then(
function (response) {
if (response.status === 200){
self.$store.state.saveBar = true;
}
}
)
},
},
computed: {
currentCameraIndex: {
get() {
return this.$store.state.currentCameraIndex;
@@ -48,7 +54,23 @@
},
resolutionList: {
get() {
return this.$store.state.resolutionList;
let tmp_list = [];
for (let i of this.$store.state.resolutionList){
tmp_list.push(`${i['width']} X ${i['height']} at ${i['fps']} FPS, ${i['pixelFormat']}`)
}
return tmp_list;
}
},
streamResolutionList:{
get(){
let cam_res = this.$store.state.resolutionList[this.cameraSettings.resolution];
let tmp_list = [];
let x = 1;
for (let i = 0; i < 4; i++){
tmp_list.push(`${cam_res['width']/x} X ${cam_res['height']/x}`);
x *= 2;
}
return tmp_list;
}
},
cameraSettings: {

View File

@@ -29,7 +29,14 @@
},
methods: {
sendGeneralSettings() {
this.handleInput('generalSettings', this.settings);
const self = this;
this.axios.post("http://" + this.$address + "/api/settings/general", this.settings).then(
function (response) {
if (response.status === 200){
self.$store.state.saveBar = true;
}
}
)
}
},
computed: {