初始化提交

This commit is contained in:
王立帮
2024-07-19 10:16:00 +08:00
parent 4c7b571f20
commit 4a2d56dcc4
7084 changed files with 741212 additions and 63 deletions

View File

@@ -0,0 +1,47 @@
import * as Blockly from 'blockly/core';
const COMMUNICATE_HUE = 140;
export const serialBT_Init = {
init: function () {
this.setColour(COMMUNICATE_HUE);
this.appendValueInput("CONTENT", String)
.appendField(Blockly.Msg.MIXLY_SERIALBT_INIT)
.setCheck(String);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setInputsInline(true);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_SERIAL_BEGIN);
}
};
export const serialBT_available = {
init: function () {
this.setColour(COMMUNICATE_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_SERIALBT_AVAILABLE);
this.setOutput(true, Boolean);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERIAL_AVAILABLE);
}
};
export const serialBT_read = {
init: function () {
this.setColour(COMMUNICATE_HUE);
this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_SERIALBT_READ);
this.setOutput(true, Boolean);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_BLOCKGROUP_SERIAL_AVAILABLE);
}
};
export const serialBT_write = {
init: function () {
this.setColour(COMMUNICATE_HUE);
this.appendValueInput("CONTENT", String)
.appendField(Blockly.Msg.MIXLY_SERIALBT_WRITE);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.TEXT_WRITE_TOOLTIP);
}
};