add tooltips and en translations

This commit is contained in:
Mario Pesch 2021-05-17 15:51:57 +02:00
parent 44d48997d4
commit 531db63b85
4 changed files with 67 additions and 56 deletions

View File

@ -10,7 +10,7 @@ Blockly.Blocks["sensebox_phyphox_init"] = {
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip); this.setTooltip(Blockly.Msg.sensebox_phyphox_init_tooltip);
}, },
}; };
@ -26,16 +26,12 @@ Blockly.Blocks["sensebox_phyphox_experiment"] = {
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.sensebox_phyphox_experimentTitle) .appendField(Blockly.Msg.sensebox_phyphox_experimentTitle)
.appendField(new Blockly.FieldTextInput("Experiment Title"), "title"); .appendField(new Blockly.FieldTextInput("Experiment Title"), "title");
this.appendDummyInput()
.appendField(Blockly.Msg.sensebox_phyphox_experimentCategory)
.appendField(
new Blockly.FieldTextInput("senseBox Experiments"),
"category"
);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.sensebox_phyphox_experimentDescription) .appendField(Blockly.Msg.sensebox_phyphox_experimentDescription)
.appendField( .appendField(
new Blockly.FieldTextInput("Experiment Beschreibung"), new Blockly.FieldTextInput(
Blockly.Msg.sensebox_phyphox_experiment_description
),
"description" "description"
); );
this.appendStatementInput("view").appendField( this.appendStatementInput("view").appendField(
@ -43,19 +39,7 @@ Blockly.Blocks["sensebox_phyphox_experiment"] = {
); );
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip); this.setTooltip(Blockly.Msg.sensebox_phyphox_experiment_tooltip);
},
};
Blockly.Blocks["sensebox_phyphox_view"] = {
init: function () {
this.setColour(getColour().phyphox);
this.appendStatementInput("view").appendField(
Blockly.Msg.sensebox_phyphox_createView
);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip);
}, },
}; };
@ -82,8 +66,8 @@ Blockly.Blocks["sensebox_phyphox_graph"] = {
.appendField(Blockly.Msg.sensebox_phyphox_graphStyle) .appendField(Blockly.Msg.sensebox_phyphox_graphStyle)
.appendField( .appendField(
new Blockly.FieldDropdown([ new Blockly.FieldDropdown([
["dots", "dots"], [Blockly.Msg.sensebox_phyphox_style_dots, "dots"],
["line", "line"], [Blockly.Msg.sensebox_phyphox_style_line, "line"],
]), ]),
"style" "style"
); );
@ -95,7 +79,7 @@ Blockly.Blocks["sensebox_phyphox_graph"] = {
); );
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip); this.setTooltip(Blockly.Msg.sensebox_phyphox_graph_tooltip);
}, },
}; };
@ -125,7 +109,7 @@ Blockly.Blocks["sensebox_phyphox_channel"] = {
); );
this.setOutput(true); this.setOutput(true);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip); this.setTooltip(Blockly.Msg.sensebox_phyphox_timestamp_tooltip);
}, },
}; };
@ -147,7 +131,7 @@ Blockly.Blocks["sensebox_phyphox_sendchannel"] = {
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip); this.setTooltip(Blockly.Msg.sensebox_phyphox_sendchannel_tooltip);
}, },
}; };
@ -159,6 +143,6 @@ Blockly.Blocks["sensebox_phyphox_experiment_send"] = {
); );
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.senseBox_led_tooltip); this.setTooltip(Blockly.Msg.sensebox_phyphox_experiment_send_tooltip);
}, },
}; };

View File

