IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
IMS_ModuleFunctionData_Rcs Class Reference

Stores the static data of an Rcs thruster. More...

Inheritance diagram for IMS_ModuleFunctionData_Rcs:
IMS_ModuleFunctionData_Thruster IMS_ModuleFunctionData_Base

Public Member Functions

virtual bool HasGui ()
 This function serves to check whether a module function has a GUI before creating it. More...
 
bool IsMirrored ()
 
- Public Member Functions inherited from IMS_ModuleFunctionData_Thruster
THRUSTERMODEGetThrusterMode (int mode)
 
int getNumberOfModes ()
 
THRUSTEREXHAUSTGetThrusterExhaust (int idx)
 
int GetNumberOfExhausts ()
 
VECTOR3 GetThrustDirection ()
 
VECTOR3 GetThrusterPosition ()
 
- Public Member Functions inherited from IMS_ModuleFunctionData_Base
virtual bool LoadFromFile (string configfile, IMSFILE cfg)
 Loads the data from config file. More...
 
FUNCTIONTYPE GetType ()
 
string GetName ()
 

Protected Member Functions

virtual bool processConfigLine (vector< string > &tokens)
 Receives all lines of the config file that concern this ModuleFunction one by one. More...
 
virtual bool validateData (string configfile)
 Validates the data for completeness after loading. More...
 
void mirrorExhausts ()
 Creates exhausts mirroring the existing ones.
 

Protected Attributes

bool mirrored = false
 if true, a mirrored thruster will be placed on the same module
 
- Protected Attributes inherited from IMS_ModuleFunctionData_Thruster
vector< THRUSTERMODEthrustermodes
 
vector< THRUSTEREXHAUSTexhausts
 
VECTOR3 thrustdirection = _V(0, 0, 0)
 
VECTOR3 thrusterpos = _V(0, 0, 0)
 
- Protected Attributes inherited from IMS_ModuleFunctionData_Base
FUNCTIONTYPE type
 Stores the type of the ModuleFunction.
 
string name = ""
 Stores the Name of the ModuleFunction.
 

Detailed Description

Stores the static data of an Rcs thruster.

Config parameters

In general, defining an RCS thruster is no different from defining a normal thruster. All parameters used for a thruster are valid, with the limitation that Rcs thrusters will only ever use the first thrustermode defined. There is one additional parameter to common thrusterdefinitions:

[mirror] = <0 or 1> //If set to 1, the thruster will be mirrored, i.e. an exact, inverted duplicate (relative to the module) will be created, exhausts and all.
//You should use this whenever you have a pair of Rcs thrusters that point in opposite directions. Not only is it less to write,
//it also greatly improves the performance of the calculation of firing solutions for your vessels rcs.
//default is 0.

Config example:

BEGIN_MODULEFUNCTION RCS
dir = 0 1 0
mirror = 1
BEGIN_EXHAUST
length = 0.5
width = 0.1
pos = 0 -0.5 0
END_EXHAUST
BEGIN_THRUSTERMODE rcs
Consumable = N2H4 1
Thrust = 1000
Isp = 2160
END_THRUSTERMODE
END_MODULEFUNCTION

Member Function Documentation

virtual bool IMS_ModuleFunctionData_Rcs::HasGui ( )
inlinevirtual

This function serves to check whether a module function has a GUI before creating it.

Note
If your ModuleFunction has its own GUI, overload this function and return true, as simple as that.
Returns
Always false

Reimplemented from IMS_ModuleFunctionData_Thruster.

bool IMS_ModuleFunctionData_Rcs::processConfigLine ( vector< string > &  tokens)
protectedvirtual

Receives all lines of the config file that concern this ModuleFunction one by one.

Overload this function to receive the relevant data of your module.

Parameters
tokensa vector of strings that contains the individual parts of the line, delimited by whitespace or '='
Note
Throw runtime_error with an error message if you encounter an invalid line! The message will be loged in Orbiter.log together with the name of the config file.
Returns
true if the passed line was processed, false if not.

Reimplemented from IMS_ModuleFunctionData_Thruster.

bool IMS_ModuleFunctionData_Rcs::validateData ( string  configfile)
protectedvirtual

Validates the data for completeness after loading.

Implement this function to validate your data at the end of the loading process. Check if everything's there that needs to be, and write log messages if it isn't.

Parameters
configfileThe name of the configfile, so you can add it to your messages so config writers find their mistakes faster.
Returns
False if the modulefunction is unable to function, otherwise return true.
Note
If your Implementation returns false, The loading process will be aborted by forcing orbiter to crash, so be sure to keep your loging straight!

Reimplemented from IMS_ModuleFunctionData_Thruster.


The documentation for this class was generated from the following files: