mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-27 13:23:52 +08:00
[GUI] Added more types to store.js, fixed odrive config import/export
This commit is contained in:
+5
-4
@@ -222,8 +222,8 @@ export default {
|
|||||||
};
|
};
|
||||||
reader.addEventListener("load", function (e) {
|
reader.addEventListener("load", function (e) {
|
||||||
let importString = e.target.result;
|
let importString = e.target.result;
|
||||||
importString = importString.replaceAll(" Infinity", '" Infinity"');
|
importString = importString.replace(/ Infinity/g, '" Infinity"');
|
||||||
importString = importString.replaceAll(" -Infinity", '" -Infinity"');
|
importString = importString.replace(/ -Infinity/g, '" -Infinity"');
|
||||||
importConfig(JSON.parse(importString));
|
importConfig(JSON.parse(importString));
|
||||||
});
|
});
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
@@ -268,8 +268,9 @@ export default {
|
|||||||
if (exportString.includes('"Infinity"')) {
|
if (exportString.includes('"Infinity"')) {
|
||||||
console.log("found infinity!");
|
console.log("found infinity!");
|
||||||
}
|
}
|
||||||
exportString = exportString.replaceAll('"Infinity"', 'Infinity');
|
console.log(typeof exportString);
|
||||||
exportString = exportString.replaceAll('"-Infinity"', '-Infinity');
|
exportString = exportString.replace(/"Infinity"/g, 'Infinity');
|
||||||
|
exportString = exportString.replace(/"-Infinity"/g, '-Infinity');
|
||||||
const blob = new Blob([exportString], {
|
const blob = new Blob([exportString], {
|
||||||
type: "application/json",
|
type: "application/json",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
"value": 1
|
"value": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Starup Sequence",
|
"text": "Startup Sequence",
|
||||||
"value": 2
|
"value": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
"value": 1
|
"value": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Starup Sequence",
|
"text": "Startup Sequence",
|
||||||
"value": 2
|
"value": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+8
-1
@@ -267,7 +267,14 @@ export default new Vuex.Store({
|
|||||||
case "float":
|
case "float":
|
||||||
retObj[key] = parseFloat(parseFloat(odriveObj[key]["val"]).toFixed(3));
|
retObj[key] = parseFloat(parseFloat(odriveObj[key]["val"]).toFixed(3));
|
||||||
break;
|
break;
|
||||||
case "int":
|
case "int8":
|
||||||
|
case "int16":
|
||||||
|
case "int32":
|
||||||
|
case "int64":
|
||||||
|
case "uint8":
|
||||||
|
case "uint16":
|
||||||
|
case "uint32":
|
||||||
|
case "uint64":
|
||||||
retObj[key] = parseInt(odriveObj[key]["val"]);
|
retObj[key] = parseInt(odriveObj[key]["val"]);
|
||||||
break;
|
break;
|
||||||
case "bool":
|
case "bool":
|
||||||
|
|||||||
@@ -143,6 +143,14 @@ let odriveEnums = {
|
|||||||
{
|
{
|
||||||
text: "Homing",
|
text: "Homing",
|
||||||
value: 11,
|
value: 11,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Encoder Hall Polarity Calibration",
|
||||||
|
value: 12,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Encoder Hall Phase Calibration",
|
||||||
|
value: 13,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
current_state: [
|
current_state: [
|
||||||
@@ -193,6 +201,14 @@ let odriveEnums = {
|
|||||||
{
|
{
|
||||||
text: "Homing",
|
text: "Homing",
|
||||||
value: 11,
|
value: 11,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Encoder Hall Polarity Calibration",
|
||||||
|
value: 12,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Encoder Hall Phase Calibration",
|
||||||
|
value: 13,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// encoder mode
|
// encoder mode
|
||||||
|
|||||||
Reference in New Issue
Block a user