diff --git a/GUI/src/assets/wizard/wizard.js b/GUI/src/assets/wizard/wizard.js index 1051106f..3de17e4c 100644 --- a/GUI/src/assets/wizard/wizard.js +++ b/GUI/src/assets/wizard/wizard.js @@ -6,6 +6,7 @@ export let pages = { ODrive: { number: 0, title: "Which ODrive do you have?", + link: "ODrive Version", component: "wizardPage", next: "Motor_0", back: "ODrive", @@ -25,6 +26,7 @@ export let pages = { Motor_0: { number: 1, title: "Which motor are you using on Axis 0?", + link: "Motor 0", component: "wizardPage", next: "Encoder_0", back: "ODrive", @@ -78,6 +80,7 @@ export let pages = { Encoder_0: { number: 2, title: "Which encoder are you using for Axis 0?", + link: "Encoder 0", component: "wizardPage", next: "Misc_0", back: "Motor_0", @@ -134,6 +137,7 @@ export let pages = { Misc_0: { number: 3, title: "Finishing touches for Axis 0", + link: "Misc 0", component: "wizardPage", next: "Motor_1", back: "Encoder_0", @@ -152,6 +156,7 @@ export let pages = { Motor_1: { number: 4, title: "Which motor are you using for Axis 1?", + link: "Motor 1", component: "wizardPage", next: "Encoder_1", back: "Misc_0", @@ -205,6 +210,7 @@ export let pages = { Encoder_1: { number: 5, title: "Which encoder are you using for Axis 1?", + link: "Encoder 1", component: "wizardPage", next: "Misc_1", back: "Motor_1", @@ -261,6 +267,7 @@ export let pages = { Misc_1: { number: 6, title: "Finishing touches for Axis 1", + link: "Misc 1", component: "wizardPage", next: "End", back: "Encoder_1", @@ -279,6 +286,7 @@ export let pages = { End: { number: 7, title: "Review choices", + link: "Review and Apply", component: "wizardPage", next: "End", back: "Misc_1", diff --git a/GUI/src/components/actions/Action.vue b/GUI/src/components/actions/Action.vue index 6034022e..d8595c12 100644 --- a/GUI/src/components/actions/Action.vue +++ b/GUI/src/components/actions/Action.vue @@ -47,7 +47,7 @@ export default { params.append("key", key); } params.append("val", this.value); - params.append("type", "numeric"); + params.append("type", "number"); console.log(params.toString()); let request = { params: params, diff --git a/GUI/src/components/wizard/wizardEncoderIncremental.vue b/GUI/src/components/wizard/wizardEncoderIncremental.vue index 4b67d216..9aff7be0 100644 --- a/GUI/src/components/wizard/wizardEncoderIncremental.vue +++ b/GUI/src/components/wizard/wizardEncoderIncremental.vue @@ -12,6 +12,9 @@ import odriveEnums from "../../assets/odriveEnums.json"; export default { name: "wizardEncoderIncremental", + props: { + data: Object, + }, data: function () { return { cpr_set: false, @@ -21,13 +24,36 @@ export default { methods: { setCPR(e) { this.cpr = parseInt(e.target.value); + let configStub = undefined; + if (this.data.axis == "axis0") { + configStub = { + axis0: { + encoder: { + config: { + cpr: this.cpr, + use_index: false, + type: odriveEnums.ENCODER_MODE_INCREMENTAL, + } + } + } + } + } + else if (this.data.axis == "axis1") { + configStub = { + axis: { + encoder: { + config: { + cpr: this.cpr, + use_index: false, + type: odriveEnums.ENCODER_MODE_INCREMENTAL, + } + } + } + } + } this.$emit("choice", { choice: "Incremental", - config: { - cpr: this.cpr, - use_index: false, - type: odriveEnums.ENCODER_MODE_INCREMENTAL, - }, + configStub: configStub, }); }, }, diff --git a/GUI/src/components/wizard/wizardEncoderIncrementalIndex.vue b/GUI/src/components/wizard/wizardEncoderIncrementalIndex.vue index 040971d9..36d2447a 100644 --- a/GUI/src/components/wizard/wizardEncoderIncrementalIndex.vue +++ b/GUI/src/components/wizard/wizardEncoderIncrementalIndex.vue @@ -12,6 +12,9 @@ import odriveEnums from "../../assets/odriveEnums.json"; export default { name: "wizardEncoderIncremental", + props: { + data: Object, + }, data: function () { return { cpr_set: false, @@ -21,13 +24,36 @@ export default { methods: { setCPR(e) { this.cpr = parseInt(e.target.value); + let configStub = undefined; + if (this.data.axis == "axis0") { + configStub = { + axis0: { + encoder: { + config: { + cpr: this.cpr, + use_index: true, + type: odriveEnums.ENCODER_MODE_INCREMENTAL, + } + } + } + } + } + else if (this.data.axis == "axis1") { + configStub = { + axis: { + encoder: { + config: { + cpr: this.cpr, + use_index: true, + type: odriveEnums.ENCODER_MODE_INCREMENTAL, + } + } + } + } + } this.$emit("choice", { choice: "IncrementalIndex", - config: { - cpr: this.cpr, - use_index: true, - type: odriveEnums.ENCODER_MODE_INCREMENTAL, - }, + configStub: configStub, }); }, }, diff --git a/GUI/src/components/wizard/wizardMotor.vue b/GUI/src/components/wizard/wizardMotor.vue index 08adc0c1..548b6619 100644 --- a/GUI/src/components/wizard/wizardMotor.vue +++ b/GUI/src/components/wizard/wizardMotor.vue @@ -29,6 +29,7 @@ export default { name: "wizardMotor", props: { data: Object, + axis: String, }, data: function () { return { @@ -44,7 +45,13 @@ export default { }, computed: { resistance: function () { - let keys = ["odrive0", this.data.axis, "motor", "config", "phase_resistance"]; + let keys = [ + "odrive0", + this.data.axis, + "motor", + "config", + "phase_resistance", + ]; let odriveObj = this.$store.state.odrives; for (const key of keys) { odriveObj = odriveObj[key]; @@ -52,7 +59,13 @@ export default { return parseFloat(odriveObj["val"]).toExponential(3); }, inductance: function () { - let keys = ["odrive0", this.data.axis, "motor", "config", "phase_inductance"]; + let keys = [ + "odrive0", + this.data.axis, + "motor", + "config", + "phase_inductance", + ]; let odriveObj = this.$store.state.odrives; for (const key of keys) { odriveObj = odriveObj[key]; @@ -63,7 +76,13 @@ export default { watch: { resistance: function (newVal) { console.log("from resistance watcher: " + newVal); - let keys = ["odrive0", this.data.axis, "motor", "config", "phase_resistance"]; + let keys = [ + "odrive0", + this.data.axis, + "motor", + "config", + "phase_resistance", + ]; let odriveObj = this.$store.state.odrives; for (const key of keys) { odriveObj = odriveObj[key]; @@ -72,7 +91,13 @@ export default { }, inductance: function (newVal) { console.log("from inductance watcher: " + newVal); - let keys = ["odrive0", this.data.axis, "motor", "config", "phase_inductance"]; + let keys = [ + "odrive0", + this.data.axis, + "motor", + "config", + "phase_inductance", + ]; let odriveObj = this.$store.state.odrives; for (const key of keys) { odriveObj = odriveObj[key]; @@ -116,15 +141,39 @@ export default { this.kv_set == true ) { console.log("emitting choice event from other motor"); + let configStub = undefined; + if (this.axis == "axis0") { + configStub = { + axis0: { + motor: { + config: { + pole_pairs: this.pole_pairs, + torque_constant: this.torque_constant, + phase_resistance: this.phase_resistance, + phase_inductance: this.phase_inductance, + type: odriveEnums.MOTOR_TYPE_HIGH_CURRENT, + }, + }, + }, + }; + } else if (this.axis == "axis1") { + configStub = { + axis1: { + motor: { + config: { + pole_pairs: this.pole_pairs, + torque_constant: this.torque_constant, + phase_resistance: this.phase_resistance, + phase_inductance: this.phase_inductance, + type: odriveEnums.MOTOR_TYPE_HIGH_CURRENT, + }, + }, + }, + }; + } this.$emit("choice", { choice: "Other motor", - config: { - pole_pairs: this.pole_pairs, - torque_constant: this.torque_constant, - phase_resistance: this.phase_resistance, - phase_inductance: this.phase_inductance, - type: odriveEnums.MOTOR_TYPE_HIGH_CURRENT, - }, + configStub: configStub, }); } }, @@ -136,7 +185,7 @@ export default { params.append("key", key); } params.append("val", odriveEnums.AXIS_STATE_MOTOR_CALIBRATION); - params.append("type", "numeric"); + params.append("type", "number"); console.log(params.toString()); let request = { params: params, diff --git a/GUI/src/components/wizard/wizardPage.vue b/GUI/src/components/wizard/wizardPage.vue index 64c29b67..daebc47b 100644 --- a/GUI/src/components/wizard/wizardPage.vue +++ b/GUI/src/components/wizard/wizardPage.vue @@ -13,12 +13,13 @@ /> @@ -75,6 +76,7 @@ export default { .wizard-choices { display: flex; flex-direction: row; + flex-wrap: wrap; } .chosen { diff --git a/GUI/src/views/Wizard.vue b/GUI/src/views/Wizard.vue index 359672cd..95a1b024 100644 --- a/GUI/src/views/Wizard.vue +++ b/GUI/src/views/Wizard.vue @@ -1,6 +1,16 @@ + + Wizard Pages + {{page.link}} +