This commit is contained in:
fredqian
2025-03-25 16:08:59 +08:00
22 changed files with 92 additions and 88 deletions

View File

@@ -132,7 +132,7 @@ export const tone_notes = {
init: function () { init: function () {
this.setColour(ACTUATOR_HUE); this.setColour(ACTUATOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.TONE_NOTES), 'STAT'); .appendField(new Blockly.FieldDropdown(tone_notes.TONE_NOTES), 'STAT');
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_TONE_NOTE); this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_TONE_NOTE);
}, },
@@ -370,7 +370,7 @@ export const display_rgb_init = {
.setAlign(Blockly.inputs.Align.RIGHT); .setAlign(Blockly.inputs.Align.RIGHT);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE) .appendField(Blockly.Msg.MIXLY_MICROPYTHON_SOCKET_TYPE)
.appendField(new Blockly.FieldDropdown(this.DISPLAY_RGB_TYPE), "TYPE"); .appendField(new Blockly.FieldDropdown(display_rgb_init.DISPLAY_RGB_TYPE), "TYPE");
this.appendValueInput("LEDCOUNT") this.appendValueInput("LEDCOUNT")
.setCheck(Number) .setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
@@ -492,7 +492,7 @@ export const display_rgb_rainbow3 = {
.appendField(new Blockly.FieldDropdown(Profile.default.digital), "PIN") .appendField(new Blockly.FieldDropdown(Profile.default.digital), "PIN")
.setAlign(Blockly.inputs.Align.RIGHT); .setAlign(Blockly.inputs.Align.RIGHT);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.DISPLAY_RAINBOW_TYPE), "TYPE"); .appendField(new Blockly.FieldDropdown(display_rgb_rainbow3.DISPLAY_RAINBOW_TYPE), "TYPE");
this.appendValueInput("rainbow_color") this.appendValueInput("rainbow_color")
.setCheck(Number) .setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
@@ -544,7 +544,7 @@ export const Mixly_motor = {
this.setColour(ACTUATOR_HUE); this.setColour(ACTUATOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MOTOR) .appendField(Blockly.Msg.MIXLY_MOTOR)
.appendField(new Blockly.FieldDropdown(this.MOTOR_TYPE), "MOTOR_TYPE"); .appendField(new Blockly.FieldDropdown(Mixly_motor.MOTOR_TYPE), "MOTOR_TYPE");
this.appendDummyInput("") this.appendDummyInput("")
this.appendValueInput("PIN1") this.appendValueInput("PIN1")
.setCheck(Number) .setCheck(Number)
@@ -611,7 +611,7 @@ export const GD5800_MP3_Set_Device = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MP3_SOURCE) .appendField(Blockly.Msg.MIXLY_MP3_SOURCE)
.appendField(Blockly.Msg.MIXLY_STAT) .appendField(Blockly.Msg.MIXLY_STAT)
.appendField(new Blockly.FieldDropdown(this.GD5800_MP3_Device), "DEVICEID"); .appendField(new Blockly.FieldDropdown(GD5800_MP3_Set_Device.GD5800_MP3_Device), "DEVICEID");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
@@ -638,7 +638,7 @@ export const GD5800_MP3_CONTROL = {
.setCheck(Number); .setCheck(Number);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_STAT) .appendField(Blockly.Msg.MIXLY_STAT)
.appendField(new Blockly.FieldDropdown(this.GD5800_MP3_CONTROL_TYPE), "CONTROL_TYPE"); .appendField(new Blockly.FieldDropdown(GD5800_MP3_CONTROL.GD5800_MP3_CONTROL_TYPE), "CONTROL_TYPE");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
@@ -670,7 +670,7 @@ export const GD5800_MP3_LOOP_MODE = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MP3_LOOP_MODE) .appendField(Blockly.Msg.MIXLY_MP3_LOOP_MODE)
.appendField(Blockly.Msg.MIXLY_STAT) .appendField(Blockly.Msg.MIXLY_STAT)
.appendField(new Blockly.FieldDropdown(this.GD5800_MP3_LOOP_MODE_TYPE), "LOOP_MODE"); .appendField(new Blockly.FieldDropdown(GD5800_MP3_LOOP_MODE.GD5800_MP3_LOOP_MODE_TYPE), "LOOP_MODE");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
@@ -700,7 +700,7 @@ export const GD5800_MP3_EQ_MODE = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MP3_EQ_MODE) .appendField(Blockly.Msg.MIXLY_MP3_EQ_MODE)
.appendField(Blockly.Msg.MIXLY_STAT) .appendField(Blockly.Msg.MIXLY_STAT)
.appendField(new Blockly.FieldDropdown(this.GD5800_MP3_EQ_MODE_TYPE), "EQ_MODE"); .appendField(new Blockly.FieldDropdown(GD5800_MP3_EQ_MODE.GD5800_MP3_EQ_MODE_TYPE), "EQ_MODE");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
@@ -777,8 +777,9 @@ export const voice_module = {
.setCheck(Number); .setCheck(Number);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MP3_PLAY) .appendField(Blockly.Msg.MIXLY_MP3_PLAY)
.appendField(new Blockly.FieldDropdown(this.VOICE_LIST), "VOICE"); .appendField(new Blockly.FieldDropdown(voice_module.VOICE_LIST), "VOICE");
this.appendValueInput("WAIT").setCheck(Number).appendField(Blockly.Msg.MIXLY_MICROBIT_WAIT); this.appendValueInput("WAIT").setCheck(Number)
.appendField(Blockly.Msg.MIXLY_MICROBIT_WAIT);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setInputsInline(true); this.setInputsInline(true);
@@ -862,9 +863,9 @@ export const AFMotorRun = {
this.setColour(ACTUATOR_HUE); this.setColour(ACTUATOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField("AFMotor" + Blockly.Msg.MIXLY_MOTOR) .appendField("AFMotor" + Blockly.Msg.MIXLY_MOTOR)
.appendField(new Blockly.FieldDropdown(this.MOTOR), "motor") .appendField(new Blockly.FieldDropdown(AFMotorRun.MOTOR), "motor")
.appendField(Blockly.Msg.MIXLY_MICROBIT_Direction) .appendField(Blockly.Msg.MIXLY_MICROBIT_Direction)
.appendField(new Blockly.FieldDropdown(this.DIRECTION), "direction") .appendField(new Blockly.FieldDropdown(AFMotorRun.DIRECTION), "direction")
.appendField(Blockly.Msg.MIXLY_SPEED); .appendField(Blockly.Msg.MIXLY_SPEED);
this.appendValueInput("speed", Number) this.appendValueInput("speed", Number)
.setCheck(Number); .setCheck(Number);
@@ -891,7 +892,7 @@ export const AFMotorStop = {
this.setColour(ACTUATOR_HUE); this.setColour(ACTUATOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_STOP + "AFMotor" + Blockly.Msg.MIXLY_MOTOR) .appendField(Blockly.Msg.MIXLY_STOP + "AFMotor" + Blockly.Msg.MIXLY_MOTOR)
.appendField(new Blockly.FieldDropdown(this.MOTOR), "motor"); .appendField(new Blockly.FieldDropdown(AFMotorStop.MOTOR), "motor");
this.setPreviousStatement(true); this.setPreviousStatement(true);
this.setNextStatement(true); this.setNextStatement(true);
}, },
@@ -1079,7 +1080,7 @@ export const arduino_dfplayer_set_1 = {
.appendField(Blockly.Msg.YX5200_MP3) .appendField(Blockly.Msg.YX5200_MP3)
.appendField(new Blockly.FieldTextInput("myPlayer"), "dfplayer_name") .appendField(new Blockly.FieldTextInput("myPlayer"), "dfplayer_name")
.appendField(" ") .appendField(" ")
.appendField(new Blockly.FieldDropdown(this.DATA), "set_data"); .appendField(new Blockly.FieldDropdown(arduino_dfplayer_set_1.DATA), "set_data");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
@@ -1306,8 +1307,10 @@ export const I2Cmotor = {
this.setColour(ACTUATOR_HUE); this.setColour(ACTUATOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField("I2C" + Blockly.Msg.MIXLY_MOTOR) .appendField("I2C" + Blockly.Msg.MIXLY_MOTOR)
.appendField(new Blockly.FieldDropdown(this.I2C_Motor_SELECT), "motor"); .appendField(new Blockly.FieldDropdown(I2Cmotor.I2C_Motor_SELECT), "motor");
this.appendValueInput("SPEED").setCheck(Number).appendField(Blockly.Msg.MIXLY_MOTOR_SPEED); this.appendValueInput("SPEED")
.setCheck(Number)
.appendField(Blockly.Msg.MIXLY_MOTOR_SPEED);
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true); this.setPreviousStatement(true);
this.setNextStatement(true); this.setNextStatement(true);
@@ -1333,7 +1336,7 @@ export const M9101X_S_MP3_CONTROL = {
.setCheck(Number); .setCheck(Number);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_STAT) .appendField(Blockly.Msg.MIXLY_STAT)
.appendField(new Blockly.FieldDropdown(this.M9101X_S_MP3_CONTROL_TYPE), "CONTROL_TYPE"); .appendField(new Blockly.FieldDropdown(M9101X_S_MP3_CONTROL.M9101X_S_MP3_CONTROL_TYPE), "CONTROL_TYPE");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);

View File

@@ -19,7 +19,7 @@ export const controls_delay = {
this.setColour(LOOPS_HUE); this.setColour(LOOPS_HUE);
this.appendValueInput("DELAY_TIME", Number) this.appendValueInput("DELAY_TIME", Number)
.appendField(Blockly.Msg.MIXLY_DELAY) .appendField(Blockly.Msg.MIXLY_DELAY)
.appendField(new Blockly.FieldDropdown(this.UNIT), "UNIT") .appendField(new Blockly.FieldDropdown(controls_delay.UNIT), "UNIT")
.setCheck(Number); .setCheck(Number);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
@@ -84,8 +84,9 @@ export const controls_whileUntil = {
this.appendValueInput("BOOL") this.appendValueInput("BOOL")
.setCheck([Boolean, Number]) .setCheck([Boolean, Number])
.appendField(Blockly.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT) .appendField(Blockly.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), "MODE"); .appendField(new Blockly.FieldDropdown(controls_whileUntil.OPERATORS), "MODE");
this.appendStatementInput("DO").appendField(Blockly.Msg.MIXLY_DO); this.appendStatementInput("DO")
.appendField(Blockly.Msg.MIXLY_DO);
this.setPreviousStatement(true); this.setPreviousStatement(true);
this.setNextStatement(true); this.setNextStatement(true);
this.setHelpUrl( this.setHelpUrl(
@@ -110,7 +111,7 @@ export const controls_whileUntil = {
export const controls_flow_statements = { export const controls_flow_statements = {
init: function () { init: function () {
this.setColour(LOOPS_HUE); this.setColour(LOOPS_HUE);
var dropdown = new Blockly.FieldDropdown(this.OPERATORS); var dropdown = new Blockly.FieldDropdown(controls_flow_statements.OPERATORS);
this.appendDummyInput() this.appendDummyInput()
.appendField(dropdown, "FLOW") .appendField(dropdown, "FLOW")
.appendField(Blockly.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP); .appendField(Blockly.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP);
@@ -165,7 +166,7 @@ export const controls_millis = {
this.setColour(LOOPS_HUE); this.setColour(LOOPS_HUE);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_RUNTIME) .appendField(Blockly.Msg.MIXLY_RUNTIME)
.appendField(new Blockly.FieldDropdown(this.UNIT), "UNIT"); .appendField(new Blockly.FieldDropdown(controls_millis.UNIT), "UNIT");
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS); this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS);
}, },
@@ -832,7 +833,7 @@ export const simple_timer = {
init: function () { init: function () {
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_SIMPLE_TIMER) .appendField(Blockly.Msg.MIXLY_SIMPLE_TIMER)
.appendField(new Blockly.FieldDropdown(this.NUMBER), "NO") .appendField(new Blockly.FieldDropdown(simple_timer.NUMBER), "NO")
.appendField(Blockly.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL); .appendField(Blockly.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL);
this.appendValueInput("timein") this.appendValueInput("timein")
.setCheck(null); .setCheck(null);
@@ -894,7 +895,7 @@ export const super_delay_function1 = {
init: function () { init: function () {
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.super_delay_function) .appendField(Blockly.Msg.super_delay_function)
.appendField(new Blockly.FieldDropdown(this.NUMBER), "number"); .appendField(new Blockly.FieldDropdown(super_delay_function1.NUMBER), "number");
this.appendStatementInput("delay_function") this.appendStatementInput("delay_function")
.setCheck(null); .setCheck(null);
this.setColour(120); this.setColour(120);
@@ -926,7 +927,7 @@ export const execute_super_delay_function1 = {
init: function () { init: function () {
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.execute_super_delay_function) .appendField(Blockly.Msg.execute_super_delay_function)
.appendField(new Blockly.FieldDropdown(this.NUMBER), "number"); .appendField(new Blockly.FieldDropdown(execute_super_delay_function1.NUMBER), "number");
this.appendValueInput("time_interval") this.appendValueInput("time_interval")
.setCheck(null) .setCheck(null)
.appendField(Blockly.Msg.time_interval); .appendField(Blockly.Msg.time_interval);

View File

@@ -1806,7 +1806,7 @@ export const lcd_display_pattern = {
.appendField(Blockly.Msg.COLUMN_DISPLAY_IMAGE); .appendField(Blockly.Msg.COLUMN_DISPLAY_IMAGE);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.LCD_NUMBERING) .appendField(Blockly.Msg.LCD_NUMBERING)
.appendField(new Blockly.FieldDropdown(this.NUMBER), "number"); .appendField(new Blockly.FieldDropdown(lcd_display_pattern.NUMBER), "number");
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(DISPLAY_HUE); this.setColour(DISPLAY_HUE);
@@ -2121,7 +2121,7 @@ export const TFT_Rotation = {
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_ROTATE) .appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_ROTATE)
.appendField(new Blockly.FieldDropdown(this.ROTATION_TYPE), "Rotation_TYPE"); .appendField(new Blockly.FieldDropdown(TFT_Rotation.ROTATION_TYPE), "Rotation_TYPE");
this.setPreviousStatement(true); this.setPreviousStatement(true);
this.setNextStatement(true); this.setNextStatement(true);
this.setInputsInline(true); this.setInputsInline(true);

View File

@@ -202,7 +202,7 @@ export const NTP_server_get_time = {
.appendField(Blockly.Msg.NTP_server_get_time); .appendField(Blockly.Msg.NTP_server_get_time);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.NTP_TIME_TYPE), "TIME_TYPE"); .appendField(new Blockly.FieldDropdown(NTP_server_get_time.NTP_TIME_TYPE), "TIME_TYPE");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true, Number); this.setOutput(true, Number);
}, },

View File

@@ -347,7 +347,7 @@ export const ADS1015_setGain = {
.appendField(Blockly.Msg.ADS1015_setGain); .appendField(Blockly.Msg.ADS1015_setGain);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.GAIN_TYPE), "ADS1015_setGain"); .appendField(new Blockly.FieldDropdown(ADS1015_setGain.GAIN_TYPE), "ADS1015_setGain");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);

View File

@@ -37,7 +37,7 @@ export const math_arithmetic = {
this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id4"); this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id4");
this.appendValueInput('B') this.appendValueInput('B')
.setCheck(null) .setCheck(null)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(math_arithmetic.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
// Assign 'this' to a variable for use in the tooltip closure below. // Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this; var thisBlock = this;
@@ -72,7 +72,7 @@ export const math_bit = {
.setCheck(Number); .setCheck(Number);
this.appendValueInput('B') this.appendValueInput('B')
.setCheck(Number) .setCheck(Number)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(math_bit.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
this.setTooltip(""); this.setTooltip("");
this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id8"); this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id8");
@@ -97,7 +97,7 @@ export const math_trig = {
this.setOutput(true, Number); this.setOutput(true, Number);
this.appendValueInput('NUM') this.appendValueInput('NUM')
.setCheck(Number) .setCheck(Number)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(math_trig.OPERATORS), 'OP');
// Assign 'this' to a variable for use in the tooltip closure below. // Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this; var thisBlock = this;
this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id17"); this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id17");
@@ -137,7 +137,7 @@ export const math_to_int = {
this.setColour(MATH_HUE); this.setColour(MATH_HUE);
this.appendValueInput('A') this.appendValueInput('A')
.setCheck(Number) .setCheck(Number)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(math_to_int.OPERATORS), 'OP');
this.setOutput(true, Number); this.setOutput(true, Number);
this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id18"); this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/04.Mathematics.html#id18");
var thisBlock = this; var thisBlock = this;
@@ -169,7 +169,7 @@ export const math_to_int = {
export const arduino_variate_type = { export const arduino_variate_type = {
init: function () { init: function () {
this.appendDummyInput() this.appendDummyInput()
.appendField(new Blockly.FieldDropdown(this.DATATYPES), "variate_type"); .appendField(new Blockly.FieldDropdown(arduino_variate_type.DATATYPES), "variate_type");
this.setOutput(true, null); this.setOutput(true, null);
this.setColour(MATH_HUE); this.setColour(MATH_HUE);
this.setTooltip(""); this.setTooltip("");
@@ -216,7 +216,7 @@ export const math_max_min = {
this.appendValueInput('A') this.appendValueInput('A')
.setCheck(Number) .setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP') .appendField(new Blockly.FieldDropdown(math_max_min.OPERATORS), 'OP')
.appendField('('); .appendField('(');
this.appendValueInput('B') this.appendValueInput('B')
.setCheck(Number) .setCheck(Number)

View File

@@ -6,7 +6,7 @@ export const SCoopTask = {
init: function () { init: function () {
this.appendDummyInput() this.appendDummyInput()
.appendField("Scoop Task") .appendField("Scoop Task")
.appendField(new Blockly.FieldDropdown(this.NUMBER), "_tasknum"); .appendField(new Blockly.FieldDropdown(SCoopTask.NUMBER), "_tasknum");
this.appendStatementInput("setup") this.appendStatementInput("setup")
.appendField(Blockly.Msg.MIXLY_SETUP) .appendField(Blockly.Msg.MIXLY_SETUP)
.setCheck(null); .setCheck(null);

View File

@@ -144,7 +144,7 @@ export const ds18b20 = {
.appendField(Blockly.Msg.MIXLY_DS18B20) .appendField(Blockly.Msg.MIXLY_DS18B20)
.appendField(new Blockly.FieldDropdown(Profile.default.digital), "PIN") .appendField(new Blockly.FieldDropdown(Profile.default.digital), "PIN")
.appendField(Blockly.Msg.MIXLY_GETTEMPERATUE) .appendField(Blockly.Msg.MIXLY_GETTEMPERATUE)
.appendField(new Blockly.FieldDropdown(this.UNIT), "UNIT"); .appendField(new Blockly.FieldDropdown(ds18b20.UNIT), "UNIT");
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_DS18); this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_DS18);
}, },
@@ -176,7 +176,7 @@ export const mlx90614_get_data = {
this.appendDummyInput() this.appendDummyInput()
.appendField("MLX90614" + Blockly.Msg.MLX90614_TYPE) .appendField("MLX90614" + Blockly.Msg.MLX90614_TYPE)
.appendField(Blockly.Msg.MIXLY_GET) .appendField(Blockly.Msg.MIXLY_GET)
.appendField(new Blockly.FieldDropdown(this.DATA_TYPE), "mlx90614_data"); .appendField(new Blockly.FieldDropdown(mlx90614_get_data.DATA_TYPE), "mlx90614_data");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true, null); this.setOutput(true, null);
this.setColour(40); this.setColour(40);
@@ -246,7 +246,7 @@ export const DS1307_init = {
.appendField(Blockly.Msg.MIXLY_RTCINIT); .appendField(Blockly.Msg.MIXLY_RTCINIT);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.RTC_TYPE), 'RTCType'); .appendField(new Blockly.FieldDropdown(DS1307_init.RTC_TYPE), 'RTCType');
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(Blockly.Msg.MIXLY_PIN); .appendField(Blockly.Msg.MIXLY_PIN);
@@ -277,7 +277,7 @@ export const RTC_get_time = {
//.appendField(new Blockly.FieldTextInput('myRTC'), 'RTCName'); //.appendField(new Blockly.FieldTextInput('myRTC'), 'RTCName');
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.RTC_TIME_TYPE), "TIME_TYPE"); .appendField(new Blockly.FieldDropdown(RTC_get_time.RTC_TIME_TYPE), "TIME_TYPE");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_RTC_GETTIME.replace('%1', this.getFieldValue("TIME_TYPE"))); this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_RTC_GETTIME.replace('%1', this.getFieldValue("TIME_TYPE")));
@@ -392,7 +392,7 @@ export const SHT20 = {
.appendField("SHT20" + Blockly.Msg.MIXLY_DHT11_T_H); .appendField("SHT20" + Blockly.Msg.MIXLY_DHT11_T_H);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.SHT20_TYPE), "SHT20_TYPE"); .appendField(new Blockly.FieldDropdown(SHT20.SHT20_TYPE), "SHT20_TYPE");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
this.setTooltip(); this.setTooltip();
@@ -411,7 +411,7 @@ export const ADXL345 = {
.appendField(Blockly.Msg.MIXLY_ADXL345); .appendField(Blockly.Msg.MIXLY_ADXL345);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.ADXL345_GETAB), "ADXL345_PIN"); .appendField(new Blockly.FieldDropdown(ADXL345.ADXL345_GETAB), "ADXL345_PIN");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
this.setTooltip(); this.setTooltip();
@@ -799,7 +799,7 @@ export const PS2_Button = {
this.setColour(SENSOR_HUE); this.setColour(SENSOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.PS2_BUTTON) .appendField(Blockly.Msg.PS2_BUTTON)
.appendField(new Blockly.FieldDropdown(this.PSBUTTON), "psbt") .appendField(new Blockly.FieldDropdown(PS2_Button.PSBUTTON), "psbt")
.appendField(Blockly.Msg.MIXLY_PULSEIN_STAT) .appendField(Blockly.Msg.MIXLY_PULSEIN_STAT)
.appendField(new Blockly.FieldDropdown([ .appendField(new Blockly.FieldDropdown([
[Blockly.Msg.MIXLY_BUTTON_HOLD, "Button"], [Blockly.Msg.MIXLY_BUTTON_HOLD, "Button"],
@@ -835,7 +835,7 @@ export const PS2_stk = {
this.setColour(SENSOR_HUE); this.setColour(SENSOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.PS2_stick) .appendField(Blockly.Msg.PS2_stick)
.appendField(new Blockly.FieldDropdown(this.PSSTK), "psstk"); .appendField(new Blockly.FieldDropdown(PS2_stk.PSSTK), "psstk");
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(''); this.setTooltip('');
}, },
@@ -852,7 +852,7 @@ export const TCS34725_Get_RGB = {
this.setColour(SENSOR_HUE); this.setColour(SENSOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.TCS34725_Get_RGB) .appendField(Blockly.Msg.TCS34725_Get_RGB)
.appendField(new Blockly.FieldDropdown(this.DF_TCS34725_COLOR), "DF_TCS34725_COLOR"); .appendField(new Blockly.FieldDropdown(TCS34725_Get_RGB.DF_TCS34725_COLOR), "DF_TCS34725_COLOR");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
}, },
@@ -1072,7 +1072,7 @@ export const mixgo_MPU9250 = {
.appendField("MPU9250" + Blockly.Msg.MixGo_MPU9250); .appendField("MPU9250" + Blockly.Msg.MixGo_MPU9250);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.MixGo_MPU9250_GETAB), "MixGo_MPU9250_GETAB"); .appendField(new Blockly.FieldDropdown(mixgo_MPU9250.MixGo_MPU9250_GETAB), "MixGo_MPU9250_GETAB");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
this.setTooltip(""); this.setTooltip("");

View File

@@ -99,7 +99,7 @@ export const sd_volume = {
this.setColour(STORAGE_HUE); this.setColour(STORAGE_HUE);
this.appendDummyInput() this.appendDummyInput()
.appendField("SD") .appendField("SD")
.appendField(new Blockly.FieldDropdown(this.VOLUME_TYPE), 'volume_TYPE'); .appendField(new Blockly.FieldDropdown(sd_volume.VOLUME_TYPE), 'volume_TYPE');
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(); this.setTooltip();
}, },
@@ -285,7 +285,7 @@ export const simple_spiffs_store_spiffs_write = {
.appendField(Blockly.Msg.MIXLY_SD_NEWLINE); .appendField(Blockly.Msg.MIXLY_SD_NEWLINE);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MODE) .appendField(Blockly.Msg.MIXLY_MODE)
.appendField(new Blockly.FieldDropdown(this.OPEN_MODE), 'MODE'); .appendField(new Blockly.FieldDropdown(simple_spiffs_store_spiffs_write.OPEN_MODE), 'MODE');
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_STORE_SDWRITE); this.setTooltip(Blockly.Msg.MIXLY_TOOLTIP_STORE_SDWRITE);

View File

@@ -201,7 +201,7 @@ export const text_equals_starts_ends = {
this.appendValueInput("STR1") this.appendValueInput("STR1")
.setCheck([String, Number]); .setCheck([String, Number]);
this.appendValueInput("STR2") this.appendValueInput("STR2")
.appendField(new Blockly.FieldDropdown(this.TEXT_DOWHAT), 'DOWHAT') .appendField(new Blockly.FieldDropdown(text_equals_starts_ends.TEXT_DOWHAT), 'DOWHAT')
.setCheck([String, Number]); .setCheck([String, Number]);
this.setOutput(true, [Boolean, Number]); this.setOutput(true, [Boolean, Number]);
this.setInputsInline(true); this.setInputsInline(true);

View File

@@ -81,7 +81,7 @@ export const handbit_MSA300 = {
.appendField(Blockly.Msg.MixGo_MPU9250); .appendField(Blockly.Msg.MixGo_MPU9250);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.HANDBIT_MSA300_GETAB), "HANDBIT_MSA300_GETAB"); .appendField(new Blockly.FieldDropdown(handbit_MSA300.HANDBIT_MSA300_GETAB), "HANDBIT_MSA300_GETAB");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
this.setTooltip(""); this.setTooltip("");
@@ -101,7 +101,7 @@ export const handbit_MSA300_action = {
.appendField(Blockly.Msg.Handbit); .appendField(Blockly.Msg.Handbit);
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.HANDBIT_MSA300_ACTION), "HANDBIT_MSA300_ACTION"); .appendField(new Blockly.FieldDropdown(handbit_MSA300_action.HANDBIT_MSA300_ACTION), "HANDBIT_MSA300_ACTION");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
this.setTooltip(""); this.setTooltip("");
@@ -138,7 +138,7 @@ export const handbit_rgb_rainbow3 = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RGB); .appendField(Blockly.Msg.MIXLY_RGB);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.DISPLAY_RAINBOW_TYPE), "TYPE"); .appendField(new Blockly.FieldDropdown(handbit_rgb_rainbow3.DISPLAY_RAINBOW_TYPE), "TYPE");
this.appendValueInput("rainbow_color") this.appendValueInput("rainbow_color")
.setCheck(Number) .setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)

View File

@@ -9,7 +9,7 @@ export const brightness_select = {
init: function () { init: function () {
this.setColour(DISPLAY_HUE); this.setColour(DISPLAY_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.BRIGHTNESS_SELECT), 'STAT'); .appendField(new Blockly.FieldDropdown(brightness_select.BRIGHTNESS_SELECT), 'STAT');
this.setOutput(true, Number); this.setOutput(true, Number);
}, },
BRIGHTNESS_SELECT: [ BRIGHTNESS_SELECT: [
@@ -84,7 +84,7 @@ export const mixepi_ADXL345_action = {
.appendField("MIXEPI"); .appendField("MIXEPI");
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(new Blockly.FieldDropdown(this.MIXEPI_ADXL345_ACTION), "MIXEPI_ADXL345_ACTION"); .appendField(new Blockly.FieldDropdown(mixepi_ADXL345_action.MIXEPI_ADXL345_ACTION), "MIXEPI_ADXL345_ACTION");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
this.setTooltip(""); this.setTooltip("");
@@ -121,7 +121,7 @@ export const mixepi_rgb_rainbow3 = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RGB); .appendField(Blockly.Msg.MIXLY_RGB);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.DISPLAY_RAINBOW_TYPE), "TYPE"); .appendField(new Blockly.FieldDropdown(mixepi_rgb_rainbow3.DISPLAY_RAINBOW_TYPE), "TYPE");
this.appendValueInput("rainbow_color") this.appendValueInput("rainbow_color")
.setCheck(Number) .setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)

View File

@@ -37,7 +37,7 @@ export const HT16K33_POS = {
this.appendDummyInput("") this.appendDummyInput("")
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)
.appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT) .appendField(Blockly.Msg.MIXLY_DISPLAY_MATRIX_SHOWPOINT)
.appendField(new Blockly.FieldDropdown(this.DRAW_TYPE), "DrawPixel_TYPE"); .appendField(new Blockly.FieldDropdown(HT16K33_POS.DRAW_TYPE), "DrawPixel_TYPE");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true); this.setPreviousStatement(true);
this.setNextStatement(true); this.setNextStatement(true);
@@ -447,7 +447,7 @@ export const MixGo_rgb_rainbow3 = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RGB); .appendField(Blockly.Msg.MIXLY_RGB);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.DISPLAY_RAINBOW_TYPE), "TYPE"); .appendField(new Blockly.FieldDropdown(MixGo_rgb_rainbow3.DISPLAY_RAINBOW_TYPE), "TYPE");
this.appendValueInput("rainbow_color") this.appendValueInput("rainbow_color")
.setCheck(Number) .setCheck(Number)
.setAlign(Blockly.inputs.Align.RIGHT) .setAlign(Blockly.inputs.Align.RIGHT)

