feat(boards): 物联网 分类下添加 TinyWebDB 分类
This commit is contained in:
@@ -778,4 +778,123 @@ export const ollama_empty_history = {
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
const TINY_WEB_DB = 0;
|
||||
|
||||
export const iot_tiny_web_db_init = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField(`${Blockly.Msg.MIXLY_SETUP} TinyWebDB`);
|
||||
this.appendValueInput('ADDR')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_EMQX_SERVER);
|
||||
this.appendValueInput('USERNAME')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_EMQX_USERNAME);
|
||||
this.appendValueInput('PASSWORD')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_EMQX_PASSWORD);
|
||||
this.setInputsInline(false);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const iot_tiny_web_db_init_with_mqtt = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField(`${Blockly.Msg.MIXLY_SETUP} TinyWebDB`);
|
||||
this.appendValueInput('MQTT')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(`MixIO ${Blockly.Msg.MIXLY_Client}`);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const iot_tiny_web_db_update = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField('TinyWebDB');
|
||||
this.appendValueInput('TAG')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_UPDATE_VARIABLE);
|
||||
this.appendValueInput('VALUE')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.DICTS_ADD_VALUE);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const iot_tiny_web_db_get = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField('TinyWebDB');
|
||||
this.appendValueInput('TAG')
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.DICTS_ADD_VALUE);
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const iot_tiny_web_db_count = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField('TinyWebDB');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_NUM);
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const iot_tiny_web_db_search = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField('TinyWebDB')
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_SEARCH_VARIABLES);
|
||||
this.appendValueInput('NO')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_START_NUMBER);
|
||||
this.appendValueInput('COUNT')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_VARIABLE_NUMBER);
|
||||
this.appendValueInput('TAG')
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_SEARCH_VARS);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_ALL, 'both'],
|
||||
[Blockly.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_TAG, 'tag'],
|
||||
[Blockly.Msg.MIXLY_TINY_WEB_DB_GET_VARIABLES_VALUE, 'value']
|
||||
]), 'DTYPE');
|
||||
this.setInputsInline(false);
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const iot_tiny_web_db_delete = {
|
||||
init: function () {
|
||||
this.setColour(TINY_WEB_DB);
|
||||
this.appendDummyInput()
|
||||
.appendField('TinyWebDB');
|
||||
this.appendValueInput('TAG')
|
||||
.appendField(Blockly.Msg.MIXLY_TINY_WEB_DB_DELETE_VARIABLE);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user