Skip to content

Reword Lua script UI - #1

Closed
gonzalo-bulnes wants to merge 14 commits into
pkendall64:wifi-config-modefrom
gonzalo-bulnes:refine-lua-script-gyro-ui
Closed

Reword Lua script UI#1
gonzalo-bulnes wants to merge 14 commits into
pkendall64:wifi-config-modefrom
gonzalo-bulnes:refine-lua-script-gyro-ui

Conversation

@gonzalo-bulnes

@gonzalo-bulnes gonzalo-bulnes commented Aug 22, 2026

Copy link
Copy Markdown

A few goals here:

  • make the UI fit the B&W displays
  • keep it clear on color displays
  • match the WebUI hierarchy as much as possible, so that:

To do:

  • Move Calibration folder to top level
  • Move [Stick Calibration] command to Main setup folder, like in the WebUI
  • Use invert instead of reverse for consistency with non-gyro output mapping
  • Use primary instead of master for input channels
  • Review the orientation options for length
  • Review the gyro mode switch type for length
  • Follow the moves of the gyro mode switch type and rate gain multiplier fields

@gonzalo-bulnes
gonzalo-bulnes force-pushed the refine-lua-script-gyro-ui branch from 4adb02b to 609e524 Compare August 23, 2026 02:13
static char gyroOffOn[] = "Off;On"; // Off-ON
// needs to match gyro_status_t
static const char *gyroStatus[] = {"Off","IMU Not Detected","Need RX-Orientation","Need Stick Calibration","Running"};
static const char *gyroStatus[] = {"Off","!Detected","!Orient.","!Stick cal","Running"};

@gonzalo-bulnes gonzalo-bulnes Aug 23, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ones may be a bit controversial. I feel the ! conveys the idea of an error, even if someone doesn't necessarily read it as NOT, and space is really at a premium in these fields on B&W displays.


// Must match gyro_pidgroup_t
static const char gyroPidGroup[] = "Rate (v/100);Level(v/100);AHRS (v/10)";
static const char gyroPidGroup[] = "Rate (%);Level (%);AHRS (x0.1)";

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we can turn them all in % and move the unit next to the values.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necesary percentages.. there are weights for parameters in the algorithms


