Skip to content

Commit

Permalink
lint and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Juniormunk committed Oct 9, 2024
1 parent 4fbffff commit dcaec8a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@

package org.photonvision.vision.pipeline;

import com.fasterxml.jackson.annotation.JsonTypeName;
import org.photonvision.common.util.numbers.IntegerCouple;
import org.photonvision.vision.apriltag.AprilTagFamily;
import org.photonvision.vision.target.TargetModel;

import com.fasterxml.jackson.annotation.JsonTypeName;

@JsonTypeName("ArucoPipelineSettings")
public class ArucoPipelineSettings extends AdvancedPipelineSettings {
public AprilTagFamily tagFamily = AprilTagFamily.kTag16h5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@

package org.photonvision.vision.processes;

import edu.wpi.first.cscore.CameraServerJNI;
import edu.wpi.first.cscore.VideoException;
import edu.wpi.first.math.util.Units;
import io.javalin.websocket.WsContext;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;

import org.opencv.core.Size;
import org.photonvision.common.configuration.CameraConfiguration;
import org.photonvision.common.configuration.ConfigManager;
Expand Down Expand Up @@ -54,11 +57,6 @@
import org.photonvision.vision.target.TargetModel;
import org.photonvision.vision.target.TrackedTarget;

import edu.wpi.first.cscore.CameraServerJNI;
import edu.wpi.first.cscore.VideoException;
import edu.wpi.first.math.util.Units;
import io.javalin.websocket.WsContext;

/**
* This is the God Class
*
Expand Down Expand Up @@ -94,7 +92,6 @@ public class VisionModule {
MJPGFrameConsumer inputVideoStreamer;
MJPGFrameConsumer outputVideoStreamer;


public VisionModule(PipelineManager pipelineManager, VisionSource visionSource, int index) {
logger =
new Logger(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;

import org.apache.commons.lang3.tuple.Pair;
import org.opencv.core.Point;
import org.photonvision.common.dataflow.DataChangeSubscriber;
Expand All @@ -47,10 +46,11 @@ public class VisionModuleChangeSubscriber extends DataChangeSubscriber {

public VisionModuleChangeSubscriber(VisionModule parentModule) {
this.parentModule = parentModule;
logger = new Logger(
VisionModuleChangeSubscriber.class,
parentModule.visionSource.getSettables().getConfiguration().nickname,
LogGroup.VisionModule);
logger =
new Logger(
VisionModuleChangeSubscriber.class,
parentModule.visionSource.getSettables().getConfiguration().nickname,
LogGroup.VisionModule);
}

@Override
Expand Down Expand Up @@ -95,8 +95,8 @@ public void processSettingChanges() {
switch (propName) {
case "pipelineName": // rename current pipeline
logger.info("Changing nick to " + newPropValue);
parentModule.pipelineManager
.getCurrentPipelineSettings().pipelineNickname = (String) newPropValue;
parentModule.pipelineManager.getCurrentPipelineSettings().pipelineNickname =
(String) newPropValue;
parentModule.saveAndBroadcastAll();
continue;
case "newPipelineInfo": // add new pipeline
Expand Down Expand Up @@ -128,8 +128,9 @@ public void processSettingChanges() {
continue;
case "startCalibration":
try {
var data = JacksonUtils.deserialize(
(Map<String, Object>) newPropValue, UICalibrationData.class);
var data =
JacksonUtils.deserialize(
(Map<String, Object>) newPropValue, UICalibrationData.class);
parentModule.startCalibration(data);
parentModule.saveAndBroadcastAll();
} catch (Exception e) {
Expand Down Expand Up @@ -249,18 +250,15 @@ public void processSettingChanges() {
}

/**
* Sets the value of a property in the given object using reflection. This
* method should not be
* used generally and is only known to be correct in the context of
* `onDataChangeEvent`.
* Sets the value of a property in the given object using reflection. This method should not be
* used generally and is only known to be correct in the context of `onDataChangeEvent`.
*
* @param currentSettings The object whose property needs to be set.
* @param propName The name of the property to be set.
* @param newPropValue The new value to be assigned to the property.
* @param propName The name of the property to be set.
* @param newPropValue The new value to be assigned to the property.
* @throws IllegalAccessException If the field cannot be accessed.
* @throws NoSuchFieldException If the field does not exist.
* @throws Exception If an some other unknown exception occurs
* while setting the property.
* @throws NoSuchFieldException If the field does not exist.
* @throws Exception If an some other unknown exception occurs while setting the property.
*/
protected static void setProperty(Object currentSettings, String propName, Object newPropValue)
throws IllegalAccessException, NoSuchFieldException, Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.util.function.Consumer;
import java.util.function.Supplier;

import org.photonvision.common.logging.LogGroup;
import org.photonvision.common.logging.Logger;
import org.photonvision.vision.camera.QuirkyCamera;
Expand Down

0 comments on commit dcaec8a

Please sign in to comment.