Gauges: convert generator-voltage bar to named-member bridge
The eng-page generator-voltage bar (evolt.pcc, ScalarBarGauge @004c721c) and the MyomerCluster seek-voltage graph were fed by GeneratorVoltageConnection, which walked the same dead path as the generator-letter lamp: ResolveLink(AttributePointerOf(subsystem,"InputVoltage")) -> read resolved +0x1DC == Generator::outputVoltage. The BT_DEV_GAUGES audio attribute rows shifted the chained attribute ids so AttributePointerOf no longer lands on voltageSource@0x1D0 -> the bar always read 0. New BTGeneratorVoltage(subsystem) bridge (powersub.cpp) reads the NAMED member via PoweredSubsystem::ResolveVoltageSource()->Generator::MeasuredVoltage() (outputVoltage@0x1DC), bypassing the attribute table -- same pattern as BTPowerSourceFrame/BTCoolingLoopFrame. Both GeneratorVoltageConnection callers (the ScalarBarGauge param + the MyomerCluster seekValue) now pass subsystem_in. [voltfeed]-verified: Myomers -> 10000V from GeneratorD (was 0 on the dead path). Both pod + glass builds clean. Eng-page render awaiting live playtest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8c7ff639de
commit
f2eaf3d0ac
@@ -716,6 +716,44 @@ int BTPowerSourceFrame(void *subsystem_v)
|
||||
return frame;
|
||||
}
|
||||
|
||||
//
|
||||
// BTGeneratorVoltage -- complete-type bridge for the GeneratorVoltageConnection
|
||||
// (@004c3288), which drives the eng-page generator-voltage bar (evolt.pcc,
|
||||
// ScalarBarGauge @004c721c) and the MyomerCluster seek-voltage graph. The
|
||||
// binary resolved the subsystem's InputVoltage link and read resolved+0x1DC ==
|
||||
// Generator::outputVoltage (0..12000, == MeasuredVoltage()). Same databinding
|
||||
// trap as BTPowerSourceFrame: the port's ResolveLink(AttributePointerOf(...,
|
||||
// "InputVoltage")) path is dead after the BT_DEV_GAUGES audio attribute rows
|
||||
// shifted the chained ids, so the bar read 0. This reads the NAMED member via
|
||||
// PoweredSubsystem::ResolveVoltageSource(), bypassing the attribute table.
|
||||
//
|
||||
Scalar BTGeneratorVoltage(void *subsystem_v)
|
||||
{
|
||||
static int s_log = -1;
|
||||
if (s_log < 0) s_log = getenv("BT_LOOP_LOG") ? 1 : 0;
|
||||
static int s_n = 0;
|
||||
int trace = s_log && (s_n++ < 40);
|
||||
|
||||
Subsystem *sub = (Subsystem *)subsystem_v;
|
||||
if (sub == 0 || !sub->IsDerivedFrom(*PoweredSubsystem::GetClassDerivations()))
|
||||
{
|
||||
if (trace) DEBUG_STREAM << "[voltfeed] " << (sub ? sub->GetName() : "(null)")
|
||||
<< " -> 0 (not a PoweredSubsystem)\n" << std::flush;
|
||||
return 0.0f;
|
||||
}
|
||||
Generator *gen = (Generator *)((PoweredSubsystem *)sub)->ResolveVoltageSource();
|
||||
if (gen == 0 || gen->GetClassID() != RegisteredClass::GeneratorClassID)
|
||||
{
|
||||
if (trace) DEBUG_STREAM << "[voltfeed] " << sub->GetName()
|
||||
<< " -> 0 (no Generator)\n" << std::flush;
|
||||
return 0.0f;
|
||||
}
|
||||
Scalar volts = gen->MeasuredVoltage(); // outputVoltage @0x1DC
|
||||
if (trace) DEBUG_STREAM << "[voltfeed] " << sub->GetName() << " -> " << volts
|
||||
<< "V (generator '" << gen->GetName() << "')\n" << std::flush;
|
||||
return volts;
|
||||
}
|
||||
|
||||
|
||||
//#############################################################################
|
||||
// Voltage-source linkage helpers
|
||||
|
||||
Reference in New Issue
Block a user