Files
TeslaRel410/restoration/source410/MUNGA/LAMP.HPP
T
CydandClaude Fable 5 6b216d0643 source410: link campaign - entire engine compiles (152/152), first true link,
52-symbol unresolved ledger

build410.sh: merged-engine mass compile + BT TUs + tlib + authentic tlink32.
Engine closure fixes: boxtree/set/l4gauge/filestrm back-dates, lamp<->gaugrend
cycle broken (1995 form), APP.HPP Shutdown default, NetNub include path, DPL
vpx shim, SOS 32-bit lib arbitration (SOSDBXC/SOSMBXC; SOSMW*=16-bit), WATTCP
excluded (16-bit NetNub TSR side). UNRESOLVED-LEDGER.txt = the measured gap to
a linking BTL4OPT.EXE.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 08:46:05 -05:00

185 lines
4.3 KiB
C++

#if !defined(LAMP_HPP)
# define LAMP_HPP
class GaugeRenderer;
# if !defined(GRAPH2D_HPP)
# include <graph2d.hpp>
# endif
# if !defined(MODE_HPP)
# include <mode.hpp>
# endif
# if !defined(SLOT_HPP)
# include <slot.hpp>
# endif
# if !defined(CHAIN_HPP)
# include <chain.hpp>
# endif
class LampManager;
class GraphicLamp;
typedef int LampID;
typedef int LampState;
//#########################################################################
//################################# Lamp ##################################
//#########################################################################
class Lamp : public Node
{
friend class LampManager;
//----------------------------------------------------------------------
// Public methods
//----------------------------------------------------------------------
public:
enum
{
LampStateUndefined = -1,
LampStateOff = 0,
LampStateOn,
NextLampState
};
virtual ~Lamp();
Logical
TestInstance() const;
virtual void
SetState(LampState new_state);
void
SetAlertState(Logical alert_on = True);
LampState
GetState()
{
Check(this);
return previousState;
}
protected:
//----------------------------------------------------------------------
// Protected methods
//----------------------------------------------------------------------
Lamp(
LampID lamp_id,
ModeMask mode_mask,
LampManager *lamp_manager
);
virtual void
Update(Logical force_notify_of_state_change = False);
virtual void
NotifyOfStateChange();
//
//----------------------------------------------------------------------
// Protected data
//----------------------------------------------------------------------
//
LampID
lampID;
ModeMask
modeMask;
LampState
previousState;
LampManager
*manager;
int
alertActive;
};
//#########################################################################
//############################## GraphicLamp ##############################
//#########################################################################
class GraphicLamp :
public Lamp
{
//----------------------------------------------------------------------
// Public methods
//----------------------------------------------------------------------
public:
~GraphicLamp();
Logical
TestInstance() const;
//----------------------------------------------------------------------
// Protected methods
//----------------------------------------------------------------------
protected:
GraphicLamp(
LampID lamp_id,
ModeMask mode_mask,
LampManager *lamp_manager,
GaugeRenderer *renderer,
int graphics_port_number
);
//----------------------------------------------------------------------
// Public data
//----------------------------------------------------------------------
GaugeRenderer
*renderer;
GraphicsView
localView;
};
# if !defined(GAUGREND_HPP)
# include <gaugrend.hpp>
# endif
//############################## LampManager ##############################
// The Lamp Manager belongs to the Gauge Renderer: it is responsible for
// handling specialized 'lamp' objects similar to (but not identical to)
// gauge objects.
//#########################################################################
class LampManager SIGNATURED
{
friend class Lamp;
//----------------------------------------------------------------------
// Public methods
//----------------------------------------------------------------------
public:
virtual ~LampManager();
Logical
TestInstance() const;
virtual void
Update(ModeMask current_mode_mask);
Lamp *
FindLamp(LampID lamp_id, ModeMask mode_mask);
void
RemoveAllLamps();
ModeMask
GetPreviousModeMask()
{
Check(this);
Check_Fpu();
return previousModeMask;
}
//----------------------------------------------------------------------
// Protected methods
//----------------------------------------------------------------------
protected:
LampManager();
void
ActivateLamps(ModeMask bits_became_active);
void
DeactivateLamps(ModeMask bits_became_inactive);
void
AddLamp(Lamp *new_lamp);
void
RemoveLamp(LampID lamp_id, ModeMask mode_mask);
ModeMask
previousModeMask;
ChainOf<Lamp*>
lampList,
activeLampList,
inactiveLampList;
};
#endif