mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
UI 3d mode, ConfigManager bugfixes (#103)
* stupid bugs I guess idk where else to put this commit * Run spotless * Fix config file loading Splits load into own method * Run spotless
This commit is contained in:
@@ -87,11 +87,9 @@ public class ConfigManager {
|
||||
this.camerasFolder = new File(Path.of(configDirectoryFile.toString(), "cameras").toUri());
|
||||
|
||||
TimedTaskManager.getInstance().addTask("ConfigManager", this::checkSaveAndWrite, 1000);
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
private void load() {
|
||||
public void load() {
|
||||
logger.info("Loading settings...");
|
||||
if (!configDirectoryFile.exists()) {
|
||||
if (configDirectoryFile.mkdirs()) {
|
||||
@@ -163,6 +161,9 @@ public class ConfigManager {
|
||||
public void saveToDisk() {
|
||||
logger.info("Saving settings...");
|
||||
|
||||
// Delete old configs
|
||||
FileUtils.deleteDirectory(camerasFolder.toPath());
|
||||
|
||||
try {
|
||||
JacksonUtils.serialize(hardwareConfigFile.toPath(), config.getHardwareConfig());
|
||||
} catch (IOException e) {
|
||||
@@ -174,9 +175,6 @@ public class ConfigManager {
|
||||
logger.error("Could not save network config!", e);
|
||||
}
|
||||
|
||||
// Delete old configs
|
||||
FileUtils.deleteDirectory(camerasFolder.toPath());
|
||||
|
||||
// save all of our cameras
|
||||
var cameraConfigMap = config.getCameraConfigurations();
|
||||
for (var subdirName : cameraConfigMap.keySet()) {
|
||||
|
||||
Reference in New Issue
Block a user