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

Holds static data for a pressurised (read: habitable) volume in a module. More...

Inheritance diagram for IMS_ModuleFunctionData_Pressurised:
IMS_ModuleFunctionData_Base IMS_ModuleFunctionData_Tank

Public Member Functions

double getVolume ()
 
- Public Member Functions inherited from IMS_ModuleFunctionData_Base
virtual bool LoadFromFile (string configfile, IMSFILE cfg)
 Loads the data from config file. More...
 
virtual bool HasGui ()
 This function serves to check whether a module function has a GUI before creating it. More...
 
FUNCTIONTYPE GetType ()
 
string GetName ()
 

Protected Member Functions

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

Protected Attributes

double volume
 usable volume in m^3
 
- 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

Holds static data for a pressurised (read: habitable) volume in a module.

Config file structure

Following are valid parameters to define a pressurised volume inside a module:

BEGIN_MODULEFUNCTION PRESSURISED
Volume = <float m^3> //pressurised volume in cubic meters
END_MODULEFUNCTION

Member Function Documentation

bool IMS_ModuleFunctionData_Pressurised::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.

Implements IMS_ModuleFunctionData_Base.

Reimplemented in IMS_ModuleFunctionData_Tank.

bool IMS_ModuleFunctionData_Pressurised::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!

Implements IMS_ModuleFunctionData_Base.

Reimplemented in IMS_ModuleFunctionData_Tank.


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