feat: special function to push customisable switches (#5497)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
3djc
2024-09-14 11:56:42 +10:00
committed by GitHub
co-authored by philmoz elecpower
parent 40449bf730
commit d417228677
48 changed files with 287 additions and 27 deletions
+3 -2
View File
@@ -194,9 +194,10 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
case SOURCE_TYPE_SWITCH:
dfltName = Boards::getSwitchInfo(index - 1, board).name.c_str();
if (Boards::isSwitchFunc(index - 1, board)) {
if (model && index <= CPN_MAX_SWITCHES_FUNCTION) {
if (model) {
int fsindex = Boards::getSwitchTagNum(index - 1, board) - 1;
custName = QString(model->functionSwitchNames[fsindex]).trimmed();
if (fsindex >= 0 && fsindex < CPN_MAX_SWITCHES_FUNCTION)
custName = QString(model->functionSwitchNames[fsindex]).trimmed();
}
}
else {