Wire color based signal input selector (for virtual signals)
Posted: Mon Aug 22, 2016 7:56 pm
And another small suggestion not yet in Circuit network features for 0.14:
Backstory:
Situation: I have a (mod-provided) warehouse, behaving like a chest with many many items. I'd like to use grabbers to remove excess items, using more than x slots. Currently I calculate "EACH - 40k if > 0, else 0", and providing that as filter condition to the inserters. Since some items have different stack sizes, this doesn't work very well, because (in the worst-case-scenario) blueprints might use every single slot. Because of that, I have to define a number of items per item type by hand somewhere.
Current Solution: Place an arithmetic combinator for every single signal type, and subtract the specific fixed value. I don't like this, because it's very time-consuming to reconfigure those combinators, and difficult to find them again, as they currently do not have an item type overlay. Alternativly, I can use the implicit each-addition by adding green values to red values previously multiplied with -1. This won't work anymore, when I want to switch to other logic, like multiplication etc.
Specific suggestion:
Add EACH_RED and EACH_GREEN next to the virtual EACH-Signal, and do the same for EVERY and ANY ("if ANY_RED > 0, pass EVERY_GREEN to the output"). This would allow me to use a constant combinator on the green wire, and define the maximum item count there; then calculating "EACH_RED - EACH_GREEN" in one arithmetic combinator instead of "EACH - FIXED_NUMBER" in many, many arithmetic combinators.
The color selection would only be necessary for "EACH/ANY/EVERY"-Signals; but would triple the amount of virtual signals, not necessarily the best idea if there already are many many items from mods in the list.
Generalized Suggestion:
The current behaviour of implicitly adding the red and the green signal values is useful to build fast and small circuits. When handling many signals, it would be easier to be able to select "red only" or "green only" for input values (and in comparing combinators for the output values taken from corresponding input values) instead of the default "red+green" for every type of signal, removing the need of renaming signals to different names by using "newtype = oldtype+0" (or "newtype = oldtype*1", etc.) as diodes. (Output signal types would stay the same; passing the output value to all wire colors -- why should i connect a <anycolor> wire, if I don't want the output signal on it?)
Backstory:
Situation: I have a (mod-provided) warehouse, behaving like a chest with many many items. I'd like to use grabbers to remove excess items, using more than x slots. Currently I calculate "EACH - 40k if > 0, else 0", and providing that as filter condition to the inserters. Since some items have different stack sizes, this doesn't work very well, because (in the worst-case-scenario) blueprints might use every single slot. Because of that, I have to define a number of items per item type by hand somewhere.
Current Solution: Place an arithmetic combinator for every single signal type, and subtract the specific fixed value. I don't like this, because it's very time-consuming to reconfigure those combinators, and difficult to find them again, as they currently do not have an item type overlay. Alternativly, I can use the implicit each-addition by adding green values to red values previously multiplied with -1. This won't work anymore, when I want to switch to other logic, like multiplication etc.
Specific suggestion:
Add EACH_RED and EACH_GREEN next to the virtual EACH-Signal, and do the same for EVERY and ANY ("if ANY_RED > 0, pass EVERY_GREEN to the output"). This would allow me to use a constant combinator on the green wire, and define the maximum item count there; then calculating "EACH_RED - EACH_GREEN" in one arithmetic combinator instead of "EACH - FIXED_NUMBER" in many, many arithmetic combinators.
The color selection would only be necessary for "EACH/ANY/EVERY"-Signals; but would triple the amount of virtual signals, not necessarily the best idea if there already are many many items from mods in the list.
Generalized Suggestion:
The current behaviour of implicitly adding the red and the green signal values is useful to build fast and small circuits. When handling many signals, it would be easier to be able to select "red only" or "green only" for input values (and in comparing combinators for the output values taken from corresponding input values) instead of the default "red+green" for every type of signal, removing the need of renaming signals to different names by using "newtype = oldtype+0" (or "newtype = oldtype*1", etc.) as diodes. (Output signal types would stay the same; passing the output value to all wire colors -- why should i connect a <anycolor> wire, if I don't want the output signal on it?)