Skip to content

Commit

Permalink
Fix migration function
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-se committed Feb 20, 2024
1 parent 622e42c commit 0ec0d4b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
17 changes: 7 additions & 10 deletions html/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?
</div>
<div class="col-md-2">
<button class="btn btn-primary btn-sm" type="button" id="migrate-btn" data-bs-toggle="collapse" data-bs-target="#collapseSupport" aria-expanded="false" aria-controls="collapseSupport" data-bs-toggle="tooltip" name="support-btn" id="support-btn" title="Collect data relevant for a support case">
<button class="btn btn-primary btn-sm" type="button" id="migrate-btn" data-bs-toggle="tooltip" name="migrate-btn" title="Migrate ispindel config">
Migrate
</button>
</div>
Expand All @@ -124,17 +124,14 @@
// var url = "/test/migrate.json";
$.getJSON(url, function (cfg) {
console.log( cfg );

gyro = {}
gyro["ax"] = cfg["Offset"][0];
gyro["ay"] = cfg["Offset"][1];
gyro["az"] = cfg["Offset"][2];
gyro["gx"] = cfg["Offset"][3];
gyro["gy"] = cfg["Offset"][4];
gyro["gz"] = cfg["Offset"][5];

data = {}
data["gyro-calibration-data"] = gyro;
data["ax"] = cfg["Offset"][0];
data["ay"] = cfg["Offset"][1];
data["az"] = cfg["Offset"][2];
data["gx"] = cfg["Offset"][3];
data["gy"] = cfg["Offset"][4];
data["gz"] = cfg["Offset"][5];
data["gravity-formula"] = cfg["POLY"];

$.ajax( "/api/migrate", {
Expand Down
Loading

0 comments on commit 0ec0d4b

Please sign in to comment.