Merge pull request #119 from sensebox/random-small-fixes
Multiple Issue fixes
This commit is contained in:
commit
c47cb0a02e
BIN
public/media/hardware/ble-bee.png
Normal file
BIN
public/media/hardware/ble-bee.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 194 KiB |
File diff suppressed because it is too large
Load Diff
@ -1,304 +1,329 @@
|
|||||||
import * as Blockly from 'blockly/core';
|
import * as Blockly from "blockly/core";
|
||||||
import { getColour } from '../helpers/colour';
|
import { getColour } from "../helpers/colour";
|
||||||
import * as Types from '../helpers/types'
|
import * as Types from "../helpers/types";
|
||||||
import { FieldSlider } from '@blockly/field-slider';
|
import { FieldSlider } from "@blockly/field-slider";
|
||||||
|
|
||||||
|
Blockly.Blocks["sensebox_display_beginDisplay"] = {
|
||||||
Blockly.Blocks['sensebox_display_beginDisplay'] = {
|
init: function () {
|
||||||
init: function () {
|
this.appendDummyInput().appendField(
|
||||||
this.appendDummyInput()
|
Blockly.Msg.senseBox_display_beginDisplay
|
||||||
.appendField(Blockly.Msg.senseBox_display_beginDisplay)
|
);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_beginDisplay_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_display_beginDisplay_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_clearDisplay'] = {
|
Blockly.Blocks["sensebox_display_clearDisplay"] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.appendDummyInput()
|
this.appendDummyInput().appendField(
|
||||||
.appendField(Blockly.Msg.senseBox_display_clearDisplay)
|
Blockly.Msg.senseBox_display_clearDisplay
|
||||||
this.setPreviousStatement(true, null);
|
);
|
||||||
this.setNextStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_clearDisplay_tooltip);
|
this.setColour(getColour().sensebox);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
this.setTooltip(Blockly.Msg.senseBox_display_clearDisplay_tooltip);
|
||||||
}
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_printDisplay'] = {
|
Blockly.Blocks["sensebox_display_printDisplay"] = {
|
||||||
init: function (block) {
|
init: function (block) {
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput().appendField(
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay);
|
Blockly.Msg.senseBox_display_printDisplay
|
||||||
this.appendDummyInput()
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_color)
|
this.appendDummyInput()
|
||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_display_white, "WHITE,BLACK"], [Blockly.Msg.senseBox_display_black, "BLACK,WHITE"]]), "COLOR");
|
.appendField(Blockly.Msg.senseBox_display_color)
|
||||||
this.appendDummyInput()
|
.appendField(
|
||||||
.appendField(Blockly.Msg.senseBox_display_setSize)
|
new Blockly.FieldDropdown([
|
||||||
.appendField(new FieldSlider(1, 1, 4), "SIZE");
|
[Blockly.Msg.senseBox_display_white, "WHITE,BLACK"],
|
||||||
this.appendDummyInput()
|
[Blockly.Msg.senseBox_display_black, "BLACK,WHITE"],
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
]),
|
||||||
.appendField(new FieldSlider(0, 0, 64), "X");
|
"COLOR"
|
||||||
this.appendDummyInput()
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
this.appendDummyInput()
|
||||||
.appendField(new FieldSlider(0, 0, 128), "Y");
|
.appendField(Blockly.Msg.senseBox_display_setSize)
|
||||||
this.appendValueInput('printDisplay')
|
.appendField(new FieldSlider(1, 1, 4), "SIZE");
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_value)
|
this.appendDummyInput()
|
||||||
.setCheck(null);
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
||||||
this.setPreviousStatement(true, null);
|
.appendField(new FieldSlider(0, 0, 128), "X");
|
||||||
this.setNextStatement(true, null);
|
this.appendDummyInput()
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
.appendField(new FieldSlider(0, 0, 64), "Y");
|
||||||
},
|
this.appendValueInput("printDisplay")
|
||||||
/**
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_value)
|
||||||
* Called whenever anything on the workspace changes.
|
.setCheck(null);
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
this.setPreviousStatement(true, null);
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
this.setNextStatement(true, null);
|
||||||
* @this Blockly.Block
|
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
||||||
*/
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
onchange: function (e) {
|
},
|
||||||
var legal = false;
|
/**
|
||||||
// Is the block nested in a loop?
|
|
||||||
var block = this;
|
|
||||||
do {
|
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
|
||||||
legal = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
block = block.getSurroundParent();
|
|
||||||
} while (block);
|
|
||||||
if (legal) {
|
|
||||||
this.setWarningText(null);
|
|
||||||
} else {
|
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LOOP_TYPES: ['sensebox_display_show'],
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_fastPrint'] = {
|
|
||||||
init: function (block) {
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_show);
|
|
||||||
this.appendValueInput("Title1", 'Title1')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_title);
|
|
||||||
this.appendValueInput("Value1", 'Value1')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_value);
|
|
||||||
this.appendValueInput("Dimension1", 'Dimension1')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_dimension);
|
|
||||||
this.appendValueInput("Title2", 'Title2')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_title);
|
|
||||||
this.appendValueInput("Value2", 'Value2')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_value);
|
|
||||||
this.appendValueInput("Dimension2", 'Dimension2')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_dimension);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.sensebox_display_fastPrint_tooltip);
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
* Add warning if block is not nested inside a the correct loop.
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
* @param {!Blockly.Events.Abstract} e Change event.
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
var legal = false;
|
var legal = false;
|
||||||
// Is the block nested in a loop?
|
// Is the block nested in a loop?
|
||||||
var block = this;
|
var block = this;
|
||||||
do {
|
do {
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
||||||
legal = true;
|
legal = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
block = block.getSurroundParent();
|
block = block.getSurroundParent();
|
||||||
} while (block);
|
} while (block);
|
||||||
if (legal) {
|
if (legal) {
|
||||||
this.setWarningText(null);
|
this.setWarningText(null);
|
||||||
} else {
|
} else {
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
}
|
|
||||||
},
|
|
||||||
LOOP_TYPES: ['sensebox_display_show'],
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_plotDisplay'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotDisplay)
|
|
||||||
this.appendValueInput("Title", 'Text')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotTitle);
|
|
||||||
this.appendValueInput("YLabel", 'Text')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotYLabel);
|
|
||||||
this.appendValueInput("XLabel", 'Text')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotXLabel);
|
|
||||||
this.appendValueInput("XRange1", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotXRange1);
|
|
||||||
this.appendValueInput("XRange2", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotXRange2)
|
|
||||||
this.appendValueInput("YRange1", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotYRange1);
|
|
||||||
this.appendValueInput("YRange2", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotYRange2);
|
|
||||||
this.setInputsInline(false);
|
|
||||||
this.appendValueInput("XTick", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotXTick);
|
|
||||||
this.appendValueInput("YTick", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotYTick);
|
|
||||||
this.appendValueInput("TimeFrame", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_plotTimeFrame);
|
|
||||||
this.appendValueInput('plotDisplay')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_value)
|
|
||||||
.setCheck(null);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Called whenever anything on the workspace changes.
|
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
onchange: function (e) {
|
|
||||||
var legal = false;
|
|
||||||
// Is the block nested in a loop?
|
|
||||||
var block = this;
|
|
||||||
do {
|
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
|
||||||
legal = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
block = block.getSurroundParent();
|
|
||||||
} while (block);
|
|
||||||
if (legal) {
|
|
||||||
this.setWarningText(null);
|
|
||||||
} else {
|
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LOOP_TYPES: ['sensebox_display_show'],
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_show'] = {
|
|
||||||
init: function () {
|
|
||||||
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.sensebox_display_show);
|
|
||||||
this.appendStatementInput('SHOW');
|
|
||||||
this.setTooltip(Blockly.Msg.sensebox_display_show_tip);
|
|
||||||
this.setHelpUrl('');
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
LOOP_TYPES: ["sensebox_display_show"],
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_fillCircle'] = {
|
Blockly.Blocks["sensebox_display_fastPrint"] = {
|
||||||
init: function () {
|
init: function (block) {
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput().appendField(
|
||||||
.appendField(Blockly.Msg.sensebox_display_fillCircle);
|
Blockly.Msg.senseBox_display_fastPrint_show
|
||||||
this.appendValueInput('X')
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
this.appendValueInput("Title1", "Title1").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_fastPrint_title
|
||||||
this.appendValueInput('Y')
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
this.appendValueInput("Value1", "Value1").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_fastPrint_value
|
||||||
this.appendValueInput('Radius')
|
);
|
||||||
.appendField(Blockly.Msg.sensebox_display_fillCircle_radius)
|
this.appendValueInput("Dimension1", "Dimension1").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_fastPrint_dimension
|
||||||
this.appendDummyInput('fill')
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_filled)
|
this.appendValueInput("Title2", "Title2").appendField(
|
||||||
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
Blockly.Msg.senseBox_display_fastPrint_title
|
||||||
this.setInputsInline(false);
|
);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_fillCircle_tooltip)
|
this.appendValueInput("Value2", "Value2").appendField(
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl)
|
Blockly.Msg.senseBox_display_fastPrint_value
|
||||||
this.setPreviousStatement(true, null);
|
);
|
||||||
this.setNextStatement(true, null);
|
this.appendValueInput("Dimension2", "Dimension2").appendField(
|
||||||
},
|
Blockly.Msg.senseBox_display_fastPrint_dimension
|
||||||
/**
|
);
|
||||||
|
this.setPreviousStatement(true, null);
|
||||||
|
this.setNextStatement(true, null);
|
||||||
|
this.setTooltip(Blockly.Msg.sensebox_display_fastPrint_tooltip);
|
||||||
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
|
},
|
||||||
|
/**
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
* Add warning if block is not nested inside a the correct loop.
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
* @param {!Blockly.Events.Abstract} e Change event.
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
var legal = false;
|
var legal = false;
|
||||||
// Is the block nested in a loop?
|
// Is the block nested in a loop?
|
||||||
var block = this;
|
var block = this;
|
||||||
do {
|
do {
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
||||||
legal = true;
|
legal = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
block = block.getSurroundParent();
|
block = block.getSurroundParent();
|
||||||
} while (block);
|
} while (block);
|
||||||
if (legal) {
|
if (legal) {
|
||||||
this.setWarningText(null);
|
this.setWarningText(null);
|
||||||
} else {
|
} else {
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LOOP_TYPES: ['sensebox_display_show'],
|
LOOP_TYPES: ["sensebox_display_show"],
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_drawRectangle'] = {
|
Blockly.Blocks["sensebox_display_plotDisplay"] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput().appendField(
|
||||||
.appendField(Blockly.Msg.sensebox_display_drawRectangle);
|
Blockly.Msg.senseBox_display_plotDisplay
|
||||||
this.appendValueInput('X')
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
this.appendValueInput("Title", "Text").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_plotTitle
|
||||||
this.appendValueInput('Y')
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
this.appendValueInput("YLabel", "Text").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_plotYLabel
|
||||||
this.appendValueInput('width')
|
);
|
||||||
.appendField(Blockly.Msg.sensebox_display_drawRectangle_width)
|
this.appendValueInput("XLabel", "Text").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_plotXLabel
|
||||||
this.appendValueInput('height')
|
);
|
||||||
.appendField(Blockly.Msg.sensebox_display_drawRectangle_height)
|
this.appendValueInput("XRange1", "Number").appendField(
|
||||||
.setCheck(Types.NUMBER.compatibleTypes);
|
Blockly.Msg.senseBox_display_plotXRange1
|
||||||
this.appendDummyInput('fill')
|
);
|
||||||
.appendField(Blockly.Msg.senseBox_display_filled)
|
this.appendValueInput("XRange2", "Number").appendField(
|
||||||
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
Blockly.Msg.senseBox_display_plotXRange2
|
||||||
this.setInputsInline(false);
|
);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_drawRectangle_tooltip)
|
this.appendValueInput("YRange1", "Number").appendField(
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl)
|
Blockly.Msg.senseBox_display_plotYRange1
|
||||||
this.setPreviousStatement(true, null);
|
);
|
||||||
this.setNextStatement(true, null);
|
this.appendValueInput("YRange2", "Number").appendField(
|
||||||
},
|
Blockly.Msg.senseBox_display_plotYRange2
|
||||||
/**
|
);
|
||||||
|
this.setInputsInline(false);
|
||||||
|
this.appendValueInput("XTick", "Number").appendField(
|
||||||
|
Blockly.Msg.senseBox_display_plotXTick
|
||||||
|
);
|
||||||
|
this.appendValueInput("YTick", "Number").appendField(
|
||||||
|
Blockly.Msg.senseBox_display_plotYTick
|
||||||
|
);
|
||||||
|
this.appendValueInput("TimeFrame", "Number").appendField(
|
||||||
|
Blockly.Msg.senseBox_display_plotTimeFrame
|
||||||
|
);
|
||||||
|
this.appendValueInput("plotDisplay")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_value)
|
||||||
|
.setCheck(null);
|
||||||
|
this.setPreviousStatement(true, null);
|
||||||
|
this.setNextStatement(true, null);
|
||||||
|
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
||||||
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
|
},
|
||||||
|
/**
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
* Add warning if block is not nested inside a the correct loop.
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
* @param {!Blockly.Events.Abstract} e Change event.
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
var legal = false;
|
var legal = false;
|
||||||
// Is the block nested in a loop?
|
// Is the block nested in a loop?
|
||||||
var block = this;
|
var block = this;
|
||||||
do {
|
do {
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
||||||
legal = true;
|
legal = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
block = block.getSurroundParent();
|
block = block.getSurroundParent();
|
||||||
} while (block);
|
} while (block);
|
||||||
if (legal) {
|
if (legal) {
|
||||||
this.setWarningText(null);
|
this.setWarningText(null);
|
||||||
} else {
|
} else {
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LOOP_TYPES: ['sensebox_display_show'],
|
LOOP_TYPES: ["sensebox_display_show"],
|
||||||
|
};
|
||||||
|
|
||||||
|
Blockly.Blocks["sensebox_display_show"] = {
|
||||||
|
init: function () {
|
||||||
|
this.setColour(getColour().sensebox);
|
||||||
|
this.appendDummyInput().appendField(Blockly.Msg.sensebox_display_show);
|
||||||
|
this.appendStatementInput("SHOW");
|
||||||
|
this.setTooltip(Blockly.Msg.sensebox_display_show_tip);
|
||||||
|
this.setHelpUrl("");
|
||||||
|
this.setPreviousStatement(true, null);
|
||||||
|
this.setNextStatement(true, null);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
Blockly.Blocks["sensebox_display_fillCircle"] = {
|
||||||
|
init: function () {
|
||||||
|
this.setColour(getColour().sensebox);
|
||||||
|
this.appendDummyInput().appendField(
|
||||||
|
Blockly.Msg.sensebox_display_fillCircle
|
||||||
|
);
|
||||||
|
this.appendValueInput("X")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendValueInput("Y")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendValueInput("Radius")
|
||||||
|
.appendField(Blockly.Msg.sensebox_display_fillCircle_radius)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendDummyInput("fill")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_filled)
|
||||||
|
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
||||||
|
this.setInputsInline(false);
|
||||||
|
this.setTooltip(Blockly.Msg.senseBox_display_fillCircle_tooltip);
|
||||||
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
|
this.setPreviousStatement(true, null);
|
||||||
|
this.setNextStatement(true, null);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Called whenever anything on the workspace changes.
|
||||||
|
* Add warning if block is not nested inside a the correct loop.
|
||||||
|
* @param {!Blockly.Events.Abstract} e Change event.
|
||||||
|
* @this Blockly.Block
|
||||||
|
*/
|
||||||
|
onchange: function (e) {
|
||||||
|
var legal = false;
|
||||||
|
// Is the block nested in a loop?
|
||||||
|
var block = this;
|
||||||
|
do {
|
||||||
|
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
||||||
|
legal = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
block = block.getSurroundParent();
|
||||||
|
} while (block);
|
||||||
|
if (legal) {
|
||||||
|
this.setWarningText(null);
|
||||||
|
} else {
|
||||||
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
LOOP_TYPES: ["sensebox_display_show"],
|
||||||
|
};
|
||||||
|
|
||||||
|
Blockly.Blocks["sensebox_display_drawRectangle"] = {
|
||||||
|
init: function () {
|
||||||
|
this.setColour(getColour().sensebox);
|
||||||
|
this.appendDummyInput().appendField(
|
||||||
|
Blockly.Msg.sensebox_display_drawRectangle
|
||||||
|
);
|
||||||
|
this.appendValueInput("X")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_x)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendValueInput("Y")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_printDisplay_y)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendValueInput("width")
|
||||||
|
.appendField(Blockly.Msg.sensebox_display_drawRectangle_width)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendValueInput("height")
|
||||||
|
.appendField(Blockly.Msg.sensebox_display_drawRectangle_height)
|
||||||
|
.setCheck(Types.NUMBER.compatibleTypes);
|
||||||
|
this.appendDummyInput("fill")
|
||||||
|
.appendField(Blockly.Msg.senseBox_display_filled)
|
||||||
|
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
||||||
|
this.setInputsInline(false);
|
||||||
|
this.setTooltip(Blockly.Msg.senseBox_display_drawRectangle_tooltip);
|
||||||
|
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||||
|
this.setPreviousStatement(true, null);
|
||||||
|
this.setNextStatement(true, null);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Called whenever anything on the workspace changes.
|
||||||
|
* Add warning if block is not nested inside a the correct loop.
|
||||||
|
* @param {!Blockly.Events.Abstract} e Change event.
|
||||||
|
* @this Blockly.Block
|
||||||
|
*/
|
||||||
|
onchange: function (e) {
|
||||||
|
var legal = false;
|
||||||
|
// Is the block nested in a loop?
|
||||||
|
var block = this;
|
||||||
|
do {
|
||||||
|
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
||||||
|
legal = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
block = block.getSurroundParent();
|
||||||
|
} while (block);
|
||||||
|
if (legal) {
|
||||||
|
this.setWarningText(null);
|
||||||
|
} else {
|
||||||
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
LOOP_TYPES: ["sensebox_display_show"],
|
||||||
};
|
};
|
||||||
|
@ -3,42 +3,129 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const sensebox_mcu = {
|
const sensebox_mcu = {
|
||||||
description: 'senseBox Microcontroller Unit based on Microchip SAMD21G18A',
|
description: "senseBox Microcontroller Unit based on Microchip SAMD21G18A",
|
||||||
compilerFlag: 'arduino:samd',
|
compilerFlag: "arduino:samd",
|
||||||
digitalPins: [['D1', '1'], ['D2', '2'], ['D3', '3'], ['D4', '4'], ['D5', '5'], ['D6', '6']],
|
digitalPins: [
|
||||||
digitalPinsLED: [['BUILTIN_1', '7'], ['BUILTIN_2', '8'], ['D1', '1'], ['D2', '2'], ['D3', '3'], ['D4', '4'], ['D5', '5'], ['D6', '6']],
|
["A1", "1"],
|
||||||
digitalPinsButton: [['on Board', '0'], ['D1', '1'], ['D2', '2'], ['D3', '3'], ['D4', '4'], ['D5', '5'], ['D6', '6']],
|
["A2", "2"],
|
||||||
pwmPins: [['D1', '1'], ['D2', '2'], ['D3', '3'], ['D4', '4'], ['D5', '5'], ['D6', '6']],
|
["B3", "3"],
|
||||||
serial: [['serial', 'SerialUSB'], ['serial_1', 'Serial1'], ['serial_2', 'Serial2']],
|
["B4", "4"],
|
||||||
serialPins: {
|
["C5", "5"],
|
||||||
SerialUSB: [['RX', ''], ['TX', '']],
|
["C6", "6"],
|
||||||
Serial1: [['RX', '11'], ['TX', '10']],
|
],
|
||||||
Serial2: [['RX', '13'], ['TX', '12']]
|
digitalPinsLED: [
|
||||||
},
|
["BUILTIN_1", "7"],
|
||||||
serialSpeed: [['300', '300'], ['600', '600'], ['1200', '1200'],
|
["BUILTIN_2", "8"],
|
||||||
['2400', '2400'], ['4800', '4800'], ['9600', '9600'],
|
["A1", "1"],
|
||||||
['14400', '14400'], ['19200', '19200'], ['28800', '28800'],
|
["A2", "2"],
|
||||||
['31250', '31250'], ['38400', '38400'], ['57600', '57600'],
|
["B3", "3"],
|
||||||
['115200', '115200']],
|
["B4", "4"],
|
||||||
spi: [['SPI', 'SPI']],
|
["C5", "5"],
|
||||||
spiPins: { SPI: [['MOSI', '19'], ['MISO', '21'], ['SCK', '20']] },
|
["C6", "6"],
|
||||||
spiClockDivide: [['2 (8MHz)', 'SPI_CLOCK_DIV2'],
|
],
|
||||||
['4 (4MHz)', 'SPI_CLOCK_DIV4'],
|
digitalPinsButton: [
|
||||||
['8 (2MHz)', 'SPI_CLOCK_DIV8'],
|
["on Board", "0"],
|
||||||
['16 (1MHz)', 'SPI_CLOCK_DIV16'],
|
["A1", "1"],
|
||||||
['32 (500KHz)', 'SPI_CLOCK_DIV32'],
|
["A2", "2"],
|
||||||
['64 (250KHz)', 'SPI_CLOCK_DIV64'],
|
["B3", "3"],
|
||||||
['128 (125KHz)', 'SPI_CLOCK_DIV128']],
|
["B4", "4"],
|
||||||
i2c: [['I2C', 'Wire']],
|
["C5", "5"],
|
||||||
i2cPins: { Wire: [['SDA', '17'], ['SCL', '16']] },
|
["C6", "6"],
|
||||||
i2cSpeed: [['100kHz', '100000L'], ['400kHz', '400000L']],
|
],
|
||||||
builtinLed: [['BUILTIN_1', '7'], ['BUILTIN_2', '8']],
|
pwmPins: [
|
||||||
interrupt: [['interrupt1', '1'], ['interrupt2', '2'], ['interrupt3', '3'], ['interrupt4', '4'], ['interrupt5', '5'], ['interrupt6', '6']],
|
["A1", "1"],
|
||||||
analogPins: [['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A4', 'A4'], ['A5', 'A5'], ['A6', 'A6']],
|
["A2", "2"],
|
||||||
serial_baud_rate: 9600,
|
["B3", "3"],
|
||||||
parseKey: '_*_'
|
["B4", "4"],
|
||||||
|
["C5", "5"],
|
||||||
|
["C6", "6"],
|
||||||
|
],
|
||||||
|
serial: [
|
||||||
|
["serial", "SerialUSB"],
|
||||||
|
["serial_1", "Serial1"],
|
||||||
|
["serial_2", "Serial2"],
|
||||||
|
],
|
||||||
|
serialPins: {
|
||||||
|
SerialUSB: [
|
||||||
|
["RX", ""],
|
||||||
|
["TX", ""],
|
||||||
|
],
|
||||||
|
Serial1: [
|
||||||
|
["RX", "11"],
|
||||||
|
["TX", "10"],
|
||||||
|
],
|
||||||
|
Serial2: [
|
||||||
|
["RX", "13"],
|
||||||
|
["TX", "12"],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
serialSpeed: [
|
||||||
|
["300", "300"],
|
||||||
|
["600", "600"],
|
||||||
|
["1200", "1200"],
|
||||||
|
["2400", "2400"],
|
||||||
|
["4800", "4800"],
|
||||||
|
["9600", "9600"],
|
||||||
|
["14400", "14400"],
|
||||||
|
["19200", "19200"],
|
||||||
|
["28800", "28800"],
|
||||||
|
["31250", "31250"],
|
||||||
|
["38400", "38400"],
|
||||||
|
["57600", "57600"],
|
||||||
|
["115200", "115200"],
|
||||||
|
],
|
||||||
|
spi: [["SPI", "SPI"]],
|
||||||
|
spiPins: {
|
||||||
|
SPI: [
|
||||||
|
["MOSI", "19"],
|
||||||
|
["MISO", "21"],
|
||||||
|
["SCK", "20"],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
spiClockDivide: [
|
||||||
|
["2 (8MHz)", "SPI_CLOCK_DIV2"],
|
||||||
|
["4 (4MHz)", "SPI_CLOCK_DIV4"],
|
||||||
|
["8 (2MHz)", "SPI_CLOCK_DIV8"],
|
||||||
|
["16 (1MHz)", "SPI_CLOCK_DIV16"],
|
||||||
|
["32 (500KHz)", "SPI_CLOCK_DIV32"],
|
||||||
|
["64 (250KHz)", "SPI_CLOCK_DIV64"],
|
||||||
|
["128 (125KHz)", "SPI_CLOCK_DIV128"],
|
||||||
|
],
|
||||||
|
i2c: [["I2C", "Wire"]],
|
||||||
|
i2cPins: {
|
||||||
|
Wire: [
|
||||||
|
["SDA", "17"],
|
||||||
|
["SCL", "16"],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
i2cSpeed: [
|
||||||
|
["100kHz", "100000L"],
|
||||||
|
["400kHz", "400000L"],
|
||||||
|
],
|
||||||
|
builtinLed: [
|
||||||
|
["BUILTIN_1", "7"],
|
||||||
|
["BUILTIN_2", "8"],
|
||||||
|
],
|
||||||
|
interrupt: [
|
||||||
|
["interrupt1", "1"],
|
||||||
|
["interrupt2", "2"],
|
||||||
|
["interrupt3", "3"],
|
||||||
|
["interrupt4", "4"],
|
||||||
|
["interrupt5", "5"],
|
||||||
|
["interrupt6", "6"],
|
||||||
|
],
|
||||||
|
analogPins: [
|
||||||
|
["A1", "A1"],
|
||||||
|
["A2", "A2"],
|
||||||
|
["B3", "A3"],
|
||||||
|
["B4", "A4"],
|
||||||
|
["C5", "A5"],
|
||||||
|
["C6", "A6"],
|
||||||
|
],
|
||||||
|
serial_baud_rate: 9600,
|
||||||
|
parseKey: "_*_",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const selectedBoard = () => {
|
export const selectedBoard = () => {
|
||||||
return sensebox_mcu;
|
return sensebox_mcu;
|
||||||
};
|
};
|
||||||
|
@ -1,50 +1,64 @@
|
|||||||
export const LOGIC = {
|
export const LOGIC = {
|
||||||
|
CONTROLS_IF_ELSEIF_TOOLTIP: "Eine weitere Bedingung hinzufügen.",
|
||||||
|
CONTROLS_IF_ELSE_TOOLTIP:
|
||||||
|
"Eine sonst-Bedingung hinzufügen, führt eine Anweisung aus, falls keine Bedingung zutrifft.",
|
||||||
|
CONTROLS_IF_HELPURL: "https://github.com/google/blockly/wiki/IfElse", // untranslated
|
||||||
|
CONTROLS_IF_IF_TOOLTIP: "Hinzufügen, entfernen oder sortieren von Sektionen",
|
||||||
|
CONTROLS_IF_MSG_ELSE: "sonst",
|
||||||
|
CONTROLS_IF_MSG_ELSEIF: "sonst wenn",
|
||||||
|
CONTROLS_IF_MSG_IF: "wenn",
|
||||||
|
CONTROLS_IF_TOOLTIP_1:
|
||||||
|
"Wenn eine Bedingung wahr (true) ist, dann führe eine Anweisung aus.",
|
||||||
|
CONTROLS_IF_TOOLTIP_2:
|
||||||
|
"Wenn eine Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Ansonsten führe die zweite Anweisung aus.",
|
||||||
|
CONTROLS_IF_TOOLTIP_3:
|
||||||
|
"Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus.",
|
||||||
|
CONTROLS_IF_TOOLTIP_4:
|
||||||
|
"Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus. Falls keine der beiden Bedingungen wahr (true) ist, dann führe die dritte Anweisung aus.",
|
||||||
|
LOGIC_BOOLEAN_HELPURL: "https://github.com/google/blockly/wiki/Logic#values", // untranslated
|
||||||
|
LOGIC_BOOLEAN_TOOLTIP: "Ist entweder wahr (true) oder falsch (false)",
|
||||||
|
LOGIC_BOOLEAN_TRUE: "wahr",
|
||||||
|
LOGIC_COMPARE_HELPURL: "https://de.wikipedia.org/wiki/Vergleich_%28Zahlen%29",
|
||||||
|
LOGIC_COMPARE_TOOLTIP_EQ: "Ist wahr (true), wenn beide Werte gleich sind.",
|
||||||
|
LOGIC_COMPARE_TOOLTIP_GT:
|
||||||
|
"Ist wahr (true), wenn der erste Wert größer als der zweite Wert ist.",
|
||||||
|
LOGIC_COMPARE_TOOLTIP_GTE:
|
||||||
|
"Ist wahr (true), wenn der erste Wert größer als oder gleich groß wie der zweite Wert ist.",
|
||||||
|
LOGIC_COMPARE_TOOLTIP_LT:
|
||||||
|
"Ist wahr (true), wenn der erste Wert kleiner als der zweite Wert ist.",
|
||||||
|
LOGIC_COMPARE_TOOLTIP_LTE:
|
||||||
|
"Ist wahr (true), wenn der erste Wert kleiner als oder gleich groß wie der zweite Wert ist.",
|
||||||
|
LOGIC_COMPARE_TOOLTIP_NEQ:
|
||||||
|
"Ist wahr (true), wenn beide Werte unterschiedlich sind.",
|
||||||
|
LOGIC_NEGATE_HELPURL: "https://github.com/google/blockly/wiki/Logic#not", // untranslated
|
||||||
|
LOGIC_NEGATE_TITLE: "nicht %1",
|
||||||
|
LOGIC_NEGATE_TOOLTIP:
|
||||||
|
"Ist wahr (true), wenn der Eingabewert falsch (false) ist. Ist falsch (false), wenn der Eingabewert wahr (true) ist.",
|
||||||
|
LOGIC_NULL: "null",
|
||||||
|
LOGIC_NULL_HELPURL: "https://de.wikipedia.org/wiki/Nullwert",
|
||||||
|
LOGIC_NULL_TOOLTIP: "Ist NULL.",
|
||||||
|
LOGIC_OPERATION_AND: "und",
|
||||||
|
LOGIC_OPERATION_HELPURL:
|
||||||
|
"https://github.com/google/blockly/wiki/Logic#logical-operations", // untranslated
|
||||||
|
LOGIC_OPERATION_OR: "oder",
|
||||||
|
LOGIC_OPERATION_TOOLTIP_AND:
|
||||||
|
"Ist wahr (true), wenn beide Werte wahr (true) sind.",
|
||||||
|
LOGIC_OPERATION_TOOLTIP_OR:
|
||||||
|
"Ist wahr (true), wenn einer der beiden Werte wahr (true) ist.",
|
||||||
|
LOGIC_TERNARY_CONDITION: "teste",
|
||||||
|
LOGIC_TERNARY_HELPURL: "https://de.wikipedia.org/wiki/%3F:#Auswahloperator",
|
||||||
|
LOGIC_TERNARY_IF_FALSE: "wenn falsch",
|
||||||
|
LOGIC_TERNARY_IF_TRUE: "wenn wahr",
|
||||||
|
LOGIC_TERNARY_TOOLTIP:
|
||||||
|
'Überprüft eine Bedingung "teste". Wenn die Bedingung wahr ist, wird der "wenn wahr" Wert zurückgegeben, andernfalls der "wenn falsch" Wert',
|
||||||
|
|
||||||
CONTROLS_IF_ELSEIF_TOOLTIP: "Eine weitere Bedingung hinzufügen.",
|
/**
|
||||||
CONTROLS_IF_ELSE_TOOLTIP: "Eine sonst-Bedingung hinzufügen, führt eine Anweisung aus, falls keine Bedingung zutrifft.",
|
* Cases
|
||||||
CONTROLS_IF_HELPURL: "https://github.com/google/blockly/wiki/IfElse", // untranslated
|
*/
|
||||||
CONTROLS_IF_IF_TOOLTIP: "Hinzufügen, entfernen oder sortieren von Sektionen",
|
cases_do: "Führe aus",
|
||||||
CONTROLS_IF_MSG_ELSE: "sonst",
|
cases_condition: "Fall (Variable): ",
|
||||||
CONTROLS_IF_MSG_ELSEIF: "sonst wenn",
|
cases_switch: "Variable",
|
||||||
CONTROLS_IF_MSG_IF: "wenn",
|
cases_add: "Fall",
|
||||||
CONTROLS_IF_TOOLTIP_1: "Wenn eine Bedingung wahr (true) ist, dann führe eine Anweisung aus.",
|
cases_tooltip:
|
||||||
CONTROLS_IF_TOOLTIP_2: "Wenn eine Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Ansonsten führe die zweite Anweisung aus.",
|
"Führt den entsprechenden Fall aus, wenn die Überprüfung der Variable TRUE ergibt. Über das Zahnrad kannst du weitere Fälle hinzufügen. Über den 'Default' fall kannst du bestimmen, was passieren soll wenn keiner der vorher definierten Fälle eingetreten ist.",
|
||||||
CONTROLS_IF_TOOLTIP_3: "Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus.",
|
};
|
||||||
CONTROLS_IF_TOOLTIP_4: "Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus. Falls keine der beiden Bedingungen wahr (true) ist, dann führe die dritte Anweisung aus.",
|
|
||||||
LOGIC_BOOLEAN_HELPURL: "https://github.com/google/blockly/wiki/Logic#values", // untranslated
|
|
||||||
LOGIC_BOOLEAN_TOOLTIP: "Ist entweder wahr (true) oder falsch (false)",
|
|
||||||
LOGIC_BOOLEAN_TRUE: "wahr",
|
|
||||||
LOGIC_COMPARE_HELPURL: "https://de.wikipedia.org/wiki/Vergleich_%28Zahlen%29",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_EQ: "Ist wahr (true), wenn beide Werte gleich sind.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_GT: "Ist wahr (true), wenn der erste Wert größer als der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_GTE: "Ist wahr (true), wenn der erste Wert größer als oder gleich groß wie der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_LT: "Ist wahr (true), wenn der erste Wert kleiner als der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_LTE: "Ist wahr (true), wenn der erste Wert kleiner als oder gleich groß wie der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_NEQ: "Ist wahr (true), wenn beide Werte unterschiedlich sind.",
|
|
||||||
LOGIC_NEGATE_HELPURL: "https://github.com/google/blockly/wiki/Logic#not", // untranslated
|
|
||||||
LOGIC_NEGATE_TITLE: "nicht %1",
|
|
||||||
LOGIC_NEGATE_TOOLTIP: "Ist wahr (true), wenn der Eingabewert falsch (false) ist. Ist falsch (false), wenn der Eingabewert wahr (true) ist.",
|
|
||||||
LOGIC_NULL: "null",
|
|
||||||
LOGIC_NULL_HELPURL: "https://de.wikipedia.org/wiki/Nullwert",
|
|
||||||
LOGIC_NULL_TOOLTIP: "Ist NULL.",
|
|
||||||
LOGIC_OPERATION_AND: "und",
|
|
||||||
LOGIC_OPERATION_HELPURL: "https://github.com/google/blockly/wiki/Logic#logical-operations", // untranslated
|
|
||||||
LOGIC_OPERATION_OR: "oder",
|
|
||||||
LOGIC_OPERATION_TOOLTIP_AND: "Ist wahr (true), wenn beide Werte wahr (true) sind.",
|
|
||||||
LOGIC_OPERATION_TOOLTIP_OR: "Ist wahr (true), wenn einer der beiden Werte wahr (true) ist.",
|
|
||||||
LOGIC_TERNARY_CONDITION: "teste",
|
|
||||||
LOGIC_TERNARY_HELPURL: "https://de.wikipedia.org/wiki/%3F:#Auswahloperator",
|
|
||||||
LOGIC_TERNARY_IF_FALSE: "wenn falsch",
|
|
||||||
LOGIC_TERNARY_IF_TRUE: "wenn wahr",
|
|
||||||
LOGIC_TERNARY_TOOLTIP: "Überprüft eine Bedingung \"teste\". Wenn die Bedingung wahr ist, wird der \"wenn wahr\" Wert zurückgegeben, andernfalls der \"wenn falsch\" Wert",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cases
|
|
||||||
*/
|
|
||||||
cases_do: "Führe aus",
|
|
||||||
cases_condition: "Fall (Variable): ",
|
|
||||||
cases_switch: "Variable",
|
|
||||||
cases_add: "Fall",
|
|
||||||
cases_tooltip: "Führt den entsprechenden Fall aus, wenn die Überprüfung der Variable TRUE ergibt. Über das Zahnrad kannst du weitere Fälle hinzufügen. Über den 'Default' fall kannst du bestimmen, was passieren soll wenn keiner der vorher definierten Fälle eingetreten ist.",
|
|
||||||
}
|
|
||||||
|
@ -244,7 +244,7 @@ export const TRANSLATIONS = {
|
|||||||
senseBox_serial_tip:
|
senseBox_serial_tip:
|
||||||
"Gibt Messwerte oder Daten auf dem Seriellen Monitor der Arduino IDE aus. Praktisch um ohne Display zu arbeiten",
|
"Gibt Messwerte oder Daten auf dem Seriellen Monitor der Arduino IDE aus. Praktisch um ohne Display zu arbeiten",
|
||||||
senseBox_output_timestamp: "Zeitstempel (RFC 3339)",
|
senseBox_output_timestamp: "Zeitstempel (RFC 3339)",
|
||||||
senseBox_led: "LED an digitalen",
|
senseBox_led: "LED an",
|
||||||
senseBox_led_tip:
|
senseBox_led_tip:
|
||||||
"Einfache LED. Beim Anschluss sollte immer ein Vorwiderstand verwendet werden",
|
"Einfache LED. Beim Anschluss sollte immer ein Vorwiderstand verwendet werden",
|
||||||
senseBox_piezo: "Piezo an digital",
|
senseBox_piezo: "Piezo an digital",
|
||||||
|
@ -1,45 +1,45 @@
|
|||||||
export const LED = {
|
export const LED = {
|
||||||
|
senseBox_led: "LED connected to",
|
||||||
|
senseBox_led_tip: "simple LED. Don't forget the resistor",
|
||||||
|
|
||||||
|
senseBox_rgb_led: "RGB-LED",
|
||||||
|
senseBox_rgb_led_tip: "RGB-LED",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WS2818 RGB LED
|
||||||
|
*/
|
||||||
|
senseBox_ws2818_rgb_led: "Set RGB-LED at",
|
||||||
|
senseBox_ws2818_rgb_led_init: "Initialise RGB LED (WS2818)",
|
||||||
|
senseBox_ws2818_rgb_led_position: "Position",
|
||||||
|
senseBox_ws2818_rgb_led_brightness: "Brightness",
|
||||||
|
senseBox_ws2818_rgb_led_tooltip:
|
||||||
|
"Change the color of your RGB LED with this block. Link a block for the color. If multiple RGB LEDs are chained together you can use the position to determine which LED is controlled.",
|
||||||
|
senseBox_ws2818_rgb_led_init_tooltip:
|
||||||
|
"Connect the RGB LED to one of the three **digital/analog ports**. If multiple RGB LEDs are daisy-chained together you can determine which LED is controlled by position.",
|
||||||
|
senseBox_ws2818_rgb_led_color: "Color",
|
||||||
|
senseBox_ws2818_rgb_led_number: "Number",
|
||||||
|
|
||||||
senseBox_led: "LED connected to digital",
|
/**
|
||||||
senseBox_led_tip: "simple LED. Don't forget the resistor",
|
* Color
|
||||||
|
*/
|
||||||
|
|
||||||
senseBox_rgb_led: "RGB-LED",
|
COLOUR_BLEND_COLOUR1: "colour 1",
|
||||||
senseBox_rgb_led_tip: "RGB-LED",
|
COLOUR_BLEND_COLOUR2: "colour 2",
|
||||||
|
COLOUR_BLEND_HELPURL: "http://meyerweb.com/eric/tools/color-blend/",
|
||||||
/**
|
COLOUR_BLEND_RATIO: "ratio",
|
||||||
* WS2818 RGB LED
|
COLOUR_BLEND_TITLE: "blend",
|
||||||
*/
|
COLOUR_BLEND_TOOLTIP:
|
||||||
senseBox_ws2818_rgb_led: "Set RGB-LED at",
|
"Blends two colours together with a given ratio (0.0 - 1.0).",
|
||||||
senseBox_ws2818_rgb_led_init: "Initialise RGB LED (WS2818)",
|
COLOUR_PICKER_HELPURL: "https://en.wikipedia.org/wiki/Color",
|
||||||
senseBox_ws2818_rgb_led_position: "Position",
|
COLOUR_PICKER_TOOLTIP: "Choose a colour from the palette.",
|
||||||
senseBox_ws2818_rgb_led_brightness: "Brightness",
|
COLOUR_RANDOM_HELPURL: "http://randomcolour.com",
|
||||||
senseBox_ws2818_rgb_led_tooltip: "Change the color of your RGB LED with this block. Link a block for the color. If multiple RGB LEDs are chained together you can use the position to determine which LED is controlled.",
|
COLOUR_RANDOM_TITLE: "random colour",
|
||||||
senseBox_ws2818_rgb_led_init_tooltip: "Connect the RGB LED to one of the three **digital/analog ports**. If multiple RGB LEDs are daisy-chained together you can determine which LED is controlled by position.",
|
COLOUR_RANDOM_TOOLTIP: "Choose a colour at random.",
|
||||||
senseBox_ws2818_rgb_led_color: "Color",
|
COLOUR_RGB_BLUE: "blue",
|
||||||
senseBox_ws2818_rgb_led_number: "Number",
|
COLOUR_RGB_GREEN: "green",
|
||||||
|
COLOUR_RGB_HELPURL: "http://www.december.com/html/spec/colorper.html",
|
||||||
/**
|
COLOUR_RGB_RED: "red",
|
||||||
* Color
|
COLOUR_RGB_TITLE: "colour with",
|
||||||
*/
|
COLOUR_RGB_TOOLTIP:
|
||||||
|
"Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 255.",
|
||||||
COLOUR_BLEND_COLOUR1: "colour 1",
|
};
|
||||||
COLOUR_BLEND_COLOUR2: "colour 2",
|
|
||||||
COLOUR_BLEND_HELPURL: "http://meyerweb.com/eric/tools/color-blend/",
|
|
||||||
COLOUR_BLEND_RATIO: "ratio",
|
|
||||||
COLOUR_BLEND_TITLE: "blend",
|
|
||||||
COLOUR_BLEND_TOOLTIP: "Blends two colours together with a given ratio (0.0 - 1.0).",
|
|
||||||
COLOUR_PICKER_HELPURL: "https://en.wikipedia.org/wiki/Color",
|
|
||||||
COLOUR_PICKER_TOOLTIP: "Choose a colour from the palette.",
|
|
||||||
COLOUR_RANDOM_HELPURL: "http://randomcolour.com",
|
|
||||||
COLOUR_RANDOM_TITLE: "random colour",
|
|
||||||
COLOUR_RANDOM_TOOLTIP: "Choose a colour at random.",
|
|
||||||
COLOUR_RGB_BLUE: "blue",
|
|
||||||
COLOUR_RGB_GREEN: "green",
|
|
||||||
COLOUR_RGB_HELPURL: "http://www.december.com/html/spec/colorper.html",
|
|
||||||
COLOUR_RGB_RED: "red",
|
|
||||||
COLOUR_RGB_TITLE: "colour with",
|
|
||||||
COLOUR_RGB_TOOLTIP: "Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 255.",
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
{
|
{
|
||||||
"id": "bluetooth-bee",
|
"id": "bluetooth-bee",
|
||||||
"name": "Bluetooth-Bee",
|
"name": "Bluetooth-Bee",
|
||||||
"src": "lora-bee.png",
|
"src": "ble-bee.png",
|
||||||
"url": "https://docs.sensebox.de/hardware/bee-ble/"
|
"url": "https://docs.sensebox.de/hardware/bee-ble/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user