Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
62e8f698a5 | |||
d0331720b4 | |||
724ac19281 | |||
3e193e97bf | |||
23c1789976 | |||
87b08bf6f3 | |||
3e534f7329 | |||
7f8499bb5f | |||
4bcde58c0c | |||
dd5df88dea | |||
f35ed0205b | |||
7379c8dfe7 | |||
574de3a15e | |||
a3c08ddb01 | |||
070cc42d36 | |||
77aa7b86d8 | |||
f912ea6104 | |||
b06bc6bc6c | |||
af3189d8b5 |
@ -1,4 +1,4 @@
|
||||
# LEGO MINDSTORMS EV3 target for PXT
|
||||
# LEGO® MINDSTORMS® Education EV3 for Microsoft MakeCode
|
||||
|
||||
[](https://ci2.dot.net/job/Private/job/pxt_project_rainbow/job/master/job/pxt-ev3_Push/)
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
* [Wake Up!](/tutorials/wake-up)
|
||||
* [Make An Animation](/tutorials/make-an-animation)
|
||||
* [What Animal Am I?](/tutorials/what-animal-am-i)
|
||||
* [Music Brick](/tutorials/mindstorms-music)
|
||||
* [Music Brick](/tutorials/music-brick)
|
||||
* [Run Motors](/tutorials/run-motors)
|
||||
* [Touch to Run](/tutorials/touch-to-run)
|
||||
* [Touch Sensor Values](/tutorials/touch-sensor-values)
|
||||
|
@ -16,7 +16,7 @@ Design cars that can park themselves safely without driver intervention.
|
||||
|
||||
### Build
|
||||
|
||||
Build a LEGO MINDSTORMS vehicle that can park itself safely without driver intervention. Start by constructing this model:
|
||||
Build a @boardname@ vehicle that can park itself safely without driver intervention. Start by constructing this model:
|
||||
|
||||
[](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-driving-base-79bebfc16bd491186ea9c9069842155e.pdf)
|
||||
|
||||
|
@ -16,7 +16,7 @@ Think about:
|
||||
|
||||
### Build
|
||||
|
||||
Build a LEGO MINDSTORMS vehicle that can help prevent drivers from falling asleep and causing an accident. Start by constructing this model:
|
||||
Build a @boardname@ vehicle that can help prevent drivers from falling asleep and causing an accident. Start by constructing this model:
|
||||
|
||||
[](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-color-sensor-down-driving-base-d30ed30610c3d6647d56e17bc64cf6e2.pdf)
|
||||
|
||||
|
@ -16,7 +16,7 @@ Think about:
|
||||
|
||||
### Build
|
||||
|
||||
Build a LEGO MINDSTORMS vehicle that can avoid accidents between vehicles and objects in the road. Start by constructing this model:
|
||||
Build a @boardname@ vehicle that can avoid accidents between vehicles and objects in the road. Start by constructing this model:
|
||||
|
||||
[](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-ultrasonic-sensor-driving-base-61ffdfa461aee2470b8ddbeab16e2070.pdf)
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
{
|
||||
"name": "Try",
|
||||
"imageUrl": "/static/lessons/try.png",
|
||||
"description": "Get a quick introduction to programming with EV3.",
|
||||
"description": "Get a quick introduction to programming.",
|
||||
"url": "/getting-started/try",
|
||||
"cardType": "side"
|
||||
},
|
||||
|
@ -4,7 +4,7 @@ Get a quick introduction to programming with EV3.
|
||||
|
||||

|
||||
|
||||
We are excited to help you get started with LEGO MINDSTORMS Education EV3. In this project we will guide you through connecting your EV3 brick, creating your first program, controlling a Large Motor, a Touch Sensor and a Color Sensor. These steps can take up to 45 minutes.
|
||||
We are excited to help you get started with @boardname@. In this project we will guide you through connecting your EV3 brick, creating your first program, controlling a Large Motor, a Touch Sensor and a Color Sensor. These steps can take up to 45 minutes.
|
||||
|
||||
## Turn on your EV3 Brick
|
||||
|
||||
|
@ -106,4 +106,4 @@ sensors.ultrasonic4.setThreshold(UltrasonicSensorEvent.ObjectDetected, 10)
|
||||
**Congratulations!**
|
||||
|
||||
You are ready to move on to the next steps.
|
||||
Try a LEGO MINDSTORMS [Design Engineering](/design-engineering), [Coding](/coding), or [Maker](/maker) activity.
|
||||
Try a [Design Engineering](/design-engineering), [Coding](/coding), or [Maker](/maker) activity.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Coding in MakeCode
|
||||
|
||||
This guide helps users who are used to the LabView LEGO Minstorms editor quickly get familiar with using blocks in MakeCode.
|
||||
This guide helps users who are used to work with @boardname@ to get familiar with using blocks in MakeCode.
|
||||
|
||||
## Snap together the blocks
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
### Required Materials
|
||||
|
||||
* [LEGO MINDSTORMS Education EV3 Core Set](https://education.lego.com/enus/products/legomindstormseducationev3coreset/5003400)
|
||||
* [@boardname@ Core Set](https://education.lego.com/enus/products/legomindstormseducationev3coreset/5003400)
|
||||
* Lesson plan
|
||||
* Student Worksheet for each activity
|
||||
* Inspirational images for each activity
|
||||
@ -16,7 +16,7 @@ Each lesson is designed to take 90 minutes. If you work in shorter class periods
|
||||
|
||||
### Preparation
|
||||
|
||||
It is important to establish student groups. Groups of two work well. Ensure that each student has a copy of the Student Worksheet for recording their design process, or alternatively, they can use their own preferred method for recording their design journey. They will also need the LEGO MINDSTORMS Education EV3 Core Set (one set for every two students is recommended).
|
||||
It is important to establish student groups. Groups of two work well. Ensure that each student has a copy of the Student Worksheet for recording their design process, or alternatively, they can use their own preferred method for recording their design journey. They will also need the @boardname@ Core Set (one set for every two students is recommended).
|
||||
|
||||
### Prior Learning
|
||||
|
||||
|
@ -10,7 +10,7 @@ Your robot will:
|
||||
* Use at least one motor
|
||||
* Use NO wheels for locomotion
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Construct @unplugged
|
||||
@ -25,7 +25,7 @@ The legs in the Walker Bot are designed to show how to change the rotary motion
|
||||
|
||||
Start by reading [these](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/ev3-dep/building%20instructions/walker-bot-bi-180fc24f9298e1dd6201099627d43903.pdf) instructions first.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Program 1 @fullscreen
|
||||
|
@ -10,7 +10,7 @@ Your robot will:
|
||||
* Use at least one motor
|
||||
* Use NO wheels for locomotion
|
||||
|
||||

|
||||

|
||||
|
||||
## Construct
|
||||
|
||||
@ -24,7 +24,7 @@ The legs in the Walker Bot are designed to show how to change the rotary motion
|
||||
|
||||
Start by reading [these](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/ev3-dep/building%20instructions/walker-bot-bi-180fc24f9298e1dd6201099627d43903.pdf) instructions first.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Program
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Maker Activites
|
||||
|
||||
These six activities require the [LEGO® MINDSTORMS® Education EV3 Core Set (45544)](https://education.lego.com/en-us/products/lego-mindstorms-education-ev3-core-set-/5003400). Supporting materials for teachers and middle school students are provided, offering everything teachers and students need to explore their inner makers as they follow the design process to solve open-ended, themed challenges...
|
||||
These six activities require the [@boardname@ Core Set (45544)](https://education.lego.com/en-us/products/lego-mindstorms-education-ev3-core-set-/5003400). Supporting materials for teachers and middle school students are provided, offering everything teachers and students need to explore their inner makers as they follow the design process to solve open-ended, themed challenges...
|
||||
|
||||
* [Download Curriculum Materials](https://education.lego.com/en-us/downloads/mindstorms-ev3/curriculum)
|
||||
|
||||
|
@ -20,7 +20,7 @@ Look at the photos and think about:
|
||||
|
||||
### Things You’ll Need
|
||||
|
||||
* [LEGO MINDSTORMS Education EV3 Core Set](https://education.lego.com/enus/products/legomindstormseducationev3coreset/5003400)
|
||||
* [@boardname@ Core Set](https://education.lego.com/enus/products/legomindstormseducationev3coreset/5003400)
|
||||
|
||||
Additional materials to add to your Security Gadget:
|
||||
|
||||
@ -72,7 +72,7 @@ Some things to do while brainstorming:
|
||||
|
||||
It is time to start making!
|
||||
|
||||
* Use the components from the LEGO® MINDSTORMS EV3 Core Set and additional materials to make your chosen solution.
|
||||
* Use the components from the @boardname@ Core Set and additional materials to make your chosen solution.
|
||||
* Test and analyze your design as you go and record any improvements that you make.
|
||||
|
||||
### Review and Revise Your Solution
|
||||
|
@ -19,7 +19,7 @@ Look at the photos and think about:
|
||||
|
||||
### Things You’ll Need
|
||||
|
||||
* [LEGO MINDSTORMS Education EV3 Core Set](https://education.lego.com/enus/products/legomindstormseducationev3coreset/5003400)
|
||||
* [@boardname@ Core Set](https://education.lego.com/enus/products/legomindstormseducationev3coreset/5003400)
|
||||
|
||||
Additional materials to add to your Sound Machine:
|
||||
|
||||
@ -71,7 +71,7 @@ Some things to do while brainstorming:
|
||||
|
||||
It is time to start making!
|
||||
|
||||
* Use the components from the LEGO® MINDSTORMS EV3 Core Set and additional materials to make your chosen solution.
|
||||
* Use the components from the @boardname@ Core Set and additional materials to make your chosen solution.
|
||||
* Test and analyze your design as you go and record any improvements that you make.
|
||||
|
||||
### Review and Revise Your Solution
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
@ -2,13 +2,13 @@
|
||||
|
||||
If your're having trouble getting your code onto the @boardname@, try these steps to see if you can fix the problem.
|
||||
|
||||
## Can I see the LEGO drive on my computer?
|
||||
## Can I see the **@drivename@** drive on my computer?
|
||||
|
||||
When your @boardname@ is connected to your computer, you should see a new drive called **@drivename@** attached.
|
||||
|
||||
On Windows, it looks like this in Explorer:
|
||||
|
||||

|
||||

|
||||
|
||||
If you don't see the **@drivename@** drive, make sure your brick is powered on and check that your USB connection is good.
|
||||
|
||||
|
@ -27,8 +27,8 @@ Step by step guides to coding your @boardname@.
|
||||
"name": "Music Brick",
|
||||
"description": "Transform the brick into a musical instrument!",
|
||||
"cardType": "tutorial",
|
||||
"url":"/tutorials/mindstorms-music",
|
||||
"imageUrl":"/static/tutorials/mindstorms-music.png"
|
||||
"url":"/tutorials/music-brick",
|
||||
"imageUrl":"/static/tutorials/music-brick.png"
|
||||
}]
|
||||
```
|
||||
|
||||
@ -110,3 +110,17 @@ Step by step guides to coding your @boardname@.
|
||||
}]
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
[Wake Up!](/tutorials/wake-up),
|
||||
[Make An Animation](/tutorials/make-an-animation),
|
||||
[What Animal Am I?](/tutorials/what-animal-am-i),
|
||||
[Music Brick](/tutorials/music-brick),
|
||||
[Run Motors](/tutorials/run-motors),
|
||||
[Touch to Run](/tutorials/touch-to-run),
|
||||
[Touch Sensor Values](/tutorials/touch-sensor-values),
|
||||
[What Color?](/tutorials/what-color),
|
||||
[Line Following](/tutorials/line-following),
|
||||
[Red Light, Green Light](/tutorials/redlight-greenlight),
|
||||
[Object Near?](/tutorials/object-near),
|
||||
[Security Alert](/tutorials/security-alert)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
Transform your @boardname@ into a musical instrument!
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Step 1
|
||||
@ -53,7 +53,7 @@ brick.showString("Press my buttons to make music!", 1)
|
||||
|
||||
In the ``||music:play tone||`` blocks, use the drop-down menu to select a note to play for each block. You can also set the duration to play each note for.
|
||||
|
||||

|
||||

|
||||
|
||||
```blocks
|
||||
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
|
@ -406,7 +406,7 @@ export class FieldMotors extends Blockly.FieldDropdown implements Blockly.FieldC
|
||||
let opts = {};
|
||||
let conts = {};
|
||||
let vals = {};
|
||||
for (let opt in options) {
|
||||
for (let opt = 0; opt < options.length; opt++) {
|
||||
let text = options[opt][0].alt ? options[opt][0].alt : options[opt][0];
|
||||
if (text.indexOf(' ') == -1) {
|
||||
// Patch dual motors as they don't have prefixes.
|
||||
|
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-ev3",
|
||||
"version": "0.1.18",
|
||||
"version": "0.1.24",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-ev3",
|
||||
"version": "0.1.18",
|
||||
"version": "0.1.24",
|
||||
"description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode",
|
||||
"private": true,
|
||||
"keywords": [
|
||||
@ -46,7 +46,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-common-packages": "0.20.38",
|
||||
"pxt-core": "3.8.10"
|
||||
"pxt-core": "3.8.14"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
||||
|
@ -2,9 +2,9 @@
|
||||
"id": "ev3",
|
||||
"platformid": "linux",
|
||||
"nickname": "lego",
|
||||
"name": "LEGO MINDSTORMS EV3",
|
||||
"title": "LEGO MINDSTORMS EV3 - Blocks / Javascript editor",
|
||||
"description": "A Blocks / JavaScript code editor for the LEGO MINDSTORMS EV3.",
|
||||
"name": "LEGO® MINDSTORMS® Education EV3",
|
||||
"title": "LEGO® MINDSTORMS® Education EV3 - Blocks / Javascript editor",
|
||||
"description": "A Blocks / JavaScript code editor for the LEGO® MINDSTORMS® Education EV3.",
|
||||
"corepkg": "ev3",
|
||||
"bundleddirs": [
|
||||
"libs/base",
|
||||
@ -98,7 +98,7 @@
|
||||
"githubUrl": "https://github.com/Microsoft/pxt-ev3",
|
||||
"betaUrl": "https://makecode.legoeducation.com/about",
|
||||
"driveDisplayName": "EV3",
|
||||
"boardName": "LEGO MINDSTORMS EV3 Brick",
|
||||
"boardName": "LEGO® MINDSTORMS® Education EV3",
|
||||
"selectLanguage": true,
|
||||
"availableLocales": [
|
||||
"en"
|
||||
|
@ -1,10 +1,46 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 146.25 120.31">
|
||||
<defs>
|
||||
<linearGradient id="linear-gradient" x1="-809.89" y1="-16.33" x2="-809.89" y2="-16.88" gradientTransform="translate(53145.53 916.09) scale(65.53 48.84)" gradientUnits="userSpaceOnUse">
|
||||
<linearGradient id="linear-gradient-background" x1="-809.89" y1="-16.33" x2="-809.89" y2="-16.88" gradientTransform="translate(53145.53 916.09) scale(65.53 48.84)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#6a6a6a"/>
|
||||
<stop offset="0.52" stop-color="#6a6a6a"/>
|
||||
<stop offset="1" stop-color="#6a6a6a"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient" x1="-374.89" y1="432.9" x2="-374.89" y2="432.82" gradientTransform="matrix(110.73, 0, 0, -106.94, 41567.45, 46425.3)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#f1f1f1"/>
|
||||
<stop offset="1" stop-color="#7a7a7a"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-2" x1="-376" y1="450.74" x2="-376" y2="450.72" gradientTransform="matrix(100.11, 0, 0, -79.18, 37697.19, 35762.28)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#a8aaa8"/>
|
||||
<stop offset="1" stop-color="gray"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-3" x1="-376.21" y1="614.94" x2="-376.21" y2="614.75" gradientTransform="matrix(98.29, 0, 0, -23.36, 37033.43, 14529.9)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#a8aaa8"/>
|
||||
<stop offset="1" stop-color="#535453"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-black" x1="-382.07" y1="493.36" x2="-382.07" y2="494.25" gradientTransform="matrix(65.53, 0, 0, -48.84, 25091.11, 24228.69)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#6a6a6a"/>
|
||||
<stop offset="0.52" stop-color="#6a6a6a"/>
|
||||
<stop offset="1" stop-color="#6a6a6a"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-green" x1="0" y1="0" x2="145" y2="48" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#6a6a6a"/>
|
||||
<stop offset="0.52" stop-color="#8CE300"/>
|
||||
<stop offset="1" stop-color="#6a6a6a"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-red" x1="0" y1="0" x2="145" y2="48" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#6a6a6a"/>
|
||||
<stop offset="0.52" stop-color="#D02E26"/>
|
||||
<stop offset="1" stop-color="#6a6a6a"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-orange" x1="0" y1="0" x2="145" y2="48" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#6a6a6a"/>
|
||||
<stop offset="0.52" stop-color="#F8D039"/>
|
||||
<stop offset="1" stop-color="#6a6a6a"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linear-gradient-5" x1="-743.87" y1="1256.85" x2="-743.87" y2="1257.21" gradientTransform="matrix(3.03, 0, 0, -6.22, 2312.41, 7891.56)" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#757575"/>
|
||||
<stop offset="1" stop-color="#393939"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<title>EV3Landscape</title>
|
||||
<g id="EV3">
|
||||
@ -17,7 +53,7 @@
|
||||
</g>
|
||||
<g id="buttons">
|
||||
<path id="btn_grey" data-name="btn grey" d="M68.9,119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13H57.93a5.13,5.13,0,1,1-.35-10.25h2.47V97.79l8.76-8.94h8.75c3.94,4,8.74,8.75,8.74,8.75v1.32h2a5.13,5.13,0,0,1,.35,10.25H86.3v1.13c-4.66,4.79-8.68,8.84-8.68,8.84Z" style="fill: #6a6a6a"/>
|
||||
<path id="btn_color" data-name="btn color" d="M68.9,119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13H57.93a5.13,5.13,0,1,1-.35-10.25h2.47V97.79l8.76-8.94h8.75c3.94,4,8.74,8.75,8.74,8.75v1.32h2a5.13,5.13,0,0,1,.35,10.25H86.3v1.13c-4.66,4.79-8.68,8.84-8.68,8.84Z" style="fill: url(#linear-gradient)"/>
|
||||
<path id="btn_color" data-name="btn color" d="M68.9,119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13H57.93a5.13,5.13,0,1,1-.35-10.25h2.47V97.79l8.76-8.94h8.75c3.94,4,8.74,8.75,8.74,8.75v1.32h2a5.13,5.13,0,0,1,.35,10.25H86.3v1.13c-4.66,4.79-8.68,8.84-8.68,8.84Z" style="fill: url(#linear-gradient-background)"/>
|
||||
<path id="btn_left" data-name="btn left" d="M57.85,100.14H64.3v7.62H57.85a3.81,3.81,0,0,1-3.8-3.81h0A3.81,3.81,0,0,1,57.85,100.14Z" style="fill: #a8aaa8"/>
|
||||
<path id="btn_right" data-name="btn right" d="M88.32,107.76H81.88v-7.62h6.44a3.81,3.81,0,0,1,3.81,3.8h0a3.81,3.81,0,0,1-3.81,3.81Z" style="fill: #a8aaa8"/>
|
||||
<path id="btn_enter" data-name="btn enter" d="M69.37,100.14h7.44a.29.29,0,0,1,.29.28v7.06a.29.29,0,0,1-.29.28H69.37a.29.29,0,0,1-.28-.28v-7.06A.29.29,0,0,1,69.37,100.14Z" style="fill: #393939"/>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 5.2 KiB |
@ -1,4 +1,4 @@
|
||||
|
||||
namespace pxsim.visuals {
|
||||
export const EV3_LANDSCAPE_SVG = `<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 146.25 120.31"><defs><linearGradient id="linear-gradient" x1="-809.89" y1="-16.33" x2="-809.89" y2="-16.88" gradientTransform="matrix(65.53 0 0 48.84 53145.53 916.09)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6a6a6a"/><stop offset=".52" stop-color="#6a6a6a"/><stop offset="1" stop-color="#6a6a6a"/></linearGradient></defs><g id="EV3"><g id="brick"><path id="ev3_body_2" data-name="ev3 body 2" d="M2.64 0h141a2.47 2.47 0 0 1 2.64 2.25v115.81a2.47 2.47 0 0 1-2.64 2.25h-141A2.47 2.47 0 0 1 0 118.06V2.25A2.47 2.47 0 0 1 2.64 0z" fill="#fff"/><path id="ev3_screenborder" data-name="ev3 screenborder" d="M8.47 1.54h129.31a6.58 6.58 0 0 1 6.58 6.58v72.67a6.6 6.6 0 0 1-6.58 6.6H8.47a6.6 6.6 0 0 1-6.58-6.6V8.12a6.58 6.58 0 0 1 6.58-6.58z" fill="#393939"/><path id="ev3_screen" data-name="ev3 screen" d="M19.06 5.07h106.8a4.6 4.6 0 0 1 4.69 4.52v68.25a4.61 4.61 0 0 1-4.61 4.62H19.06a4.61 4.61 0 0 1-4.61-4.62V9.68a4.6 4.6 0 0 1 4.61-4.61z" fill="#97b5a6"/></g><g id="buttons"><path id="btn_grey" data-name="btn grey" d="M68.9 119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13h-2.13a5.13 5.13 0 1 1-.35-10.25h2.47v-1.13l8.76-8.94h8.75c3.94 4 8.74 8.75 8.74 8.75v1.32h2a5.13 5.13 0 0 1 .35 10.25H86.3v1.13c-4.66 4.79-8.68 8.84-8.68 8.84z" fill="#6a6a6a"/><path id="btn_color" data-name="btn color" d="M68.9 119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13h-2.13a5.13 5.13 0 1 1-.35-10.25h2.47v-1.13l8.76-8.94h8.75c3.94 4 8.74 8.75 8.74 8.75v1.32h2a5.13 5.13 0 0 1 .35 10.25H86.3v1.13c-4.66 4.79-8.68 8.84-8.68 8.84z" fill="url(#linear-gradient)"/><path id="btn_left" data-name="btn left" d="M57.85 100.14h6.45v7.62h-6.45a3.81 3.81 0 0 1-3.8-3.81 3.81 3.81 0 0 1 3.8-3.81z" fill="#a8aaa8"/><path id="btn_right" data-name="btn right" d="M88.32 107.76h-6.44v-7.62h6.44a3.81 3.81 0 0 1 3.81 3.8 3.81 3.81 0 0 1-3.81 3.81z" fill="#a8aaa8"/><path id="btn_enter" data-name="btn enter" d="M69.37 100.14h7.44a.29.29 0 0 1 .29.28v7.06a.29.29 0 0 1-.29.28h-7.44a.29.29 0 0 1-.28-.28v-7.06a.29.29 0 0 1 .28-.28z" fill="#393939"/><path id="btn_up" data-name="btn up" d="M69.19 90.26l7.9-.09L83 96.28l-2.44 2.44v4.42h-2.25v-2.55a1.86 1.86 0 0 0-1.86-1.86h-6.87a1.54 1.54 0 0 0-1.6 1.46v3H65.7v-4.47l-2.44-2.49z" fill="#a8aaa8"/><path id="btn_down" data-name="btn down" d="M77.05 117.65l-7.85.06-5.94-6.1 2.48-2.43v-4.44H68v2.54a1.9 1.9 0 0 0 1.86 1.9h6.82a1.62 1.62 0 0 0 1.65-1.58v-2.86h2.27v4.44l2.4 2.43z" fill="#a8aaa8"/></g></g></svg>`;
|
||||
export const EV3_LANDSCAPE_SVG = `<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 146.25 120.31"><defs><linearGradient id="linear-gradient-background" x1="-809.89" y1="-16.33" x2="-809.89" y2="-16.88" gradientTransform="matrix(65.53 0 0 48.84 53145.53 916.09)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6a6a6a"/><stop offset=".52" stop-color="#6a6a6a"/><stop offset="1" stop-color="#6a6a6a"/></linearGradient><linearGradient id="linear-gradient" x1="-374.89" y1="432.9" x2="-374.89" y2="432.82" gradientTransform="matrix(110.73 0 0 -106.94 41567.45 46425.3)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f1f1f1"/><stop offset="1" stop-color="#7a7a7a"/></linearGradient><linearGradient id="linear-gradient-2" x1="-376" y1="450.74" x2="-376" y2="450.72" gradientTransform="matrix(100.11 0 0 -79.18 37697.19 35762.28)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a8aaa8"/><stop offset="1" stop-color="gray"/></linearGradient><linearGradient id="linear-gradient-3" x1="-376.21" y1="614.94" x2="-376.21" y2="614.75" gradientTransform="matrix(98.29 0 0 -23.36 37033.43 14529.9)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a8aaa8"/><stop offset="1" stop-color="#535453"/></linearGradient><linearGradient id="linear-gradient-black" x1="-382.07" y1="493.36" x2="-382.07" y2="494.25" gradientTransform="matrix(65.53 0 0 -48.84 25091.11 24228.69)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6a6a6a"/><stop offset=".52" stop-color="#6a6a6a"/><stop offset="1" stop-color="#6a6a6a"/></linearGradient><linearGradient id="linear-gradient-green" x2="145" y2="48" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6a6a6a"/><stop offset=".52" stop-color="#8CE300"/><stop offset="1" stop-color="#6a6a6a"/></linearGradient><linearGradient id="linear-gradient-red" x2="145" y2="48" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6a6a6a"/><stop offset=".52" stop-color="#D02E26"/><stop offset="1" stop-color="#6a6a6a"/></linearGradient><linearGradient id="linear-gradient-orange" x2="145" y2="48" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6a6a6a"/><stop offset=".52" stop-color="#F8D039"/><stop offset="1" stop-color="#6a6a6a"/></linearGradient><linearGradient id="linear-gradient-5" x1="-743.87" y1="1256.85" x2="-743.87" y2="1257.21" gradientTransform="matrix(3.03 0 0 -6.22 2312.41 7891.56)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#757575"/><stop offset="1" stop-color="#393939"/></linearGradient></defs><g id="EV3"><g id="brick"><path id="ev3_body_2" data-name="ev3 body 2" d="M2.64 0h141a2.47 2.47 0 0 1 2.64 2.25v115.81a2.47 2.47 0 0 1-2.64 2.25h-141A2.47 2.47 0 0 1 0 118.06V2.25A2.47 2.47 0 0 1 2.64 0z" fill="#fff"/><path id="ev3_screenborder" data-name="ev3 screenborder" d="M8.47 1.54h129.31a6.58 6.58 0 0 1 6.58 6.58v72.67a6.6 6.6 0 0 1-6.58 6.6H8.47a6.6 6.6 0 0 1-6.58-6.6V8.12a6.58 6.58 0 0 1 6.58-6.58z" fill="#393939"/><path id="ev3_screen" data-name="ev3 screen" d="M19.06 5.07h106.8a4.6 4.6 0 0 1 4.69 4.52v68.25a4.61 4.61 0 0 1-4.61 4.62H19.06a4.61 4.61 0 0 1-4.61-4.62V9.68a4.6 4.6 0 0 1 4.61-4.61z" fill="#97b5a6"/></g><g id="buttons"><path id="btn_grey" data-name="btn grey" d="M68.9 119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13h-2.13a5.13 5.13 0 1 1-.35-10.25h2.47v-1.13l8.76-8.94h8.75c3.94 4 8.74 8.75 8.74 8.75v1.32h2a5.13 5.13 0 0 1 .35 10.25H86.3v1.13c-4.66 4.79-8.68 8.84-8.68 8.84z" fill="#6a6a6a"/><path id="btn_color" data-name="btn color" d="M68.9 119.14c-3.46-3.34-8.84-8.84-8.84-8.84v-1.13h-2.13a5.13 5.13 0 1 1-.35-10.25h2.47v-1.13l8.76-8.94h8.75c3.94 4 8.74 8.75 8.74 8.75v1.32h2a5.13 5.13 0 0 1 .35 10.25H86.3v1.13c-4.66 4.79-8.68 8.84-8.68 8.84z" fill="url(#linear-gradient-background)"/><path id="btn_left" data-name="btn left" d="M57.85 100.14h6.45v7.62h-6.45a3.81 3.81 0 0 1-3.8-3.81 3.81 3.81 0 0 1 3.8-3.81z" fill="#a8aaa8"/><path id="btn_right" data-name="btn right" d="M88.32 107.76h-6.44v-7.62h6.44a3.81 3.81 0 0 1 3.81 3.8 3.81 3.81 0 0 1-3.81 3.81z" fill="#a8aaa8"/><path id="btn_enter" data-name="btn enter" d="M69.37 100.14h7.44a.29.29 0 0 1 .29.28v7.06a.29.29 0 0 1-.29.28h-7.44a.29.29 0 0 1-.28-.28v-7.06a.29.29 0 0 1 .28-.28z" fill="#393939"/><path id="btn_up" data-name="btn up" d="M69.19 90.26l7.9-.09L83 96.28l-2.44 2.44v4.42h-2.25v-2.55a1.86 1.86 0 0 0-1.86-1.86h-6.87a1.54 1.54 0 0 0-1.6 1.46v3H65.7v-4.47l-2.44-2.49z" fill="#a8aaa8"/><path id="btn_down" data-name="btn down" d="M77.05 117.65l-7.85.06-5.94-6.1 2.48-2.43v-4.44H68v2.54a1.9 1.9 0 0 0 1.86 1.9h6.82a1.62 1.62 0 0 0 1.65-1.58v-2.86h2.27v4.44l2.4 2.43z" fill="#a8aaa8"/></g></g></svg>`;
|
||||
}
|
||||
|
@ -388,7 +388,8 @@ namespace pxsim.visuals {
|
||||
})
|
||||
}
|
||||
// Kill the brick
|
||||
this.layoutView.getBrick().kill();
|
||||
this.layoutView.getPortraitBrick().kill();
|
||||
this.layoutView.getLandscapeBrick().kill();
|
||||
|
||||
// Save previous inputs for the next cycle
|
||||
EV3View.previousSelectedInputs = ev3board().getInputNodes().map((node, index) => (this.getDisplayViewForNode(node.id, index).getSelected()) ? node.id : -1)
|
||||
@ -474,7 +475,8 @@ namespace pxsim.visuals {
|
||||
|
||||
const brickNode = ev3board().getBrickNode();
|
||||
if (brickNode.didChange()) {
|
||||
this.getDisplayViewForNode(brickNode.id, -1).updateState();
|
||||
this.layoutView.getPortraitBrick().updateState();
|
||||
this.layoutView.getLandscapeBrick().updateState();
|
||||
}
|
||||
|
||||
const outputNodes = ev3board().getMotors();
|
||||
|
@ -54,7 +54,8 @@ namespace pxsim.visuals {
|
||||
this.group = svg.elt("g") as SVGGElement;
|
||||
|
||||
let gc = "gradient-color-" + this.getPort();
|
||||
this.colorGradient = svg.linearGradient(globalDefs, gc, false);
|
||||
const prevColorGradient = globalDefs.querySelector(`#${gc}`) as SVGLinearGradientElement;
|
||||
this.colorGradient = prevColorGradient ? prevColorGradient : svg.linearGradient(globalDefs, gc, false);
|
||||
svg.setGradientValue(this.colorGradient, "50%");
|
||||
svg.setGradientColors(this.colorGradient, "black", "yellow");
|
||||
|
||||
@ -99,10 +100,5 @@ namespace pxsim.visuals {
|
||||
|
||||
return this.group;
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
if (this.colorGradient) this.colorGradient.parentElement.removeChild(this.colorGradient);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
@ -15,7 +15,8 @@ namespace pxsim.visuals {
|
||||
getInnerView(parent: SVGSVGElement, globalDefs: SVGDefsElement) {
|
||||
let gid = "gradient-slider-" + this.getPort();
|
||||
this.group = svg.elt("g") as SVGGElement;
|
||||
this.gradient = createGradient(gid, this.getGradientDefinition());
|
||||
const prevGradient = globalDefs.querySelector(`#${gid}`) as SVGLinearGradientElement;
|
||||
this.gradient = prevGradient ? prevGradient : createGradient(gid, this.getGradientDefinition());
|
||||
this.gradient.setAttribute('x1', '0%');
|
||||
this.gradient.setAttribute('y1', '0%');
|
||||
this.gradient.setAttribute('x2', '0%');
|
||||
@ -74,11 +75,6 @@ namespace pxsim.visuals {
|
||||
return this.group;
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
if (this.gradient) this.gradient.parentElement.removeChild(this.gradient);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
getInnerHeight() {
|
||||
return 192;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ namespace pxsim.visuals {
|
||||
this.brick.setSelected(false);
|
||||
this.brickLandscape.setSelected(true);
|
||||
this.brickLandscape.setVisible(false);
|
||||
this.position();
|
||||
this.position();
|
||||
}
|
||||
|
||||
public isBrickLandscape() {
|
||||
@ -86,7 +86,15 @@ namespace pxsim.visuals {
|
||||
}
|
||||
|
||||
public getBrick() {
|
||||
return this.brickInLandscape ? this.brickLandscape : this.brick;
|
||||
return this.brickInLandscape ? this.getLandscapeBrick() : this.getPortraitBrick();
|
||||
}
|
||||
|
||||
public getPortraitBrick() {
|
||||
return this.brick;
|
||||
}
|
||||
|
||||
public getLandscapeBrick() {
|
||||
return this.brickLandscape;
|
||||
}
|
||||
|
||||
public unselectBrick() {
|
||||
|
@ -18,7 +18,6 @@ namespace pxsim.visuals {
|
||||
if (!motorState) return;
|
||||
const speed = motorState.getSpeed();
|
||||
|
||||
if (!speed) return;
|
||||
this.setMotorAngle(motorState.getAngle() % 360);
|
||||
this.setMotorLabel(speed);
|
||||
}
|
||||
@ -42,13 +41,8 @@ namespace pxsim.visuals {
|
||||
this.motorLabelGroup = pxsim.svg.child(this.content, "g") as SVGGElement;
|
||||
this.motorLabel = pxsim.svg.child(this.motorLabelGroup, "text", { 'text-anchor': 'middle', 'x': '0', 'y': '0', 'class': 'sim-text number inverted' }) as SVGTextElement;
|
||||
}
|
||||
// If Motor speed is not 0
|
||||
if (this.currentLabel) {
|
||||
this.motorLabel.textContent = `${this.currentLabel}%`;
|
||||
this.positionMotorLabel();
|
||||
} else {
|
||||
this.motorLabel.textContent = ``;
|
||||
}
|
||||
this.motorLabel.textContent = `${this.currentLabel}%`;
|
||||
this.positionMotorLabel();
|
||||
}
|
||||
|
||||
protected abstract positionMotorLabel(): void;
|
||||
|
@ -15,6 +15,6 @@
|
||||
"Maker": "maker"
|
||||
},
|
||||
"electronManifest": {
|
||||
"latest": "v0.1.17"
|
||||
"latest": "v0.1.19"
|
||||
}
|
||||
}
|
||||
|