View File

@@ -56,7 +56,7 @@ export const ESP_TCS34725_Get_RGB = {
this.setColour(SENSOR_HUE); this.setColour(SENSOR_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.TCS34725_Get_RGB) .appendField(Blockly.Msg.TCS34725_Get_RGB)
.appendField(new Blockly.FieldDropdown(this.TCS34725_COLOR), "TCS34725_COLOR"); .appendField(new Blockly.FieldDropdown(ESP_TCS34725_Get_RGB.TCS34725_COLOR), "TCS34725_COLOR");
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
}, },

View File

@@ -29,7 +29,7 @@ export const spiffs_open_file = {
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MODE); .appendField(Blockly.Msg.MIXLY_MODE);
this.appendDummyInput() this.appendDummyInput()
.appendField(new Blockly.FieldDropdown(this.OPEN_MODE), 'MODE'); .appendField(new Blockly.FieldDropdown(spiffs_open_file.OPEN_MODE), 'MODE');
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);

View File

@@ -103,7 +103,7 @@ export const controls_whileUntil = {
this.appendValueInput('BOOL') this.appendValueInput('BOOL')
.setCheck([Boolean, Number]) .setCheck([Boolean, Number])
.appendField(Blockly.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT) .appendField(Blockly.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'MODE'); .appendField(new Blockly.FieldDropdown(controls_whileUntil.OPERATORS), 'MODE');
this.appendStatementInput('DO') this.appendStatementInput('DO')
.appendField(Blockly.Msg.MIXLY_DO); .appendField(Blockly.Msg.MIXLY_DO);
this.setPreviousStatement(true); this.setPreviousStatement(true);
@@ -127,7 +127,7 @@ export const controls_whileUntil = {
export const controls_flow_statements = { export const controls_flow_statements = {
init: function () { init: function () {
this.setColour(LOOPS_HUE); this.setColour(LOOPS_HUE);
var dropdown = new Blockly.FieldDropdown(this.OPERATORS); var dropdown = new Blockly.FieldDropdown(controls_flow_statements.OPERATORS);
this.appendDummyInput() this.appendDummyInput()
.appendField(dropdown, 'FLOW') .appendField(dropdown, 'FLOW')
.appendField(Blockly.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP); .appendField(Blockly.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP);

View File

@@ -944,7 +944,7 @@ export const image_shift = {
.setCheck(["esp32_image", "List", String]); .setCheck(["esp32_image", "List", String]);
this.appendDummyInput('') this.appendDummyInput('')
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET2) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET2)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(image_shift.OPERATORS), 'OP');
this.appendValueInput('val') this.appendValueInput('val')
.appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT) .appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT)
.setCheck(Number); .setCheck(Number);
@@ -983,7 +983,7 @@ export const image_arithmetic = {
.appendField(Blockly.Msg.MICROBIT_DISPLAY_MERGE_SHAPE); .appendField(Blockly.Msg.MICROBIT_DISPLAY_MERGE_SHAPE);
this.appendValueInput('B') this.appendValueInput('B')
// .setCheck(["esp32_image", "List", String]) // .setCheck(["esp32_image", "List", String])
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(image_arithmetic.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
var thisBlock = this; var thisBlock = this;
this.setTooltip(function () { this.setTooltip(function () {
@@ -1300,7 +1300,7 @@ export const display_image_size = {
.setCheck("esp32_image") .setCheck("esp32_image")
// .appendField(Blockly.Msg.blockpy_USE_LIST); // .appendField(Blockly.Msg.blockpy_USE_LIST);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(display_image_size.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
var thisBlock = this; var thisBlock = this;
@@ -1332,7 +1332,7 @@ export const display_rect = {
.setCheck("var"); .setCheck("var");
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RECT) .appendField(Blockly.Msg.MIXLY_RECT)
.appendField(new Blockly.FieldDropdown(this.STATUS), 'OP') .appendField(new Blockly.FieldDropdown(display_rect.STATUS), 'OP')
// this.appendValueInput("PIN", Number) // this.appendValueInput("PIN", Number)
// .setCheck(Number) // .setCheck(Number)
// .setAlign(Blockly.inputs.Align.RIGHT) // .setAlign(Blockly.inputs.Align.RIGHT)
@@ -1736,7 +1736,7 @@ export const display_animate = {
this.setOutput(true, 'Tuple'); this.setOutput(true, 'Tuple');
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_ESP32_DISPLAY_ANIMATE) .appendField(Blockly.Msg.MIXLY_ESP32_DISPLAY_ANIMATE)
.appendField(new Blockly.FieldDropdown(this.ANIMATE), 'ANIMATION') .appendField(new Blockly.FieldDropdown(display_animate.ANIMATE), 'ANIMATION')
//this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP); //this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP);
}, },
ANIMATE: [ ANIMATE: [
@@ -1753,7 +1753,7 @@ export const display_circle = {
.setCheck("var"); .setCheck("var");
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE) .appendField(Blockly.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)
.appendField(new Blockly.FieldDropdown(this.STATUS), 'OP') .appendField(new Blockly.FieldDropdown(display_circle.STATUS), 'OP')
this.jsonInit({ this.jsonInit({
"message0": Blockly.Msg.MIXLY_HANBIT_SHOW_CIRCLE, "message0": Blockly.Msg.MIXLY_HANBIT_SHOW_CIRCLE,
"args0": [ "args0": [
@@ -1798,7 +1798,7 @@ export const display_triangle = {
.setCheck("var"); .setCheck("var");
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_DISPLAY_DRAW + Blockly.Msg.MIXLY_HANBIT_DRAW_TRIANGLE) .appendField(Blockly.Msg.MIXLY_DISPLAY_DRAW + Blockly.Msg.MIXLY_HANBIT_DRAW_TRIANGLE)
.appendField(new Blockly.FieldDropdown(this.STATUS), 'OP') .appendField(new Blockly.FieldDropdown(display_triangle.STATUS), 'OP')
this.jsonInit({ this.jsonInit({
"message0": Blockly.Msg.MIXLY_HANBIT_SHOW_triangle, "message0": Blockly.Msg.MIXLY_HANBIT_SHOW_triangle,
"args0": [ "args0": [

View File

@@ -145,7 +145,7 @@ export const display_matrix_extern_shift = {
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET)
this.appendDummyInput('') this.appendDummyInput('')
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET2) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET2)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(display_matrix_extern_shift.OPERATORS), 'OP');
this.appendValueInput('val') this.appendValueInput('val')
.appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT) .appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT)
.setCheck(Number); .setCheck(Number);
@@ -264,7 +264,7 @@ export const display_matrix_extern_image_builtins = {
this.setColour(DISPLAY_EXTERN_HUE); this.setColour(DISPLAY_EXTERN_HUE);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MICROBIT_Built_in_image1) .appendField(Blockly.Msg.MIXLY_MICROBIT_Built_in_image1)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'image'); .appendField(new Blockly.FieldDropdown(display_matrix_extern_image_builtins.OPERATORS), 'image');
this.setOutput(true, "esp32_image"); this.setOutput(true, "esp32_image");
this.setInputsInline(true); this.setInputsInline(true);
this.setTooltip(Blockly.Msg.MIXLY_MICROBIT_Clear_display); this.setTooltip(Blockly.Msg.MIXLY_MICROBIT_Clear_display);
@@ -297,7 +297,7 @@ export const matrix_extern_image_arithmetic = {
.appendField(Blockly.Msg.MICROBIT_DISPLAY_MERGE_SHAPE); .appendField(Blockly.Msg.MICROBIT_DISPLAY_MERGE_SHAPE);
this.appendValueInput('B') this.appendValueInput('B')
// .setCheck(["esp32_image", "List", String]) // .setCheck(["esp32_image", "List", String])
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(matrix_extern_image_arithmetic.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
var thisBlock = this; var thisBlock = this;
this.setTooltip(function () { this.setTooltip(function () {
@@ -396,7 +396,7 @@ export const display_image_size = {
.setCheck("esp32_image") .setCheck("esp32_image")
// .appendField(Blockly.Msg.blockpy_USE_LIST); // .appendField(Blockly.Msg.blockpy_USE_LIST);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(display_image_size.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true); this.setOutput(true);
var thisBlock = this; var thisBlock = this;
@@ -428,7 +428,7 @@ export const display_rect = {
.setCheck("var"); .setCheck("var");
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_RECT) .appendField(Blockly.Msg.MIXLY_RECT)
.appendField(new Blockly.FieldDropdown(this.STATUS), 'OP') .appendField(new Blockly.FieldDropdown(display_rect.STATUS), 'OP')
// this.appendValueInput("PIN", Number) // this.appendValueInput("PIN", Number)
// .setCheck(Number) // .setCheck(Number)
// .setAlign(Blockly.inputs.Align.RIGHT) // .setAlign(Blockly.inputs.Align.RIGHT)
@@ -664,7 +664,7 @@ export const display_animate = {
this.setOutput(true, 'Tuple'); this.setOutput(true, 'Tuple');
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_ESP32_DISPLAY_ANIMATE) .appendField(Blockly.Msg.MIXLY_ESP32_DISPLAY_ANIMATE)
.appendField(new Blockly.FieldDropdown(this.ANIMATE), 'ANIMATION') .appendField(new Blockly.FieldDropdown(display_animate.ANIMATE), 'ANIMATION')
//this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP); //this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP);
}, },
ANIMATE: [ ANIMATE: [
@@ -681,7 +681,7 @@ export const display_circle = {
.setCheck("var"); .setCheck("var");
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE) .appendField(Blockly.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE)
.appendField(new Blockly.FieldDropdown(this.STATUS), 'OP') .appendField(new Blockly.FieldDropdown(display_circle.STATUS), 'OP')
this.jsonInit({ this.jsonInit({
"message0": Blockly.Msg.MIXLY_HANBIT_SHOW_CIRCLE, "message0": Blockly.Msg.MIXLY_HANBIT_SHOW_CIRCLE,
"args0": [ "args0": [
@@ -1540,7 +1540,7 @@ export const extern_oled_shift = {
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET)
this.appendDummyInput('') this.appendDummyInput('')
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET2) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET2)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(extern_oled_shift.OPERATORS), 'OP');
this.appendValueInput('val') this.appendValueInput('val')
.appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT) .appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT)
.setCheck(Number); .setCheck(Number);

View File

@@ -210,7 +210,7 @@ export const image_arithmetic = {
.appendField(Blockly.Msg.MICROBIT_DISPLAY_MERGE_SHAPE); .appendField(Blockly.Msg.MICROBIT_DISPLAY_MERGE_SHAPE);
this.appendValueInput('B') this.appendValueInput('B')
// .setCheck(["esp32_image", "List", String]) // .setCheck(["esp32_image", "List", String])
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(image_arithmetic.OPERATORS), 'OP');
this.setInputsInline(true); this.setInputsInline(true);
var thisBlock = this; var thisBlock = this;
this.setTooltip(function () { this.setTooltip(function () {
@@ -251,7 +251,7 @@ export const display_shift = {
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET)
this.appendDummyInput('') this.appendDummyInput('')
.appendField(Blockly.Msg.DISPLAY_IMAGE_LET2) .appendField(Blockly.Msg.DISPLAY_IMAGE_LET2)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(display_shift.OPERATORS), 'OP');
this.appendValueInput('val') this.appendValueInput('val')
.appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT) .appendField(Blockly.Msg.DISPLAY_IMAGE_SHIFT)
.setCheck(Number); .setCheck(Number);
@@ -416,7 +416,7 @@ export const mixgome_display_font = {
this.setColour(DISPLAY_ONBOARD_HUE); this.setColour(DISPLAY_ONBOARD_HUE);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.OLED_SET_FONT) .appendField(Blockly.Msg.OLED_SET_FONT)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(mixgome_display_font.OPERATORS), 'OP');
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setInputsInline(true); this.setInputsInline(true);
@@ -721,7 +721,7 @@ export const mpython_pbm_image = {
init: function () { init: function () {
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MICROBIT_Built_in_image1) .appendField(Blockly.Msg.MIXLY_MICROBIT_Built_in_image1)
.appendField(new Blockly.FieldDropdown(this.IMAGES), 'path'); .appendField(new Blockly.FieldDropdown(mpython_pbm_image.IMAGES), 'path');
this.setColour(DISPLAY_ONBOARD_HUE); this.setColour(DISPLAY_ONBOARD_HUE);
this.setOutput(true); this.setOutput(true);
}, },
@@ -886,7 +886,7 @@ export const mixbot_display_rotate = {
this.setColour(DISPLAY_ONBOARD_HUE); this.setColour(DISPLAY_ONBOARD_HUE);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.MIXLY_MIXBOT_SCREEN_ROTATE) .appendField(Blockly.Msg.MIXLY_MIXBOT_SCREEN_ROTATE)
.appendField(new Blockly.FieldDropdown(this.OPERATORS), 'OP'); .appendField(new Blockly.FieldDropdown(mixbot_display_rotate.OPERATORS), 'OP');
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setInputsInline(true); this.setInputsInline(true);

View File

@@ -416,7 +416,7 @@ export const requests_attribute = {
this.setColour(NETWORK_HUE); this.setColour(NETWORK_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MICROBIT_JS_GET) .appendField(Blockly.Msg.MIXLY_MICROBIT_JS_GET)
.appendField(new Blockly.FieldDropdown(this.ATTR), 'ATTR') .appendField(new Blockly.FieldDropdown(requests_attribute.ATTR), 'ATTR')
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true, String); this.setOutput(true, String);
var thisBlock = this; var thisBlock = this;
@@ -446,7 +446,7 @@ export const requests_method = {
this.setColour(NETWORK_HUE); this.setColour(NETWORK_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.blockpy_CONDUCT) .appendField(Blockly.Msg.blockpy_CONDUCT)
.appendField(new Blockly.FieldDropdown(this.METHOD), 'DIR') .appendField(new Blockly.FieldDropdown(requests_method.METHOD), 'DIR')
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.blockpy_REQUESTS) .appendField(Blockly.Msg.blockpy_REQUESTS)
this.setInputsInline(true); this.setInputsInline(true);
@@ -557,7 +557,7 @@ export const requests_attribute2 = {
this.setColour(COMMUNICATE_HUE); this.setColour(COMMUNICATE_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_MICROBIT_JS_GET) .appendField(Blockly.Msg.MIXLY_MICROBIT_JS_GET)
.appendField(new Blockly.FieldDropdown(this.ATTR), 'ATTR') .appendField(new Blockly.FieldDropdown(requests_attribute2.ATTR), 'ATTR')
this.setInputsInline(true); this.setInputsInline(true);
this.setOutput(true, String); this.setOutput(true, String);
}, },

View File

@@ -539,7 +539,7 @@ export const sensor_dht11 = {
.appendField(Blockly.Msg.MIXLY_PIN) .appendField(Blockly.Msg.MIXLY_PIN)
.setCheck(Number); .setCheck(Number);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.METHOD), "WHAT"); .appendField(new Blockly.FieldDropdown(sensor_dht11.METHOD), "WHAT");
this.setOutput(true, Number); this.setOutput(true, Number);
var thisBlock = this; var thisBlock = this;
this.setTooltip(function () { this.setTooltip(function () {

View File

@@ -182,7 +182,7 @@ export const sensor_dht11 = {
.appendField(Blockly.Msg.MIXLY_PIN) .appendField(Blockly.Msg.MIXLY_PIN)
.setCheck(Number); .setCheck(Number);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown(this.METHOD), "WHAT"); .appendField(new Blockly.FieldDropdown(sensor_dht11.METHOD), "WHAT");
this.setOutput(true, Number); this.setOutput(true, Number);
var thisBlock = this; var thisBlock = this;
this.setTooltip(function () { this.setTooltip(function () {
@@ -1665,7 +1665,7 @@ export const PS2_stk = {
this.setColour(SENSOR_EXTERN_HUE); this.setColour(SENSOR_EXTERN_HUE);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.PS2_stick) .appendField(Blockly.Msg.PS2_stick)
.appendField(new Blockly.FieldDropdown(this.PSSTK), "psstk"); .appendField(new Blockly.FieldDropdown(PS2_stk.PSSTK), "psstk");
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(''); this.setTooltip('');
}, },
@@ -1739,7 +1739,7 @@ export const PS2_stk_new = {
.appendField(Blockly.Msg.PS2); .appendField(Blockly.Msg.PS2);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(Blockly.Msg.MIXLY_JOYSTICK) .appendField(Blockly.Msg.MIXLY_JOYSTICK)
.appendField(new Blockly.FieldDropdown(this.PSSTK), "psstk"); .appendField(new Blockly.FieldDropdown(PS2_stk_new.PSSTK), "psstk");
this.setOutput(true, Number); this.setOutput(true, Number);
this.setTooltip(''); this.setTooltip('');
}, },