diff --git a/boards/default_src/micropython/blocks/iot.js b/boards/default_src/micropython/blocks/iot.js index 72656c18..cc69804d 100644 --- a/boards/default_src/micropython/blocks/iot.js +++ b/boards/default_src/micropython/blocks/iot.js @@ -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); + } }; \ No newline at end of file diff --git a/boards/default_src/micropython/generators/iot.js b/boards/default_src/micropython/generators/iot.js index 1c30b2de..0f0cd509 100644 --- a/boards/default_src/micropython/generators/iot.js +++ b/boards/default_src/micropython/generators/iot.js @@ -310,4 +310,52 @@ export const use_ollama_llm_to_chat_return = function (_, generator) { export const ollama_empty_history = function () { var code = 'llm.empty_history()\n'; return code; +} + +export const iot_tiny_web_db_init = function (_,generator) { + generator.definitions_['import_tiny_webdb'] = "import tiny_webdb"; + const addr = generator.valueToCode(this, 'ADDR', generator.ORDER_ATOMIC); + const username = generator.valueToCode(this, 'USERNAME', generator.ORDER_ATOMIC); + const password = generator.valueToCode(this, 'PASSWORD', generator.ORDER_ATOMIC); + const code = `webdb = tiny_webdb.TinyWebDB(${addr}, ${username}, ${password})\n`; + return code; +} + +export const iot_tiny_web_db_init_with_mqtt = function (_,generator) { + const mqtt = generator.valueToCode(this, 'MQTT', generator.ORDER_ATOMIC); + const code = `webdb = tiny_webdb.TinyWebDB(${mqtt})\n`; + return code; +} + +export const iot_tiny_web_db_update = function (_,generator) { + const tag = generator.valueToCode(this, 'TAG', generator.ORDER_ATOMIC); + const value = generator.valueToCode(this, 'VALUE', generator.ORDER_ATOMIC); + const code = `webdb.update(${tag}, ${value})\n`; + return code; +} + +export const iot_tiny_web_db_get = function (_,generator) { + const tag = generator.valueToCode(this, 'TAG', generator.ORDER_ATOMIC); + const code = `webdb.get(${tag})`; + return [code, generator.ORDER_ATOMIC]; +} + +export const iot_tiny_web_db_count = function (_,generator) { + const code = 'webdb.count()'; + return [code, generator.ORDER_ATOMIC]; +} + +export const iot_tiny_web_db_search = function (_,generator) { + const no = generator.valueToCode(this, 'NO', generator.ORDER_ATOMIC); + const count = generator.valueToCode(this, 'COUNT', generator.ORDER_ATOMIC); + const tag = generator.valueToCode(this, 'TAG', generator.ORDER_ATOMIC); + const dtype = this.getFieldValue('DTYPE'); + const code = `webdb.search(${no}, ${count}, ${tag}, '${dtype}')`; + return [code, generator.ORDER_ATOMIC]; +} + +export const iot_tiny_web_db_delete = function (_,generator) { + const tag = generator.valueToCode(this, 'TAG', generator.ORDER_ATOMIC); + const code = `webdb.delete(${tag})\n`; + return code; } \ No newline at end of file diff --git a/boards/default_src/micropython/origin/build/lib/mixiot.py b/boards/default_src/micropython/origin/build/lib/mixiot.py index 28822d7d..15f5c1f1 100644 --- a/boards/default_src/micropython/origin/build/lib/mixiot.py +++ b/boards/default_src/micropython/origin/build/lib/mixiot.py @@ -1,6 +1,5 @@ import time import usocket as socket -import urequests as requests import ustruct as struct from machine import unique_id from ubinascii import hexlify @@ -41,8 +40,9 @@ def image_base64(path="mixly.jpg"): return b'data:image/jpg;base64,' + b64encode(path) def ntp(url='mixio.mixly.cn'): + import urequests try: - results=eval(requests.get('http://{}/time.php'.format(url)).text) + results=eval(urequests.get('http://{}/time.php'.format(url)).text) except Exception as e: raise RuntimeError("API request failed or WiFi is not connected",e) return results @@ -72,6 +72,7 @@ class MQTTClient: port = 8883 if ssl else 1883 self.client_id = client_id self.sock = None + self.server = server self.addr = socket.getaddrinfo(server, port)[0][-1] self.ssl = ssl self.ssl_params = ssl_params @@ -86,7 +87,6 @@ class MQTTClient: self.lw_retain = False self._on_message_filtered = MQTTMatcher() self._star_time = time.ticks_ms() - self._tiny_web_db = TinyWebDB("", username, password) def _send_str(self, s): self.sock.write(struct.pack("!H", str_len(s))) @@ -343,85 +343,5 @@ class MQTTClient: self.ping() return self.wait_msg() - def tiny_web_db_update(self, url, key, value): - self._tiny_web_db.set_url(url) - return self._tiny_web_db.update(key, value) - - def tiny_web_db_get(self, url, key): - self._tiny_web_db.set_url(url) - return self._tiny_web_db.get(key) - - def tiny_web_db_count(self, url): - self._tiny_web_db.set_url(url) - return self._tiny_web_db.count() - - def tiny_web_db_search(self, url, no=1, count=1, tag='', dtype='both'): - self._tiny_web_db.set_url(url) - return self._tiny_web_db.search(no, count, tag, dtype) - - def tiny_web_db_delete(self, url, key): - self._tiny_web_db.set_url(url) - return self._tiny_web_db.delete(key) - -class TinyWebDB: - def __init__(self, url, username, password): - self._api_url = "" - self._username = username - self._password = password - self.set_url(url) - - def update(self, key, value): - key = str(key) - value = str(value) - result = self._request("update", "tag={}&value={}".format(key, value)) - if result["status"] == "error": - raise RuntimeError(result["message"]) - - def get(self, key): - key = str(key) - result = self._request("get", "tag={}".format(key)) - if result["status"] == "error": - raise RuntimeError(result["message"]) - return result["value"] - - def count(self): - result = self._request("count") - if result["status"] == "error": - raise RuntimeError(result["message"]) - return int(result["count"]) - - def search(self, no=1, count=1, tag='', dtype='both'): - no = str(no) - count = str(count) - result = self._request("search", "no={}&count={}&tag={}&type={}".format(no, count, tag, dtype)) - if result["status"] == "error": - raise RuntimeError(result["message"]) - return result["data"] - - def delete(self, key): - key = str(key) - result = self._request("delete", "tag={}".format(key)) - if result["status"] == "error": - raise RuntimeError(result["message"]) - - def set_url(self, url): - if url[-1] != '/': - url += '/' - self._api_url = url - - def _request(self, op, param=""): - data = "user={}&secret={}&action={}".format(self._username, self._password, op) - if param: - data += '&' + param - try: - headers = { - "Content-Type": "application/x-www-form-urlencoded" - } - response = requests.post(self._api_url, data=data, headers=headers) - result = {} - if response.status_code == 200: - result = response.json() - response.close() - return result - except Exception as e: - raise RuntimeError("API request failed or WiFi is not connected", e) \ No newline at end of file + def get_server_info(self): + return (self.server, self.username, self.password) diff --git a/boards/default_src/micropython/origin/build/lib/tiny_webdb.py b/boards/default_src/micropython/origin/build/lib/tiny_webdb.py new file mode 100644 index 00000000..b61263be --- /dev/null +++ b/boards/default_src/micropython/origin/build/lib/tiny_webdb.py @@ -0,0 +1,72 @@ +import urequests as requests + + +class TinyWebDB: + def __init__(self, url, username, password): + self._api_url = "" + self._username = username + self._password = password + self.set_url(url) + + def __init__(self, mqtt_client): + self._api_url = "" + url, username, password = mqtt_client.get_server_info() + self.set_url('https://{}:443'.format(url)) + self._username = username + self._password = password + + def update(self, key, value): + key = str(key) + value = str(value) + result = self._request("update", "tag={}&value={}".format(key, value)) + if result["status"] == "error": + raise RuntimeError(result["message"]) + + def get(self, key): + key = str(key) + result = self._request("get", "tag={}".format(key)) + if result["status"] == "error": + raise RuntimeError(result["message"]) + return result["value"] + + def count(self): + result = self._request("count") + if result["status"] == "error": + raise RuntimeError(result["message"]) + return int(result["count"]) + + def search(self, no=1, count=1, tag='', dtype='both'): + no = str(no) + count = str(count) + result = self._request("search", "no={}&count={}&tag={}&type={}".format(no, count, tag, dtype)) + if result["status"] == "error": + raise RuntimeError(result["message"]) + return result["data"] + + def delete(self, key): + key = str(key) + result = self._request("delete", "tag={}".format(key)) + if result["status"] == "error": + raise RuntimeError(result["message"]) + + def set_url(self, url): + if url[-1] != '/': + url += '/' + self._api_url = url + + def _request(self, op, param=""): + data = "user={}&secret={}&action={}".format(self._username, self._password, op) + if param: + data += '&' + param + try: + headers = { + "Content-Type": "application/x-www-form-urlencoded" + } + response = requests.post(self._api_url, data=data, headers=headers) + result = {} + if response.status_code == 200: + result = response.json() + response.close() + return result + except Exception as e: + raise RuntimeError("API request failed or WiFi is not connected", e) \ No newline at end of file diff --git a/boards/default_src/micropython_esp32/css/color_esp32_mixgo.css b/boards/default_src/micropython_esp32/css/color_esp32_mixgo.css index cfe73d8a..7be75f26 100644 --- a/boards/default_src/micropython_esp32/css/color_esp32_mixgo.css +++ b/boards/default_src/micropython_esp32/css/color_esp32_mixgo.css @@ -409,6 +409,16 @@ div.blocklyToolboxDiv>div.blocklyToolboxContents>div:nth-child(12)>div.blocklyTr background-size: 100% auto; } +#catTinyWebDB.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database.png') no-repeat; + background-size: 100% auto; +} + +#catTinyWebDB.blocklyTreeRow.blocklyTreeSelected>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database2.png') no-repeat; + background-size: 100% auto; +} + #catFactory.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { background: url('../../../../common/media/mark/factory3.png') no-repeat; background-size: 100% auto; diff --git a/boards/default_src/micropython_esp32/template.xml b/boards/default_src/micropython_esp32/template.xml index 1052d16e..3f870e36 100644 --- a/boards/default_src/micropython_esp32/template.xml +++ b/boards/default_src/micropython_esp32/template.xml @@ -2841,6 +2841,77 @@ + + + + + https://mixio.mixly.cn + + + + + username + + + + + password + + + + + + + mqtt_client + + + + + + + mixly + + + + + hello + + + + + + + mixly + + + + + + + + + 1 + + + + + 1 + + + + + mixly + + + + + + + mixly + + + + diff --git a/boards/default_src/micropython_esp32c2/css/color_esp32c3_mixgocc.css b/boards/default_src/micropython_esp32c2/css/color_esp32c3_mixgocc.css index 7a67282a..e471b651 100644 --- a/boards/default_src/micropython_esp32c2/css/color_esp32c3_mixgocc.css +++ b/boards/default_src/micropython_esp32c2/css/color_esp32c3_mixgocc.css @@ -427,6 +427,16 @@ div.blocklyToolboxDiv>div.blocklyToolboxContents>div:nth-child(12)>div.blocklyTr background-size: 100% auto; } +#catTinyWebDB.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database.png') no-repeat; + background-size: 100% auto; +} + +#catTinyWebDB.blocklyTreeRow.blocklyTreeSelected>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database2.png') no-repeat; + background-size: 100% auto; +} + #catAIOT.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { background: url('../../../../common/media/mark/ai.png') no-repeat; background-size: 100% auto; diff --git a/boards/default_src/micropython_esp32c2/template.xml b/boards/default_src/micropython_esp32c2/template.xml index bae21d91..3ac852a5 100644 --- a/boards/default_src/micropython_esp32c2/template.xml +++ b/boards/default_src/micropython_esp32c2/template.xml @@ -2739,6 +2739,77 @@ + + + + + https://mixio.mixly.cn + + + + + username + + + + + password + + + + + + + mqtt_client + + + + + + + mixly + + + + + hello + + + + + + + mixly + + + + + + + + + 1 + + + + + 1 + + + + + mixly + + + + + + + mixly + + + + diff --git a/boards/default_src/micropython_esp32c3/css/color_esp32c3_mixgocc.css b/boards/default_src/micropython_esp32c3/css/color_esp32c3_mixgocc.css index e5083a8e..5013b08b 100644 --- a/boards/default_src/micropython_esp32c3/css/color_esp32c3_mixgocc.css +++ b/boards/default_src/micropython_esp32c3/css/color_esp32c3_mixgocc.css @@ -408,6 +408,16 @@ div.blocklyToolboxDiv>div.blocklyToolboxContents>div:nth-child(12)>div.blocklyTr background-size: 100% auto; } +#catTinyWebDB.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database.png') no-repeat; + background-size: 100% auto; +} + +#catTinyWebDB.blocklyTreeRow.blocklyTreeSelected>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database2.png') no-repeat; + background-size: 100% auto; +} + #catAIOT.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { background: url('../../../../common/media/mark/ai.png') no-repeat; background-size: 100% auto; diff --git a/boards/default_src/micropython_esp32c3/template.xml b/boards/default_src/micropython_esp32c3/template.xml index 52fb6c22..6cc6d719 100644 --- a/boards/default_src/micropython_esp32c3/template.xml +++ b/boards/default_src/micropython_esp32c3/template.xml @@ -2623,6 +2623,77 @@ + + + + + https://mixio.mixly.cn + + + + + username + + + + + password + + + + + + + mqtt_client + + + + + + + mixly + + + + + hello + + + + + + + mixly + + + + + + + + + 1 + + + + + 1 + + + + + mixly + + + + + + + mixly + + + + diff --git a/boards/default_src/micropython_esp32s2/css/color_esp32s2_mixgoce.css b/boards/default_src/micropython_esp32s2/css/color_esp32s2_mixgoce.css index 5544f629..c3d44391 100644 --- a/boards/default_src/micropython_esp32s2/css/color_esp32s2_mixgoce.css +++ b/boards/default_src/micropython_esp32s2/css/color_esp32s2_mixgoce.css @@ -408,6 +408,16 @@ div.blocklyToolboxDiv>div.blocklyToolboxContents>div:nth-child(12)>div.blocklyTr background-size: 100% auto; } +#catTinyWebDB.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database.png') no-repeat; + background-size: 100% auto; +} + +#catTinyWebDB.blocklyTreeRow.blocklyTreeSelected>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database2.png') no-repeat; + background-size: 100% auto; +} + #catAIOT.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { background: url('../../../../common/media/mark/ai.png') no-repeat; background-size: 100% auto; diff --git a/boards/default_src/micropython_esp32s2/template.xml b/boards/default_src/micropython_esp32s2/template.xml index 2100b5c2..49b170a7 100644 --- a/boards/default_src/micropython_esp32s2/template.xml +++ b/boards/default_src/micropython_esp32s2/template.xml @@ -2661,6 +2661,77 @@ + + + + + https://mixio.mixly.cn + + + + + username + + + + + password + + + + + + + mqtt_client + + + + + + + mixly + + + + + hello + + + + + + + mixly + + + + + + + + + 1 + + + + + 1 + + + + + mixly + + + + + + + mixly + + + + diff --git a/boards/default_src/micropython_esp32s3/css/color_esp32s2_mixgoce.css b/boards/default_src/micropython_esp32s3/css/color_esp32s2_mixgoce.css index 62adb26c..bb528804 100644 --- a/boards/default_src/micropython_esp32s3/css/color_esp32s2_mixgoce.css +++ b/boards/default_src/micropython_esp32s3/css/color_esp32s2_mixgoce.css @@ -388,6 +388,16 @@ div.blocklyToolboxDiv>div.blocklyToolboxContents>div:nth-child(12)>div.blocklyTr background-size: 100% auto; } +#catTinyWebDB.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database.png') no-repeat; + background-size: 100% auto; +} + +#catTinyWebDB.blocklyTreeRow.blocklyTreeSelected>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database2.png') no-repeat; + background-size: 100% auto; +} + #catAIOT.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { background: url('../../../../common/media/mark/ai.png') no-repeat; background-size: 100% auto; diff --git a/boards/default_src/micropython_esp32s3/template.xml b/boards/default_src/micropython_esp32s3/template.xml index cfe1c8bf..df850542 100644 --- a/boards/default_src/micropython_esp32s3/template.xml +++ b/boards/default_src/micropython_esp32s3/template.xml @@ -3153,6 +3153,77 @@ + + + + + https://mixio.mixly.cn + + + + + username + + + + + password + + + + + + + mqtt_client + + + + + + + mixly + + + + + hello + + + + + + + mixly + + + + + + + + + 1 + + + + + 1 + + + + + mixly + + + + + + + mixly + + + + diff --git a/boards/default_src/micropython_robot/css/color_esp32_mixgo.css b/boards/default_src/micropython_robot/css/color_esp32_mixgo.css index 70d5446b..82c2b422 100644 --- a/boards/default_src/micropython_robot/css/color_esp32_mixgo.css +++ b/boards/default_src/micropython_robot/css/color_esp32_mixgo.css @@ -409,6 +409,16 @@ div.blocklyToolboxDiv>div.blocklyToolboxContents>div:nth-child(12)>div.blocklyTr background-size: 100% auto; } +#catTinyWebDB.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database.png') no-repeat; + background-size: 100% auto; +} + +#catTinyWebDB.blocklyTreeRow.blocklyTreeSelected>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { + background: url('../../../../common/media/mark/database2.png') no-repeat; + background-size: 100% auto; +} + #catFactory.blocklyTreeRow>div.blocklyTreeRowContentContainer>span.blocklyTreeIcon { background: url('../../../../common/media/mark/factory3.png') no-repeat; background-size: 100% auto; diff --git a/boards/default_src/micropython_robot/template.xml b/boards/default_src/micropython_robot/template.xml index 6fda6653..ac878294 100644 --- a/boards/default_src/micropython_robot/template.xml +++ b/boards/default_src/micropython_robot/template.xml @@ -2423,6 +2423,77 @@ + + + + + https://mixio.mixly.cn + + + + + username + + + + + password + + + + + + + mqtt_client + + + + + + + mixly + + + + + hello + + + + + + + mixly + + + + + + + + + 1 + + + + + 1 + + + + + mixly + + + + + + + mixly + + + + diff --git a/common/media/mark/database.png b/common/media/mark/database.png new file mode 100644 index 00000000..220e7229 Binary files /dev/null and b/common/media/mark/database.png differ diff --git a/common/media/mark/database2.png b/common/media/mark/database2.png new file mode 100644 index 00000000..5c7b246f Binary files /dev/null and b/common/media/mark/database2.png differ diff --git a/common/msg/blockly/en.js b/common/msg/blockly/en.js index 7e553f4e..ce5a62aa 100644 --- a/common/msg/blockly/en.js +++ b/common/msg/blockly/en.js @@ -175,7 +175,8 @@ En.MSG = { disablePythonToBlockly: "Blocks↔Code", enablePythonToBlockly: "Blocks↔Code", catSearch: "Search", - wiki: "Wiki" + wiki: "Wiki", + catTinyWebDB: "TinyWebDB" }; /* 多重选择 */ @@ -3995,4 +3996,16 @@ En.MIXLY_DISPLAY_SCROLL_WAY = 'direction of scrolling'; En.MIXLY_LIGHT_SENSOR2 = 'light sensor'; En.MIXLY_ROTARY_ENCODER = 'rotary encoder'; En.MIXLY_REVOLVE = 'revolue'; +En.MIXLY_TINY_WEB_DB_UPDATE_VARIABLE = 'Set variable'; +En.MIXLY_TINY_WEB_DB_GET_VARIABLE = 'Get variable'; +En.MIXLY_TINY_WEB_DB_SEARCH_VARIABLES = 'Search variables'; +En.MIXLY_TINY_WEB_DB_DELETE_VARIABLE = 'Delete variable'; +En.MIXLY_TINY_WEB_DB_GET_VARIABLES_NUM = 'Get the number of variables'; +En.MIXLY_TINY_WEB_DB_GET_VARIABLES_ALL = 'Return all data'; +En.MIXLY_TINY_WEB_DB_GET_VARIABLES_TAG = 'Return variable name'; +En.MIXLY_TINY_WEB_DB_GET_VARIABLES_VALUE = 'Return variable value'; +En.MIXLY_TINY_WEB_DB_START_NUMBER = 'Start number'; +En.MIXLY_TINY_WEB_DB_VARIABLE_NUMBER = 'Number of variables'; +En.MIXLY_TINY_WEB_DB_SEARCH_VARS = 'Characters in variable names'; + })(); diff --git a/common/msg/blockly/zh-hans.js b/common/msg/blockly/zh-hans.js index 4298978f..0a03b0ed 100644 --- a/common/msg/blockly/zh-hans.js +++ b/common/msg/blockly/zh-hans.js @@ -186,7 +186,8 @@ ZhHans.MSG = { disablePythonToBlockly: "图文互换", enablePythonToBlockly: "图文互换", catSearch: "查找", - wiki: "Wiki" + wiki: "Wiki", + catTinyWebDB: "TinyWebDB" }; /* 多重选择 */ @@ -4154,4 +4155,16 @@ ZhHans.MIXLY_DISPLAY_SCROLL_WAY = '滚动显示方向'; ZhHans.MIXLY_LIGHT_SENSOR2 = '光照传感器'; ZhHans.MIXLY_ROTARY_ENCODER = '旋转解码器'; ZhHans.MIXLY_REVOLVE = '旋'; +ZhHans.MIXLY_TINY_WEB_DB_UPDATE_VARIABLE = '设置变量'; +ZhHans.MIXLY_TINY_WEB_DB_GET_VARIABLE = '获取变量'; +ZhHans.MIXLY_TINY_WEB_DB_SEARCH_VARIABLES = '查询变量'; +ZhHans.MIXLY_TINY_WEB_DB_DELETE_VARIABLE = '删除变量'; +ZhHans.MIXLY_TINY_WEB_DB_GET_VARIABLES_NUM = '获取变量个数'; +ZhHans.MIXLY_TINY_WEB_DB_GET_VARIABLES_ALL = '返回全部数据'; +ZhHans.MIXLY_TINY_WEB_DB_GET_VARIABLES_TAG = '返回变量名'; +ZhHans.MIXLY_TINY_WEB_DB_GET_VARIABLES_VALUE = '返回变量值'; +ZhHans.MIXLY_TINY_WEB_DB_START_NUMBER = '起始编号'; +ZhHans.MIXLY_TINY_WEB_DB_VARIABLE_NUMBER = '变量个数'; +ZhHans.MIXLY_TINY_WEB_DB_SEARCH_VARS = '变量名包含的字符'; + })(); \ No newline at end of file diff --git a/common/msg/blockly/zh-hant.js b/common/msg/blockly/zh-hant.js index c7462ed8..c634a67d 100644 --- a/common/msg/blockly/zh-hant.js +++ b/common/msg/blockly/zh-hant.js @@ -186,7 +186,8 @@ ZhHant.MSG = { disablePythonToBlockly: "圖文互換", enablePythonToBlockly: "圖文互換", catSearch: "查找", - wiki: "Wiki" + wiki: "Wiki", + catTinyWebDB: "TinyWebDB" }; /* 多重選擇 */ @@ -4149,4 +4150,16 @@ ZhHant.MIXLY_DISPLAY_SCROLL_WAY = '滾動顯示方向'; ZhHant.MIXLY_LIGHT_SENSOR2 = '光照傳感器'; ZhHant.MIXLY_ROTARY_ENCODER = '旋轉解碼器'; ZhHant.MIXLY_REVOLVE = '旋'; +ZhHant.MIXLY_TINY_WEB_DB_UPDATE_VARIABLE = '設定變數'; +ZhHant.MIXLY_TINY_WEB_DB_GET_VARIABLE = '取得變數'; +ZhHant.MIXLY_TINY_WEB_DB_SEARCH_VARIABLES = '查詢變數'; +ZhHant.MIXLY_TINY_WEB_DB_DELETE_VARIABLE = '刪除變數'; +ZhHant.MIXLY_TINY_WEB_DB_GET_VARIABLES_NUM = '取得變數個數'; +ZhHant.MIXLY_TINY_WEB_DB_GET_VARIABLES_ALL = '傳回全部資料'; +ZhHant.MIXLY_TINY_WEB_DB_GET_VARIABLES_TAG = '傳回變數名稱'; +ZhHant.MIXLY_TINY_WEB_DB_GET_VARIABLES_VALUE = '傳回變數值'; +ZhHant.MIXLY_TINY_WEB_DB_START_NUMBER = '起始編號'; +ZhHant.MIXLY_TINY_WEB_DB_VARIABLE_NUMBER = '變數個數'; +ZhHant.MIXLY_TINY_WEB_DB_SEARCH_VARS = '變數名稱包含的字元'; + })();