Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickpi useless blocks #76

Open
wants to merge 2,278 commits into
base: master
Choose a base branch
from
Open

Quickpi useless blocks #76

wants to merge 2,278 commits into from

Conversation

NicolasWent
Copy link
Collaborator

This pull request aim is to remove blocks that can't be used:

A block "that can't be used", is a block that the sensor for it has been deleted. For example if you remove all the leds, then all the blocks that use led are deleted (in blockly and python).

We also needed to handle the case when the block is already in use in user's code. In that case:

In python

In python it was already handled: it says an error during execution saying that the function does not exists.

In blockly

In blockly, there is a message saying that the highlighted block is not allowed at the start of the execution.

This pull request also modify the message during the deletion of a sensor to say to the user that he has to remove all functions that use this sensor in his code.

mobydimk and others added 30 commits September 29, 2020 02:20
[QuickPi][Fr] Changed french block of fill
Copy link
Contributor

@mblockelet mblockelet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good changes, I just made a few comments which are mostly about making the code more generic (some parts are too specific to quick-pi) and also slightly simpler.

pemFioi/quickAlgo/i18n.js Outdated Show resolved Hide resolved
pemFioi/quickAlgo/subtask.js Outdated Show resolved Hide resolved
pemFioi/quickAlgo/subtask.js Outdated Show resolved Hide resolved
pemFioi/quickpi/blocklyQuickPi_lib.js Outdated Show resolved Hide resolved
@@ -1617,116 +1617,120 @@ var getContext = function (display, infos, curLevel) {
// Some data can be made accessible by the library through the context object
context.quickpi = {};

// we put that outside of the function #context.getConceptList because that is our only way to know the which sensor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you took the list out ; you could just call context.getConceptList();.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I done this to prevent calls to getConceptList because I just need the fields that I have put outside.

pemFioi/quickpi/blocklyQuickPi_lib.js Outdated Show resolved Hide resolved
pemFioi/quickAlgo/blockly_interface.js Outdated Show resolved Hide resolved
pemFioi/quickAlgo/blockly_blocks.js Outdated Show resolved Hide resolved
Copy link
Contributor

@mblockelet mblockelet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants