Merge pull request #168 from sensebox/fix/phyphox-view-style

fix phyphox view style to use lines as default
This commit is contained in:
Mario Pesch 2022-04-26 10:32:49 +02:00 committed by GitHub
commit 198782d106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -65,8 +65,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([
[Blockly.Msg.sensebox_phyphox_style_dots, "dots"],
[Blockly.Msg.sensebox_phyphox_style_line, "line"], [Blockly.Msg.sensebox_phyphox_style_line, "line"],
[Blockly.Msg.sensebox_phyphox_style_dots, "dots"],
]), ]),
"style" "style"
); );

View File

@ -90,7 +90,9 @@ Blockly.Arduino.sensebox_phyphox_graph = function () {
code += `${label}.setUnitY("${unity}");\n`; code += `${label}.setUnitY("${unity}");\n`;
code += `${label}.setLabelX("${labelx}");\n`; code += `${label}.setLabelX("${labelx}");\n`;
code += `${label}.setLabelY("${labely}");\n`; code += `${label}.setLabelY("${labely}");\n`;
if (style === "dots"){
code += `${label}.setStyle("${style}");\n`; code += `${label}.setStyle("${style}");\n`;
}
code += `${label}.setChannel(${channelX}, ${channelY});\n`; code += `${label}.setChannel(${channelX}, ${channelY});\n`;
code += `firstView.addElement(${label});\n`; code += `firstView.addElement(${label});\n`;
return code; return code;