Skip to content

Commit 4b3a477

Browse files
committed
v1.6.0: Can now filter any column, performance improvement when getting data chunks, bug fix on filtered data viewing, increased reading precision from 8 to 9, additional documentation. Fixed text cutoff bug with getRecordingInformation() & getEventInformation().
1 parent 9873eb5 commit 4b3a477

File tree

5 files changed

+139
-127
lines changed

5 files changed

+139
-127
lines changed

dataRecorder.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
namespace microdata {
22
import AppInterface = user_interface_base.AppInterface
33
import Screen = user_interface_base.Screen
4-
import Scene = user_interface_base.Scene
4+
import Scene = user_interface_base.Scene
55
import Sprite = user_interface_base.Sprite
66
import Affine = user_interface_base.Affine
77
import font = user_interface_base.font
88

99
/** Number of sensor information boxes that can fit onto the screen at once*/
1010
const MAX_SENSORS_ON_SCREEN: number = 5
1111
/** The colours that will be used for the lines & sensor information boxes */
12-
const SENSOR_BOX_COLORS: number[] = [2,3,4,6,7,9]
12+
const SENSOR_BOX_COLORS: number[] = [2, 3, 4, 6, 7, 9]
1313
/** The colours that will be used for writing the information about the sensor. */
14-
const SENSOR_BOX_TEXT_COLORS: number[] = [1,1,1,1,15,15]
14+
const SENSOR_BOX_TEXT_COLORS: number[] = [1, 1, 1, 1, 15, 15]
1515

1616
/**
1717
* Responsible for invoking the logging commands for each sensor,
@@ -45,7 +45,7 @@ namespace microdata {
4545
this.sensors = sensors
4646
this.numberOfSensors = sensors.length
4747

48-
this.sensorIndexOffset = 0
48+
this.sensorIndexOffset = 0
4949
this.currentSensorIndex = 0
5050
this.sensorBoxColor = 15
5151
this.showCancelRecordingScreen = false;
@@ -95,7 +95,7 @@ namespace microdata {
9595

9696
if (this.sensorIndexOffset > 0)
9797
this.sensorIndexOffset = Math.max(0, this.sensorIndexOffset - 1)
98-
98+
9999
this.update()
100100
}
101101
)
@@ -135,8 +135,8 @@ namespace microdata {
135135

136136
this.log()
137137
}
138-
139-
log() {this.scheduler.start()}
138+
139+
log() { this.scheduler.start() }
140140

141141
update(): void {
142142
Screen.fillRect(
@@ -149,8 +149,8 @@ namespace microdata {
149149

150150
// Check if all sensors have finished their work:
151151
if (this.scheduler.loggingComplete()) {
152-
screen().printCenter("Data Logging Complete.", (screen().height>> 1) - 10);
153-
screen().printCenter("Press B to back out.", screen().height>> 1);
152+
screen().printCenter("Data Logging Complete.", (screen().height >> 1) - 10);
153+
screen().printCenter("Press B to back out.", screen().height >> 1);
154154
}
155155

156156
else {
@@ -160,7 +160,7 @@ namespace microdata {
160160
for (let i = this.sensorIndexOffset; i < this.numberOfSensors; i++) {
161161
if (i - this.sensorIndexOffset > MAX_SENSORS_ON_SCREEN)
162162
break
163-
163+
164164
// Get the colour for this box
165165
this.sensorBoxColor = SENSOR_BOX_COLORS[i % SENSOR_BOX_COLORS.length]
166166

@@ -175,7 +175,7 @@ namespace microdata {
175175
16,
176176
16
177177
)
178-
178+
179179
screen().fillRect(
180180
7,
181181
y,
@@ -241,7 +241,7 @@ namespace microdata {
241241
}
242242

243243
if (this.showCancelRecordingScreen) {
244-
const headerX = Screen.HALF_WIDTH // Log has data in it
244+
const headerX = Screen.HALF_WIDTH; // Log has data in it
245245

246246
// Outline:
247247
screen().fillRect(
@@ -263,14 +263,14 @@ namespace microdata {
263263
const tutorialTextLength = ("Cancel recording?".length * font.charWidth)
264264
screen().print(
265265
"Cancel recording?",
266-
headerX - (tutorialTextLength>> 1),
266+
headerX - (tutorialTextLength >> 1),
267267
Screen.HALF_HEIGHT - 30 + 7,
268268
15 // Black
269269
)
270270

271271
// Underline the title:
272272
screen().fillRect(
273-
headerX - (tutorialTextLength>> 1) - 1,
273+
headerX - (tutorialTextLength >> 1) - 1,
274274
Screen.HALF_HEIGHT - 30 + 16,
275275
tutorialTextLength,
276276
2,
@@ -318,4 +318,4 @@ namespace microdata {
318318
}
319319
}
320320
}
321-
}
321+
}

home.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ namespace microdata {
8181
private drawVersion() {
8282
const font = bitmaps.font5
8383
Screen.print(
84-
"v1.5.3",
85-
Screen.RIGHT_EDGE - font.charWidth * "v1.5.3".length,
84+
"v1.6.0",
85+
Screen.RIGHT_EDGE - font.charWidth * "v1.6.0".length,
8686
Screen.BOTTOM_EDGE - font.charHeight - 2,
8787
0xb,
8888
font

pxt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MicroData",
3-
"version": "1.5.3",
3+
"version": "1.6.0",
44
"description": "Data science with micro:bit v2",
55
"dependencies": {
66
"core": "*",

0 commit comments

Comments
 (0)