Skip to content

Conversation

@atburghardt
Copy link
Contributor

Pin-Button is displayed when production-line is selected.
When clicked, all blocks are added to the pin-gui.

@atburghardt atburghardt changed the base branch from master to dev February 17, 2023 10:15
local model, block, recipe = self:getParameterObjects()

if block == nil then return end
if block == nil and (event.item3 ~= nil and event.item3:find("^block_")) then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please explain to me what this is doing and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is no Block given, the pin function could be called from production line view. It checks if that pin-button contained information in item3 about the needed information to find the correct production line.

Would need to debug now, to see what exactly is saved in blocks. Can do that on Monday. Should have added comments, I guess it's because I added block _id's to the buttons. There was a good reason why I did that, just can't remember now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the pin-panel is opened without a block selected, but with the whole production line the block will always be nil.
So when for example using the pipet function, the block needs to be set. Item3 holds the block id which I double check, because when opening the pin-panel, block needs to be nil and item3 has a different string (if i remember correctly)

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.

2 participants