missionpinball / mpf

Mission Pinball Framework: Open source software to run a real pinball machine.
http://missionpinball.org
MIT License
217 stars 143 forks source link

BCP command 'settings' is undocumented #1850

Open arthurkehrwald opened 4 weeks ago

arthurkehrwald commented 4 weeks ago

I would like to be able to parse and write documentation for the settings BCP command., but I don't fully understand the structure of the settings parameter. Here is an example:

{
    "settings": [
        [
            "brightness",
            "Brightness",
            100,
            "brightness",
            1.0,
            {
                "0.25": "25%",
                "0.5": "50%",
                "0.75": "75%",
                "1.0": "100% (default)"
            },
            "standard"
        ],
        [
            "flipper_power",
            "Flipper power",
            1000,
            "flipper_power",
            1.0,
            {
                "0.8": "Weak",
                "1.0": "Normal (default)",
                "1.2": "Strong"
            },
            "standard"
        ]
    ]
}

It's an array of arrays, with each sub-array representing an option in the settings. In the example above, there are two options: "brightness" and "flipper_power". Each of these options has seven elements, but I don't know their purpose. Here are my guesses, based on the documentation for the setttings config key.

Index Purpose Type
1 Internal name string
2 Display name string
3 Sorting priority int
4 Name of associated machine variable string
5 Value Varies
6 Associate individual values with descriptive texts to enable the MC to provide sensible values to choose from in the service menu string to string dictionary
7 Category string

Is this correct?

avanwinkle commented 4 weeks ago

I've just merged some fixes into the dev branch (and release 0.57.4.dev1) that improve the BCP communications, back ported from the work on the Godot BCP client in MPF 0.80.

Settings are now sent in batches based on setting type, and yes your documentation outline above looks correct.