Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReflectionConfig - Make class parsing public #18

Closed
AdrianVovk opened this issue Feb 2, 2020 · 0 comments
Closed

ReflectionConfig - Make class parsing public #18

AdrianVovk opened this issue Feb 2, 2020 · 0 comments

Comments

@AdrianVovk
Copy link

I'm looking for a way to programmatically register classes into the FTCDashboard config system. Here's what I'm trying to do:

object TunerRegistrar {
    private fun OpModeManager.register(cls: KClass<out OpMode>) {
        this.register(
                OpModeMeta(cls.simpleName!!, OpModeMeta.Flavor.AUTONOMOUS, "Tuning"),
                cls.java)
        FtcDashboard.getInstance().configRoot.putVariable(
                ReflectionConfig.createVariableFromClass(cls.java))
    }

    @JvmStatic
    @OpModeRegistrar
    fun registerTuners(mgr: OpModeManager) {
        if (DEBUG) {
            mgr.register(DumbWheelSpinner::class)
            mgr.register(WheelDirectionTester::class)
            mgr.register(TrackWidthTuner::class)
            mgr.register(DriveVelocityPIDTuner::class)
            mgr.register(FollowerPIDTuner::class)
            mgr.register(TurnTest::class)
            mgr.register(StraightTest::class)
            mgr.register(SplineTest::class)
            mgr.register(VisionTest::class)
        }
    }
}

However, ReflectionConfig.createVariableFromClass is a private method. Could it be made public so that this could be possible?

Thank you!

@rbrott rbrott closed this as completed in 8f6818d Feb 4, 2020
j5155 pushed a commit to jdhs-ftc/ftc-dashboard-record that referenced this issue Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant