Annotated:
One of the challenges with the AAI modpack (Advanced Automotive Industries - programmable vehicles) is limiting the amount of circuit network processing that happens each tick, for UPS' sake. The mod will also only run a limited number of programmable buildings each tick (default: 10) , so if you try to do too much, things can start getting glitchy.
This is my survey station, which handles resource scanning in an efficient way. The local network is wired with green wires only, and expects a trigger input on the red network connected to the central power pole. In this blueprint, the trigger is "white open box zone signal > 1". You can set this off using a clock circuit, push button, or anything else that generates a pulse.
Once triggered, the system will scan each tile that has been marked with a "white open box" (e.g., by using the zone planner) for resources. If it finds something, it will replace it with a coloured solid circle depending on its type, and flash the lamp a colour that matches the resource (unlit in this picture). If it doesn't find anything, the zone marking is removed.
The nixie tubes in the bottom left show the the last four digits of the count of tiles left to scan. You probably shouldn't scan more than 10000 tiles at once anyway.
Here's how it works. Once the trigger pulse has been received, it's sent to the zone scanner in purple. (This isolates the survey station's network from whatever else is going on, so I can use the red wires as a message bus.)
Because the zone scanner is wired into itself, the output signal (which contains a "white open box zone marker" = 1) is sent back into the input. If there was nothing else going on, the zone scanner would get stuck looking at the first "white open box zone marker", but we're going to replace or delete it with the rest of our circuit. Therefore, we will destructively iterate across everything that was painted with the "white open box zone marker".
The output of the zone scanner is fed into the tile scanner, which lets us see what's at the tile we painted. The tile scanner outputs to:
- The deciders to select replacement zone (yellow, top mid)
- The deciders to select lamp colour (orange, bottom mid)
- Arithmetic combinators to extract X/Y values (white, right)
The arithmetic combinators to extract X/Y values are configured thus: compute (X or Y) + 0, output on (X or Y). This means all the other output from the tile scanner is dropped.
The deciders to select replacement zone and the arithmetics to extract X/Y values are all fed into the zone controller, which rewrites the zones. Because every signal we've computed from the tile scanner passes through exactly 1 combinator, they all hit the zone controller at the same time and update the correct tile. If one of the deciders fires a signal, it will replace the zone with a new zone identifying the resource. If none of the deciders fire, then the zone controller will remove any zone present at that location. In either case, our "white open box" zone painting is erased.
The "grey star" signal is provided by AAI Signals, and means "number of thing scanned". It's being read from the zone scanner, so it's the total count of tiles painted with the "white open box" zone. It is sent to the nixie tubes by dividing it by 100 for the left tube, and sending it through unmodified for the right, showing the 4-digit count.