mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-03 03:01:40 +00:00
WIP stream divisor
set enum for stream divisor
This commit is contained in:
@@ -30,6 +30,7 @@ public class Camera {
|
||||
private final Object cvSourceLock = new Object();
|
||||
private CvSource cvSource;
|
||||
private float FOV;
|
||||
private int streamDivisor;
|
||||
private CameraValues camVals;
|
||||
private CamVideoMode camVideoMode;
|
||||
private int currentPipelineIndex;
|
||||
@@ -138,11 +139,16 @@ public class Camera {
|
||||
public int getCurrentPipelineIndex() {
|
||||
return currentPipelineIndex;
|
||||
}
|
||||
|
||||
public void setCurrentPipelineIndex(int pipelineNumber) {
|
||||
if (pipelineNumber - 1 > pipelines.size()) return;
|
||||
currentPipelineIndex = pipelineNumber;
|
||||
}
|
||||
public int getStreamDivisor(){
|
||||
return streamDivisor;
|
||||
}
|
||||
public void setStreamDivisor(int divisor){
|
||||
streamDivisor = divisor;
|
||||
}
|
||||
|
||||
public HashMap<Integer, Pipeline> getPipelines() {
|
||||
return pipelines;
|
||||
|
||||
@@ -54,8 +54,10 @@ public class ServerHandler {
|
||||
break;
|
||||
}
|
||||
case "cameraSettings": {
|
||||
System.out.println("sadfsdf");
|
||||
//change camera settings using a camera settings object
|
||||
HashMap camSettings = (HashMap)entry.getValue();
|
||||
CameraManager.getCurrentCamera().setFOV((float)camSettings.get("fov"));
|
||||
CameraManager.getCurrentCamera().setStreamDivisor((Integer) camSettings.get("streamDivisor"));
|
||||
CameraManager.getCurrentCamera().setCamVideoMode((Integer) camSettings.get("resolution"),true);
|
||||
break;
|
||||
}
|
||||
case "command": {
|
||||
@@ -67,6 +69,8 @@ public class ServerHandler {
|
||||
CameraManager.setCurrentCamera((String) entry.getValue());
|
||||
HashMap<String,Object> tmp = new HashMap<>();
|
||||
tmp.put("pipeline",CameraManager.getCurrentCamera().getCurrentPipeline());
|
||||
tmp.put("port", CameraManager.getCurrentCamera().getStreamPort());
|
||||
tmp.put("resolutionList",CameraManager.getResolutionList());
|
||||
broadcastMessage(tmp);
|
||||
break;
|
||||
}
|
||||
@@ -74,7 +78,6 @@ public class ServerHandler {
|
||||
CameraManager.getCurrentCamera().setCurrentPipelineIndex((Integer) entry.getValue());
|
||||
HashMap<String,Object> tmp = new HashMap<>();
|
||||
tmp.put("pipeline",getOrdinalPipeline());
|
||||
//TODO Add cam settings to the map
|
||||
broadcastMessage(tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<CVselect name="Camera" :list="cameraList"></CVselect>
|
||||
<CVselect name="Camera" :list="cameraList" v-model="currentCameraIndex"></CVselect>
|
||||
<CVselect name="Resulotion" v-model="cameraSettings.resolution" :list="resolutionList"></CVselect>
|
||||
<CVselect name="Stream Resulotion" v-model="cameraSettings.streamResolution" :list="['1:1','1:2','1:4','1:6']"></CVselect>
|
||||
<CVselect name="Stream Resulotion" v-model="getDivisorIndex" :list="['1:1','1:2','1:4','1:6']"></CVselect>
|
||||
<CVnumberinput name="Diagonal FOV" v-model="cameraSettings.fov" ></CVnumberinput>
|
||||
<v-btn style="margin-top:10px" small color="#4baf62">Save Camera Settings</v-btn>
|
||||
</div>
|
||||
@@ -11,6 +11,7 @@
|
||||
<script>
|
||||
import CVselect from '../../components/cv-select'
|
||||
import CVnumberinput from '../../components/cv-number-input'
|
||||
import { get } from 'http';
|
||||
export default {
|
||||
name: 'CameraSettings',
|
||||
components:{
|
||||
@@ -25,9 +26,11 @@ import CVnumberinput from '../../components/cv-number-input'
|
||||
methods:{
|
||||
sendCameraSettings(){
|
||||
this.handleInput('cameraSettings',this.cameraSettings);
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
computed:{
|
||||
|
||||
currentCameraIndex:{
|
||||
get(){
|
||||
return this.$store.state.currentCameraIndex;
|
||||
|
||||
Reference in New Issue
Block a user