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