diff --git a/app/src/main/java/cmu/xprize/robotutor/RoboTutor.java b/app/src/main/java/cmu/xprize/robotutor/RoboTutor.java index b307e8eb..2487eeb4 100644 --- a/app/src/main/java/cmu/xprize/robotutor/RoboTutor.java +++ b/app/src/main/java/cmu/xprize/robotutor/RoboTutor.java @@ -87,6 +87,7 @@ import cmu.xprize.robotutor.tutorengine.util.CAssetObject; import cmu.xprize.robotutor.tutorengine.util.CrashHandler; import cmu.xprize.robotutor.tutorengine.widgets.core.IGuidView; +import cmu.xprize.robotutor.tutorengine.util.MABHandler; import cmu.xprize.util.CDisplayMetrics; import cmu.xprize.util.CLoaderView; import cmu.xprize.util.IReadyListener; @@ -207,6 +208,10 @@ public class RoboTutor extends Activity implements IReadyListener, IRoboTutor, H ScreenRecordHelper screenRecordHelper; private ScreenRecorder screenRecorder = null; + + //Declare armName + private String armName = "default_arm"; + @Override protected void onCreate(Bundle savedInstanceState) { @@ -351,7 +356,7 @@ private void initializeAndStartLogs() { String initTime = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss", Locale.US).format(calendar.getTime()); SEQUENCE_ID_STRING = String.format(Locale.US, "%06d", getNextLogSequenceId()); // NOTE: Need to include the configuration name when that is fully merged - String logFilename = "RoboTutor_" + // TODO TODO TODO there should be a version name in here!!! + String logFilename = "RoboTutor_" + armName + Configuration.configVersion(this) + "_" + BuildConfig.VERSION_NAME + "_" + SEQUENCE_ID_STRING + "_" + initTime + "_" + Build.SERIAL; @@ -373,6 +378,13 @@ private void initializeAndStartLogs() { // TODO : implement time stamps logManager.postDateTimeStamp(GRAPH_MSG, "RoboTutor:SessionStart"); logManager.postEvent_I(GRAPH_MSG, "EngineVersion:" + VERSION_RT); + + // After starting logging, select the arm name using MABHandler + armName = MABHandler.getArm(ARM_WEIGHTS_FILE, null); + + // Update the log filename with the selected arm name + logFilename = logFilename.replace("default_arm", armName); + Log.w(TAG, "Log filename updated: " + logFilename); } /**