Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment Class Reference

A Data Class used to hold the information about a Manned Science Experiment. More...

Inheritance diagram for Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment:
IConfigNode

Classes

class  SeismicPartData
 Internal Class used to store entries in SeismicPartList More...
 

Public Member Functions

void CalcSendSeismicScience (Vessel vessel, Part part, float solarMultiplier)
 Called by DeployedScience Scenario when a Seismic science event occurs. Will calculate Science and send it immediately back to Home CB. Checks first if this experiment is in fact a DeployedScience.SeismicExperimentId match. More...
 
void CalculateScience (float solarMultiplier)
 Calculate Science from lastUT to current UT and store in DataStore. Do NOT call this method for Seismic Experiments. Use CalcSendSeismicScience instead. More...
 
bool GatherScienceData (out ScienceData experimentData)
 Creates ScienceData for the stored data in the experiment. More...
 
void Load (ConfigNode node)
 
void Save (ConfigNode node)
 
delegate float SeismicDataCalc (DeployedScienceExperiment scienceExp, float impactJoules, float impactJoulesMaxValue, List< SeismicPartData > seismicPartData)
 Delegate Method for mods to override the Seismic Data calculation if desired. Use SeismicDataCalcOverrideAdd to add a method instance that will be called to override the stock calculation. The Delegate must receive the specified parameters and return a float which contains the Amount of Science Data generated. More...
 
void SeismicDataCalcOverrideAdd (SeismicDataCalc method)
 Add a delegate method for mods to override the Seismic Data calculation if desired. More...
 
void SeismicDataCalcOverrideRemove (SeismicDataCalc method)
 Remove a delegate method for mods to override the Seismic Data calculation if desired. More...
 
bool SendDataToComms ()
 Does not check if it's time to send the data. This should be done by checking TimeToSendStoredData() first. Does not use ModuleDataTransmitter or Electric Charge to send the data. Rather - ensure the Deployed Science Cluster is Powered in order to send the data back to Kerbin. More...
 
bool TimeToSendStoredData ()
 Returns true if the amount of stored science in the experiment is a multiple of 10% of the total amount of science that it can generate. Will always return true if the Experiment is a Seismometer experiment. More...
 
void UpdateScienceExperiment (ModuleGroundExperiment moduleGroundExperiment)
 Update the Science variables in this data class from the passed in PartModule. Updates reference to the PartModule. ScienceLimit, ScienceValue and ScienceModifierRate. More...
 
void UpdateScienceLimitExperiment (ModuleGroundExperiment moduleGroundExperiment)
 Update the ScienceLimit in this data class from the passed in PartModule. Updates reference to the PartModule and ScienceLimit only. More...
 
void UpdateScienceValueExperiment (ModuleGroundExperiment moduleGroundExperiment)
 Update the ScienceValue in this data class from the passed in PartModule. Updates reference to the PartModule and the ScienceValue only. More...
 

Static Public Member Functions

static DeployedScienceExperiment Spawn (ModuleGroundExperiment moduleGroundExperiment, DeployedScienceCluster cluster)
 Spawns a DeployedScienceExperiment GameObject; sets the initial data and returns the DeployedScienceExperiment component. More...
 
static DeployedScienceExperiment SpawnandLoad (ConfigNode node)
 Spawns a DeployedScienceExperiment GameObject; Loads it from ConfigNode and returns the DeployedScienceExperiment component. More...
 

Public Attributes

DeployedScienceCluster Cluster
 Reference to the DeployedScienceCluster data instance that this is a part of. More...
 
FloatCurve distanceCurve
 Floatcurve used to evaluate the distance multiplier for Seismic Experiment. More...
 
ScienceExperiment Experiment
 The Science Experiment. More...
 
Vessel ExperimentVessel
 A link to the Vessel the experiment is a part of. More...
 
double LastScienceGeneratedUT
 The UT when Science was last generated for this Cluster More...
 
DeployedSciencePart sciencePart
 The DeployedSciencePart module that this ScienceExperiment is a part of. More...
 
List< SeismicPartDataseismicPartList
 A list of SeismicPartData that is generated when Parts impact the surface of a CB that this Experiment is deployed on. The list will be processed and cleared automatically by this instance 3 seconds after the first impact is recorded. More...
 
