|
We had some trouble with Block Card 10. Quentin is fixing JP's fix to this item.
|
|
Christina and her friend Cydnie have a talent for producing trees--the forest is growing! |
|
Quentin helped out too. |
|
Here they're drilling the holes for planting. |
|
Quentin rigged up a nozzle for the vacuum cleaner to remove dust without damaging the vegetation. |
|
Finally he simply sprayed the whole area with dilute India ink. |
Quentin also added a feature to the system that causes trains whose speed is brought to 0 to be electronically braked using the freewheeling diode on the block cards. Some locomotives now can stop within an inch when running at full power.
If we showed a picture of the coding process, it would just look like a guy at a computer, but we're showing pictures of our models, so why not show Quentin's work?
Index: tmrc/railserver/picnet/BlockController.java
===================================================================
--- tmrc/railserver/picnet/BlockController.java (revision 333)
+++ tmrc/railserver/picnet/BlockController.java (revision 335)
@@ -5,6 +5,7 @@
public class BlockController extends CardController implements EventReceiver
{
Block[] blocks = new Block[8];
+ int oldspeed = 0;
public int getTypeId()
{
@@ -50,9 +51,22 @@
if(cardPos == -1)
return;
+ boolean direction = b.getDirection();
+
+ // E-braking. If the block is at 0 but assigned, invert
+ // the polarity so the freewheeling diode will stop the train more quickly.
+ if ((b.getOwner() != null) && (b.getSpeed() == 0) && (oldspeed != 0)) {
+ direction = !direction;
+
+ // Re-enter after a delay to reverse back
+ Age.installDelayedEvent(new RealEvent("setSpeed", null, b), 500, this, false);
+ }
+
int[] data = new int[] {
cardPos,
- b.getSpeed() & 0x7f | (b.getDirection()?0x80:0x00)};
+ b.getSpeed() & 0x7f | (direction?0x80:0x00)};
+
+ oldspeed = b.getSpeed();
sendPacket(BLOCK_SEND_SPEED, data);
// System.err.println("Setting speed of "+b.card+" "+b.cardPos);