update toolbox and change colour

This commit is contained in:
Mario Pesch 2022-08-03 11:19:59 +02:00
parent 047588842c
commit 078bbe0477
6 changed files with 66 additions and 40 deletions

34
package-lock.json generated
View File

@ -5077,6 +5077,17 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/ansi-escapes/node_modules/type-fest": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/ansi-html": { "node_modules/ansi-html": {
"version": "0.0.7", "version": "0.0.7",
"resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz",
@ -22556,9 +22567,11 @@
} }
}, },
"node_modules/type-fest": { "node_modules/type-fest": {
"version": "0.21.3", "version": "0.13.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
"optional": true,
"peer": true,
"engines": { "engines": {
"node": ">=10" "node": ">=10"
}, },
@ -28548,6 +28561,13 @@
"integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
"requires": { "requires": {
"type-fest": "^0.21.3" "type-fest": "^0.21.3"
},
"dependencies": {
"type-fest": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="
}
} }
}, },
"ansi-html": { "ansi-html": {
@ -42256,9 +42276,11 @@
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g=="
}, },
"type-fest": { "type-fest": {
"version": "0.21.3", "version": "0.13.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
"optional": true,
"peer": true
}, },
"type-is": { "type-is": {
"version": "1.6.18", "version": "1.6.18",

View File

@ -17,7 +17,7 @@ Blockly.Blocks["sensebox_motors_beginServoMotor"] = {
.setAlign(Blockly.ALIGN_RIGHT); .setAlign(Blockly.ALIGN_RIGHT);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_beginServoMotor_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_beginServoMotor_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_beginServoMotor_helpurl); this.setHelpUrl(Blockly.Msg.sensebox_motors_beginServoMotor_helpurl);
}, },
@ -36,7 +36,7 @@ Blockly.Blocks["sensebox_motors_moveServoMotor"] = {
.setAlign(Blockly.ALIGN_RIGHT); .setAlign(Blockly.ALIGN_RIGHT);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_moveServoMotor_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_moveServoMotor_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_moveServoMotor_helpurl); 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); .appendField(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin_helpurl); this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_begin_helpurl);
}, },
@ -73,7 +73,7 @@ Blockly.Blocks["sensebox_motors_I2CMotorBoard_moveDCMotor"] = {
.setAlign(Blockly.ALIGN_RIGHT); .setAlign(Blockly.ALIGN_RIGHT);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_moveDCMotor_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_moveDCMotor_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_moveDCMotor_helpurl); 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) .appendField(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_motor)
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_I2CMotorBoard_stopDCMotor_helpurl); 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"); .appendField(new FieldSlider(3, 1, 3), "rpm");
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_beginStepperMotor_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_beginStepperMotor_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_beginStepperMotor_helpurl); this.setHelpUrl(Blockly.Msg.sensebox_motors_beginStepperMotor_helpurl);
}, },
@ -137,7 +137,7 @@ Blockly.Blocks["sensebox_motors_moveStepperMotor"] = {
.appendField(Blockly.Msg.sensebox_motors_moveStepperMotor_step); .appendField(Blockly.Msg.sensebox_motors_moveStepperMotor_step);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setColour(getColour().sensebox); this.setColour(getColour().motors);
this.setTooltip(Blockly.Msg.sensebox_motors_moveStepperMotor_tooltip); this.setTooltip(Blockly.Msg.sensebox_motors_moveStepperMotor_tooltip);
this.setHelpUrl(Blockly.Msg.sensebox_motors_moveStepperMotor_helpurl); this.setHelpUrl(Blockly.Msg.sensebox_motors_moveStepperMotor_helpurl);
}, },

View File

@ -14,6 +14,7 @@ const colours = {
serial: 230, serial: 230,
webserver: 40, webserver: 40,
phyphox: 25, phyphox: 25,
motors: 190,
}; };
export const getColour = () => { export const getColour = () => {

View File

@ -12,6 +12,7 @@ export const UI = {
toolbox_variables: "Variablen", toolbox_variables: "Variablen",
toolbox_serial: "Seriell", toolbox_serial: "Seriell",
toolbox_advanced: "Erweitert", toolbox_advanced: "Erweitert",
toolbox_motors: "Motoren",
variable_NUMBER: "Zahl (int)", variable_NUMBER: "Zahl (int)",
variable_SHORT_NUMBER: "char", variable_SHORT_NUMBER: "char",
variable_LONG: "große Zahl (long)", variable_LONG: "große Zahl (long)",

View File

@ -12,6 +12,7 @@ export const UI = {
toolbox_variables: "Variables", toolbox_variables: "Variables",
toolbox_serial: "Serial", toolbox_serial: "Serial",
toolbox_advanced: "Erweitert", toolbox_advanced: "Erweitert",
toolbox_motors: "Motors",
variable_NUMBER: "Number (int)", variable_NUMBER: "Number (int)",
variable_SHORT_NUMBER: "char", variable_SHORT_NUMBER: "char",
variable_LONG: " Zahl (long)", variable_LONG: " Zahl (long)",

View File

@ -298,33 +298,7 @@ class Toolbox extends React.Component {
</Value> </Value>
</Block> </Block>
</Category> </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}> {/* <Category name="Telegram" colour={getColour().sensebox}>
<Block type="sensebox_telegram" /> <Block type="sensebox_telegram" />
<Block type="sensebox_telegram_do" /> <Block type="sensebox_telegram_do" />
@ -672,6 +646,33 @@ class Toolbox extends React.Component {
</Value> </Value>
</Block> </Block>
</Category> </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}> <Category name="Watchdog" colour={getColour().io}>
<Block type="watchdog_enable"></Block> <Block type="watchdog_enable"></Block>
<Block type="watchdog_reset"></Block> <Block type="watchdog_reset"></Block>