Regarding pressure plates, they're possible. Close a door blocking access to respective plates while the wrong fluid is being pumped. Open a door to drain pressure plate while this is occurring. Don't set it to 2/7; set it to 3/7, you'll have better luck.
Perhaps... however, I am getting quickly convinced that I was wrong... pressure plates for this setup, at least in the manner that I was thinking of using them (to detect when water/magma had spread entirely across the bridge), are probably the wrong way to go... even with your workaround, there is a bit of micromanagement involved in simply keeping them from deconstructing on every cycle.
I have to agree with Reelyanoob that it is probably better to do the math first, and dump exactly enough for one spread... doing a small amount of work here before setup would eliminate a LOT of work after setup.
I will take your advice on 3/7, though... especially given that this would probably be best setup on aquifier/volcano setup, there is really no solid reason to be a conservationist, and it would probably eliminate a lot of false starts and empty pockets.
AND outputting to a bridge is mediated through a memory cell-- through another pump. You build one more of those pumps that only works when all pressure plates are simultaneously active and link it to a pump that moves water onto a single tile containing a triggers on>x pressure plate. Link that pressure plate to the bridge. If at any time your AND is true, your pump begins working, and moves water onto your pressure plate. About 100 ticks later, your bridge opens. Of course, you need to drain the memory cell afterwards to re-close the bridge. If this idea of memory (tiles that either contain or don't contain water) is new to you, experiment with it until you understand everything it can do: I think it's really at the heart of good logic design.
The concept is not entirely new, but also not entirely familiar. I had never thought of using the presence of water as a boolean before. I had (imagine this) been treating it like a float. Rather than [water] and [no_water], I had been thinking in terms of how full the square was [0...7]... but it is looking about as reliable as trying to compare floats in programming... random evaporation, and unstable flow characteristics.
It would probably be better to simply have one of your memory cells... but to leave the water in it until I was ready for the bridge to close (or, if I can work it into the timing schematic, 100 ticks BEFORE I am ready to trigger the bridges again). I really do wish, however, that there was a good method of triggering without a 100 tick delay OR an off signal at all. I would far prefer having to use two pressure plates (one to close, the other to open) than having an automatic 100 tick toggle switch. At least with two separate plates, I could time it far more accurately and simply.
2-step repeater at http://df.magmawiki.com/index.php/User:MrFake/TwoStepAlternatingRepeater gives you a process to create a 200 tick delay. Longer delays can be created easily, if that's what you need. Power the repeater when you want the delay to begin; unpower it by feedback.
Wonderful... that is exactly the type of thing that I was looking for.
Even better, this would solve the problem I have had regarding switching from the water side to the magma side...
However, given that I have multiple steps, I may actually build an n-step repeater instead... realistically, I could chain them together like a nested loop... thus:
While (System is active)
{
while (currentFluid is active)
{
Close Bridges
Open Floodgates
Programmed Delay
Close Floodgates
Open Bridges
}
currentFluid != currentFluid; // assuming boolean (water/magma)
}
Again... one of the issues that I am seeing repeatedly is the 100 tick 'OFF' signal that the pressure plates create.
In a basic setup where you want something triggered on and off repeatedly, this would not be an issue... but it would be nice to simply have a single 'ON' signal for a setup like this; where the timing depend on which fluid is active, and there are multiple steps in a continuing sequence... in such a case, stray 'OFF' signals are a nuisance.
I am thinking, if I am using two separate loops for water and magma, due to the timing being different between the fluids, then I could simply have chambers that flood to time rather than passing around a single block of water.... this way, the pressure plate would not de-trigger at all (as they are still covered) until their cycle is completed, and the water is evacuated from them (although it might be easier to simply dump it to a temporary chamber which is continuously being evacuated.... that would probably make for more agile timing). By that time, I would have that side detached from the mechanism (through a gear), so the 100 tick signal would fall on deaf ears.
This leads to a question, then...
Does anyone have any idea how many ticks it takes a pump to fill a single 7/7 tile? I am thinking of timing like this:
%> %> %>
XX __XX __XX
XX XXXX XXXX
XXXXXXXXX XXXX
XXXXXXXXXXXXXXXX
In such a case, the yellow would fill the pool beneath it, which, when full would trigger the red. Red has a deeper pool to fill, and would take longer, then finally trigger the blue.
The above is only for illustration... I understand doing it exactly as above would lead to issues (such the red plate repeatedly triggering/untriggering as blue pulled water off of the plate).... those issues are handleable, and were drawn as above only for simplicity of typing.
- Rather... how many ticks does water take to fill a tile like that?
A related by slightly separate question would be: How long would it take to dump a tile? Assuming gravity dropping water directly through an open hatch, how would one compute the ticks required to drain a room?
How about flow time? For example, water continuously pumped down a 1 tile channel would travel how fast? How do flow characteristics change on an open floor?
Has anyone already done that work? If so, is there a link?
Many of the designs hat I have seen seem to imply that water is immediately transferred in 7/7 chunks from one side of the pump to the other. In such a case, the above design would be an extremely rapid timer.
This would be quite usable, however, if you chained small sets of timers together, you could, in effect, time any number of ticks you wished. Timer 1 takes 10 ticks, for example, then dumps its water (for sake of illustration, here, assume instant drainage... real numbers may vary), triggers timer 2, and starts again... timer 2 also takes 10 ticks, but since it is only triggered once every 10 ticks, it finally triggers on tick 100. You could, in effect, build a dwarven clock, so you could tell the number of ticks that had elapsed in a season, for example...
for (i = 0; i < 10; i++) // pump 1
{
for (n = 0; n <10; n++) //pump 2
{
}
}
Memory. Learn it, use it, love it. Separate machine components, activated or deactivated by the state of a memory cell.
OK. Will do... That makes a lot of sense.
No, once again, the way to do it is memory. After each iteration, z_complete:=z_complete+1. While z_complete<5, make obsidian.
The memory that I would use for this would actually be ring of ten pumps. Water in one cell indicates z_level 0, pour magma; water in the next, z_level 0, pour water; water in the next, z_level 1, pour magma-- etc. The final cell contains a pressure plate that stops the process (or more likely, each of the preceding cells contains a pressure plate that allows the process).
Gotcha. I can see that working.
Thinking about nested cycles, however...
while (cycleComplete < 5)
{
activate water side
water:
{
deactivate magma side
close brides
open floodgates
wait waterDelay ticks
close floodgates
open bridges
activate magma side
}
magma:
{
deactivate water side
close bridges
open floodgates
wait magmaDelay ticks
close floodgates
open bridges
mark cycleComplete + 1
}
}
I was afraid that I would have to create a separate complete set of mechanisms for each cycle, and have the system continuously go through them, stopping at the end.
Your method is much simpler... I, honestly, hadn't thought of mechanics in the same way that I think of programming... much is the pity. Functionally, I could simply have the system fill one cell with water on the completion of each cycle, then, using the AND gate from earlier, have it kill the process, and empty the 'buckets' after they are all filled.
If it starts via gear, one throw is enough.
Yeah, I had been realizing that using a lever to initialize the process was using the wrong tool for the job. I had been thinking of using a plate, but you are correct... a gear would be far easier, as I wouldn't have to deal with yet ANOTHER 100 tick delay.
The pressure plate always sends both an on and an off. The only thing the lever does is get a dwarf to run across it. That works even if the process is begun via bridge, floodgate, whatever.
That, however, is really my problem with it... starting the system, then 100 ticks later, getting a second signal could throw a bit of a wrench into it. A gear seems a far easier solution to the issue.
Or better, using separate loops for water and magma, you simply detach the pressure plate from the rest of the works before it sends its off. Then you don't have to screw with it at all.
Here's pseudocode involving memory:
Begin started by writing true to pump_magma memory
Pump magma from activation of pump_magma memory
Wait until adequate magma on peripheral pressure plate
Write false to pump_magma from peripheral magma plate; this stops magma pump in 100 ticks
Begin 200 tick delay from magma activation that outputs by writing to bridge_drop memory and new delay circuit:
Set bridge_drop = 1 (ie write true to bridge_drop from activation of magma plate; memory outputs to bridges)
Set bridge_drop = 0 (just drain bridge_drop memory, can have a pump activated by the presence of water in bridge_drop for this purpose, timing's not important)
Begin new 200 tick delay that outputs by writing to
Set pump_water = true from delay output, this activates water pumps
...just like for magma, even using same memory, except we're triggering changes with a different pressure plate...
Increment z_count (best way to do this is with a five-value memory cell; intermediary steps with alternating pumps is easiest way I know to build this)
Each of the first five (full) steps of z-count writes true to pump_magma
Last step of z-count incremented to 0 step of z_count by lever or pressure plate; this is how you wait for your miners and haulers. (0-step writes true to pump_mamga, which begins process all over again.)
Again... I am ashamed.
I had been thinking of mechanics the way I think of working on my car.
It is far more elegant to think of mechanics the way I think of programming an application. Had that been my approach walking in, I do not believe many of these questions would have been asked.
I think getting a basic schematic done will be my goal of the day.