parent
9ef5b8d4ad
commit
a71dee2923
@ -11,5 +11,7 @@
|
|||||||
"datalog.addValue|param|value": "value of the cell, eg: 0",
|
"datalog.addValue|param|value": "value of the cell, eg: 0",
|
||||||
"datalog.flush": "Commits any buffered row to disk",
|
"datalog.flush": "Commits any buffered row to disk",
|
||||||
"datalog.setEnabled": "Turns on or off datalogging",
|
"datalog.setEnabled": "Turns on or off datalogging",
|
||||||
|
"datalog.setSampleInterval": "Sets the minimum number of milli seconds between rows",
|
||||||
|
"datalog.setSampleInterval|param|millis": "milliseconds between each sample, eg: 50",
|
||||||
"datalog.setStorage": "* @param storage custom storage solution"
|
"datalog.setStorage": "* @param storage custom storage solution"
|
||||||
}
|
}
|
@ -2,6 +2,7 @@
|
|||||||
"datalog.addRow|block": "datalog add row",
|
"datalog.addRow|block": "datalog add row",
|
||||||
"datalog.addValue|block": "datalog add %name|=%value",
|
"datalog.addValue|block": "datalog add %name|=%value",
|
||||||
"datalog.setEnabled|block": "datalog %enabled=toggleOnOff",
|
"datalog.setEnabled|block": "datalog %enabled=toggleOnOff",
|
||||||
|
"datalog.setSampleInterval|block": "set datalog sampling interval to %millis|(ms)",
|
||||||
"datalog|block": "datalog",
|
"datalog|block": "datalog",
|
||||||
"{id:category}Datalog": "Datalog"
|
"{id:category}Datalog": "Datalog"
|
||||||
}
|
}
|
@ -2,7 +2,7 @@ namespace datalog.ev3 {
|
|||||||
/**
|
/**
|
||||||
* A datalog storage for the EV3
|
* A datalog storage for the EV3
|
||||||
*/
|
*/
|
||||||
export class EV3DatalogStorage extends DatalogStorage { // implements DatalogStorage {
|
export class EV3DatalogStorage extends DatalogStorage {
|
||||||
private _filename: string;
|
private _filename: string;
|
||||||
private _buffer: string;
|
private _buffer: string;
|
||||||
private _storage: storage.Storage;
|
private _storage: storage.Storage;
|
||||||
@ -38,18 +38,18 @@ namespace datalog.ev3 {
|
|||||||
// commit row data
|
// commit row data
|
||||||
this._buffer += storage.toCSV(values, this._storage.csvSeparator);
|
this._buffer += storage.toCSV(values, this._storage.csvSeparator);
|
||||||
// buffered writes
|
// buffered writes
|
||||||
if (this._buffer.length > 1024)
|
if (this._buffer.length > 512)
|
||||||
this.flush();
|
this.flush();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Flushes any buffered data
|
* Flushes any buffered data
|
||||||
*/
|
*/
|
||||||
flush(): void {
|
flush(): void {
|
||||||
if (this._buffer) {
|
if (this._buffer) {
|
||||||
const b = this._buffer;
|
const b = this._buffer;
|
||||||
this._buffer = "";
|
this._buffer = "";
|
||||||
this._storage.append(this._filename, b);
|
this._storage.append(this._filename, b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// automatic hook up
|
// automatic hook up
|
||||||
|
@ -44,8 +44,8 @@
|
|||||||
"webfonts-generator": "^0.4.0"
|
"webfonts-generator": "^0.4.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pxt-common-packages": "0.17.12",
|
"pxt-common-packages": "0.17.13",
|
||||||
"pxt-core": "3.0.26"
|
"pxt-core": "3.0.29"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
||||||
|
Loading…
Reference in New Issue
Block a user