float xmitDataScalar = 1f
 The Data Scalar used for transmitting the data back to Home CB. For deployed science the default is 1f. More...
 

Properties

string ExperimentId [get]
 This is the Science System Experiment Id defined in EXPERIMENT_DEFINITION cfg node. More...
 
string ExperimentName [get]
 The Class/Name of the Experiment. More...
 
bool ExperimentSituationValid [get]
 Is set to true or false if the Experiment Situation is currently valid or not. More...
 
ModuleGroundExperiment GroundExperimentModule [get]
 Will return reference to the related ModuleGroundExperiment PartModule instance - if it's loaded. Otherwise will return null. More...
 
uint PartId [get]
 Part PersistentId More...
 
float ScienceDiminishingModifierRate [get, set]
 The Science modifier applied for diminishing returns. Where there is more than one of this type of experiment on the same CelestialBody. More...
 
float ScienceLimit [get]
 The Maximum amount of Science this Experiment can generate More...
 
float ScienceModifierRate [get]
 The Science modifier (percentage) at which science is generated. This percentage is set based on the traits and level of the kerbal that placed it. More...
 
float ScienceValue [get]
 The Amount of Science this experiment generates More...
 
bool SeismicEventDataSendPending [get]
 This will be true when a Seismic Event is in progress and the data in SiesmicPartList has not been processed yet. More...
 
float StoredScienceData [get]
 The Amount of Science data generated but not transmitted More...
 
float TotalScienceGenerated [get]
 The Total Science Generated by this Experiment More...
 
float TransmittedScienceData [get]
 The Amount of Science data transmitted More...
 

Detailed Description

A Data Class used to hold the information about a Manned Science Experiment.

Member Function Documentation

void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.CalcSendSeismicScience ( Vessel  vessel,
Part  part,
float  solarMultiplier 
)
inline

Called by DeployedScience Scenario when a Seismic science event occurs. Will calculate Science and send it immediately back to Home CB. Checks first if this experiment is in fact a DeployedScience.SeismicExperimentId match.

Parameters
vesselReference to the Vessel
part
solarMultiplierThis is a percentage multiplier applied to the science to allow for Solar Panel generation only providing Power for half the total time (dark-side)
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.CalculateScience ( float  solarMultiplier)
inline

Calculate Science from lastUT to current UT and store in DataStore. Do NOT call this method for Seismic Experiments. Use CalcSendSeismicScience instead.

Parameters
solarMultiplierThis is a percentage multiplier applied to the science to allow for Solar Panel generation only providing Power for half the total time (dark-side)
bool Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.GatherScienceData ( out ScienceData  experimentData)
inline

Creates ScienceData for the stored data in the experiment.

Parameters
experimentDataScienceData experimentData with any stored experiment science.
Returns
true or false depending on whether the process was successful or not.
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.Load ( ConfigNode  node)
inline

Implements IConfigNode.

void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.Save ( ConfigNode  node)
inline

Implements IConfigNode.

delegate float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.SeismicDataCalc ( DeployedScienceExperiment  scienceExp,
float  impactJoules,
float  impactJoulesMaxValue,
List< SeismicPartData seismicPartData 
)

Delegate Method for mods to override the Seismic Data calculation if desired. Use SeismicDataCalcOverrideAdd to add a method instance that will be called to override the stock calculation. The Delegate must receive the specified parameters and return a float which contains the Amount of Science Data generated.

Parameters
scienceExpThe DeployedScienceExperiment instance
impactJoulesThe calculated impact in Joules
impactJoulesMaxValueThe maximum amount of Joules that will produce 100% science for the experiment
seismicPartDataA list of the Seismic Part Data for all the parts that slammed into the ground that should be considered in the Data Calculations
Returns
a float value indicating the amount of science data generated.
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.SeismicDataCalcOverrideAdd ( SeismicDataCalc  method)
inline

Add a delegate method for mods to override the Seismic Data calculation if desired.

Parameters
method
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.SeismicDataCalcOverrideRemove ( SeismicDataCalc  method)
inline

Remove a delegate method for mods to override the Seismic Data calculation if desired.

Parameters
method
bool Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.SendDataToComms ( )
inline

