Skip to content

Commit c5a6c85

Browse files
author
Matthew Matz
committed
fixes for fingerprint and array blocks
1 parent 64160d8 commit c5a6c85

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/main/webapp/cdn/blockly/generators/propc/sensors.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@ Blockly.Blocks.fp_scanner_add = {
367367
this.setColour(colorPalette.getColor('input'));
368368
this.appendDummyInput()
369369
.appendField("Fingerprint Scanner")
370-
.appendField(new Blockly.FieldDropdown([["add", "ADD"], ["delete", "DEL"], ["delete all users", "ALL"]], function (action) {
370+
.appendField(new Blockly.FieldDropdown([["capture and save to", "ADD"], ["delete capture for", "DEL"], ["delete all captures", "ALL"]], function (action) {
371371
this.sourceBlock_.setAction_({"ACTION": action});
372372
}), "ACTION");
373373
this.appendValueInput("USER")
374374
.setCheck("Number")
375-
.appendField("user");
375+
.appendField("ID");
376376
this.setInputsInline(true);
377377
this.setPreviousStatement(true, null);
378378
this.setNextStatement(true, null);
@@ -393,7 +393,7 @@ Blockly.Blocks.fp_scanner_add = {
393393
if (!inputIs) {
394394
this.appendValueInput("USER")
395395
.setCheck("Number")
396-
.appendField("user");
396+
.appendField("ID");
397397
}
398398
} else {
399399
if (inputIs)
@@ -431,7 +431,7 @@ Blockly.Blocks.fp_scanner_scan = {
431431
this.setColour(colorPalette.getColor('input'));
432432
this.appendDummyInput()
433433
.appendField("Fingerprint Scanner")
434-
.appendField(new Blockly.FieldDropdown([["scan", "SCAN"], ["scan and compare", "COMP"], ["count users", "COUNT"]], function (action) {
434+
.appendField(new Blockly.FieldDropdown([["scan and identify", "SCAN"], ["scan and compare", "COMP"], ["count number of IDs", "COUNT"]], function (action) {
435435
this.sourceBlock_.setAction_({"ACTION": action});
436436
}), "ACTION");
437437
this.setInputsInline(true);
@@ -453,7 +453,7 @@ Blockly.Blocks.fp_scanner_scan = {
453453
if (!inputIs) {
454454
this.appendValueInput("USER")
455455
.setCheck("Number")
456-
.appendField("to user");
456+
.appendField("to ID");
457457
}
458458
} else {
459459
if (inputIs)
@@ -484,7 +484,7 @@ Blockly.propc.fp_scanner_scan = function () {
484484
code = 'fingerScanner(' + usr + ')';
485485
}
486486
if (act === 'COUNT')
487-
code = 'fingerScanner(fpScan)';
487+
code = 'fingerprint_countUsers(fpScan)';
488488
}
489489
//code = 'toast';
490490
return [code, Blockly.propc.ORDER_ATOMIC];

src/main/webapp/cdn/blockly/generators/propc/variables.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,14 @@ Blockly.propc.array_fill = function () {
255255
varName = varName.replace(" ", "_");
256256
varName = varName.replace(/\W/g, "");
257257
var varVals = this.getFieldValue('NUM');
258+
258259
varVals = varVals.replace(/[^0-9,-\.]/g, "");
259260
varVals = varVals.replace(/,\./g, ",0.");
260261
varVals = varVals.replace(/\b\.[0-9-]+,\b/g, ",");
261262
varVals = varVals.replace(/\.[0-9],/g, ",");
262263
varVals = varVals.replace(/,,/g, ",0,");
263264
varVals = varVals.replace(/,\s*$/, "");
265+
varVals = varVals.split(".")[0];
264266
var noCommas = varVals.replace(/,/g, "");
265267

266268
var elements = varVals.length - noCommas.length + 1;

src/main/webapp/cdn/blockly/language/en/_messages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ Blockly.MSG_XBEE_RECEIVE_TOOLTIP = "XBee receive: receives information from an X
345345
Blockly.MSG_WS2812B_INIT_TOOLTIP = "RGB-LED init: match to Propeller I/O pin connections and number of LEDs.";
346346
Blockly.MSG_WS2812B_SET_TOOLTIP = "RGB-LED set: specify color for a specific LED.";
347347
Blockly.MSG_WS2812B_UPDATE_TOOLTIP = "RGB-LED update: update colors of all connected RGB-LEDs.";
348-
Blockly.MSG_FPS_INIT_TOOLTIP = "Fingerprint scanner initialize: match to Propeller I/O pin connections and set to allow/prevent fingerprint overwriting.";
349-
Blockly.MSG_FPS_ADD_TOOLTIP = "Fingerprint scanner add: Add or delete a user or users and their fingerprint(s).";
350-
Blockly.MSG_FPS_SCAN_TOOLTIP = "Fingerprint scanner scan: Scan or scan and compare a fingerprint, or count the number of saved users.";
348+
Blockly.MSG_FPS_INIT_TOOLTIP = "Fingerprint scanner initialize: match to Propeller I/O pin connections.";
349+
Blockly.MSG_FPS_ADD_TOOLTIP = "Fingerprint scanner capture: capture and save or delete a capture or captures and their ID(s).";
350+
Blockly.MSG_FPS_SCAN_TOOLTIP = "Fingerprint scanner scan: scan and identify or scan and compare a fingerprint, or count the number of saved captures.";
351351
Blockly.MSG_HMC5883L_INIT_TOOLTIP = "Compass initialize: match to Propeller I/O pin connections.";
352352
Blockly.MSG_HMC5883L_READ_TOOLTIP = "Compass heading: get current heading in degrees.";
353353
Blockly.MSG_JOYSTICK_INPUT_XAXIS_TOOLTIP = "Joystick x-axis: gets horizontal position of Joystick, match to A/D socket.";

0 commit comments

Comments
 (0)