-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: master
Are you sure you want to change the base?
Conversation
Doc adding
[QuickPi][Fr] Changed french block of fill
…s a public function of the context
…ent than their name in documentation)
There was a problem hiding this 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.
@@ -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 |
There was a problem hiding this comment.
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();
.
There was a problem hiding this comment.
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.
This reverts commit 8afadf0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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.