acmerobotics / ftc-dashboard

React-based web dashboard designed for FTC
https://acmerobotics.github.io/ftc-dashboard
Other
168 stars 125 forks source link

Configuration does not support long numbers #148

Closed BD103 closed 8 months ago

BD103 commented 8 months ago

When I try editing long variables through FTC Dashboard, they are treated as empty dropdowns instead of actual numbers.

image
@Config
object AprilVision {
    @JvmField
    var OPTIMUM_EXPOSURE: Long = 1

    @JvmField
    var OPTIMUM_GAIN: Int = 255
}

I am using Kotlin, but I can also reproduce it in Java if requested. I theorize the reason this is happening is because the JVM treats long types as two ints, but FTC Dashboard's serialization can't handle it.

BD103 commented 8 months ago

Adding on to that, it seems the primitives are hardcoded here:

https://github.com/acmerobotics/ftc-dashboard/blob/8743b686840423e2e5d48e4d87250d3f14feae4e/DashboardCore/src/main/java/com/acmerobotics/dashboard/config/variable/VariableType.java#L8-L25

Here's a list of primitives that could benefit from being added to the list: