Commit graph

589 commits

Author SHA1 Message Date
Karishma Chadha
86d61a4c20 Emit event tracking when the project's hasCloudData status changes. Cloud var creation now happens regardless of connectivity to the provider. 2018-11-28 15:03:19 -05:00
Paul Kaplan
421aac6340 Ensure setCompatibilityMode continues to restart if previously started.
This was previous behavior, but the previous commit which prevents restarts based on _steppingInterval truthiness broke it because clearInterval does not modify the value of _steppingInterval
2018-11-28 08:47:51 -05:00
Paul Kaplan
4378603d36 Prevent the runtime from spawning new stepping intervals 2018-11-28 08:34:22 -05:00
Paul Kaplan
ffb02c607d
Merge pull request #1783 from paulkaplan/emit-start-event
Emit a RUNTIME_STARTED event to track if the vm has been started
2018-11-27 16:38:27 -05:00
Paul Kaplan
cc4751228e Emit a RUNTIME_STARTED event to track if the vm has been started 2018-11-27 11:37:01 -05:00
Ray Schamp
dd2023e2f3
Merge pull request #1779 from rschamp/project-dirty-signal
Add "project changed" event
2018-11-27 08:54:30 -05:00
Ray Schamp
5022227c15 Add "project changed" event
And emit it whenever we think the project has changed. Try to not emit it when a change has happened internally that shouldn't affect the serialized project.

