3
3
class =" v-card v-sheet theme--light mt-5"
4
4
>
5
5
<v-combobox
6
- v-for =" port in Object.keys(port_map )"
6
+ v-for =" port in range(1,9 )"
7
7
:key =" port"
8
8
v-model =" ports[port]"
9
9
:items =" available_ports"
10
- :label =" `${port_map[ port] }`"
10
+ :label =" `Serial ${ port}`"
11
11
:rules =" [isValidEndpoint]"
12
12
:loading =" current_serial_ports.isEmpty()"
13
13
outlined
@@ -78,6 +78,7 @@ import back_axios from '@/utils/api'
78
78
import { isIpAddress } from ' @/utils/pattern_validators'
79
79
80
80
import { fetchAutopilotSerialConfiguration } from ' ./AutopilotManagerUpdater'
81
+ import { range } from ' lodash'
81
82
82
83
export default Vue .extend ({
83
84
name: ' AutopilotSerialConfiguration' ,
@@ -86,19 +87,6 @@ export default Vue.extend({
86
87
},
87
88
data() {
88
89
return {
89
- // Portmap is used to deal with ardupilots weird mapping situation
90
- // Note that the mapping is not linear
91
- port_map: {
92
- // A (Serial 0) is reserved
93
- C: ' Serial 1' ,
94
- D: ' Serial 2' ,
95
- B: ' Serial 3' ,
96
- E: ' Serial 4' ,
97
- F: ' Serial 5' ,
98
- G: ' Serial 6' ,
99
- H: ' Serial 7' ,
100
- I: ' Serial 8' ,
101
- },
102
90
ports: {} as Dictionary <string | undefined >,
103
91
fetch_autopilot_serial_config_task: new OneMoreTime ({ delay: 10000 , disposeWith: this }),
104
92
fetch_serial_task: new OneMoreTime ({ delay: 10000 , disposeWith: this }),
@@ -122,7 +110,7 @@ export default Vue.extend({
122
110
}
123
111
}
124
112
return new_list
125
- },
113
+ }
126
114
},
127
115
watch: {
128
116
current_serial_ports: {
@@ -144,6 +132,7 @@ export default Vue.extend({
144
132
}
145
133
}
146
134
},
135
+ range ,
147
136
async saveAndRestart(): Promise <void > {
148
137
await back_axios ({
149
138
method: ' put' ,
0 commit comments