Skip to content

Instantly share code, notes, and snippets.

@NoahAndrews
Created January 18, 2018 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoahAndrews/f9f5a9eb9c8a5959126066c47377d8a2 to your computer and use it in GitHub Desktop.
Save NoahAndrews/f9f5a9eb9c8a5959126066c47377d8a2 to your computer and use it in GitHub Desktop.
Getting the current configuration file's name
package org.firstinspires.ftc.teamcode;
import android.app.Activity;
import com.qualcomm.ftccommon.configuration.RobotConfigFileManager;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
@Autonomous(name = "Get Current Config File")
public class GetConfigName extends LinearOpMode {
RobotConfigFileManager configManager;
@Override
public void runOpMode() throws InterruptedException {
// Note that instantiating random classes in the SDK may not be the best idea.
// In this case, I did my best to verify that RobotConfigFileManager will work properly
// and not cause any issues when you create a new instance of it this way.
configManager = new RobotConfigFileManager((Activity) hardwareMap.appContext);
String configName = configManager.getActiveConfig().getName();
telemetry.addData("Active configuration", configName);
telemetry.update();
waitForStart();
while(opModeIsActive()) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment