修改
删除S3灯颜色 统一S3和mini_g2 的rfid 增加 角度弧度转换 所有板 增加 S3根据气压获取海拔
This commit is contained in:
@@ -674,4 +674,28 @@ export const generate_cartesian_product = {
|
||||
this.setTitleValue(newName, 'VAR');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const math_radian_to_degree = {
|
||||
init: function () {
|
||||
this.setColour(MATH_HUE);
|
||||
this.setOutput(true)
|
||||
this.appendValueInput('VAR')
|
||||
.appendField(Blockly.Msg.MIXLY_SET_RADIAN);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_TRANS_TO_ANGLE);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const math_degree_to_radian = {
|
||||
init: function () {
|
||||
this.setColour(MATH_HUE);
|
||||
this.setOutput(true)
|
||||
this.appendValueInput('VAR')
|
||||
.appendField(Blockly.Msg.MIXLY_SET_DEGREE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_TRANS_TO_RADIAN);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
@@ -321,4 +321,18 @@ export const generate_cartesian_product = function (_, generator) {
|
||||
code = `itertools.product(${items.join(', ')}, repeat=${re})`;
|
||||
}
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
export const math_radian_to_degree = function (_, generator) {
|
||||
generator.definitions_.import_math = "import math";
|
||||
var v = generator.valueToCode(this, 'VAR', generator.ORDER_ATOMIC);
|
||||
var code = 'math.degrees('+ v + ')';
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
export const math_degree_to_radian = function (_, generator) {
|
||||
generator.definitions_.import_math = "import math";
|
||||
var v = generator.valueToCode(this, 'VAR', generator.ORDER_ATOMIC);
|
||||
var code = 'math.radians('+ v + ')';
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
Reference in New Issue
Block a user