mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
web socket speed improvement and input values bugfix
This commit is contained in:
@@ -145,16 +145,20 @@ public class SocketHandler {
|
||||
switch (entry.getKey()) {
|
||||
case "exposure": {
|
||||
currentCamera.setExposure((Integer) entry.getValue());
|
||||
break;
|
||||
}
|
||||
case "brightness": {
|
||||
currentCamera.setBrightness((Integer) entry.getValue());
|
||||
break;
|
||||
}
|
||||
case "videoMode":{
|
||||
currentCamera.setVideoMode((Integer) entry.getValue());
|
||||
break;
|
||||
}
|
||||
case "streamDivisor":{
|
||||
VisionProcess currentVisionProcess = VisionManager.getCurrentUIVisionProcess();
|
||||
currentVisionProcess.cameraStreamer.setDivisor(StreamDivisor.values()[(Integer) entry.getValue()], true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,10 +64,11 @@
|
||||
timer: undefined
|
||||
}),
|
||||
created() {
|
||||
this.$options.sockets.onmessage = async (data) => {
|
||||
this.$options.sockets.onmessage = (data) => {
|
||||
try {
|
||||
var buffer = await data.data.arrayBuffer();
|
||||
let message = this.$msgPack.decode(buffer);
|
||||
|
||||
let message = this.$msgPack.decode(data.data);
|
||||
|
||||
for (let prop in message) {
|
||||
if (message.hasOwnProperty(prop)) {
|
||||
this.handleMessage(prop, message[prop]);
|
||||
|
||||
@@ -16,8 +16,13 @@ if (process.env.NODE_ENV === "production"){
|
||||
Vue.prototype.$address = location.hostname + ":5800";
|
||||
}
|
||||
|
||||
const url = 'ws://' + Vue.prototype.$address + '/websocket';
|
||||
var ws = new WebSocket(url);
|
||||
ws.binaryType = "arraybuffer";
|
||||
|
||||
Vue.use(VueNativeSock, 'ws://' + Vue.prototype.$address + '/websocket');
|
||||
Vue.use(VueNativeSock, url,{
|
||||
WebSocket: ws
|
||||
});
|
||||
Vue.use(VueAxios, axios);
|
||||
Vue.prototype.$msgPack = msgPack(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user