Commit 0018f555 authored by MarkG's avatar MarkG Committed by TIGERs GitLab
Browse files

Simplify run configs and rename productive to tournament mode

See merge request main/Sumatra!1525

sumatra-commit: ebee52d201d0d2146b18a6f8f4e4bca025abca53
parent 288afe9b
Pipeline #17762 passed with stage
in 5 minutes and 37 seconds
......@@ -137,7 +137,7 @@ public class ToolBar
private void toggleTournamentMode(ActionEvent e)
{
JToggleButton btn = (JToggleButton) e.getSource();
SumatraModel.getInstance().setProductive(btn.isSelected());
SumatraModel.getInstance().setTournamentMode(btn.isSelected());
}
......
/*
* Copyright (c) 2009 - 2020, DHBW Mannheim - TIGERs Mannheim
* Copyright (c) 2009 - 2022, DHBW Mannheim - TIGERs Mannheim
*/
package edu.tigers.sumatra.persistence;
......@@ -162,7 +162,7 @@ public class RecordManager extends AModule implements IRefereeObserver
@Override
public void onNewRefereeMsg(final SslGcRefereeMessage.Referee refMsg)
{
if (autoRecord && SumatraModel.getInstance().isProductive() && (refMsg != null)
if (autoRecord && SumatraModel.getInstance().isTournamentMode() && (refMsg != null)
&& refMsg.getCommandCounter() != lastCommandCounter)
{
startStopRecording(refMsg);
......
/*
* Copyright (c) 2009 - 2018, DHBW Mannheim - TIGERs Mannheim
* Copyright (c) 2009 - 2022, DHBW Mannheim - TIGERs Mannheim
*/
package edu.tigers.sumatra.wp;
......@@ -12,25 +12,25 @@ import edu.tigers.sumatra.wp.data.WorldFrameWrapper;
public class BerkeleyAutoPauseHook implements IWorldFrameObserver, IBerkeleyRecorderHook
{
@Override
public void start()
{
SumatraModel.getInstance().getModule(AWorldPredictor.class).addObserver(this);
}
@Override
public void stop()
{
SumatraModel.getInstance().getModule(AWorldPredictor.class).removeObserver(this);
}
@Override
public void onNewWorldFrame(final WorldFrameWrapper wFrameWrapper)
{
if (SumatraModel.getInstance().isProductive() && wFrameWrapper.getGameState().isIdleGame())
if (SumatraModel.getInstance().isTournamentMode() && wFrameWrapper.getGameState().isIdleGame())
{
SumatraModel.getInstance().getModule(RecordManager.class).pauseRecorder();
} else
......
......@@ -366,7 +366,7 @@ public class WorldInfoCollector extends AWorldPredictor
registerToCamModule();
registerToRecordManagerModule();
ShapeMap.setPersistDebugShapes(!SumatraModel.getInstance().isProductive());
ShapeMap.setPersistDebugShapes(!SumatraModel.getInstance().isTournamentMode());
}
......
......@@ -9,6 +9,7 @@ import edu.tigers.moduli.exceptions.DependencyException;
import edu.tigers.moduli.exceptions.LoadModulesException;
import edu.tigers.moduli.listenerVariables.ModulesState;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
......@@ -54,8 +55,9 @@ public final class SumatraModel extends Moduli
// Application Properties
private static final String CONFIG_SETTINGS_PATH = "./config/";
private boolean productive = false;
@Getter
@Setter
private boolean tournamentMode;
private boolean simulation = false;
private String environment = "";
......@@ -96,7 +98,7 @@ public final class SumatraModel extends Moduli
SumatraModel.getInstance().setCurrentModuliConfig(moduliConfig);
loadModulesOfConfig(getCurrentModuliConfig());
startModules();
} catch (Throwable e)
} catch (Exception e)
{
log.error("Could not start Sumatra.", e);
}
......@@ -361,26 +363,6 @@ public final class SumatraModel extends Moduli
}
/**
* Set if application should run in productive mode
*
* @param productive
*/
public void setProductive(final boolean productive)
{
this.productive = productive;
}
/**
* @return if we are in productive (match) mode
*/
public boolean isProductive()
{
return productive;
}
/**
* save properties
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment