Skip to content

Commit

Permalink
sort calibration points
Browse files Browse the repository at this point in the history
  • Loading branch information
vitotai committed Mar 15, 2024
1 parent ce14288 commit 22175ae
Show file tree
Hide file tree
Showing 127 changed files with 30,764 additions and 30,745 deletions.
2 changes: 1 addition & 1 deletion htmljs/dist/chinese/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/chinese/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/chinese/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/chinese/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/chinese/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/chinese/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/chinese/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/chinese/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/chinese/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/chinese/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/chinese/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/chinese/logging.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/english/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/english/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/english/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/english/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/english/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/english/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/english/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/english/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/english/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/english/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/english/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/english/logging.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/italian/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/italian/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/italian/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/italian/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/italian/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/italian/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/italian/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/italian/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/italian/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/italian/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/italian/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/italian/logging.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/control_s.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/control_s.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/index_s.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/index_s.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/norwegian/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/norwegian/logging.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/control_s.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/control_s.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/index_s.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/index_s.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/portuguese-br/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/portuguese-br/logging.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/control_s.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/control_s.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/index_s.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/index_s.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/slovak/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/slovak/logging.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/spanish/BPLLogViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/spanish/BPLLogViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/spanish/BPLogWebViewer.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/spanish/BPLogWebViewer.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/spanish/config.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/spanish/config.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/spanish/control.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/spanish/control.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/spanish/index.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/spanish/index.htm.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion htmljs/dist/spanish/logging.htm

Large diffs are not rendered by default.

Binary file modified htmljs/dist/spanish/logging.htm.gz
Binary file not shown.
1 change: 1 addition & 0 deletions htmljs/src/js/vendor/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ var GravityChangePeriod3 =24 * 3600;
var raw = (t.devType == 2)? traw/10000:traw/100;
t.calpoints.push([raw,gravity]);
}
t.calpoints.sort(function(a,b){return a[0]-b[0];});
}
} else if (d0 == 0xF4) { // mode
//console.log(""+t.ctime/t.interval +" Stage:"+d1);
Expand Down
6 changes: 5 additions & 1 deletion src/ExternalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,17 @@ bool ExternalData::processGravityReport(char data[],size_t length, bool authenti
return false;
}
float gravity = root["gravity"];
float tilt = -100;

if(root.containsKey("raw")){
tilt = root["raw"];
}

if(root.containsKey("og")){
_setOriginalGravity(gravity);

}else{
// gravity data from user
float tilt = -100;
userSetGravity(gravity,tilt);
}
}else if(root.containsKey("name") && root.containsKey("temperature") && root.containsKey("angle") && root.containsKey("battery")&& root.containsKey("RSSI")){
Expand Down
17 changes: 14 additions & 3 deletions src/FormulaKeeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,21 @@ bool FormulaKeeper::addGravity(float sg){
}

void FormulaKeeper::addPoint(float tilt,float sg){
DBG_PRINTF("*** addPoint:%.4f,%f.4f\n",tilt,sg);
_calTilts[_numberOfPoints]= tilt;
_calGravities[_numberOfPoints] = sg;
if(_numberOfPoints >= MaxNumberCalibrationPoints) return;
int pos=0;

while(pos<_numberOfPoints && _calTilts[pos]< tilt) pos++;

if(pos < _numberOfPoints){
for(int i=_numberOfPoints; i> pos;i--){
_calTilts[i]= _calTilts[i-1];
_calGravities[i] =_calGravities[i-1];
}
}
_calTilts[pos]= tilt;
_calGravities[pos] = sg;
_numberOfPoints ++;
DBG_PRINTF("*** addPoint:%.4f,%f.4f @%d\n",tilt,sg,pos);
}

#endif
1,800 changes: 900 additions & 900 deletions wdoc/chinese_config_htm.h

Large diffs are not rendered by default.

2,228 changes: 1,114 additions & 1,114 deletions wdoc/chinese_control_htm.h

Large diffs are not rendered by default.

2,605 changes: 1,303 additions & 1,302 deletions wdoc/chinese_index_htm.h

Large diffs are not rendered by default.

1,850 changes: 925 additions & 925 deletions wdoc/chinese_log_htm.h

Large diffs are not rendered by default.

1,397 changes: 698 additions & 699 deletions wdoc/english_config_htm.h

Large diffs are not rendered by default.

2,158 changes: 1,079 additions & 1,079 deletions wdoc/english_control_htm.h

Large diffs are not rendered by default.

5,561 changes: 2,781 additions & 2,780 deletions wdoc/english_index_htm.h

Large diffs are not rendered by default.

1,384 changes: 692 additions & 692 deletions wdoc/english_log_htm.h

Large diffs are not rendered by default.

1,405 changes: 702 additions & 703 deletions wdoc/italian_config_htm.h

Large diffs are not rendered by default.

2,180 changes: 1,090 additions & 1,090 deletions wdoc/italian_control_htm.h

Large diffs are not rendered by default.

5,609 changes: 2,805 additions & 2,804 deletions wdoc/italian_index_htm.h

Large diffs are not rendered by default.

1,832 changes: 916 additions & 916 deletions wdoc/italian_log_htm.h

Large diffs are not rendered by default.

1,407 changes: 703 additions & 704 deletions wdoc/norwegian_config_htm.h

Large diffs are not rendered by default.

1,628 changes: 814 additions & 814 deletions wdoc/norwegian_control_htm.h

Large diffs are not rendered by default.

2,573 changes: 1,287 additions & 1,286 deletions wdoc/norwegian_index_htm.h

Large diffs are not rendered by default.

1,778 changes: 889 additions & 889 deletions wdoc/norwegian_log_htm.h

Large diffs are not rendered by default.

1,415 changes: 707 additions & 708 deletions wdoc/portuguese-br_config_htm.h

Large diffs are not rendered by default.

2,202 changes: 1,101 additions & 1,101 deletions wdoc/portuguese-br_control_htm.h

Large diffs are not rendered by default.

2,585 changes: 1,293 additions & 1,292 deletions wdoc/portuguese-br_index_htm.h

Large diffs are not rendered by default.

1,412 changes: 706 additions & 706 deletions wdoc/portuguese-br_log_htm.h

Large diffs are not rendered by default.

1,792 changes: 896 additions & 896 deletions wdoc/slovak_config_htm.h

Large diffs are not rendered by default.

2,215 changes: 1,108 additions & 1,107 deletions wdoc/slovak_control_htm.h

Large diffs are not rendered by default.

2,613 changes: 1,307 additions & 1,306 deletions wdoc/slovak_index_htm.h

Large diffs are not rendered by default.

1,430 changes: 715 additions & 715 deletions wdoc/slovak_log_htm.h

Large diffs are not rendered by default.

1,783 changes: 891 additions & 892 deletions wdoc/spanish_config_htm.h

Large diffs are not rendered by default.

2,192 changes: 1,096 additions & 1,096 deletions wdoc/spanish_control_htm.h

Large diffs are not rendered by default.

2,583 changes: 1,292 additions & 1,291 deletions wdoc/spanish_index_htm.h

Large diffs are not rendered by default.

1,772 changes: 886 additions & 886 deletions wdoc/spanish_log_htm.h

Large diffs are not rendered by default.

0 comments on commit 22175ae

Please sign in to comment.