IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
abstract class that defines the API for module functionalities. More...
Public Member Functions | |
IMS_ModuleFunction_Base (IMS_ModuleFunctionData_Base *_data, IMS_Module *_module, FUNCTIONTYPE _type) | |
Constructor. More... | |
virtual void | PostLoad ()=0 |
called on SimStart, after LoadState() but before AddFunctionToVessel() More... | |
virtual void | SaveState (FILEHANDLE scn)=0 |
overload to save modulefunction specific stuff to scenario. More... | |
void | LoadState (FILEHANDLE scn) |
Sends every scenario line concerning this modulefunction function to processScenarioLine(). More... | |
virtual void | AddFunctionToVessel (IMS2 *vessel)=0 |
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)=0 |
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 double | GetMass () |
Returns the current modulefunctions mass. 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... | |
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 | processScenarioLine (string line)=0 |
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... | |
virtual bool | ProcessEvent (Event_Base *e)=0 |
Receives all events coming through this EventHandler. More... | |
Protected Attributes | |
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_Base * | data |
Pointer to the config file data for this ModuleFunction. | |
abstract class that defines the API for module functionalities.
A module function is an object that does things for a module which not every module must be capable of doing. In General, these things should have some relation to the Orbiter API. If this is not the case, the functionality should be implemented as a component instead (Compnent Interface not yet implemented, we'll get there...)
IMS_ModuleFunction_Base::IMS_ModuleFunction_Base | ( | IMS_ModuleFunctionData_Base * | _data, |
IMS_Module * | _module, | ||
FUNCTIONTYPE | _type | ||
) |
Constructor.
_data | the IMS_ModuleFunctionData object containing the static config data for this module function |
_module | The IMS_Module object containing this module function |
_type | An identifer for the type of this module function |
|
pure 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 |
Implemented in IMS_ModuleFunction_Thruster.
|
inlinevirtual |
returns the GUI of this module function, or NULL if this module function doesn't have a user interface.
Reimplemented in IMS_ModuleFunction_Thruster.
|
inlinevirtual |
Returns the current modulefunctions mass.
|
inline |
void IMS_ModuleFunction_Base::LoadState | ( | FILEHANDLE | scn | ) |
Sends every scenario line concerning this modulefunction function to processScenarioLine().
scn | the FILEHANDLE to the opened scenario file |
|
pure virtual |
called on SimStart, after LoadState() but before AddFunctionToVessel()
Implemented in IMS_ModuleFunction_Thruster.
|
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 in IMS_ModuleFunction_Thruster.
|
protectedpure virtual |
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 |
Implemented in IMS_ModuleFunction_Thruster.
|
pure 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 |
Implemented in IMS_ModuleFunction_Thruster.
|
pure virtual |
overload to save modulefunction specific stuff to scenario.
scn | the FILEHANDLE to the opened scenario file |
Implemented in IMS_ModuleFunction_Thruster.