This iteration fires the event too frequently, e.g., when switching sprites. This is meant as a simple initial implementation that can be improved.
2018-11-26 17:10:43 -05:00
Karishma Chadha
63c4b53b09
Replace reference to deleted variable with specific variable info needed. 2018-11-21 11:45:16 -05:00
Karishma Chadha
25ce08131a Add rename and delete functionality for cloud variables. Refactor function name for cloud variable creation API. 2018-11-20 15:11:12 -05:00
Karishma Chadha
0c9da5d963
Merge pull request #1755 from kchadha/cloud-var-create
Create cloud variables
2018-11-14 21:39:29 -05:00
Paul Kaplan
8aa88fa2a2
Merge pull request #1723 from mzgoddard/blocks-monitored-cache
Cache the set of actively monitored blocks
2018-11-14 14:16:36 -05:00
Karishma Chadha
3fc1b89b30 Add ability to create cloud variables, and have cloud provider wait for confirmation from server. 2018-11-13 16:43:51 -05:00
Karishma Chadha
14bee14d8c Update extensions to load when deserializing monitors. This is necessary when the monitor is the only part of the project that uses the extension. Update extension monitor color category. 2018-11-09 23:45:49 -05:00
Karishma Chadha
1b9b3ac909 Revert changes that were made to leverage the monitor blocks getting created when the toolbox is loaded. This approach does not work when viewing the project detached from scratch-blocks (e.g. player mode). 2018-11-09 23:45:48 -05:00
Karishma Chadha
ebdd548c8f Update for auto-positioning monitors so that having just one of x or y be 0 (e.g. a monitor placed in the top right corner of the stage) does not result in the monitor being treated as a new monitor and get auto-positioned. 2018-11-09 23:45:48 -05:00
Karishma Chadha
1a4f0a75f2 Serialize and deserialize monitors. Obtain monitor block information from runtime. Fix issue where stage monitors weren't getting loaded correctly. 2018-11-09 23:45:48 -05:00
Karishma Chadha
7ea310a194 Fix typo in comment 2018-11-08 14:43:07 -05:00
Karishma Chadha
5db3db3a92 monitor id getter should use block fields instead of a list of strings 2018-11-08 01:33:26 -05:00
Karishma Chadha
0e7eae98d5 Separate out monitors for blocks reporter blocks that have parameters. 2018-11-08 00:37:28 -05:00
Karishma Chadha
4bb2d19584
Merge pull request #1683 from mzgoddard/sequencer-thread-cleanup
Sequencer thread cleanup
2018-11-07 17:15:11 -05:00
Eric Rosenbaum
2cff4159bb
Use the new note picker field in music and EV3 extensions (#1720)
* Add note field type

* Note picker in music extension plays notes

* Use note picker in EV3 beep block
2018-11-07 11:50:15 -05:00
Michael "Z" Goddard
a3f9aa1e22
cache the set of actively monitored blocks
Projects can have 100's of potentially monitored blocks. Caching the
set of monitored blocks can save time in Runtime._step every frame.
2018-11-02 15:24:05 -04:00
Paul Kaplan
596d0c4f5f Include the origin blockId of the top block being dragged.
This is required by the GUI in order to take a snapshot of the blocks for the backpack. Only the ID is needed, the rest can be done by the GUI.
2018-11-01 14:13:07 -04:00
Karishma Chadha
ffef2e92fc Fix up docs and incorrect initialization of cloud data manager functions. Add 'spec' unit tests that the cloud data manager functions are actually functions. 2018-10-31 19:20:13 -04:00
Michael "Z" Goddard
2ffa8eb333
update runtime thread tests
Threads are now removed after every "inner" step. Any thread that
reaches its DONE conditions is immediately removed instead of requiring
an extra step to remove it. As such tests that check the number of
threads have been updated to consider this.
2018-10-31 17:56:12 -04:00
Karishma Chadha
1df6743a5f Refactor cloud data manager to break out cloud data limit check vs. limit update. 2018-10-31 13:40:05 -04:00
Karishma Chadha
848deaff30 Track whether a project has cloud data and enforce a cloud data limit on projects being loaded into the runtime. 2018-10-30 18:53:57 -04:00
Katie Broida
6ef600dc2c
Add runtime event for when the project is loaded (#1669) 2018-10-30 15:26:22 -04:00
Karishma Chadha
4959ab9ff3 Create a new cloud io device 2018-10-29 00:58:30 -04:00
Michael "Z" Goddard
fcafcbdd0a
return 0 from parameters outside of their procedure 2018-10-23 15:14:31 -04:00
Michael "Z" Goddard
ef4045aaf1
Merge pull request #1642 from mzgoddard/set-procedure-param-defaults
Set procedure param defaults
2018-10-23 15:13:16 -04:00
Michael "Z" Goddard
b833ef8d24
remove finished threads every loop of all threads
When all threads are looped, finished threads must be removed so
threads that are waiting for those to complete and be removed may
continue executing. This effects broadcast and wait for example. The
threads created by broadcast and wait can finish in the same tick and
must be removed from the list of threads so that broadcast and wait
knows to stop waiting.
2018-10-19 16:43:36 -04:00
DD
91e2f3a935 Revert 1643 Confirm extension in use in sb2 serialization 2018-10-18 11:06:13 -04:00
Evelyn Eastmond
2564b24d71 Differentiate peripheral errors: request vs. disconnect (#1654)
* Beginning to add differentiation for hardware disconnect alerts.

* Set connected status after error is sent.
2018-10-17 15:48:07 -04:00
Katie Broida
899ce56214
Confirm extension in use in sb2 serialization (#1643)
Add a check when serializing sb2 projects to see whether an extension is actually in use in a block or a visible monitor.
2018-10-17 10:49:08 -04:00
Michael "Z" Goddard
2b257dde57
add getProcedureParamNamesIdsAndDefaults
Use getProcedureParamNamesIdsAndDefaults to get the defaults along with
names and ids so defaults may be set for a procedure call if the
parameter is not provided.
2018-10-16 16:31:45 -04:00
Andrew Sliwinski
23f6346045
Merge pull request #1631 from mzgoddard/stop-other-asks
Stop other asks
2018-10-15 13:16:49 -04:00
Michael "Z" Goddard
56ec22df77
add Runtime.executableTargets
executableTargets is a list of the targets in the reverse order of
their execution. This order matches the draw list's order in the
renderer.
2018-10-04 00:42:05 -04:00
Michael "Z" Goddard
574749bbba
add STOP_FOR_TARGET runtime event and respond for ask blocks
Remove questions for targets that are individually stopping and
progress the asked question if it is from a stopping target.
2018-10-03 10:38:14 -04:00
Eric Rosenbaum
f5edcfa3bb Update event name to MIC_LISTENING 2018-09-20 12:06:31 -04:00
Eric Rosenbaum
e44eff48e3 Add mic indicator update event for speech2text 2018-09-18 10:58:49 -04:00
Chris Willis-Ford
8977ce1e93
Merge pull request #1565 from cwillisf/extension-monitors
Extension monitors
2018-09-12 18:10:12 -04:00
Christopher Willis-Ford
346e1383ed Split extended opcode with splitFirst instead of split 2018-09-12 17:02:18 -04:00
Evelyn Eastmond
ec432e3b2f Refactor for hardware extensions (#1555)
* Beginning refactor: renaming 'device' to 'peripheral', shortening function names, reordering functions, etc.

* Continuing refactoring: renaming some functions to be more verbose in the runtime, adding JSDocs, etc.

* Changing 'device' to 'peripheral', etc.

* Changing 'session' to 'socket'.

* Fixing EV3 menus and menu arg validation, reordering functions, etc.

* Add _send, add some references to documentation, etc.

* Factored out _outputCommand and _inputCommand, renamed some enums, etc.

* Fixed _outputCommand, some other minor cleanup.

* Make _outputCommand and _inputCommand public.

* Added TODO.

* Renamed BLE UUID enums to be clearer.

* Change WeDo2 in comments to WeDo 2.0, etc.

* Changed some WeDo2Motor command names, cleaned up some JSDocs.

* Beginning a major EV3 refactor.

* WeDo2 formatting and comment changes.

* Motor refactoring in EV3: motorTurnClockwise and motorTurnCounterClockwise initial working state.

* Add reminders to possibly cast motor menu args in WeDo2.

* Continue to move motor commands in EV3 to EV3Motor class, don't create new EV3Motor on every poll cycle, etc.

* Factoring EV3 polling value commands, etc.

* Fixing EV3 motor power, position and button pressed, and some commenting, etc.

* Move EV3 motor position parsing to EV3Motor class, move directCommand and directCompoundCommand functions, some commenting, etc.

* Changed WeDo2 motor label enum name.

* Removed some EV3 motor functions that aren't needed, changed menu label enum names, moved some opcodes up to enums.

* Fixing comments and documentation.

* Some commenting.

* Adding further documentation and references to PDFs, changed reply check to be safer, etc.

* Some comment changes.

* Moving some functions around in EV3 and WeDo2 to match.

* Commenting, etc.

* Some renaming of session, etc.

* Fix stopAllMotors in EV3.

* Fixing clearing of motors in EV3.

* Some comment changes.

* Change runtime .extensions/registerExtension to .peripheralExtensions/registerPeripheralExtension.

* Renaming outputCommand/inputCommand to generateOutputCommand/generateInputCommand, etc.

* Moved motorCommandIDs to EV3Motor class, renamed directCommand to generateCommand, etc.

* Adding a reminder to rename something.

* JSDoc fix in EV3Motor class.

* Fixing microbit function name.

* Adding a todo item.

* Changing Ev3 menu formats to be backwards compatible, moving a BLE function up.

* Fixing EV3 ports again, and button pressed returning a boolean.

* Fixing menu value to be a string in EV3.
2018-09-07 17:01:23 -04:00
Christopher Willis-Ford
8602d5798a Allow extension reporter only if no block args 2018-09-07 12:16:48 -07:00
Christopher Willis-Ford
f5182a231e Add getLabelForOpcode for use by monitors 2018-09-07 12:01:13 -07:00
Christopher Willis-Ford
701fb6c1c5 Enable extension monitors, add flag to disable
Extension reporters now offer a monitor checkbox by default, unless the
`disableMonitor` flag is set in the extension block metadata.
2018-09-07 11:13:13 -07:00
Karishma Chadha
62bf790d8f Fix stack glows so that stacks glow as soon as the first block in the stack starts running as opposed to after the first block has finished. Make sure that monitored reporters in the flyout are not glowing. 2018-08-22 14:44:06 -04:00
Ray Schamp
4b5cf6505a
Merge pull request #1398 from paulkaplan/publish-docs
Publish jsdoc to gh-pages
2018-08-08 16:46:48 -04:00
Karishma Chadha
d91788406c Don't generate new IDs for variables when making a sprite clone. 2018-08-07 16:24:02 -04:00