mirror of
https://gitlab.silvrtree.co.uk/martind2000/censis-archive.git
synced 2025-03-13 00:10:01 +00:00
”2016-06-07”
This commit is contained in:
parent
5d409f19e3
commit
e80c00e850
@ -68,23 +68,34 @@ CC2650_ACCEL = function(p) {
|
|||||||
var message;
|
var message;
|
||||||
var calcData;
|
var calcData;
|
||||||
|
|
||||||
|
function gString(v) {
|
||||||
|
return [v.toFixed(3),'G'].join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function aString(v) {
|
||||||
|
return [v.toFixed(3),'\'/s'].join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function mString(v) {
|
||||||
|
return [v.toFixed(3),'mT'].join('');
|
||||||
|
}
|
||||||
calcData = this.processData(data);
|
calcData = this.processData(data);
|
||||||
|
|
||||||
message = 'Gyro <br/>' + 'X: ' + calcData.gyro.x + '<br/>' + 'Y: ' + calcData.gyro.y + '<br/>' + 'Z: ' + calcData.gyro.z + '<br/>' + 'Accel <br/>' + 'X: ' + calcData.accel.x + '<br/>' + 'Y: ' + calcData.accel.y + '<br/>' + 'Z: ' + calcData.accel.z + '<br/>' + 'Mag <br/>' + 'X: ' + calcData.mag.x + '<br/>' + 'Y: ' + calcData.mag.y + '<br/>' + 'Z: ' + calcData.mag.z + '<br/>';
|
message = 'Gyro <br/>' + 'X: ' + calcData.gyro.x + '<br/>' + 'Y: ' + calcData.gyro.y + '<br/>' + 'Z: ' + calcData.gyro.z + '<br/>' + 'Accel <br/>' + 'X: ' + calcData.accel.x + '<br/>' + 'Y: ' + calcData.accel.y + '<br/>' + 'Z: ' + calcData.accel.z + '<br/>' + 'Mag <br/>' + 'X: ' + calcData.mag.x + '<br/>' + 'Y: ' + calcData.mag.y + '<br/>' + 'Z: ' + calcData.mag.z + '<br/>';
|
||||||
|
|
||||||
this.state = message;
|
this.state = message;
|
||||||
|
|
||||||
this.$result[this.frames.gyroID + '-x'].text(calcData.gyro.x.toFixed(5));
|
this.$result[this.frames.gyroID + '-x'].text(gString(calcData.gyro.x));
|
||||||
this.$result[this.frames.gyroID + '-y'].text(calcData.gyro.y.toFixed(5));
|
this.$result[this.frames.gyroID + '-y'].text(gString(calcData.gyro.y));
|
||||||
this.$result[this.frames.gyroID + '-z'].text(calcData.gyro.z.toFixed(5));
|
this.$result[this.frames.gyroID + '-z'].text(gString(calcData.gyro.z));
|
||||||
|
|
||||||
this.$result[this.frames.accelID + '-x'].text(calcData.accel.x.toFixed(5));
|
this.$result[this.frames.accelID + '-x'].text(aString(calcData.accel.x));
|
||||||
this.$result[this.frames.accelID + '-y'].text(calcData.accel.y.toFixed(5));
|
this.$result[this.frames.accelID + '-y'].text(aString(calcData.accel.y));
|
||||||
this.$result[this.frames.accelID + '-z'].text(calcData.accel.z.toFixed(5));
|
this.$result[this.frames.accelID + '-z'].text(aString(calcData.accel.z));
|
||||||
|
|
||||||
this.$result[this.frames.magID + '-x'].text(calcData.mag.x);
|
this.$result[this.frames.magID + '-x'].text(mString(calcData.mag.x));
|
||||||
this.$result[this.frames.magID + '-y'].text(calcData.mag.y);
|
this.$result[this.frames.magID + '-y'].text(mString(calcData.mag.y));
|
||||||
this.$result[this.frames.magID + '-z'].text(calcData.mag.z);
|
this.$result[this.frames.magID + '-z'].text(mString(calcData.mag.z));
|
||||||
|
|
||||||
this.data.gyro.x = this.storeData(calcData.gyro.x, this.data.gyro.x);
|
this.data.gyro.x = this.storeData(calcData.gyro.x, this.data.gyro.x);
|
||||||
this.data.gyro.y = this.storeData(calcData.gyro.y, this.data.gyro.y);
|
this.data.gyro.y = this.storeData(calcData.gyro.y, this.data.gyro.y);
|
||||||
@ -158,6 +169,7 @@ CC2650_ACCEL = function(p) {
|
|||||||
var lineID;
|
var lineID;
|
||||||
var max;
|
var max;
|
||||||
|
|
||||||
|
|
||||||
var parts = ['x', 'y', 'z'];
|
var parts = ['x', 'y', 'z'];
|
||||||
|
|
||||||
_data = data || this.data;
|
_data = data || this.data;
|
||||||
@ -186,9 +198,16 @@ CC2650_ACCEL = function(p) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('accel max:', max)
|
|
||||||
|
console.log('accel max:', max);
|
||||||
ceiling = max;
|
ceiling = max;
|
||||||
floor = max * -1;
|
|
||||||
|
/* if (ceiling < this.previousCeil) {
|
||||||
|
ceiling = ceiling + ((this.previousCeil - ceiling) / 2);
|
||||||
|
ceiling = (Math.ceil((Math.round(ceiling) + 1) / 10));
|
||||||
|
}*/
|
||||||
|
|
||||||
|
floor = ceiling * -1;
|
||||||
ceilingLimit = ceiling;
|
ceilingLimit = ceiling;
|
||||||
|
|
||||||
var scalePos = (124 / 2) / ceiling;
|
var scalePos = (124 / 2) / ceiling;
|
||||||
@ -225,6 +244,7 @@ CC2650_ACCEL = function(p) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.previousCeil = ceiling;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.animateGraph = function() {
|
this.animateGraph = function() {
|
||||||
|
@ -45,6 +45,9 @@ var CAPABILITY = function(p) {
|
|||||||
|
|
||||||
this.target = null;
|
this.target = null;
|
||||||
this.$frame = null;
|
this.$frame = null;
|
||||||
|
|
||||||
|
this.previousCeil = 0;
|
||||||
|
|
||||||
capabilityManager.register({id: this.capabilityID, module: this});
|
capabilityManager.register({id: this.capabilityID, module: this});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -68,23 +68,34 @@ CC2650_ACCEL = function(p) {
|
|||||||
var message;
|
var message;
|
||||||
var calcData;
|
var calcData;
|
||||||
|
|
||||||
|
function gString(v) {
|
||||||
|
return [v.toFixed(3),'G'].join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function aString(v) {
|
||||||
|
return [v.toFixed(3),'\'/s'].join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function mString(v) {
|
||||||
|
return [v.toFixed(3),'mT'].join('');
|
||||||
|
}
|
||||||
calcData = this.processData(data);
|
calcData = this.processData(data);
|
||||||
|
|
||||||
message = 'Gyro <br/>' + 'X: ' + calcData.gyro.x + '<br/>' + 'Y: ' + calcData.gyro.y + '<br/>' + 'Z: ' + calcData.gyro.z + '<br/>' + 'Accel <br/>' + 'X: ' + calcData.accel.x + '<br/>' + 'Y: ' + calcData.accel.y + '<br/>' + 'Z: ' + calcData.accel.z + '<br/>' + 'Mag <br/>' + 'X: ' + calcData.mag.x + '<br/>' + 'Y: ' + calcData.mag.y + '<br/>' + 'Z: ' + calcData.mag.z + '<br/>';
|
message = 'Gyro <br/>' + 'X: ' + calcData.gyro.x + '<br/>' + 'Y: ' + calcData.gyro.y + '<br/>' + 'Z: ' + calcData.gyro.z + '<br/>' + 'Accel <br/>' + 'X: ' + calcData.accel.x + '<br/>' + 'Y: ' + calcData.accel.y + '<br/>' + 'Z: ' + calcData.accel.z + '<br/>' + 'Mag <br/>' + 'X: ' + calcData.mag.x + '<br/>' + 'Y: ' + calcData.mag.y + '<br/>' + 'Z: ' + calcData.mag.z + '<br/>';
|
||||||
|
|
||||||
this.state = message;
|
this.state = message;
|
||||||
|
|
||||||
this.$result[this.frames.gyroID + '-x'].text(calcData.gyro.x.toFixed(5));
|
this.$result[this.frames.gyroID + '-x'].text(gString(calcData.gyro.x));
|
||||||
this.$result[this.frames.gyroID + '-y'].text(calcData.gyro.y.toFixed(5));
|
this.$result[this.frames.gyroID + '-y'].text(gString(calcData.gyro.y));
|
||||||
this.$result[this.frames.gyroID + '-z'].text(calcData.gyro.z.toFixed(5));
|
this.$result[this.frames.gyroID + '-z'].text(gString(calcData.gyro.z));
|
||||||
|
|
||||||
this.$result[this.frames.accelID + '-x'].text(calcData.accel.x.toFixed(5));
|
this.$result[this.frames.accelID + '-x'].text(aString(calcData.accel.x));
|
||||||
this.$result[this.frames.accelID + '-y'].text(calcData.accel.y.toFixed(5));
|
this.$result[this.frames.accelID + '-y'].text(aString(calcData.accel.y));
|
||||||
this.$result[this.frames.accelID + '-z'].text(calcData.accel.z.toFixed(5));
|
this.$result[this.frames.accelID + '-z'].text(aString(calcData.accel.z));
|
||||||
|
|
||||||
this.$result[this.frames.magID + '-x'].text(calcData.mag.x);
|
this.$result[this.frames.magID + '-x'].text(mString(calcData.mag.x));
|
||||||
this.$result[this.frames.magID + '-y'].text(calcData.mag.y);
|
this.$result[this.frames.magID + '-y'].text(mString(calcData.mag.y));
|
||||||
this.$result[this.frames.magID + '-z'].text(calcData.mag.z);
|
this.$result[this.frames.magID + '-z'].text(mString(calcData.mag.z));
|
||||||
|
|
||||||
this.data.gyro.x = this.storeData(calcData.gyro.x, this.data.gyro.x);
|
this.data.gyro.x = this.storeData(calcData.gyro.x, this.data.gyro.x);
|
||||||
this.data.gyro.y = this.storeData(calcData.gyro.y, this.data.gyro.y);
|
this.data.gyro.y = this.storeData(calcData.gyro.y, this.data.gyro.y);
|
||||||
@ -158,6 +169,7 @@ CC2650_ACCEL = function(p) {
|
|||||||
var lineID;
|
var lineID;
|
||||||
var max;
|
var max;
|
||||||
|
|
||||||
|
|
||||||
var parts = ['x', 'y', 'z'];
|
var parts = ['x', 'y', 'z'];
|
||||||
|
|
||||||
_data = data || this.data;
|
_data = data || this.data;
|
||||||
@ -186,9 +198,16 @@ CC2650_ACCEL = function(p) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('accel max:', max)
|
|
||||||
|
console.log('accel max:', max);
|
||||||
ceiling = max;
|
ceiling = max;
|
||||||
floor = max * -1;
|
|
||||||
|
/* if (ceiling < this.previousCeil) {
|
||||||
|
ceiling = ceiling + ((this.previousCeil - ceiling) / 2);
|
||||||
|
ceiling = (Math.ceil((Math.round(ceiling) + 1) / 10));
|
||||||
|
}*/
|
||||||
|
|
||||||
|
floor = ceiling * -1;
|
||||||
ceilingLimit = ceiling;
|
ceilingLimit = ceiling;
|
||||||
|
|
||||||
var scalePos = (124 / 2) / ceiling;
|
var scalePos = (124 / 2) / ceiling;
|
||||||
@ -225,6 +244,7 @@ CC2650_ACCEL = function(p) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.previousCeil = ceiling;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.animateGraph = function() {
|
this.animateGraph = function() {
|
||||||
|
@ -45,6 +45,9 @@ var CAPABILITY = function(p) {
|
|||||||
|
|
||||||
this.target = null;
|
this.target = null;
|
||||||
this.$frame = null;
|
this.$frame = null;
|
||||||
|
|
||||||
|
this.previousCeil = 0;
|
||||||
|
|
||||||
capabilityManager.register({id: this.capabilityID, module: this});
|
capabilityManager.register({id: this.capabilityID, module: this});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user