static folderParameter luaGyroPIDFolder = {
{"PIDs (Advanced)", CRSF_FOLDER},
{"Advanced (PIDs)", CRSF_FOLDER},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guessing what the name of the corresponding panel in the WebUI could be. 💭


static folderParameter luaGyroFModeFolder = {
{"FMode Settings", CRSF_FOLDER},
{"Tuning", CRSF_FOLDER},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure about this vs Settings, but I followed the WebUI (where I think it "Gyro Mode Tuning" reads good. In the Lua script, "Gyro Mode" is the visible title of the menu.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is more a Flight mode tuning... not general tuning

@gonzalo-bulnes gonzalo-bulnes Aug 23, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested to move from "gyro flight mode" to "gyro mode", so that there is less room for confusion between the gyro modes and the typical EdgeTX "flight modes".

I've been highlighting gyro mode as a specific gyro concept across the docs, and I think it works well.

In this specific Lua screen, the title of the menu / page is Gyro Modes and it has two menu entries: Tuning and Advanced (PIDs). This echoes the WebUI Gyro Mode Tuning panel.

The full hierarchy to get there is: RX > Gyro > Gyro Modes > Tuning.

Respectively: RX > Gyro > Gyro Modes > Advanced (PIDs).

// Step 2: Stick Range Cal
newStep = lcsAskConfirm;
msg = "Moved to all Sides/Corners?";
msg = "Move over full range";

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fighting for a few characters. 😬


static selectionParameter luaGyroFMode_StickPri = {
{"Stick Priority", CRSF_TEXT_SELECTION},
{"Stck priority", CRSF_TEXT_SELECTION},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was just one character too many. IMHO this looks better than the ...y touching the value. YMMV.


static int8Parameter luaGyroFMode_AngLimitPitch = {
{"Limit Pitch", CRSF_UINT8},
{"Pitch limit", CRSF_UINT8},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noun vs verb.

}
},
" deg (+Left)"
" deg (+Lft)"

@gonzalo-bulnes gonzalo-bulnes Aug 23, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing parenthesis does get one pixel cut, but I think they still make the text clearer, and removing more letters from Left would pass the threshold of readability IMO.

Comment on lines +1605 to -1611
registerParameter(&luaGyroCalibrationFolder, nullptr, luaGyroMainFolder.common.id);
registerParameter(&luaGyroModelFolder, nullptr, luaGyroMainFolder.common.id);
registerParameter(&luaGyroModesFolder, nullptr, luaGyroModelFolder.common.id);
registerParameter(&luaGyroOutputFolder, nullptr, luaGyroModelFolder.common.id);
registerParameter(&luaGyroQuickSetupFolder, nullptr, luaGyroModelFolder.common.id);
registerParameter(&luaGyroSettingsFolder, nullptr, luaGyroMainFolder.common.id);
registerParameter(&luaGyroFModeFolder, nullptr, luaGyroSettingsFolder.common.id);
registerParameter(&luaGyroCalibrationFolder, nullptr, luaGyroSettingsFolder.common.id);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to match the WebUI.


// ----- Gyro -> Model -> Stick Calibration
registerParameter(&luaGyroStickCal, [this](propertiesCommon *item, uint8_t arg) { luaparamGyroStickCal(item, arg); }, luaGyroCalibrationFolder.common.id);
registerParameter(&luaGyroStickCal, [this](propertiesCommon *item, uint8_t arg) { luaparamGyroStickCal(item, arg); }, luaGyroModelFolder.common.id);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to match the WebUI.

Also WebUI and script do share docs, so aligning the hierarchy does help a lot in keeping the structure of the docs simple / easy to maintain.

@gonzalo-bulnes
gonzalo-bulnes marked this pull request as ready for review August 23, 2026 04:00
We can't use the UART in the ISR in this mode so CRSF is delayed to the timeout call instead
Use a low-poly GLB and OGL for rendering
Compass rose, artificial horizon & Ground plane
Fix build by ignoring libraries before the LDF does its stupidity!
Extract wizard to a common component & reuse for gyro wizards
Export/Import configuration
Validate setting in SetGyroConfig
I've no idea why, but this change did break the 'Gyro enabled' field.
It went from displaying 'Gyro enabled: On' and being editable (On;Off),
to display 'Gyro enabled: n' and not being editable.
The non-gyro Output mapping uses 'invert'.
The other channels with the same function do not follow the values
of the primary as in a master/follower relationship; instead there
is one primary input, which values are taken into account by the gyro,
and secondary inputs which are ignored.
I had missed the fact that 'Level' groups all the level modes,
so 'Mode group' is more accurate than 'Mode'.

And the hint is actually useful, even though '(v/100)' was too long.
@gonzalo-bulnes
gonzalo-bulnes force-pushed the refine-lua-script-gyro-ui branch from 9cf7dc2 to dbdb146 Compare August 23, 2026 11:32
@gonzalo-bulnes

gonzalo-bulnes commented Aug 23, 2026

Copy link
Copy Markdown
Author

(rebased to fix minor conflict)

@gonzalo-bulnes
gonzalo-bulnes force-pushed the refine-lua-script-gyro-ui branch from d666d43 to e47b65c Compare August 23, 2026 12:23
@gonzalo-bulnes

gonzalo-bulnes commented Aug 23, 2026

Copy link
Copy Markdown
Author

@pkendall64 I'm omitting updating the headers (web assets) to avoid generating pointless conflicts. Since you'll have to re-build the headers anyway...

@sonarqubecloud

Copy link
Copy Markdown

@pkendall64

Copy link
Copy Markdown
Owner

@gonzalo-bulnes probably what you should do is rebase this and drop the wifi commits i.e. the first 4 and the 2 simple changes and PR agains Frankies branch.
I can then make the simple changes to the web UI.

Mixing and matching which branch we're doing changes on is going to get very confusing.

@gonzalo-bulnes

Copy link
Copy Markdown
Author

Sounds good @pkendall64 ! Makes sense, I'll do that. 👍 (Cc: @frankiearzu as a heads up 🙂)

@pkendall64
pkendall64 force-pushed the wifi-config-mode branch 2 times, most recently from c425dcf to 069d5a7 Compare August 23, 2026 21:16
@pkendall64
pkendall64 force-pushed the wifi-config-mode branch 3 times, most recently from a3fd7de to ecacde0 Compare August 23, 2026 23:11
@gonzalo-bulnes

Copy link
Copy Markdown
Author

Closed in favor of frankiearzu#15

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

Successfully merging this pull request may close these issues.

3 participants