Idea

Sebastian Hemmann avatar image
4 Likes"
Sebastian Hemmann suggested Jordan Johnson commented

Edit Mode for Conveyor Module

Hi, since the Conveyors in the Conveyor Module are able to do a lot of stuff only by dragging around (e.g. connect to other Conveyors, change size) it happens very often that connections (Transfers) are created or droped away accidentally while working on a model.

Normally we are just creating the layout of the conveyor system and after this we implement the logic (e.g. Photo Eyes, Decision Points, Connections).

So I think it would be helpful to have a "switch" to turn on/ off the edit mode of the Conveyors. So if the edit mode is turned off, the layout can´t be changed (accidentally). Nevertheless adding Photoeyes or Decision Points could be allowed in the turned off edit mode.

conveyordecision pointsphoto eyes
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Comment

·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson commented

You can make a button on your toolbar that acts like a switch, disabling layout changes:

int mode = -1;
forobjecttreeunder(model()) {
	if (isclasstype(a, "Conveyor::Conveyor")) {
		if (mode == -1) {
			mode = !switch_protected(a, -1);
		}		
		switch_protected(a, mode);
	}
}

When I did this, I was still able to add and edit decision points and photo eyes, even when I couldn't move the conveyors.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

Hi @jordan.johnson, thanks for this information.

Could you please add further information about:

  1. How to turn it off again?
  2. How to add a button to our toolbar?
0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Sebastian Hemmann commented ·

This code just switches the toggle. It checks the protected flag on the first conveyor it finds, and then sets it to the opposite. That way, you can just click the button again to turn it off.

To add it to the toolbar, go to Global Preferences, to the Customize Toolbar tab, add a new button, and put this code in the code for that button.

1 Like 1 ·

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.