mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Ensure stream divisor respects pipeline changes (#163)
Ensure stream divisor respects pipeline changes. Previously this was only set on UI commands and on construction.
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.configuration;
|
||||
|
||||
public enum StreamDivisor {
|
||||
NONE(1),
|
||||
HALF(2),
|
||||
QUARTER(4),
|
||||
SIXTH(6);
|
||||
|
||||
public final Integer value;
|
||||
|
||||
StreamDivisor(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -261,6 +261,12 @@ public class VisionModule {
|
||||
visionSource.getSettables().setBrightness(config.cameraBrightness);
|
||||
visionSource.getSettables().setExposure(config.cameraExposure);
|
||||
|
||||
// Also set new frame divisor
|
||||
dashboardInputStreamer.setFrameDivisor(
|
||||
pipelineManager.getCurrentPipelineSettings().streamingFrameDivisor);
|
||||
dashboardOutputStreamer.setFrameDivisor(
|
||||
pipelineManager.getCurrentPipelineSettings().streamingFrameDivisor);
|
||||
|
||||
if (!cameraQuirks.hasQuirk(CameraQuirk.Gain)) {
|
||||
config.cameraGain = -1;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user