Skip to content

Commit 796ac22

Browse files
committed
commit
1 parent 4d63c86 commit 796ac22

File tree

5 files changed

+145
-1
lines changed

5 files changed

+145
-1
lines changed

locales/en/messages.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"nornController": {
393393
"message": "Controller"
394394
},
395+
"nornRadioController": {
396+
"message": "Radio Controller"
397+
},
395398
"nornSize": {
396399
"message": "Size"
397400
},
@@ -401,6 +404,9 @@
401404
"nornMBId": {
402405
"message": "MB ID"
403406
},
407+
"nornFailSafe": {
408+
"message": "FailSafe"
409+
},
404410
"nornGPS": {
405411
"message": "GPS"
406412
},

src/js/tabs/norn_config.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,29 @@ norn_config.initialize = function (callback) {
136136
mbIdInput.on("input", function () {
137137
self.analyticsChanges["NornMBId"] = $(this).val() || null;
138138
});
139+
140+
// Populate Controller list (explicit options)
141+
const controllerSelect = $("select[name='norn_controller']");
142+
if (controllerSelect.length) {
143+
controllerSelect.empty();
144+
controllerSelect.append(`<option value="">${i18n.getMessage("nornNone")}</option>`);
145+
controllerSelect.append(`<option value="BOXER">BOXER</option>`);
146+
controllerSelect.append(`<option value="TX12">TX12</option>`);
147+
controllerSelect.on("change", function () {
148+
self.analyticsChanges["NornController"] = $(this).val() || null;
149+
});
150+
}
151+
152+
// Populate FailSafe list (explicit options)
153+
const failSafeSelect = $("select[name='norn_failsafe']");
154+
if (failSafeSelect.length) {
155+
failSafeSelect.empty();
156+
failSafeSelect.append(`<option value="">${i18n.getMessage("nornNone")}</option>`);
157+
failSafeSelect.append(`<option value="Default">Default</option>`);
158+
failSafeSelect.on("change", function () {
159+
self.analyticsChanges["NornFailSafe"] = $(this).val() || null;
160+
});
161+
}
139162
}
140163

