Skip to content

Commit 31c4906

Browse files
committed
Settings also working
1 parent 0f8d424 commit 31c4906

File tree

3 files changed

+128
-179
lines changed

3 files changed

+128
-179
lines changed

vue-frontend/src/App.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ export default {
137137
});
138138
139139
let _this = this;
140-
let hardware_list = ['intensity', 'distance', 'oled', 'motor']; // TODO: can I get this from this.peripherals?
141-
let peripherals = {'sensors': {}, 'actuators': {} };
140+
let peripheral_list = Object.keys(this.peripherals);
141+
let hardware_list = peripheral_list.filter(item => !item.includes("motor"));
142+
hardware_list.push("motor");
143+
hardware_list.push("device");
144+
let peripherals = {'sensors': {}, 'actuators': {}, 'devices': {} };
142145
let params = {};
143146
144147
var request = {
@@ -190,7 +193,9 @@ export default {
190193
// Save everything in sensors/actuators
191194
for (let type in params){
192195
console.log(type);
193-
if (_this.peripherals[type].rel_path.split("\\")[0] == "Sensors"){
196+
if (type == "device"){
197+
peripherals['devices'] = params[type];
198+
} else if (_this.peripherals[type].rel_path.split("\\")[0] == "Sensors"){
194199
peripherals['sensors'][type] = params[type];
195200
} else {
196201
peripherals['actuators'][type] = params[type];

vue-frontend/src/assets/json/properties_mc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"nano": {
3+
"text": "Arduino Nano",
34
"pin_map": {
45
"RX0": 0,
56
"TX1": 1,
@@ -28,6 +29,7 @@
2829
"analog_offset": 14
2930
},
3031
"nano_old": {
32+
"text": "Arduino Nano (old)",
3133
"pin_map": {
3234
"RX0": 0,
3335
"TX1": 1,
@@ -56,6 +58,7 @@
5658
"analog_offset": 14
5759
},
5860
"pico": {
61+
"text": "Raspberry Pi Pico",
5962
"pin_map": {
6063
"GP0" : 0,
6164
"GP1" : 1,
@@ -91,6 +94,7 @@
9194
"analog_offset": 26
9295
},
9396
"uno": {
97+
"text": "Arduino Uno",
9498
"pin_map": {
9599
"RX0": 0,
96100
"TX1": 1,

0 commit comments

Comments
 (0)