Myomers (: PoweredSubsystem) -- locomotion muscle: seek-voltage drive table (scaled by the generator's rated voltage via ResolveVoltageSource), efficiency + heat-range members; MyomersSimulation staged. Condenser (: HeatSink) -- active refrigeration in a coolant loop; valveState/refrigerationFactor/condenserNumber. Both ctors chain their parents + init from resource; statics/dtor/test real. Heat/power subsystem family now COMPLETE (11 classes): MechSubsystem, HeatableSubsystem, HeatSink, PoweredSubsystem, Generator, Condenser, Sensor, Myomers, HeatWatcher, PowerWatcher, Gyroscope, HUD, Torso. BT: 31 ok. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
86 lines
2.5 KiB
C++
86 lines
2.5 KiB
C++
//===========================================================================//
|
|
// File: myomers.hpp //
|
|
// Project: BattleTech Brick: Mech subsystems //
|
|
// Contents: Myomers -- the artificial-muscle (locomotion power) subsystem //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#if !defined(MYOMERS_HPP)
|
|
# define MYOMERS_HPP
|
|
|
|
# if !defined(POWERSUB_HPP)
|
|
# include <powersub.hpp>
|
|
# endif
|
|
|
|
//##################### Forward Class Declarations #######################
|
|
class Mech;
|
|
|
|
//###########################################################################
|
|
//#################### Myomers Model Resource ##########################
|
|
//###########################################################################
|
|
|
|
struct Myomers__SubsystemResource:
|
|
public PoweredSubsystem::SubsystemResource
|
|
{
|
|
Scalar velocityEfficiency;
|
|
Scalar accelerationEfficiency;
|
|
Scalar seekVoltage[5];
|
|
int seekVoltageRecommendedIndex;
|
|
};
|
|
|
|
//###########################################################################
|
|
//############################## Myomers ###############################
|
|
//###########################################################################
|
|
|
|
class Myomers:
|
|
public PoweredSubsystem
|
|
{
|
|
public:
|
|
static Derivation ClassDerivations;
|
|
static SharedData DefaultData;
|
|
|
|
typedef void
|
|
(Myomers::*Performance)(Scalar time_slice);
|
|
void
|
|
SetPerformance(Performance performance)
|
|
{
|
|
Check(this);
|
|
activePerformance = (Simulation::Performance)performance;
|
|
}
|
|
|
|
static Logical
|
|
TestClass(Mech &);
|
|
Logical
|
|
TestInstance() const;
|
|
void
|
|
MyomersSimulation(Scalar time_slice);
|
|
|
|
public:
|
|
typedef Myomers__SubsystemResource SubsystemResource;
|
|
|
|
Myomers(
|
|
Mech *owner,
|
|
int subsystem_ID,
|
|
SubsystemResource *subsystem_resource,
|
|
SharedData &shared_data = DefaultData
|
|
);
|
|
~Myomers();
|
|
|
|
protected:
|
|
Scalar speedEffect;
|
|
int currentSeekVoltageIndex;
|
|
int recommendedSeekVoltageIndex;
|
|
int minSeekVoltageIndex;
|
|
int maxSeekVoltageIndex;
|
|
Scalar seekVoltage[5];
|
|
Scalar heatRange;
|
|
Scalar heatRangeSquared;
|
|
Scalar velocityEfficiency;
|
|
Scalar accelerationEfficiency;
|
|
};
|
|
|
|
#endif
|