Update(boards): 为一些块添加deprecated标志,将在未来移除

This commit is contained in:
王立帮
2025-03-24 14:54:45 +08:00
parent f26b15b07b
commit a3dbab66e1
2 changed files with 126 additions and 25 deletions

View File

@@ -832,8 +832,6 @@ export const mpython_pbm_image = {
["Water_level_1", "Water_level_1"],
["Water_level_2", "Water_level_2"],
["Water_level_3", "Water_level_3"],
],
"type": "field_dropdown"
}
@@ -941,19 +939,6 @@ export const bitbot_display_image_create = {
}
};
//mixgo_nova onboard tft below:
export const onboard_tft_show_image = {
init: function () {
this.setColour(DISPLAY_ONBOARD_HUE);
this.appendValueInput('data')
.appendField(Blockly.Msg.OLED_BITMAP);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setInputsInline(true);
this.setTooltip(Blockly.Msg.OLED_BITMAP_OR_STRING);
}
};
export const onboard_tft_show_image_xy = {
init: function () {
this.setColour(DISPLAY_ONBOARD_HUE);
@@ -1368,4 +1353,94 @@ export const draw_pointer = {
this.setInputsInline(true);
this.setTooltip(Blockly.Msg.DRAW_POINTER_TOOLTIP);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_show_image = {
init: function () {
this.setColour(DISPLAY_ONBOARD_HUE);
this.appendValueInput('data')
.appendField(Blockly.Msg.OLED_BITMAP);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setInputsInline(true);
this.setTooltip(Blockly.Msg.OLED_BITMAP_OR_STRING);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_scroll_string = {
init: function () {
display_scroll_string.init.call(this);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_show_frame_string = {
init: function () {
display_show_frame_string.init.call(this);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_shift = {
init: function () {
display_shift.init.call(this);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_get_screen_pixel = {
init: function () {
display_get_screen_pixel.init.call(this);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_bright_screen = {
init: function () {
display_bright_screen.init.call(this);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_clear = {
init: function () {
display_clear.init.call(this);
this.appendDummyInput()
.appendField(`(${Blockly.Msg.MIXLY_DEPRECATED})`);
this.setWarningText(Blockly.Msg.MIXLY_DEPRECATED_WARNING_TEXT);
}
};

View File

@@ -659,15 +659,6 @@ export const bitbot_display_image_create = function (block, generator) {
return [code, generator.ORDER_ATOMIC];
}
//mixgo_nova onboard tft below:
export const onboard_tft_show_image = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
generator.definitions_['import_' + version + '_onboard_tft'] = "from " + version + " import onboard_tft";
var data = generator.valueToCode(this, 'data', generator.ORDER_ASSIGNMENT);
var code = "onboard_tft.image(" + data + ", color=0xffff)\n";
return code;
}
export const onboard_tft_show_image_xy = function (_, generator) {
var version = Boards.getSelectedBoardKey().split(':')[2];
generator.definitions_['import_' + version + '_onboard_tft'] = "from " + version + " import onboard_tft";
@@ -945,4 +936,39 @@ export const draw_pointer = function(_, generator) {
var angle = generator.valueToCode(this, 'angle', generator.ORDER_ASSIGNMENT);
var code = "onboard_matrix.pointern(angle=" + angle + ")\n";
return code;
}
}
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_show_image = display_show_image;
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_scroll_string = display_scroll_string;
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_show_frame_string = display_get_screen_pixel;
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_shift = display_shift;
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_get_screen_pixel = display_get_screen_pixel;
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_bright_screen = display_bright_screen;
/**
* @deprecated To be removed in the future
*/
export const onboard_tft_clear = display_clear;