Skip to content

Commit 066b557

Browse files
committed
Merge remote-tracking branch 'home/master'
2 parents 3c4e31b + 7db154d commit 066b557

File tree

23 files changed

+329
-135
lines changed

23 files changed

+329
-135
lines changed

src/main/resources/com/parallax/server/blocklyprop/internationalization/translations.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ footer.licenselink = License
2626
footer.changelog = Change log
2727
footer.librarieslink = External libraries
2828
footer.clientdownloadlink = BlocklyProp-client
29-
footer.appversion = v0.91
30-
footer.buildversion = 184
29+
footer.appversion = v0.92
30+
footer.buildversion = 199
3131

3232
html.content_missing = Content missing
3333

@@ -112,8 +112,8 @@ project.create.nextlink = Next
112112
project.create.finishlink = Finish
113113
project.create.previouslink = Previous
114114

115-
project.board.activity-board = Activity Board WX
116-
project.board.s3 = S3 Robot
115+
project.board.activity-board = Propeller Activity Board WX
116+
project.board.s3 = Scribbler Robot
117117
project.board.heb = Hackable Electronic Badge
118118
project.board.other = Other
119119

src/main/resources/com/parallax/server/blocklyprop/internationalization/translations_nl.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ menu.your_projects = Jouw projecten
1111
menu.project_list = Projecten lijst
1212
menu.profile = Profiel
1313

14-
footer.appversion = v0.91
15-
footer.buildversion = 184
14+
footer.appversion = v0.92
15+
footer.buildversion = 199
1616

1717
home.latest_projects.title = Laatste projecten
1818
home.c_project.title = C Project

src/main/webapp/WEB-INF/servlet/help/menu.jsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111
<div class="container">
12+
<!--
1213
<div class="navbar navbar-default">
1314
<p class="navbar-text"><strong><a href="<url:getUrl url="/public/help"/>"><fmt:message key="help.title" /></a></strong></p>
1415
<ul class="nav navbar-nav">
@@ -23,4 +24,5 @@
2324
<button type="submit" class="btn btn-default"><fmt:message key="help.search.submit" /></button>
2425
</form>
2526
</div>
27+
-->
2628
</div>

