IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Modulefunction that defines a basic thruster. More...
Public Member Functions | |
IMS_ModuleFunction_Thruster (IMS_ModuleFunctionData_Thruster *_data, IMS_Module *_module, bool creategui) | |
virtual void | PostLoad () |
called on SimStart, after LoadState() but before AddFunctionToVessel() More... | |
virtual void | SaveState (FILEHANDLE scn) |
overload to save modulefunction specific stuff to scenario. More... | |
virtual void | AddFunctionToVessel (IMS2 *vessel) |
Everything that needs to be done when the modulefunction is removed from a vessel should be implemented in an overload of this function. More... | |
virtual void | RemoveFunctionFromVessel (IMS2 *vessel) |
Everything that needs to be done when the module is removed from a vessel should be implemented in an overload of this function. More... | |
virtual void | PreStep (double simdt, IMS2 *vessel) |
gets called at every clbkPreStep of the containing vessel. More... | |
virtual GUI_ModuleFunction_Base * | GetGui () |
returns the GUI of this module function, or NULL if this module function doesn't have a user interface. More... | |
virtual void | AddExhaustsToVessel () |
adds all exhausts of the thruster to the vessel | |
virtual void | RemoveExhaustsFromVessel () |
Removes all exhausts of the thruster from the vessel. | |
virtual void | SetThrusterMode (int modeidx) |
sets the thruster mode of the thruster. More... | |
virtual void | SetThrusterGroup (int thrustergroup) |
Sets the thrusters control group. More... | |
IMS_ModuleFunctionData_Thruster * | GetData () |
Public Member Functions inherited from IMS_ModuleFunction_Base | |
IMS_ModuleFunction_Base (IMS_ModuleFunctionData_Base *_data, IMS_Module *_module, FUNCTIONTYPE _type) | |
Constructor. More... | |
void | LoadState (FILEHANDLE scn) |
Sends every scenario line concerning this modulefunction function to processScenarioLine(). More... | |
virtual double | GetMass () |
Returns the current modulefunctions mass. More... | |
IMS_Module * | GetModule () |
Public Member Functions inherited from EventHandler | |
void | ConnectToMyEventGenerator (EventSink *sink, EVENTPIPE pipe) |
connects an EventSink to the EventGenerator of this in the appropriate pipe. More... | |
void | ConnectToMyEventSink (EventSink *sink, EVENTPIPE pipe) |
Connects an EventSink on this to the passed event sink. More... | |
void | ConnectMySinkToYourNode (EventNode *node, EVENTPIPE pipe) |
Connects an EventSink on this to the passed EventNode, no matter whether generator or another sink. More... | |
EVENTHANDLERTYPE | GetEventHandlerType () |
Returns the EVENTHANDLERTYPE of this event handler. | |
UINT | GetUID () |
Returns the globaly unique identifier of this event handler. | |
Protected Member Functions | |
virtual bool | ProcessEvent (Event_Base *e) |
Receives all events coming through this EventHandler. More... | |
vector< THRUSTEREXHAUST > | getRelativeExhausts () |
virtual bool | processScenarioLine (string line) |
receives all scenario lines concerning this modulefunction, one after the other. More... | |
Protected Member Functions inherited from EventHandler | |
EventGenerator * | createEventGenerator (EVENTPIPE pipe) |
Creates a new EventGenerator for this handler instance. More... | |
EventSink * | createEventSink (EVENTPIPE pipe) |
creates a new EventSink in this handler instance More... | |
void | disconnect (EventHandler *handler, bool bidirectional=true) |
Completely severs connections to and from the passed EventHandler, all sinks, all generators. More... | |
void | sendEvents () |
Tells all event generators in this event handler to advance their event cue. More... | |
void | processWaitingQueue () |
processes all events in the waiting queue. More... | |
void | addEvent (Event_Base *_event, EVENTPIPE _pipe=DEFAULT_PIPE) |
Adds an event to the eventcue of an eventpipe. More... | |
void | addEventToWaitingQueue (Event_Base *_event) |
Adds an event to this handlers waiting queue. More... | |
void | relayEvent (Event_Base *_event, EVENTPIPE _pipe) |
Relays an event to another event pipe. More... | |
EventSink * | getEventSink (EVENTPIPE pipe) |
returns the EventSink on this EventHandler that belongs to the passed event pipe More... | |
EventGenerator * | getEventGenerator (EVENTPIPE pipe) |
Returns the EventGenerator on this EventHandler that belongs to the passed event pipe. More... | |
Protected Attributes | |
THRUSTER_HANDLE | thruster = NULL |
int | currentthrustermode = 0 |
The index of the currently active thruster mode. | |
bool | operational = true |
Shows whether the thruster is currentl yoperational or not. | |
int | thrustergroup = -1 |
Contains the THGROUP_TYPE value or -1 if the thruster is not in a group. | |
IMS_PropulsionManager * | propmanager = NULL |
vector< UINT > | exhaust_ids |
Contains the orbiter indices of currently active exhausts for this thruster. | |
Protected Attributes inherited from IMS_ModuleFunction_Base | |
FUNCTIONTYPE | type |
An identifier for the type of this module function. | |
IMS_Module * | module = NULL |
Pointer to the IMS_Module containing this module function. | |
Protected Attributes inherited from EventHandler | |
EVENTPIPE | defaultpipe = DEFAULT_PIPE |
Use this to set the defualt event pipe of this event handler. | |
EVENTHANDLERTYPE | eventhandlertype |
An identifier that offers a group identification. | |
Private Attributes | |
IMS_ModuleFunctionData_Thruster * | data |
GUI_ModuleFunction_Thruster * | menu |
Modulefunction that defines a basic thruster.
This class is not abstract, but might become in the future. It is intended that specialised thruster types or roles are derived from this class (such as chemical thrusters, electrical, etc). The thruster modulefunction provides implementation for different and selectable thrustermodes, used propellant types and ratios as well as exhaust rendering.
|
virtual |
Everything that needs to be done when the modulefunction is removed from a vessel should be implemented in an overload of this function.
vessel | The vessel the module is to be added to |
Implements IMS_ModuleFunction_Base.
|
virtual |
returns the GUI of this module function, or NULL if this module function doesn't have a user interface.
Reimplemented from IMS_ModuleFunction_Base.
|
protected |
|
virtual |
called on SimStart, after LoadState() but before AddFunctionToVessel()
Implements IMS_ModuleFunction_Base.
|
virtual |
gets called at every clbkPreStep of the containing vessel.
simdt | elapsed time since the last frame |
vessel | the vessel this module function belongs to |
Reimplemented from IMS_ModuleFunction_Base.
|
protectedvirtual |
Receives all events coming through this EventHandler.
Overload to implement event handling in your inheriting class. The function will receive Events one by one as they are coming through your event sinks, regardless of which pipe they belong to. Return true to consume an event, but be sure it was only meant for you when you do that.
e | The event coming through the event pipe |
Implements EventHandler.
|
protectedvirtual |
receives all scenario lines concerning this modulefunction, one after the other.
line | A string object containing the line read from the scenario use this function to implement state initialisation when your module function is loaded from scenario |
Implements IMS_ModuleFunction_Base.
|
virtual |
Everything that needs to be done when the module is removed from a vessel should be implemented in an overload of this function.
vessel | The vessel the module is being removed from |
Implements IMS_ModuleFunction_Base.
|
virtual |
overload to save modulefunction specific stuff to scenario.
scn | the FILEHANDLE to the opened scenario file |
Implements IMS_ModuleFunction_Base.
|
virtual |
Sets the thrusters control group.
thrustergroup | The value of a THGROUP_TYPE identifier, or -1 if the thruster is removed from all groups |
|
virtual |
sets the thruster mode of the thruster.
modeidx | The index the desired mode has in the thrusters modes list. |