141164
function on_tab_loaded_handler() {
@@ -173,7 +196,9 @@ norn_config.initialize = function (callback) {
173196
const gpsEnabled = $("#norn_gps").is(":checked");
174197
const craftName = $("#norn_craft_name").val() || "";
175198
const mbId = $("#norn_mb_id").val() || "";
176-
return { fcKey, droneSize, manticoreKey, vtxKey, gpsEnabled, craftName, mbId };
199+
const controller = $("select[name='norn_controller']").val() || "";
200+
const failSafe = $("select[name='norn_failsafe']").val() || "";
201+
return { fcKey, droneSize, manticoreKey, vtxKey, gpsEnabled, craftName, mbId, controller, failSafe };
177202
}
178203

179204
function on_generate_handler(e) {
@@ -229,6 +254,8 @@ norn_config.initialize = function (callback) {
229254
const gpsEnabled = $("#norn_gps").is(":checked");
230255
const craftName = $("#norn_craft_name").val();
231256
const mbId = $("#norn_mb_id").val();
257+
const controller = $("select[name='norn_controller']").val();
258+
const failSafe = $("select[name='norn_failsafe']").val();
232259

233260
if (fcKey) parts.push(fcKey);
234261
if (droneSize) parts.push(`${droneSize}inch`);
@@ -237,6 +264,8 @@ norn_config.initialize = function (callback) {
237264
if (gpsEnabled) parts.push("GPS");
238265
if (craftName) parts.push(craftName);
239266
if (mbId) parts.push(`MB${mbId}`);
267+
if (controller) parts.push(controller);
268+
if (failSafe) parts.push(failSafe);
240269

241270
const filename = parts.length > 0 ? `norn_config_${parts.join("_")}.txt` : "norn_config.txt";
242271

src/norn-configs/README.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
# - '': Empty string if no MB ID entered
4444
# - Any string value for MB identification
4545
#
46+
# controller: Controller type (from select[name='norn_controller'])
47+
# - '': Empty/None selected
48+
# - 'BOXER': BOXER controller
49+
# - 'TX12': TX12 controller
50+
#
51+
# failSafe: FailSafe configuration (from select[name='norn_failsafe'])
52+
# - '': Empty/None selected
53+
# - 'Default': Default failSafe configuration
54+
#
4655
# Template Syntax (Handlebars):
4756
# - {{#if condition}} ... {{/if}} : Conditional blocks
4857
# - {{variable}} : Output variable value

src/norn-configs/template.hbs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# GPS: {{gpsEnabled}}
66
# Craft Name: {{craftName}}
77
# MB ID: {{mbId}}
8+
# Controller: {{controller}}
9+
# FailSafe: {{failSafe}}
810

911
defaults nosave
1012
batch start
@@ -62,3 +64,70 @@ serial UART5 64 115200 57600 0 115200
6264
{{#if gpsEnabled}}
6365
serial UART6 2 115200 57600 0 115200
6466
{{/if}}
67+
68+
# AUX CONFIGURATION
69+
{{!-- TX12 Controller AUX Configuration --}}
70+
{{#if (eq controller 'TX12')}}
71+
aux 0 0 0 1800 2100 0 0
72+
aux 1 1 1 1400 2100 0 0
73+
aux 2 40 2 1400 2100 0 0
74+
aux 3 41 2 1800 2100 0 0
75+
{{/if}}
76+
{{!-- Default AUX Configuration (for BOXER or no controller selected) --}}
77+
{{#if (ne controller 'TX12')}}
78+
aux 0 0 0 1800 2100 0 0
79+
aux 1 1 1 1700 2100 0 0
80+
aux 2 2 1 1300 1700 0 0
81+
aux 3 26 3 1675 2100 0 0
82+
aux 4 58 4 1800 2100 0 0
83+
aux 5 59 5 1800 2100 0 0
84+
{{/if}}
85+
86+
# VTX CONFIGURATION
87+
{{!-- 5.8GHz VTX Configuration --}}
88+
{{#if (eq vtxKey '5.8VTX')}}
89+
vtxtable bands 8
90+
vtxtable channels 8
91+
vtxtable band 1 BAND_A A CUSTOM 5865 5845 5825 5805 5785 5765 5745 5725
92+
vtxtable band 2 BAND_B B CUSTOM 5733 5752 5771 5790 5809 5828 5847 5866
93+
vtxtable band 3 BAND_E E CUSTOM 5705 5685 5665 5645 5885 5905 5925 5945
94+
vtxtable band 4 BAND_F F CUSTOM 5740 5760 5780 5800 5820 5840 5860 5880
95+
vtxtable band 5 BAND_R R CUSTOM 5658 5695 5732 5769 5806 5843 5880 5917
96+
vtxtable band 6 BAND_L L CUSTOM 5917 5800 5645 5493 5333 5200 5050 4990
97+
vtxtable band 7 BAND_X X CUSTOM 4990 5020 5050 5080 5110 5140 5170 5200
98+
vtxtable band 8 BAND_C C CUSTOM 4990 5020 5050 5080 5110 5140 5170 5200
99+
vtxtable powerlevels 5
100+
vtxtable powervalues 25 100 200 400 600
101+
vtxtable powerlabels 25 200 500 1.5 2.5
102+
{{/if}}
103+
{{!-- 3.3GHz VTX Configuration --}}
104+
{{#if (eq vtxKey '3.3VTX')}}
105+
vtxtable bands 5
106+
vtxtable channels 8
107+
vtxtable band 1 BAND_A A CUSTOM 3320 3345 3370 3395 3420 3445 3470 3495
108+
vtxtable band 2 BAND_B B CUSTOM 3310 3330 3355 3380 3405 3430 3455 3480
109+
vtxtable band 3 BAND_C C CUSTOM 3490 3510 3530 3550 3570 3590 3610 3630
110+
vtxtable band 4 BAND_D D CUSTOM 3330 3350 3370 3390 3410 3430 3450 3470
111+
vtxtable band 5 BAND_E E CUSTOM 3170 3190 3210 3230 3250 3270 3290 3310
112+
vtxtable powerlevels 5
113+
vtxtable powervalues 25 100 200 400 600
114+
vtxtable powerlabels 250 500 1W 2W 4W
115+
{{/if}}
116+
117+
{{#if (eq failSafe 'Default')}}
118+
# FAILSAFE CONFIGURATION
119+
rxfail 0 s 1500
120+
rxfail 1 s 1500
121+
rxfail 2 s 1500
122+
rxfail 3 h
123+
{{/if}}
124+
125+
{{#if craftName}}
126+
# CRAFT NAME CONFIGURATION
127+
set craft_name = {{craftName}}
128+
{{/if}}
129+
130+
{{#if mbId}}
131+
# MB CONFIGURATION
132+
set mb_id = {{mbId}}
133+
{{/if}}

src/tabs/norn_config.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,37 @@
112112
</div>
113113
</div>
114114
</div>
115+
<div class="col-span-1">
116+
<div class="gui_box grey">
117+
<div class="gui_box_titlebar">
118+
<div class="spacer_box_title" i18n="nornRadioController"></div>
119+
</div>
120+
<div class="spacer_box">
121+
<div class="select">
122+
<select name="norn_controller" id="norn_controller">
123+
<option value="" i18n="nornNone"></option>
124+
</select>
125+
</div>
126+
</div>
127+
</div>
128+
</div>
129+
</div>
130+
131+
<div class="grid-row grid-box col2">
132+
<div class="col-span-1">
133+
<div class="gui_box grey">
134+
<div class="gui_box_titlebar">
135+
<div class="spacer_box_title" i18n="nornFailSafe"></div>
136+
</div>
137+
<div class="spacer_box">
138+
<div class="select">
139+
<select name="norn_failsafe" id="norn_failsafe">
140+
<option value="" i18n="nornNone"></option>
141+
</select>
142+
</div>
143+
</div>
144+
</div>
145+
</div>
115146
<div class="col-span-1">
116147
<!-- Empty space for future use -->
117148
</div>

0 commit comments

Comments
 (0)