update RGB-Block
This commit is contained in:
parent
f6f6d6f1da
commit
48e63fe898
@ -46,4 +46,6 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,9 +19,11 @@ export const onChangeCode = () => (dispatch, getState) => {
|
||||
var selectedBlock = Blockly.selected
|
||||
console.log(selectedBlock)
|
||||
if (selectedBlock !== null) {
|
||||
code.helpurl = selectedBlock.helpUrl
|
||||
code.tooltip = selectedBlock.tooltip
|
||||
} else if (selectedBlock === null) {
|
||||
code.tooltip = "Wähle einen Block aus um dir die Hilfe anzeigen zu lassen"
|
||||
code.helpurl = ''
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ Blockly.Blocks['sensebox_display_beginDisplay'] = {
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_display_beginDisplay_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||
}
|
||||
};
|
||||
|
||||
@ -24,7 +24,7 @@ Blockly.Blocks['sensebox_display_clearDisplay'] = {
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_display_clearDisplay_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||
}
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ Blockly.Blocks['sensebox_display_printDisplay'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||
},
|
||||
/**
|
||||
* Called whenever anything on the workspace changes.
|
||||
@ -99,7 +99,7 @@ Blockly.Blocks['sensebox_display_fastPrint'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.sensebox_display_fastPrint_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||
},
|
||||
/**
|
||||
* Called whenever anything on the workspace changes.
|
||||
@ -160,7 +160,7 @@ Blockly.Blocks['sensebox_display_plotDisplay'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
||||
},
|
||||
/**
|
||||
* Called whenever anything on the workspace changes.
|
||||
@ -221,6 +221,7 @@ Blockly.Blocks['sensebox_display_fillCircle'] = {
|
||||
.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);
|
||||
},
|
||||
@ -272,6 +273,7 @@ Blockly.Blocks['sensebox_display_drawRectangle'] = {
|
||||
.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);
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as Blockly from 'blockly';
|
||||
import { getColour } from '../helpers/colour'
|
||||
import { selectedBoard } from '../helpers/board'
|
||||
|
||||
import * as Types from '../helpers/types'
|
||||
|
||||
|
||||
Blockly.Blocks['sensebox_led'] = {
|
||||
@ -15,7 +15,7 @@ Blockly.Blocks['sensebox_led'] = {
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_on, "HIGH"], [Blockly.Msg.senseBox_off, "LOW"]]), "STAT");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_led_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_led_tooltip);
|
||||
}
|
||||
};
|
||||
|
||||
@ -35,11 +35,31 @@ Blockly.Blocks['sensebox_rgb_led'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_rgb_led_tip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Blockly.Blocks['sensebox_ws2818_led_init'] = {
|
||||
init: function () {
|
||||
|
||||
var dropdownOptions = [[Blockly.Msg.senseBox_ultrasonic_port_A, '1'],
|
||||
[Blockly.Msg.senseBox_ultrasonic_port_B, '3'], [Blockly.Msg.senseBox_ultrasonic_port_C, '5']];
|
||||
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led_init)
|
||||
.appendField("Port:")
|
||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
||||
this.appendValueInput("BRIGHTNESS", "brightness")
|
||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_brightness));
|
||||
this.appendValueInput("NUMBER", "number")
|
||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_number));
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_ws2818_rgb_led_init_tooltip);
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['sensebox_ws2818_led'] = {
|
||||
init: function () {
|
||||
|
||||
@ -51,19 +71,106 @@ Blockly.Blocks['sensebox_ws2818_led'] = {
|
||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led)
|
||||
.appendField("Port:")
|
||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
||||
this.appendValueInput("BRIGHTNESS", "brightness")
|
||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_brightness));
|
||||
this.appendValueInput("POSITION", "position")
|
||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_position));
|
||||
this.appendValueInput("RED", 'Number')
|
||||
.appendField(Blockly.Msg.COLOUR_RGB_RED);//Blockly.Msg.senseBox_basic_red
|
||||
this.appendValueInput("GREEN", 'Number')
|
||||
.appendField(Blockly.Msg.COLOUR_RGB_GREEN);//Blockly.Msg.senseBox_basic_green
|
||||
this.appendValueInput("BLUE", 'Number')
|
||||
.appendField(Blockly.Msg.COLOUR_RGB_BLUE);
|
||||
this.appendValueInput("COLOR", 'Number')
|
||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led_color)
|
||||
.setCheck("Colour");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_rgb_led_tip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setTooltip(Blockly.Msg.senseBox_ws2818_rgb_led_tooltip);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
||||
// Block for colour picker.
|
||||
{
|
||||
"type": "colour_picker",
|
||||
"message0": "%1",
|
||||
"args0": [
|
||||
{
|
||||
"type": "field_colour",
|
||||
"name": "COLOUR",
|
||||
"colour": "#ff0000"
|
||||
}
|
||||
],
|
||||
"output": "Colour",
|
||||
"helpUrl": "%{BKY_COLOUR_PICKER_HELPURL}",
|
||||
"colour": getColour().sensebox,
|
||||
"tooltip": "%{BKY_COLOUR_PICKER_TOOLTIP}",
|
||||
"extensions": ["parent_tooltip_when_inline"]
|
||||
},
|
||||
|
||||
// Block for random colour.
|
||||
{
|
||||
"type": "colour_random",
|
||||
"message0": "%{BKY_COLOUR_RANDOM_TITLE}",
|
||||
"output": "Colour",
|
||||
"helpUrl": "%{BKY_COLOUR_RANDOM_HELPURL}",
|
||||
"colour": getColour().sensebox,
|
||||
"tooltip": "%{BKY_COLOUR_RANDOM_TOOLTIP}"
|
||||
},
|
||||
|
||||
// Block for composing a colour from RGB components.
|
||||
{
|
||||
"type": "colour_rgb",
|
||||
"message0": "%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "RED",
|
||||
"check": Types.getCompatibleTypes('int'),
|
||||
"align": "RIGHT"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "GREEN",
|
||||
"check": Types.getCompatibleTypes('int'),
|
||||
"align": "RIGHT"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "BLUE",
|
||||
"check": Types.getCompatibleTypes('int'),
|
||||
"align": "RIGHT"
|
||||
}
|
||||
],
|
||||
"output": "Colour",
|
||||
"helpUrl": "%{BKY_COLOUR_RGB_HELPURL}",
|
||||
"colour": getColour().sensebox,
|
||||
"tooltip": "%{BKY_COLOUR_RGB_TOOLTIP}"
|
||||
},
|
||||
|
||||
// Block for blending two colours together.
|
||||
{
|
||||
"type": "colour_blend",
|
||||
"message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} " +
|
||||
"%1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "COLOUR1",
|
||||
"check": "Colour",
|
||||
"align": "RIGHT"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "COLOUR2",
|
||||
"check": "Colour",
|
||||
"align": "RIGHT"
|
||||
},
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "RATIO",
|
||||
"check": "Number",
|
||||
"align": "RIGHT"
|
||||
}
|
||||
],
|
||||
"output": "Colour",
|
||||
"helpUrl": "%{BKY_COLOUR_BLEND_HELPURL}",
|
||||
"style": "colour_blocks",
|
||||
"tooltip": "%{BKY_COLOUR_BLEND_TOOLTIP}"
|
||||
}
|
||||
]); // END JSON EXTRACT (Do not delete this comment.)
|
||||
|
||||
|
@ -15,8 +15,8 @@ Blockly.Blocks['sensebox_sd_open_file'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setTooltip(Blockly.Msg.senseBox_sd_open_file_tooltip);
|
||||
this.setHelpUrl('https://docs.sensebox.de/hardware/bee-sd/');
|
||||
}
|
||||
};
|
||||
|
||||
@ -32,8 +32,8 @@ Blockly.Blocks['sensebox_sd_create_file'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setTooltip(Blockly.Msg.senseBox_sd_create_file_tooltip);
|
||||
this.setHelpUrl('https://docs.sensebox.de/hardware/bee-sd/');
|
||||
}
|
||||
};
|
||||
|
||||
@ -50,8 +50,8 @@ Blockly.Blocks['sensebox_sd_write_file'] = {
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
this.setTooltip(Blockly.Msg.senseBox_sd_write_file_tooltip);
|
||||
this.setHelpUrl('https://docs.sensebox.de/hardware/bee-sd/');
|
||||
},
|
||||
/**
|
||||
* Called whenever anything on the workspace changes.
|
||||
|
@ -18,7 +18,7 @@ Blockly.Blocks['sensebox_sensor_temp_hum'] = {
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_temp, "Temperature"], [Blockly.Msg.senseBox_hum, "Humidity"]]), "NAME");
|
||||
this.setOutput(true, Types.DECIMAL.typeName);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_temp_hum_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_temp_hum_tooltip);
|
||||
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||
}
|
||||
};
|
||||
@ -39,7 +39,7 @@ Blockly.Blocks['sensebox_sensor_uv_light'] = {
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_light, "Illuminance"], [Blockly.Msg.senseBox_uv, "UvIntensity"]]), "NAME");
|
||||
this.setOutput(true, Types.DECIMAL.typeName);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_uv_light_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_uv_light_tooltip);
|
||||
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||
}
|
||||
};
|
||||
@ -62,7 +62,7 @@ Blockly.Blocks['sensebox_sensor_bmx055_accelerometer'] = {
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_bmx055_accelerometer_range_2g, "0x3"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_4g, "0x5"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_8g, "0x8"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_16g, "0x0C"]]), "RANGE");
|
||||
this.setOutput(true, Types.DECIMAL.typeName);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tooltip);
|
||||
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||
}
|
||||
};
|
||||
@ -84,7 +84,7 @@ Blockly.Blocks['sensebox_sensor_sds011'] = {
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_sds011_serial1, "Serial1"], [Blockly.Msg.senseBox_sds011_serial2, "Serial2"]]), "SERIAL");
|
||||
this.setOutput(true, Types.DECIMAL.typeName);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_sds011_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_sds011_tooltip);
|
||||
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||
}
|
||||
};
|
||||
@ -209,7 +209,7 @@ Blockly.Blocks['sensebox_sensor_ultrasonic_ranger'] = {
|
||||
.appendField(new Blockly.FieldDropdown(
|
||||
selectedBoard().digitalPins), 'ultrasonic_echo');
|
||||
this.setOutput(true, Types.NUMBER.typeName);
|
||||
this.setTooltip(Blockly.Msg.senseBox_ultrasonic_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_ultrasonic_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
},
|
||||
/**
|
||||
@ -295,7 +295,7 @@ Blockly.Blocks['sensebox_button'] = {
|
||||
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPinsButton), "PIN");
|
||||
this.setOutput(true, Types.BOOLEAN.typeName);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setTooltip(Blockly.Msg.senseBox_button_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_button_tooltip);
|
||||
this.setHelpUrl('https://sensebox.de/books');
|
||||
}
|
||||
};
|
||||
|
@ -12,6 +12,7 @@ Blockly.Blocks["sensebox_telegram"] = {
|
||||
.appendField("telegram")
|
||||
.appendField(new Blockly.FieldTextInput("token"), "telegram_token");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_telegram_init_tooltip);
|
||||
this.setNextStatement(true, null);
|
||||
}
|
||||
};
|
||||
@ -24,6 +25,7 @@ Blockly.Blocks["sensebox_telegram_do"] = {
|
||||
this.appendStatementInput("telegram_do");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_telegram_do_tooltip)
|
||||
}
|
||||
};
|
||||
|
||||
@ -36,6 +38,7 @@ Blockly.Blocks["sensebox_telegram_do_on_message"] = {
|
||||
.appendField(Blockly.Msg.senseBox_telegram_message)
|
||||
.appendField(new Blockly.FieldTextInput("/message"), 'telegram_message');
|
||||
this.appendStatementInput("telegram_do_on_message").setCheck(null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_telegram_message_tooltip)
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
}
|
||||
@ -46,8 +49,10 @@ Blockly.Blocks["sensebox_telegram_send"] = {
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput().appendField(Blockly.Msg.senseBox_telegram_send);
|
||||
this.appendValueInput("telegram_text_to_send").setCheck(null);
|
||||
this.setTooltip(Blockly.Msg.senseBox_telegram_send_tooltip)
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
|
||||
},
|
||||
LOOP_TYPES: ["sensebox_telegram_do_on_message"]
|
||||
};
|
@ -3,7 +3,7 @@ import { getColour } from '../helpers/colour'
|
||||
|
||||
Blockly.Blocks['sensebox_wifi'] = {
|
||||
init: function () {
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_tooltip);
|
||||
this.setHelpUrl('');
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput()
|
||||
@ -16,6 +16,7 @@ Blockly.Blocks['sensebox_wifi'] = {
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.senseBox_output_password)
|
||||
.appendField(new Blockly.FieldTextInput("Password"), "Password");
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_wifi_helpurl)
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
},
|
||||
@ -43,7 +44,7 @@ Blockly.Blocks['sensebox_wifi'] = {
|
||||
|
||||
Blockly.Blocks['sensebox_startap'] = {
|
||||
init: function () {
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_tip);
|
||||
this.setTooltip(Blockly.Msg.senseBox_wifi_startap_tooltip);
|
||||
this.setHelpUrl('');
|
||||
this.setColour(getColour().sensebox);
|
||||
this.appendDummyInput()
|
||||
@ -52,6 +53,7 @@ Blockly.Blocks['sensebox_startap'] = {
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.senseBox_wifi_ssid)
|
||||
.appendField(new Blockly.FieldTextInput("SSID"), "SSID");
|
||||
this.setHelpUrl(Blockly.Msg.senseBox_wifi_helpurl)
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
}
|
||||
|
@ -22,25 +22,54 @@ Blockly.Arduino.sensebox_rgb_led = function () {
|
||||
};
|
||||
|
||||
|
||||
Blockly.Arduino.sensebox_ws2818_led = function () {
|
||||
Blockly.Arduino.sensebox_ws2818_led_init = function () {
|
||||
var dropdown_pin = this.getFieldValue('Port');
|
||||
var blocks = Blockly.mainWorkspace.getAllBlocks();
|
||||
var count = 0;
|
||||
for (var i = 0; i < blocks.length; i++) {
|
||||
if (blocks[i].type === 'sensebox_ws2818_led' && blocks[i].getFieldValue('Port') === dropdown_pin) {
|
||||
count++;
|
||||
|
||||
}
|
||||
}
|
||||
var numPixel = count;
|
||||
var numPixel = Blockly.Arduino.valueToCode(this, 'NUMBER', Blockly.Arduino.ORDER_ATOMIC) || '1';
|
||||
var brightness = Blockly.Arduino.valueToCode(this, 'BRIGHTNESS', Blockly.Arduino.ORDER_ATOMIC) || '50'
|
||||
var position = Blockly.Arduino.valueToCode(this, 'POSITION', Blockly.Arduino.ORDER_ATOMIC) || '0';
|
||||
var red = Blockly.Arduino.valueToCode(this, 'RED', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
var green = Blockly.Arduino.valueToCode(this, 'GREEN', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
var blue = Blockly.Arduino.valueToCode(this, 'BLUE', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
Blockly.Arduino.definitions_['define_rgb_led' + dropdown_pin] = `#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_${dropdown_pin}= Adafruit_NeoPixel(${numPixel}, ${dropdown_pin},NEO_GRB + NEO_KHZ800);\n`;
|
||||
Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();\n';
|
||||
Blockly.Arduino.setupCode_['setup_rgb_led_brightness' + dropdown_pin] = `rgb_led_${dropdown_pin}.setBrightness(${brightness});\n`;
|
||||
var code = `rgb_led_${dropdown_pin}.setPixelColor(${position},rgb_led_${dropdown_pin}.Color(${red},${green},${blue}));\nrgb_led_${dropdown_pin}.show();\n`;
|
||||
return '';
|
||||
};
|
||||
|
||||
Blockly.Arduino.sensebox_ws2818_led = function () {
|
||||
var dropdown_pin = this.getFieldValue('Port');
|
||||
var position = Blockly.Arduino.valueToCode(this, 'POSITION', Blockly.Arduino.ORDER_ATOMIC) || '0';
|
||||
// var red = Blockly.Arduino.valueToCode(this, 'RED', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
// var green = Blockly.Arduino.valueToCode(this, 'GREEN', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
//var blue = Blockly.Arduino.valueToCode(this, 'BLUE', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
//var code = `rgb_led_${dropdown_pin}.setPixelColor(${position},rgb_led_${dropdown_pin}.Color(${red},${green},${blue}));\nrgb_led_${dropdown_pin}.show();\n`;
|
||||
var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||
console.log(color)
|
||||
var code = `rgb_led_${dropdown_pin}.setPixelColor(${position},rgb_led_${dropdown_pin}.Color(${color}));\nrgb_led_${dropdown_pin}.show();\n`;
|
||||
return code;
|
||||
};
|
||||
|
||||
|
||||
function hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : null;
|
||||
}
|
||||
|
||||
Blockly.Arduino['colour_picker'] = function (block) {
|
||||
const rgb = hexToRgb(block.getFieldValue('COLOUR'));
|
||||
|
||||
return [rgb.r + ', ' + rgb.g + ', ' + rgb.b, Blockly.Arduino.ORDER_ATOMIC];
|
||||
};
|
||||
|
||||
Blockly.Arduino['colour_random'] = function (block) {
|
||||
return ['random(0, 255), random(0, 255), random(0, 255)', Blockly.Arduino.ORDER_ATOMIC];
|
||||
};
|
||||
|
||||
Blockly.Arduino['colour_rgb'] = function (block) {
|
||||
const red = Blockly.Arduino.valueToCode(block, 'RED', Blockly.Arduino.ORDER_ATOMIC);
|
||||
const green = Blockly.Arduino.valueToCode(block, 'GREEN', Blockly.Arduino.ORDER_ATOMIC);
|
||||
const blue = Blockly.Arduino.valueToCode(block, 'BLUE', Blockly.Arduino.ORDER_ATOMIC);
|
||||
|
||||
return [red + ', ' + green + ', ' + blue, Blockly.Arduino.ORDER_ATOMIC];
|
||||
};
|
@ -15,16 +15,16 @@ Blockly.Msg.COLOUR_BLEND_RATIO = "im Verhältnis";
|
||||
Blockly.Msg.COLOUR_BLEND_TITLE = "mische";
|
||||
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Vermische 2 Farben mit konfigurierbaren Farbverhältnis (0.0 - 1.0).";
|
||||
Blockly.Msg.COLOUR_PICKER_HELPURL = "https://de.wikipedia.org/wiki/Farbe";
|
||||
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Wähle eine Farbe aus der Palette.";
|
||||
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Wähle eine Farbe aus der Palette. Die Farbe wird automatisch in RGB-Werte konvertiert.";
|
||||
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
|
||||
Blockly.Msg.COLOUR_RANDOM_TITLE = "zufällige Farbe";
|
||||
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Wähle eine Farbe nach dem Zufallsprinzip.";
|
||||
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Erstelle eine Farbe nach dem Zufallsprinzip.";
|
||||
Blockly.Msg.COLOUR_RGB_BLUE = "blau";
|
||||
Blockly.Msg.COLOUR_RGB_GREEN = "grün";
|
||||
Blockly.Msg.COLOUR_RGB_HELPURL = "https://de.wikipedia.org/wiki/RGB-Farbraum";
|
||||
Blockly.Msg.COLOUR_RGB_RED = "rot";
|
||||
Blockly.Msg.COLOUR_RGB_TITLE = "Farbe mit";
|
||||
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Erstelle eine Farbe mit selbst definierten Rot-, Grün- und Blauwerten. Alle Werte müssen zwischen 0 und 100 liegen.";
|
||||
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Erstelle eine Farbe mit selbst definierten Rot-, Grün- und Blauwerten. Alle Werte müssen zwischen 0 und 255 liegen. 0 ist hierbei die geringte Intensität der Farbe 255 die höchste.";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://de.wikipedia.org/wiki/Kontrollstruktur";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "Die Schleife abbrechen";
|
||||
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "mit der nächsten Iteration der Schleife fortfahren";
|
||||
@ -408,7 +408,7 @@ Blockly.Msg.ARD_DIGITALWRITE = "setzte digitalen Pin#";
|
||||
Blockly.Msg.ARD_DIGITALWRITE_TIP = "Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port";
|
||||
Blockly.Msg.ARD_FUN_RUN_LOOP = "Endlosschleife()";
|
||||
Blockly.Msg.ARD_FUN_RUN_SETUP = "Setup()";
|
||||
Blockly.Msg.ARD_FUN_RUN_TIP = "Definiert die setup() und loop() Funktionen";
|
||||
Blockly.Msg.ARD_FUN_RUN_TIP = "Definiert die setup() und loop() Funktionen. Die setup()-Funktion wird beim starten **einmal** ausgeführt. Anschließend wir die loop()-Funktion in einer **Endlosschleife** ausgeführt. Füge in die Setup()-Funktion Blöcke ein, um z.B. das Display zu initalisieren, eine Verbindung zum WiFi-Netzwerk herzustellen oder um die LoRa Verbindung zu initialsieren.";
|
||||
Blockly.Msg.ARD_HIGH = "HIGH";
|
||||
Blockly.Msg.ARD_HIGHLOW_TIP = "Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.";
|
||||
Blockly.Msg.ARD_LOW = "LOW";
|
||||
@ -526,12 +526,21 @@ Blockly.Msg.senseBox_on = "Ein";
|
||||
Blockly.Msg.senseBox_sensor = "Sensoren"
|
||||
Blockly.Msg.senseBox_output_filename = "Daten";
|
||||
Blockly.Msg.senseBox_output_format = "Format:";
|
||||
|
||||
/**
|
||||
* SD-Block
|
||||
*/
|
||||
Blockly.Msg.senseBox_sd_create_file = "Erstelle Datei auf SD-Karte";
|
||||
Blockly.Msg.senseBox_sd_write_file = " Schreibe Daten auf SD-Karte";
|
||||
Blockly.Msg.senseBox_sd_write_file = "Schreibe Daten auf SD-Karte";
|
||||
Blockly.Msg.senseBox_sd_open_file = "Öffne eine Datei auf der SD-Karte";
|
||||
Blockly.Msg.senseBox_sd_create_file_tooltip = "Erstellt eine Datei auf der Karte. Stecke das SD-Bee auf den Steckplatz **XBEE2**. Die **maximale** Länge des Dateinamen sind **8 Zeichen**. Die Datei sollte zuerst im *Setup()* erstellt werden"
|
||||
Blockly.Msg.senseBox_sd_write_file_tooptip = "Schreibe Daten auf die SD-Karte. Beachte, dass die Datei zuerst geöffnet werden muss.";
|
||||
Blockly.Msg.senseBox_sd_open_file_tooltip = "Öffne die Datei auf der SD-Karte, um Dateien zu speichern. Am Ende der Schleife wird die Datei automatisch wieder geschlossen.";
|
||||
Blockly.Msg.sensebox_sd_filename = "Daten";
|
||||
Blockly.Msg.senseBox_SD_COMPONENT = "SD-Block";
|
||||
Blockly.Msg.senseBox_sd_decimals = "Dezimalen";
|
||||
|
||||
|
||||
Blockly.Msg.senseBox_output_linebreak = "Zeilenumbruch";
|
||||
Blockly.Msg.senseBox_output_networkid = "NetzwerkID";
|
||||
Blockly.Msg.senseBox_output_password = "Passwort";
|
||||
@ -540,8 +549,7 @@ Blockly.Msg.senseBox_output_safetosd_tip = "Speichert Messwerte auf SD Karte"
|
||||
Blockly.Msg.senseBox_output_serialprint = "Auf Kommandozeile ausgeben";
|
||||
Blockly.Msg.senseBox_serial_tip = "Gibt Messwerte oder Daten auf dem Seriellen Monitor der Arduino IDE aus. Praktisch um ohne Display zu arbeiten";
|
||||
Blockly.Msg.senseBox_output_timestamp = "Zeitstempel";
|
||||
Blockly.Msg.senseBox_button = "Button";
|
||||
Blockly.Msg.senseBox_button_tooltip = "Liest den Zustand des Buttons";
|
||||
|
||||
Blockly.Msg.senseBox_led = "LED an digitalen";
|
||||
Blockly.Msg.senseBox_led_tip = "Einfache LED. Beim Anschluss sollte immer ein Vorwiderstand verwendet werden";
|
||||
Blockly.Msg.senseBox_piezo = "Piezo an digital";
|
||||
@ -572,21 +580,42 @@ Blockly.Msg.senseBox_rgb_led = "RGB-LED"
|
||||
Blockly.Msg.senseBox_rgb_led_tip = "RGB-LED benötigt einen digitalen Pin und eine Stromkreis ";
|
||||
|
||||
|
||||
/**
|
||||
* Temperature and Humidity Sensor (HDC1080)
|
||||
*/
|
||||
Blockly.Msg.senseBox_temp = "Temperatur in °C";
|
||||
Blockly.Msg.senseBox_temp_hum = "Temperatur-/Luftfeuchtigkeitssensor (HDC1080)";
|
||||
Blockly.Msg.senseBox_temp_hum_tip = "Dieser Block gibt dir die Messwerte des Temperatur- und Luftfeuchtigkeitssensor zurück. Schließe den Sensor an einen der 5 I2C Anschlüsse an. Messwert wird mit 2 Nachkommastellen ausgegeben.";
|
||||
Blockly.Msg.senseBox_temp_hum_tooltip = "Dieser Block gibt dir die Messwerte des Temperatur- und Luftfeuchtigkeitssensor zurück. Schließe den Sensor an einen der 5 I2C Anschlüsse an. Messwert wird mit 2 Nachkommastellen ausgegeben.";
|
||||
|
||||
/**
|
||||
* Ultraschalldistanzsensor
|
||||
*/
|
||||
|
||||
Blockly.Msg.senseBox_ultrasonic = "Ultraschall-Abstandssensor an Port";
|
||||
Blockly.Msg.senseBox_ultrasonic_trigger = "Trigger"
|
||||
Blockly.Msg.senseBox_ultrasonic_echo = "Echo"
|
||||
Blockly.Msg.senseBox_ultrasonic_port_A = "A";
|
||||
Blockly.Msg.senseBox_ultrasonic_port_B = "B";
|
||||
Blockly.Msg.senseBox_ultrasonic_port_C = "C";
|
||||
Blockly.Msg.senseBox_ultrasonic_tip = "Misst die Distanz mithilfe von Ultraschall in cm";
|
||||
Blockly.Msg.senseBox_ultrasonic_tooltip = `Misst die Distanz mithilfe von Ultraschall in cm. Schließe den Sensor an einen der drei Digital/Analog Ports an:
|
||||
|
||||
- Trigger: Grünes Kabel
|
||||
- Echo: gelbes Kabel`;
|
||||
|
||||
|
||||
/**
|
||||
* UV and Lightsensor
|
||||
*/
|
||||
Blockly.Msg.senseBox_value = "Messwert:";
|
||||
Blockly.Msg.senseBox_uv_light = "Helligkeit-/UV-Sensor";
|
||||
Blockly.Msg.senseBox_uv_light_tip = "Sensor misst UV-Licht oder die Helligkeit";
|
||||
Blockly.Msg.senseBox_uv_light_tooltip = "Sensor misst UV-Licht oder die Helligkeit. Die Helligkeit wird als **Ganzezahl** in Lux ausgegeben. Die UV-Intensität als **Kommazahl** in µW/cm².";
|
||||
Blockly.Msg.senseBox_uv = "UV-Intensität in µW/cm²";
|
||||
Blockly.Msg.senseBox_light = "Beleuchtungsstärke in Lux";
|
||||
|
||||
/**
|
||||
* BMX055
|
||||
*/
|
||||
|
||||
Blockly.Msg.senseBox_bmx055_compass = "Lage Sensor";
|
||||
Blockly.Msg.senseBox_bmx055_accelerometer = "Beschleunigungssensor";
|
||||
Blockly.Msg.senseBox_bmx055_accelerometer_range = "Messbereich";
|
||||
@ -605,10 +634,21 @@ Blockly.Msg.senseBox_bmx055_compass_tip = "Lage Sensor";
|
||||
Blockly.Msg.senseBox_bmx055_gyroscope_tip = "Lage Sensor";
|
||||
Blockly.Msg.senseBox_bmx055_x = "X-Richtung";
|
||||
Blockly.Msg.senseBox_bmx055_y = "Y-Richtung";
|
||||
Blockly.Msg.senseBox_bmx055_accelerometer_tooltip = `Dieser Block gibt dir den Messwert des Beschleunigungssensors der direkt auf der senseBox MCU aufgelötet ist. Im Dropdown Menü kannst du die Richtung und den Messbereich auswählen.`
|
||||
|
||||
|
||||
/**
|
||||
* WiFi
|
||||
*/
|
||||
Blockly.Msg.senseBox_wifi_connect = "Verbinde mit WLAN";
|
||||
Blockly.Msg.senseBox_wifi_ssid = "Netzwerkname";
|
||||
Blockly.Msg.senseBox_wifi_tip = "stellt eine WLAN verbindung her";
|
||||
Blockly.Msg.senseBox_wifi_tooltip = "Stellt eine Verbindung mit einem WLAN-Netzwerk her. Möchtest du dich mit einem ungesicheren Netzwerk (z.B. Freifunk) verbinden lösche das Feld Passwort. Das WiFi-Bee muss auf den Steckplatz **XBEE1** aufgesteckt werden.";
|
||||
Blockly.Msg.senseBox_wifi_startap = "Initialisiere WLAN Access Point";
|
||||
Blockly.Msg.senseBox_wifi_startap_tooltip = "Erstellt einen WiFi-Accesspoint zu dem du dich verbinden kannst. Beachte, dass immer nur 1 Gerät gleichzeitig verbunden werden kann.";
|
||||
Blockly.Msg.senseBox_wifi_helpurl = "https://docs.sensebox.de/blockly/blockly-web-wifi/"
|
||||
/**
|
||||
* openSenseMap
|
||||
*/
|
||||
Blockly.Msg.senseBox_osem_connection_tip = "stellt eine WLAN verbindung her";
|
||||
Blockly.Msg.senseBox_send_to_osem_tip = "sende Messwert an";
|
||||
Blockly.Msg.senseBox_send_to_osem = "Sende Messwert an die openSenseMap";
|
||||
@ -620,11 +660,16 @@ Blockly.Msg.senseBox_osem_exposure = "Typ";
|
||||
Blockly.Msg.senseBox_osem_stationary = "Stationär";
|
||||
Blockly.Msg.senseBox_osem_mobile = "Mobil";
|
||||
Blockly.Msg.senseBox_osem_access_token = "API Schlüssel";
|
||||
|
||||
/**
|
||||
* Feinstaubsensor (SDS011)
|
||||
*/
|
||||
|
||||
Blockly.Msg.senseBox_sds011 = "Feinstaubsensor";
|
||||
Blockly.Msg.senseBox_sds011_dimension = "in µg/m³ an";
|
||||
Blockly.Msg.senseBox_sds011_pm25 = "PM2.5";
|
||||
Blockly.Msg.senseBox_sds011_pm10 = "PM10";
|
||||
Blockly.Msg.senseBox_sds011_tip = "Misst die Feinstaubbelastung";
|
||||
Blockly.Msg.senseBox_sds011_tooltip = "Dieser Block gibt dir den Messwert des Feinstaubsensor. Schließe den Feinstaubsensor an einen der 2 **Serial/UART** Anschlüssen an. Im Dropdown Menü zwischen PM2.5 und PM10 auswählen. Der Messwert wird dir als **Kommazahl** in µg/m3"
|
||||
Blockly.Msg.senseBox_sds011_serial1 = "Serial1";
|
||||
Blockly.Msg.senseBox_sds011_serial2 = "Serial2";
|
||||
|
||||
@ -678,7 +723,7 @@ Blockly.Msg.senseBox_display_fastPrint_title = "Titel";
|
||||
Blockly.Msg.senseBox_display_fastPrint_value = "Messwert";
|
||||
Blockly.Msg.senseBox_display_fastPrint_dimension = "Einheit";
|
||||
Blockly.Msg.sensebox_display_fastPrint_tooltip = "Zeigt zwei Messwerte auf dem Display an. Wähle eine Überschrift für jeden Messwert und gib die Einheit an."
|
||||
//Tooltips
|
||||
Blockly.Msg.senseBox_display_helpurl = "https://docs.sensebox.de/blockly/blockly-display/"
|
||||
|
||||
|
||||
// GPS
|
||||
@ -694,24 +739,44 @@ Blockly.Msg.senseBox_gps_tooltip = `Liest das GPS Modul aus und gibt dir die Sta
|
||||
**Anschluss: I2C**
|
||||
`
|
||||
|
||||
// openSenseMap
|
||||
|
||||
Blockly.Msg.senseBox_send_mobile_to_osem = "Sende Messwert und Standort an die openSenseMap";
|
||||
Blockly.Msg.senseBox_send_mobile_to_osem_tip = "Sende Messwert und Standort an die openSenseMap";
|
||||
|
||||
/**
|
||||
* Interval Block
|
||||
*/
|
||||
Blockly.Msg.senseBox_interval_timer = "Messintervall";
|
||||
Blockly.Msg.senseBox_interval = "ms"
|
||||
Blockly.Msg.senseBox_interval_timer_tip = "Intervall";
|
||||
Blockly.Msg.senseBox_soil = "Bodenfeuchte";
|
||||
Blockly.Msg.senseBox_watertemperature = "Wassertemperatur"
|
||||
// Cases
|
||||
|
||||
|
||||
/**
|
||||
* Cases
|
||||
*/
|
||||
Blockly.Msg.cases_do = "Führe aus";
|
||||
Blockly.Msg.cases_condition = "Fall (Variable) = ";
|
||||
Blockly.Msg.cases_switch = "Variable";
|
||||
Blockly.Msg.cases_add = "Fall";
|
||||
//Button
|
||||
|
||||
/**
|
||||
* Button
|
||||
*/
|
||||
Blockly.Msg.senseBox_button = "Button";
|
||||
Blockly.Msg.senseBox_button_isPressed = "ist gedrückt";
|
||||
Blockly.Msg.senseBox_button_switch = "als Schalter";
|
||||
Blockly.Msg.senseBox_button_wasPressed = "wurde gedrückt";
|
||||
//Webserver
|
||||
Blockly.Msg.senseBox_button_tooltip = `Dieser Block gibt dir den Status des angeschlossenen Buttons. Im Dropdown Menü können verschiedene Modi für den Button ausgewählt werden. Angesteuert können entweder der on Board Button oder ein Button, der an einen der 6 digitalen Pins angeschlossen ist. verschiedene Modi:
|
||||
- "ist gedrückt": Mit diesem Modus kannst du abfragen ob der Block gerade gedrückt wird. Du erhältst entweder den Wert TRUE oder FALSE.
|
||||
- "wurde gedrückt": Mit diesem Modus kannst du abfragen ob der Block gedrückt wurde. Erst wenn der Knopf gedrückt und wieder losgelassen wurde erhältst du TRUE zurück
|
||||
- "als Schalter": Wenn du diesen Block verwendest kannst du den Knopf wie ein Lichtschalter verwenden. Der Status wird gespeichert bis der Button erneut gedrückt wird`
|
||||
|
||||
/**
|
||||
* Webserver
|
||||
*/
|
||||
|
||||
Blockly.Msg.senseBox_ip_address = "IP-Adresse";
|
||||
Blockly.Msg.senseBox_ip_address_tip = "Gibt die IP-Adresse als Zeichenkette zurück.";
|
||||
Blockly.Msg.senseBox_init_http_server_tip = "Initialisiert einen http-Server auf dem angegebenen Port";
|
||||
@ -748,7 +813,11 @@ Blockly.Msg.senseBox_bme680_tip = "Gibt Messwerte des BME680 zurück";
|
||||
Blockly.Msg.senseBox_bme680_warning = "Achtung. Gas (VOC) kann nicht gleichzeitig mit anderen Parametern gemessen werden"
|
||||
Blockly.Msg.senseBox_gas = "Gas (VOC)";
|
||||
Blockly.Msg.sensebox_soil_smt50 = "Bodenfeuchte/-temperatur (SMT50)";
|
||||
// LoRa
|
||||
|
||||
/**
|
||||
* LoRa Blöcke
|
||||
*/
|
||||
|
||||
Blockly.Msg.senseBox_LoRa_connect = "Zu TTN senden";
|
||||
Blockly.Msg.senseBox_LoRa_device_id = "Device EUI (lsb)";
|
||||
Blockly.Msg.senseBox_LoRa_app_id = "Application EUI (lsb)";
|
||||
@ -788,38 +857,68 @@ Blockly.Msg.senseBox_LoRa_init_abp_tip = 'Initialisiere die LoRa übertragung. K
|
||||
|
||||
Blockly.Msg.senseBox_LoRa_init_otaa_tip = "Initialisiere die LoRa übertragung. Kopiere die ID's im lsb Format";
|
||||
|
||||
//Windspeed
|
||||
/**
|
||||
* Windspeed
|
||||
*/
|
||||
Blockly.Msg.senseBox_windspeed = "Windgeschwindigkeitssensor";
|
||||
//Soundsensor
|
||||
Blockly.Msg.senseBox_windspeed_tooltip = ""
|
||||
|
||||
/*
|
||||
* Soundsensor
|
||||
*/
|
||||
Blockly.Msg.senseBox_soundsensor_dfrobot = "Soundsensor (DF Robot)";
|
||||
Blockly.Msg.senseBox_soundsensor_dfrobot_tooltip = ""
|
||||
|
||||
|
||||
//BME680
|
||||
/*
|
||||
* BME680
|
||||
*/
|
||||
Blockly.Msg.senseBox_bme680 = "Umweltsensor (BME680)";
|
||||
Blockly.Msg.senseBox_bme_iaq = "Innenraumluftqualität (IAQ)";
|
||||
Blockly.Msg.senseBox_bme_iaq_accuracy = "Kalibrierungswert";
|
||||
Blockly.Msg.senseBox_bme_co2 = "CO2 Äquivalent";
|
||||
Blockly.Msg.senseBox_bme_breatheVocEquivalent = "Atemluft VOC Äquivalent";
|
||||
Blockly.Msg.senseBox_bme_tip = "Gibt Messwerte des BME680 zurück";
|
||||
Blockly.Msg.senseBox_bme_tooltip = "Gibt Messwerte des BME680 zurück";
|
||||
|
||||
Blockly.Msg.senseBox_gas = "Gas (VOC)";
|
||||
|
||||
/**
|
||||
* Truebner SMT50
|
||||
*/
|
||||
Blockly.Msg.sensebox_soil_stm50 = "Bodenfeuchte/-temperatur (SMT50)";
|
||||
//Telegram
|
||||
/*
|
||||
* Telegram
|
||||
*/
|
||||
Blockly.Msg.senseBox_telegram_init = "Telegram Bot initialisieren"
|
||||
Blockly.Msg.senseBox_telegram_token = "Token"
|
||||
Blockly.Msg.senseBox_telegram_do = "Telegram mache"
|
||||
Blockly.Msg.senseBox_telegram_do_tooltip = "Füge in diese Schleife die Blöcke ein, die dein Telegram Bot ausführen soll. Beachte hierbei, dass du Aktionen bei einer bestimmten Nachricht ausführen lassen kannst oder auch selbst eine Nachricht versenden werden kann."
|
||||
Blockly.Msg.senseBox_telegram_do_on_message = "bei Nachricht"
|
||||
Blockly.Msg.senseBox_telegram_message = "Nachricht"
|
||||
Blockly.Msg.senseBox_telegram_message_tooltip = "Führe eine Aktion aus, wenn der Telegram eine *Nachricht* empfangen hat."
|
||||
Blockly.Msg.senseBox_telegram_send = "Sende Nachricht"
|
||||
//SCD30 CO2 Sensor
|
||||
Blockly.Msg.senseBox_telegram_send_tooltip = "Dein Telgram Bot sendet dir eine Nachricht auf dein Handy. Die Nachricht kann zum Beispiel ein Alarm oder auch ein Messwert sein"
|
||||
Blockly.Msg.senseBox_telegram_init_tooltip = "Initialisiere den Telegram Bot. Verwende diesen Block in der **Setup()-Schleife**. Den Token kannst du dir über den Telegram erstellen."
|
||||
Blockly.Msg.senseBox_telegram_helpurl = "https://sensebox.de/projects/de/2019-12-15-telegram-blockly"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* SCD30 CO2 Senso
|
||||
*/
|
||||
Blockly.Msg.senseBox_scd30 = "CO2 Sensor (Sensirion SCD30)";
|
||||
Blockly.Msg.senseBox_scd_tip = "Gibt den Wert des CO2 Sensors";
|
||||
Blockly.Msg.senseBox_scd_co2 = "CO2 in ppm";
|
||||
//WS2818 RGB LED
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led = "senseBox WS2812 - RGB LED";
|
||||
|
||||
/**
|
||||
* WS2818 RGB LED
|
||||
*/
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led = "Setze RGB-LED an";
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_init = "RGB LED (WS2818) initialisieren";
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_position = "Position";
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_brightness = "Helligkeit";
|
||||
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_tooltip = "Verändere mit diesem Block die Farbe deiner RGB-LED. Verbinde einen Block für die Farbe. Wenn mehrere RGB-LEDs miteinander verkettet werden kannst du über die Position bestimmen welche LED angesteuert wird. "
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_init_tooltip = "Schließe die RGB-LED an einen der drei **digital/analog Ports** an. Wenn mehrere RGB-LEDs miteinander verkettet werden kannst du über die Position bestimmen welche LED angesteuert wird. "
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_color = "Farbe"
|
||||
Blockly.Msg.senseBox_ws2818_rgb_led_number = "Anzahl"
|
||||
|
||||
|
||||
/***
|
||||
@ -836,6 +935,14 @@ Blockly.Msg.senseBox_mqtt_publish = "Sende an Feed/Topic";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add Translation for Blocks above
|
||||
* ---------------------------------------------------------------
|
||||
* Add Translation for the UI below
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Typed Variable Modal
|
||||
*
|
||||
@ -849,11 +956,6 @@ Blockly.Msg.TYPED_VAR_MODAL_CANCEL_BUTTON = "Abbrechen";
|
||||
Blockly.Msg.TYPED_VAR_MODAL_TITLE = "Erstelle Variable";
|
||||
Blockly.Msg.TYPED_VAR_MODAL_INVALID_NAME = "Der Name ist ungültig, bitte versuche einen anderen."
|
||||
|
||||
/**
|
||||
* Add Translation for Blocks above
|
||||
* ---------------------------------------------------------------
|
||||
* Add Translation for the UI below
|
||||
*/
|
||||
|
||||
/**
|
||||
* Toolbox
|
||||
@ -1089,6 +1191,13 @@ Blockly.Msg.compile_overlay_head = "Dein Programm wird nun kompiliert und herunt
|
||||
Blockly.Msg.compile_overlay_text = "Kopiere es anschließend auf deine senseBox MCU"
|
||||
Blockly.Msg.compile_overlay_help = "Benötigst du mehr Hilfe? Dann schaue hier: "
|
||||
|
||||
/**
|
||||
* Tooltip Viewer
|
||||
*/
|
||||
|
||||
Blockly.Msg.tooltip_viewer = "Hilfe"
|
||||
Blockly.Msg.tooltip_moreInformation = "Mehr Informationen findest du "
|
||||
|
||||
/**
|
||||
* FAQ
|
||||
*/
|
||||
|
@ -61,7 +61,11 @@ class Toolbox extends React.Component {
|
||||
</Category>
|
||||
<Category name="SD" colour={getColour().sensebox}>
|
||||
<Block type="sensebox_sd_create_file" />
|
||||
<Block type="sensebox_sd_open_file" />
|
||||
<Block type="sensebox_sd_open_file">
|
||||
<Value name="SD">
|
||||
<Block type="sensebox_sd_write_file"></Block>
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="sensebox_sd_write_file" />
|
||||
</Category>
|
||||
<Category name="LED" colour={getColour().sensebox}>
|
||||
@ -83,10 +87,10 @@ class Toolbox extends React.Component {
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="sensebox_led" />
|
||||
<Block type="sensebox_ws2818_led">
|
||||
<Value name="POSITION">
|
||||
<Block type="sensebox_ws2818_led_init">
|
||||
<Value name="NUMBER">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">0</Field>
|
||||
<Field name="NUM">1</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
<Value name="BRIGHTNESS">
|
||||
@ -94,16 +98,32 @@ class Toolbox extends React.Component {
|
||||
<Field name="NUM">30</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
<Value name="RED">
|
||||
</Block>
|
||||
<Block type="sensebox_ws2818_led">
|
||||
<Value name="POSITION">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">0</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
<Value name="GREEN">
|
||||
<Value name="COLOR">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">0</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="colour_picker"></Block>
|
||||
<Block type="colour_random"></Block>
|
||||
<Block type="colour_rgb">
|
||||
<Value name="RED">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">100</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
<Value name="GREEN">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">50</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
<Value name="BLUE">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">0</Field>
|
||||
|
@ -10,9 +10,6 @@ import CardContent from '@material-ui/core/CardContent';
|
||||
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import Link from '@material-ui/core/Link'
|
||||
import CardActions from '@material-ui/core/CardActions';
|
||||
import Button from '@material-ui/core/Button';
|
||||
|
||||
class TooltipViewer extends Component {
|
||||
|
||||
@ -20,13 +17,16 @@ class TooltipViewer extends Component {
|
||||
render() {
|
||||
|
||||
return (
|
||||
<Card style={{ height: '100%', margin: '1vH 0 0 0', maxHeight: '19vH' }} ref={this.myDiv}>
|
||||
<Card className="tooltipViewer" style={{ height: '100%', margin: '1vH 0 0 0', maxHeight: '19vH', overflow: 'auto' }} ref={this.myDiv}>
|
||||
<CardContent>
|
||||
<Typography variant="h5" component="h2">
|
||||
Hilfe
|
||||
</Typography>
|
||||
<Typography variant="body1" component="p">
|
||||
<ReactMarkdown>{this.props.tooltip}</ReactMarkdown>
|
||||
{Blockly.Msg.tooltip_viewer}
|
||||
</Typography>
|
||||
<Typography variant="body2" component="p">
|
||||
<ReactMarkdown linkTarget="_blank">{this.props.tooltip}</ReactMarkdown>
|
||||
|
||||
{this.props.helpurl !== '' ? <ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown> : null}
|
||||
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@ -35,11 +35,13 @@ class TooltipViewer extends Component {
|
||||
}
|
||||
|
||||
TooltipViewer.propTypes = {
|
||||
tooltip: PropTypes.string.isRequired
|
||||
tooltip: PropTypes.string.isRequired,
|
||||
helpurl: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
tooltip: state.workspace.code.tooltip
|
||||
tooltip: state.workspace.code.tooltip,
|
||||
helpurl: state.workspace.code.helpurl
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, null)(withWidth()(TooltipViewer));
|
||||
|
Loading…
x
Reference in New Issue
Block a user