问题修改
1️⃣字节转16进制字符2️⃣蓝牙3类调整位置3️⃣心知天气参数 默认天
This commit is contained in:
@@ -121,12 +121,11 @@ export const Weather_daily_content = function (_, generator) {
|
||||
generator.definitions_['import_seniverse_api*'] = "from seniverse_api import *";
|
||||
var content = this.getFieldValue('content');
|
||||
var day = generator.valueToCode(this, 'day', generator.ORDER_ATOMIC);
|
||||
var index = day - 1;
|
||||
if (content == 'none') {
|
||||
var code = 'Weather_daily.analysis()';
|
||||
var code = 'Weather_daily.analysis('+day+')';
|
||||
}
|
||||
else {
|
||||
var code = 'Weather_daily.analysis(' + index + ',"' + content + '")';
|
||||
var code = 'Weather_daily.analysis(' + day + ',"' + content + '")';
|
||||
}
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
};
|
||||
@@ -135,12 +134,11 @@ export const Air_daily_content = function (_, generator) {
|
||||
generator.definitions_['import_seniverse_api*'] = "from seniverse_api import *";
|
||||
var content = this.getFieldValue('content');
|
||||
var day = generator.valueToCode(this, 'day', generator.ORDER_ATOMIC);
|
||||
var index = day - 1;
|
||||
if (content == 'none') {
|
||||
var code = 'Air_daily.analysis()';
|
||||
var code = 'Air_daily.analysis('+day+')';
|
||||
}
|
||||
else {
|
||||
var code = 'Air_daily.analysis(' + index + ',"' + content + '")';
|
||||
var code = 'Air_daily.analysis(' + day + ',"' + content + '")';
|
||||
}
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
};
|
||||
@@ -149,12 +147,11 @@ export const Geo_sun_content = function (_, generator) {
|
||||
generator.definitions_['import_seniverse_api*'] = "from seniverse_api import *";
|
||||
var content = this.getFieldValue('content');
|
||||
var day = generator.valueToCode(this, 'day', generator.ORDER_ATOMIC);
|
||||
var index = day - 1;
|
||||
if (content == 'none') {
|
||||
var code = 'Geo_sun.analysis()';
|
||||
var code = 'Geo_sun.analysis('+day+')';
|
||||
}
|
||||
else {
|
||||
var code = 'Geo_sun.analysis(' + index + ',"' + content + '")';
|
||||
var code = 'Geo_sun.analysis(' + day + ',"' + content + '")';
|
||||
}
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
};
|
||||
@@ -163,12 +160,11 @@ export const Geo_moon_content = function (_, generator) {
|
||||
generator.definitions_['import_seniverse_api*'] = "from seniverse_api import *";
|
||||
var content = this.getFieldValue('content');
|
||||
var day = generator.valueToCode(this, 'day', generator.ORDER_ATOMIC);
|
||||
var index = day - 1;
|
||||
if (content == 'none') {
|
||||
var code = 'Geo_moon.analysis()';
|
||||
var code = 'Geo_moon.analysis('+day+')';
|
||||
}
|
||||
else {
|
||||
var code = 'Geo_moon.analysis(' + index + ',"' + content + '")';
|
||||
var code = 'Geo_moon.analysis(' + day + ',"' + content + '")';
|
||||
}
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
};
|
||||
@@ -343,4 +343,20 @@ div.blocklyToolboxDiv > div.blocklyToolboxContents > div:nth-child(12) > div.blo
|
||||
#catCommunicate.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/requests2.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEC.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEC.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni2.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEKM.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEKM.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni2.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
@@ -1691,78 +1691,6 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_init">
|
||||
<value name="kname">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_keyboard</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_keyboard_get_mac"></block>
|
||||
<block type="ble_keyboard_connect"></block>
|
||||
<block type="analog_ble_keyboard_input" >
|
||||
<value name="special">
|
||||
<block type="special_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="general">
|
||||
<block type="general_key">
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_str">
|
||||
<value name="str">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Hello, Mixly!</field>
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="time">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_init">
|
||||
<value name="name">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_Mouse</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_mouse_get_mac"></block>
|
||||
<block type="ble_mouse_connect"></block>
|
||||
<block type="analog_ble_mouse_input" >
|
||||
<value name="key">
|
||||
<block type="mouse_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="x">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="y">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="wheel">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catOnBoardDisplay" name="catOnBoardDisplay" colour='#569A98'
|
||||
m-show="micropython:esp32:mixgo micropython:esp32:mixgo_pe">
|
||||
@@ -2978,6 +2906,8 @@
|
||||
</block>
|
||||
</statement>
|
||||
</block>
|
||||
</category>
|
||||
<category id ="catBLEC" colour="140">
|
||||
<block type="communicate_bluetooth_handle">
|
||||
<value name="VAR">
|
||||
<shadow type="variables_get">
|
||||
@@ -3025,6 +2955,80 @@
|
||||
</statement>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catBLEKM" coclour="140">
|
||||
<block type="analog_ble_keyboard_init">
|
||||
<value name="kname">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_keyboard</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_keyboard_get_mac"></block>
|
||||
<block type="ble_keyboard_connect"></block>
|
||||
<block type="analog_ble_keyboard_input" >
|
||||
<value name="special">
|
||||
<block type="special_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="general">
|
||||
<block type="general_key">
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_str">
|
||||
<value name="str">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Hello, Mixly!</field>
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="time">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_init">
|
||||
<value name="name">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_Mouse</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_mouse_get_mac"></block>
|
||||
<block type="ble_mouse_connect"></block>
|
||||
<block type="analog_ble_mouse_input" >
|
||||
<value name="key">
|
||||
<block type="mouse_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="x">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="y">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="wheel">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catIR" colour="140">
|
||||
<block type="communicate_ir_recv_init">
|
||||
<value name="PIN">
|
||||
|
||||
@@ -357,4 +357,20 @@ div.blocklyToolboxDiv > div.blocklyToolboxContents > div:nth-child(12) > div.blo
|
||||
#catCommunicate.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/requests2.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEC.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEC.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni2.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEKM.blocklyTreeRow > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
#catBLEKM.blocklyTreeRow.blocklyTreeSelected > div.blocklyTreeRowContentContainer > span.blocklyTreeIcon{
|
||||
background:url('../../../../common/media/mark/comuni2.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
}
|
||||
@@ -1738,78 +1738,6 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_init">
|
||||
<value name="kname">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_keyboard</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_keyboard_get_mac"></block>
|
||||
<block type="ble_keyboard_connect"></block>
|
||||
<block type="analog_ble_keyboard_input" >
|
||||
<value name="special">
|
||||
<block type="special_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="general">
|
||||
<block type="general_key">
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_str">
|
||||
<value name="str">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Hello, Mixly!</field>
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="time">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_init">
|
||||
<value name="name">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_Mouse</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_mouse_get_mac"></block>
|
||||
<block type="ble_mouse_connect"></block>
|
||||
<block type="analog_ble_mouse_input" >
|
||||
<value name="key">
|
||||
<block type="mouse_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="x">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="y">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="wheel">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catOnBoardDisplay" name="catOnBoardDisplay" colour='#569A98'
|
||||
m-hide='micropython:esp32c3:generic micropython:esp32c3:mixgocar_c3'>
|
||||
@@ -2676,28 +2604,28 @@
|
||||
<block type="Weather_daily_content">
|
||||
<value name="day">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
<field name="NUM">0</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="Air_daily_content">
|
||||
<value name="day">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
<field name="NUM">0</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="Geo_sun_content">
|
||||
<value name="day">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
<field name="NUM">0</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="Geo_moon_content">
|
||||
<value name="day">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">1</field>
|
||||
<field name="NUM">0</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
@@ -2820,6 +2748,8 @@
|
||||
</block>
|
||||
</statement>
|
||||
</block>
|
||||
</category>
|
||||
<category id ="catBLEC" colour="140">
|
||||
<block type="communicate_bluetooth_handle">
|
||||
<value name="VAR">
|
||||
<shadow type="variables_get">
|
||||
@@ -2867,6 +2797,80 @@
|
||||
</statement>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catBLEKM" coclour="140">
|
||||
<block type="analog_ble_keyboard_init">
|
||||
<value name="kname">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_keyboard</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_keyboard_get_mac"></block>
|
||||
<block type="ble_keyboard_connect"></block>
|
||||
<block type="analog_ble_keyboard_input" >
|
||||
<value name="special">
|
||||
<block type="special_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="general">
|
||||
<block type="general_key">
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_str">
|
||||
<value name="str">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Hello, Mixly!</field>
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="time">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_keyboard_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_init">
|
||||
<value name="name">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">ble_Mouse</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="ble_mouse_get_mac"></block>
|
||||
<block type="ble_mouse_connect"></block>
|
||||
<block type="analog_ble_mouse_input" >
|
||||
<value name="key">
|
||||
<block type="mouse_key">
|
||||
</block>
|
||||
</value>
|
||||
<value name="x">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="y">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="wheel">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_ble_mouse_send_battery">
|
||||
<value name="battery">
|
||||
<shadow type="math_number">
|
||||
<field name="NUM">10</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catIR" colour="140">
|
||||
<block type="communicate_ir_recv_init">
|
||||
<value name="PIN">
|
||||
|
||||
@@ -533,8 +533,8 @@ export const turn_to_int = {
|
||||
init: function () {
|
||||
this.setColour(MATH_HUE);
|
||||
this.appendValueInput('VAR')
|
||||
.appendField(Blockly.Msg.LANG_MATH_BYTE+Blockly.Msg.MIXLY_TO_INT);
|
||||
.appendField(Blockly.Msg.LANG_MATH_BYTE+Blockly.Msg.MIXLY_TO_HEX);
|
||||
this.setOutput(true, Number);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_PYTHON_TOOLTIP_TOINT)
|
||||
this.setTooltip(Blockly.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)
|
||||
}
|
||||
};
|
||||
@@ -304,6 +304,7 @@ export const text_to_number_skulpt = function (_, generator) {
|
||||
export const base_map = math_map;
|
||||
|
||||
export const turn_to_int = function (_, generator) {
|
||||
generator.definitions_.import_hexlify = "from ubinascii import hexlify";
|
||||
var str = generator.valueToCode(this, 'VAR', generator.ORDER_ATOMIC);
|
||||
return ["int(" + str + ')', generator.ORDER_ATOMIC];
|
||||
return ["hexlify(" + str + ').decode()', generator.ORDER_ATOMIC];
|
||||
}
|
||||
@@ -156,7 +156,9 @@ En.MSG = {
|
||||
catAudio: "Audio",
|
||||
catNeopixel: "RGB light",
|
||||
catOneWire: "OneWire Communicate",
|
||||
catBLE: "Bluetooth",
|
||||
catBLE: "Bluetooth transmission",
|
||||
catBLEC:"Bluetooth remote control",
|
||||
catBLEKM:"Bluetooth keyboard and mouse",
|
||||
catBLE_HID: "Peripheral Device (Slave)",
|
||||
catBLE_UART: "Central Device (Host)",
|
||||
catBLE_PERIPHERAL: "Serial port transparent transmission",
|
||||
@@ -3749,4 +3751,6 @@ En.MIXLY_RANGE_OF_BATTERY = "the range of battery level is 0~100%";
|
||||
En.MIXLY_MOUSE = "mouse";
|
||||
En.MIXLY_SEND = "send";
|
||||
En.MIXLY_VARIABLE_UNPACK = "Unpack";
|
||||
En.MIXLY_TO_HEX = "Convert hexadecimal characters";
|
||||
En.MIXLY_PYTHON_TOOLTIP_TOHEX = "Converts a value to a hexadecimal character";
|
||||
})();
|
||||
@@ -167,7 +167,9 @@ ZhHans.MSG = {
|
||||
catAudio: "音频",
|
||||
catNeopixel: "RGB灯",
|
||||
catOneWire: "OneWire通信",
|
||||
catBLE: "蓝牙",
|
||||
catBLE: "蓝牙透传",
|
||||
catBLEC:"蓝牙遥控",
|
||||
catBLEKM:"蓝牙键鼠",
|
||||
catBLE_HID: "外围设备(从机)",
|
||||
catBLE_UART: "中心设备(主机)",
|
||||
catBLE_PERIPHERAL: "串口透传",
|
||||
@@ -3897,4 +3899,6 @@ ZhHans.MIXLY_RANGE_OF_BATTERY = "电池的电量范围为 0~100%";
|
||||
ZhHans.MIXLY_MOUSE = "鼠标";
|
||||
ZhHans.MIXLY_SEND = "发送";
|
||||
ZhHans.MIXLY_VARIABLE_UNPACK = "解包";
|
||||
ZhHans.MIXLY_TO_HEX = "转16进制字符";
|
||||
ZhHans.MIXLY_PYTHON_TOOLTIP_TOHEX = "将一个值转换为一个16进制字符";
|
||||
})();
|
||||
@@ -155,7 +155,9 @@ ZhHant.MSG = {
|
||||
catAudio: "音頻",
|
||||
catNeopixel: "RGB燈",
|
||||
catOneWire: "OneWire通信",
|
||||
catBLE: "藍牙",
|
||||
catBLE: "藍牙透傳",
|
||||
catBLEC:"藍牙遙控",
|
||||
catBLEKM:"藍牙鍵鼠",
|
||||
catBLE_HID: "外圍設備(從機)",
|
||||
catBLE_UART: "中心設備(主機)",
|
||||
catBLE_PERIPHERAL: "串口透傳",
|
||||
@@ -3752,4 +3754,6 @@ ZhHant.MIXLY_RANGE_OF_BATTERY = "電池的電量範圍為 0~100%";
|
||||
ZhHant.MIXLY_MOUSE = "鼠標";
|
||||
ZhHant.MIXLY_SEND = "發送";
|
||||
ZhHant.MIXLY_VARIABLE_UNPACK = "解包";
|
||||
ZhHant.MIXLY_TO_HEX = "轉16進制字符";
|
||||
ZhHant.MIXLY_PYTHON_TOOLTIP_TOHEX = "將一個值轉換為一個16進制字符";
|
||||
})();
|
||||
Reference in New Issue
Block a user