Compare commits
69 Commits
Author | SHA1 | Date | |
---|---|---|---|
59ca9cf463 | |||
7da811246c | |||
69f8453947 | |||
39ba9b81af | |||
51a14596cd | |||
8518c446cd | |||
2f69df0d9d | |||
1789d0ce21 | |||
d0809510c4 | |||
6b9c0eaf65 | |||
52bdf94233 | |||
fd50ed8f7c | |||
ba0eb93b0f | |||
9a4ed45797 | |||
820fdf3a3c | |||
348d5ffc26 | |||
95e47a0b25 | |||
c3312ed5d1 | |||
b7cdc7d0fe | |||
dde5a35cd9 | |||
be398d84ee | |||
4445acce7a | |||
d6d8b0655b | |||
216aa1ddaf | |||
783a561941 | |||
c916664ae7 | |||
4b836ede1b | |||
52fdaeec99 | |||
2aaa45e10d | |||
7993363e89 | |||
4d671f6cb0 | |||
cc020d5a81 | |||
5c39862a44 | |||
e0e5c95989 | |||
800b4ad224 | |||
40c3b4b0cf | |||
64bdc35e6f | |||
2b5f702bb6 | |||
1c81ecd23f | |||
4d223374b5 | |||
dd9cf9014f | |||
eb11d7926c | |||
609740dc48 | |||
955a2c9757 | |||
02838e6c30 | |||
b0c54e84e6 | |||
b6644b7a23 | |||
3c4c38eb59 | |||
29aba7b10b | |||
7427142243 | |||
436500babb | |||
82be4e344b | |||
81bfca4ed6 | |||
c35dbdd38f | |||
1bc93013e6 | |||
58148eb1c3 | |||
a7c62b45b2 | |||
bd765d49ee | |||
383ca5467d | |||
e240e3b394 | |||
7affbf8cb6 | |||
4dff282633 | |||
5d470fdcef | |||
f30eac41e9 | |||
d7f46c0fb5 | |||
a1b059171b | |||
995527675a | |||
84eb849bc7 | |||
5e0e35b4bd |
@ -2,7 +2,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
|
||||
require("./editor")
|
||||
require("./editor/deploy")
|
||||
|
||||
declare namespace pxt.editor {
|
||||
function deployCoreAsync(resp: pxtc.CompileResult, disconnect?: boolean): Promise<void>;
|
||||
|
66
docs/static/fonts/icons/iconfont.css
vendored
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "iconfont";
|
||||
src: url("iconfont.eot?e05611aaee246c1da118a83eaf515de9?#iefix") format("embedded-opentype"),
|
||||
url("iconfont.woff2?e05611aaee246c1da118a83eaf515de9") format("woff2"),
|
||||
url("iconfont.woff?e05611aaee246c1da118a83eaf515de9") format("woff");
|
||||
src: url("iconfont.eot?73552ec404b3a3d3769a3f04fa58c2c4?#iefix") format("embedded-opentype"),
|
||||
url("iconfont.woff2?73552ec404b3a3d3769a3f04fa58c2c4") format("woff2"),
|
||||
url("iconfont.woff?73552ec404b3a3d3769a3f04fa58c2c4") format("woff");
|
||||
}
|
||||
|
||||
.icon {
|
||||
@ -28,3 +28,63 @@ url("iconfont.woff?e05611aaee246c1da118a83eaf515de9") format("woff");
|
||||
.icon-gyro:before {
|
||||
content: "\f104";
|
||||
}
|
||||
.icon-addpackage:before {
|
||||
content: "\f105";
|
||||
}
|
||||
.icon-brick:before {
|
||||
content: "\f106";
|
||||
}
|
||||
.icon-controls:before {
|
||||
content: "\f107";
|
||||
}
|
||||
.icon-functions:before {
|
||||
content: "\f108";
|
||||
}
|
||||
.icon-list:before {
|
||||
content: "\f109";
|
||||
}
|
||||
.icon-logic:before {
|
||||
content: "\f10a";
|
||||
}
|
||||
.icon-loops:before {
|
||||
content: "\f10b";
|
||||
}
|
||||
.icon-math:before {
|
||||
content: "\f10c";
|
||||
}
|
||||
.icon-motors:before {
|
||||
content: "\f10d";
|
||||
}
|
||||
.icon-music:before {
|
||||
content: "\f10e";
|
||||
}
|
||||
.icon-sensors:before {
|
||||
content: "\f10f";
|
||||
}
|
||||
.icon-text:before {
|
||||
content: "\f110";
|
||||
}
|
||||
.icon-variables:before {
|
||||
content: "\f111";
|
||||
}
|
||||
.icon-advancedcollapsed:before {
|
||||
content: "\f112";
|
||||
}
|
||||
.icon-advancedexpanded:before {
|
||||
content: "\f113";
|
||||
}
|
||||
.icon-cancel:before {
|
||||
content: "\f114";
|
||||
}
|
||||
.icon-check:before {
|
||||
content: "\f115";
|
||||
}
|
||||
.icon-download:before {
|
||||
content: "\f116";
|
||||
}
|
||||
.icon-save:before {
|
||||
content: "\f117";
|
||||
}
|
||||
.icon-blocks:before {
|
||||
content: "\f118";
|
||||
}
|
||||
|
BIN
docs/static/fonts/icons/iconfont.eot
vendored
60
docs/static/fonts/icons/iconfont.svg
vendored
@ -19,6 +19,66 @@
|
||||
<glyph glyph-name="gyro"
|
||||
unicode=""
|
||||
horiz-adv-x="23.578015492438215" d=" M17 0H6.4A5.901881224640355 5.901881224640355 0 0 0 5.1 0.3H2.3A1.283659166359277 1.283659166359277 0 0 0 1 1.6V4.5H0.5A0.5016599040944301 0.5016599040944301 0 0 0 0 5V35.4A0.5016599040944301 0.5016599040944301 0 0 0 0.5 35.9H1V38.7A1.283659166359277 1.283659166359277 0 0 0 2.3 40H10.6V39.6H12.8V40H21.2A1.283659166359277 1.283659166359277 0 0 0 22.5 38.7V35.9H23.1A0.5016599040944301 0.5016599040944301 0 0 0 23.6 35.4V5.1A0.5016599040944301 0.5016599040944301 0 0 0 23.1 4.6H22.5V1.6A1.283659166359277 1.283659166359277 0 0 0 21.2 0.4H18.5C18.4 0.1 17.2 0 17 0zM6.2 34.5L3.7 33.8A1.0033198081888601 1.0033198081888601 0 0 1 3.4 33.7A0.2360752489856142 0.2360752489856142 0 0 1 3.3 33.5A0.20656584286241245 0.20656584286241245 0 0 1 3.4 33.3L4.1 32.8A7.657690888970861 7.657690888970861 0 0 1 3.1 30A8.51346366654371 8.51346366654371 0 0 1 4.8 23.5C5.8 24.2 6.5 24.7 6.5 24.7A7.377351530800443 7.377351530800443 0 0 0 5.4 26.9A6.300258207303577 6.300258207303577 0 0 0 6 31.8L6.5 31.5H6.5L6.6 31.5A0.3541128734784213 0.3541128734784213 0 0 1 6.8 31.4A0.17705643673921065 0.17705643673921065 0 0 1 7 31.5A0.6344522316488379 0.6344522316488379 0 0 1 7 32L6.2 34.5zM17.5 31.8H17.5A6.300258207303577 6.300258207303577 0 0 0 18 26.9A7.510143858354851 7.510143858354851 0 0 0 17 24.7L17.1 24.6L18.6 23.5A8.631501291036518 8.631501291036518 0 0 1 20.3 30A7.657690888970861 7.657690888970861 0 0 1 19.3 32.8L19.8 33.1L20 33.2A0.22132054592401326 0.22132054592401326 0 0 1 20.1 33.4A0.26558465510881596 0.26558465510881596 0 0 1 20 33.6A1.0033198081888601 1.0033198081888601 0 0 1 19.7 33.7L17.2 34.5S17.1 34.1 17 33.6S16.6 32.3 16.5 32A0.619697528587237 0.619697528587237 0 0 1 16.5 31.5A0.17705643673921065 0.17705643673921065 0 0 1 16.6 31.4A0.48690520103282936 0.48690520103282936 0 0 1 16.8 31.4L16.8 31.4L17.4 31.7zM11.7 30.6A1.9918849133161198 1.9918849133161198 0 1 1 13.7 28.6A1.9918849133161198 1.9918849133161198 0 0 1 11.7 30.6H11.7z" />
|
||||
<glyph glyph-name="addpackage"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M20 35.7C11.3 35.7 4.3 28.7 4.3 20S11.3 4.3 20 4.3S35.7 11.3 35.7 20S28.7 35.7 20 35.7zM30.4 18.3H21.7V9.6H18.3V18.3H9.6V21.7H18.3V30.4H21.7V21.7H30.4V18.3z" />
|
||||
<glyph glyph-name="brick"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M34.3 0.9H5.7V39.1H34.4V0.9zM10.4 32.7V18.4H29.6V32.7H10.4z" />
|
||||
<glyph glyph-name="controls"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M6.1 33H9.6V5.2H6.1V33z M18.3 33H21.7V5.2H18.3V33z M30.4 33H33.9V5.2H30.4V33z M2.6 15.7H13V7H2.6V15.7z M14.8 31.3H25.2V22.6H14.8V31.3z M27 22.6H37.4V13.9H27V22.6z" />
|
||||
<glyph glyph-name="functions"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M12.2 25.4H9.1C9.1 26.3 9.1 26.5 9.9 26.5C11.5 26.5 12.5 27.2 13.1 28.6C13.8 30.1 14.8 31.5 15.7 33.1C16.5 34.3 18.1 35.3 19.7 35.5C20.7 35.7 21.9 35.3 22.5 34.5C22.8 33.9 22.8 33.4 22.6 32.7C22.3 32.2 21.8 32 21.1 32.2C20.5 32.2 20.2 32.7 20.2 33.3C20.2 33.4 20.2 33.4 20.2 33.6C20.2 33.9 20.4 34.3 20.4 34.6C20 34.6 19.5 34.8 19.2 34.6C18.5 34.3 17.9 33.9 17.4 33.1C16.7 32 16.2 30.6 15.7 29.4C15.3 28.6 15 27.3 14.8 26.5H17.2C17.1 26.1 17.1 25.8 16.9 25.4H14.5C13.9 23.5 13.6 21.9 12.9 20.2C12.2 16.7 10.8 13.4 9.4 10.1C8.7 8.6 7.7 7.3 6.6 6.3C5.8 5.4 4.5 4.9 3.3 4.9C2.6 4.7 1.8 5.1 1.1 5.4C0.7 5.8 0.5 6.5 0.7 7.2C1.1 7.7 1.6 8 2.5 7.9C3 7.9 3.2 7.3 3.2 6.8C3.2 6.6 3 6.5 3 6.5C2.8 6.3 2.8 6.1 2.8 5.9C3 5.9 3.2 5.8 3.5 5.8C4.4 5.8 5.4 6.3 5.9 7.2C6.5 8 7 9.1 7.2 9.9C8.5 15.2 10.1 20.4 11.7 25.4C12.2 25.3 12.2 25.3 12.2 25.4z M32.5 4.7C32.7 4.9 32.7 5.1 32.9 5.3C34.8 6.3 36 8.4 36.4 10.5C37.1 13.9 37.1 17.4 36.2 20.9C35.7 22.8 34.5 24.2 33.1 25.4C32.9 25.6 32.7 25.8 32.7 25.9C36 24.7 39.2 20.6 39.2 15.3C39.3 10.8 36.7 6.5 32.5 4.7z M23.9 25.8C23.9 25.6 23.7 25.4 23.7 25.4C21.8 24.4 20.5 22.3 20.2 20.2C19.5 16.7 19.5 13.3 20.4 9.6C20.9 7.7 22.1 6.3 23.5 5.1C23.7 4.9 23.9 4.9 23.9 4.6C20 6.5 17.4 10.5 17.6 15C17.4 20.7 20.9 24.9 23.9 25.8z M32 12.2C32 12.2 32.2 12.2 32.4 12C32.4 12 32.4 12 32.4 11.9C31.9 11 31.3 10.1 30.3 9.6C29.9 9.3 29.2 9.1 28.5 9.6C28.4 9.8 28.2 9.9 28.2 10.3C27.9 11.3 27.7 12.4 27.5 13.4C27.5 13.6 27.5 13.6 27.3 13.8C27.2 13.4 27 13.1 26.6 12.7C26.1 12 25.6 11 24.7 10.3C24.4 9.9 24 9.6 23.5 9.4C23 9.3 22.5 9.4 21.9 9.9V10.1C21.9 10.5 21.9 10.8 22.3 11C22.5 11.2 22.8 11.2 23.2 11L23.3 10.8C23.9 10.5 24 10.3 24.4 11C25.1 12 25.9 13.4 26.8 14.5C26.8 14.6 26.8 14.8 26.8 15C26.6 15.7 26.5 16.6 26.3 17.3C25.9 18.5 25.4 19 24 19H23.9C23.7 19.2 23.9 19.3 24 19.3C24.7 19.5 25.8 19.7 26.5 19.7C26.6 19.7 26.8 19.7 27 19.5C27.5 18.8 27.9 18.1 28 17.1C28 16.9 28.2 16.6 28.2 16.4C28.4 16.7 28.7 17.3 29.1 17.6C29.6 18.1 30.1 18.8 30.8 19.3C31.2 19.5 31.5 19.7 31.9 19.7C32.4 19.7 32.7 19.3 32.7 18.8V18.6C32.5 18.1 32.2 17.9 31.7 18.1L31.7 18.1C31.5 18.1 31.5 18.1 31.3 18.1C30.8 18.5 30.1 18.3 29.6 17.8L29.6 17.8C29.2 17.3 28.7 16.6 28.4 15.9C28.4 15.7 28.4 15.7 28.4 15.5C28.7 14.3 28.9 12.9 29.2 11.5C29.2 11.3 29.2 11.3 29.4 11.2C29.6 10.6 29.9 10.5 30.3 11C31.3 11.3 31.5 11.9 32 12.2z" />
|
||||
<glyph glyph-name="list"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M11.1 30.4H36.9V27.3H11.1V30.4z M11.1 22.4H36.9V19.3H11.1V22.4z M11.1 14.4H36.9V11.3H11.1V14.4z M5.6 27.3H3.8V33.6H2.4V34.6C3.3 34.6 4 35.1 4.2 36.2H5.6V27.3z M7.7 17.6V16H1.4V16.7C1.4 18.8 2.8 19.7 4 20.3C5.7 21.2 5.7 21.6 5.7 22.1C5.7 22.6 5.4 23.1 4.5 23.1C3.7 23.1 3.1 22.4 3.1 21.6H1.4C1.4 23.1 2.4 24.7 4.5 24.7C6.6 24.7 7.5 23.3 7.5 22.1C7.5 20.3 6.3 19.8 4.9 19C4 18.4 3.3 17.9 3.3 17.4H7.7z M4.5 4.5C2.4 4.5 1.4 5.9 1.2 7.5H3C3 6.6 3.5 6.1 4.5 6.1C5.6 6.1 6.1 6.6 6.1 7.3C6.1 8 5.6 8.5 4.7 8.5H4.2V9.9H4.5C5.6 9.9 5.9 10.4 5.9 11C5.9 11.7 5.4 12 4.7 12C3.8 12 3.3 11.3 3.3 10.6H1.6C1.6 12.2 2.6 13.6 4.5 13.6C6.4 13.6 7.5 12.3 7.5 11.1C7.5 10.4 7.1 9.7 6.3 9.4C7.3 9 7.7 8.2 7.7 7.3C7.8 6.1 6.8 4.5 4.5 4.5z" />
|
||||
<glyph glyph-name="logic"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M2.8 14.1H7.4C10 14.2 12.2 16 13.1 18.6C15 23.1 18.3 31.3 23.7 31.3S29.8 31.3 29.8 31.3V35.8L36.9 28.3L29.8 21.5V26.4H24.9C22.3 25.7 20.2 24 19.4 21.5C17.3 17 15.2 9.4 8.2 9.2C5.1 9.2 3 9.2 3 9.2V14.1z M2.8 31.1V26.2H8.2C8.2 26.2 11.4 26.2 13.1 22.1C13.8 23.8 14.7 25.4 15.7 26.9C15.7 26.9 12.2 30.9 8.4 30.9S2.8 31.1 2.8 31.1z M19.5 18.4C19.5 18.4 21.8 13.9 24.4 13.9H30V18.4L37.3 11.3L30 4.2V9H23.7C23.7 9 20.2 9 16.9 13.4C18 14.9 18.8 16.7 19.5 18.4z" />
|
||||
<glyph glyph-name="loops"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M6.3 12.7C4.5 15.2 2.6 17.4 0.9 20H4.5C4.5 24.2 6.3 28.4 9.2 31.3C11.3 33.4 13.7 34.8 16.7 35.3C21.9 36.6 27.3 35 31.1 31.2C30.3 30.3 29.4 29.4 28.7 28.7C24.2 32.6 19.3 33.3 14.1 30.5C10.3 28.4 8.2 24.4 8.2 20.2H11.8C9.7 17.6 7.8 15 6.3 12.7z M32.2 20H28.5C30.4 22.5 32.2 24.7 33.9 27.3C35.8 24.9 37.6 22.6 39.3 20H35.6C35.6 15.7 33.7 11.5 30.6 8.6C28.5 6.6 26.1 5.3 23.3 4.7C18.1 3.5 12.7 5.1 8.9 8.9L11.3 11.3C15.6 7.5 20.7 6.6 25.9 9.6C29.9 11.7 32.2 15.7 32.2 20z" />
|
||||
<glyph glyph-name="math"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M15.2 5.3C14.9 4.9 14.2 4.2 13.8 3.9L9.3 8.4C7.6 6.7 6.2 5.3 4.8 3.9C4.4 4.2 3.8 4.9 3.4 5.3L7.9 9.8C6.2 11.5 4.8 12.9 3.4 14.3C3.8 14.7 4.4 15.4 4.8 15.7L9.3 11.2L13.8 15.7C14.2 15.4 14.9 14.7 15.2 14.3L10.7 9.8C12.1 8.2 13.7 6.7 15.2 5.3z M1.5 28V30H7.9V36.4C8.6 36.4 9.1 36.4 9.8 36.4V30H16.3V28H9.8V21.6H7.8V28H1.5z M38.4 10.7H22V14.1H38.4V10.7z M38.4 7.2V3.7H22V7.2H38.4z M38.4 31V27.5H22V31H38.4z" />
|
||||
<glyph glyph-name="motors"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M28.9 25.8C27.5 24.4 25.9 22.9 24.5 21.5H35.7V32.6L32.2 29.1C29.6 32.3 25.9 34.3 21.8 34.9C18.3 35.4 14.6 34.5 11.7 32.6C4.2 28.1 1.9 18.3 6.5 10.9S20.7 1.1 28.2 5.6C30.8 7.2 32.7 9.5 34.1 12.1C32.7 12.6 31.3 13.3 29.9 13.8C28.5 11 25.9 9 23 8.1C20.7 7.4 18.3 7.6 16 8.4C10.3 10.7 7.3 17.1 9.4 22.9C10.6 26.3 13.6 29 17.1 29.8C21.6 31.2 26.3 29.5 28.9 25.8z M16.7 19C16.7 17.1 18.3 15.7 20 15.7S23.3 17.3 23.3 19C23.3 21 21.8 22.3 20 22.3C18.1 22.5 16.7 21 16.7 19C16.7 19 16.7 19 16.7 19z" />
|
||||
<glyph glyph-name="music"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M24.2 17.7C27.1 17.2 29.9 15.7 31.7 13.2C32.5 13.2 33.4 13.2 33.4 13.2S36 20.9 30.3 26.3S13.4 31.7 9.2 26.3C6.3 22.6 5.2 17.6 6.8 13.2C7.3 13.2 7.7 13.2 8.2 13.2C8.2 13.2 11.1 17.6 15.8 17.7C15.7 10.1 15.7 3.5 15.7 3.5C12.3 4.2 9.6 6.3 8 9.4C4.5 10.1 1.7 13.2 1.7 17C1.7 28.3 10.3 34.8 20 34.8S38.8 27.3 38.1 17C37.7 9.9 31.8 9.4 31.8 9.4C30.4 6.3 27.7 4 24.3 3.5C24.2 11.3 24.2 17.7 24.2 17.7z" />
|
||||
<glyph glyph-name="sensors"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M20 36.9C10.6 36.9 3 29.2 3 19.8C3 10.4 10.6 2.8 20 2.8S37 10.4 37 19.8C36.9 29.4 29.4 36.9 20 36.9zM20 8.2C13.4 8.2 8.2 13.6 8.2 20S13.6 31.8 20 31.8S31.8 26.4 31.8 20S26.6 8.2 20 8.2z M13.2 20C13.2 16.3 16.3 13.2 20 13.2C23.7 13.2 26.8 16.3 26.8 20C26.8 23.7 23.7 26.8 20 26.8C16.3 26.8 13.2 23.7 13.2 20z" />
|
||||
<glyph glyph-name="text"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M23.1 30.6V2.8H16.5V30.6H7.7V36.7H32.3V30.6H23.1z" />
|
||||
<glyph glyph-name="variables"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M36.8 12V7.8H3.4V12H36.8z M36.8 22.1V17.9H3.4V22.1H36.8z M36.7 32.2V28H3.3V32.2H36.7z" />
|
||||
<glyph glyph-name="advancedcollapsed"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M39.7 28.2L36.2 31.5L20 15.3L3.8 31.5L0.3 28.2L18.3 10.3L18.3 10.3L20 8.5L20.5 9L20.5 9z" />
|
||||
<glyph glyph-name="advancedexpanded"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M39.3 12L21.7 29.6L21.7 29.6L20 31.3L19.5 30.8L19.5 30.8L0.7 12L4 8.7L20 24.7L36 8.7z" />
|
||||
<glyph glyph-name="cancel"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M33 29.6L29.4 33.2L20.2 24L11 33.2L7.3 29.6L16.5 20.3L7.3 11.1L11 7.3L20.2 16.5L29.4 7.3L33 11.1L23.8 20.3z" />
|
||||
<glyph glyph-name="check"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M33.7 32.9L15.3 14.4L7.5 22.3L3.8 18.4L11.7 10.8L11.7 10.8L15.3 7.1L37.4 29.2z" />
|
||||
<glyph glyph-name="download"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M5.2 15.7H36.5V1.7H5.2V15.7z M28.5 24.2L26.1 26.6L22.6 23.1L22.6 36.5L19.1 36.5L19.1 23.5L16 26.6L13.6 24.2L20.9 16.7L21 16.9L21.2 16.7z" />
|
||||
<glyph glyph-name="save"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M25 34.5C25 33.6 25 32.8 25 31.9C25 31 24.7 30.9 24 30.9C23.5 30.9 22.8 30.9 22.4 30.9C22.1 30.9 21.4 31 21.4 31.7V31.9V36.9C21.4 37.3 21.6 37.8 22.3 38C22.3 38 22.3 38 22.4 38C23 38 23.7 38 24.2 38C24.7 38 25.2 37.6 25.2 37.1C25.2 37.1 25.2 37.1 25.2 36.9C25 36.3 25 35.2 25 34.5z M37.6 31.2C35.8 32.9 34.3 34.5 32.5 36.3C31 37.8 31 37.8 28.5 37.8C27.5 37.8 27.3 37.6 27.3 36.6V28.4C27.3 27.4 27.1 27.2 26.1 27.2H14.3C13.2 27.2 13 27.4 13 28.4V36.4C13 37.6 12.9 37.8 11.7 37.8H3.8C2.6 37.8 2.4 37.6 2.4 36.4V19.9C2.4 14.3 2.4 8.9 2.4 3.2C2.4 2 2.6 1.8 3.7 1.8H36.9C37.9 1.8 38.1 2.2 38.1 3.2V29.6C38.3 30.5 37.9 30.9 37.6 31.2zM33.7 6.7H7.1V23H33.7V6.7z" />
|
||||
<glyph glyph-name="blocks"
|
||||
unicode=""
|
||||
horiz-adv-x="40" d=" M10.9 23H39V16.9H10.9V23z M39.2 27.1L39.2 33L0.9 33L0.9 31.1L0.9 27.1L0.9 12.9L0.9 7L39.2 7L39.2 12.9L6.9 12.9L6.9 27.1z" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 15 KiB |
BIN
docs/static/fonts/icons/iconfont.ttf
vendored
BIN
docs/static/fonts/icons/iconfont.woff
vendored
BIN
docs/static/fonts/icons/iconfont.woff2
vendored
133
editor/deploy.ts
Normal file
@ -0,0 +1,133 @@
|
||||
/// <reference path="../node_modules/pxt-core/built/pxteditor.d.ts"/>
|
||||
/// <reference path="../node_modules/pxt-core/built/pxtsim.d.ts"/>
|
||||
|
||||
import UF2 = pxtc.UF2;
|
||||
|
||||
export let ev3: pxt.editor.Ev3Wrapper
|
||||
|
||||
export function debug() {
|
||||
return initAsync()
|
||||
.then(w => w.downloadFileAsync("/tmp/dmesg.txt", v => console.log(pxt.Util.uint8ArrayToString(v))))
|
||||
}
|
||||
|
||||
function hf2Async() {
|
||||
return pxt.HF2.mkPacketIOAsync()
|
||||
.then(h => {
|
||||
let w = new pxt.editor.Ev3Wrapper(h)
|
||||
ev3 = w
|
||||
return w.reconnectAsync(true)
|
||||
.then(() => w)
|
||||
})
|
||||
}
|
||||
|
||||
let noHID = false
|
||||
|
||||
let initPromise: Promise<pxt.editor.Ev3Wrapper>
|
||||
export function initAsync() {
|
||||
if (initPromise)
|
||||
return initPromise
|
||||
|
||||
let canHID = false
|
||||
if (pxt.U.isNodeJS) {
|
||||
canHID = true
|
||||
} else {
|
||||
const forceHexDownload = /forceHexDownload/i.test(window.location.href);
|
||||
if (pxt.Cloud.isLocalHost() && pxt.Cloud.localToken && !forceHexDownload)
|
||||
canHID = true
|
||||
}
|
||||
|
||||
if (noHID)
|
||||
canHID = false
|
||||
|
||||
if (canHID) {
|
||||
initPromise = hf2Async()
|
||||
.catch(err => {
|
||||
initPromise = null
|
||||
noHID = true
|
||||
return Promise.reject(err)
|
||||
})
|
||||
} else {
|
||||
noHID = true
|
||||
initPromise = Promise.reject(new Error("no HID"))
|
||||
}
|
||||
|
||||
return initPromise
|
||||
}
|
||||
|
||||
// this comes from aux/pxt.lms
|
||||
const rbfTemplate = `
|
||||
4c45474f580000006d000100000000001c000000000000000e000000821b038405018130813e8053
|
||||
74617274696e672e2e2e0084006080XX00448581644886488405018130813e80427965210084000a
|
||||
`
|
||||
export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
|
||||
let w: pxt.editor.Ev3Wrapper
|
||||
|
||||
let filename = resp.downloadFileBaseName || "pxt"
|
||||
filename = filename.replace(/^lego-/, "")
|
||||
|
||||
let fspath = "../prjs/BrkProg_SAVE/"
|
||||
|
||||
let elfPath = fspath + filename + ".elf"
|
||||
let rbfPath = fspath + filename + ".rbf"
|
||||
|
||||
let rbfHex = rbfTemplate
|
||||
.replace(/\s+/g, "")
|
||||
.replace("XX", pxt.U.toHex(pxt.U.stringToUint8Array(elfPath)))
|
||||
let rbfBIN = pxt.U.fromHex(rbfHex)
|
||||
pxt.HF2.write16(rbfBIN, 4, rbfBIN.length)
|
||||
|
||||
let origElfUF2 = UF2.parseFile(pxt.U.stringToUint8Array(atob(resp.outfiles[pxt.outputName()])))
|
||||
|
||||
let mkFile = (ext: string, data: Uint8Array = null) => {
|
||||
let f = UF2.newBlockFile()
|
||||
f.filename = "Projects/" + filename + ext
|
||||
if (data)
|
||||
UF2.writeBytes(f, 0, data)
|
||||
return f
|
||||
}
|
||||
|
||||
let elfUF2 = mkFile(".elf")
|
||||
for (let b of origElfUF2) {
|
||||
UF2.writeBytes(elfUF2, b.targetAddr, b.data)
|
||||
}
|
||||
|
||||
let r = UF2.concatFiles([elfUF2, mkFile(".rbf", rbfBIN)])
|
||||
let data = UF2.serializeFile(r)
|
||||
|
||||
resp.outfiles[pxtc.BINARY_UF2] = btoa(data)
|
||||
|
||||
let saveUF2Async = () => {
|
||||
if (isCli || !pxt.commands.saveOnlyAsync) {
|
||||
return Promise.resolve()
|
||||
} else {
|
||||
return pxt.commands.saveOnlyAsync(resp)
|
||||
}
|
||||
}
|
||||
|
||||
if (noHID) return saveUF2Async()
|
||||
|
||||
return initAsync()
|
||||
.then(w_ => {
|
||||
w = w_
|
||||
if (w.isStreaming)
|
||||
pxt.U.userError("please stop the program first")
|
||||
return w.stopAsync()
|
||||
})
|
||||
.then(() => w.rmAsync(elfPath))
|
||||
.then(() => w.flashAsync(elfPath, UF2.readBytes(origElfUF2, 0, origElfUF2.length * 256)))
|
||||
.then(() => w.flashAsync(rbfPath, rbfBIN))
|
||||
.then(() => w.runAsync(rbfPath))
|
||||
.then(() => {
|
||||
if (isCli)
|
||||
return w.disconnectAsync()
|
||||
else
|
||||
return Promise.resolve()
|
||||
//return Promise.delay(1000).then(() => w.dmesgAsync())
|
||||
}).catch(e => {
|
||||
// if we failed to initalize, retry
|
||||
if (noHID)
|
||||
return saveUF2Async()
|
||||
else
|
||||
return Promise.reject(e)
|
||||
})
|
||||
}
|
@ -1,152 +1,120 @@
|
||||
/// <reference path="../node_modules/pxt-core/built/pxteditor.d.ts" />
|
||||
/// <reference path="../node_modules/pxt-core/built/pxteditor.d.ts"/>
|
||||
/// <reference path="../node_modules/pxt-core/built/pxtsim.d.ts"/>
|
||||
|
||||
import { deployCoreAsync, initAsync } from "./deploy";
|
||||
import { FieldPorts } from "./field_ports";
|
||||
import { FieldImages } from "./field_images";
|
||||
|
||||
pxt.editor.initExtensionsAsync = function(opts: pxt.editor.ExtensionOptions): Promise<pxt.editor.ExtensionResult> {
|
||||
pxt.debug('loading pxt-ev3 target extensions...')
|
||||
updateBlocklyShape();
|
||||
const res: pxt.editor.ExtensionResult = {
|
||||
fieldEditors: [{
|
||||
selector: "ports",
|
||||
editor: FieldPorts
|
||||
}, {
|
||||
selector: "images",
|
||||
editor: FieldImages
|
||||
}],
|
||||
deployCoreAsync
|
||||
};
|
||||
initAsync().catch(e => {
|
||||
// probably no HID - we'll try this again upon deployment
|
||||
})
|
||||
return Promise.resolve<pxt.editor.ExtensionResult>(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the shape of Blockly blocks with square corners
|
||||
*/
|
||||
function updateBlocklyShape() {
|
||||
|
||||
/**
|
||||
* Rounded corner radius.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).CORNER_RADIUS = 0 * (Blockly.BlockSvg as any).GRID_UNIT;
|
||||
|
||||
/**
|
||||
* Inner space between edge of statement input and notch.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).STATEMENT_INPUT_INNER_SPACE = 3 * (Blockly.BlockSvg as any).GRID_UNIT;
|
||||
/**
|
||||
* SVG path for drawing next/previous notch from left to right.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).NOTCH_PATH_LEFT = (
|
||||
'l 8,8 ' +
|
||||
'h 16 ' +
|
||||
'l 8,-8 '
|
||||
);
|
||||
|
||||
/**
|
||||
* SVG path for drawing next/previous notch from right to left.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).NOTCH_PATH_RIGHT = (
|
||||
'l -8,8 ' +
|
||||
'h -16 ' +
|
||||
'l -8,-8 '
|
||||
);
|
||||
|
||||
/**
|
||||
* SVG start point for drawing the top-left corner.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).TOP_LEFT_CORNER_START =
|
||||
'm 0,' + 0;
|
||||
|
||||
/**
|
||||
* SVG path for drawing the rounded top-left corner.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).TOP_LEFT_CORNER =
|
||||
'l ' + (Blockly.BlockSvg as any).CORNER_RADIUS + ',0 ';
|
||||
|
||||
/**
|
||||
* SVG path for drawing the rounded top-right corner.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).TOP_RIGHT_CORNER =
|
||||
'l ' + 0 + ',' + (Blockly.BlockSvg as any).CORNER_RADIUS;
|
||||
|
||||
/**
|
||||
* SVG path for drawing the rounded bottom-right corner.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).BOTTOM_RIGHT_CORNER =
|
||||
'l 0,' + (Blockly.BlockSvg as any).CORNER_RADIUS;
|
||||
|
||||
/**
|
||||
* SVG path for drawing the rounded bottom-left corner.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).BOTTOM_LEFT_CORNER =
|
||||
'l -' + (Blockly.BlockSvg as any).CORNER_RADIUS + ',0';
|
||||
|
||||
/**
|
||||
* SVG path for drawing the top-left corner of a statement input.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).INNER_TOP_LEFT_CORNER =
|
||||
'l ' + (Blockly.BlockSvg as any).CORNER_RADIUS + ',-' + 0;
|
||||
|
||||
/**
|
||||
* SVG path for drawing the bottom-left corner of a statement input.
|
||||
* Includes the rounded inside corner.
|
||||
* @const
|
||||
*/
|
||||
(Blockly.BlockSvg as any).INNER_BOTTOM_LEFT_CORNER =
|
||||
'l ' + 0 + ',' + (Blockly.BlockSvg as any).CORNER_RADIUS * 2 +
|
||||
'l ' + (Blockly.BlockSvg as any).CORNER_RADIUS + ',' + 0;
|
||||
|
||||
}
|
||||
|
||||
// When require()d from node, bind the global pxt namespace
|
||||
namespace pxt {
|
||||
export const dummyExport = 1;
|
||||
}
|
||||
eval("if (typeof process === 'object' && process + '' === '[object process]') pxt = global.pxt")
|
||||
|
||||
namespace pxt.editor {
|
||||
import UF2 = pxtc.UF2;
|
||||
|
||||
export let ev3: Ev3Wrapper
|
||||
|
||||
export function debug() {
|
||||
return initAsync()
|
||||
.then(w => w.downloadFileAsync("/tmp/dmesg.txt", v => console.log(pxt.Util.uint8ArrayToString(v))))
|
||||
}
|
||||
|
||||
// this comes from aux/pxt.lms
|
||||
const rbfTemplate = `
|
||||
4c45474f580000006d000100000000001c000000000000000e000000821b038405018130813e8053
|
||||
74617274696e672e2e2e0084006080XX00448581644886488405018130813e80427965210084000a
|
||||
`
|
||||
|
||||
function hf2Async() {
|
||||
return pxt.HF2.mkPacketIOAsync()
|
||||
.then(h => {
|
||||
let w = new Ev3Wrapper(h)
|
||||
ev3 = w
|
||||
return w.reconnectAsync(true)
|
||||
.then(() => w)
|
||||
})
|
||||
}
|
||||
|
||||
let noHID = false
|
||||
|
||||
let initPromise: Promise<Ev3Wrapper>
|
||||
function initAsync() {
|
||||
if (initPromise)
|
||||
return initPromise
|
||||
|
||||
let canHID = false
|
||||
if (U.isNodeJS) {
|
||||
canHID = true
|
||||
} else {
|
||||
const forceHexDownload = /forceHexDownload/i.test(window.location.href);
|
||||
if (Cloud.isLocalHost() && Cloud.localToken && !forceHexDownload)
|
||||
canHID = true
|
||||
}
|
||||
|
||||
if (noHID)
|
||||
canHID = false
|
||||
|
||||
if (canHID) {
|
||||
initPromise = hf2Async()
|
||||
.catch(err => {
|
||||
initPromise = null
|
||||
noHID = true
|
||||
return Promise.reject(err)
|
||||
})
|
||||
} else {
|
||||
noHID = true
|
||||
initPromise = Promise.reject(new Error("no HID"))
|
||||
}
|
||||
|
||||
return initPromise
|
||||
}
|
||||
|
||||
export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
|
||||
let w: Ev3Wrapper
|
||||
|
||||
let filename = resp.downloadFileBaseName || "pxt"
|
||||
filename = filename.replace(/^lego-/, "")
|
||||
|
||||
let fspath = "../prjs/BrkProg_SAVE/"
|
||||
|
||||
let elfPath = fspath + filename + ".elf"
|
||||
let rbfPath = fspath + filename + ".rbf"
|
||||
|
||||
let rbfHex = rbfTemplate
|
||||
.replace(/\s+/g, "")
|
||||
.replace("XX", U.toHex(U.stringToUint8Array(elfPath)))
|
||||
let rbfBIN = U.fromHex(rbfHex)
|
||||
HF2.write16(rbfBIN, 4, rbfBIN.length)
|
||||
|
||||
let origElfUF2 = UF2.parseFile(U.stringToUint8Array(atob(resp.outfiles[pxt.outputName()])))
|
||||
|
||||
let mkFile = (ext: string, data: Uint8Array = null) => {
|
||||
let f = UF2.newBlockFile()
|
||||
f.filename = "Projects/" + filename + ext
|
||||
if (data)
|
||||
UF2.writeBytes(f, 0, data)
|
||||
return f
|
||||
}
|
||||
|
||||
let elfUF2 = mkFile(".elf")
|
||||
for (let b of origElfUF2) {
|
||||
UF2.writeBytes(elfUF2, b.targetAddr, b.data)
|
||||
}
|
||||
|
||||
let r = UF2.concatFiles([elfUF2, mkFile(".rbf", rbfBIN)])
|
||||
let data = UF2.serializeFile(r)
|
||||
|
||||
resp.outfiles[pxtc.BINARY_UF2] = btoa(data)
|
||||
|
||||
let saveUF2Async = () => {
|
||||
if (isCli || !pxt.commands.saveOnlyAsync) {
|
||||
return Promise.resolve()
|
||||
} else {
|
||||
return pxt.commands.saveOnlyAsync(resp)
|
||||
}
|
||||
}
|
||||
|
||||
if (noHID) return saveUF2Async()
|
||||
|
||||
return initAsync()
|
||||
.then(w_ => {
|
||||
w = w_
|
||||
if (w.isStreaming)
|
||||
U.userError("please stop the program first")
|
||||
return w.stopAsync()
|
||||
})
|
||||
.then(() => w.rmAsync(elfPath))
|
||||
.then(() => w.flashAsync(elfPath, UF2.readBytes(origElfUF2, 0, origElfUF2.length * 256)))
|
||||
.then(() => w.flashAsync(rbfPath, rbfBIN))
|
||||
.then(() => w.runAsync(rbfPath))
|
||||
.then(() => {
|
||||
if (isCli)
|
||||
return w.disconnectAsync()
|
||||
else
|
||||
return Promise.resolve()
|
||||
//return Promise.delay(1000).then(() => w.dmesgAsync())
|
||||
}).catch(e => {
|
||||
// if we failed to initalize, retry
|
||||
if (noHID)
|
||||
return saveUF2Async()
|
||||
else
|
||||
return Promise.reject(e)
|
||||
})
|
||||
}
|
||||
|
||||
initExtensionsAsync = function (opts: pxt.editor.ExtensionOptions): Promise<pxt.editor.ExtensionResult> {
|
||||
pxt.debug('loading pxt-ev3 target extensions...')
|
||||
const res: pxt.editor.ExtensionResult = {
|
||||
deployCoreAsync,
|
||||
};
|
||||
initAsync().catch(e => {
|
||||
// probably no HID - we'll try this again upon deployment
|
||||
})
|
||||
return Promise.resolve<pxt.editor.ExtensionResult>(res);
|
||||
}
|
||||
}
|
||||
// namespace pxt {
|
||||
// export const dummyExport = 1;
|
||||
// }
|
||||
// eval("if (typeof process === 'object' && process + '' === '[object process]') pxt = global.pxt")
|
||||
|
114
editor/field_images.ts
Normal file
@ -0,0 +1,114 @@
|
||||
/// <reference path="../node_modules/pxt-core/localtypings/blockly.d.ts"/>
|
||||
/// <reference path="../node_modules/pxt-core/built/pxtblocks.d.ts"/>
|
||||
/// <reference path="../node_modules/pxt-core/built/pxtsim.d.ts"/>
|
||||
|
||||
export interface FieldImagesOptions extends pxtblockly.FieldImageDropdownOptions {
|
||||
}
|
||||
|
||||
export class FieldImages extends pxtblockly.FieldImageDropdown implements Blockly.FieldCustom {
|
||||
public isFieldCustom_ = true;
|
||||
|
||||
constructor(text: string, options: FieldImagesOptions, validator?: Function) {
|
||||
super(text, options, validator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a dropdown menu under the text.
|
||||
* @private
|
||||
*/
|
||||
public showEditor_() {
|
||||
// If there is an existing drop-down we own, this is a request to hide the drop-down.
|
||||
if (Blockly.DropDownDiv.hideIfOwner(this)) {
|
||||
return;
|
||||
}
|
||||
// If there is an existing drop-down someone else owns, hide it immediately and clear it.
|
||||
Blockly.DropDownDiv.hideWithoutAnimation();
|
||||
Blockly.DropDownDiv.clearContent();
|
||||
// Populate the drop-down with the icons for this field.
|
||||
let dropdownDiv = Blockly.DropDownDiv.getContentDiv();
|
||||
let contentDiv = document.createElement('div');
|
||||
// Accessibility properties
|
||||
contentDiv.setAttribute('role', 'menu');
|
||||
contentDiv.setAttribute('aria-haspopup', 'true');
|
||||
const options = this.getOptions();
|
||||
for (let i = 0, option: any; option = options[i]; i++) {
|
||||
let content = (options[i] as any)[0]; // Human-readable text or image.
|
||||
const value = (options[i] as any)[1]; // Language-neutral value.
|
||||
// Icons with the type property placeholder take up space but don't have any functionality
|
||||
// Use for special-case layouts
|
||||
if (content.type == 'placeholder') {
|
||||
let placeholder = document.createElement('span');
|
||||
placeholder.setAttribute('class', 'blocklyDropDownPlaceholder');
|
||||
placeholder.style.width = content.width + 'px';
|
||||
placeholder.style.height = content.height + 'px';
|
||||
contentDiv.appendChild(placeholder);
|
||||
continue;
|
||||
}
|
||||
let button = document.createElement('button');
|
||||
button.setAttribute('id', ':' + i); // For aria-activedescendant
|
||||
button.setAttribute('role', 'menuitem');
|
||||
button.setAttribute('class', 'blocklyDropDownButton');
|
||||
button.title = content.alt;
|
||||
if ((this as any).columns_) {
|
||||
button.style.width = (((this as any).width_ / (this as any).columns_) - 8) + 'px';
|
||||
//button.style.height = ((this.width_ / this.columns_) - 8) + 'px';
|
||||
} else {
|
||||
button.style.width = content.width + 'px';
|
||||
button.style.height = content.height + 'px';
|
||||
}
|
||||
let backgroundColor = this.sourceBlock_.getColour();
|
||||
if (value == this.getValue()) {
|
||||
// This icon is selected, show it in a different colour
|
||||
backgroundColor = this.sourceBlock_.getColourTertiary();
|
||||
button.setAttribute('aria-selected', 'true');
|
||||
}
|
||||
button.style.backgroundColor = backgroundColor;
|
||||
button.style.borderColor = this.sourceBlock_.getColourTertiary();
|
||||
Blockly.bindEvent_(button, 'click', this, (this as any).buttonClick_);
|
||||
Blockly.bindEvent_(button, 'mouseup', this, (this as any).buttonClick_);
|
||||
// These are applied manually instead of using the :hover pseudoclass
|
||||
// because Android has a bad long press "helper" menu and green highlight
|
||||
// that we must prevent with ontouchstart preventDefault
|
||||
Blockly.bindEvent_(button, 'mousedown', button, function (e) {
|
||||
this.setAttribute('class', 'blocklyDropDownButton blocklyDropDownButtonHover');
|
||||
e.preventDefault();
|
||||
});
|
||||
Blockly.bindEvent_(button, 'mouseover', button, function () {
|
||||
this.setAttribute('class', 'blocklyDropDownButton blocklyDropDownButtonHover');
|
||||
contentDiv.setAttribute('aria-activedescendant', this.id);
|
||||
});
|
||||
Blockly.bindEvent_(button, 'mouseout', button, function () {
|
||||
this.setAttribute('class', 'blocklyDropDownButton');
|
||||
contentDiv.removeAttribute('aria-activedescendant');
|
||||
});
|
||||
let buttonImg = document.createElement('img');
|
||||
buttonImg.src = content.src;
|
||||
//buttonImg.alt = icon.alt;
|
||||
// Upon click/touch, we will be able to get the clicked element as e.target
|
||||
// Store a data attribute on all possible click targets so we can match it to the icon.
|
||||
button.setAttribute('data-value', value);
|
||||
buttonImg.setAttribute('data-value', value);
|
||||
button.appendChild(buttonImg);
|
||||
contentDiv.appendChild(button);
|
||||
}
|
||||
contentDiv.style.width = (this as any).width_ + 'px';
|
||||
dropdownDiv.appendChild(contentDiv);
|
||||
|
||||
Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(), this.sourceBlock_.getColourTertiary());
|
||||
|
||||
// Calculate positioning based on the field position.
|
||||
var scale = this.sourceBlock_.workspace.scale;
|
||||
var bBox = { width: this.size_.width, height: this.size_.height };
|
||||
bBox.width *= scale;
|
||||
bBox.height *= scale;
|
||||
var position = this.fieldGroup_.getBoundingClientRect();
|
||||
var primaryX = position.left + bBox.width / 2;
|
||||
var primaryY = position.top + bBox.height;
|
||||
var secondaryX = primaryX;
|
||||
var secondaryY = position.top;
|
||||
// Set bounds to workspace; show the drop-down.
|
||||
(Blockly.DropDownDiv as any).setBoundsElement(this.sourceBlock_.workspace.getParentSvg().parentNode);
|
||||
(Blockly.DropDownDiv as any).show(this, primaryX, primaryY, secondaryX, secondaryY,
|
||||
(this as any).onHide_.bind(this));
|
||||
}
|
||||
}
|
147
editor/field_ports.ts
Normal file
@ -0,0 +1,147 @@
|
||||
/// <reference path="../node_modules/pxt-core/localtypings/blockly.d.ts"/>
|
||||
/// <reference path="../node_modules/pxt-core/built/pxtsim.d.ts"/>
|
||||
|
||||
export interface FieldPortsOptions extends Blockly.FieldCustomDropdownOptions {
|
||||
columns?: string;
|
||||
width?: string;
|
||||
}
|
||||
|
||||
export class FieldPorts extends Blockly.FieldDropdown implements Blockly.FieldCustom {
|
||||
public isFieldCustom_ = true;
|
||||
|
||||
// Width in pixels
|
||||
private width_: number;
|
||||
|
||||
// Columns in grid
|
||||
private columns_: number;
|
||||
|
||||
private savedPrimary_: string;
|
||||
|
||||
constructor(text: string, options: FieldPortsOptions, validator?: Function) {
|
||||
super(options.data);
|
||||
|
||||
this.columns_ = parseInt(options.columns) || 4;
|
||||
this.width_ = parseInt(options.width) || 300;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a dropdown menu under the text.
|
||||
* @private
|
||||
*/
|
||||
public showEditor_() {
|
||||
// If there is an existing drop-down we own, this is a request to hide the drop-down.
|
||||
if (Blockly.DropDownDiv.hideIfOwner(this)) {
|
||||
return;
|
||||
}
|
||||
// If there is an existing drop-down someone else owns, hide it immediately and clear it.
|
||||
Blockly.DropDownDiv.hideWithoutAnimation();
|
||||
Blockly.DropDownDiv.clearContent();
|
||||
// Populate the drop-down with the icons for this field.
|
||||
let dropdownDiv = Blockly.DropDownDiv.getContentDiv();
|
||||
let contentDiv = document.createElement('div');
|
||||
// Accessibility properties
|
||||
contentDiv.setAttribute('role', 'menu');
|
||||
contentDiv.setAttribute('aria-haspopup', 'true');
|
||||
const options = this.getOptions();
|
||||
for (let i = 0, option: any; option = options[i]; i++) {
|
||||
let content = (options[i] as any)[0]; // Human-readable text or image.
|
||||
const value = (options[i] as any)[1]; // Language-neutral value.
|
||||
// Icons with the type property placeholder take up space but don't have any functionality
|
||||
// Use for special-case layouts
|
||||
if (content.type == 'placeholder') {
|
||||
let placeholder = document.createElement('span');
|
||||
placeholder.setAttribute('class', 'blocklyDropDownPlaceholder');
|
||||
placeholder.style.width = content.width + 'px';
|
||||
placeholder.style.height = content.height + 'px';
|
||||
contentDiv.appendChild(placeholder);
|
||||
continue;
|
||||
}
|
||||
let button = document.createElement('button');
|
||||
button.setAttribute('id', ':' + i); // For aria-activedescendant
|
||||
button.setAttribute('role', 'menuitem');
|
||||
button.setAttribute('class', 'blocklyDropDownButton');
|
||||
button.title = content.alt;
|
||||
if (this.columns_) {
|
||||
button.style.width = ((this.width_ / this.columns_) - 8) + 'px';
|
||||
button.style.height = ((this.width_ / this.columns_) - 8) + 'px';
|
||||
} else {
|
||||
button.style.width = content.width + 'px';
|
||||
button.style.height = content.height + 'px';
|
||||
}
|
||||
let backgroundColor = this.sourceBlock_.getColour();
|
||||
if (value == this.getValue()) {
|
||||
// This icon is selected, show it in a different colour
|
||||
backgroundColor = this.sourceBlock_.getColourTertiary();
|
||||
button.setAttribute('aria-selected', 'true');
|
||||
}
|
||||
button.style.backgroundColor = backgroundColor;
|
||||
button.style.borderColor = this.sourceBlock_.getColourTertiary();
|
||||
Blockly.bindEvent_(button, 'click', this, this.buttonClick_);
|
||||
Blockly.bindEvent_(button, 'mouseup', this, this.buttonClick_);
|
||||
// These are applied manually instead of using the :hover pseudoclass
|
||||
// because Android has a bad long press "helper" menu and green highlight
|
||||
// that we must prevent with ontouchstart preventDefault
|
||||
Blockly.bindEvent_(button, 'mousedown', button, function (e) {
|
||||
this.setAttribute('class', 'blocklyDropDownButton blocklyDropDownButtonHover');
|
||||
e.preventDefault();
|
||||
});
|
||||
Blockly.bindEvent_(button, 'mouseover', button, function () {
|
||||
this.setAttribute('class', 'blocklyDropDownButton blocklyDropDownButtonHover');
|
||||
contentDiv.setAttribute('aria-activedescendant', this.id);
|
||||
});
|
||||
Blockly.bindEvent_(button, 'mouseout', button, function () {
|
||||
this.setAttribute('class', 'blocklyDropDownButton');
|
||||
contentDiv.removeAttribute('aria-activedescendant');
|
||||
});
|
||||
let buttonImg = document.createElement('img');
|
||||
buttonImg.src = content.src;
|
||||
//buttonImg.alt = icon.alt;
|
||||
// Upon click/touch, we will be able to get the clicked element as e.target
|
||||
// Store a data attribute on all possible click targets so we can match it to the icon.
|
||||
button.setAttribute('data-value', value);
|
||||
buttonImg.setAttribute('data-value', value);
|
||||
button.appendChild(buttonImg);
|
||||
contentDiv.appendChild(button);
|
||||
}
|
||||
contentDiv.style.width = this.width_ + 'px';
|
||||
dropdownDiv.appendChild(contentDiv);
|
||||
|
||||
Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(), this.sourceBlock_.getColourTertiary());
|
||||
|
||||
// Calculate positioning based on the field position.
|
||||
var scale = this.sourceBlock_.workspace.scale;
|
||||
var bBox = { width: this.size_.width, height: this.size_.height };
|
||||
bBox.width *= scale;
|
||||
bBox.height *= scale;
|
||||
var position = this.fieldGroup_.getBoundingClientRect();
|
||||
var primaryX = position.left + bBox.width / 2;
|
||||
var primaryY = position.top + bBox.height;
|
||||
var secondaryX = primaryX;
|
||||
var secondaryY = position.top;
|
||||
// Set bounds to workspace; show the drop-down.
|
||||
(Blockly.DropDownDiv as any).setBoundsElement(this.sourceBlock_.workspace.getParentSvg().parentNode);
|
||||
(Blockly.DropDownDiv as any).show(this, primaryX, primaryY, secondaryX, secondaryY,
|
||||
this.onHide_.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for when a button is clicked inside the drop-down.
|
||||
* Should be bound to the FieldIconMenu.
|
||||
* @param {Event} e DOM event for the click/touch
|
||||
* @private
|
||||
*/
|
||||
private buttonClick_ = function (e: any) {
|
||||
let value = e.target.getAttribute('data-value');
|
||||
this.setValue(value);
|
||||
Blockly.DropDownDiv.hide();
|
||||
};
|
||||
|
||||
/**
|
||||
* Callback for when the drop-down is hidden.
|
||||
*/
|
||||
private onHide_ = function () {
|
||||
Blockly.DropDownDiv.content_.removeAttribute('role');
|
||||
Blockly.DropDownDiv.content_.removeAttribute('aria-haspopup');
|
||||
Blockly.DropDownDiv.content_.removeAttribute('aria-activedescendant');
|
||||
};
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitReturns": true,
|
||||
"declaration": true,
|
||||
"out": "../built/editor.js",
|
||||
"module": "commonjs",
|
||||
"outDir": "../built/editor",
|
||||
"rootDir": ".",
|
||||
"newLine": "LF",
|
||||
"sourceMap": false
|
||||
"sourceMap": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"declaration": true
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 375 KiB |
BIN
legoresources/MC22122017/01b - MakeCode - basicdesign@2x.png
Normal file
After Width: | Height: | Size: 384 KiB |
After Width: | Height: | Size: 383 KiB |
After Width: | Height: | Size: 418 KiB |
BIN
legoresources/MC22122017/02a - MakeCode - portselector@2x.png
Normal file
After Width: | Height: | Size: 386 KiB |
BIN
legoresources/MC22122017/03a - MakeCode - all elements@2x.png
Normal file
After Width: | Height: | Size: 442 KiB |
BIN
legoresources/MC22122017/03b - MakeCode - motorsync@2x.png
Normal file
After Width: | Height: | Size: 404 KiB |
BIN
legoresources/MC22122017/04a - MakeCode - medmotor@2x.png
Normal file
After Width: | Height: | Size: 430 KiB |
BIN
legoresources/MC22122017/04b - MakeCode - medmotor@2x.png
Normal file
After Width: | Height: | Size: 428 KiB |
BIN
legoresources/MC22122017/05a - MakeCode - large motor@2x.png
Normal file
After Width: | Height: | Size: 426 KiB |
BIN
legoresources/MC22122017/05b - MakeCode - large motor@2x.png
Normal file
After Width: | Height: | Size: 425 KiB |
BIN
legoresources/MC22122017/06 - MakeCode - color - 1@2x.png
Normal file
After Width: | Height: | Size: 428 KiB |
BIN
legoresources/MC22122017/06 - MakeCode - color - 2@2x.png
Normal file
After Width: | Height: | Size: 422 KiB |
BIN
legoresources/MC22122017/06 - MakeCode - color - 3@2x.png
Normal file
After Width: | Height: | Size: 429 KiB |
BIN
legoresources/MC22122017/07a - MakeCode - Gyro@2x.png
Normal file
After Width: | Height: | Size: 423 KiB |
BIN
legoresources/MC22122017/07b - MakeCode - Gyro@2x.png
Normal file
After Width: | Height: | Size: 413 KiB |
BIN
legoresources/MC22122017/08 - MakeCode - UltraSound@2x.png
Normal file
After Width: | Height: | Size: 408 KiB |
BIN
legoresources/MC22122017/09a - MakeCode - display image@2x.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
legoresources/MC22122017/10a - MakeCode – mouseover@2x.png
Normal file
After Width: | Height: | Size: 407 KiB |
BIN
legoresources/MC22122017/10b - MakeCode – mouseover@2x.png
Normal file
After Width: | Height: | Size: 408 KiB |
BIN
legoresources/MC22122017/10c - MakeCode - popup w-overlay@2x.png
Normal file
After Width: | Height: | Size: 351 KiB |
BIN
legoresources/MC22122017/11a - MakeCode - delete block@2x.png
Normal file
After Width: | Height: | Size: 346 KiB |
BIN
legoresources/MC22122017/11b - MakeCode - delete block@2x.png
Normal file
After Width: | Height: | Size: 366 KiB |
BIN
legoresources/MC22122017/12a - MakeCode - fullscreen@2x.png
Normal file
After Width: | Height: | Size: 382 KiB |
BIN
legoresources/MC22122017/12b - MakeCode - fullscreen@2x.png
Normal file
After Width: | Height: | Size: 424 KiB |
BIN
legoresources/MC22122017/Loader - 1@2x.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
legoresources/MC22122017/Loader – 2@2x.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
legoresources/MC22122017/XX-blocks@2x.png
Normal file
After Width: | Height: | Size: 270 KiB |
5914
legoresources/MakeCode_overview.ai
Normal file
14
libs/behaviors/_locales/behaviors-jsdoc-strings.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"behaviors": "Behavior drive blocks",
|
||||
"behaviors.Behavior": "A behavior",
|
||||
"behaviors.BehaviorManager": "A manager for behaviors",
|
||||
"behaviors.BehaviorManager.add": "Adds a new behavior to the behavior manager",
|
||||
"behaviors.BehaviorManager.add|param|behavior": "the behavior to add",
|
||||
"behaviors.BehaviorManager.start": "Starts the behavior control loop",
|
||||
"behaviors.BehaviorManager.stop": "Stops the execution loop",
|
||||
"behaviors.addBehavior": "Adds the behavior and starts it",
|
||||
"behaviors.addBehavior|param|behavior": "a behavior",
|
||||
"behaviors.avoidCrash": "A behavior that stops all motors if the sensor distance get too short",
|
||||
"behaviors.driveForward": "A behavior that turns on the motors to the specified speed",
|
||||
"behaviors.driveForward|param|motors": "@param speed the desired speed, eg: 50"
|
||||
}
|
7
libs/behaviors/_locales/behaviors-strings.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"behaviors.addBehavior|block": "add behavior %behavior",
|
||||
"behaviors.avoidCrash|block": "avoid crash using %ultrasonic",
|
||||
"behaviors.driveForward|block": "drive %motors|forward at %speed|%",
|
||||
"behaviors|block": "behaviors",
|
||||
"{id:category}Behaviors": "Behaviors"
|
||||
}
|
6
libs/behaviors/pxt.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/behaviors",
|
||||
"dependencies": {
|
||||
"core": "file:../ev3"
|
||||
}
|
||||
}
|
56
libs/behaviors/targetoverrides.ts
Normal file
@ -0,0 +1,56 @@
|
||||
namespace behaviors {
|
||||
class AvoidCrashBehavior extends behaviors.Behavior {
|
||||
private ultrasonic: sensors.UltraSonicSensor;
|
||||
constructor(ultrasonic: sensors.UltraSonicSensor) {
|
||||
super();
|
||||
this.ultrasonic = ultrasonic;
|
||||
}
|
||||
|
||||
shouldRun(): boolean {
|
||||
return this.ultrasonic.distance() < 5;
|
||||
}
|
||||
|
||||
run(): void {
|
||||
motors.stopAllMotors();
|
||||
this.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A behavior that stops all motors if the sensor distance get too short
|
||||
*/
|
||||
//% blockId=behaviorsAvoidCrash block="avoid crash using %ultrasonic"
|
||||
export function avoidCrash(ultrasonic: sensors.UltraSonicSensor) : behaviors.Behavior {
|
||||
return new AvoidCrashBehavior(ultrasonic);
|
||||
}
|
||||
|
||||
class DriveForwardBehavior extends behaviors.Behavior {
|
||||
private motors: motors.MotorBase;
|
||||
private speed: number;
|
||||
constructor(motors: motors.MotorBase, speed: number) {
|
||||
super();
|
||||
this.motors = motors;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
shouldRun(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
run(): void {
|
||||
this.motors.setSpeed(this.speed);
|
||||
pauseUntil(() => !this.active);
|
||||
this.motors.setSpeed(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A behavior that turns on the motors to the specified speed
|
||||
* @param motors
|
||||
* @param speed the desired speed, eg: 50
|
||||
*/
|
||||
//% blockId=behaviorsDriveForward block="drive %motors|forward at %speed|%"
|
||||
export function driveForward(motors: motors.MotorBase, speed: number): behaviors.Behavior {
|
||||
return new DriveForwardBehavior(motors, speed);
|
||||
}
|
||||
}
|
@ -56,6 +56,7 @@ namespace sensors {
|
||||
|
||||
constructor(port: number) {
|
||||
super(port)
|
||||
this._setMode(ColorSensorMode.None);
|
||||
this.thresholdDetector = new sensors.internal.ThresholdDetector(this.id());
|
||||
}
|
||||
|
||||
@ -110,6 +111,7 @@ namespace sensors {
|
||||
//% blockId=colorOnColorDetected
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=100 blockGap=8
|
||||
//% group="Color Sensor"
|
||||
onColorDetected(color: ColorSensorColor, handler: () => void) {
|
||||
@ -129,6 +131,7 @@ namespace sensors {
|
||||
//% blockId=colorPauseForColorDetected
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Color Sensor"
|
||||
pauseForColor(color: ColorSensorColor) {
|
||||
@ -148,6 +151,7 @@ namespace sensors {
|
||||
//% blockId=colorGetColor
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=99
|
||||
//% group="Color Sensor"
|
||||
color(): ColorSensorColor {
|
||||
@ -165,6 +169,7 @@ namespace sensors {
|
||||
//% blockId=colorOnLightChanged
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=89 blockGap=8
|
||||
//% group="Color Sensor"
|
||||
onLightChanged(mode: LightIntensityMode, condition: LightCondition, handler: () => void) {
|
||||
@ -181,6 +186,7 @@ namespace sensors {
|
||||
//% blockId=colorPauseForLight
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=88 blockGap=8
|
||||
//% group="Color Sensor"
|
||||
pauseForLight(mode: LightIntensityMode, condition: LightCondition) {
|
||||
@ -198,6 +204,7 @@ namespace sensors {
|
||||
//% blockId=colorLight
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=87
|
||||
//% group="Color Sensor"
|
||||
light(mode: LightIntensityMode) {
|
||||
|
@ -21,8 +21,6 @@
|
||||
"brick.Button.pauseUntil": "Waits until the event is raised",
|
||||
"brick.Button.pauseUntil|param|ev": "the event to wait for",
|
||||
"brick.Button.wasPressed": "See if the button was pressed again since the last time you checked.",
|
||||
"brick._imagePicker": "An image",
|
||||
"brick._imagePicker|param|image": "the image",
|
||||
"brick.buttonDown": "Down button on the EV3 Brick.",
|
||||
"brick.buttonEnter": "Enter button on the EV3 Brick.",
|
||||
"brick.buttonLeft": "Left button on the EV3 Brick.",
|
||||
@ -31,17 +29,12 @@
|
||||
"brick.clearScreen": "Clears the screen",
|
||||
"brick.lightPattern": "Pattern block.",
|
||||
"brick.lightPattern|param|pattern": "the lights pattern to use. eg: LightsPattern.Green",
|
||||
"brick.print": "Show text on the screen.",
|
||||
"brick.printLine": "Show text on the screen at a specific line.",
|
||||
"brick.printLine|param|line": "the line number to print the text at, eg: 0",
|
||||
"brick.printLine|param|text": "the text to print on the screen, eg: \"Hello world\"",
|
||||
"brick.printPorts": "Prints the port states on the screen",
|
||||
"brick.print|param|text": "the text to print on the screen, eg: \"Hello world\"",
|
||||
"brick.print|param|x": "the starting position's x coordinate, eg: 0",
|
||||
"brick.print|param|y": "the starting position's x coordinate, eg: 0",
|
||||
"brick.setLight": "Set lights.",
|
||||
"brick.setLight|param|pattern": "the lights pattern to use.",
|
||||
"brick.setPixel": "Sets a pixel on or off",
|
||||
"brick.setPixel|param|on": "a value indicating if the pixel should be on or off",
|
||||
"brick.setPixel|param|x": "the starting position's x coordinate, eg: 0",
|
||||
"brick.setPixel|param|y": "the starting position's x coordinate, eg: 0",
|
||||
"brick.showImage": "Shows an image on screen",
|
||||
"brick.showImage|param|image": "image to draw",
|
||||
"console": "Reading and writing data to the console output.\n\nReading and writing data to the console output.",
|
||||
@ -59,9 +52,10 @@
|
||||
"control.raiseEvent": "Announce that an event happened to registered handlers.",
|
||||
"control.raiseEvent|param|src": "ID of the Component that generated the event",
|
||||
"control.raiseEvent|param|value": "Component specific code indicating the cause of the event.",
|
||||
"motors.Motor.angle": "Gets motor ration angle.",
|
||||
"motors.Motor.clearCount": "Clears the motor count",
|
||||
"motors.Motor.angle": "Gets motor angle.",
|
||||
"motors.Motor.clearCounts": "Clears the motor count",
|
||||
"motors.Motor.speed": "Gets motor actual speed.",
|
||||
"motors.Motor.tacho": "Gets motor tachometer count.",
|
||||
"motors.Motor.toString": "Returns the status of the motor",
|
||||
"motors.MotorBase.isReady": "Returns a value indicating if the motor is still running a previous command.",
|
||||
"motors.MotorBase.move": "Moves the motor by a number of rotations, degress or seconds",
|
||||
@ -77,9 +71,15 @@
|
||||
"motors.MotorBase.setSpeed": "Sets the speed of the motor.",
|
||||
"motors.MotorBase.setSpeed|param|speed": "the speed from ``100`` full forward to ``-100`` full backward, eg: 50",
|
||||
"motors.MotorBase.stop": "Stops the motor(s).",
|
||||
"motors.SynchedMotorPair.drive": "Makes a differential drive robot move with a given speed (%) and rotation rate (deg/s)\nusing a unicycle model.",
|
||||
"motors.SynchedMotorPair.drive|param|rotationSpeed": "rotation of the robot around the center point, eg: 30",
|
||||
"motors.SynchedMotorPair.drive|param|speed": "speed of the center point between motors, eg: 10",
|
||||
"motors.SynchedMotorPair.drive|param|value": "the amount of movement, eg: 2",
|
||||
"motors.SynchedMotorPair.setDimensions": "Sets the wheels radius and base length of a directional drive robot",
|
||||
"motors.SynchedMotorPair.setDimensions|param|wheelRadius": "@param baseLength ",
|
||||
"motors.SynchedMotorPair.steer": "Turns the motor and the follower motor by a number of rotations",
|
||||
"motors.SynchedMotorPair.steer|param|speed": "the speed from ``100`` full forward to ``-100`` full backward, eg: 50",
|
||||
"motors.SynchedMotorPair.steer|param|steering": "the ratio of power sent to the follower motor, from ``-100`` to ``100``",
|
||||
"motors.SynchedMotorPair.steer|param|turnRatio": "the ratio of power sent to the follower motor, from ``-200`` to ``200``, eg: 0",
|
||||
"motors.SynchedMotorPair.steer|param|unit": "the meaning of the value",
|
||||
"motors.SynchedMotorPair.steer|param|value": "the move quantity, eg: 2",
|
||||
"motors.SynchedMotorPair.tank": "The Move Tank block can make a robot drive forward, backward, turn, or stop. \nUse the Move Tank block for robot vehicles that have two Large Motors, \nwith one motor driving the left side of the vehicle and the other the right side. \nYou can make the two motors go at different speeds or in different directions \nto make your robot turn.",
|
||||
|
@ -28,7 +28,6 @@
|
||||
"brick.Button.onEvent|block": "on %button|%event",
|
||||
"brick.Button.pauseUntil|block": "pause until %button|%event",
|
||||
"brick.Button.wasPressed|block": "%button|was pressed",
|
||||
"brick._imagePicker|block": "%image",
|
||||
"brick.buttonDown|block": "down",
|
||||
"brick.buttonEnter|block": "enter",
|
||||
"brick.buttonLeft|block": "left",
|
||||
@ -36,10 +35,9 @@
|
||||
"brick.buttonUp|block": "up",
|
||||
"brick.clearScreen|block": "clear screen",
|
||||
"brick.lightPattern|block": "%pattern",
|
||||
"brick.printLine|block": "print %text| at line %line",
|
||||
"brick.printPorts|block": "print ports",
|
||||
"brick.print|block": "print %text| at x: %x| y: %y",
|
||||
"brick.setLight|block": "set light to %pattern=led_pattern",
|
||||
"brick.setPixel|block": "set pixel %on| at x: %x| y: %y",
|
||||
"brick.showImage|block": "show image %image=screen_image_picker",
|
||||
"brick|block": "brick",
|
||||
"console.logValue|block": "console|log value %name|= %value",
|
||||
@ -49,14 +47,17 @@
|
||||
"control.raiseEvent|block": "raise event|from %src|with value %value",
|
||||
"control|block": "control",
|
||||
"motors.Motor.angle|block": "%motor|angle",
|
||||
"motors.Motor.clearCounts|block": "%motor|clear counts",
|
||||
"motors.Motor.speed|block": "%motor|speed",
|
||||
"motors.Motor.tacho|block": "%motor|tacho",
|
||||
"motors.MotorBase.move|block": "move %motor|for %value|%unit|at %speed|%",
|
||||
"motors.MotorBase.pauseUntilReady|block": "%motor|pause until ready",
|
||||
"motors.MotorBase.setBrake|block": "set %motor|brake %brake",
|
||||
"motors.MotorBase.setReversed|block": "set %motor|reversed %reversed",
|
||||
"motors.MotorBase.setSpeed|block": "set speed of %motor|to %speed|%",
|
||||
"motors.SynchedMotorPair.steer|block": "steer %chassis|%steering|%|at speed %speed|%|by %value|%unit",
|
||||
"motors.SynchedMotorPair.tank|block": "tank %chassis|left %speedLeft|%|right %speedRight|%|by %value|%unit",
|
||||
"motors.SynchedMotorPair.drive|block": "drive %chassis|at %speed|cm/s|turning %rotationSpeed|deg/s|for %value|%unit",
|
||||
"motors.SynchedMotorPair.steer|block": "steer %chassis turn by|%turnRatio|at speed %speed|%|for %value|%unit",
|
||||
"motors.SynchedMotorPair.tank|block": "tank %chassis|left %speedLeft|%|right %speedRight|%|for %value|%unit",
|
||||
"motors.largeAB|block": "large A+B",
|
||||
"motors.largeAD|block": "large A+D",
|
||||
"motors.largeA|block": "large A",
|
||||
|
@ -66,6 +66,7 @@ namespace brick {
|
||||
|
||||
//% hidden
|
||||
_update(curr: boolean) {
|
||||
if (this == null) return
|
||||
if (this._isPressed == curr) return
|
||||
this._isPressed = curr
|
||||
if (curr) {
|
||||
@ -104,7 +105,7 @@ namespace brick {
|
||||
//% blockId=buttonWasPressed
|
||||
//% parts="brick"
|
||||
//% blockNamespace=brick
|
||||
//% weight=80 blockGap=8
|
||||
//% weight=80
|
||||
//% group="Buttons"
|
||||
wasPressed() {
|
||||
const r = this._wasPressed
|
||||
|
@ -1,260 +1,260 @@
|
||||
namespace images {
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsBigSmile = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsHeartLarge = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsHeartSmall = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsMouth1open = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsMouth1shut = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsMouth2open = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsMouth2shut = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsSad = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsSick = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsSmile = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsSwearing = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsTalking = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsWink = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const expressionsZzz = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesAngry = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesAwake = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesBlackEye = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesBottomLeft = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesBottomRight = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesCrazy1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesCrazy2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesDisappointed = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesDizzy = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesDown = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesEvil = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesHurt = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesKnockedOut = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesLove = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesMiddleLeft = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesMiddleRight = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesNeutral = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesNuclear = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesPinchLeft = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesPinchMiddle = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesPinchRight = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesSleeping = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesTear = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesTiredLeft = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesTiredMiddle = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesTiredRight = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesToxic = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesUp = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const eyesWinking = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationAccept = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationBackward = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationDecline = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationForward = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationLeft = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationNoGo = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationQuestionMark = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationRight = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationStop1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationStop2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationThumbsDown = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationThumbsUp = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const informationWarning = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoColorSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoEv3icon = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoEv3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoGyroSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoIrBeacon = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoIrSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoLego = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoLargeMotor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoMindstorms = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoMediumMotor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoSoundSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoTempSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoTouchSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const legoUsSensor = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsBomb = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsBoom = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsFire = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsFlowers = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsForest = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsLightOff = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsLightOn = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsLightning = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsNight = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsPirate = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsSnow = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const objectsTarget = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressBar0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressBar1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressBar2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressBar3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressBar4 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDial0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDial1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDial2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDial3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDial4 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDots0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDots1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDots2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressDots3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressHourglass0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressHourglass1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressHourglass2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressTimer0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressTimer1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressTimer2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressTimer3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressTimer4 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressWaterLevel0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressWaterLevel1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressWaterLevel2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const progressWaterLevel3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemAccept1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemAccept2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemAlert = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemBox = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemBusy0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemBusy1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemDecline1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemDecline2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemDotEmpty = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemDotFull = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemEv3small = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemPlay = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider0 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider1 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider2 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider3 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider4 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider5 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider6 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider7 = screen.unpackPNG(hex``);
|
||||
//% fixedInstance jres blockIdentity=brick._imagePicker
|
||||
//% fixedInstance jres blockIdentity=brick.__imagePicker
|
||||
export const systemSlider8 = screen.unpackPNG(hex``);
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ namespace sensors.internal {
|
||||
}
|
||||
|
||||
public setLevel(level: number) {
|
||||
if (this == null) return
|
||||
this.level = this.clampValue(level);
|
||||
|
||||
if (this.level >= this.highThreshold) {
|
||||
|
@ -14,7 +14,7 @@ enum Output {
|
||||
//% block="C+D"
|
||||
CD = Output.C | Output.D,
|
||||
//% block="A+D"
|
||||
AD = Output.B | Output.C,
|
||||
AD = Output.A | Output.D,
|
||||
//% block="All"
|
||||
ALL = 0x0f
|
||||
}
|
||||
@ -109,7 +109,7 @@ namespace motors {
|
||||
* Stops all motors
|
||||
*/
|
||||
//% blockId=motorStopAll block="stop all motors"
|
||||
//% weight=97
|
||||
//% weight=5
|
||||
//% group="Motion"
|
||||
export function stopAllMotors() {
|
||||
const b = mkCmd(Output.ALL, DAL.opOutputStop, 0)
|
||||
@ -258,7 +258,7 @@ namespace motors {
|
||||
/**
|
||||
* Returns a value indicating if the motor is still running a previous command.
|
||||
*/
|
||||
//%
|
||||
//% group="Sensors"
|
||||
isReady(): boolean {
|
||||
this.init();
|
||||
const buf = mkCmd(this._port, DAL.opOutputTest, 2);
|
||||
@ -278,6 +278,7 @@ namespace motors {
|
||||
* @param timeOut optional maximum pausing time in milliseconds
|
||||
*/
|
||||
//% blockId=motorPauseUntilRead block="%motor|pause until ready"
|
||||
//% weight=97
|
||||
//% group="Motion"
|
||||
pauseUntilReady(timeOut?: number) {
|
||||
pauseUntil(() => this.isReady(), timeOut);
|
||||
@ -330,7 +331,8 @@ namespace motors {
|
||||
* @param motor the port which connects to the motor
|
||||
*/
|
||||
//% blockId=motorSpeed block="%motor|speed"
|
||||
//% weight=72 blockGap=8
|
||||
//% weight=72
|
||||
//% blockGap=8
|
||||
//% group="Sensors"
|
||||
speed(): number {
|
||||
this.init();
|
||||
@ -338,10 +340,10 @@ namespace motors {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets motor ration angle.
|
||||
* Gets motor angle.
|
||||
* @param motor the port which connects to the motor
|
||||
*/
|
||||
//% blockId=motorTachoCount block="%motor|angle"
|
||||
//% blockId=motorAngle block="%motor|angle"
|
||||
//% weight=70
|
||||
//% group="Sensors"
|
||||
angle(): number {
|
||||
@ -349,11 +351,28 @@ namespace motors {
|
||||
return getMotorData(this._port).count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets motor tachometer count.
|
||||
* @param motor the port which connects to the motor
|
||||
*/
|
||||
//% blockId=motorTachoCount block="%motor|tacho"
|
||||
//% weight=69
|
||||
//% blockGap=8
|
||||
//% group="Sensors"
|
||||
tacho(): number {
|
||||
this.init();
|
||||
return getMotorData(this._port).tachoCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the motor count
|
||||
*/
|
||||
//% group="Motion"
|
||||
clearCount() {
|
||||
//% blockId=motorClearCount block="%motor|clear counts"
|
||||
//% weight=68
|
||||
//% blockGap=8
|
||||
//% group="Sensors"
|
||||
clearCounts() {
|
||||
this.init();
|
||||
const b = mkCmd(this._port, DAL.opOutputClearCount, 0)
|
||||
writePWM(b)
|
||||
@ -399,9 +418,13 @@ namespace motors {
|
||||
|
||||
//% fixedInstances
|
||||
export class SynchedMotorPair extends MotorBase {
|
||||
private wheelRadius: number;
|
||||
private baseLength: number;
|
||||
|
||||
constructor(ports: Output) {
|
||||
super(ports, () => this.__init(), (speed) => this.__setSpeed(speed), (steps, stepsOrTime, speed) => this.__move(steps, stepsOrTime, speed));
|
||||
this.wheelRadius = 3;
|
||||
this.baseLength = 12;
|
||||
this.markUsed();
|
||||
}
|
||||
|
||||
@ -422,7 +445,7 @@ namespace motors {
|
||||
private __setSpeed(speed: number) {
|
||||
syncMotors(this._port, {
|
||||
speed: speed,
|
||||
turnRatio: 0,
|
||||
turnRatio: 100, // same speed
|
||||
useBrake: !!this._brake
|
||||
})
|
||||
}
|
||||
@ -437,53 +460,6 @@ namespace motors {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns the motor and the follower motor by a number of rotations
|
||||
* @param value the move quantity, eg: 2
|
||||
* @param unit the meaning of the value
|
||||
* @param steering the ratio of power sent to the follower motor, from ``-100`` to ``100``
|
||||
* @param speed the speed from ``100`` full forward to ``-100`` full backward, eg: 50
|
||||
*/
|
||||
//% blockId=motorPairTurn block="steer %chassis|%steering|%|at speed %speed|%|by %value|%unit"
|
||||
//% weight=9 blockGap=8
|
||||
//% steering.min=-100 steering=100
|
||||
//% inlineInputMode=inline
|
||||
//% group="Chassis"
|
||||
steer(steering: number, speed: number, value: number, unit: MoveUnit) {
|
||||
this.init();
|
||||
speed = Math.clamp(-100, 100, speed >> 0);
|
||||
if (!speed) {
|
||||
stop(this._port, this._brake);
|
||||
return;
|
||||
}
|
||||
|
||||
const turnRatio = Math.clamp(-200, 200, steering + 100 >> 0);
|
||||
let useSteps: boolean;
|
||||
let stepsOrTime: number;
|
||||
switch (unit) {
|
||||
case MoveUnit.Rotations:
|
||||
stepsOrTime = (value * 360) >> 0;
|
||||
useSteps = true;
|
||||
break;
|
||||
case MoveUnit.Degrees:
|
||||
stepsOrTime = value >> 0;
|
||||
useSteps = true;
|
||||
break;
|
||||
default:
|
||||
stepsOrTime = value;
|
||||
useSteps = false;
|
||||
break;
|
||||
}
|
||||
|
||||
syncMotors(this._port, {
|
||||
useSteps: useSteps,
|
||||
speed: speed,
|
||||
turnRatio: turnRatio,
|
||||
stepsOrTime: stepsOrTime,
|
||||
useBrake: this._brake
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The Move Tank block can make a robot drive forward, backward, turn, or stop.
|
||||
* Use the Move Tank block for robot vehicles that have two Large Motors,
|
||||
@ -495,17 +471,115 @@ namespace motors {
|
||||
* @param speedLeft the speed on the left motor, eg: 50
|
||||
* @param speedRight the speed on the right motor, eg: 50
|
||||
*/
|
||||
//% blockId=motorPairTank block="tank %chassis|left %speedLeft|%|right %speedRight|%|by %value|%unit"
|
||||
//% blockId=motorPairTank block="tank %chassis|left %speedLeft|%|right %speedRight|%|for %value|%unit"
|
||||
//% weight=9 blockGap=8
|
||||
//% speedLeft.min=-100 speedLeft=100
|
||||
//% speedRight.min=-100 speedRight=100
|
||||
//% inlineInputMode=inline
|
||||
//% group="Chassis"
|
||||
tank(speedLeft: number, speedRight: number, value: number, unit: MoveUnit) {
|
||||
speedLeft = Math.clamp(speedLeft >> 0, -100, 100);
|
||||
speedRight = Math.clamp(speedRight >> 0, -100, 100);
|
||||
const steering = (speedRight * 100 / speedLeft) >> 0;
|
||||
this.steer(speedLeft, steering, value, unit);
|
||||
this.init();
|
||||
|
||||
speedLeft = Math.clamp(-100, 100, speedLeft >> 0);
|
||||
speedRight = Math.clamp(-100, 100, speedRight >> 0);
|
||||
|
||||
const speed = Math.abs(speedLeft) > Math.abs(speedRight) ? speedLeft : speedRight;
|
||||
const turnRatio = speedLeft == speed
|
||||
? (100 - speedRight / speedLeft * 100)
|
||||
: (speedLeft / speedRight * 100 - 100);
|
||||
this.steer(turnRatio, speed, value, unit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a differential drive robot move with a given speed (%) and rotation rate (deg/s)
|
||||
* using a unicycle model.
|
||||
* @param speed speed of the center point between motors, eg: 10
|
||||
* @param rotationSpeed rotation of the robot around the center point, eg: 30
|
||||
* @param value the amount of movement, eg: 2
|
||||
* @param unit
|
||||
*/
|
||||
//% blockId=motorDrive block="drive %chassis|at %speed|cm/s|turning %rotationSpeed|deg/s|for %value|%unit"
|
||||
//% inlineInputMode=inline
|
||||
//% group="Chassis"
|
||||
//% weight=8 blockGap=8
|
||||
drive(speed: number, rotationSpeed: number, value: number, unit: MoveUnit) {
|
||||
this.init();
|
||||
|
||||
// speed is expressed in %
|
||||
const R = this.wheelRadius; // cm
|
||||
const L = this.baseLength; // cm
|
||||
const PI = 3.14;
|
||||
const maxw = 170 / 60 * 2 * PI; // rad / s
|
||||
const maxv = maxw * R; // cm / s
|
||||
// speed is cm / s
|
||||
const v = speed; // cm / s
|
||||
const w = rotationSpeed / 360 * 2 * PI; // rad / s
|
||||
|
||||
const vr = (2 * v + w * L) / (2 * R); // rad / s
|
||||
const vl = (2 * v - w * L) / (2 * R); // rad / s
|
||||
|
||||
const sr = vr / maxw * 100; // %
|
||||
const sl = vl / maxw * 100; // %
|
||||
|
||||
this.tank(sr, sl, value, unit)
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns the motor and the follower motor by a number of rotations
|
||||
* @param turnRatio the ratio of power sent to the follower motor, from ``-200`` to ``200``, eg: 0
|
||||
* @param speed the speed from ``100`` full forward to ``-100`` full backward, eg: 50
|
||||
* @param value the move quantity, eg: 2
|
||||
* @param unit the meaning of the value
|
||||
*/
|
||||
//% blockId=motorPairTurn block="steer %chassis turn by|%turnRatio|at speed %speed|%|for %value|%unit"
|
||||
//% weight=6 blockGap=8
|
||||
//% turnRatio.min=-200 turnRatio=200
|
||||
//% inlineInputMode=inline
|
||||
//% group="Chassis"
|
||||
steer(turnRatio: number, speed: number, value: number, unit: MoveUnit) {
|
||||
this.init();
|
||||
speed = Math.clamp(-100, 100, speed >> 0);
|
||||
if (!speed) {
|
||||
stop(this._port, this._brake);
|
||||
return;
|
||||
}
|
||||
|
||||
turnRatio = Math.clamp(-200, 200, turnRatio >> 0);
|
||||
let useSteps: boolean;
|
||||
let stepsOrTime: number;
|
||||
switch (unit) {
|
||||
case MoveUnit.Rotations:
|
||||
stepsOrTime = (value * 360) >> 0;
|
||||
useSteps = true;
|
||||
break;
|
||||
case MoveUnit.Degrees:
|
||||
stepsOrTime = value >> 0;
|
||||
useSteps = true;
|
||||
break;
|
||||
default:
|
||||
stepsOrTime = value >> 0;
|
||||
useSteps = false;
|
||||
break;
|
||||
}
|
||||
|
||||
syncMotors(this._port, {
|
||||
useSteps: useSteps,
|
||||
speed: speed,
|
||||
turnRatio: turnRatio,
|
||||
stepsOrTime: stepsOrTime,
|
||||
useBrake: this._brake
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the wheels radius and base length of a directional drive robot
|
||||
* @param wheelRadius
|
||||
* @param baseLength
|
||||
*/
|
||||
//% group="Chassis"
|
||||
setDimensions(wheelRadius: number, baseLength: number): void {
|
||||
this.wheelRadius = wheelRadius;
|
||||
this.baseLength = baseLength;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -513,6 +587,8 @@ namespace motors {
|
||||
*/
|
||||
//%
|
||||
toString(): string {
|
||||
this.init();
|
||||
|
||||
let r = outputToName(this._port);
|
||||
for (let i = 0; i < DAL.NUM_OUTPUTS; ++i) {
|
||||
if (this._port & (1 << i)) {
|
||||
|
@ -80,15 +80,6 @@ namespace brick {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a pixel on or off
|
||||
* @param on a value indicating if the pixel should be on or off
|
||||
* @param x the starting position's x coordinate, eg: 0
|
||||
* @param y the starting position's x coordinate, eg: 0
|
||||
*/
|
||||
//% blockId=screen_setpixel block="set pixel %on| at x: %x| y: %y"
|
||||
//% weight=98 group="Screen"
|
||||
//% x.min=0 x.max=178 y.min=0 y.max=128 on.fieldEditor=toggleonoff
|
||||
export function setPixel(on: boolean, x: number, y: number) {
|
||||
x |= 0
|
||||
y |= 0
|
||||
@ -97,14 +88,20 @@ namespace brick {
|
||||
}
|
||||
|
||||
/**
|
||||
* Show text on the screen.
|
||||
* Show text on the screen at a specific line.
|
||||
* @param text the text to print on the screen, eg: "Hello world"
|
||||
* @param x the starting position's x coordinate, eg: 0
|
||||
* @param y the starting position's x coordinate, eg: 0
|
||||
* @param line the line number to print the text at, eg: 0
|
||||
*/
|
||||
//% blockId=screen_print block="print %text| at x: %x| y: %y"
|
||||
//% weight=99 group="Screen" inlineInputMode="inline" blockGap=8
|
||||
//% x.min=0 x.max=178 y.min=0 y.max=128
|
||||
//% blockId=screen_print block="print %text| at line %line"
|
||||
//% weight=98 group="Screen" inlineInputMode="inline" blockGap=8
|
||||
//% line.min=0 line.max=9
|
||||
export function printLine(text: string, line: number) {
|
||||
const NUM_LINES = 9;
|
||||
const offset = 5;
|
||||
const y = offset + (Math.clamp(0, NUM_LINES, line) / (NUM_LINES + 2)) * DAL.LCD_HEIGHT;
|
||||
brick.print(text, offset, y);
|
||||
}
|
||||
|
||||
export function print(text: string, x: number, y: number, mode = Draw.Normal) {
|
||||
x |= 0
|
||||
y |= 0
|
||||
@ -140,7 +137,7 @@ namespace brick {
|
||||
* @param image image to draw
|
||||
*/
|
||||
//% blockId=screen_show_image block="show image %image=screen_image_picker"
|
||||
//% weight=95 group="Screen" blockGap=8
|
||||
//% weight=100 group="Screen" blockGap=8
|
||||
export function showImage(image: Image, delay: number = 400) {
|
||||
if (!image) return;
|
||||
image.draw(0, 0, Draw.Normal);
|
||||
@ -154,11 +151,11 @@ namespace brick {
|
||||
* @param image the image
|
||||
*/
|
||||
//% blockId=screen_image_picker block="%image" shim=TD_ID
|
||||
//% image.fieldEditor="imagedropdown"
|
||||
//% image.fieldEditor="images"
|
||||
//% image.fieldOptions.columns=6
|
||||
//% image.fieldOptions.hasSearchBar=true
|
||||
//% image.fieldOptions.width=600
|
||||
//% group="Screen" weight=0 blockHidden=1
|
||||
export function _imagePicker(image: Image): Image {
|
||||
export function __imagePicker(image: Image): Image {
|
||||
return image;
|
||||
}
|
||||
|
||||
@ -166,7 +163,7 @@ namespace brick {
|
||||
* Clears the screen
|
||||
*/
|
||||
//% blockId=screen_clear_screen block="clear screen"
|
||||
//% weight=94 group="Screen" blockGap=8
|
||||
//% weight=90 group="Screen"
|
||||
export function clearScreen() {
|
||||
screen.clear();
|
||||
}
|
||||
@ -221,10 +218,14 @@ namespace brick {
|
||||
// motors
|
||||
const datas = motors.getAllMotorData();
|
||||
for(let i = 0; i < datas.length; ++i) {
|
||||
const x = i * 52;
|
||||
const data = datas[i];
|
||||
if (!data.actualSpeed && !data.count) continue;
|
||||
const x = i * 52;
|
||||
print(`${data.actualSpeed}%`, x, brick.LINE_HEIGHT)
|
||||
print(`${data.count}>`, x, 2 * brick.LINE_HEIGHT)
|
||||
|
||||
console.logValue(`speed.` + "ABCD"[i], data.actualSpeed);
|
||||
console.logValue(`angle.` + "ABCD"[i], data.count);
|
||||
}
|
||||
|
||||
// sensors
|
||||
@ -232,7 +233,10 @@ namespace brick {
|
||||
for(let i =0; i < sis.length; ++i) {
|
||||
const si = sis[i];
|
||||
const x = (si.port() - 1) * 52;
|
||||
print(`${si._query()}`, x, 9 * brick.LINE_HEIGHT)
|
||||
const v = si._query();
|
||||
print(`${v}`, x, 9 * brick.LINE_HEIGHT)
|
||||
|
||||
console.logValue(`sensor.` + si.port(), v);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,30 +1,34 @@
|
||||
|
||||
//% color="#68C3E2" weight=100
|
||||
//% color="#68C3E2" weight=100 icon="\uf106"
|
||||
//% groups='["Buttons", "Screen"]'
|
||||
//% labelLineWidth=0
|
||||
namespace brick {
|
||||
}
|
||||
|
||||
|
||||
//% color="#C8509B" weight=95 icon="\uf192"
|
||||
//% color="#C8509B" weight=95 icon="\uf10f"
|
||||
//% labelLineWidth=0
|
||||
//% groups='["Ultrasonic Sensor", "Touch Sensor", "Color Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Gyro Sensor"]'
|
||||
//% groupIcons='["\uf101","\uf103","\uf102","","","\uf104"]'
|
||||
namespace sensors {
|
||||
}
|
||||
|
||||
//% color="#A5CA18" weight=90 icon="\uf185"
|
||||
//% color="#A5CA18" weight=90 icon="\uf10d"
|
||||
//% groups='["Motion", "Sensors", "Chassis"]'
|
||||
//% labelLineWidth=0
|
||||
namespace motors {
|
||||
}
|
||||
|
||||
//% color="#D67923" weight=80
|
||||
//% labelLineWidth=0
|
||||
namespace behaviors {
|
||||
}
|
||||
|
||||
//% color="#D67923" weight=80 icon="\uf10e"
|
||||
namespace music {
|
||||
|
||||
}
|
||||
|
||||
//% color="#5F3109"
|
||||
//% color="#5F3109" icon="\uf107"
|
||||
namespace control {
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ namespace sensors {
|
||||
//% blockId=gyroGetAngle
|
||||
//% parts="gyroscope"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Gyro Sensor"
|
||||
angle(): number {
|
||||
@ -44,6 +45,7 @@ namespace sensors {
|
||||
//% blockId=gyroGetRate
|
||||
//% parts="gyroscope"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Gyro Sensor"
|
||||
rate(): number {
|
||||
|
@ -112,7 +112,7 @@ namespace sensors {
|
||||
//% blockId=remotebuttonWasPressed
|
||||
//% parts="remote"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=80 blockGap=8
|
||||
//% weight=80
|
||||
//% group="Remote Infrared Beacon"
|
||||
wasPressed() {
|
||||
return this.button.wasPressed();
|
||||
@ -238,7 +238,7 @@ namespace sensors {
|
||||
//% blockId=infraredGetRemoteCommand
|
||||
//% parts="infrared"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=65 blockGap=8
|
||||
//% weight=65
|
||||
//% group="Infrared Sensor"
|
||||
remoteCommand(): number {
|
||||
this._setMode(IrSensorMode.RemoteControl)
|
||||
|
@ -2,8 +2,6 @@
|
||||
"Sound.buffer": "Returns the underlaying Buffer object.",
|
||||
"Sound.play": "Play sound.",
|
||||
"music": "Generation of music tones.",
|
||||
"music._soundPicker": "A sound",
|
||||
"music._soundPicker|param|sound": "the sound",
|
||||
"music.beat": "Return the duration of a beat in milliseconds (the beat fraction).",
|
||||
"music.beat|param|fraction": "the fraction of the current whole note, eg: BeatFraction.Half",
|
||||
"music.changeTempoBy": "Change the tempo up or down by some amount of beats per minute (bpm).",
|
||||
|
@ -20,7 +20,6 @@
|
||||
"Note.GSharp|block": "G#",
|
||||
"SoundOutputDestination.Pin|block": "pin",
|
||||
"SoundOutputDestination.Speaker|block": "speaker",
|
||||
"music._soundPicker|block": "%sound",
|
||||
"music.beat|block": "%fraction|beat",
|
||||
"music.changeTempoBy|block": "change tempo by %value|(bpm)",
|
||||
"music.noteFrequency|block": "%note",
|
||||
|
@ -170,7 +170,7 @@ void playTone(int frequency, int ms) {
|
||||
//% blockId=music_stop_all_sounds block="stop all sounds"
|
||||
//% parts="headphone"
|
||||
//% blockNamespace=music
|
||||
//% weight=76 blockGap=8
|
||||
//% weight=97
|
||||
void stopAllSounds() {
|
||||
if (currentSample) {
|
||||
samplePtr = currentSample->length;
|
||||
|
2
libs/music/shims.d.ts
vendored
@ -32,7 +32,7 @@ declare namespace music {
|
||||
//% blockId=music_stop_all_sounds block="stop all sounds"
|
||||
//% parts="headphone"
|
||||
//% blockNamespace=music
|
||||
//% weight=76 blockGap=8 shim=music::stopAllSounds
|
||||
//% weight=97 shim=music::stopAllSounds
|
||||
function stopAllSounds(): void;
|
||||
|
||||
/** Makes a sound bound to a buffer in WAV format. */
|
||||
|
@ -264,10 +264,12 @@ namespace music {
|
||||
* @param sound the sound to play
|
||||
*/
|
||||
//% blockId=music_play_sound_effect_until_done block="play sound effect %sound|until done"
|
||||
//% weight=98
|
||||
//% weight=98 blockGap=8
|
||||
export function playSoundEffectUntilDone(sound: Sound) {
|
||||
if (!sound) return;
|
||||
if (!sound || numSoundsPlaying >= soundsLimit) return;
|
||||
numSoundsPlaying++;
|
||||
sound.play();
|
||||
numSoundsPlaying--;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -276,7 +278,7 @@ namespace music {
|
||||
*/
|
||||
//% blockId=music_sound_picker block="%sound" shim=TD_ID
|
||||
//% weight=0 blockHidden=1
|
||||
export function _soundPicker(sound: Sound): Sound {
|
||||
export function __soundPicker(sound: Sound): Sound {
|
||||
return sound;
|
||||
}
|
||||
|
||||
@ -285,7 +287,7 @@ namespace music {
|
||||
* @param sound the sound to play
|
||||
*/
|
||||
//% blockId=music_play_sound_effect block="play sound effect %sound"
|
||||
//% weight=99
|
||||
//% weight=99 blockGap=8
|
||||
export function playSoundEffect(sound: Sound) {
|
||||
if (!sound || numSoundsPlaying >= soundsLimit) return;
|
||||
numSoundsPlaying++;
|
||||
|
@ -1,9 +1,11 @@
|
||||
{
|
||||
"tests": "Unit tests framework",
|
||||
"TestEvent": "Various test event in the execution cycle",
|
||||
"tests": "A Unit tests framework",
|
||||
"tests.assert": "Checks a boolean condition",
|
||||
"tests.assertClose": "Checks that 2 values are close to each other",
|
||||
"tests.assertClose|param|actual": "what the value was",
|
||||
"tests.assertClose|param|expected": "what the value should be",
|
||||
"tests.assertClose|param|tolerance": "the acceptable error margin",
|
||||
"tests.assertClose|param|tolerance": "the acceptable error margin, eg: 5",
|
||||
"tests.onEvent": "Registers code to be called at various points in the test execution",
|
||||
"tests.test": "Registers a test to run"
|
||||
}
|
@ -1,4 +1,9 @@
|
||||
{
|
||||
"TestEvent.RunSetUp|block": "run setup",
|
||||
"TestEvent.RunTearDown|block": "run teardown",
|
||||
"TestEvent.TestSetUp|block": "test setup",
|
||||
"TestEvent.TestTearDown|block": "test teardown",
|
||||
"tests.assertClose|block": "assert %message|%expected|close to %actual|by %tolerance",
|
||||
"tests.assert|block": "assert %message|%condition",
|
||||
"tests.test|block": "test %name",
|
||||
"tests|block": "tests",
|
||||
|
@ -1,14 +1,6 @@
|
||||
{
|
||||
"name": "tests",
|
||||
"description": "A unit test library",
|
||||
"files": [
|
||||
"README.md",
|
||||
"tests.ts"
|
||||
],
|
||||
"testFiles": [
|
||||
],
|
||||
"public": true,
|
||||
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/tests",
|
||||
"dependencies": {
|
||||
"core": "file:../core"
|
||||
"core": "file:../ev3"
|
||||
}
|
||||
}
|
12
libs/tests/targetoverrides.ts
Normal file
@ -0,0 +1,12 @@
|
||||
// EV3 specific test functions
|
||||
tests.onEvent(TestEvent.RunSetUp, function() {
|
||||
console.sendToScreen();
|
||||
})
|
||||
tests.onEvent(TestEvent.TestSetUp, function() {
|
||||
motors.stopAllMotors();
|
||||
motors.resetAllMotors();
|
||||
})
|
||||
tests.onEvent(TestEvent.TestTearDown, function() {
|
||||
motors.stopAllMotors();
|
||||
motors.resetAllMotors();
|
||||
})
|
@ -1,94 +0,0 @@
|
||||
/**
|
||||
* Unit tests framework
|
||||
*/
|
||||
//% weight=100 color=#0fbc11 icon=""
|
||||
namespace tests {
|
||||
class Test {
|
||||
name: string;
|
||||
handler: () => void;
|
||||
errors: string[];
|
||||
|
||||
constructor(name: string, handler: () => void) {
|
||||
this.name = name;
|
||||
this.handler = handler;
|
||||
this.errors = [];
|
||||
}
|
||||
|
||||
reset() {
|
||||
motors.stopAllMotors();
|
||||
motors.resetAllMotors();
|
||||
}
|
||||
|
||||
run() {
|
||||
// clear state
|
||||
this.reset();
|
||||
|
||||
console.log(`> ${this.name}`)
|
||||
this.handler()
|
||||
|
||||
if (this.errors.length)
|
||||
console.log('')
|
||||
|
||||
// ensure clean state after test
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
let _tests: Test[] = undefined;
|
||||
let _currentTest: Test = undefined;
|
||||
|
||||
function run() {
|
||||
if (!_tests) return;
|
||||
|
||||
const start = control.millis();
|
||||
console.sendToScreen();
|
||||
console.log(`${_tests.length} tests found`)
|
||||
console.log(` `)
|
||||
for (let i = 0; i < _tests.length; ++i) {
|
||||
const t = _currentTest = _tests[i];
|
||||
t.run();
|
||||
_currentTest = undefined;
|
||||
}
|
||||
console.log(` `)
|
||||
console.log(`${_tests.length} tests, ${_tests.map(t => t.errors.length).reduce((p, c) => p + c, 0)} errs in ${Math.ceil((control.millis() - start) / 1000)}s`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a test to run
|
||||
*/
|
||||
//% blockId=testtest block="test %name"
|
||||
export function test(name: string, handler: () => void): void {
|
||||
if (!name || !handler) return;
|
||||
if (!_tests) {
|
||||
_tests = [];
|
||||
control.runInBackground(function () {
|
||||
// should run after on start
|
||||
loops.pause(100)
|
||||
run()
|
||||
})
|
||||
}
|
||||
_tests.push(new Test(name, handler));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks a boolean condition
|
||||
*/
|
||||
//% blockId=testAssert block="assert %message|%condition"
|
||||
export function assert(message: string, condition: boolean) {
|
||||
if (!condition) {
|
||||
console.log(`!!! ${message || ''}`)
|
||||
if (_currentTest)
|
||||
_currentTest.errors.push(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that 2 values are close to each other
|
||||
* @param expected what the value should be
|
||||
* @param actual what the value was
|
||||
* @param tolerance the acceptable error margin
|
||||
*/
|
||||
export function assertClose(name: string, expected: number, actual: number, tolerance: number) {
|
||||
assert(`${name} ${expected} != ${actual} +-${tolerance}`, Math.abs(expected - actual) <= tolerance);
|
||||
}
|
||||
}
|
@ -45,6 +45,7 @@ namespace sensors {
|
||||
//% blockId=touchEvent block="on %sensor|%event"
|
||||
//% parts="touch"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Touch Sensor"
|
||||
onEvent(ev: TouchSensorEvent, body: () => void) {
|
||||
@ -60,6 +61,7 @@ namespace sensors {
|
||||
//% blockId=touchWaitUntil block="pause until %sensor|%event"
|
||||
//% parts="touch"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=98 blockGap=8
|
||||
//% group="Touch Sensor"
|
||||
pauseUntil(ev: TouchSensorEvent) {
|
||||
@ -75,7 +77,8 @@ namespace sensors {
|
||||
//% blockId=touchIsPressed
|
||||
//% parts="touch"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=81 blockGap=8
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=81
|
||||
//% group="Touch Sensor"
|
||||
isPressed() {
|
||||
return this.button.isPressed();
|
||||
@ -90,6 +93,7 @@ namespace sensors {
|
||||
//% blockId=touchWasPressed
|
||||
//% parts="touch"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=81 blockGap=8
|
||||
//% group="Touch Sensor"
|
||||
wasPressed() {
|
||||
|
@ -46,6 +46,7 @@ namespace sensors {
|
||||
//% block="on %sensor|%event"
|
||||
//% parts="ultrasonicsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=100 blockGap=8
|
||||
//% group="Ultrasonic Sensor"
|
||||
onEvent(event: UltrasonicSensorEvent, handler: () => void) {
|
||||
@ -60,6 +61,7 @@ namespace sensors {
|
||||
//% blockId=ultrasonicWait
|
||||
//% parts="ultrasonicsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Ultrasonic Sensor"
|
||||
pauseUntil(event: UltrasonicSensorEvent) {
|
||||
@ -75,7 +77,8 @@ namespace sensors {
|
||||
//% blockId=sonarGetDistance
|
||||
//% parts="ultrasonicsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=65 blockGap=8
|
||||
//% sensor.fieldEditor="ports"
|
||||
//% weight=65
|
||||
//% group="Ultrasonic Sensor"
|
||||
distance(): number {
|
||||
// it supposedly also has an inch mode, but we stick to cm
|
||||
|
4683
package-lock.json
generated
Normal file
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-ev3",
|
||||
"version": "0.0.46",
|
||||
"version": "0.0.52",
|
||||
"description": "LEGO Mindstorms EV3 for Microsoft MakeCode",
|
||||
"private": true,
|
||||
"keywords": [
|
||||
@ -44,8 +44,8 @@
|
||||
"webfonts-generator": "^0.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-common-packages": "0.14.13",
|
||||
"pxt-core": "3.0.2"
|
||||
"pxt-common-packages": "0.15.3",
|
||||
"pxt-core": "3.0.5"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
||||
|
@ -16,7 +16,8 @@
|
||||
"libs/infrared-sensor",
|
||||
"libs/gyro-sensor",
|
||||
"libs/ev3",
|
||||
"libs/tests"
|
||||
"libs/tests",
|
||||
"libs/behaviors"
|
||||
],
|
||||
"simulator": {
|
||||
"autoRun": true,
|
||||
@ -94,6 +95,7 @@
|
||||
"privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=521839",
|
||||
"termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977",
|
||||
"githubUrl": "https://github.com/Microsoft/pxt-ev3",
|
||||
"betaUrl": "https://lego.makecode.com/",
|
||||
"boardName": "LEGO Mindstorms EV3 Brick",
|
||||
"selectLanguage": true,
|
||||
"highContrast": true,
|
||||
@ -137,6 +139,15 @@
|
||||
"functions": "#19325A",
|
||||
"arrays": "#901F76"
|
||||
},
|
||||
"blockIcons": {
|
||||
"loops": "\uf10b",
|
||||
"logic": "\uf10a",
|
||||
"math": "\uf10c",
|
||||
"variables": "\uf111",
|
||||
"text": "\uf110",
|
||||
"functions": "\uf108",
|
||||
"arrays": "\uf109"
|
||||
},
|
||||
"monacoColors": {
|
||||
"editor.background": "#ecf6ff"
|
||||
}
|
||||
|
@ -3,12 +3,13 @@
|
||||
namespace pxsim {
|
||||
|
||||
export enum ColorSensorMode {
|
||||
None = -1,
|
||||
Reflected = 0,
|
||||
Ambient = 1,
|
||||
Colors = 2,
|
||||
RefRaw = 3,
|
||||
RgbRaw = 4,
|
||||
ColorCal = 5
|
||||
ColorCal = 5,
|
||||
}
|
||||
|
||||
export enum ThresholdState {
|
||||
@ -24,6 +25,7 @@ namespace pxsim {
|
||||
|
||||
constructor(port: number) {
|
||||
super(port);
|
||||
this.mode = -1;
|
||||
}
|
||||
|
||||
getDeviceType() {
|
||||
|
@ -81,7 +81,6 @@ namespace pxsim.control {
|
||||
export function dmesg(s: string) {
|
||||
console.log("DMESG: " + s)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace pxsim.output {
|
||||
|
@ -15,6 +15,7 @@ namespace pxsim {
|
||||
private speedCmdValues: number[];
|
||||
private speedCmdTacho: number;
|
||||
private speedCmdTime: number;
|
||||
private _synchedMotor: MotorNode; // non-null if master motor
|
||||
|
||||
constructor(port: number, large: boolean) {
|
||||
super(port);
|
||||
@ -22,22 +23,34 @@ namespace pxsim {
|
||||
}
|
||||
|
||||
getSpeed() {
|
||||
return this.speed * (this.polarity == 0 ? -1 : 1);
|
||||
return this.speed * (this.polarity == 0 ? -1 : 1);
|
||||
}
|
||||
|
||||
getAngle() {
|
||||
return this.angle;
|
||||
}
|
||||
|
||||
// returns the slave motor if any
|
||||
getSynchedMotor() {
|
||||
return this._synchedMotor;
|
||||
}
|
||||
|
||||
setSpeedCmd(cmd: DAL, values: number[]) {
|
||||
this.speedCmd = cmd;
|
||||
this.speedCmdValues = values;
|
||||
this.speedCmdTacho = this.angle;
|
||||
this.speedCmdTime = pxsim.U.now();
|
||||
delete this._synchedMotor;
|
||||
}
|
||||
|
||||
setSyncCmd(motor: MotorNode, cmd: DAL, values: number[]) {
|
||||
this.setSpeedCmd(cmd, values);
|
||||
this._synchedMotor = motor;
|
||||
}
|
||||
|
||||
clearSpeedCmd() {
|
||||
delete this.speedCmd;
|
||||
delete this._synchedMotor;
|
||||
}
|
||||
|
||||
setLarge(large: boolean) {
|
||||
@ -67,6 +80,7 @@ namespace pxsim {
|
||||
|
||||
stop() {
|
||||
this.started = false;
|
||||
this.clearSpeedCmd();
|
||||
}
|
||||
|
||||
start() {
|
||||
@ -77,7 +91,7 @@ namespace pxsim {
|
||||
console.log(`motor: ${elapsed}ms - ${this.speed}% - ${this.angle}> - ${this.tacho}|`)
|
||||
const interval = Math.min(20, elapsed);
|
||||
let t = 0;
|
||||
while(t < elapsed) {
|
||||
while (t < elapsed) {
|
||||
let dt = interval;
|
||||
if (t + dt > elapsed) dt = elapsed - t;
|
||||
this.updateStateStep(dt);
|
||||
@ -97,14 +111,14 @@ namespace pxsim {
|
||||
case DAL.opOutputTimeSpeed:
|
||||
case DAL.opOutputTimePower:
|
||||
case DAL.opOutputStepPower:
|
||||
case DAL.opOutputStepSpeed:
|
||||
case DAL.opOutputStepSpeed: {
|
||||
// ramp up, run, ramp down, <brake> using time
|
||||
const speed = this.speedCmdValues[0];
|
||||
const step1 = this.speedCmdValues[1];
|
||||
const step2 = this.speedCmdValues[2];
|
||||
const step3 = this.speedCmdValues[3];
|
||||
const brake = this.speedCmdValues[4];
|
||||
const dstep = (this.speedCmd == DAL.opOutputTimePower || this.speedCmd == DAL.opOutputTimeSpeed)
|
||||
const dstep = (this.speedCmd == DAL.opOutputTimePower || this.speedCmd == DAL.opOutputTimeSpeed)
|
||||
? pxsim.U.now() - this.speedCmdTime
|
||||
: this.tacho - this.speedCmdTacho;
|
||||
if (dstep < step1) // rampup
|
||||
@ -117,9 +131,36 @@ namespace pxsim {
|
||||
if (brake) this.speed = 0;
|
||||
this.clearSpeedCmd();
|
||||
}
|
||||
this.speed = Math.round(this.speed); // integer only
|
||||
break;
|
||||
}
|
||||
case DAL.opOutputStepSync:
|
||||
case DAL.opOutputTimeSync: {
|
||||
if (!this._synchedMotor) // handled in other motor code
|
||||
break;
|
||||
|
||||
const otherMotor = this._synchedMotor;
|
||||
const speed = this.speedCmdValues[0];
|
||||
const turnRatio = this.speedCmdValues[1];
|
||||
const stepsOrTime = this.speedCmdValues[2];
|
||||
const brake = this.speedCmdValues[3];
|
||||
const dstep = this.speedCmd == DAL.opOutputTimeSync
|
||||
? pxsim.U.now() - this.speedCmdTime
|
||||
: this.tacho - this.speedCmdTacho;
|
||||
// 0 is special case, run infinite
|
||||
if (!stepsOrTime || dstep < stepsOrTime)
|
||||
this.speed = speed;
|
||||
else {
|
||||
if (brake) this.speed = 0;
|
||||
this.clearSpeedCmd();
|
||||
}
|
||||
// send synched motor state
|
||||
otherMotor.speed = Math.floor(this.speed * turnRatio / 100);
|
||||
if (!this._synchedMotor)
|
||||
otherMotor.clearSpeedCmd();
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.speed = Math.round(this.speed); // integer only
|
||||
|
||||
// compute delta angle
|
||||
const rotations = this.getSpeed() / 100 * this.rotationsPerMilliSecond * elapsed;
|
||||
|
@ -56,6 +56,25 @@ namespace pxsim {
|
||||
motors.forEach(motor => motor.setSpeedCmd(cmd, [speed, step1, step2, step3, brake]));
|
||||
return 2;
|
||||
}
|
||||
case DAL.opOutputStepSync:
|
||||
case DAL.opOutputTimeSync: {
|
||||
const port = buf.data[1];
|
||||
const speed = pxsim.BufferMethods.getNumber(buf, BufferMethods.NumberFormat.Int8LE, 2); // signed byte
|
||||
// note that b[3] is padding
|
||||
const turnRatio = pxsim.BufferMethods.getNumber(buf, BufferMethods.NumberFormat.Int16LE, 4);
|
||||
// b[6], b[7] is padding
|
||||
const stepsOrTime = pxsim.BufferMethods.getNumber(buf, BufferMethods.NumberFormat.Int32LE, 8);
|
||||
const brake = pxsim.BufferMethods.getNumber(buf, BufferMethods.NumberFormat.Int8LE, 12);
|
||||
|
||||
const motors = ev3board().getMotor(port);
|
||||
for (const motor of motors) {
|
||||
const otherMotor = motors.filter(m => m.port != motor.port)[0];
|
||||
motor.setSyncCmd(
|
||||
motor.port < otherMotor.port ? otherMotor : undefined,
|
||||
cmd, [speed, turnRatio, stepsOrTime, brake]);
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
case DAL.opOutputStop: {
|
||||
// stop
|
||||
const port = buf.data[1];
|
||||
|
@ -5,6 +5,7 @@ namespace pxsim {
|
||||
|
||||
protected mode: number;
|
||||
protected valueChanged: boolean;
|
||||
protected modeChanged: boolean;
|
||||
|
||||
constructor(port: number) {
|
||||
super(port);
|
||||
@ -24,6 +25,8 @@ namespace pxsim {
|
||||
|
||||
setMode(mode: number) {
|
||||
this.mode = mode;
|
||||
this.changed = true;
|
||||
this.modeChanged = true;
|
||||
}
|
||||
|
||||
getMode() {
|
||||
@ -44,6 +47,12 @@ namespace pxsim {
|
||||
return res;
|
||||
}
|
||||
|
||||
modeChange() {
|
||||
const res = this.modeChanged;
|
||||
this.modeChanged = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
setChangedState() {
|
||||
this.changed = true;
|
||||
this.valueChanged = false;
|
||||
|
@ -10,8 +10,6 @@ namespace pxsim.music {
|
||||
}
|
||||
|
||||
namespace pxsim.SoundMethods {
|
||||
let numSoundsPlaying = 0;
|
||||
const soundsLimit = 1;
|
||||
let audio: HTMLAudioElement;
|
||||
|
||||
export function buffer(buf: RefBuffer) {
|
||||
@ -27,18 +25,15 @@ namespace pxsim.SoundMethods {
|
||||
}
|
||||
|
||||
export function play(buf: RefBuffer, volume: number) {
|
||||
if (!buf || numSoundsPlaying >= soundsLimit) {
|
||||
if (!buf) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return new Promise<void>(resolve => {
|
||||
let url = "data:audio/wav;base64," + btoa(uint8ArrayToString(buf.data))
|
||||
audio = new Audio(url)
|
||||
audio.onended = () => {
|
||||
resolve();
|
||||
numSoundsPlaying--;
|
||||
}
|
||||
numSoundsPlaying++;
|
||||
audio.play()
|
||||
audio.onended = () => resolve();
|
||||
audio.onpause = () => resolve();
|
||||
audio.play();
|
||||
})
|
||||
}
|
||||
|
||||
@ -46,8 +41,8 @@ namespace pxsim.SoundMethods {
|
||||
return new Promise<void>(resolve => {
|
||||
if (audio) {
|
||||
audio.pause();
|
||||
numSoundsPlaying--;
|
||||
}
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -183,8 +183,8 @@ namespace pxsim.visuals {
|
||||
this.layoutView.updateTheme(theme);
|
||||
}
|
||||
|
||||
private getControlForNode(id: NodeType, port: number) {
|
||||
if (this.cachedControlNodes[id] && this.cachedControlNodes[id][port]) {
|
||||
private getControlForNode(id: NodeType, port: number, useCache = true) {
|
||||
if (useCache && this.cachedControlNodes[id] && this.cachedControlNodes[id][port]) {
|
||||
return this.cachedControlNodes[id][port];
|
||||
}
|
||||
|
||||
@ -340,6 +340,28 @@ namespace pxsim.visuals {
|
||||
cancelAnimationFrame(animationId);
|
||||
})
|
||||
}
|
||||
// Save previous inputs for the next cycle
|
||||
EV3View.previousSelectedInputs = ev3board().getInputNodes().map((node, index) => (this.getDisplayViewForNode(node.id, index).getSelected()) ? node.id : -1)
|
||||
EV3View.previousSeletedOutputs = ev3board().getMotors().map((node, index) => (this.getDisplayViewForNode(node.id, index).getSelected()) ? node.id : -1);
|
||||
}
|
||||
|
||||
private static previousSelectedInputs: number[];
|
||||
private static previousSeletedOutputs: number[];
|
||||
|
||||
private static isPreviousInputSelected(index: number, id: number) {
|
||||
if (EV3View.previousSelectedInputs && EV3View.previousSelectedInputs[index] == id) {
|
||||
EV3View.previousSelectedInputs[index] = undefined;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static isPreviousOutputSelected(index: number, id: number) {
|
||||
if (EV3View.previousSeletedOutputs && EV3View.previousSeletedOutputs[index] == id) {
|
||||
EV3View.previousSeletedOutputs[index] = undefined;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private begin() {
|
||||
@ -382,7 +404,9 @@ namespace pxsim.visuals {
|
||||
const view = this.getDisplayViewForNode(node.id, index);
|
||||
if (!node.didChange() && !view.didChange()) return;
|
||||
if (view) {
|
||||
const control = view.getSelected() ? this.getControlForNode(node.id, index) : undefined;
|
||||
const isSelected = EV3View.isPreviousInputSelected(index, node.id) || view.getSelected();
|
||||
if (isSelected && !view.getSelected()) view.setSelected(true);
|
||||
const control = isSelected ? this.getControlForNode(node.id, index, !node.modeChange()) : undefined;
|
||||
const closeIcon = control ? this.getCloseIconView() : undefined;
|
||||
this.layoutView.setInput(index, view, control, closeIcon);
|
||||
view.updateState();
|
||||
@ -401,7 +425,9 @@ namespace pxsim.visuals {
|
||||
const view = this.getDisplayViewForNode(node.id, index);
|
||||
if (!node.didChange() && !view.didChange()) return;
|
||||
if (view) {
|
||||
const control = view.getSelected() ? this.getControlForNode(node.id, index) : undefined;
|
||||
const isSelected = EV3View.isPreviousOutputSelected(index, node.id) || view.getSelected();
|
||||
if (isSelected && !view.getSelected()) view.setSelected(true);
|
||||
const control = isSelected ? this.getControlForNode(node.id, index) : undefined;
|
||||
const closeIcon = control ? this.getCloseIconView() : undefined;
|
||||
this.layoutView.setOutput(index, view, control, closeIcon);
|
||||
view.updateState();
|
||||
|
@ -7,7 +7,7 @@ namespace pxsim.visuals {
|
||||
|
||||
getInnerView() {
|
||||
this.group = svg.elt("g") as SVGGElement;
|
||||
this.group.setAttribute("transform", `translate(1.02, 1.5) scale(0.8)`)
|
||||
this.group.setAttribute("transform", `translate(2, 2.5) scale(0.6)`)
|
||||
|
||||
const colorIds = ['red', 'yellow', 'blue', 'green', undefined, 'grey'];
|
||||
const colors = ['#f12a21', '#ffd01b', '#006db3', '#00934b', undefined, '#6c2d00'];
|
||||
|
@ -14,6 +14,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
|
||||
public updateState() {
|
||||
super.updateState();
|
||||
// TODO: show different color modes
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
|
||||
updateState() {
|
||||
super.updateState();
|
||||
const motorState = ev3board().getMotors()[this.port];
|
||||
if (!motorState) return;
|
||||
const speed = motorState.getSpeed();
|
||||
|
@ -20,6 +20,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
|
||||
updateState() {
|
||||
super.updateState();
|
||||
const motorState = ev3board().getMotors()[this.port];
|
||||
if (!motorState) return;
|
||||
const speed = motorState.getSpeed();
|
||||
|
@ -4,7 +4,8 @@ namespace pxsim.visuals {
|
||||
protected content: SVGSVGElement;
|
||||
|
||||
protected controlShown: boolean;
|
||||
protected selected: boolean;
|
||||
|
||||
protected opacity: number;
|
||||
|
||||
constructor(protected xml: string, protected prefix: string, protected id: NodeType, protected port: NodeType) {
|
||||
super();
|
||||
@ -106,19 +107,24 @@ namespace pxsim.visuals {
|
||||
this.updateOpacity();
|
||||
}
|
||||
|
||||
public updateState() {
|
||||
this.updateOpacity();
|
||||
}
|
||||
|
||||
protected updateOpacity() {
|
||||
if (this.rendered) {
|
||||
const opacity = this.selected ? "0.2" : "1";
|
||||
if (this.hasClick()) {
|
||||
this.setOpacity(opacity);
|
||||
const opacity = this.selected ? 0.2 : 1;
|
||||
if (this.hasClick() && this.opacity != opacity) {
|
||||
this.opacity = opacity;
|
||||
this.setOpacity(this.opacity);
|
||||
if (this.selected) this.content.style.cursor = "";
|
||||
else this.content.style.cursor = "pointer";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected setOpacity(opacity: string) {
|
||||
this.element.setAttribute("opacity", opacity);
|
||||
protected setOpacity(opacity: number) {
|
||||
this.element.setAttribute("opacity", `${opacity}`);
|
||||
}
|
||||
}
|
||||
}
|
@ -219,7 +219,6 @@ namespace pxsim.visuals {
|
||||
this.changed = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export abstract class SimView<T extends BaseNode> extends View implements LayoutElement {
|
||||
|
@ -4,20 +4,7 @@
|
||||
viewBox="0 0 23 23" style="enable-background:new 0 0 23 23;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
.st1{fill:none;stroke:#717171;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_expansions" transform="translate(-9596 11554)">
|
||||
<circle id="Ellipse_34" class="st0" cx="9607.5" cy="-11542" r="9"/>
|
||||
<g id="Rectangle_253_1_" transform="translate(527 574)">
|
||||
<rect x="9079.5" y="-12122" class="st0" width="2" height="12"/>
|
||||
<rect x="9080" y="-12121.5" class="st1" width="1" height="11"/>
|
||||
</g>
|
||||
<g id="Rectangle_254_1_" transform="translate(522 581) rotate(-90)">
|
||||
|
||||
<rect x="12117" y="9084.5" transform="matrix(-2.535182e-06 -1 1 -2.535182e-06 3037.5305 21208.5234)" class="st0" width="12" height="2"/>
|
||||
|
||||
<rect x="12117.5" y="9085" transform="matrix(-2.535182e-06 -1 1 -2.535182e-06 3037.5305 21208.5234)" class="st1" width="11" height="1"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st0" d="M11.5,2.5c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S16.5,2.5,11.5,2.5z M17.5,12.5h-5v5h-2v-5h-5v-2h5v-5h2v5h5V12.5z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 552 B |
@ -6,18 +6,5 @@
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_advanced_closed" transform="translate(-9594 10075)">
|
||||
<g id="Line_9_1_">
|
||||
|
||||
<rect x="9600.7" y="-10067" transform="matrix(0.7071 -0.7071 0.7071 0.7071 9926.6836 3842.5476)" class="st0" width="2" height="11.3"/>
|
||||
</g>
|
||||
<g id="Line_10_1_">
|
||||
|
||||
<rect x="9603" y="-10062.3" transform="matrix(0.7071 -0.7071 0.7071 0.7071 9928.7334 3847.4973)" class="st0" width="11.3" height="2"/>
|
||||
</g>
|
||||
<g id="menu_icn_advanced_closed-2">
|
||||
|
||||
<rect x="9604.7" y="-10057.6" transform="matrix(0.7071 -0.7071 0.7071 0.7071 9924.7324 3846.2527)" class="st0" width="1" height="1"/>
|
||||
</g>
|
||||
</g>
|
||||
<polygon class="st0" points="22.8,6.8 20.8,4.9 11.5,14.2 2.2,4.9 0.2,6.8 10.5,17.1 10.5,17.1 11.5,18.1 11.8,17.8 11.8,17.8 "/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1017 B After Width: | Height: | Size: 552 B |
@ -6,18 +6,5 @@
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_advanced_open" transform="translate(-8544 12422.914) rotate(180)">
|
||||
<g id="Line_9">
|
||||
|
||||
<rect x="-8559.7" y="12406.3" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -11283.3965 -2416.5291)" class="st0" width="2" height="11.3"/>
|
||||
</g>
|
||||
<g id="Line_10">
|
||||
|
||||
<rect x="-8557.4" y="12411" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -11281.3467 -2411.5793)" class="st0" width="11.3" height="2"/>
|
||||
</g>
|
||||
<g id="Rectangle_251">
|
||||
|
||||
<rect x="-8555.7" y="12415.7" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -11285.3848 -2412.8174)" class="st0" width="1" height="1"/>
|
||||
</g>
|
||||
</g>
|
||||
<polygon class="st0" points="22.6,16.1 12.5,6 12.5,6 11.5,5 11.2,5.3 11.2,5.3 0.4,16.1 2.3,18 11.5,8.8 20.7,18 "/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1023 B After Width: | Height: | Size: 540 B |
@ -7,25 +7,24 @@
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_FX" transform="translate(-9079.886 11883.081)">
|
||||
<path id="Path_166" class="st0" d="M9087.2-11874.5h-1.7c0-0.5,0-0.6,0.5-0.6c0.8,0,1.4-0.4,1.7-1.1c0.4-0.8,0.9-1.6,1.4-2.4
|
||||
c0.5-0.7,1.3-1.2,2.2-1.3c0.6-0.1,1.2,0.1,1.5,0.6c0.2,0.3,0.2,0.6,0.1,0.9c-0.2,0.3-0.5,0.4-0.8,0.3c-0.3,0-0.5-0.3-0.5-0.6
|
||||
c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.4,0.1-0.6c-0.2,0-0.5-0.1-0.7,0c-0.4,0.2-0.7,0.4-0.9,0.8c-0.4,0.6-0.7,1.3-0.9,2
|
||||
c-0.2,0.5-0.4,1.1-0.5,1.6h1.3c-0.1,0.2-0.1,0.4-0.2,0.6h-1.3c-0.3,1-0.5,1.9-0.8,2.8c-0.4,1.9-1.1,3.7-1.9,5.5
|
||||
c-0.4,0.8-0.9,1.5-1.5,2.1c-0.5,0.5-1.1,0.8-1.8,0.8c-0.4,0.1-0.8-0.1-1.2-0.3c-0.2-0.2-0.3-0.6-0.2-0.9c0.2-0.3,0.5-0.5,0.9-0.4
|
||||
c0.3,0,0.4,0.3,0.4,0.6c0,0.1-0.1,0.2-0.1,0.2c-0.1,0.1-0.1,0.2-0.1,0.3c0.1,0,0.2,0.1,0.4,0.1c0.5,0,1-0.3,1.3-0.8
|
||||
c0.3-0.5,0.6-1,0.7-1.5c0.8-2.8,1.6-5.6,2.4-8.4C9087.2-11874.4,9087.2-11874.4,9087.2-11874.5z"/>
|
||||
<path id="Path_167" class="st0" d="M9098.2-11863.3c0.1-0.1,0.1-0.2,0.2-0.3c1-0.6,1.7-1.7,1.9-2.8c0.4-1.9,0.4-3.8-0.1-5.6
|
||||
c-0.3-1-0.9-1.8-1.7-2.4c-0.1-0.1-0.2-0.2-0.2-0.3c1.8,0.7,3.5,2.9,3.5,5.7C9101.8-11866.6,9100.4-11864.3,9098.2-11863.3z"/>
|
||||
<path id="Path_168" class="st0" d="M9093.5-11874.7c0,0.1-0.1,0.2-0.1,0.2c-1,0.6-1.7,1.7-1.9,2.8c-0.4,1.9-0.4,3.8,0.1,5.7
|
||||
c0.3,1,0.9,1.8,1.7,2.4c0.1,0.1,0.2,0.1,0.2,0.3c-2.1-1-3.5-3.2-3.4-5.6C9090-11872,9091.9-11874.2,9093.5-11874.7z"/>
|
||||
<path id="Path_169" class="st0" d="M9097.9-11867.4c0,0,0.1,0,0.2,0.1c0,0,0,0,0,0.1c-0.3,0.5-0.6,0.9-1.1,1.2
|
||||
c-0.2,0.2-0.6,0.3-0.9,0c-0.1-0.1-0.2-0.2-0.2-0.4c-0.2-0.6-0.3-1.1-0.4-1.7c0-0.1,0-0.1-0.1-0.2c-0.1,0.2-0.2,0.4-0.4,0.6
|
||||
c-0.3,0.4-0.6,0.9-1,1.3c-0.2,0.2-0.4,0.4-0.7,0.5c-0.3,0.1-0.6,0-0.8-0.3c0,0,0-0.1,0-0.1c0-0.2,0-0.4,0.2-0.5
|
||||
c0.1-0.1,0.3-0.1,0.5,0c0,0,0.1,0.1,0.1,0.1c0.3,0.2,0.4,0.3,0.6-0.1c0.4-0.6,0.8-1.3,1.3-1.9c0-0.1,0-0.2,0-0.3
|
||||
c-0.1-0.4-0.2-0.8-0.3-1.2c-0.2-0.7-0.5-0.9-1.2-0.9h-0.1c-0.1-0.1,0-0.2,0.1-0.2c0.4-0.1,0.9-0.2,1.3-0.2c0.1,0,0.2,0,0.3,0.1
|
||||
c0.3,0.4,0.5,0.8,0.6,1.3c0,0.1,0.1,0.3,0.1,0.4c0.1-0.2,0.3-0.5,0.5-0.7c0.3-0.3,0.6-0.7,0.9-0.9c0.2-0.1,0.4-0.2,0.6-0.2
|
||||
c0.3,0,0.5,0.2,0.5,0.5c0,0,0,0.1,0,0.1c-0.1,0.3-0.3,0.4-0.6,0.3c0,0,0,0,0,0c-0.1,0-0.1,0-0.2,0c-0.3-0.2-0.7-0.1-0.9,0.2
|
||||
c0,0,0,0,0,0c-0.2,0.3-0.5,0.7-0.7,1c0,0.1,0,0.1,0,0.2c0.2,0.7,0.3,1.4,0.5,2.2c0,0.1,0,0.1,0.1,0.2c0.1,0.3,0.3,0.4,0.5,0.1
|
||||
C9097.5-11866.9,9097.6-11867.2,9097.9-11867.4z"/>
|
||||
<path id="Path_166" class="st0" d="M9086.9-11874.7h-1.8c0-0.5,0-0.6,0.5-0.6c0.9,0,1.5-0.4,1.8-1.2c0.4-0.9,1-1.7,1.5-2.6
|
||||
c0.5-0.7,1.4-1.3,2.3-1.4c0.6-0.1,1.3,0.1,1.6,0.6c0.2,0.3,0.2,0.6,0.1,1c-0.2,0.3-0.5,0.4-0.9,0.3c-0.3,0-0.5-0.3-0.5-0.6
|
||||
c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.4,0.1-0.6c-0.2,0-0.5-0.1-0.7,0c-0.4,0.2-0.7,0.4-1,0.9c-0.4,0.6-0.7,1.4-1,2.1
|
||||
c-0.2,0.5-0.4,1.2-0.5,1.7h1.4c-0.1,0.2-0.1,0.4-0.2,0.6h-1.4c-0.3,1.1-0.5,2-0.9,3c-0.4,2-1.2,3.9-2,5.8c-0.4,0.9-1,1.6-1.6,2.2
|
||||
c-0.5,0.5-1.2,0.8-1.9,0.8c-0.4,0.1-0.9-0.1-1.3-0.3c-0.2-0.2-0.3-0.6-0.2-1c0.2-0.3,0.5-0.5,1-0.4c0.3,0,0.4,0.3,0.4,0.6
|
||||
c0,0.1-0.1,0.2-0.1,0.2c-0.1,0.1-0.1,0.2-0.1,0.3c0.1,0,0.2,0.1,0.4,0.1c0.5,0,1.1-0.3,1.4-0.8c0.3-0.5,0.6-1.1,0.7-1.6
|
||||
c0.8-3,1.7-6,2.6-8.9C9086.9-11874.6,9086.9-11874.6,9086.9-11874.7z"/>
|
||||
<path id="Path_167" class="st0" d="M9098.6-11862.8c0.1-0.1,0.1-0.2,0.2-0.3c1.1-0.6,1.8-1.8,2-3c0.4-2,0.4-4-0.1-6
|
||||
c-0.3-1.1-1-1.9-1.8-2.6c-0.1-0.1-0.2-0.2-0.2-0.3c1.9,0.7,3.7,3.1,3.7,6.1C9102.5-11866.3,9101-11863.8,9098.6-11862.8z"/>
|
||||
<path id="Path_168" class="st0" d="M9093.6-11874.9c0,0.1-0.1,0.2-0.1,0.2c-1.1,0.6-1.8,1.8-2,3c-0.4,2-0.4,4,0.1,6.1
|
||||
c0.3,1.1,1,1.9,1.8,2.6c0.1,0.1,0.2,0.1,0.2,0.3c-2.2-1.1-3.7-3.4-3.6-6C9089.9-11872,9091.9-11874.4,9093.6-11874.9z"/>
|
||||
<path id="Path_169" class="st0" d="M9098.3-11867.1c0,0,0.1,0,0.2,0.1c0,0,0,0,0,0.1c-0.3,0.5-0.6,1-1.2,1.3c-0.2,0.2-0.6,0.3-1,0
|
||||
c-0.1-0.1-0.2-0.2-0.2-0.4c-0.2-0.6-0.3-1.2-0.4-1.8c0-0.1,0-0.1-0.1-0.2c-0.1,0.2-0.2,0.4-0.4,0.6c-0.3,0.4-0.6,1-1.1,1.4
|
||||
c-0.2,0.2-0.4,0.4-0.7,0.5c-0.3,0.1-0.6,0-0.9-0.3v-0.1c0-0.2,0-0.4,0.2-0.5c0.1-0.1,0.3-0.1,0.5,0l0.1,0.1
|
||||
c0.3,0.2,0.4,0.3,0.6-0.1c0.4-0.6,0.9-1.4,1.4-2c0-0.1,0-0.2,0-0.3c-0.1-0.4-0.2-0.9-0.3-1.3c-0.2-0.7-0.5-1-1.3-1h-0.1
|
||||
c-0.1-0.1,0-0.2,0.1-0.2c0.4-0.1,1-0.2,1.4-0.2c0.1,0,0.2,0,0.3,0.1c0.3,0.4,0.5,0.8,0.6,1.4c0,0.1,0.1,0.3,0.1,0.4
|
||||
c0.1-0.2,0.3-0.5,0.5-0.7c0.3-0.3,0.6-0.7,1-1c0.2-0.1,0.4-0.2,0.6-0.2c0.3,0,0.5,0.2,0.5,0.5v0.1c-0.1,0.3-0.3,0.4-0.6,0.3l0,0
|
||||
c-0.1,0-0.1,0-0.2,0c-0.3-0.2-0.7-0.1-1,0.2l0,0c-0.2,0.3-0.5,0.7-0.7,1.1c0,0.1,0,0.1,0,0.2c0.2,0.7,0.3,1.5,0.5,2.3
|
||||
c0,0.1,0,0.1,0.1,0.2c0.1,0.3,0.3,0.4,0.5,0.1C9097.9-11866.6,9098-11866.9,9098.3-11867.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.6 KiB |
@ -7,10 +7,11 @@
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_loops" transform="translate(-9080.903 10401.478)">
|
||||
<path id="Path_141" class="st0" d="M9085.3-10385.5c-0.9-1.3-1.9-2.5-2.8-3.8h1.9c0-2.2,0.9-4.4,2.5-5.9c1.1-1.1,2.4-1.8,3.9-2.1
|
||||
c2.7-0.6,5.6,0.2,7.6,2.2c-0.5,0.5-0.9,0.9-1.3,1.3c-2.4-2-4.9-2.4-7.7-0.9c-2,1.1-3.1,3.2-3.1,5.4h1.9
|
||||
C9087.2-10388,9086.2-10386.7,9085.3-10385.5z"/>
|
||||
<path id="Path_142" class="st0" d="M9098.9-10389.3h-1.9c1-1.3,1.9-2.5,2.8-3.8c1,1.3,1.9,2.5,2.8,3.8h-1.9c0,2.3-1,4.5-2.6,6
|
||||
c-1.1,1-2.4,1.7-3.8,2c-2.7,0.6-5.6-0.2-7.6-2.2l1.3-1.3c2.3,2,4.9,2.5,7.7,0.9C9097.7-10384.9,9098.9-10387,9098.9-10389.3z"/>
|
||||
<path id="Path_141" class="st0" d="M9084.5-10385.8c-1-1.4-2.1-2.7-3.1-4.2h2.1c0-2.4,1-4.8,2.7-6.5c1.2-1.2,2.6-2,4.3-2.3
|
||||
c3-0.7,6.1,0.2,8.3,2.4c-0.5,0.5-1,1-1.4,1.4c-2.6-2.2-5.4-2.6-8.4-1c-2.2,1.2-3.4,3.5-3.4,5.9h2.1
|
||||
C9086.5-10388.6,9085.4-10387.1,9084.5-10385.8z"/>
|
||||
<path id="Path_142" class="st0" d="M9099.4-10390h-2.1c1.1-1.4,2.1-2.7,3.1-4.2c1.1,1.4,2.1,2.7,3.1,4.2h-2.1
|
||||
c0,2.5-1.1,4.9-2.9,6.6c-1.2,1.1-2.6,1.9-4.2,2.2c-3,0.7-6.1-0.2-8.3-2.4l1.4-1.4c2.5,2.2,5.4,2.7,8.4,1
|
||||
C9098.1-10385.2,9099.4-10387.5,9099.4-10390z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@ -8,12 +8,12 @@
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_math" transform="translate(-9078.442 10583.172)">
|
||||
<path id="Path_153" class="st0" d="M9087.4-10564.7c-0.2,0.2-0.5,0.5-0.7,0.7l-2.2-2.2c-0.8,0.8-1.5,1.5-2.2,2.2
|
||||
c-0.2-0.2-0.5-0.5-0.7-0.7l2.2-2.2c-0.8-0.8-1.5-1.5-2.2-2.2c0.2-0.2,0.5-0.5,0.7-0.7l2.2,2.2l2.2-2.2c0.2,0.2,0.5,0.5,0.7,0.7
|
||||
l-2.2,2.2C9085.9-10566.1,9086.7-10565.4,9087.4-10564.7z"/>
|
||||
<path id="Path_154" class="st0" d="M9080.9-10575.6v-0.9h3.1v-3.1c0.3,0,0.6,0,0.9,0v3.1h3.1v0.9h-3.1v3.1h-1v-3.1H9080.9z"/>
|
||||
<path id="Path_155" class="st1" d="M9098.5-10567.3h-7.8v-1.7h7.8V-10567.3z"/>
|
||||
<path id="Path_156" class="st1" d="M9098.5-10565.6v1.7h-7.8v-1.7H9098.5z"/>
|
||||
<path id="Path_157" class="st1" d="M9098.5-10577v1.7h-7.8v-1.7H9098.5z"/>
|
||||
<path id="Path_153" class="st0" d="M9087.2-10563.2c-0.2,0.2-0.6,0.6-0.8,0.8l-2.6-2.6c-1,1-1.8,1.8-2.6,2.6
|
||||
c-0.2-0.2-0.6-0.6-0.8-0.8l2.6-2.6c-1-1-1.8-1.8-2.6-2.6c0.2-0.2,0.6-0.6,0.8-0.8l2.6,2.6l2.6-2.6c0.2,0.2,0.6,0.6,0.8,0.8
|
||||
l-2.6,2.6C9085.4-10564.9,9086.3-10564,9087.2-10563.2z"/>
|
||||
<path id="Path_154" class="st0" d="M9079.3-10576.3v-1.1h3.7v-3.7c0.4,0,0.7,0,1.1,0v3.7h3.7v1.1h-3.7v3.7h-1.2v-3.7H9079.3z"/>
|
||||
<path id="Path_155" class="st1" d="M9100.5-10566.3h-9.4v-2h9.4V-10566.3z"/>
|
||||
<path id="Path_156" class="st1" d="M9100.5-10564.3v2h-9.4v-2H9100.5z"/>
|
||||
<path id="Path_157" class="st1" d="M9100.5-10578v2h-9.4v-2H9100.5z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
@ -3,16 +3,10 @@
|
||||
<svg version="1.1" id="svg41" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 23 23" style="enable-background:new 0 0 23 23;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:none;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_sensor" transform="translate(-9778 10128)">
|
||||
<g id="Path_170" transform="translate(697 95)">
|
||||
<path class="st0" d="M9092.5-10221.5c5.5,0,10,4.5,10,10s-4.5,10-10,10s-10-4.5-10-10S9087-10221.5,9092.5-10221.5z"/>
|
||||
<path class="st1" d="M9092.5-10204.5c3.9,0,7-3.1,7-7s-3.1-7-7-7s-7,3.1-7,7S9088.6-10204.5,9092.5-10204.5 M9092.5-10201.5
|
||||
c-5.5,0-10-4.5-10-10s4.5-10,10-10s10,4.5,10,10S9098-10201.5,9092.5-10201.5z"/>
|
||||
</g>
|
||||
<path id="Path_171" class="st1" d="M9789.5-10120.5c2.2,0,4,1.8,4,4s-1.8,4-4,4s-4-1.8-4-4S9787.3-10120.5,9789.5-10120.5z"/>
|
||||
</g>
|
||||
<path class="st0" d="M11.5,1.8c-5.4,0-9.8,4.4-9.8,9.8c0,5.4,4.4,9.8,9.8,9.8s9.8-4.4,9.8-9.8C21.2,6.1,16.9,1.8,11.5,1.8z
|
||||
M11.5,18.3c-3.8,0-6.8-3.1-6.8-6.8s3.1-6.8,6.8-6.8s6.8,3.1,6.8,6.8S15.3,18.3,11.5,18.3z"/>
|
||||
<circle class="st0" cx="11.5" cy="11.5" r="3.9"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1010 B After Width: | Height: | Size: 687 B |
@ -3,27 +3,18 @@
|
||||
<svg version="1.1" id="svg41" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 23 23" style="enable-background:new 0 0 23 23;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{clip-path:url(#SVGID_2_);}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g>
|
||||
<defs>
|
||||
<rect id="SVGID_1_" x="3" y="5" width="16" height="13"/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_2_">
|
||||
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<g id="menu_icn_variables" transform="translate(-9077.432 10524.199)" class="st0">
|
||||
<g transform="translate(-518.568 -458.199)">
|
||||
<path id="Path_165" class="st1" d="M9615-10061v2h-16v-2H9615z"/>
|
||||
</g>
|
||||
<g transform="translate(-518.568 -453.199)">
|
||||
<path id="Path_165-2" class="st1" d="M9615-10061v2h-16v-2H9615z"/>
|
||||
</g>
|
||||
<g transform="translate(-518.568 -448.199)">
|
||||
<path id="Path_165-3" class="st1" d="M9615-10061v2h-16v-2H9615z"/>
|
||||
</g>
|
||||
<g transform="translate(-518.568 -448.199)">
|
||||
<path id="Path_165-3" class="st0" d="M539.7,464.3v2.4h-19.2v-2.4H539.7z"/>
|
||||
</g>
|
||||
<g transform="translate(-518.568 -453.199)">
|
||||
<path id="Path_165-2" class="st0" d="M539.7,463.5v2.4h-19.2v-2.4H539.7z"/>
|
||||
</g>
|
||||
<g id="menu_icn_variables" transform="translate(-9077.432 10524.199)">
|
||||
<g transform="translate(-518.568 -458.199)">
|
||||
<path id="Path_165" class="st0" d="M9617.1-10061.5v2.4h-19.2v-2.4H9617.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 884 B |
@ -2,10 +2,30 @@ const webfontsGenerator = require('webfonts-generator');
|
||||
|
||||
webfontsGenerator({
|
||||
files: [
|
||||
'./ultrasonic.svg',
|
||||
"./ultrasonic.svg",
|
||||
"./color.svg",
|
||||
"./touch.svg",
|
||||
"./gyro.svg"
|
||||
"./gyro.svg",
|
||||
"./categories/addpackage.svg",
|
||||
"./categories/brick.svg",
|
||||
"./categories/controls.svg",
|
||||
"./categories/functions.svg",
|
||||
"./categories/list.svg",
|
||||
"./categories/logic.svg",
|
||||
"./categories/loops.svg",
|
||||
"./categories/math.svg",
|
||||
"./categories/motors.svg",
|
||||
"./categories/music.svg",
|
||||
"./categories/sensors.svg",
|
||||
"./categories/text.svg",
|
||||
"./categories/variables.svg",
|
||||
"./categories/advancedcollapsed.svg",
|
||||
"./categories/advancedexpanded.svg",
|
||||
"./icons/cancel.svg",
|
||||
"./icons/check.svg",
|
||||
"./icons/download.svg",
|
||||
"./icons/save.svg",
|
||||
"./icons/blocks.svg"
|
||||
],
|
||||
dest: '../docs/static/fonts/icons/',
|
||||
round: 10
|
||||
|
14
svgicons/icons/blocks.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="svg41" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 23 23" style="enable-background:new 0 0 23 23;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_blocks" transform="translate(-9594.255 11170)">
|
||||
<rect id="Rectangle_271" x="9600.5" y="-11160.2" class="st0" width="16.2" height="3.5"/>
|
||||
<polygon class="st0" points="9616.8,-11162.6 9616.8,-11166 9594.8,-11166 9594.8,-11164.9 9594.8,-11162.6 9594.8,-11154.4
|
||||
9594.8,-11151 9616.8,-11151 9616.8,-11154.4 9598.2,-11154.4 9598.2,-11162.6 "/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 790 B |
@ -6,10 +6,6 @@
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="icn_cancel_x" transform="translate(14923.365 9661)">
|
||||
|
||||
<rect id="Rectangle_277" x="-14920.9" y="-9651.1" transform="matrix(0.7071 -0.7071 0.7071 0.7071 2455.6738 -13370.6289)" class="st0" width="18" height="3"/>
|
||||
|
||||
<rect id="Rectangle_278" x="-14913.4" y="-9658.6" transform="matrix(0.7071 -0.7071 0.7071 0.7071 2455.6738 -13370.6299)" class="st0" width="3" height="18"/>
|
||||
</g>
|
||||
<polygon class="st0" points="19,6 16.9,3.9 11.6,9.2 6.3,3.9 4.2,6 9.5,11.3 4.2,16.6 6.3,18.8 11.6,13.5 16.9,18.8 19,16.6
|
||||
13.7,11.3 "/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 562 B |
@ -6,10 +6,5 @@
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="icn_cancel_ok" transform="translate(15066.061 9654)">
|
||||
|
||||
<rect id="Rectangle_275" x="-15061" y="-9644.1" transform="matrix(0.7071 -0.7071 0.7071 0.7071 2409.7021 -13467.6172)" class="st0" width="18" height="3"/>
|
||||
|
||||
<rect id="Rectangle_276" x="-15061.3" y="-9643.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 2405.1626 -13472.2129)" class="st0" width="3" height="9"/>
|
||||
</g>
|
||||
<polygon class="st0" points="19.4,4.1 8.8,14.7 4.3,10.2 2.2,12.4 6.7,16.8 6.7,16.8 8.8,18.9 21.5,6.2 "/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 530 B |
@ -8,12 +8,7 @@
|
||||
<title>color</title>
|
||||
<g id="menu_icn_download" transform="translate(-9563 11322)">
|
||||
<rect id="Rectangle_167" x="9566" y="-11308" class="st0" width="18" height="8"/>
|
||||
<g id="arrow" transform="translate(6 -5)">
|
||||
<rect id="Rectangle_168" x="9568" y="-11315" class="st0" width="2" height="10"/>
|
||||
|
||||
<rect id="Rectangle_169" x="9567.6" y="-11307.6" transform="matrix(0.7071 -0.7071 0.7071 0.7071 10798.123 3455.804)" class="st0" width="6" height="2"/>
|
||||
|
||||
<rect id="Rectangle_170" x="9566.6" y="-11309.6" transform="matrix(0.7071 -0.7071 0.7071 0.7071 10797.2441 3453.6824)" class="st0" width="2" height="6"/>
|
||||
</g>
|
||||
<polygon class="st0" points="9579.4,-11312.9 9578,-11314.3 9576,-11312.3 9576,-11320 9574,-11320 9574,-11312.5 9572.2,-11314.3
|
||||
9570.8,-11312.9 9575,-11308.6 9575.1,-11308.7 9575.2,-11308.6 "/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 772 B |
@ -4,21 +4,15 @@
|
||||
viewBox="0 0 23 23" style="enable-background:new 0 0 23 23;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
.st1{fill:none;}
|
||||
.st2{fill:none;stroke:#FFFFFF;}
|
||||
</style>
|
||||
<title>color</title>
|
||||
<g id="menu_icn_savedisc" transform="translate(-8886 12201.056)">
|
||||
<path id="Path_116" class="st0" d="M8888.4-12189.1v-8.4c0-0.6,0.1-0.7,0.7-0.7h4c0.6,0,0.7,0.1,0.7,0.7v4.1c0,0.5,0.1,0.6,0.6,0.6
|
||||
h6c0.5,0,0.6-0.1,0.6-0.6v-4.2c0-0.5,0.1-0.6,0.6-0.6c1.2,0,1.2,0,2,0.8c0.9,0.9,1.7,1.7,2.6,2.6c0.2,0.2,0.3,0.4,0.3,0.7v13.5
|
||||
c0,0.5-0.1,0.7-0.6,0.7h-16.9c-0.5,0-0.6-0.1-0.6-0.7C8888.4-12183.5,8888.4-12186.3,8888.4-12189.1z M8897.5-12181.9h6.6
|
||||
c0.6,0,0.7-0.1,0.7-0.7v-7.7c0-0.5-0.1-0.7-0.7-0.7h-13.2c-0.5,0-0.7,0.1-0.7,0.7v7.7c0,0.6,0.1,0.7,0.7,0.7H8897.5z"/>
|
||||
<path id="Path_117" class="st0" d="M8899.8-12196.4c0,0.4,0,0.9,0,1.3c0,0.4-0.2,0.5-0.5,0.5c-0.3,0-0.6,0-0.8,0
|
||||
c-0.2,0-0.5-0.1-0.5-0.4c0,0,0-0.1,0-0.1v-2.6c0-0.2,0.1-0.4,0.4-0.5c0,0,0,0,0.1,0c0.3,0,0.6,0,0.9,0c0.3,0,0.5,0.2,0.5,0.4
|
||||
c0,0,0,0,0,0.1C8899.8-12197.3,8899.8-12196.8,8899.8-12196.4z"/>
|
||||
<g id="Rectangle_166" transform="translate(1.445 6.558)">
|
||||
<rect x="8888.4" y="-12198.2" class="st1" width="15.4" height="10.3"/>
|
||||
<rect x="8888.9" y="-12197.7" class="st2" width="14.4" height="9.3"/>
|
||||
</g>
|
||||
<path id="Path_117" class="st0" d="M8900.4-12197.9c0,0.5,0,1,0,1.5c0,0.5-0.2,0.6-0.6,0.6c-0.3,0-0.7,0-0.9,0
|
||||
c-0.2,0-0.6-0.1-0.6-0.5v-0.1v-2.9c0-0.2,0.1-0.5,0.5-0.6c0,0,0,0,0.1,0c0.3,0,0.7,0,1,0c0.3,0,0.6,0.2,0.6,0.5c0,0,0,0,0,0.1
|
||||
C8900.4-12198.9,8900.4-12198.3,8900.4-12197.9z"/>
|
||||
<path class="st0" d="M8907.6-12196c-1-1-1.9-1.9-2.9-2.9c-0.9-0.9-0.9-0.9-2.3-0.9c-0.6,0-0.7,0.1-0.7,0.7v4.7
|
||||
c0,0.6-0.1,0.7-0.7,0.7h-6.8c-0.6,0-0.7-0.1-0.7-0.7v-4.6c0-0.7-0.1-0.8-0.8-0.8h-4.5c-0.7,0-0.8,0.1-0.8,0.8v9.5
|
||||
c0,3.2,0,6.3,0,9.6c0,0.7,0.1,0.8,0.7,0.8h19.1c0.6,0,0.7-0.2,0.7-0.8v-15.2C8908-12195.6,8907.8-12195.8,8907.6-12196z
|
||||
M8905.4-12181.9h-15.3v-9.4h15.3V-12181.9z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
@ -9,15 +9,22 @@
|
||||
/* Fonts for toolbox icons */
|
||||
@font-face {
|
||||
font-family: 'legoIcons';
|
||||
src: data-uri("../docs/static/fonts/icons/iconfont.woff2");
|
||||
src: data-uri("../docs/static/fonts/icons/iconfont.woff");
|
||||
}
|
||||
|
||||
.blocklyFlyoutLabel:not(.blocklyFlyoutHeading) .blocklyFlyoutLabelIcon {
|
||||
font-family: 'legoIcons';
|
||||
fill: white;
|
||||
font-size: 1.7rem;
|
||||
}
|
||||
|
||||
.blocklyFlyoutLabel .blocklyFlyoutLabelIcon {
|
||||
font-family: 'legoIcons';
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon {
|
||||
font-family: 'legoIcons' !important;
|
||||
}
|
||||
|
||||
/* Toolbox padding */
|
||||
.blocklyToolboxDiv, .monacoToolboxDiv {
|
||||
padding: 0.5rem;
|
||||
@ -62,9 +69,83 @@ span.blocklyTreeLabel {
|
||||
border-radius: 1rem !important;
|
||||
}
|
||||
|
||||
|
||||
/* Square shaped corners */
|
||||
.blocklyDropDownDiv {
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
@media only screen and (max-width: @largestMobileScreen) {
|
||||
#blocklyTrashIcon {
|
||||
margin: 0.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconloops::before {
|
||||
content: "\f10b";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconlogic::before {
|
||||
content: "\f10a";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconvariables::before {
|
||||
content: "\f111";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconmath::before {
|
||||
content: "\f10c";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconfunctions {
|
||||
font-family: 'legoIcons' !important;
|
||||
}
|
||||
span.blocklyTreeIcon.blocklyTreeIconfunctions::before {
|
||||
content: "\f108";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconarrays::before {
|
||||
content: "\f109";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIcontext::before {
|
||||
content: "\f110";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconaddpackage::before {
|
||||
content: "\f105";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconadvancedcollapsed::before {
|
||||
content: "\f112";
|
||||
}
|
||||
|
||||
span.blocklyTreeIcon.blocklyTreeIconadvancedexpanded::before {
|
||||
content: "\f113";
|
||||
}
|
||||
|
||||
.save-editortools-btn .icon.save:before {
|
||||
font-family: 'legoIcons';
|
||||
content: "\f117";
|
||||
}
|
||||
|
||||
.download-button .icon.download.icon-and-text:before {
|
||||
font-family: 'legoIcons';
|
||||
content: "\f116";
|
||||
}
|
||||
|
||||
.button.approve.positive i.icon.checkmark:before {
|
||||
font-family: 'legoIcons';
|
||||
content: "\f115";
|
||||
}
|
||||
|
||||
.button.approve.cancel i.icon.cancel:before {
|
||||
font-family: 'legoIcons';
|
||||
content: "\f114";
|
||||
}
|
||||
|
||||
.blocks-menuitem i.icon.blocks:before {
|
||||
font-family: 'legoIcons' !important;
|
||||
content: "\f118" !important;
|
||||
}
|
||||
|
@ -76,6 +76,12 @@
|
||||
color:white !important;
|
||||
}
|
||||
|
||||
/* lowercase menu items */
|
||||
.menubar .ui.menu.fixed > .left.menu > .ui.item > .ui.text,
|
||||
.menubar .ui.menu.fixed > .ui.item > span {
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
@media only screen and (max-width: @largestMobileScreen) {
|
||||
#filelist {
|
||||
|