update toolbox and change colour
This commit is contained in:
@@ -17,7 +17,7 @@ Blockly.Blocks["sensebox_motors_beginServoMotor"] = {
|
||||
.setAlign(Blockly.ALIGN_RIGHT);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_beginServoMotor_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_beginServoMotor_helpurl);
|
||||
},
|
||||
@@ -36,7 +36,7 @@ Blockly.Blocks["sensebox_motors_moveServoMotor"] = {
|
||||
.setAlign(Blockly.ALIGN_RIGHT);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_moveServoMotor_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_moveServoMotor_helpurl);
|
||||
},
|
||||
@@ -53,7 +53,7 @@ Blockly.Blocks["sensebox_motors_I2CMotorBoard_begin"] = {
|
||||
.appendField(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin_helpurl);
|
||||
},
|
||||
@@ -73,7 +73,7 @@ Blockly.Blocks["sensebox_motors_I2CMotorBoard_moveDCMotor"] = {
|
||||
.setAlign(Blockly.ALIGN_RIGHT);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_moveDCMotor_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_moveDCMotor_helpurl);
|
||||
},
|
||||
@@ -90,7 +90,7 @@ Blockly.Blocks["sensebox_motors_I2CMotorBoard_stopDCMotor"] = {
|
||||
.appendField(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_motor)
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_helpurl);
|
||||
},
|
||||
@@ -122,7 +122,7 @@ Blockly.Blocks["sensebox_motors_beginStepperMotor"] = {
|
||||
.appendField(new FieldSlider(3, 1, 3), "rpm");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_beginStepperMotor_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_beginStepperMotor_helpurl);
|
||||
},
|
||||
@@ -137,7 +137,7 @@ Blockly.Blocks["sensebox_motors_moveStepperMotor"] = {
|
||||
.appendField(Blockly.Msg.sensebox_motors_moveStepperMotor_step);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(getColour().sensebox);
|
||||
this.setColour(getColour().motors);
|
||||
this.setTooltip(Blockly.Msg.sensebox_motors_moveStepperMotor_tooltip);
|
||||
this.setHelpUrl(Blockly.Msg.sensebox_motors_moveStepperMotor_helpurl);
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ const colours = {
|
||||
serial: 230,
|
||||
webserver: 40,
|
||||
phyphox: 25,
|
||||
motors: 190,
|
||||
};
|
||||
|
||||
export const getColour = () => {
|
||||
|
||||
@@ -12,6 +12,7 @@ export const UI = {
|
||||
toolbox_variables: "Variablen",
|
||||
toolbox_serial: "Seriell",
|
||||
toolbox_advanced: "Erweitert",
|
||||
toolbox_motors: "Motoren",
|
||||
variable_NUMBER: "Zahl (int)",
|
||||
variable_SHORT_NUMBER: "char",
|
||||
variable_LONG: "große Zahl (long)",
|
||||
|
||||
@@ -12,6 +12,7 @@ export const UI = {
|
||||
toolbox_variables: "Variables",
|
||||
toolbox_serial: "Serial",
|
||||
toolbox_advanced: "Erweitert",
|
||||
toolbox_motors: "Motors",
|
||||
variable_NUMBER: "Number (int)",
|
||||
variable_SHORT_NUMBER: "char",
|
||||
variable_LONG: " Zahl (long)",
|
||||
|
||||
@@ -298,33 +298,7 @@ class Toolbox extends React.Component {
|
||||
</Value>
|
||||
</Block>
|
||||
</Category>
|
||||
<Category name="Motors" colour={getColour().sensebox}>
|
||||
<Block type="sensebox_motors_beginServoMotor" />
|
||||
<Block type="sensebox_motors_moveServoMotor">
|
||||
<Value name="degrees">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">90</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block>
|
||||
{/* <Block type="sensebox_motors_I2CMotorBoard_begin" />
|
||||
<Block type="sensebox_motors_I2CMotorBoard_moveDCMotor">
|
||||
<Value name="speed">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">100</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="sensebox_motors_I2CMotorBoard_stopDCMotor" />
|
||||
<Block type="sensebox_motors_beginStepperMotor" />
|
||||
<Block type="sensebox_motors_moveStepperMotor">
|
||||
<Value name="steps">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">2048</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block> */}
|
||||
</Category>
|
||||
|
||||
{/* <Category name="Telegram" colour={getColour().sensebox}>
|
||||
<Block type="sensebox_telegram" />
|
||||
<Block type="sensebox_telegram_do" />
|
||||
@@ -672,6 +646,33 @@ class Toolbox extends React.Component {
|
||||
</Value>
|
||||
</Block>
|
||||
</Category>
|
||||
<Category name={Blockly.Msg.toolbox_motors} colour={getColour().motors}>
|
||||
<Block type="sensebox_motors_beginServoMotor" />
|
||||
<Block type="sensebox_motors_moveServoMotor">
|
||||
<Value name="degrees">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">90</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block>
|
||||
{/* <Block type="sensebox_motors_I2CMotorBoard_begin" />
|
||||
<Block type="sensebox_motors_I2CMotorBoard_moveDCMotor">
|
||||
<Value name="speed">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">100</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block>
|
||||
<Block type="sensebox_motors_I2CMotorBoard_stopDCMotor" />
|
||||
<Block type="sensebox_motors_beginStepperMotor" />
|
||||
<Block type="sensebox_motors_moveStepperMotor">
|
||||
<Value name="steps">
|
||||
<Block type="math_number">
|
||||
<Field name="NUM">2048</Field>
|
||||
</Block>
|
||||
</Value>
|
||||
</Block> */}
|
||||
</Category>
|
||||
<Category name="Watchdog" colour={getColour().io}>
|
||||
<Block type="watchdog_enable"></Block>
|
||||
<Block type="watchdog_reset"></Block>
|
||||
|
||||
Reference in New Issue
Block a user