src/main/webapp/cdn/blockly/generators/propc/TiltandAcceleration.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ Blockly.Blocks.MX2125_rotation = {
5656
init: function () {
5757
this.setColour(colorPalette.getColor('input'));
5858
this.appendDummyInput()
59-
.appendField("MX2125 rotation")
60-
.appendField("x-axis PIN")
59+
.appendField("Memsic rotation x-axis PIN")
6160
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PINX")
6261
.appendField("y-axis PIN")
6362
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PINY");
@@ -102,18 +101,23 @@ Blockly.Blocks.MMA7455_acceleration = {
102101
.appendField("Accelerometer x-axis PIN")
103102
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PINX")
104103
this.appendDummyInput()
104+
.setAlign(Blockly.ALIGN_RIGHT)
105105
.appendField("store x value in")
106106
.appendField(new Blockly.FieldVariable(Blockly.LANG_VARIABLES_GET_ITEM), 'X_VAR');
107107
this.appendDummyInput()
108+
.setAlign(Blockly.ALIGN_RIGHT)
108109
.appendField("y-axis PIN")
109110
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PINY")
110111
this.appendDummyInput()
112+
.setAlign(Blockly.ALIGN_RIGHT)
111113
.appendField("store y value in")
112114
.appendField(new Blockly.FieldVariable(Blockly.LANG_VARIABLES_GET_ITEM), 'Y_VAR');
113115
this.appendDummyInput()
116+
.setAlign(Blockly.ALIGN_RIGHT)
114117
.appendField("z-axis PIN")
115118
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PINZ")
116119
this.appendDummyInput()
120+
.setAlign(Blockly.ALIGN_RIGHT)
117121
.appendField("store z value in")
118122
.appendField(new Blockly.FieldVariable(Blockly.LANG_VARIABLES_GET_ITEM), 'Z_VAR');
119123

src/main/webapp/cdn/blockly/generators/propc/abvolts.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ Blockly.Blocks.ab_volt_in = {
3131
init: function() {
3232
this.setColour(colorPalette.getColor('io'));
3333
this.appendDummyInput()
34-
.appendField("ADC read (0-5V) in volt-100ths")
35-
.appendField("channel")
36-
.appendField(new Blockly.FieldDropdown([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"]]), "CHANNEL");
37-
34+
.appendField("ADC channel")
35+
.appendField(new Blockly.FieldDropdown([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"]]), "CHANNEL")
36+
.appendField("read (0-5V) in volt-100ths")
3837
this.setOutput(true, 'Number');
3938
this.setPreviousStatement(false, null);
4039
this.setNextStatement(false, null);

src/main/webapp/cdn/blockly/generators/propc/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Blockly.propc.pulse_in = function() {
155155
var pin = this.getFieldValue("PIN");
156156
var state = this.getFieldValue("STATE");
157157

158-
var code = 'pulse_in(' + pin + ', ' + state + ');\n';
158+
var code = 'pulse_in(' + pin + ', ' + state + ')';
159159
return [code, Blockly.propc.ORDER_NONE];
160160
};
161161

src/main/webapp/cdn/blockly/generators/propc/console.js

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ if (!Blockly.Blocks)
3232
Blockly.Blocks.console_print = {
3333
init: function () {
3434
this.setColour(colorPalette.getColor('protocols'));
35-
this.appendDummyInput()
36-
.appendField("Terminal print text")
37-
.appendField(quotes.newQuote_(true))
38-
.appendField(new Blockly.FieldTextInput(''), 'TEXT')
39-
.appendField(quotes.newQuote_(false));
40-
35+
this.appendValueInput('MESSAGE')
36+
.setCheck('String')
37+
.appendField("Terminal print text");
38+
this.setInputsInline(true);
4139
this.setPreviousStatement(true, null);
4240
this.setNextStatement(true, null);
4341
}
@@ -47,27 +45,44 @@ Blockly.Blocks.console_print_variables = {
4745
init: function () {
4846
this.setColour(colorPalette.getColor('protocols'));
4947
this.appendValueInput('VALUE')
50-
.appendField("Terminal print number");
51-
48+
.appendField("Terminal print number");
49+
this.appendDummyInput()
50+
.appendField("as")
51+
.appendField(new Blockly.FieldDropdown([
52+
['Decimal','DEC'],
53+
['Hexadecimal','HEX'],
54+
['Binary', 'BIN']
55+
]), "FORMAT");
5256
this.setInputsInline(true);
5357
this.setPreviousStatement(true, null);
5458
this.setNextStatement(true, null);
5559
}
5660
};
5761

58-
62+
// Terminal print text
5963
Blockly.propc.console_print = function () {
60-
var text = this.getFieldValue('TEXT');
64+
var text = Blockly.propc.valueToCode(this, 'MESSAGE', Blockly.propc.ORDER_ATOMIC);
6165
Blockly.propc.serial_terminal_ = true;
62-
63-
return 'print("' + text + '");\n';
66+
return 'print(' + text + ');';
6467
};
6568

6669
Blockly.propc.console_print_variables = function () {
67-
var value = Blockly.propc.valueToCode(this, 'VALUE', Blockly.propc.ORDER_ATOMIC) || '1000';
70+
// var value = Blockly.propc.valueToCode(this, 'VALUE', Blockly.propc.ORDER_ATOMIC) || '1000';
71+
var value = Blockly.propc.valueToCode(this, 'VALUE', Blockly.propc.ORDER_ATOMIC);
72+
var format = this.getFieldValue('FORMAT');
6873
Blockly.propc.serial_terminal_ = true;
6974

70-
return 'print("%d", ' + value + ');\n';
75+
var code = 'print(';
76+
if (format === 'BIN') {
77+
code += '"%b"';
78+
}else if (format === 'HEX') {
79+
code += '"%x"';
80+
}else {
81+
code += '"%d"';
82+
}
83+
84+
code += ', ' + value + ');';
85+
return code;
7186
};
7287

7388
Blockly.Blocks.console_newline = {
@@ -120,38 +135,50 @@ Blockly.Blocks.console_move_to_row = {
120135
}
121136
};
122137

123-
Blockly.propc.console_newline = function () {
124-
Blockly.propc.serial_terminal_ = true;
125-
return 'print("\\r");';
138+
Blockly.Blocks.console_move_to_position = {
139+
init: function () {
140+
this.setColour(colorPalette.getColor('protocols'));
141+
this.appendDummyInput()
142+
.appendField("Terminal move to row");
143+
this.appendValueInput('ROW')
144+
.setCheck('Number');
145+
this.appendDummyInput()
146+
.appendField("column");
147+
this.appendValueInput('COLUMN')
148+
.setCheck('Number');
149+
150+
this.setInputsInline(true);
151+
this.setPreviousStatement(true, null);
152+
this.setNextStatement(true, null);
153+
}
126154
};
127155

128-
Blockly.propc.console_clear = function () {
156+
Blockly.propc.console_newline = function () {
129157
Blockly.propc.serial_terminal_ = true;
130-
return 'print("\\x10");';
158+
return 'term_cmd(CR);';
131159
};
132160

133-
Blockly.propc.console_move_to_column = function () {
134-
var column = Blockly.propc.valueToCode(this, 'COLUMNS', Blockly.propc.ORDER_NONE);
161+
Blockly.propc.console_clear = function () {
135162
Blockly.propc.serial_terminal_ = true;
136-
137-
if (Number(column) < 0) {
138-
column = 0;
139-
} else if (Number(column) > 255) {
140-
column = 255;
141-
}
142-
143-
return 'print("\\x0E%c", ' + column + ');';
163+
return 'term_cmd(CLS);';
144164
};
145165

146-
Blockly.propc.console_move_to_row = function () {
147-
var row = Blockly.propc.valueToCode(this, 'ROWS', Blockly.propc.ORDER_NONE);
166+
Blockly.propc.console_move_to_position = function () {
148167
Blockly.propc.serial_terminal_ = true;
168+
var row = Blockly.propc.valueToCode(this, 'ROW', Blockly.propc.ORDER_NONE);
169+
var column = Blockly.propc.valueToCode(this, 'COLUMN', Blockly.propc.ORDER_NONE);
149170

150171
if (Number(row) < 0) {
151172
row = 0;
152173
} else if (Number(row) > 255) {
153174
row = 255;
154175
}
155176

156-
return 'print("\\x0F%c", ' + row + ');';
177+
if (Number(column) < 0) {
178+
column = 0;
179+
} else if (Number(column) > 255) {
180+
column = 255;
181+
}
182+
183+
return 'term_cmd(CRSRXY, ' + column + ', ' + row + ');';
157184
};

src/main/webapp/cdn/blockly/generators/propc/debug_LCD.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Blockly.Blocks.debug_lcd_init = {
3232
init: function () {
3333
this.setColour(colorPalette.getColor('protocols'));
3434
this.appendDummyInput()
35-
.appendField("LCD init PIN")
35+
.appendField("LCD initialize PIN")
3636
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
3737
this.appendDummyInput()
3838
.appendField("baud")
@@ -133,7 +133,11 @@ Blockly.propc.debug_lcd_number = function () {
133133
};
134134

135135
Blockly.propc.debug_lcd_action = function () {
136-
var action = this.getFieldValue('ACTION');
137-
138-
return 'dprint(debug_lcd, ' + action + ');\n';
136+
var action = this.getFieldValue('ACTION');
137+
var code = '';
138+
if(action === '12') {
139+
code = 'pause(5);\n';
140+
}
141+
code += 'writeChar(debug_lcd, ' + action + ');\n';
142+
return code;
139143
};

src/main/webapp/cdn/blockly/generators/propc/oled.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Blockly.Blocks.oled_get_max_height = {
281281
init: function() {
282282
this.setColour(colorPalette.getColor('protocols'));
283283
this.appendDummyInput()
284-
.appendField("max height")
284+
.appendField("OLED max height")
285285

286286
this.setPreviousStatement(false, null);
287287
this.setNextStatement(false, null);
@@ -293,7 +293,7 @@ Blockly.Blocks.oled_get_max_width = {
293293
init: function() {
294294
this.setColour(colorPalette.getColor('protocols'));
295295
this.appendDummyInput()
296-
.appendField("max width")
296+
.appendField("OLED max width")
297297

298298
this.setPreviousStatement(false, null);
299299
this.setNextStatement(false, null);
@@ -337,10 +337,10 @@ Blockly.Blocks.oled_print_number = {
337337
.appendField("OLED print number ")
338338
this.appendDummyInput()
339339
.appendField(new Blockly.FieldDropdown([
340-
["DEC", "DEC"],
341-
["BIN", "BIN"],
342-
["OCT", "OCT"],
343-
["HEX", "HEX"]
340+
["Decimal", "DEC"],
341+
["Hexadecimal", "HEX"],
342+
["Binary", "BIN"],
343+
//["OCT", "OCT"],
344344
]), "type");
345345
this.setInputsInline(true);
346346
this.setPreviousStatement(true, null);

src/main/webapp/cdn/blockly/generators/propc/sensors.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Blockly.Blocks.sensor_ping = {
3131
init: function () {
3232
this.setColour(colorPalette.getColor('input'));
3333
this.appendDummyInput()
34-
.appendField("Ping)))")
34+
.appendField("Ping))) distance in")
3535
.appendField(new Blockly.FieldDropdown([["inches", "INCHES"], ["cm", "CM"]]), "UNIT")
3636
.appendField("PIN")
3737
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
@@ -107,8 +107,7 @@ Blockly.Blocks.sound_impact_run = {
107107
init: function() {
108108
this.setColour(colorPalette.getColor('input'));
109109
this.appendDummyInput()
110-
.appendField("Sound Impact")
111-
.appendField("run in processor")
110+
.appendField("Sound Impact run in processor")
112111
.appendField(new Blockly.FieldDropdown([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"]]), "COG");
113112

114113
this.setInputsInline(true);
@@ -176,7 +175,7 @@ Blockly.Blocks.colorpal_enable = {
176175
init: function () {
177176
this.setColour(colorPalette.getColor('input'));
178177
this.appendDummyInput()
179-
.appendField("ColorPal enable");
178+
.appendField("ColorPal initialize");
180179

181180
this.setPreviousStatement(true, null);
182181
this.setNextStatement(true, null);

0 commit comments

Comments
 (0)