Compare commits
1287 Commits
Author | SHA1 | Date | |
---|---|---|---|
df9d3c4444 | |||
edc489c83d | |||
fb29af8011 | |||
516def7a3f | |||
b5cb8deb93 | |||
741facc769 | |||
41a5bc72a1 | |||
9d5e93b879 | |||
32e0cb0fe8 | |||
a224259e74 | |||
c144f3a15d | |||
a3fa07463f | |||
aa20f2fa4d | |||
4a1399de59 | |||
0b8e5c12c3 | |||
445066776b | |||
6cb204c548 | |||
6ed6a525fd | |||
ba6dc9f136 | |||
98bc8d2a27 | |||
58d0e238e3 | |||
f79b726f87 | |||
0f3c7b8c0f | |||
dac6f5af73 | |||
99fb074952 | |||
66ba26586f | |||
e27c4de108 | |||
f19a110953 | |||
626055d3eb | |||
9085c98c7f | |||
85e3148f23 | |||
60f8dd8228 | |||
c2e37a2c6e | |||
b4ad4819a5 | |||
d9f2c7cc42 | |||
15638d2767 | |||
5ecd20583b | |||
4c27d62796 | |||
90da72a8de | |||
8f50beb938 | |||
52527dd584 | |||
fc0faf5181 | |||
cd9589e562 | |||
a34bcee7a2 | |||
d011cdb37e | |||
af7c51b954 | |||
a65e71f3b1 | |||
89e899cc79 | |||
b37e823b57 | |||
8cb31daa48 | |||
a984778dfd | |||
008cbf543f | |||
61ee841431 | |||
e856d59235 | |||
32753d3395 | |||
7b11a04727 | |||
6d6c053e4f | |||
1008fdd371 | |||
ddc2b7437b | |||
b9c95ebb1e | |||
b16d02ec66 | |||
38fb36087a | |||
5dbbc2266f | |||
2a22001e02 | |||
214ff25995 | |||
f4768d99ff | |||
8792f9fe36 | |||
3d45bef910 | |||
3de6b33163 | |||
3f1c03ea51 | |||
a4063d636d | |||
92b5b76171 | |||
51d285b0b0 | |||
4d8afdd3ae | |||
13b21ad275 | |||
d90a43a6d8 | |||
6fd14e718d | |||
c79f043529 | |||
3a676c7151 | |||
0023710209 | |||
0756091e8c | |||
8144df0023 | |||
b2137e2622 | |||
39b30c8ae1 | |||
1c5d6316cc | |||
6d4d681898 | |||
7053fd1490 | |||
e7a49acac0 | |||
d76cfb6e2e | |||
538f08052d | |||
b6fed71c58 | |||
6c86f98b66 | |||
26797545c6 | |||
3ce8aa1f47 | |||
8b46698f50 | |||
47401e947c | |||
718cc9d530 | |||
b83d777144 | |||
cfb9acea34 | |||
53189830a1 | |||
67da22c135 | |||
7c7014a25f | |||
851f395ec9 | |||
a343cbd065 | |||
a2c042f715 | |||
a4a97f31cb | |||
5bd6a384ae | |||
943393dfa3 | |||
7089aa9c54 | |||
bd9e456bc5 | |||
ea82d066c9 | |||
bb8338a0f0 | |||
b24b65abcd | |||
2cc0523f9a | |||
a78f7f9601 | |||
b1cf3246ae | |||
24eb6f64db | |||
0c99eaf7bf | |||
8eb3376cf5 | |||
b863d5663d | |||
aeb4cb6a17 | |||
fd88e0b7f0 | |||
ea0d2d4d02 | |||
adff537013 | |||
19fc284884 | |||
5d9f85828d | |||
9f31637000 | |||
8e811b913e | |||
269254796d | |||
46995cbd54 | |||
380488528f | |||
aca863f436 | |||
a1ec25fd79 | |||
3e9d6d5895 | |||
719370f6b0 | |||
2780497d4f | |||
3eeaf2eddc | |||
eb3e91420c | |||
38cd913020 | |||
9159c297a5 | |||
851687dba8 | |||
28b8006ec5 | |||
271128c075 | |||
a04ca0d715 | |||
8b89fe721d | |||
1baf04b1fd | |||
6c7f0f911c | |||
f2008f9263 | |||
62127f7269 | |||
740cedd978 | |||
4278ff2b37 | |||
e7bea34d95 | |||
825409b697 | |||
8f72ac0094 | |||
8a6bb610e3 | |||
94dc141062 | |||
286dd1e50b | |||
6451d9add9 | |||
fd1dcde86b | |||
99947a9e21 | |||
a69239abed | |||
fd06fae050 | |||
7fbb056edf | |||
06758863fb | |||
ad8af16a5a | |||
70dd6bcac5 | |||
b103423a53 | |||
a82a44e587 | |||
e6f612283f | |||
fcd60876ab | |||
5daa9a0bb6 | |||
4fb3926073 | |||
73932f4619 | |||
c99138b02e | |||
64d584681a | |||
9788dd49cc | |||
9d15c4e270 | |||
fe7b06d763 | |||
0e0275e496 | |||
ffd4d96539 | |||
a6b4c9645a | |||
a9141d027f | |||
807e581c3d | |||
41a4dfeb68 | |||
4430391e87 | |||
81667f4df5 | |||
835048132c | |||
00217305c2 | |||
85e8a70f76 | |||
bbdf27de5a | |||
3e63d4083e | |||
d1b8e3c752 | |||
1164feb754 | |||
9ebd9d4f04 | |||
9fd2a3a3e6 | |||
7f40889103 | |||
ee37b4a959 | |||
99d05ec91b | |||
412e5bd034 | |||
141420d337 | |||
084f83ba1b | |||
8601eff170 | |||
5da4d74a2a | |||
4215574a7c | |||
da9d986a3e | |||
7481b9c24c | |||
de5def8dde | |||
dd011b977a | |||
20d0dd91ad | |||
825c6d57e7 | |||
b3edb81d3c | |||
78089da134 | |||
3aef765d35 | |||
f4727f12c9 | |||
a36cb65aa5 | |||
3b16e59ee1 | |||
f2c43c74ac | |||
1c4c93dc60 | |||
d73847bfba | |||
4e46682489 | |||
ab7aa00747 | |||
2bebb6056d | |||
22046c417c | |||
dc8afa6d45 | |||
22e2ab5ad9 | |||
f365726a8e | |||
e329b3bd2e | |||
d7b709e97b | |||
9714ec46e9 | |||
20ef54f565 | |||
554df0bce9 | |||
6c89dddef6 | |||
23f91895f7 | |||
3f83cda087 | |||
7e79635413 | |||
56e1cf91ac | |||
f9f96f33f0 | |||
0b33073be1 | |||
65594842fc | |||
c6ed665f84 | |||
79462deb24 | |||
5c05f3e241 | |||
4f7dd75fbe | |||
338e507b51 | |||
601231a5dc | |||
f0850336e5 | |||
a6b2187ec5 | |||
28ae4f4230 | |||
09933b6a8d | |||
45bb6e7cb3 | |||
33c234a87e | |||
e9aa343d67 | |||
d83039430c | |||
5b2e877aef | |||
c5b28f5b8e | |||
e765021bf9 | |||
dbcd9e535c | |||
cff88d67ad | |||
3f241e8bc9 | |||
69c3d2d249 | |||
bc04d30595 | |||
63a26835b1 | |||
79113115e0 | |||
573ed7f6f2 | |||
61da1032d6 | |||
36d455c693 | |||
42c766b6d7 | |||
6f00384891 | |||
8440f7c763 | |||
8a8e864f99 | |||
7a3402b782 | |||
5e9a5b29f4 | |||
aff9d1ee60 | |||
8add7e8efb | |||
e7dfd0531b | |||
d2b1f70ce2 | |||
fbf7513c44 | |||
e9bdc26d15 | |||
52fafe9359 | |||
971dca6c96 | |||
a761c27b19 | |||
a062a85c7f | |||
a9865a731a | |||
ba4095ac9c | |||
8606a00701 | |||
bf57ba2902 | |||
4cd61cd96a | |||
c4139a862f | |||
ca3cd1de22 | |||
d7f22bc8e6 | |||
28b28d0b52 | |||
0ee2b285c0 | |||
d5cb085264 | |||
c055a5d329 | |||
8fe8b78f4c | |||
f627f125c0 | |||
7d3254477a | |||
3149ed4c1d | |||
baeafcdebe | |||
12754acc54 | |||
329baaf9a4 | |||
47efcfb41f | |||
e2d1b8a55c | |||
579eb29ce3 | |||
ada9560642 | |||
7b352b3a58 | |||
a5d5836ea2 | |||
57dc26a127 | |||
3e37b03808 | |||
d035713786 | |||
6e4a71b2f4 | |||
0b4dd534ab | |||
ed07f0baad | |||
004d34b5df | |||
aa380baf1c | |||
5123a962d9 | |||
7dcd770508 | |||
ead4d32446 | |||
a51a14022a | |||
05098252ed | |||
8e74965964 | |||
63913c2182 | |||
c55716e148 | |||
dd94442555 | |||
56f6a2fa56 | |||
4ca9df141c | |||
a29e06abce | |||
43e4d06fd9 | |||
3c8027425a | |||
3f66870688 | |||
1f32a4851e | |||
478b1c84de | |||
20ac14fdf6 | |||
c805d67cf6 | |||
943c2e7716 | |||
298a37e576 | |||
327d52014c | |||
6a5cfae5ff | |||
64ebb5c8c3 | |||
bb97b57b01 | |||
534e3723d2 | |||
ad6ef04b1f | |||
2c09b7794f | |||
4941ce1694 | |||
aa6a965f59 | |||
1831c30050 | |||
df5989760c | |||
e942fb5733 | |||
6a7f65894c | |||
f56e9369dd | |||
e23c5e019f | |||
1aa08f63fe | |||
8ef94d2854 | |||
797474063d | |||
b76622542b | |||
6a1415b3e1 | |||
2d09aef287 | |||
3ce1fa9b6e | |||
155bbb25f7 | |||
5fb3da5a77 | |||
5b682cd8d9 | |||
4755f0953c | |||
bdcd299805 | |||
3e23fe4814 | |||
3782d26e64 | |||
84a29eec65 | |||
299efaf0f2 | |||
33c60b467b | |||
81f74f07b2 | |||
583b08df28 | |||
01f80b67bc | |||
a890d2a357 | |||
0d1b91afc3 | |||
5c0d37d718 | |||
c81e56613e | |||
4cc7215d35 | |||
8751d2aaa1 | |||
af91622dda | |||
45d4caf595 | |||
a8e1d2a86c | |||
5099b11823 | |||
37e0307698 | |||
1b15eefa5a | |||
a4eccaf4f9 | |||
5981863e3f | |||
9ac7a4c522 | |||
9f1c3ee13c | |||
8b9c3d71d5 | |||
6d726b7499 | |||
b5da5afd1d | |||
420898e98c | |||
f6b392356c | |||
f4896f8d7c | |||
4dbd691146 | |||
2742dba0c4 | |||
5bea47a094 | |||
835a4b5cf0 | |||
055704b3ef | |||
60107aa7ce | |||
787ab021a7 | |||
f56a70f502 | |||
4ec6749ee6 | |||
8413b61397 | |||
ecbb970983 | |||
36e6570296 | |||
92c63b615a | |||
f71267c988 | |||
38fc0f8099 | |||
8c7238eab3 | |||
2baca30184 | |||
ac56979142 | |||
ff72858c42 | |||
deac587164 | |||
7a0a2fbd0a | |||
79c32097b5 | |||
26c20d9fc3 | |||
fe826a508a | |||
62d2140d24 | |||
499d619faf | |||
c178e58260 | |||
d242501fe6 | |||
37a438735d | |||
b862cfc4ec | |||
31002ae1a8 | |||
e8a3a2f676 | |||
e6baf8c35e | |||
b72ff9fe4f | |||
58f79ea617 | |||
ed6d343992 | |||
92b46d5c7b | |||
9cf7f08ae2 | |||
3b05b8f2f6 | |||
774d614d79 | |||
545f715eeb | |||
45b480c6dd | |||
7cc93507d9 | |||
80d3f67e6c | |||
dfbea2719b | |||
ce5da6bf80 | |||
d8d2129685 | |||
5dd37a1494 | |||
6cfe39dac3 | |||
660b22b398 | |||
b9a24a4542 | |||
af5bf6e04e | |||
ecc71a3295 | |||
0834402b18 | |||
8edd8ac73a | |||
1207a91a7f | |||
727490668c | |||
f068b3d204 | |||
205a486e58 | |||
f3bfd41a75 | |||
8d5c5daaaf | |||
83cfe8f534 | |||
9378e5e90c | |||
8617f0f3b4 | |||
0ecf3dc2b4 | |||
76005841fa | |||
7bf00ff139 | |||
82e34d852c | |||
7cd8ee1e23 | |||
a91a87b628 | |||
9d71f46e78 | |||
ccf405e64c | |||
c0a75d1845 | |||
e65a521bd4 | |||
1f203269ff | |||
18feea45bb | |||
597f0c895b | |||
5f21789d90 | |||
64826db4aa | |||
b150ee873f | |||
34effcefc6 | |||
68be2384d9 | |||
2629192bdb | |||
67b5afd73a | |||
5d8193301c | |||
adf21fee6f | |||
20f3e1d24e | |||
bf8f38fe38 | |||
3e3b8ebec5 | |||
8faeeffecf | |||
343968cf09 | |||
ca92f787e8 | |||
49a67e73be | |||
11af897c3d | |||
08cd04b2c8 | |||
c1656cf441 | |||
8f3c585588 | |||
dd181e4178 | |||
ff3689e92d | |||
fffcf0f809 | |||
240162370e | |||
98238caffb | |||
f55977a51d | |||
91938f156a | |||
eb01245cce | |||
17cbea9989 | |||
22c03dfd7a | |||
cf3e8684d5 | |||
cd0b2a646f | |||
d7528c09e3 | |||
e055484492 | |||
947d69da48 | |||
07822c47a3 | |||
25d6746b7e | |||
7cb85ff459 | |||
73d18c8d39 | |||
74b6d99ab1 | |||
491ff29e40 | |||
d1db619c8d | |||
733996f83e | |||
4a624cb365 | |||
637ea17f8e | |||
f8d6bd280e | |||
b91de5bad2 | |||
d7c3433bb2 | |||
43456e9a53 | |||
081244218f | |||
6ae39f192b | |||
ed5263f248 | |||
f1ee861eb4 | |||
2ce2fd95ba | |||
741f94ce6c | |||
4b7e415ae7 | |||
3efbb4fbde | |||
4d9450dd06 | |||
910870e46f | |||
b664df4208 | |||
c660277a23 | |||
0416d88d59 | |||
4f822e3cda | |||
20d4e473ff | |||
e45190922e | |||
1df118fa19 | |||
8ba27ccc2d | |||
ff646d32b5 | |||
75d99b324c | |||
ece91d980a | |||
a6a9f25e86 | |||
cc5330bf3d | |||
4a9e1466e6 | |||
fa947036f0 | |||
0b0884a7eb | |||
d5b2a21d16 | |||
fe28dd9b92 | |||
cfcbe8fb41 | |||
d86f820a57 | |||
ace1ddb00b | |||
96be411ba2 | |||
f24f7c2279 | |||
0130a7753e | |||
54b72ba312 | |||
7bced60466 | |||
041b10ef04 | |||
0e08b58f84 | |||
dd14489f47 | |||
6d6c2b5e99 | |||
251f382e8e | |||
887a652a06 | |||
bbbb1ea6bc | |||
2c399f198a | |||
54213cf554 | |||
0c67cd8e8b | |||
a0a23a261c | |||
20c7a16524 | |||
0a722b2196 | |||
4a537b1ce8 | |||
cf0372aeaa | |||
918d2f1a3a | |||
c1a6c1c66a | |||
7a2c4f0056 | |||
23eefb28d2 | |||
2ab2535966 | |||
bb20c1780b | |||
764505d2ca | |||
62b6b8e9eb | |||
beac252620 | |||
6e62acb384 | |||
b5afe25387 | |||
ebea6b29f3 | |||
f4eca66648 | |||
a6e6dd8287 | |||
d94c7e0157 | |||
4657263abb | |||
a6c2b24e8d | |||
31651f9a11 | |||
43c7692a8f | |||
7f05de734c | |||
fe39eec686 | |||
655fa0fde8 | |||
2841df6950 | |||
713dfec949 | |||
23c4087830 | |||
de293be4fc | |||
4e54649ce7 | |||
caeef2f1e1 | |||
f3d7693a26 | |||
2ceece6cdf | |||
c2913aea82 | |||
bf90e01e7e | |||
bbee53607b | |||
e94e2e7dc4 | |||
02a0839a4e | |||
67ea6c01f2 | |||
5b5cac878b | |||
56301d2d6f | |||
f8e80e6a9d | |||
d1f314d790 | |||
27f39b4458 | |||
0c40f79dec | |||
346ec3d1a6 | |||
5a2896808e | |||
4a34edeab0 | |||
5c2833978b | |||
edfc2274a2 | |||
899c9fd8d6 | |||
13f63c2f46 | |||
8841c47638 | |||
c6f5a8dcc6 | |||
786c5f9733 | |||
0cdedd02b4 | |||
aba028b1e8 | |||
3049c88d5b | |||
8239329c2e | |||
c9d4807f25 | |||
5f4ff08c09 | |||
b99be68ea5 | |||
c639cc3f83 | |||
cd56181703 | |||
5b1a807443 | |||
e604b27c4f | |||
4727b105c4 | |||
4063b5aac8 | |||
ee8505b4f1 | |||
ab4e2c458a | |||
126c236b14 | |||
532abadb6b | |||
eea179e07c | |||
f94015803f | |||
f085253306 | |||
6de2f22542 | |||
3051e09bcf | |||
bd835a8a6e | |||
f75a034a3f | |||
71b3b6bb22 | |||
b868bd1e09 | |||
02e48f196c | |||
742eb7ea2f | |||
f1904143b6 | |||
e621252f3b | |||
3633d39f57 | |||
21bbf8fc86 | |||
dd5124f660 | |||
966ad1f503 | |||
d94f394d24 | |||
40ddd896cf | |||
5a8815c4fc | |||
9a04eb1790 | |||
906e2a2fff | |||
781339026e | |||
bd23de14e1 | |||
e6ca366d20 | |||
e2ce49d94b | |||
e3b6350785 | |||
66aba696dc | |||
5206f1f8e8 | |||
f9a7ec89e4 | |||
97894511dd | |||
e785ece9bd | |||
63035b3d5c | |||
1f8ea7ad30 | |||
899ca47a77 | |||
84f14182bf | |||
ca3702b4fe | |||
94f1b6c785 | |||
c749c8b644 | |||
b108f1538d | |||
45690215dd | |||
af42dbf30a | |||
45ecd883bb | |||
641a714f74 | |||
d1cd0a23a2 | |||
54331eb113 | |||
d4c53f1fb3 | |||
40305c3ccd | |||
e6761699d3 | |||
b15f140181 | |||
00e38e202b | |||
4cbabcd112 | |||
5def3518cf | |||
2c6f76e1a5 | |||
3eb529852b | |||
3b0cb40ea9 | |||
5cb3467194 | |||
d5628c08c8 | |||
c5c0103573 | |||
b89d6477c7 | |||
f3a6b00734 | |||
091fbb9db8 | |||
3de977c98f | |||
d262dc3704 | |||
b2e59eb676 | |||
f2d5237d5c | |||
0c701a6809 | |||
d571ce85c1 | |||
6fa316ff0e | |||
1e436f4e71 | |||
d54aa41fc9 | |||
0d90aec229 | |||
98ee6899a1 | |||
c3e9ec2dc4 | |||
4cba801d78 | |||
a3d559c7af | |||
985ed56984 | |||
be284c5e52 | |||
d59d7cb19f | |||
28d522175b | |||
7b74428275 | |||
c5571c20c7 | |||
fc97b59d0e | |||
8417d10ad3 | |||
1a6d47a1c9 | |||
d74702353f | |||
53922986b1 | |||
230de475d1 | |||
9b1d2085ba | |||
246d81ffd5 | |||
3b2729d9d8 | |||
571ae8337f | |||
cc2d18b969 | |||
fd02bd9407 | |||
6429b57081 | |||
5650f7dc35 | |||
a9cfe83bdf | |||
f9409b5fb5 | |||
7f9f14df18 | |||
a383060b4d | |||
04c8221b41 | |||
facea7d27d | |||
cfe65569ad | |||
7a0ad8e3ed | |||
4fb10faec2 | |||
f3463b5961 | |||
f39703e6f7 | |||
74b333dee4 | |||
466bda468f | |||
f4afa773ad | |||
21280f41bc | |||
41c7053f3f | |||
1a00fded98 | |||
304ef89a1d | |||
433b2bb08d | |||
273e23095b | |||
8af6d640d3 | |||
5553fb93bb | |||
493f76eba7 | |||
91b90bf70e | |||
43adfa198f | |||
59f7d0b537 | |||
f3bfe3d94e | |||
ed54ace797 | |||
0648e80131 | |||
ce9a83ff28 | |||
54439bba4d | |||
23a581c899 | |||
3f8fa4b05b | |||
53ab8651bd | |||
87300be648 | |||
d0a7df7f36 | |||
1c8fa5eab6 | |||
d8c2d697b1 | |||
2ede815535 | |||
a67f16a860 | |||
819ab9aa9a | |||
318ffde27f | |||
525e59ae4f | |||
ab087b4afa | |||
3b8ae69a6c | |||
8de6605112 | |||
daea493dcb | |||
b290692334 | |||
f25f295d0c | |||
5fd691ef92 | |||
67c8753315 | |||
9d405afde0 | |||
b05c8ebd56 | |||
b69156a12e | |||
961e2cb6e9 | |||
924d31a211 | |||
8721b54679 | |||
e99292d008 | |||
cc1ed10efb | |||
b48c11d380 | |||
3f1602f2c0 | |||
324fd45fb6 | |||
d1a3892eab | |||
28d28eb67f | |||
a67164d5e6 | |||
86b35ae88d | |||
919c8fdfca | |||
4abdb28a59 | |||
21361708ec | |||
4e56342e52 | |||
7273354944 | |||
9c96591edd | |||
4f38658d74 | |||
6329a79ce1 | |||
befbdd32cc | |||
44688ee5d5 | |||
cc36bae97d | |||
c65bdb34af | |||
21f7ef9b55 | |||
d7250d54f8 | |||
9a36a2fc05 | |||
539357237f | |||
35d59da17e | |||
0b226bc9aa | |||
f2bab5d122 | |||
6e6a98559c | |||
217fce953d | |||
bfac2910da | |||
5962c28b0e | |||
d3509a6254 | |||
df91bf234c | |||
2a46935f62 | |||
5e024c6f23 | |||
28b3d823b2 | |||
b7c9bc7978 | |||
52b2ee3f4c | |||
263cc25633 | |||
2e3d875b7d | |||
7704ad9f8d | |||
845d7a004c | |||
1cf070d649 | |||
24420a2cc4 | |||
2f8b61998b | |||
af38071c6a | |||
89f09c7f35 | |||
a667467bbd | |||
ada2583e17 | |||
c04538313d | |||
1039dc560e | |||
957c7ad848 | |||
5e7351a481 | |||
f0c089373b | |||
879a85bdbb | |||
7a9c2e0fe4 | |||
9656c1159a | |||
801117d6b0 | |||
c084bff334 | |||
18bf35f179 | |||
7e7dc91947 | |||
da79f643dc | |||
ea10cde3eb | |||
0a60b0ee37 | |||
b4bc985068 | |||
d4a55bd53d | |||
2b8d8f7b44 | |||
8b2037f51d | |||
1477fc4bed | |||
e4badc18b8 | |||
625d4de530 | |||
a3cf104185 | |||
608f2d8f82 | |||
8f9ac35d70 | |||
ce18ddbb70 | |||
ac64cbb8c5 | |||
706c51c99c | |||
7fa88249d6 | |||
5c735e839e | |||
19752b01b6 | |||
4192eeb413 | |||
87c63959cf | |||
79ee825926 | |||
20dbcfd203 | |||
993952cbe9 | |||
90a8bdcea1 | |||
b9cff5a5e9 | |||
638594bb5e | |||
d3b5809fe7 | |||
365f5dcecf | |||
4c9982051e | |||
655c9c4431 | |||
e328c22a2d | |||
dc9eb26038 | |||
3971bb5fc1 | |||
acfdfd3668 | |||
35edde573e | |||
6d21e28360 | |||
f636a7e37f | |||
78f9af5bc2 | |||
c15c3255ef | |||
7f64328079 | |||
e9410d17a6 | |||
ca8ef260d5 | |||
b19d7a5b7b | |||
5ea5e9bb5b | |||
8322310640 | |||
8f6577f029 | |||
a64b3e2b09 | |||
95ed3f419b | |||
8fcc59c9c3 | |||
a83a7f7135 | |||
2f1a7e3896 | |||
19c689a8c4 | |||
72226cd4e5 | |||
0d3af60892 | |||
f88cda8244 | |||
f71925fdd2 | |||
bfeda371a9 | |||
eb09530391 | |||
346d1e77da | |||
bf384355c4 | |||
3801e52370 | |||
99574f1ec8 | |||
12705eed06 | |||
a62f2b00b4 | |||
b32c14937c | |||
a5e1f84975 | |||
6d0beb1aa3 | |||
7d0101af25 | |||
26d92f993b | |||
d4c0dddb62 | |||
fa17ce43f7 | |||
b9a9abb478 | |||
ae925da409 | |||
b82c3c0277 | |||
b4ce65cdf3 | |||
db7e8b6fd4 | |||
7532cc01a2 | |||
60c3f1f427 | |||
8552a2de52 | |||
6725f8ef90 | |||
dea8054fbe | |||
f9cc3d2ee1 | |||
220ada6cd8 | |||
b68b12e6f1 | |||
5838c4d740 | |||
b0d4fdb009 | |||
68d25e3814 | |||
d3294ee99e | |||
00d23f8437 | |||
06be2019a6 | |||
6a742f5348 | |||
1c6c749dad | |||
2803c00814 | |||
73cf802300 | |||
2b71e2b834 | |||
0442c33808 | |||
2975e6acc9 | |||
f150d93070 | |||
df38904ba1 | |||
7f284b2a57 | |||
0e5c30ec7c | |||
d744e21975 | |||
2cc6f864a8 | |||
d428a2cd1f | |||
47f9362e5f | |||
38b197bc03 | |||
9a404854e7 | |||
d17a8de72d | |||
9d1f2e024b | |||
81c86f544c | |||
fa145ecd5c | |||
cdfc99ad3f | |||
f77e7b8850 | |||
e7d8559fe3 | |||
fcfdbcc7e4 | |||
5884231399 | |||
e8887f5904 | |||
d71186b083 | |||
852067c641 | |||
7445db5707 | |||
e4fd00c827 | |||
5ccecc1195 | |||
cdfcd30c3c | |||
25b4f46440 | |||
9f9cd6b766 | |||
4dafa4d42c | |||
fdff0a7f19 | |||
a63daed690 | |||
3eeaf2ca46 | |||
005e002fd8 | |||
b1db17fc27 | |||
a51791414c | |||
265dd660ef | |||
7517776492 | |||
29b901b856 | |||
20637aeb29 | |||
90dbc6dd08 | |||
8f99ee3608 | |||
07e8610e5d | |||
37fb907f04 | |||
13f42f5892 | |||
5fcf9165ea | |||
b33d0ba470 | |||
b9f66c5c6b | |||
9848409283 | |||
ce16e64660 | |||
4d056e0c23 | |||
70b2827cf0 | |||
15bbc13595 | |||
cac5df56eb | |||
62e4b04931 | |||
17e33cc34f | |||
d4ad150cba | |||
52bfd4e535 | |||
f854dfd9c8 | |||
d905f24f9c | |||
81b8b1b69c | |||
0c7f9058a7 | |||
efce4c3698 | |||
b5e4a36e9c | |||
04a60a5b47 | |||
29b28e7f0d | |||
979381eaef | |||
e4370f4e3c | |||
ba707f080d | |||
3816e01f87 | |||
548d215b48 | |||
43da58f214 | |||
f90d052538 | |||
13ff7cd0ec | |||
a3b34518b0 | |||
5a33dc8a81 | |||
7349e28898 | |||
26b9fdf40e | |||
3cf82b9be2 | |||
546c44bafa | |||
d727d3fcde | |||
6b0cf961c6 | |||
18419d763d | |||
99fdb53fa0 | |||
879fdd687e | |||
6c1b879c34 | |||
019bbc79fc | |||
f857a88541 | |||
6531e7bfbb | |||
2147225afd | |||
841ea6d060 | |||
3dddb2eb30 | |||
651cf14556 | |||
7f6fb5559b | |||
ea724038dc | |||
19757d4245 | |||
07a7b4048a | |||
45742aa2ac | |||
db0c5d9f9f | |||
8285250a1b | |||
de0257c7e9 | |||
3580012065 | |||
cdb23fffb6 | |||
6937c51549 | |||
69e90523e2 | |||
f76235736a | |||
8431243b63 | |||
458b4553d2 | |||
0f6e8854d8 | |||
5565bb7d24 | |||
6c539fb04f | |||
b30a0ced87 | |||
ac942e198a | |||
cef1f57e30 | |||
980ad6ce91 | |||
53bfea5752 | |||
4917bb7e39 | |||
139823203e | |||
883f4d1a20 | |||
0bce69edd0 | |||
efccc921cb | |||
55859b1237 | |||
ec09d40366 | |||
512e40fae3 | |||
028dac25f6 | |||
e0d4763974 | |||
3b3e402ffa | |||
e37ac1a1d7 | |||
17eb36a8dc | |||
10d44b97cc | |||
505c750dd0 | |||
d0e900606a | |||
dcbb076266 | |||
22c852f2d9 | |||
76770bc0e1 | |||
572080bc6d | |||
0b8142ae73 | |||
09a06d9fa9 | |||
80e8c6684d | |||
4cccb36f3d | |||
a427a1e720 | |||
be77c5296b | |||
a0c1b2c580 | |||
fc905c5f8f | |||
f1bd84733b | |||
d3080d2e66 | |||
090e530ff0 | |||
094e9d25cd | |||
0bcb9c16fa | |||
269bdb82a6 | |||
cba7e02bcd | |||
8ef834b73b | |||
ec54622f52 | |||
5d90b70425 | |||
8cef13e517 | |||
82986c091b | |||
67f2fdcfec | |||
d11c5a9028 | |||
b7cb7e477e | |||
0d1059aedf | |||
b92fc783fa | |||
6d73e5e129 | |||
6150850729 | |||
76a18fa61b | |||
2bd66ae4ef | |||
f6eefde27c | |||
60c9e4a82f | |||
56713227c5 | |||
fd6e110790 | |||
2336521df1 | |||
2ce72aeb28 | |||
e746c13212 | |||
9e073aee36 | |||
3906f06a2f | |||
d89747fa46 | |||
c4e6618baa | |||
5232be58ce | |||
5a75483811 | |||
4b40585690 | |||
dd65efaab6 | |||
890c2566af | |||
cd71fc5d13 | |||
f626dd4bbb | |||
956992e9ab | |||
91ddcef6ce | |||
49fa42473f | |||
564de8863a | |||
1dd70100d6 | |||
a38ff18eaf | |||
d46ef1efca | |||
c54cd21efa | |||
94f18340ec | |||
13bdcf762d | |||
6455da6adb | |||
4e88ba4ef2 | |||
0c7d49256d | |||
c2883d00ee | |||
7da483f258 | |||
6cbc6a53b2 | |||
5e23bc96ca | |||
4169663a8b | |||
4795c58e97 | |||
8fb96934ca | |||
cd91504c1f | |||
91e8196621 | |||
26841de6cf | |||
24f2a45310 | |||
67c5f0612a | |||
d7c3f1b50a | |||
2fb6025848 | |||
8da3c5eb84 | |||
4ee1799271 | |||
953ea31016 | |||
9fe27d5f35 | |||
d290aeb2e9 | |||
7fee84678a | |||
77030db1d3 | |||
bb6ae00a49 | |||
6515cc0360 | |||
13d09b3e83 | |||
3a434197a3 | |||
8ab0dc450a | |||
4afc887ee5 | |||
db4692843f | |||
ad98c1aaa6 | |||
6ff9652450 | |||
6182a80f41 | |||
06e59c8d02 | |||
b9f17c3143 | |||
10e3fdf007 | |||
9a50050f7c | |||
63ac41c4b4 | |||
602ebacb0b | |||
4e55c0439e | |||
965deb5711 | |||
c24aba739b | |||
c55263889b | |||
fc7325b0f6 | |||
e46e02ad5e | |||
7d12ee0cb4 | |||
6b339fdc15 | |||
8bb3f74f09 | |||
aaf1513793 | |||
3d813a8716 | |||
53724c4b63 | |||
eb7582bb56 | |||
162902fabc | |||
12dbdf8530 | |||
ac90b16825 | |||
f7531ea9b0 | |||
8c00942c39 | |||
18e637aa28 | |||
d28efb3b84 | |||
2e49901a7e | |||
981f67b581 | |||
1f7a32da6b | |||
e545ae948a | |||
dc6386da52 | |||
c908794d23 | |||
8e27d596aa | |||
9b46145391 | |||
3182f7c546 | |||
8aed8548cc | |||
5e10bd7cc9 | |||
fddb9ff0d8 | |||
a0a0554633 | |||
df92a3daae | |||
26985f2813 | |||
e7fd68e7ee | |||
e63b764568 | |||
ef821e4b8b | |||
b7a547c2b4 | |||
43d600ab38 | |||
b38145e46a | |||
b29f8faa14 | |||
e58dd64780 | |||
b1028abb04 | |||
9f0f63a79e | |||
1c403e4ddb | |||
9143b34d9d | |||
f5a41d7c37 | |||
57c8698b58 | |||
4e3ed27f93 | |||
41977f087e | |||
c1a4a55e2b | |||
abc9e90cb9 | |||
3119bcc625 | |||
905da373c0 | |||
05dce8efce | |||
cbfc960594 | |||
c2c765098d | |||
9daf6ad9fc | |||
0c05ae9b64 | |||
27ea7cae56 | |||
80f9c52bac | |||
afef607ccf | |||
45fe7e6bb4 | |||
8e66b041e2 | |||
e99a2df578 | |||
7e5f3fdbf3 | |||
b538526948 | |||
889142d0f7 | |||
3791689fc4 | |||
d05f66650f | |||
a4f08e99a9 | |||
3999c215ce | |||
c6b8acb0b8 | |||
1e054f96ec | |||
190e5e2e03 | |||
63ae951249 | |||
e5aeacae2f | |||
9ecb7f11cd | |||
d1660f1361 | |||
edf5345492 | |||
5eadb3483f | |||
c4d3fd5d67 | |||
5166c5141f | |||
c21b45a084 | |||
fa0d365aae | |||
43cab7a156 | |||
79b000b1bb | |||
0af25f4230 | |||
0fcca0792a | |||
cb1260419b | |||
17150e0d71 | |||
693d019525 | |||
fa6b48e421 | |||
8286561125 | |||
78083e18a7 | |||
cba7ccbacb | |||
391e0ed897 | |||
fce6206d28 | |||
faf1385933 | |||
7a74def276 | |||
81b93c13ad | |||
2852684f89 |
1
.gitattributes
vendored
@ -12,6 +12,7 @@
|
||||
*.html text eol=lf
|
||||
*.py text eol=lf
|
||||
*.exp text eol=lf
|
||||
*.manifest text eol=lf
|
||||
|
||||
# do not enforce text for everything - it causes issues with random binary files
|
||||
|
||||
|
26
.gitignore
vendored
@ -1,10 +1,26 @@
|
||||
node_modules
|
||||
*.sw?
|
||||
yotta_modules
|
||||
yotta_targets
|
||||
pxt_modules
|
||||
built
|
||||
typings/
|
||||
tmp/
|
||||
typings
|
||||
tmp
|
||||
temp
|
||||
projects/**
|
||||
clients/win10/app/AppPackages
|
||||
clients/win10/app/BundlePackages
|
||||
clients/win10/app/BundleArtifacts
|
||||
clients/win10/app/bin
|
||||
clients/win10/app/bld
|
||||
clients/win10/*.opendb
|
||||
clients/**/bin/**
|
||||
clients/**/obj/**
|
||||
clients/electron/projects
|
||||
|
||||
*.user
|
||||
*.sw?
|
||||
*.ts.new
|
||||
*.tgz
|
||||
temp/
|
||||
*.db
|
||||
projects/
|
||||
*.suo
|
||||
*.log
|
||||
|
@ -4,7 +4,12 @@ node_js:
|
||||
script:
|
||||
- "node node_modules/pxt-core/built/pxt.js travis"
|
||||
- "(cd libs/lang-test0; node ../../node_modules/pxt-core/built/pxt.js run)"
|
||||
- "(cd libs/lang-test1; node ../../node_modules/pxt-core/built/pxt.js run)"
|
||||
- "(cd libs/lang-test0; node ../../node_modules/pxt-core/built/pxt.js test)"
|
||||
- "(cd libs/lang-test1; node ../../node_modules/pxt-core/built/pxt.js test)"
|
||||
- "node node_modules/pxt-core/built/pxt.js testdir tests"
|
||||
- "node node_modules/pxt-core/built/pxt.js uploaddoc"
|
||||
- "(cd libs/hello; node ../../node_modules/pxt-core/built/pxt.js testconv https://az851932.vo.msecnd.net/files/td-converter-tests-v0.json)"
|
||||
sudo: false
|
||||
notifications:
|
||||
email:
|
||||
@ -12,4 +17,6 @@ notifications:
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- built/cache
|
||||
- libs/hello/built/cache
|
||||
|
||||
|
20
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"file.autoSave": "afterDelay",
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/built/**": true,
|
||||
"**/node_modules/**": true,
|
||||
"**/yotta_modules/**": true,
|
||||
"**/yotta_targets": true,
|
||||
"**/pxt_modules/**": true
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/yotta_modules/**": true,
|
||||
"**/yotta_targets": true,
|
||||
"**/pxt_modules/**": true
|
||||
},
|
||||
"tslint.enable": true,
|
||||
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib"
|
||||
}
|
95
README.md
@ -1,48 +1,85 @@
|
||||
# micro:bit target for KindScript
|
||||
# micro:bit target for PXT
|
||||
|
||||
This target allow to program a [BBC micro:bit](https://www.microbit.co.uk/) using [KindScript](https://github.com/Microsoft/kindscript).
|
||||
This target allow to program a [BBC micro:bit](https://www.microbit.co.uk/) using
|
||||
PXT ([Microsoft Programming Experience Toolkit](https://github.com/Microsoft/pxt)).
|
||||
|
||||
[](https://travis-ci.org/Microsoft/kindscript-microbit)
|
||||
* [Try it live](https://codethemicrobit.com)
|
||||
|
||||
# Getting started
|
||||
[](https://travis-ci.org/Microsoft/pxt-microbit)
|
||||
|
||||
> If you're making changes to kindscript repository itself, proceed to **Local installation** below.
|
||||
## Local server
|
||||
|
||||
* Clone this repo and run
|
||||
The local server allows to run the editor and the documentation from your computer.
|
||||
|
||||
### Setup
|
||||
|
||||
The following commands are a 1-time setup after synching the repo on your machine.
|
||||
|
||||
* if not yet installed, install [Node.js 4.4.5 or higher](https://nodejs.org/en/download/)
|
||||
* [clone this repo](https://help.github.com/articles/cloning-a-repository/) to your computer and go in the project folder
|
||||
```
|
||||
git clone https://github.com/microsoft/pxt-microbit
|
||||
cd pxt-microbit
|
||||
```
|
||||
* install the PXT command line (add ``sudo`` for Mac/Linux shells).
|
||||
```
|
||||
npm install -g pxt
|
||||
```
|
||||
* install the dependencies
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
* Install the `KindScript` tool and launch the local server:
|
||||
### Running
|
||||
|
||||
Run this command to open a local web server (add ``sudo`` for Mac/Linux shells)
|
||||
```
|
||||
npm install -g kindscript-cli
|
||||
kind serve
|
||||
pxt serve
|
||||
```
|
||||
To re-build the `built/target.json` file, re-run `kind serve`.
|
||||
If the local server opens in the wrong browser, make sure to copy the URL containing the local token.
|
||||
Otherwise, the editor will not be able to load the projects.
|
||||
|
||||
If you need modify the `.cpp` files, turn on yotta compilation with the ``-yt`` flag (add ``sudo`` for Mac/Linux shells):
|
||||
```
|
||||
pxt serve -yt
|
||||
```
|
||||
|
||||
## Local installation
|
||||
## Updates
|
||||
|
||||
* Clone and build [KindScript](https://github.com/Microsoft/kindscript) in a `kindscript` folder.
|
||||
* Clone this repo in a `kindscript-microbit` folder next to `kindscript`
|
||||
To update your PXT version and make sure you're running the latest tools, run (add ``sudo`` for Mac/Linux shells)
|
||||
```
|
||||
pxt update
|
||||
```
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
* To build and deploy new changes
|
||||
More instructions at https://github.com/Microsoft/pxt#running-a-target-from-localhost
|
||||
|
||||
```
|
||||
npm install -g kindscript-cli
|
||||
cd ../kindscript
|
||||
jake
|
||||
cd ../kindscript-microbit
|
||||
npm link ../kindscript
|
||||
```
|
||||
* run this command to build and launch a local editor
|
||||
## Universal Windows App
|
||||
|
||||
```
|
||||
kind serve
|
||||
```
|
||||
* open `localhost:3232` to try your editor!
|
||||
The Windows 10 app is a [Universal Windows Hosted Web App](https://microsoftedge.github.io/WebAppsDocs/en-US/win10/CreateHWA.htm)
|
||||
that wraps ``codethemicrobit.com`` and provides additional features.
|
||||
|
||||
### Building
|
||||
|
||||
* Install Visual Studio 2015 Update 2 or higher. Make sure the Windows 10 templates are installed.
|
||||
* open the ``win10/app.sln`` solution and launch the ``codethemicrobit`` project.
|
||||
|
||||
## Testing
|
||||
|
||||
The build automatically runs the following:
|
||||
|
||||
* make sure the built-in packages compile
|
||||
* `pxt run` in `libs/lang-test*` - this will run the test in command line runner;
|
||||
there is a number of asserts in both of these
|
||||
* `pxt testdir` in `tests` - this makes sure all the files compile and generates .hex files
|
||||
* run the TD->TS converter on a number of test scripts from `microbit.co.uk` and make sure the results compile
|
||||
|
||||
To test something on the device:
|
||||
|
||||
* do a `pxt deploy` in `libs/lang-test*` - they should show `1` or `2` on the screen (and not unhappy face)
|
||||
* run `pxt testdir` in `tests` and deploy some of the hex files from `tests/built`
|
||||
|
||||
The `lang-test0` source comes from the `pxt-core` package. It's also tested with `pxt run` there.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
26
clients/chrome/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# microbit-chrome
|
||||
Prototype chrome addon that exposes the micro:bit's serial output to webpages.
|
||||
* watch the [demo video](https://vimeo.com/146207766)
|
||||
|
||||
# Installation
|
||||
See [developer.chrome.com](https://developer.chrome.com/extensions/getstarted#unpacked)
|
||||
for instructions on how to install the local version into your chrome browser.
|
||||
|
||||
# Requirements
|
||||
* Chrome 48 or later.
|
||||
|
||||
# Sample page
|
||||
The `demo.html` webpage goes along with the
|
||||
https://github.com/Microsoft/microbit-touchdevelop/blob/master/examples/tcs34725.cpp
|
||||
program. Run `http-server` from this directory, then visit
|
||||
http://localhost:8080/demo.html
|
||||
(keep in mind that pages served from `file://` cannot open ports).
|
||||
|
||||
# Building
|
||||
|
||||
Open a command prompt and run the following commands.
|
||||
|
||||
````
|
||||
npm install
|
||||
typings update
|
||||
````
|
68
clients/chrome/background.js
Normal file
@ -0,0 +1,68 @@
|
||||
///<reference path='typings/browser.d.ts'/>
|
||||
var connections = [];
|
||||
// A list of "ports", i.e. connected clients (such as web pages). Multiple web
|
||||
// pages can connect to our service: they all receive the same data.
|
||||
var ports = [];
|
||||
function byPath(path) {
|
||||
return connections.filter(function (x) { return x.path == path; });
|
||||
}
|
||||
function byId(id) {
|
||||
return connections.filter(function (x) { return x.id == id; });
|
||||
}
|
||||
function onReceive(data, id) {
|
||||
if (ports.length == 0)
|
||||
return;
|
||||
var view = new DataView(data);
|
||||
var decoder = new TextDecoder("utf-8");
|
||||
var decodedString = decoder.decode(view);
|
||||
ports.forEach(function (port) { return port.postMessage({
|
||||
type: "serial",
|
||||
data: decodedString,
|
||||
id: id
|
||||
}); });
|
||||
}
|
||||
function findNewDevices() {
|
||||
chrome.serial.getDevices(function (serialPorts) {
|
||||
serialPorts.forEach(function (serialPort) {
|
||||
if (byPath(serialPort.path).length == 0 &&
|
||||
serialPort.displayName == "mbed Serial Port") {
|
||||
chrome.serial.connect(serialPort.path, { bitrate: 115200 }, function (info) {
|
||||
// In case the [connect] operation takes more than five seconds...
|
||||
if (info && byPath(serialPort.path).length == 0)
|
||||
connections.push({
|
||||
id: info.connectionId,
|
||||
path: serialPort.path
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function main() {
|
||||
// Register new clients in the [ports] global variable.
|
||||
chrome.runtime.onConnectExternal.addListener(function (port) {
|
||||
if (/^(micro:bit|touchdevelop|yelm|pxt|codemicrobit|codethemicrobit)$/.test(port.name)) {
|
||||
ports.push(port);
|
||||
port.onDisconnect.addListener(function () {
|
||||
ports = ports.filter(function (x) { return x != port; });
|
||||
});
|
||||
}
|
||||
});
|
||||
// When receiving data for one of the connections that we're tracking, forward
|
||||
// it to all connected clients.
|
||||
chrome.serial.onReceive.addListener(function (info) {
|
||||
if (byId(info.connectionId).length > 0)
|
||||
onReceive(info.data, info.connectionId);
|
||||
});
|
||||
// When it looks like we've been disconnected, drop the corresponding
|
||||
// connection object from the [connections] global variable.
|
||||
chrome.serial.onReceiveError.addListener(function (info) {
|
||||
if (info.error == "system_error" || info.error == "disconnected" || info.error == "device_lost")
|
||||
connections = connections.filter(function (x) { return x.id != info.connectionId; });
|
||||
});
|
||||
// Probe serial connections at regular intervals. In case we find an mbed port
|
||||
// we haven't yet connected to, connect to it.
|
||||
setInterval(findNewDevices, 5000);
|
||||
findNewDevices();
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", main);
|
92
clients/chrome/background.ts
Normal file
@ -0,0 +1,92 @@
|
||||
// A list of: {
|
||||
// id: number;
|
||||
// path: string;
|
||||
// } where [id] is the [connectionId] (internal to Chrome) and [path] is the
|
||||
// OS' name for the device (e.g. "COM4").
|
||||
interface Connection {
|
||||
id: string;
|
||||
path: string;
|
||||
}
|
||||
let connections: Connection[] = [];
|
||||
|
||||
// A list of "ports", i.e. connected clients (such as web pages). Multiple web
|
||||
// pages can connect to our service: they all receive the same data.
|
||||
let ports = [];
|
||||
|
||||
interface Message {
|
||||
type: string;
|
||||
data: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
function byPath(path: string): Connection[] {
|
||||
return connections.filter((x) => x.path == path);
|
||||
}
|
||||
|
||||
function byId(id: string): Connection[] {
|
||||
return connections.filter((x) => x.id == id);
|
||||
}
|
||||
|
||||
function onReceive(data, id: string) {
|
||||
if (ports.length == 0) return;
|
||||
|
||||
let view = new DataView(data);
|
||||
let decoder = new TextDecoder("utf-8");
|
||||
let decodedString = decoder.decode(view);
|
||||
ports.forEach(port => port.postMessage(<Message>{
|
||||
type: "serial",
|
||||
data: decodedString,
|
||||
id: id,
|
||||
}));
|
||||
}
|
||||
|
||||
function findNewDevices() {
|
||||
chrome.serial.getDevices(function (serialPorts) {
|
||||
serialPorts.forEach(function (serialPort) {
|
||||
if (byPath(serialPort.path).length == 0 &&
|
||||
serialPort.displayName == "mbed Serial Port") {
|
||||
chrome.serial.connect(serialPort.path, { bitrate: 115200 }, function (info) {
|
||||
// In case the [connect] operation takes more than five seconds...
|
||||
if (info && byPath(serialPort.path).length == 0)
|
||||
connections.push({
|
||||
id: info.connectionId,
|
||||
path: serialPort.path
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function main() {
|
||||
// Register new clients in the [ports] global variable.
|
||||
chrome.runtime.onConnectExternal.addListener(function (port) {
|
||||
if (/^(micro:bit|touchdevelop|yelm|pxt|codemicrobit|codethemicrobit)$/.test(port.name)) {
|
||||
ports.push(port);
|
||||
port.onDisconnect.addListener(function () {
|
||||
ports = ports.filter(function (x) { return x != port });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// When receiving data for one of the connections that we're tracking, forward
|
||||
// it to all connected clients.
|
||||
chrome.serial.onReceive.addListener(function (info) {
|
||||
if (byId(info.connectionId).length > 0)
|
||||
onReceive(info.data, info.connectionId);
|
||||
});
|
||||
|
||||
// When it looks like we've been disconnected, drop the corresponding
|
||||
// connection object from the [connections] global variable.
|
||||
chrome.serial.onReceiveError.addListener(function (info) {
|
||||
if (info.error == "system_error" || info.error == "disconnected" || info.error == "device_lost")
|
||||
connections = connections.filter((x) => x.id != info.connectionId);
|
||||
});
|
||||
|
||||
// Probe serial connections at regular intervals. In case we find an mbed port
|
||||
// we haven't yet connected to, connect to it.
|
||||
setInterval(findNewDevices, 5000);
|
||||
findNewDevices();
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", main);
|
BIN
clients/chrome/logo128.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
clients/chrome/logo48.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
30
clients/chrome/manifest.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"app": {
|
||||
"background": {
|
||||
"scripts": [ "background.js" ]
|
||||
}
|
||||
},
|
||||
|
||||
"manifest_version": 2,
|
||||
"name": "code the micro:bit",
|
||||
"version": "0.6.0",
|
||||
"author": "Microsoft Corporation",
|
||||
"short_name": "code the micro:bit",
|
||||
|
||||
"description": "Extension for https://codethemicrobit.com.",
|
||||
"homepage_url": "https://codethemicrobit.com",
|
||||
"offline_enabled": "true",
|
||||
"icons": {
|
||||
"48": "logo48.png",
|
||||
"128": "logo128.png"
|
||||
},
|
||||
|
||||
"permissions": [
|
||||
"serial",
|
||||
"usb"
|
||||
],
|
||||
|
||||
"externally_connectable": {
|
||||
"matches": [ "*://localhost/*", "https://codethemicrobit.com/*", "https://*.codethemicrobit.com/*" ]
|
||||
}
|
||||
}
|
BIN
clients/chrome/screenshot.png
Normal file
After Width: | Height: | Size: 138 KiB |
7
clients/chrome/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"compiler-options": {
|
||||
"target": "ES5",
|
||||
"module": "amd",
|
||||
"sourceMap": false
|
||||
}
|
||||
}
|
67
clients/electron/main.js
Normal file
@ -0,0 +1,67 @@
|
||||
const electron = require('electron')
|
||||
// Module to control application life.
|
||||
const app = electron.app
|
||||
// Module to create native browser window.
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
// pxt toolchain
|
||||
const pxt = require('pxt-core')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow() {
|
||||
console.log('starting app...')
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800, height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
}
|
||||
})
|
||||
|
||||
ts.pxt.Util.debug = true;
|
||||
pxt.mainCli("C:/gh/pxt-microbit/clients/electron/node_modules/pxt-microbit", ["serve", "-just"]);
|
||||
|
||||
// no menu
|
||||
mainWindow.setMenu(null);
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadURL(`http://localhost:3232/#local_token=08ba9b8f-6ccb-4202-296d-28fac7a553d9`)
|
||||
|
||||
// Open the DevTools.
|
||||
mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.on('ready', createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
19
clients/electron/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "codethemicrobit",
|
||||
"version": "0.1.0",
|
||||
"description": "A Blocks / JavaScript editor for the micro:bit",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
},
|
||||
"author": "Microsoft",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"electron-prebuilt": "^1.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"typescript": "1.8.7",
|
||||
"pxt-core": "*",
|
||||
"pxt-microbit": "*"
|
||||
}
|
||||
}
|
48
clients/win10/app.sln
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "m.pxt.io", "app\m.pxt.io.jsproj", "{39122940-AB16-4CD4-A0CE-79A3EB863ECF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Build.0 = Debug|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Build.0 = Debug|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Build.0 = Release|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.ActiveCfg = Release|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Build.0 = Release|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Deploy.0 = Release|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.ActiveCfg = Release|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Build.0 = Release|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Deploy.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
clients/win10/app/AppPackages/latest/Add-AppDevPackage.ps1
Normal file
1
clients/win10/app/BundleArtifacts/neutral.txt
Normal file
@ -0,0 +1 @@
|
||||
MainPackage=C:\gh\pxt-microbit\win10\app\bin\Debug\m.pxt.io_0.1.4.0_AnyCPU_Debug.appx
|
85
clients/win10/app/codethemicrobitapp.jsproj
Normal file
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|AnyCPU">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x86">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x86</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|AnyCPU">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>AnyCPU</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x86">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x86</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>39122940-ab16-4cd4-a0ce-79a3eb863ecf</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0'">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
|
||||
<PropertyGroup>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>$(VersionNumberMajor).$(VersionNumberMinor)</MinimumVisualStudioVersion>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<PackageCertificateKeyFile>pxtwinapp_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
|
||||
<AppxBundle>Always</AppxBundle>
|
||||
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<Content Include="msapp-error.js" />
|
||||
<Content Include="msapp-error.css" />
|
||||
<Content Include="msapp-error.html" />
|
||||
<Content Include="images\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="images\SplashScreen.scale-200.png" />
|
||||
<Content Include="images\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="images\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="images\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="images\StoreLogo.png" />
|
||||
<Content Include="images\Wide310x150Logo.scale-200.png" />
|
||||
<None Include="pxtwinapp_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below then uncomment
|
||||
that target and the DisableFastUpToDateCheck PropertyGroup.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
||||
</PropertyGroup>
|
||||
-->
|
||||
</Project>
|
48
clients/win10/app/codethemicrobitapp.sln
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "codethemicrobitapp", "codethemicrobitapp.jsproj", "{39122940-AB16-4CD4-A0CE-79A3EB863ECF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Build.0 = Debug|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Build.0 = Debug|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Build.0 = Release|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.ActiveCfg = Release|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Build.0 = Release|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Deploy.0 = Release|x64
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.ActiveCfg = Release|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Build.0 = Release|x86
|
||||
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Deploy.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
clients/win10/app/images/LockScreenLogo.scale-200.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
clients/win10/app/images/SplashScreen.scale-200.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
clients/win10/app/images/Square150x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
clients/win10/app/images/Square44x44Logo.scale-200.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.5 KiB |
BIN
clients/win10/app/images/StoreLogo.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
clients/win10/app/images/Wide310x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
17
clients/win10/app/msapp-error.css
Normal file
@ -0,0 +1,17 @@
|
||||
body {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 90%;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.paramName {
|
||||
font-size: 100%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.paramValue {
|
||||
color: black;
|
||||
}
|
26
clients/win10/app/msapp-error.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Navigation Error</title>
|
||||
<link href="msapp-error.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="msapp-error.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Navigation Error</h1>
|
||||
<div id="failureUrl" class="param">
|
||||
<span>-</span><span class="paramName">failureUrl</span><span>=</span>
|
||||
<span id="failureUrlValue" class="paramValue"></span>
|
||||
<span class="tip">(indicates the url where the error occurred)</span><br/>
|
||||
</div><br/>
|
||||
<div id="httpStatus" class="param">
|
||||
<span>-</span><span class="paramName">httpStatus</span><span>=</span>
|
||||
<span id="httpStatusValue" class="paramValue"></span>
|
||||
<span class="tip">(available when the error has an http status code)</span><br/>
|
||||
</div><br/>
|
||||
<div id="failureName">
|
||||
<span>-</span><span class="paramName">failureName</span><span>=</span>
|
||||
<span id="failureNameValue" class="paramValue"></span>
|
||||
<span class="tip">(available only when the error does not have a http status code)</span><br/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
22
clients/win10/app/msapp-error.js
Normal file
@ -0,0 +1,22 @@
|
||||
(function () {
|
||||
var validParameterNames = [ "httpStatus", "failureName", "failureUrl" ];
|
||||
|
||||
function parseQueryParameters() {
|
||||
var query = location.search.slice(1);
|
||||
return query.split("&").reduce(function (queryParameters, rawPair) {
|
||||
var pair = rawPair.split("=").map(decodeURIComponent);
|
||||
queryParameters[pair[0]] = pair[1];
|
||||
return queryParameters;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
var queryParameters = parseQueryParameters();
|
||||
validParameterNames.forEach(function (parameterName) {
|
||||
var parameterValue = queryParameters[parameterName] || "N/A";
|
||||
document.getElementById(parameterName + "Value").textContent = parameterValue;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", initialize);
|
||||
}());
|
50
clients/win10/app/package.appxmanifest
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
|
||||
<Identity Name="39122940-ab16-4cd4-a0ce-79a3eb863ecf" Version="0.1.5.0" Publisher="CN=jhalleux" />
|
||||
<mp:PhoneIdentity PhoneProductId="39122940-ab16-4cd4-a0ce-79a3eb863ecf" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>codethemicrobit</DisplayName>
|
||||
<PublisherDisplayName>Microsoft</PublisherDisplayName>
|
||||
<Logo>images\storelogo.png</Logo>
|
||||
</Properties>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" StartPage="https://codethemicrobit.com">
|
||||
<uap:ApplicationContentUriRules>
|
||||
<uap:Rule Match="https://m.pxt.io/" Type="include" WindowsRuntimeAccess="all" />
|
||||
<uap:Rule Match="https://codemicrobit.com/" Type="include" WindowsRuntimeAccess="all" />
|
||||
<uap:Rule Match="https://codethemicrobit.com/" Type="include" WindowsRuntimeAccess="all" />
|
||||
</uap:ApplicationContentUriRules>
|
||||
<uap:VisualElements DisplayName="code the micro:bit" Description="A code editor for the BBC micro:bit with Blocks or Javascript." BackgroundColor="white" Square150x150Logo="images\Square150x150Logo.png" Square44x44Logo="images\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="images\Wide310x150Logo.png" ShortName="code the micro:bit">
|
||||
</uap:DefaultTile>
|
||||
<uap:SplashScreen Image="images\splashscreen.png" />
|
||||
</uap:VisualElements>
|
||||
<Extensions>
|
||||
<uap:Extension Category="windows.fileTypeAssociation">
|
||||
<uap:FileTypeAssociation Name="microbithex">
|
||||
<uap:DisplayName>BBC micro:bit binary file</uap:DisplayName>
|
||||
<uap:SupportedFileTypes>
|
||||
<uap:FileType ContentType="application/x-microbit-hex">.hex</uap:FileType>
|
||||
</uap:SupportedFileTypes>
|
||||
</uap:FileTypeAssociation>
|
||||
</uap:Extension>
|
||||
</Extensions>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
<uap:Capability Name="removableStorage" />
|
||||
<DeviceCapability Name="bluetooth" />
|
||||
<DeviceCapability Name="serialcommunication">
|
||||
<Device Id="any">
|
||||
<Function Type="name:serialPort" />
|
||||
</Device>
|
||||
</DeviceCapability>
|
||||
</Capabilities>
|
||||
</Package>
|
BIN
clients/win10/app/pxtwinapp_TemporaryKey.pfx
Normal file
BIN
clients/win10/store/desktopblocks1366x768.png
Normal file
After Width: | Height: | Size: 172 KiB |
BIN
clients/win10/store/desktopjavascript1366x768.png
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
clients/win10/store/mobileblocks480x800.png
Normal file
After Width: | Height: | Size: 54 KiB |
40
clients/winuploader/CodeTheMicroBit.sln
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeTheMicrobit", "Microbit.Uploader\CodeTheMicrobit.csproj", "{7DC6CA45-FD75-44BC-805E-708C812CD4BF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|x64.Build.0 = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{7DC6CA45-FD75-44BC-805E-708C812CD4BF}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
7
clients/winuploader/Microbit.Uploader/App.config
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0"/>
|
||||
<supportedRuntime version="v2.0.50727"/>
|
||||
</startup>
|
||||
</configuration>
|
123
clients/winuploader/Microbit.Uploader/CodeTheMicrobit.csproj
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7DC6CA45-FD75-44BC-805E-708C812CD4BF}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.MicroBit</RootNamespace>
|
||||
<AssemblyName>CodeTheMicrobit</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DelaySign>false</DelaySign>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Settings.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Settings.Designer.cs">
|
||||
<DependentUpon>Settings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="KnownFolders.cs" />
|
||||
<Compile Include="LicenseDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LicenseDialog.Designer.cs">
|
||||
<DependentUpon>LicenseDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SingleInstanceAppHelper.cs" />
|
||||
<Compile Include="SingleInstanceAppStarter.cs" />
|
||||
<EmbeddedResource Include="LicenseDialog.resx">
|
||||
<DependentUpon>LicenseDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Settings.resx">
|
||||
<DependentUpon>Settings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MSFT_logo_png.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="Resources\MSR-LA - 2576.rtf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="favicon.ico" />
|
||||
<EmbeddedResource Include="microbit.red.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
BIN
clients/winuploader/Microbit.Uploader/GlobalSuppressions.cs
Normal file
33
clients/winuploader/Microbit.Uploader/KnownFolders.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
/// <summary>
|
||||
/// Class containing methods to retrieve specific file system paths.
|
||||
/// </summary>
|
||||
internal static class KnownFoldersNativeMethods
|
||||
{
|
||||
[SecurityCritical]
|
||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
|
||||
public static string GetDownloadPath()
|
||||
{
|
||||
IntPtr outPath;
|
||||
int result = SHGetKnownFolderPath(new Guid("{374DE290-123F-4565-9164-39C4925E467B}"), 0x00004000, new IntPtr(0), out outPath);
|
||||
if (result >= 0)
|
||||
return Marshal.PtrToStringUni(outPath);
|
||||
else return null;
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule")]
|
||||
[DllImport("Shell32.dll")]
|
||||
[SecurityCritical]
|
||||
private static extern int SHGetKnownFolderPath(
|
||||
[MarshalAs(UnmanagedType.LPStruct)]Guid rfid, uint dwFlags, IntPtr hToken,
|
||||
out IntPtr ppszPath);
|
||||
}
|
||||
|
||||
}
|
93
clients/winuploader/Microbit.Uploader/LicenseDialog.Designer.cs
generated
Normal file
@ -0,0 +1,93 @@
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
partial class LicenseDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.textBox = new System.Windows.Forms.RichTextBox();
|
||||
this.acceptButton = new System.Windows.Forms.Button();
|
||||
this.exitButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBox
|
||||
//
|
||||
this.textBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox.Location = new System.Drawing.Point(13, 13);
|
||||
this.textBox.Name = "textBox";
|
||||
this.textBox.ReadOnly = true;
|
||||
this.textBox.Size = new System.Drawing.Size(465, 438);
|
||||
this.textBox.TabIndex = 0;
|
||||
this.textBox.Text = "";
|
||||
//
|
||||
// acceptButton
|
||||
//
|
||||
this.acceptButton.Location = new System.Drawing.Point(322, 457);
|
||||
this.acceptButton.Name = "acceptButton";
|
||||
this.acceptButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.acceptButton.TabIndex = 1;
|
||||
this.acceptButton.Text = "Accept";
|
||||
this.acceptButton.UseVisualStyleBackColor = true;
|
||||
this.acceptButton.Click += new System.EventHandler(this.acceptButton_Click);
|
||||
//
|
||||
// exitButton
|
||||
//
|
||||
this.exitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.exitButton.Location = new System.Drawing.Point(403, 457);
|
||||
this.exitButton.Name = "exitButton";
|
||||
this.exitButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.exitButton.TabIndex = 2;
|
||||
this.exitButton.Text = "Exit";
|
||||
this.exitButton.UseVisualStyleBackColor = true;
|
||||
this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
|
||||
//
|
||||
// LicenseDialog
|
||||
//
|
||||
this.AcceptButton = this.acceptButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.exitButton;
|
||||
this.ClientSize = new System.Drawing.Size(490, 492);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.exitButton);
|
||||
this.Controls.Add(this.acceptButton);
|
||||
this.Controls.Add(this.textBox);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "LicenseDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "code the micro:bit terms of use";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RichTextBox textBox;
|
||||
private System.Windows.Forms.Button acceptButton;
|
||||
private System.Windows.Forms.Button exitButton;
|
||||
}
|
||||
}
|
32
clients/winuploader/Microbit.Uploader/LicenseDialog.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using Microsoft.MicroBit.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
public partial class LicenseDialog : Form
|
||||
{
|
||||
public LicenseDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.textBox.Text = Resources.MSR_LA___2576;
|
||||
}
|
||||
|
||||
private void acceptButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Yes;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void exitButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.No;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
120
clients/winuploader/Microbit.Uploader/LicenseDialog.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
BIN
clients/winuploader/Microbit.Uploader/MSFT_logo_png.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
173
clients/winuploader/Microbit.Uploader/MainForm.Designer.cs
generated
Normal file
@ -0,0 +1,173 @@
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.statusLabel = new System.Windows.Forms.Label();
|
||||
this.backgroundPictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.versionLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.SettingsLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.backgroundPictureBox)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// statusLabel
|
||||
//
|
||||
this.statusLabel.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.statusLabel.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.statusLabel.Location = new System.Drawing.Point(11, 30);
|
||||
this.statusLabel.Name = "statusLabel";
|
||||
this.statusLabel.Size = new System.Drawing.Size(364, 23);
|
||||
this.statusLabel.TabIndex = 1;
|
||||
this.statusLabel.Text = "loading...";
|
||||
//
|
||||
// backgroundPictureBox
|
||||
//
|
||||
this.backgroundPictureBox.BackColor = System.Drawing.Color.White;
|
||||
this.backgroundPictureBox.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.backgroundPictureBox.Image = global::Microsoft.MicroBit.Properties.Resources.MSFT_logo_png;
|
||||
this.backgroundPictureBox.InitialImage = null;
|
||||
this.backgroundPictureBox.Location = new System.Drawing.Point(226, 91);
|
||||
this.backgroundPictureBox.Name = "backgroundPictureBox";
|
||||
this.backgroundPictureBox.Size = new System.Drawing.Size(149, 52);
|
||||
this.backgroundPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.backgroundPictureBox.TabIndex = 0;
|
||||
this.backgroundPictureBox.TabStop = false;
|
||||
this.backgroundPictureBox.Click += new System.EventHandler(this.backgroundPictureBox_Click);
|
||||
//
|
||||
// trayIcon
|
||||
//
|
||||
this.trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("trayIcon.Icon")));
|
||||
this.trayIcon.Visible = true;
|
||||
this.trayIcon.Click += new System.EventHandler(this.trayIcon_Click);
|
||||
//
|
||||
// versionLabel
|
||||
//
|
||||
this.versionLabel.AutoSize = true;
|
||||
this.versionLabel.Location = new System.Drawing.Point(12, 121);
|
||||
this.versionLabel.Name = "versionLabel";
|
||||
this.versionLabel.Size = new System.Drawing.Size(28, 13);
|
||||
this.versionLabel.TabIndex = 2;
|
||||
this.versionLabel.TabStop = true;
|
||||
this.versionLabel.Text = "v0.9";
|
||||
this.versionLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.versionLabel_LinkClicked);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label1.Location = new System.Drawing.Point(12, 103);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(169, 15);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Automatic upload of .hex files.";
|
||||
//
|
||||
// SettingsLabel
|
||||
//
|
||||
this.SettingsLabel.AutoSize = true;
|
||||
this.SettingsLabel.Location = new System.Drawing.Point(151, 121);
|
||||
this.SettingsLabel.Name = "SettingsLabel";
|
||||
this.SettingsLabel.Size = new System.Drawing.Size(43, 13);
|
||||
this.SettingsLabel.TabIndex = 4;
|
||||
this.SettingsLabel.TabStop = true;
|
||||
this.SettingsLabel.Text = "settings";
|
||||
this.SettingsLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.SettingsLabel_LinkClicked);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.BackColor = System.Drawing.Color.White;
|
||||
this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.pictureBox1.Image = global::Microsoft.MicroBit.Properties.Resources.microbit_red;
|
||||
this.pictureBox1.InitialImage = null;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(226, 6);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(149, 79);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pictureBox1.TabIndex = 5;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
|
||||
//
|
||||
// linkLabel1
|
||||
//
|
||||
this.linkLabel1.AutoSize = true;
|
||||
this.linkLabel1.Location = new System.Drawing.Point(62, 121);
|
||||
this.linkLabel1.Name = "linkLabel1";
|
||||
this.linkLabel1.Size = new System.Drawing.Size(60, 13);
|
||||
this.linkLabel1.TabIndex = 6;
|
||||
this.linkLabel1.TabStop = true;
|
||||
this.linkLabel1.Text = "open editor";
|
||||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(388, 143);
|
||||
this.Controls.Add(this.linkLabel1);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.SettingsLabel);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.versionLabel);
|
||||
this.Controls.Add(this.statusLabel);
|
||||
this.Controls.Add(this.backgroundPictureBox);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "MainForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "code the micro:bit";
|
||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.backgroundPictureBox)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox backgroundPictureBox;
|
||||
private System.Windows.Forms.Label statusLabel;
|
||||
private System.Windows.Forms.NotifyIcon trayIcon;
|
||||
private System.Windows.Forms.LinkLabel versionLabel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.LinkLabel SettingsLabel;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||
}
|
||||
}
|
||||
|
267
clients/winuploader/Microbit.Uploader/MainForm.cs
Normal file
@ -0,0 +1,267 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
internal partial class MainForm : Form
|
||||
{
|
||||
FileSystemWatcher watcher;
|
||||
private string customcopypath = "";
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
var v = typeof(MainForm).Assembly.GetName().Version;
|
||||
this.versionLabel.Text = "v" + v.Major + "." + v.Minor;
|
||||
}
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.initializeFileWatch();
|
||||
customcopypath = (string)Application.UserAppDataRegistry.GetValue("CustomDirectory", "");
|
||||
this.openEditor();
|
||||
}
|
||||
|
||||
private void openEditor()
|
||||
{
|
||||
// lanch editor
|
||||
try { Process.Start("https://codethemicrobit.com#uploader"); } catch (Exception) { }
|
||||
}
|
||||
|
||||
private void initializeFileWatch()
|
||||
{
|
||||
if (!checkTOU()) return;
|
||||
|
||||
var downloads = KnownFoldersNativeMethods.GetDownloadPath();
|
||||
if (downloads == null)
|
||||
{
|
||||
this.updateStatus("oops, can't find the `Downloads` folder");
|
||||
return;
|
||||
}
|
||||
|
||||
this.watcher = new FileSystemWatcher(downloads);
|
||||
this.watcher.Renamed += (sender, e) => this.handleFileEvent(e);
|
||||
this.watcher.Created += (sender, e) => this.handleFileEvent(e);
|
||||
this.watcher.EnableRaisingEvents = true;
|
||||
|
||||
this.waitingForHexFileStatus();
|
||||
}
|
||||
|
||||
private void waitingForHexFileStatus()
|
||||
{
|
||||
this.updateStatus("waiting for .hex file...");
|
||||
this.trayIcon.ShowBalloonTip(3000, "ready...", "waiting for .hex file...", ToolTipIcon.None);
|
||||
}
|
||||
|
||||
static bool checkTOU()
|
||||
{
|
||||
var v = (int)Application.UserAppDataRegistry.GetValue("TermOfUse", 0);
|
||||
if (v != 1)
|
||||
{
|
||||
using (var f = new LicenseDialog())
|
||||
{
|
||||
var r = f.ShowDialog();
|
||||
if (r != DialogResult.Yes)
|
||||
{
|
||||
Application.Exit();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Application.UserAppDataRegistry.SetValue("TermOfUse", 1, RegistryValueKind.DWord);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
delegate void Callback();
|
||||
|
||||
private void updateStatus(string value)
|
||||
{
|
||||
Callback a = (Callback)(() =>
|
||||
{
|
||||
this.statusLabel.Text = value;
|
||||
this.trayIcon.Text = value;
|
||||
});
|
||||
this.Invoke(a);
|
||||
}
|
||||
|
||||
void handleFileEvent(FileSystemEventArgs e)
|
||||
{
|
||||
this.handleFile(e.FullPath);
|
||||
}
|
||||
|
||||
volatile int copying;
|
||||
void handleFile(string fullPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// In case this is data-url download, at least Chrome will not rename file, but instead write to it
|
||||
// directly. This mean we may catch it in the act. Let's leave it some time to finish writing.
|
||||
Thread.Sleep(500);
|
||||
|
||||
var info = new System.IO.FileInfo(fullPath);
|
||||
Trace.WriteLine("download: " + info.FullName);
|
||||
|
||||
if (info.Extension != ".hex") return;
|
||||
|
||||
var infoName = info.Name;
|
||||
Trace.WriteLine("download name: " + info.Name);
|
||||
if (!infoName.StartsWith("microbit-", StringComparison.OrdinalIgnoreCase)) return;
|
||||
if (info.Name.EndsWith(".uploaded.hex", StringComparison.OrdinalIgnoreCase)) return;
|
||||
if (info.Length > 1000000) return; // make sure we don't try to copy large files
|
||||
|
||||
|
||||
// already copying?
|
||||
if (Interlocked.Exchange(ref this.copying, 1) == 1)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
var driveletters = getMicrobitDrives();
|
||||
List<String> drives = new List<String>();
|
||||
foreach (var d in driveletters)
|
||||
{
|
||||
drives.Add(d.RootDirectory.FullName);
|
||||
}
|
||||
if (!String.IsNullOrEmpty(customcopypath) && Directory.Exists(customcopypath))
|
||||
{
|
||||
drives.Add(customcopypath);
|
||||
}
|
||||
if (drives.Count == 0)
|
||||
{
|
||||
this.updateStatus("no board found");
|
||||
this.trayIcon.ShowBalloonTip(3000, "cancelled uploading...", "no board found", ToolTipIcon.None);
|
||||
return;
|
||||
}
|
||||
|
||||
this.updateStatus("uploading .hex file");
|
||||
this.trayIcon.ShowBalloonTip(3000, "uploading...", "uploading .hex file", ToolTipIcon.None);
|
||||
|
||||
// copy to all boards
|
||||
copyFirmware(info.FullName, drives);
|
||||
|
||||
// move away hex file
|
||||
var temp = System.IO.Path.ChangeExtension(info.FullName, ".uploaded.hex");
|
||||
try
|
||||
{
|
||||
File.Copy(info.FullName, temp, true);
|
||||
File.Delete(info.FullName);
|
||||
}
|
||||
catch (IOException) { }
|
||||
catch (NotSupportedException) { }
|
||||
catch (UnauthorizedAccessException) { }
|
||||
catch (ArgumentException) { }
|
||||
|
||||
// update ui
|
||||
this.updateStatus("uploading done");
|
||||
this.waitingForHexFileStatus();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Interlocked.Exchange(ref this.copying, 0);
|
||||
}
|
||||
}
|
||||
catch (IOException) { }
|
||||
catch (NotSupportedException) { }
|
||||
catch (UnauthorizedAccessException) { }
|
||||
catch (ArgumentException) { }
|
||||
}
|
||||
|
||||
static void copyFirmware(string file, List<string> drives)
|
||||
{
|
||||
var waitHandles = new List<WaitHandle>();
|
||||
foreach (var drive in drives)
|
||||
{
|
||||
var ev = new AutoResetEvent(false);
|
||||
waitHandles.Add(ev);
|
||||
ThreadPool.QueueUserWorkItem((state) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var trg = System.IO.Path.Combine(drive, "firmware.hex");
|
||||
File.Copy(file, trg, true);
|
||||
}
|
||||
catch (IOException) { }
|
||||
catch (NotSupportedException) { }
|
||||
catch (UnauthorizedAccessException) { }
|
||||
catch (ArgumentException) { }
|
||||
ev.Set();
|
||||
}, ev);
|
||||
}
|
||||
|
||||
//waits for all the threads (waitHandles) to call the .Set() method
|
||||
//and inform that the execution has finished.
|
||||
WaitHandle.WaitAll(waitHandles.ToArray());
|
||||
}
|
||||
|
||||
static DriveInfo[] getMicrobitDrives()
|
||||
{
|
||||
var drives = System.IO.DriveInfo.GetDrives();
|
||||
var r = new System.Collections.Generic.List<DriveInfo>();
|
||||
foreach (var di in drives)
|
||||
{
|
||||
var label = getVolumeLabel(di);
|
||||
if (label.StartsWith("MICROBIT", StringComparison.Ordinal))
|
||||
r.Add(di);
|
||||
}
|
||||
return r.ToArray();
|
||||
}
|
||||
|
||||
static string getVolumeLabel(DriveInfo di)
|
||||
{
|
||||
try { return di.VolumeLabel; }
|
||||
catch (IOException) { }
|
||||
catch (SecurityException) { }
|
||||
catch (UnauthorizedAccessException) { }
|
||||
return "";
|
||||
}
|
||||
|
||||
private void trayIcon_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
this.Show();
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
private void versionLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process.Start("https://codethemicrobit.com/uploader");
|
||||
}
|
||||
catch (IOException) { }
|
||||
}
|
||||
|
||||
private void backgroundPictureBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.openEditor();
|
||||
}
|
||||
|
||||
private void SettingsLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var settings = new Settings(customcopypath);
|
||||
settings.ShowDialog();
|
||||
customcopypath = settings.CustomCopyPath;
|
||||
Application.UserAppDataRegistry.SetValue("CustomDirectory", customcopypath, RegistryValueKind.String);
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
this.openEditor();
|
||||
}
|
||||
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.openEditor();
|
||||
}
|
||||
}
|
||||
}
|
172
clients/winuploader/Microbit.Uploader/MainForm.resx
Normal file
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="trayIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAMIOAADCDgAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAN6bIZTOkxoUtj62FL5W1hTWpzYUvlbWFLY+thTKgwoUxnb+FLY6shS6TsoUzpMaFL5a1hS2P
|
||||
rYUxnb6FNZ2+ZTCTsvkriaf/KYKe/yuIpf8uk7L/K4il/ymBnP8tjqz/K4qn/yiBnP8qhaL/KoWh/yqG
|
||||
o/8ogJv/JXeQ/yqDnvkRMjz/Di02/wofJv8MJS3/Di02/wskLP8HGB3/Di43/w0qM/8HFxz/CyMr/w4s
|
||||
Nv8MJi7/CiAm/w4sNv8RMTv/BQsN/wUQE/8BAgL/AQQF/wYRFP8EBgf/AgIA/xAYJv8TGy3/AgIA/wMF
|
||||
Bv8HEhX/AQUG/wECAv8FEBT/BQsN/wYFD/8LByT/AQAC/wAAAP8CAgL/AwMD/woKEv8LCxT/DAwY/woK
|
||||
Ev8DAwT/AgIC/wAAAP8AAAD/AAAA/wICAv8JCA//IBs//wwMEP8AAAD/AgIC/wQEBv8bGzf/BgYK/wQE
|
||||
Bf8bGzj/BgYJ/wMDA/8AAAD/CgoK/xEREf8HBwf/Li4u/1FRUf9ERET/AQEA/wwMGf8UFCj/BAQE/wMD
|
||||
Av8DAwL/BAQE/xAQIP8RESL/AAAA/z8/P/9SUlH/NTU1/y4uLv9QUFD/QUFB/wEBAP8LCxf/EhIk/wIC
|
||||
Af8JCRH/CwsV/wICAf8PDx3/Dw8f/wAAAP89PT3/UVFQ/zQ0M/8FBQX/DAwM/wgICP8AAAD/CwsW/xIS
|
||||
JP8FBQb/Dg4b/xERIv8FBQb/Dw8d/w8PHv8AAAD/CAgK/xwXO/8KCRT/BAMI/wAAAP8AAAD/AAAA/wIC
|
||||
Av8EBAX/HR06/wgIEP8GBgv/HR07/wYGCf8DAwL/AAAA/wAAAP8JBh3/BwUS/y0fhf8FBBD/AAAA/wAA
|
||||
AP8AAAD/AAAA/xIOMv8fFVz/HhVa/xQPOP8AAQD/AAAA/wAAAP8AAAD/AAAA/wICAv9UO/v/MiKX/wUD
|
||||
D/8FAw7/AwIK/wAAAP8RCzP/IBZi/yAWYP8TDTr/AAAA/wAAAP8AAAD/AAAA/wAAAP8CAgL/VTz/+FQ6
|
||||
/P8yI5j/IBZg/ywehf8MCCX/BAMN/wUEEP8GBBH/AQED/wAAAP8AAAD/AAAA/wAAAP8AAAD/AgIC9Vc+
|
||||
/2BVOv9+Ujj0fTwptH5ONul9OCapfRUOPn4AAAB+AAAAfQAAAH4AAAB+AAAAfQAAAH4AAAB+AAAAfgQE
|
||||
BFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAA//8AAA==
|
||||
</value>
|
||||
</data>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAMIOAADCDgAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAN6bIZTOkxoUtj62FL5W1hTWpzYUvlbWFLY+thTKgwoUxnb+FLY6shS6TsoUzpMaFL5a1hS2P
|
||||
rYUxnb6FNZ2+ZTCTsvkriaf/KYKe/yuIpf8uk7L/K4il/ymBnP8tjqz/K4qn/yiBnP8qhaL/KoWh/yqG
|
||||
o/8ogJv/JXeQ/yqDnvkRMjz/Di02/wofJv8MJS3/Di02/wskLP8HGB3/Di43/w0qM/8HFxz/CyMr/w4s
|
||||
Nv8MJi7/CiAm/w4sNv8RMTv/BQsN/wUQE/8BAgL/AQQF/wYRFP8EBgf/AgIA/xAYJv8TGy3/AgIA/wMF
|
||||
Bv8HEhX/AQUG/wECAv8FEBT/BQsN/wYFD/8LByT/AQAC/wAAAP8CAgL/AwMD/woKEv8LCxT/DAwY/woK
|
||||
Ev8DAwT/AgIC/wAAAP8AAAD/AAAA/wICAv8JCA//IBs//wwMEP8AAAD/AgIC/wQEBv8bGzf/BgYK/wQE
|
||||
Bf8bGzj/BgYJ/wMDA/8AAAD/CgoK/xEREf8HBwf/Li4u/1FRUf9ERET/AQEA/wwMGf8UFCj/BAQE/wMD
|
||||
Av8DAwL/BAQE/xAQIP8RESL/AAAA/z8/P/9SUlH/NTU1/y4uLv9QUFD/QUFB/wEBAP8LCxf/EhIk/wIC
|
||||
Af8JCRH/CwsV/wICAf8PDx3/Dw8f/wAAAP89PT3/UVFQ/zQ0M/8FBQX/DAwM/wgICP8AAAD/CwsW/xIS
|
||||
JP8FBQb/Dg4b/xERIv8FBQb/Dw8d/w8PHv8AAAD/CAgK/xwXO/8KCRT/BAMI/wAAAP8AAAD/AAAA/wIC
|
||||
Av8EBAX/HR06/wgIEP8GBgv/HR07/wYGCf8DAwL/AAAA/wAAAP8JBh3/BwUS/y0fhf8FBBD/AAAA/wAA
|
||||
AP8AAAD/AAAA/xIOMv8fFVz/HhVa/xQPOP8AAQD/AAAA/wAAAP8AAAD/AAAA/wICAv9UO/v/MiKX/wUD
|
||||
D/8FAw7/AwIK/wAAAP8RCzP/IBZi/yAWYP8TDTr/AAAA/wAAAP8AAAD/AAAA/wAAAP8CAgL/VTz/+FQ6
|
||||
/P8yI5j/IBZg/ywehf8MCCX/BAMN/wUEEP8GBBH/AQED/wAAAP8AAAD/AAAA/wAAAP8AAAD/AgIC9Vc+
|
||||
/2BVOv9+Ujj0fTwptH5ONul9OCapfRUOPn4AAAB+AAAAfQAAAH4AAAB+AAAAfQAAAH4AAAB+AAAAfgQE
|
||||
BFkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAA//8AAA==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
30
clients/winuploader/Microbit.Uploader/Program.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
SingleInstanceAppStarter.Start(new MainForm(), StartNewInstance);
|
||||
}
|
||||
|
||||
// The handler when attempting to start another instance of this application
|
||||
// We can customize the logic here for which form to activate in different
|
||||
// conditions. Like in this sample, we will be selectively activate the LoginForm
|
||||
// or MainForm based on the login state of the user.
|
||||
static void StartNewInstance(object sender, StartupNextInstanceEventArgs e)
|
||||
{
|
||||
e.BringToForeground = true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Code The micro:bit Uploader")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("MicrosoftMicrobitUploader")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("7dc6ca45-fd75-44bc-805e-708c812cd4bf")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.10.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.10.0.0")]
|
||||
[assembly: CLSCompliant(true)]
|
||||
[assembly: NeutralResourcesLanguage("en-US")]
|
92
clients/winuploader/Microbit.Uploader/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,92 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.MicroBit.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.MicroBit.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap microbit_red {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("microbit_red", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap MSFT_logo_png {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MSFT_logo_png", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to TBD.
|
||||
/// </summary>
|
||||
internal static string MSR_LA___2576 {
|
||||
get {
|
||||
return ResourceManager.GetString("MSR_LA___2576", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
130
clients/winuploader/Microbit.Uploader/Properties/Resources.resx
Normal file
@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="microbit_red" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\microbit.red.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="MSFT_logo_png" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\MSFT_logo_png.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="MSR_LA___2576" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\MSR-LA - 2576.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
@ -0,0 +1 @@
|
||||
TBD
|
76
clients/winuploader/Microbit.Uploader/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,76 @@
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
partial class Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(107, 12);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBox1.TabIndex = 0;
|
||||
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(34, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Custom Path";
|
||||
//
|
||||
// Settings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(246, 48);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "Settings";
|
||||
this.ShowIcon = false;
|
||||
this.Text = "Settings";
|
||||
this.Load += new System.EventHandler(this.Settings_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
37
clients/winuploader/Microbit.Uploader/Settings.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
public partial class Settings : Form
|
||||
{
|
||||
public string CustomCopyPath;
|
||||
public Settings(string currentpath)
|
||||
{
|
||||
InitializeComponent();
|
||||
CustomCopyPath = currentpath;
|
||||
|
||||
}
|
||||
|
||||
private void Settings_Load(object sender, EventArgs e)
|
||||
{
|
||||
textBox1.Text = CustomCopyPath;
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
CustomCopyPath = textBox1.Text;
|
||||
}
|
||||
}
|
||||
}
|
120
clients/winuploader/Microbit.Uploader/Settings.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -0,0 +1,39 @@
|
||||
/****************************** Module Header ******************************\
|
||||
* Module Name: SingleInstanceAppHelper.cs
|
||||
* Project: CSWinFormSingleInstanceApp
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* The sample demonstrates how to achieve the goal that only
|
||||
* one instance of the application is allowed in Windows Forms application..
|
||||
*
|
||||
* This source is subject to the Microsoft Public License.
|
||||
* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
|
||||
* All other rights reserved.
|
||||
*
|
||||
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
\***************************************************************************/
|
||||
|
||||
using System;
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
// We need to add Microsoft.VisualBasic reference to use
|
||||
// WindowsFormsApplicationBase type.
|
||||
class SingleInstanceApp : WindowsFormsApplicationBase
|
||||
{
|
||||
public SingleInstanceApp()
|
||||
{
|
||||
}
|
||||
public SingleInstanceApp(Form f)
|
||||
{
|
||||
// Set IsSingleInstance property to true to make the application
|
||||
base.IsSingleInstance = true;
|
||||
// Set MainForm of the application.
|
||||
this.MainForm = f;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/****************************** Module Header ******************************\
|
||||
* Module Name: SingleInstanceAppStarter.cs
|
||||
* Project: CSWinFormSingleInstanceApp
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* The sample demonstrates how to achieve the goal that only
|
||||
* one instance of the application is allowed in Windows Forms application..
|
||||
*
|
||||
* This source is subject to the Microsoft Public License.
|
||||
* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
|
||||
* All other rights reserved.
|
||||
*
|
||||
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
\***************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
|
||||
namespace Microsoft.MicroBit
|
||||
{
|
||||
internal static class SingleInstanceAppStarter
|
||||
{
|
||||
static SingleInstanceApp app = null;
|
||||
|
||||
// Construct SingleInstanceApp object, and invoke its run method.
|
||||
public static void Start(Form f, StartupNextInstanceEventHandler handler)
|
||||
{
|
||||
if (app == null && f != null)
|
||||
app = new SingleInstanceApp(f);
|
||||
|
||||
// Wire up StartupNextInstance event handler.
|
||||
app.StartupNextInstance += handler;
|
||||
app.Run(Environment.GetCommandLineArgs());
|
||||
}
|
||||
}
|
||||
}
|
BIN
clients/winuploader/Microbit.Uploader/favicon.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
clients/winuploader/Microbit.Uploader/microbit.red.png
Normal file
After Width: | Height: | Size: 21 KiB |
22
cmds/cmds.ts
@ -1,22 +1,24 @@
|
||||
/// <reference path="../node_modules/pxt-core/built/pxt.d.ts"/>
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as child_process from 'child_process';
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import * as child_process from "child_process";
|
||||
|
||||
let writeFileAsync: any = Promise.promisify(fs.writeFile)
|
||||
let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Promise.promisify(child_process.exec)
|
||||
let readDirAsync = Promise.promisify(fs.readdir)
|
||||
|
||||
export function deployCoreAsync(res: ts.pxt.CompileResult) {
|
||||
|
||||
export function deployCoreAsync(res: ts.pxtc.CompileResult) {
|
||||
return getBitDrivesAsync()
|
||||
.then(drives => {
|
||||
if (drives.length == 0) {
|
||||
console.log("cannot find any drives to deploy to")
|
||||
} else {
|
||||
console.log("copy microbit.hex to " + drives.join(", "))
|
||||
console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", "))
|
||||
}
|
||||
return Promise.map(drives, d =>
|
||||
writeFileAsync(d + "microbit.hex", res.outfiles["microbit.hex"])
|
||||
writeFileAsync(d + ts.pxtc.BINARY_HEX, res.outfiles[ts.pxtc.BINARY_HEX])
|
||||
.then(() => {
|
||||
console.log("wrote hex file to " + d)
|
||||
}))
|
||||
@ -26,17 +28,23 @@ export function deployCoreAsync(res: ts.pxt.CompileResult) {
|
||||
|
||||
function getBitDrivesAsync(): Promise<string[]> {
|
||||
if (process.platform == "win32") {
|
||||
let rx = new RegExp("^([A-Z]:).* " + pxt.appTarget.compile.deployDrives)
|
||||
return execAsync("wmic PATH Win32_LogicalDisk get DeviceID, VolumeName, FileSystem")
|
||||
.then(buf => {
|
||||
let res: string[] = []
|
||||
buf.toString("utf8").split(/\n/).forEach(ln => {
|
||||
let m = /^([A-Z]:).* MICROBIT/.exec(ln)
|
||||
let m = rx.exec(ln)
|
||||
if (m) {
|
||||
res.push(m[1] + "/")
|
||||
}
|
||||
})
|
||||
return res
|
||||
})
|
||||
}
|
||||
else if (process.platform == "darwin") {
|
||||
let rx = new RegExp(pxt.appTarget.compile.deployDrives)
|
||||
return readDirAsync("/Volumes")
|
||||
.then(lst => lst.filter(s => rx.test(s)).map(s => "/Volumes/" + s + "/"))
|
||||
} else {
|
||||
return Promise.resolve([])
|
||||
}
|
||||
|
@ -8,6 +8,6 @@
|
||||
"module": "commonjs",
|
||||
"rootDir": ".",
|
||||
"newLine": "LF",
|
||||
"sourceMap": true
|
||||
"sourceMap": false
|
||||
}
|
||||
}
|
||||
|
22
docs/_locales/pl/_theme.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "koduj z micro:bit",
|
||||
"title": "koduj z micro:bit",
|
||||
"docMenu": [
|
||||
{
|
||||
"name": "O nas",
|
||||
"path": "/about"
|
||||
},
|
||||
{
|
||||
"name": "Lekcje",
|
||||
"path": "/lessons"
|
||||
},
|
||||
{
|
||||
"name": "Instrukcja obsługi",
|
||||
"path": "/reference"
|
||||
},
|
||||
{
|
||||
"name": "Urządzenie",
|
||||
"path": "/device"
|
||||
}
|
||||
]
|
||||
}
|
7
docs/_locales/pl/docs.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Dokumentacja
|
||||
|
||||
Witamy na stronach dokumentacji!
|
||||
|
||||
* Przeglądnij [instrukcje obsługi](/reference)
|
||||
* Dowiedz się więcej o [urządzeniu](/device)
|
||||
* Wystartuj z [lekcjami](/lessons)
|
@ -2,38 +2,8 @@
|
||||
basic.forever(() => {
|
||||
basic.showString("Hi!");
|
||||
})
|
||||
```
|
||||
# About
|
||||
|
||||
The [BBC micro:bit](https://www.microbit.co.uk) is a [pocket-size computer](/device) with a 5x5 display of 25 LEDs, Bluetooth and sensors that can be programmed by anyone.
|
||||
The BBC micro:bit was made possible by many [partners](https://www.microbit.co.uk/partners).
|
||||
|
||||
The micro:bit provides a fun introduction to programming and making – switch on, program it to do something fun – wear it, customize it.
|
||||
Just like Arduino, the micro:bit can be connected to and interact with sensors, displays, and other devices.
|
||||
|
||||
## Blocks or JavaScript
|
||||
|
||||
The student can program the BBC micro:bit using [visual blocks](http://www.github.com/Google/blockly) or JavaScript.
|
||||
|
||||
```blocks
|
||||
basic.showString("BBC micro:bit!");
|
||||
```
|
||||
|
||||
## Compile and Flash
|
||||
|
||||
When a user has her code ready, she can connect her BBC micro:bit to a computer via a USB cable, so it appears as a mounted drive.
|
||||
|
||||
Compilation to the ARM thumb machine code happens in the browser.
|
||||
|
||||
The student is prompted to save the ARM binary program to a file, which she then simply drags to the micro:bit mounted drive,
|
||||
which flashes the micro:bit device with the new program.
|
||||
|
||||
## Simulator: Test Your Code
|
||||
Before a student compiles her code for the micro:bit, she can run it using the micro:bit simulator, all within the confines of a web browser.
|
||||
The simulator has support for the LED screen, buttons, as well as compass, accelerometer, and digital I/O pins.
|
||||
|
||||
```sim
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
led.stopAnimation();
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. # . # .
|
||||
@ -42,6 +12,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
. # # # .`);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
led.stopAnimation();
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# . # . #
|
||||
@ -49,20 +20,51 @@ input.onButtonPressed(Button.B, () => {
|
||||
. # . # .
|
||||
. . # . .`);
|
||||
});
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #`);
|
||||
});
|
||||
basic.showString("BBC micro:bit");
|
||||
```
|
||||
# About
|
||||
|
||||
### @description A Blocks / Javascript code editor for the micro:bit, a pocket-size computer with 5x5 display, sensors and Bluetooth.
|
||||
|
||||
The [BBC micro:bit](https://www.microbit.co.uk) is a [pocket-size computer](/device) with a 5x5 display of 25 LEDs, Bluetooth and sensors that can be programmed by anyone.
|
||||
The BBC micro:bit was made possible by many [partners](https://www.microbit.co.uk/partners).
|
||||
|
||||
The micro:bit provides an easy and fun introduction to programming and making – switch on, program it to do something fun – wear it, customize it.
|
||||
Just like Arduino, the micro:bit can be connected to and interact with sensors, displays, and other devices.
|
||||
|
||||
## Hardware: The Device
|
||||
|
||||
Learn about the [hardware components](/device) of the micro:bit to make the most of it!
|
||||
|
||||
## Programming: Blocks or JavaScript
|
||||
|
||||
You can program the micro:bit using [Blocks](/blocks) or [JavaScript](/javascript), via the [micro:bit APIs](/reference):
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
basic.showString("Hi!");
|
||||
})
|
||||
```
|
||||
|
||||
## Compile and Flash: Your Program!
|
||||
|
||||
When you have your code ready, you connect your micro:bit to a computer via a USB cable, so it appears as a mounted drive (named MICROBIT).
|
||||
|
||||
Compilation to ARM thumb machine code from [Blocks](/blocks) or [JavaScript](/javascript) happens in the browser. You save the ARM binary
|
||||
program to a file, which you then copy to the micro:bit drive, which flashes the micro:bit device with the new program.
|
||||
|
||||
## Simulator: Test Your Code
|
||||
|
||||
You can run your code using the micro:bit simulator, all within the confines of a web browser.
|
||||
The simulator has support for the LED screen, buttons, as well as compass, accelerometer, and digital I/O pins.
|
||||
|
||||
## C++ Runtime
|
||||
|
||||
The C++ BBC micro:bit library, created at [Lancaster University](http://www.lancaster.ac.uk/), provides access to the hardware functions of the micro:bit,
|
||||
The [C++ micro:bit runtime](http://lancaster-university.github.io/microbit-docs/), created at [Lancaster University](http://www.lancaster.ac.uk/), provides access to the hardware functions of the micro:bit,
|
||||
as well as a set of helper functions (such as displaying a number/image/string on the LED screen).
|
||||
The JavaScript micro:bit library mirrors the functions of the C++ library.
|
||||
|
||||
The [micro:bit library](/reference) mirrors the functions of the C++ library.
|
||||
When code is compiled to ARM machine code, the calls to JavaScript micro:bit functions are replaced with calls to the corresponding C++ functions.
|
||||
|
||||
## Open Source
|
||||
|
||||
The code for the micro:bit is [open source](/open-source) on GitHub. Contributors are welcome!
|
||||
|
14
docs/blocks.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Blocks language
|
||||
|
||||
### @description Langugage constructs for the Block editor.
|
||||
|
||||
```namespaces
|
||||
for (let i = 0;i<5;++i) {}
|
||||
if (true){}
|
||||
let x = 0;
|
||||
Math.random(5);
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
[logic](/blocks/logic), [loops](/blocks/loops), [math](/blocks/math), [variables](/blocks/variables)
|
9
docs/blocks/logic.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Logic
|
||||
|
||||
```cards
|
||||
if(true) {}
|
||||
true;
|
||||
true && false;
|
||||
!true;
|
||||
1 != 0;
|
||||
```
|
102
docs/blocks/logic/boolean.md
Normal file
@ -0,0 +1,102 @@
|
||||
# Boolean
|
||||
|
||||
true or false.
|
||||
|
||||
A Boolean has one of two possible values: `true`; `false`. Boolean (logical) operators (*and*, *or*, *not*) take Boolean inputs and yields a Boolean value. Comparison operators on other types ([numbers](/reference/types/number), [strings](/reference/types/string) yields a Boolean value.
|
||||
|
||||
The following blocks represent the true and false Boolean values, which can be plugged in anywhere a Boolean value is expected:
|
||||
|
||||
```blocks
|
||||
true;
|
||||
false;
|
||||
```
|
||||
|
||||
The next three blocks represent the three Boolean (logic) operators:
|
||||
|
||||
```blocks
|
||||
true && false;
|
||||
true || false;
|
||||
!true;
|
||||
```
|
||||
|
||||
The next six blocks represent comparison operators that yield a Boolean value. Most comparisons you will do involve [numbers](/reference/types/number):
|
||||
|
||||
```blocks
|
||||
42 == 0;
|
||||
42 != 0;
|
||||
42 < 0;
|
||||
42 > 0;
|
||||
42 <= 0;
|
||||
42 >= 0;
|
||||
```
|
||||
|
||||
Boolean values and operators are often used with an [if](/blocks/logic/if) or [while](/blocks/loops/while) statement to determine which code will execute next. For example:
|
||||
|
||||
### Functions that return a Boolean
|
||||
|
||||
Some functions return a Boolean value, which you can store in a Boolean variable. For example, the following code gets the on/off state of `point (1, 2)` and stores this in the Boolean variable named `on`. Then the code clears the screen if `on` is `true`:
|
||||
|
||||
### Boolean operators
|
||||
|
||||
Boolean operators take Boolean inputs and evaluate to a Boolean output:
|
||||
|
||||
### Conjunction: `A and B`
|
||||
|
||||
`A and B` evaluates to `true` if-and-only-if both A and B are true:
|
||||
|
||||
```blocks
|
||||
false && false == false;
|
||||
false && true == false;
|
||||
true && false == false;
|
||||
true && true == true;
|
||||
```
|
||||
|
||||
### Disjunction: `A or B`
|
||||
|
||||
`A or B` evaluates to `true` if-and-only-if either A is true or B is true:
|
||||
|
||||
```blocks
|
||||
false || false == false;
|
||||
false || true == true;
|
||||
true || false == true;
|
||||
true || true == true;
|
||||
```
|
||||
|
||||
### Negation: `not A`
|
||||
|
||||
`not A` evaluates to the opposite (negation) of A:
|
||||
|
||||
```blocks
|
||||
!false == true;
|
||||
!true == false;
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
This example turns on LED `3 , 3`, if LEDs `1 , 1` and `2 , 2` are both on:
|
||||
|
||||
```blocks
|
||||
if (led.point(1,1) && led.point(2,2)) {
|
||||
led.plot(3,3)
|
||||
}
|
||||
```
|
||||
|
||||
### Comparisons of numbers and strings
|
||||
|
||||
When you compare two Numbers, you get a Boolean value, such as the comparison `x < 5` in the code below:
|
||||
|
||||
```blocks
|
||||
let x = Math.random(5)
|
||||
if(x < 5) {
|
||||
basic.showString("low");
|
||||
} else {
|
||||
basic.showString("high");
|
||||
}
|
||||
```
|
||||
|
||||
See the documentation on [Numbers](/reference/types/number) for more information on comparing two Numbers. You can also [compare strings](/reference/types/string-functions) using the `equals` function.
|
||||
|
||||
### See also
|
||||
|
||||
[if](/blocks/logic/if), [while](/blocks/loops/while), [number](/reference/types/number)
|
||||
|
28
docs/blocks/logic/if.md
Normal file
@ -0,0 +1,28 @@
|
||||
# If
|
||||
|
||||
### @parent blocks/language
|
||||
|
||||
|
||||
Conditionally run code depending on whether a [Boolean](/blocks/logic/boolean) condition is true or false.
|
||||
|
||||
```blocks
|
||||
if(true) {
|
||||
}
|
||||
```
|
||||
|
||||
Click on the dark blue gear icon (see above) to add an *else* or *if* to the current block.
|
||||
|
||||
### Example: adjusting screen brightness
|
||||
|
||||
```blocks
|
||||
if(input.lightLevel()<100){
|
||||
led.setBrightness(255);
|
||||
}
|
||||
```
|
||||
|
||||
If the [light level](/reference/input/light-level) is `< 100`, this code sets the brightness to `255`:
|
||||
|
||||
### See also
|
||||
|
||||
[while loop](/blocks/loops/while), [for](/blocks/loops/for), [boolean](/blocks/logic/boolean)
|
||||
|
7
docs/blocks/loops.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Loops
|
||||
|
||||
```cards
|
||||
for(let i = 0;i<5;i++) {}
|
||||
while(true) {}
|
||||
basic.forever(() => {});
|
||||
```
|
20
docs/blocks/loops/for.md
Normal file
@ -0,0 +1,20 @@
|
||||
# For
|
||||
|
||||
### @parent blocks/language
|
||||
|
||||
Run part of the program the number of times you say.
|
||||
|
||||
### Example: Count to 4
|
||||
|
||||
This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.
|
||||
|
||||
```blocks
|
||||
for(let i = 0; i < 5; ++i) {
|
||||
basic.showNumber(i)
|
||||
}
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[repeat](/blocks/loops/repeat), [while](/blocks/loops/while), [if](/blocks/logic/if), [show number](/reference/basic/show-number)
|
||||
|
12
docs/blocks/loops/repeat.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Repeat
|
||||
|
||||
Run part of the program the number of times you say.
|
||||
|
||||
### Block Editor
|
||||
|
||||

|
||||
|
||||
### See also
|
||||
|
||||
[for](/blocks/loops/for), [while](/blocks/loops/while), [if](/blocks/logic/if), [show number](/reference/basic/show-number)
|
||||
|
29
docs/blocks/loops/while.md
Normal file
@ -0,0 +1,29 @@
|
||||
# While
|
||||
|
||||
Repeat code while a [Boolean](/blocks/logic/boolean) `condition` is true.
|
||||
|
||||
```blocks
|
||||
while(true) {
|
||||
}
|
||||
```
|
||||
|
||||
The while loop has a *condition* that evaluates to a [Boolean](/blocks/logic/boolean) value. After the `do` keyword, add the code that you want to run while the `condition` is `true`. The while loop concludes with `end while`.
|
||||
|
||||
The condition is tested before any code runs. Which means that if the condition is false, the code inside the loop doesn't execute.
|
||||
|
||||
### Example: diagonal line
|
||||
|
||||
The following example uses a while loop to make a diagonal line on the LED screen (points `0, 0`, `1, 1`, `2, 2`, `3, 3`, `4, 4`).
|
||||
|
||||
```blocks
|
||||
let index = 4;
|
||||
while(index >= 0) {
|
||||
led.plot(index, index);
|
||||
index--;
|
||||
}
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[on button pressed](/reference/input/on-button-pressed), [for](/blocks/loops/for), [if](/blocks/logic/if), [forever](/reference/basic/forever)
|
||||
|
42
docs/blocks/math/math.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Math functions
|
||||
|
||||
### @parent blocks/language
|
||||
|
||||
The math library includes math related functions that you can use with [Numbers](/reference/types/number).
|
||||
|
||||
### abs
|
||||
|
||||
math `->` abs (x : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
returns the absolute value of input parameter `x`
|
||||
|
||||

|
||||
|
||||
### max
|
||||
|
||||
math `->` max (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
returns the larger of two input numbers (`x` and `y`)
|
||||
|
||||

|
||||
|
||||
### min
|
||||
|
||||
math `->` min (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
returns the smaller of two input numbers (`x` and `y`)
|
||||
|
||||

|
||||
|
||||
### random
|
||||
|
||||
math `->` random (limit : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
returns a random [Number](/reference/types/number) between 0 and the parameter *limit*
|
||||
|
||||

|
||||
|
||||
### See also
|
||||
|
||||
[Number](/reference/types/number)
|
||||
|
21
docs/blocks/variables.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Variables
|
||||
|
||||
[Assign](/blocks/variables/assign) (set) a variable's value
|
||||
|
||||
```blocks
|
||||
let x = 0;
|
||||
```
|
||||
|
||||
Get a variable's value
|
||||
|
||||
```blocks
|
||||
let x = 0;
|
||||
x;
|
||||
```
|
||||
|
||||
[Change](/blocks/variables/change-var) a variable's value
|
||||
|
||||
```blocks
|
||||
let x = 0;
|
||||
x+=1;
|
||||
```
|
36
docs/blocks/variables/assign.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Assignment Operator
|
||||
|
||||
Use an equals sign to make a [variable](/blocks/variables/var) store the [number](/reference/types/number)
|
||||
or [string](/reference/types/string) you say.
|
||||
|
||||
When you use the equals sign to store something in a variable, the equals sign is called
|
||||
an *assignment operator*, and what you store is called a *value*.
|
||||
|
||||
### Storing numbers in variables
|
||||
|
||||
This program makes the variable `item` equal `5` and then shows it on the [LED screen](/device/screen).
|
||||
|
||||
````blocks
|
||||
let item = 5
|
||||
basic.showNumber(item)
|
||||
````
|
||||
|
||||
### Storing strings in variables
|
||||
|
||||
This program makes the variable `name` equal `Joe` and then shows it on the [LED screen](/device/screen).
|
||||
|
||||
````blocks
|
||||
let name = "Joe"
|
||||
basic.showString(name);
|
||||
````
|
||||
|
||||
### Notes
|
||||
|
||||
You can use the assignment operator with variables of
|
||||
every [type](/reference/types). A *type* is which kind of thing
|
||||
a variable can store, like a number or string.
|
||||
|
||||
### See also
|
||||
|
||||
[variable](/blocks/variables/var), [types](/reference/types)
|
||||
|
40
docs/blocks/variables/change-var.md
Normal file
@ -0,0 +1,40 @@
|
||||
# Change Value
|
||||
|
||||
Set the value for local and global variables.
|
||||
|
||||
### @parent blocks/change-value
|
||||
|
||||
Change the value of a variable
|
||||
|
||||
```blocks
|
||||
let x = 0
|
||||
x += 1
|
||||
```
|
||||
|
||||
### Declare a variable
|
||||
|
||||
Use the assignment operator to set the value of a [variable](/blocks/variables/var). Change the value of a variable from 0 to 1 using the change item block. Like this:
|
||||
|
||||
```blocks
|
||||
let x = 0
|
||||
x += 1
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
Use the assignment operator to set the value of a [variable](/blocks/variables/var). Change the value of a variable from 0 to 1 using the change item block. Then display the new value of the variable on the LED screen. Like this:
|
||||
|
||||
```blocks
|
||||
let x = 0;
|
||||
x += 1;
|
||||
basic.showNumber(x);
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
* You can use the assignment operator with variables of each of the supported [types](/reference/types).
|
||||
|
||||
### See also
|
||||
|
||||
[variable](/blocks/variables/var), [types](/reference/types)
|
||||
|
87
docs/blocks/variables/var.md
Normal file
@ -0,0 +1,87 @@
|
||||
# Local Variables
|
||||
|
||||
How to define and use local variables.
|
||||
|
||||
### @parent language
|
||||
|
||||
A variable is a place where you can store and retrieve data. Variables have a name, a [type](/reference/types), and value:
|
||||
|
||||
* *name* is how you'll refer to the variable
|
||||
* *type* refers to the kind of data a variable can store
|
||||
* *value* refers to what's stored in the variable
|
||||
|
||||
### Var statement
|
||||
|
||||
Use the Block Editor variable statement to create a variable
|
||||
and the [assignment operator](/blocks/variables/assign)
|
||||
to store something in the variable.
|
||||
|
||||
For example, this code stores the number `2` in the `x` variable:
|
||||
|
||||
```blocks
|
||||
let x = 2;
|
||||
```
|
||||
Here's how to define a variable in the Block Editor:
|
||||
|
||||
1. Click `variables`.
|
||||
|
||||
2. Change the default variable name if you like.
|
||||
|
||||
3. Drag a block type on the right-side of the [assignment operator](/blocks/variables/assign) and click the down arrow to change the variable name.
|
||||
|
||||
A variable is created for the number returned by the [brightness](/reference/led/brightness) function.
|
||||
|
||||
```blocks
|
||||
let b = led.brightness();
|
||||
```
|
||||
|
||||
### Using variables
|
||||
|
||||
Once you've defined a variable, just use the variable's name whenever you need what's stored in the variable. For example, the following code shows the value stored in `counter` on the LED screen:
|
||||
|
||||
```blocks
|
||||
let counter = 1;
|
||||
basic.showNumber(counter);
|
||||
```
|
||||
|
||||
To change the contents of a variable use the assignment operator. The following code sets `counter` to 1 and then increments `counter` by 10:
|
||||
|
||||
```blocks
|
||||
let counter = 1;
|
||||
counter = counter + 10;
|
||||
basic.showNumber(counter);
|
||||
```
|
||||
|
||||
### Why use variables?
|
||||
|
||||
If you want to remember and modify data, you'll need a variable.
|
||||
A counter is a great example:
|
||||
|
||||
```blocks
|
||||
let counter = 0;
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
counter = counter + 1;
|
||||
basic.showNumber(counter);
|
||||
});
|
||||
```
|
||||
|
||||
### Local variables
|
||||
|
||||
Local variables exist only within the function or block of code where they're defined. For example:
|
||||
|
||||
```blocks
|
||||
// x does NOT exist here.
|
||||
if (led.brightness() > 128) {
|
||||
// x exists here
|
||||
let x = 0;
|
||||
}
|
||||
```
|
||||
|
||||
#### Notes
|
||||
|
||||
* You can use the default variable names if you'd like, however, it's best to use descriptive variable names. To change a variable name in the editor, select the down arrow next to the variable and then click "new variable".
|
||||
|
||||
### See also
|
||||
|
||||
[types](/reference/types), [assignment operator](/blocks/variables/assign)
|
||||
|
17
docs/cli.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Command Line Interface
|
||||
|
||||
```sim
|
||||
basic.forever(() => {
|
||||
basic.showString("CLI<3")
|
||||
})
|
||||
```
|
||||
|
||||
It is possible to use the codethemicrobit tools from a command line interface (CLI). The PXT CLI allows to
|
||||
* edit, compile or deploy JavaScript programs
|
||||
* can easily be integrated in most IDEs. It comes with built-in support for [Visual Studio Code](/code)!
|
||||
* run a local web server for the web editor
|
||||
* author packages using JavaScript and/or C++
|
||||
|
||||
Using the CLI assumes that you have some experience with programming and will require to install tools on your machine as well.
|
||||
|
||||
* **[LET'S GET STARTED](https://pxt.io/cli)**
|
16
docs/code.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Visual Studio Code
|
||||
|
||||
[Visual Studio Code](https://code.visualstudio.com) is a Free Open Source code editor that you can use to edit your programs.
|
||||
|
||||
Working from Visual Studio code allows you to benefit from all the features
|
||||
of a professional IDE while working with PXT: working with files,
|
||||
git integration (or source control of your choice), hundreds of extensions.
|
||||
|
||||
* background compilation
|
||||
* auto-completion
|
||||
* pxt command line integration
|
||||
|
||||
**Follow [these instructions](https://pxt.io/cli)** to setup your machine and edit your programs in Visual Studio Code.
|
||||
|
||||

|
||||
|
137
docs/device.md
@ -1,124 +1,93 @@
|
||||
# Device
|
||||
|
||||
All the bits and pieces that make up your BBC micro:bit
|
||||
All the bits and pieces that make up the BBC micro:bit
|
||||
|
||||

|
||||
|
||||
### Lights
|
||||
### LED Screen and Status LED
|
||||
|
||||
### What are the red lights on the front?
|
||||
The red lights are [LEDs](/device/screen) (light emitting diodes) and form a 5 x 5 LED Screen.
|
||||
They can be set to on/off and the brightness can be controlled.
|
||||
|
||||
The red lights are [LEDs](/microbit/device/screen) (light emitting diodes) and form a 5 x 5 grid. They can be set to on/off and the brightness can be controlled.
|
||||
|
||||
### What is the yellow light on the back of the micro:bit?
|
||||
|
||||
It is the status LED. It flashes yellow when the system wants to tell the user that something has happened.
|
||||
The yellow light on the back of the micro:bit is the status LED.
|
||||
It flashes yellow when the system wants to tell the user that something has happened.
|
||||
|
||||
### Buttons
|
||||
|
||||
### What are the buttons for?
|
||||
Buttons A and B are a form of input. When you press a button, it completes an electrical circuit.
|
||||
The micro:bit can detect either of its two buttons being pressed/released and be programmed
|
||||
to act on these events.
|
||||
|
||||
Buttons A and B are a form of input. They detect when the button is being pressed. When you press one of the buttons, it completes an electrical circuit. The micro:bit can detect either of its two buttons being pressed and un-pressed and be programmed to act on that or send the information to another device.
|
||||
Button R on the back of the micro:bit is a system button. It has different uses.
|
||||
When you have downloaded and run your code onto your micro:bit, press Button R to restart and run your program from the beginning.
|
||||
|
||||
Button R on the back of the micro:bit is a system button. It has different uses. When you have downloaded and run your code onto your micro:bit, press Button R to restart and run your program from the beginning.
|
||||
### USB connection
|
||||
|
||||
When you plug in your micro:bit, it should appear as MICROBIT. If you accidentally hold down the reset button as you’re plugging in your micro:bit, the micro:bit will appear as a MAINTENANCE drive instead of MICROBIT. This is known as maintenance mode.**
|
||||
When you plug in your micro:bit, it should appear as ``MICROBIT``.
|
||||
If you accidentally hold down the reset button as you’re plugging in your micro:bit,
|
||||
the micro:bit will appear as a MAINTENANCE drive instead of ``MICROBIT``. This is known as maintenance mode.**
|
||||
|
||||
To continue programming your micro:bit YOU MUST unplug your USB and reconnect it. Check that the drive now shows as MICROBIT.
|
||||
To continue programming your micro:bit YOU MUST unplug your USB and reconnect it. Check that the drive now shows as ``MICROBIT``.
|
||||
|
||||
**Use with caution. If you click on the drive while it shows as MAINTENANCE, you can see which version of firmware you have running on your micro:bit. Firmware on your micro:bit should be up-to-date already. You can find the version of firmware in the 'version.txt' file on the micro:bit. Further information on the firmware can be found here:
|
||||
**Use with caution. If you click on the drive while it shows as ``MAINTENANCE``,
|
||||
you can see which version of firmware you have running on your micro:bit.
|
||||
Firmware on your micro:bit should be up-to-date already.
|
||||
You can find the version of firmware in the 'version.txt' file on the micro:bit. Further information on the firmware can be found here:
|
||||
|
||||
https://developer.mbed.org/platforms/Microbit/#firmware
|
||||
|
||||
### Compass
|
||||
|
||||
### Why is there a compass on the micro:bit?
|
||||
|
||||
The compass can detect magnetic fields such as the Earth’s magnetic field. As the micro:bit has this compass, it is possible to detect the direction it is moving in. The micro:bit can detect where it is facing and movement in degrees. This data can be used by the micro:bit in a program or be sent to another device.
|
||||
The compass can detect magnetic fields such as the Earth’s magnetic field.
|
||||
As the micro:bit has this compass, it is possible to detect the direction it is moving in.
|
||||
The micro:bit can detect where it is facing and movement in degrees.
|
||||
This data can be used by the micro:bit in a program or be sent to another device.
|
||||
|
||||
### Accelerometer
|
||||
|
||||
### Why is there an accelerometer on the micro:bit?
|
||||
There is an accelerometer on your micro:bit which detects changes in the micro:bit’s speed.
|
||||
It converts analogue information into digital form that can be used in micro:bit programs.
|
||||
Output is in milli-g. The device will also detect a small number of standard actions e.g. shake, tilt and free-fall.
|
||||
|
||||
There is a an accelerometer on your micro:bit which detects changes in the micro:bit’s speed. It converts analogue information into digital form that can be used in micro:bit programs. Output is in milli-g. The device will also detect a small number of standard actions e.g. shake, tilt and free-fall.
|
||||
### Pins
|
||||
|
||||
### PINS
|
||||
The pins can be a form of input or output.
|
||||
There are labels for the input/output pins P0, P1, P2, which you can attach external sensors to such as thermometers or moisture detectors.
|
||||
You can read more about large and small pins [here](/device/pins).
|
||||
|
||||
### What are the rings labelled 0, 1, 2 on the bottom edge of the micro:bit?
|
||||
### Light level
|
||||
|
||||
These are labels for the input/output pins P0, P1, P2, which you can attach external sensors to such as thermometers or moisture detectors. The pins can be a form of input or output. You can read more about large and small pins [here](/microbit/device/pins).
|
||||
The screen can also be used a light level sensor (it's a really cool trick).
|
||||
|
||||
### How do I connect the micro:bit to my computer?
|
||||
|
||||
It can be connected to your computer or device with a micro USB. Data can be sent and received between the micro:bit and the computer so programs can be downloaded from Windows and Macs onto the micro:bit via this USB data connection. You can read more information on how to run scripts on your micro:bit [here](/microbit/device/usb), and about the error messages you might get [here](/microbit/device/error-codes).
|
||||
Your micro:bit can be connected to your computer via a micro USB cable.
|
||||
Data can be sent and received between the micro:bit and the computer so programs
|
||||
can be downloaded from Windows, Macs and Chromebooks onto the micro:bit via this USB data connection.
|
||||
You can read more information on how to run scripts on your micro:bit [here](/device/usb),
|
||||
and about the error messages you might get [here](/device/error-codes).
|
||||
|
||||
### Batteries
|
||||
### Powering your micro:bit
|
||||
|
||||
### How do I power my micro:bit?
|
||||
When your micro:bit is connected to your computer with the micro USB, it doesn’t need another power source.
|
||||
When your micro:bit isn’t connected to your computer, tablet or mobile, you will need 2 x AAA 1.5 V batteries to power it.
|
||||
|
||||
When your micro:bit is connected to your computer with the micro USB, it doesn’t need another power source. When your micro:bit isn’t connected to your computer, tablet or mobile, you will need 2 x AAA 1.5 V batteries to power it.
|
||||
The pins labelled 3V and GND are the power supply pins.
|
||||
You can attach an external device such as a motor to these and power it using the battery or USB.
|
||||
|
||||
### 3V GND
|
||||
### Serial Communication
|
||||
|
||||
### What are the rings labelled 3V and GND?
|
||||
The micro:bit can send an receive data via [serial communication](/device/serial). The serial data can be transfered via USB or BLE.
|
||||
|
||||
The pins labelled 3V and GND are the power supply pins. You can attach an external device such as a motor to these and power it using the battery or USB.
|
||||
### Bluetooth Low Energy (BLE) Antenna
|
||||
|
||||
### What is a Bluetooth Low Energy Antenna?
|
||||
|
||||
You will see this labelled BLE ANNTENA on the back of your micro:bit. It is for a messaging service, built for the Internet of Things so that devices can talk to each other. The micro:bit is a peripheral device which can talk to a central device like a smart phone or tablet that has Bluetooth Low Energy (BLE). The micro:bit can send signals and receive signals from a central device so another BLE device can control the micro:bit or the micro:bit can control another BLE device.
|
||||
|
||||
### What is Bluetooth Low Energy?
|
||||
|
||||
Bluetooth wireless technology was developed as an alternative to data cables and allowed wireless communication between devices such as PCs, smartphones and tablets. Bluetooth® Smart or Bluetooth Low Energy is a power-friendly version of Bluetooth wireless technology.
|
||||
|
||||
### What is the Internet of Things?
|
||||
|
||||
The Internet of Things (IoT) was first talked about more than 15 years ago, when it was speculated that objects and people would be able to connect wirelessly over the internet. Objects can be detected and controlled remotely, allowing greater integration between the physical and computer based world. It will let you to remotely control your alarm system, thermostat or lights in your home. It has many applications in different fields including manufacturing, health and fitness, consumer electronics and the home.
|
||||
You will see the label BLE ANTENNA on the back of your micro:bit. It is for a messaging service,
|
||||
so that devices can talk to each other. The micro:bit is a peripheral
|
||||
device which can talk to a central device like a smart phone or tablet that has Bluetooth Low Energy (BLE).
|
||||
The micro:bit can send signals and receive signals from a central device so another BLE device can
|
||||
control the micro:bit or the micro:bit can control another BLE device.
|
||||
|
||||
### Technical Information
|
||||
|
||||
The micro:bit has been designed to be a bare-board micro controller for use by children aged 11-12. The device has been through extensive safety and compliance testing to the following standards:
|
||||
|
||||
### Safety
|
||||
|
||||
IEC 60950-1:2005 (Second Edition) + Am 1:2009 + Am 2:2013
|
||||
|
||||
### EMC
|
||||
|
||||
EN 55032: 2012
|
||||
|
||||
EN 55024: 2010
|
||||
|
||||
EN 55022:2010
|
||||
|
||||
EN 301 489-1 V1.9.2 (2011-09)
|
||||
|
||||
EN 301 489-17 V2.2.1 (2012-09)
|
||||
|
||||
### Radio Spectrum
|
||||
|
||||
ETSI EN 300 328 V1.9.1 (2015-02)
|
||||
|
||||
EN 62479:2010
|
||||
|
||||
### Chemical
|
||||
|
||||
Restriction of Hazardous Substances (RoHS) 2011/65/EU Annex II article 4(1)
|
||||
|
||||
EN71-3:2013 + A1:2014 - Migration of certain elements.
|
||||
|
||||
Analysis of the 163 substances of very high concern (SVHC) on the Candidate List for authorization, concerning Regulation (EC) No. 1907/2006 as published on the European Chemicals Agency (ECHA) website.
|
||||
|
||||

|
||||
|
||||
The micro:bit device features Bluetooth Low Energy radio. The radio on the device operates in the following frequencies:
|
||||
|
||||
Frequency Range: 2402MHz to 2480MHz
|
||||
|
||||
Bluetooth Version: V4.0 Bluetooth Low Energy
|
||||
|
||||
### Declaration of Conformity
|
||||
|
||||
The document can be downloaded by clicking here for the [Declaration of Conformity](https://microbit0.blob.core.windows.net/pub/hkeghjes/declaration-of-conformity.pdf)
|
||||
|
||||
The micro:bit has been designed to be a bare-board micro controller for use by children aged 11-12.
|
||||
More information is available at the [BBC web site](http://www.microbit.co.uk/device).
|
||||
|
@ -1,21 +1,19 @@
|
||||
# micro:bit - the device
|
||||
|
||||
The micro:bit device #docs
|
||||
|
||||
The micro:bit is a very capable device with many components:
|
||||
|
||||
* [the USB connector](/microbit/device/usb)
|
||||
* [the LED screen](/microbit/device/screen)
|
||||
* [the USB connector](/device/usb)
|
||||
* [the LED screen](/device/screen)
|
||||
* [the buttons]
|
||||
* [the accelerometer]
|
||||
* [the compass]
|
||||
* [the pins](/microbit/device/pins)
|
||||
* [the pins](/device/pins)
|
||||
* [the battery plug]
|
||||
|
||||
The micro:bit embodies many fundamental concepts in computer science. To learn more, read:
|
||||
|
||||
* [the micro:bit - a reactive system](/microbit/device/reactive)
|
||||
* [the micro:bit - a reactive system](/device/reactive)
|
||||
|
||||
Sometimes, your micro:bit may display an error code. For more information, see:
|
||||
|
||||
* [the error codes](/microbit/device/error-codes)
|
||||
* [the error codes](/device/error-codes)
|
||||
|
@ -1,8 +1,7 @@
|
||||
# crocodile clips
|
||||
|
||||
The on pin pressed accessories.
|
||||
|
||||
Register an [event handler](/microbit/reference/event-handler) that will execute whenever the user attaches one side of the crocodile clip to the `GND` pin, then connects and disconnects the unattached side of the crocodile clip to pin `0`, `1`, or `2`.
|
||||
The large holes at the bottom of the board are designed to attach alligator/crocodile clips.
|
||||
Register an event that will execute whenever the user attaches one side of the crocodile clip to the `GND` pin, then connects and disconnects the unattached side of the crocodile clip to pin `0`, `1`, or `2`.
|
||||
|
||||
### Example: on pin pressed with random numbers
|
||||
|
||||
@ -12,15 +11,7 @@ This example displays a random number every time the crocodile clip holds `GND`
|
||||
|
||||
### Connecting Crocodile Clips
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Lessons
|
||||
|
||||
[love meter](/microbit/lessons/love-meter)
|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/microbit/device/pins), [pin is pressed](/microbit/reference/input/pin-is-pressed), [analog read pin](/microbit/reference/pins/analog-read-pin), [analog write pin](/microbit/reference/pins/analog-write-pin), [digital read pin](/microbit/reference/pins/digital-read-pin), [digital write pin](/microbit/reference/pins/digital-write-pin)
|
||||
[micro:bit pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
|
||||
|