Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions customWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ railsl
ebnf
editorsprache
setzanweisungen
zelos
122 changes: 106 additions & 16 deletions frontend/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const blockDefinitionsJson = [
}
],
output: 'CSetVector',
colour: 25,
colour: 0,
tooltip: '%{BKY_RAILBLOCKS_STOP_TOOLTIP}'
},
// Track-Statement Vector Direction case.
Expand All @@ -91,7 +91,7 @@ const blockDefinitionsJson = [
],
output: 'CSetVector',
tooltip: '%{BKY_RAILBLOCKS_DIR_TOOLTIP}',
colour: 25
colour: 0
},
// Contact-Wait-Statement
// Wait until a segment switch is reached or passed.
Expand All @@ -100,13 +100,10 @@ const blockDefinitionsJson = [
message0: '%{BKY_RAILBLOCKS_CONTACT_WAIT_TEXT}',
args0: [
{
type: 'field_dropdown',
options: [
['%{BKY_RAILBLOCKS_CONTACT_WAIT_REACHED}', 'ITEM1'],
['%{BKY_RAILBLOCKS_CONTACT_WAIT_PASSED}', 'ITEM2']
],
name: 'CONTACT'
},
type: "input_value",
name: "track_sensor_value",
check: "Boolean"
},
{
type: 'field_dropdown',
options: [
Expand All @@ -121,7 +118,7 @@ const blockDefinitionsJson = [
name: 'SEGMENT'
}
],
colour: 240,
colour: 210,
tooltip: '%{BKY_RAILBLOCKS_CONTACT_WAIT_TOOLTIP}',
previousStatement: 'CStatement',
nextStatement: 'CStatement'
Expand All @@ -138,7 +135,7 @@ const blockDefinitionsJson = [
name: 'DURATION'
}
],
colour: 240,
colour: 210,
tooltip: '%{BKY_RAILBLOCKS_TIME_WAIT_TOOLTIP}',
previousStatement: 'CStatement',
nextStatement: 'CStatement'
Expand All @@ -158,7 +155,7 @@ const blockDefinitionsJson = [
name: 'CROSSING_STATUS'
}
],
colour: 280,
colour: 60,
tooltip: '%{BKY_RAILBLOCKS_CROSSING_TOOLTIP}',
previousStatement: 'CStatement',
nextStatement: 'CStatement'
Expand Down Expand Up @@ -188,6 +185,11 @@ const blockDefinitionsJson = [
check: 'CStatement',
name: 'COND_BLOCK0'
},
{
type: "input_value",
name: "track_sensor_value",
check: "Boolean"
},
{
type: 'field_dropdown',
options: [
Expand All @@ -205,7 +207,12 @@ const blockDefinitionsJson = [
type: 'input_statement',
check: 'CStatement',
name: 'COND_BLOCK1'
}
},
{
type: "input_value",
name: "track_sensor_value",
check: "Boolean"
}
],
colour: 300,
tooltip: '%{BKY_RAILBLOCKS_CONDITIONAL_TOOLTIP}',
Expand Down Expand Up @@ -233,6 +240,65 @@ const blockDefinitionsJson = [
tooltip: '%{BKY_RAILBLOCKS_PARALLEL_TOOLTIP}',
previousStatement: 'CStatement',
nextStatement: 'CStatement'
},
// Reached track sensor value
// Shows that we reached the track sensor.
{
type: "reached",
message0: "%{BKY_RAILBLOCKS_CONTACT_WAIT_REACHED}",
output: "Boolean",
colour: 155,
tooltip: "Returns true if reached"
},
// Passed track sensor value
// Shows that we passed the track sensor.
{
type: "passed",
message0: "%{BKY_RAILBLOCKS_CONTACT_WAIT_PASSED}",
output: "Boolean",
colour: 155,
tooltip: "Returns true if passed"
},
// Integer range
// Is a range of integer numbers from start to end inclusive
{
type: "int_range",
message0: "%{BKY_RAILBLOCKS_INT_RANGE_TEXT}",
args0: [
{
type: "field_number",
name: "START",
value: 0,
min: 0,
precision: 1
},
{
type: "field_number",
name: "END",
value: 2
}
],
output: "int_range",
extensions: ["dynamic_int_range_validator"],
colour: 80,
tooltip: "%{BKY_RAILBLOCKS_INT_RANGE_TOOLTIP}"
},
// Integer
// Is just a simple number for shadow fields
{
type: "int_number",
message0: "%1",
args0: [
{
type: "field_number",
name: "NUM",
value: 1,
min: 0,
precision: 1
}
],
output: "Number",
extensions: ["dynamic_int_number_validator"]
}
]

Expand Down Expand Up @@ -264,11 +330,11 @@ function createToolbox (labels) {
},
{
kind: 'block',
type: 'CrossingStatement'
type: 'LightStatement',
},
{
kind: 'block',
type: 'LightStatement'
type: 'CrossingStatement'
},
{
kind: 'sep',
Expand Down Expand Up @@ -305,7 +371,31 @@ function createToolbox (labels) {
{
kind: 'block',
type: 'LoopStatement'
}
},
{
kind: 'sep',
gap: 60
},
{
kind: 'label',
text: labels.sensorValues
},
{
kind: 'block',
type: 'reached'
},
{
kind: 'block',
type: 'passed'
},
{
kind: 'label',
text: labels.numbers
},
{
kind: 'block',
type: 'int_range'
},
]
}
}
Expand Down
Loading