* chores(flysky): separate AFHDS2A and AFHDS3 into 2 different module type This should allow to remove some of the hacks added earlier. * chore: Add some EL18 CI bits * fix(afhds): cmake defs * fix(ci): add el18 to commit-tests.sh * chore(cpn): separate AFHDS2A and AFHDS3 * chore(cpn): remove binary import of afhds and legacy fxFreq field for afhds3 * fix(cpn): limit available internal afhds protocols to those supported by hardware * chore(cpn): update Flysky int module test * fix(cpn): compile error * fix(cpn): afhds2a max channels * fix: TR_MODULE_PROTOCOLS * enh(cpn): more support for afhds2a and 3 * fix(cpn): rebase compile error * fix(cpn): bit indexes * fix(cpn): emi toString * fix(cpn): limit available internal afhds protocols to those supported by hardware * enh(cpn): add support for Flysky EL18 * fix(cpn): available protocols * fix(cpn): rebase moduledata * chore(cpn): add module fields to model print * Separate AFHDS2A and AFHDS3 UI settings. * Fix AFHDS3 conversion from old subtype value. Fix 'Channel Range' layout on portrait LCD. * Fix name. --------- Co-authored-by: Peter Feerick <peter.feerick@gmail.com> Co-authored-by: elecpower <neilh713@tpg.com.au> Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
479 lines
12 KiB
Python
479 lines
12 KiB
Python
"""Legacy names used for each analog input in previous EdgeTx versions."""
|
|
|
|
LEGACY_NAMES = [
|
|
{
|
|
"targets": {"x10", "x10express", "t16", "tx16s", "t18"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "S1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer S1"
|
|
},
|
|
"P2": {
|
|
"yaml": "6POS",
|
|
"lua": "6pos",
|
|
"label": "6POS",
|
|
"short_label": "3",
|
|
"description": "Multipos Switch"
|
|
},
|
|
"P3": {
|
|
"yaml": "S2",
|
|
"lua": "s2",
|
|
"label": "S2",
|
|
"short_label": "2",
|
|
"description": "Potentiometer S2"
|
|
},
|
|
"SL1": {
|
|
"yaml": "LS",
|
|
"lua": "ls",
|
|
"label": "LS",
|
|
"short_label": "L",
|
|
"description": "Left slider"
|
|
},
|
|
"SL2": {
|
|
"yaml": "RS",
|
|
"lua": "rs",
|
|
"label": "RS",
|
|
"short_label": "R",
|
|
"description": "Right slider"
|
|
},
|
|
"EXT1": {
|
|
"yaml": "EXT1",
|
|
"lua": "ext1",
|
|
"label": "EXT1",
|
|
"short_label": "E1",
|
|
"description": "Ext 1"
|
|
},
|
|
"EXT2": {
|
|
"yaml": "EXT2",
|
|
"lua": "ext2",
|
|
"label": "EXT2",
|
|
"short_label": "E2",
|
|
"description": "Ext 2"
|
|
},
|
|
"EXT3": {
|
|
"yaml": "EXT3",
|
|
"lua": "ext3",
|
|
"label": "EXT3",
|
|
"short_label": "E3",
|
|
"description": "Ext 3"
|
|
},
|
|
"EXT4": {
|
|
"yaml": "EXT4",
|
|
"lua": "ext4",
|
|
"label": "EXT4",
|
|
"short_label": "E4",
|
|
"description": "Ext 4"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"x12s"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "S1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer S1"
|
|
},
|
|
"P2": {
|
|
"yaml": "6POS",
|
|
"lua": "6pos",
|
|
"label": "6POS",
|
|
"short_label": "3",
|
|
"description": "Multipos Switch"
|
|
},
|
|
"P3": {
|
|
"yaml": "S2",
|
|
"lua": "s2",
|
|
"label": "S2",
|
|
"short_label": "2",
|
|
"description": "Potentiometer S2"
|
|
},
|
|
"SL1": {
|
|
"yaml": "LS",
|
|
"lua": "ls",
|
|
"label": "LS",
|
|
"short_label": "L",
|
|
"description": "Left slider"
|
|
},
|
|
"SL2": {
|
|
"yaml": "RS",
|
|
"lua": "rs",
|
|
"label": "RS",
|
|
"short_label": "R",
|
|
"description": "Right slider"
|
|
},
|
|
"SL3": {
|
|
"yaml": "S3",
|
|
"lua": "s3",
|
|
"label": "L1",
|
|
"short_label": "1",
|
|
"description": "Slider S3"
|
|
},
|
|
"SL4": {
|
|
"yaml": "S4",
|
|
"lua": "s4",
|
|
"label": "L2",
|
|
"short_label": "2",
|
|
"description": "Slider S4"
|
|
},
|
|
"JSx": {
|
|
"yaml": "MOUSE1",
|
|
"lua": "jsx",
|
|
"description": "Joystick X"
|
|
},
|
|
"JSy": {
|
|
"yaml": "MOUSE2",
|
|
"lua": "jsy",
|
|
"description": "Joystick Y"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"x9e"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "F1",
|
|
"short_label": "F1",
|
|
"description": "Potentiometer 1"
|
|
},
|
|
"P2": {
|
|
"yaml": "POT2",
|
|
"lua": "s2",
|
|
"label": "F2",
|
|
"short_label": "F2",
|
|
"description": "Potentiometer 2"
|
|
},
|
|
"SL1": {
|
|
"yaml": "SLIDER1",
|
|
"lua": "ls",
|
|
"label": "LS",
|
|
"short_label": "L",
|
|
"description": "Left slider"
|
|
},
|
|
"SL2": {
|
|
"yaml": "SLIDER2",
|
|
"lua": "rs",
|
|
"label": "RS",
|
|
"short_label": "R",
|
|
"description": "Right slider"
|
|
},
|
|
"SL3": {
|
|
"yaml": "SLIDER3",
|
|
"lua": "lcs",
|
|
"label": "S1",
|
|
"short_label": "S1",
|
|
"description": "Left center slider"
|
|
},
|
|
"SL4": {
|
|
"yaml": "SLIDER4",
|
|
"lua": "rcs",
|
|
"label": "S2",
|
|
"short_label": "S2",
|
|
"description": "Right center slider"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"boxer"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer 1"
|
|
},
|
|
"P2": {
|
|
"yaml": "POT2",
|
|
"lua": "s2",
|
|
"label": "S2",
|
|
"short_label": "2",
|
|
"description": "Potentiometer 2"
|
|
},
|
|
"P3": {
|
|
"yaml": "POT3",
|
|
"lua": "s3",
|
|
"label": "S3",
|
|
"short_label": "3",
|
|
"description": "6 pos"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {
|
|
"commando8",
|
|
"lr3pro",
|
|
"nv14", "el18",
|
|
"t8", "t12",
|
|
"tlite", "tlitef4", "tpro", "tprov2",
|
|
"tx12", "tx12mk2",
|
|
"x7", "x7access",
|
|
"xlite", "xlites",
|
|
"zorro"
|
|
},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer 1"
|
|
},
|
|
"P2": {
|
|
"yaml": "POT2",
|
|
"lua": "s2",
|
|
"label": "S2",
|
|
"short_label": "2",
|
|
"description": "Potentiometer 2"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"t20"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer 1"
|
|
},
|
|
"P2": {
|
|
"yaml": "POT2",
|
|
"lua": "s2",
|
|
"label": "S2",
|
|
"short_label": "2",
|
|
"description": "Potentiometer 2"
|
|
},
|
|
"SL1": {
|
|
"yaml": "SLIDER1",
|
|
"lua": "s3",
|
|
"label": "S3",
|
|
"short_label": "3",
|
|
"description": "Potentiometer 3"
|
|
},
|
|
"SL2": {
|
|
"yaml": "SLIDER2",
|
|
"lua": "s4",
|
|
"label": "S4",
|
|
"short_label": "4",
|
|
"description": "Potentiometer 4"
|
|
},
|
|
"SL3": {
|
|
"yaml": "SLIDER3",
|
|
"lua": "sl",
|
|
"label": "SL",
|
|
"short_label": "L",
|
|
"description": "Right finger slider"
|
|
},
|
|
"SL4": {
|
|
"yaml": "SLIDER4",
|
|
"lua": "sr",
|
|
"label": "SR",
|
|
"short_label": "R",
|
|
"description": "Right finger slider"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"pocket"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer 1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"x9lite", "x9lites"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer 1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"targets": {"x9d", "x9d+", "x9d+2019"},
|
|
"inputs": {
|
|
"LH": {
|
|
"yaml": "Rud"
|
|
},
|
|
"LV": {
|
|
"yaml": "Ele"
|
|
},
|
|
"RV": {
|
|
"yaml": "Thr"
|
|
},
|
|
"RH": {
|
|
"yaml": "Ail"
|
|
},
|
|
"P1": {
|
|
"yaml": "POT1",
|
|
"lua": "s1",
|
|
"label": "S1",
|
|
"short_label": "1",
|
|
"description": "Potentiometer 1"
|
|
},
|
|
"P2": {
|
|
"yaml": "POT2",
|
|
"lua": "s2",
|
|
"label": "S2",
|
|
"short_label": "2",
|
|
"description": "Potentiometer 2"
|
|
},
|
|
"P3": {
|
|
"yaml": "POT3",
|
|
"lua": "s3",
|
|
"label": "S3",
|
|
"short_label": "3",
|
|
"description": "Potentiometer 3"
|
|
},
|
|
"SL1": {
|
|
"yaml": "SLIDER1",
|
|
"lua": "ls",
|
|
"label": "LS",
|
|
"short_label": "L",
|
|
"description": "Left slider"
|
|
},
|
|
"SL2": {
|
|
"yaml": "SLIDER2",
|
|
"lua": "rs",
|
|
"label": "RS",
|
|
"short_label": "R",
|
|
"description": "Right slider"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
|
|
|
|
def inputs_by_target(target):
|
|
"""Retrieve legacy definitions by target.
|
|
|
|
Parameters
|
|
----------
|
|
target: str
|
|
Name of the target
|
|
|
|
Returns
|
|
-------
|
|
dict
|
|
a dictionary with the basic attributes needed to generate
|
|
compatibility mappings
|
|
"""
|
|
for d in LEGACY_NAMES:
|
|
if target in d['targets']:
|
|
return d['inputs']
|
|
|
|
return None
|