@ -18,7 +18,6 @@ Blockly.Arduino.sensebox_phyphox_experiment = function () {
"" ""
); );
var title = this.getFieldValue("title").replace(/[^a-zA-Z0-9]/g, ""); var title = this.getFieldValue("title").replace(/[^a-zA-Z0-9]/g, "");
var category = this.getFieldValue("category");
var description = this.getFieldValue("description"); var description = this.getFieldValue("description");
var branch = Blockly.Arduino.statementToCode(this, "view"); var branch = Blockly.Arduino.statementToCode(this, "view");
Blockly.Arduino.phyphoxSetupCode_[ Blockly.Arduino.phyphoxSetupCode_[
@ -28,8 +27,8 @@ Blockly.Arduino.sensebox_phyphox_experiment = function () {
`setTitle_${title}` `setTitle_${title}`
] = `${experimentname}.setTitle("${title}");`; ] = `${experimentname}.setTitle("${title}");`;
Blockly.Arduino.phyphoxSetupCode_[ Blockly.Arduino.phyphoxSetupCode_[
`setCategory_${category}` `setCategory_senseBoxExperiments}`
] = `${experimentname}.setCategory("${category}");`; ] = `${experimentname}.setCategory("senseBox Experimente");`;
Blockly.Arduino.phyphoxSetupCode_[ Blockly.Arduino.phyphoxSetupCode_[
`setDescription_${description}` `setDescription_${description}`
] = `${experimentname}.setDescription("${description}");`; ] = `${experimentname}.setDescription("${description}");`;
@ -59,11 +58,6 @@ Blockly.Arduino["sensebox_phyphox_channel"] = function () {
return [code, Blockly.Arduino.ORDER_ATOMIC]; return [code, Blockly.Arduino.ORDER_ATOMIC];
}; };
Blockly.Arduino.sensebox_phyphox_view = function () {
//var code = `${branch}`;
//return code;
};
Blockly.Arduino.sensebox_phyphox_sendchannel = function (block) { Blockly.Arduino.sensebox_phyphox_sendchannel = function (block) {
var channel = this.getFieldValue("channel"); var channel = this.getFieldValue("channel");
var value = var value =

View File

@ -1,13 +1,14 @@
export const BLE = { export const BLE = {
/** /**
* Phyphox Init * Phyphox Blöcke
*/ */
sensebox_phyphox_init: "Phyphox Experiment", sensebox_phyphox_init: "Initialisiere Phyphox Gerät mit Namen:",
sensebox_phyphox_createExperiment: "Erstelle Experiment", sensebox_phyphox_createExperiment: "Erstelle Experiment",
sensebox_phyphox_experimentName: "Name des Experiments", sensebox_phyphox_experimentName: "Name des Experiments",
sensebox_phyphox_experimentTitle: "Titel", sensebox_phyphox_experimentTitle: "Titel",
sensebox_phyphox_experimentCategory: "Kategorie", sensebox_phyphox_experimentCategory: "Kategorie",
sensebox_phyphox_experimentDescription: "Beschreibung", sensebox_phyphox_experimentDescription: "Beschreibung",
sensebox_phyphox_experiment_description: "Kurze Beschreibung des Experiments",
sensebox_phyphox_writeValues: "Sende Werte", sensebox_phyphox_writeValues: "Sende Werte",
sensebox_phyphox_createView: "Mit Graphen:", sensebox_phyphox_createView: "Mit Graphen:",
sensebox_phyphox_createGraph: "Erstelle Graph", sensebox_phyphox_createGraph: "Erstelle Graph",
@ -18,8 +19,23 @@ export const BLE = {
sensebox_phyphox_labely: "Beschriftung y-Achse", sensebox_phyphox_labely: "Beschriftung y-Achse",
sensebox_phyphox_channel0: "Wert x-Achse", sensebox_phyphox_channel0: "Wert x-Achse",
sensebox_phyphox_channel1: "Wert y-Achse", sensebox_phyphox_channel1: "Wert y-Achse",
sensebox_phyphox_style_dots: "Punkte",
sensebox_phyphox_style_line: "Linie",
sensebox_phyphox_timestamp: "Zeitstempel", sensebox_phyphox_timestamp: "Zeitstempel",
sensebox_phyphox_channel: "Kanal", sensebox_phyphox_channel: "Kanal",
sensebox_phyphox_sendchannel: "sende an Kanal:", sensebox_phyphox_sendchannel: "sende an Kanal:",
sensebox_phyphox_graphStyle: "Stil", sensebox_phyphox_graphStyle: "Stil",
sensebox_phyphox_init_tooltip:
"Initialisere das Bluetooth Bee. Stecke diese auf dem Steckplatz **XBEE1**. Gib dem Phphox Messgerät einen eindeutigen Namen, damit du dieses in der App wiederfindest",
sensebox_phyphox_experiment_tooltip:
"Erstelle ein Experiment und vergib einen eindeutigen Namen und eine kurze Beschreibung. Füge bis zu 5 verschiedene Graphen in der Ansicht hinzu. ",
sensebox_phyphox_graph_tooltip:
"Erstellt einen neuen Graph für das Experiment. Gibt die Einheit und Beschriftung für die Achsen an und wähle den Stil der Visualisuerng der Messwerte. Füge an die Schnittstellen für die Werte der X- und Y-Achse den Kanal an auf dem die Messwerte später gesendet werden. Möchtest du einen Zeitstempel über die Phyphox App erstellen lassen verbinde den Block *Zeitstempel*",
sensebox_phyphox_timestamp_tooltip:
"Verwende diesen Block, um einen Zeitstempel über die Phyphox App erstellen zu lassen",
sensebox_phyphox_sendchannel_tooltip:
"Sendet einen Messwert an den ausgewählten Kanal",
sensebox_phyphox_experiment_send_tooltip:
"Sendet die Messwerte an die Phyphox App",
}; };

View File

@ -2,24 +2,41 @@ export const BLE = {
/** /**
* Phyphox Init * Phyphox Init
*/ */
sensebox_phyphox_init: "Phyphox Experiment", sensebox_phyphox_init: "Initialise Phyphox device with name:",
sensebox_phyphox_createExperiment: "Erstelle Experiment", sensebox_phyphox_createExperiment: "Create experiment",
sensebox_phyphox_experimentName: "Name des Experiments", sensebox_phyphox_experimentName: "Name of experiment",
sensebox_phyphox_experimentTitle: "Titel", sensebox_phyphox_experimentTitle: "Title",
sensebox_phyphox_experimentCategory: "Kategorie", sensebox_phyphox_experimentCategory: "Category",
sensebox_phyphox_experimentDescription: "Beschreibung", sensebox_phyphox_experimentDescription: "Description",
sensebox_phyphox_writeValues: "Sende Werte", sensebox_phyphox_experiment_description:
sensebox_phyphox_createView: "Mit Graphen:", "Short description of the experiment",
sensebox_phyphox_createGraph: "Erstelle Graph", sensebox_phyphox_writeValues: "Send values",
sensebox_phyphox_createView: "With graphs:",
sensebox_phyphox_createGraph: "Create Graph",
sensebox_phyphox_graphLabel: "", sensebox_phyphox_graphLabel: "",
sensebox_phyphox_unitx: "Einheit x-Achse", sensebox_phyphox_unitx: "Unit x-axis",
sensebox_phyphox_unity: "Einheit y-Achse", sensebox_phyphox_unity: "Unit y-axis",
sensebox_phyphox_labelx: "Beschriftung x-Achse", sensebox_phyphox_labelx: "Label x-axis",
sensebox_phyphox_labely: "Beschriftung y-Achse", sensebox_phyphox_labely: "Label y-axis",
sensebox_phyphox_channel0: "Wert x-Achse", sensebox_phyphox_channel0: "x-axis value",
sensebox_phyphox_channel1: "Wert y-Achse", sensebox_phyphox_channel1: "y-axis value",
sensebox_phyphox_timestamp: "Zeitstempel", sensebox_phyphox_style_dots: "Dots",
sensebox_phyphox_channel: "Kanal", sensebox_phyphox_style_line: "Line",
sensebox_phyphox_sendchannel: "sende an Kanal:", sensebox_phyphox_timestamp: "Timestamp",
sensebox_phyphox_graphStyle: "Stil", sensebox_phyphox_channel: "Channel",
sensebox_phyphox_sendchannel: "send to channel:",
sensebox_phyphox_graphStyle: "style",
sensebox_phyphox_init_tooltip:
"Initialise the Bluetooth Bee. Plug it into the **XBEE1** slot. Give the Phphox meter a unique name so you can find it in the app",
sensebox_phyphox_experiment_tooltip:
"Create an experiment and give it a unique name and a short description. Add up to 5 different graphs in the view. ",
sensebox_phyphox_graph_tooltip:
"Creates a new graph for the experiment. Specify the unit and label for the axes and choose the style of visualisation of the measured values. Add to the interfaces for the values of the X- and Y-axis the channel on which the measured values will be sent later. If you want to create a timestamp via the Phyphox app, connect the block *Timestamp*",
sensebox_phyphox_timestamp_tooltip:
"Use this block to have a timestamp created via the Phyphox app",
sensebox_phyphox_sendchannel_tooltip:
"Sends a reading to the selected channel",
sensebox_phyphox_experiment_send_tooltip:
"Sends the measured values to the Phyphox App",
}; };