Does not check if it's time to send the data. This should be done by checking TimeToSendStoredData() first. Does not use ModuleDataTransmitter or Electric Charge to send the data. Rather - ensure the Deployed Science Cluster is Powered in order to send the data back to Kerbin.

Returns
static DeployedScienceExperiment Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.Spawn ( ModuleGroundExperiment  moduleGroundExperiment,
DeployedScienceCluster  cluster 
)
inlinestatic

Spawns a DeployedScienceExperiment GameObject; sets the initial data and returns the DeployedScienceExperiment component.

Returns
Mission component
static DeployedScienceExperiment Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.SpawnandLoad ( ConfigNode  node)
inlinestatic

Spawns a DeployedScienceExperiment GameObject; Loads it from ConfigNode and returns the DeployedScienceExperiment component.

Returns
Mission component
bool Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.TimeToSendStoredData ( )
inline

Returns true if the amount of stored science in the experiment is a multiple of 10% of the total amount of science that it can generate. Will always return true if the Experiment is a Seismometer experiment.

Returns
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.UpdateScienceExperiment ( ModuleGroundExperiment  moduleGroundExperiment)
inline

Update the Science variables in this data class from the passed in PartModule. Updates reference to the PartModule. ScienceLimit, ScienceValue and ScienceModifierRate.

Parameters
moduleGroundExperimentThe PartModule reference
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.UpdateScienceLimitExperiment ( ModuleGroundExperiment  moduleGroundExperiment)
inline

Update the ScienceLimit in this data class from the passed in PartModule. Updates reference to the PartModule and ScienceLimit only.

Parameters
moduleGroundExperiment
void Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.UpdateScienceValueExperiment ( ModuleGroundExperiment  moduleGroundExperiment)
inline

Update the ScienceValue in this data class from the passed in PartModule. Updates reference to the PartModule and the ScienceValue only.

Parameters
moduleGroundExperiment

Member Data Documentation

DeployedScienceCluster Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.Cluster

Reference to the DeployedScienceCluster data instance that this is a part of.

FloatCurve Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.distanceCurve

Floatcurve used to evaluate the distance multiplier for Seismic Experiment.

ScienceExperiment Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.Experiment

The Science Experiment.

Vessel Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ExperimentVessel

A link to the Vessel the experiment is a part of.

double Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.LastScienceGeneratedUT

The UT when Science was last generated for this Cluster

DeployedSciencePart Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.sciencePart

The DeployedSciencePart module that this ScienceExperiment is a part of.

List<SeismicPartData> Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.seismicPartList

A list of SeismicPartData that is generated when Parts impact the surface of a CB that this Experiment is deployed on. The list will be processed and cleared automatically by this instance 3 seconds after the first impact is recorded.

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.xmitDataScalar = 1f

The Data Scalar used for transmitting the data back to Home CB. For deployed science the default is 1f.

Property Documentation

string Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ExperimentId
get

This is the Science System Experiment Id defined in EXPERIMENT_DEFINITION cfg node.

string Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ExperimentName
get

The Class/Name of the Experiment.

bool Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ExperimentSituationValid
get

Is set to true or false if the Experiment Situation is currently valid or not.

ModuleGroundExperiment Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.GroundExperimentModule
get

Will return reference to the related ModuleGroundExperiment PartModule instance - if it's loaded. Otherwise will return null.

uint Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.PartId
get

Part PersistentId

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ScienceDiminishingModifierRate
getset

The Science modifier applied for diminishing returns. Where there is more than one of this type of experiment on the same CelestialBody.

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ScienceLimit
get

The Maximum amount of Science this Experiment can generate

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ScienceModifierRate
get

The Science modifier (percentage) at which science is generated. This percentage is set based on the traits and level of the kerbal that placed it.

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.ScienceValue
get

The Amount of Science this experiment generates

bool Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.SeismicEventDataSendPending
get

This will be true when a Seismic Event is in progress and the data in SiesmicPartList has not been processed yet.

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.StoredScienceData
get

The Amount of Science data generated but not transmitted

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.TotalScienceGenerated
get

The Total Science Generated by this Experiment

float Expansions.Serenity.DeployedScience.Runtime.DeployedScienceExperiment.TransmittedScienceData
get

The Amount of Science data transmitted


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