mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 18:20:15 +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) {
|
||||
let importString = e.target.result;
|
||||
importString = importString.replaceAll(" Infinity", '" Infinity"');
|
||||
importString = importString.replaceAll(" -Infinity", '" -Infinity"');
|
||||
importString = importString.replace(/ Infinity/g, '" Infinity"');
|
||||
importString = importString.replace(/ -Infinity/g, '" -Infinity"');
|
||||
importConfig(JSON.parse(importString));
|
||||
});
|
||||
reader.readAsText(file);
|
||||
@@ -268,8 +268,9 @@ export default {
|
||||
if (exportString.includes('"Infinity"')) {
|
||||
console.log("found infinity!");
|
||||
}
|
||||
exportString = exportString.replaceAll('"Infinity"', 'Infinity');
|
||||
exportString = exportString.replaceAll('"-Infinity"', '-Infinity');
|
||||
console.log(typeof exportString);
|
||||
exportString = exportString.replace(/"Infinity"/g, 'Infinity');
|
||||
exportString = exportString.replace(/"-Infinity"/g, '-Infinity');
|
||||
const blob = new Blob([exportString], {
|
||||
type: "application/json",
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"text": "Starup Sequence",
|
||||
"text": "Startup Sequence",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"text": "Starup Sequence",
|
||||
"text": "Startup Sequence",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
|
||||
+8
-1
@@ -267,7 +267,14 @@ export default new Vuex.Store({
|
||||
case "float":
|
||||
retObj[key] = parseFloat(parseFloat(odriveObj[key]["val"]).toFixed(3));
|
||||
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"]);
|
||||
break;
|
||||
case "bool":
|
||||
|
||||
@@ -143,6 +143,14 @@ let odriveEnums = {
|
||||
{
|
||||
text: "Homing",
|
||||
value: 11,
|
||||
},
|
||||
{
|
||||
text: "Encoder Hall Polarity Calibration",
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
text: "Encoder Hall Phase Calibration",
|
||||
value: 13,
|
||||
}
|
||||
],
|
||||
current_state: [
|
||||
@@ -193,6 +201,14 @@ let odriveEnums = {
|
||||
{
|
||||
text: "Homing",
|
||||
value: 11,
|
||||
},
|
||||
{
|
||||
text: "Encoder Hall Polarity Calibration",
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
text: "Encoder Hall Phase Calibration",
|
||||
value: 13,
|
||||
}
|
||||
],
|
||||
// encoder mode
|
||||
|
||||
Reference in New Issue
Block a user