Created
January 18, 2018 15:12
-
-
Save ItsHarper/f9f5a9eb9c8a5959126066c47377d8a2 to your computer and use it in GitHub Desktop.
Getting the current configuration file's name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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