Skip to content

Commit

Permalink
AuxFunctions: use _ to marke disabled, preserve order
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Mar 9, 2022
1 parent 704daec commit e35d920
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 16 additions & 7 deletions src/components/Channels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<h5 slot="header" class="mb-0">Channels</h5>
<b-row>
<b-col sm="8">
<b-row v-for="(func, index) in auxFunctions" :key="func">
<b-row v-for="f in auxFunctions" :key="f.key">
<b-col sm="6" class="my-1">
<label :for="func" :class="classForIndex(index)">
{{ func }}
<tooltip :entry="'channel.' + func.toLowerCase()" />
<label :for="func" :class="classForIndex(f.index)">
{{ f.key }}
<tooltip :entry="'channel.' + f.key.toLowerCase()" />
</label>
</b-col>
<b-col sm="3" class="my-1">
<b-form-select
:id="func"
v-model.number="receiver_aux[index]"
:id="f.key"
v-model.number="receiver_aux[f.index]"
:options="auxChannels"
></b-form-select>
</b-col>
Expand Down Expand Up @@ -58,7 +58,16 @@ export default {
value,
};
}),
auxFunctions: (state) => $enum(state.AuxFunctions).getKeys(),
auxFunctions: (state) =>
$enum(state.AuxFunctions)
.getKeys()
.map((f, index) => {
return {
index,
key: f,
};
})
.filter((f) => !f.key.startsWith("_")),
}),
},
data() {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum AuxFunctions {
AUX_RACEMODE,
AUX_HORIZON,
AUX_STICK_BOOST_PROFILE,
// AUX_RATE_PROFILE,
_AUX_RATE_PROFILE,
AUX_BUZZER_ENABLE,
AUX_TURTLE,
AUX_MOTOR_TEST,
Expand Down

0 comments on commit e35d920

Please sign in to comment.