diff --git a/restoration/source410/BT/HEAT.HPP b/restoration/source410/BT/HEAT.HPP index 98c88f64..6a5c4819 100644 --- a/restoration/source410/BT/HEAT.HPP +++ b/restoration/source410/BT/HEAT.HPP @@ -362,6 +362,16 @@ ~HeatSink(); + // + // The cockpit's cooling-loop lamp needs both of these from BT_L4: + // whether this sink has coolant, and which sink it is plumbed to + // (the loop master, whose Condenser number IS the lamp's frame). + // + int + GetCoolantAvailable() const { Check(this); return coolantAvailable; } + Subsystem * + ResolveCoolingMaster() { Check(this); return linkedSinks.Resolve(); } + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Local Data // @@ -484,6 +494,12 @@ void RefrigerationSimulation(Scalar time_slice); + // + // The loop number (1..6) -- the cockpit lamp's image-strip frame. + // + int + GetCondenserNumber() const { Check(this); return condenserNumber; } + protected: int valveState; int condenserNumber; diff --git a/restoration/source410/BT_L4/BTL4GAU2.CPP b/restoration/source410/BT_L4/BTL4GAU2.CPP index 0a40aadb..aa733730 100644 --- a/restoration/source410/BT_L4/BTL4GAU2.CPP +++ b/restoration/source410/BT_L4/BTL4GAU2.CPP @@ -94,6 +94,10 @@ # include #endif +#if !defined(HEAT_HPP) +# include +#endif + #include static const Scalar SeekVoltageXScale = 230.0f; // 0x43660000 @@ -293,6 +297,40 @@ static Scalar // (the per-frame sampler Gauge::Update drives -- GAUGE.CPP:569). //########################################################################### +// +// The cooling-loop lamp's frame: the loop number of the Condenser this +// subsystem's sink is plumbed to, or 0 ("OFF") when it has no coolant, +// no loop master, or a master that is not a Condenser. +// +static int + CoolingLoopFrameOf(void *source) +{ + Subsystem + *subsystem = (Subsystem *)source; + if (subsystem == NULL + || !subsystem->IsDerivedFrom(HeatSink::ClassDerivations)) + { + return 0; + } + + HeatSink + *sink = (HeatSink *)subsystem; + if (sink->GetCoolantAvailable() != 1) + { + return 0; + } + + Subsystem + *master = sink->ResolveCoolingMaster(); + if (master == NULL + || !master->IsDerivedFrom(Condenser::ClassDerivations)) + { + return 0; + } + + return ((Condenser *)master)->GetCondenserNumber(); +} + // // CoolingLoopConnection -- @004c3134 ctor / @004c31a0 sampler (vt 0x518ea8). // The binary: when the source subsystem's coolant loop is available @@ -300,10 +338,12 @@ static Scalar // "HeatSink" link == linkedSinks) and shows its Condenser loop number // (condenserNumber == the image-strip frame); otherwise 0. // -// INERT STUB: HeatSink::coolantAvailable, HeatSink::linkedSinks and -// Condenser::condenserNumber are protected with no published accessor or -// attribute row in source410 (heat.hpp) -- the loop lamp draws frame 0 -// ("OFF") until the heat accessor wave lands. +// LIVE (5.3.36): heat.hpp now publishes GetCoolantAvailable() / +// ResolveCoolingMaster() / GetCondenserNumber(), so the lamp follows the +// binary exactly -- the same shape as PowerSourceConnection below. A sink +// with no coolant, no loop master, or a master that is not a Condenser +// reads frame 0 ("OFF"), which is what the box showed for every panel +// while this was stubbed. // class CoolingLoopConnection : public GaugeConnection { @@ -315,7 +355,7 @@ public: {} void Update() // @004c31a0 { - *destination = 0; + *destination = CoolingLoopFrameOf(source); } protected: void *source; // @0x10 this[4]