Table of Contents

Class SpacecraftOperationComputer

Namespace
NominalSystems.Classes
Assembly
NominalSystems.Classes.dll

[Nominal] The operation computer is a high level computer that can communicate with all systems onboard a spacecraft. It is able to interface with the EPS, telemetry and Attitude systems and produce commands that the Guidance Computer can use. Commands must be transmitted with a key of 'commands' for the computer to read and execute the command.


public class SpacecraftOperationComputer : GuidanceComputer
Inheritance
SpacecraftOperationComputer

Constructors

SpacecraftOperationComputer()

Default constructor

protected SpacecraftOperationComputer()

Fields

BatteryRechargedFraction

When the battery has been depleted below the minimum battery fraction, the guidance can be resumed only when the battery reaches this point.

[Unit(UnitType.NONE)]
[Range(0, 1)]
public double BatteryRechargedFraction

Field Value

double

DesiredPointingMode

The desired pointing mode if the battery is within the desired range of capacity.

[Metadata(IsAdvanced = true)]
public GuidancePointingType DesiredPointingMode

Field Value

GuidancePointingType

LoadedCommandTimes

A list of loaded command times that have been read by the message writer. This will store the simulation time, in seconds, in which the command should be executed.

[Hidden]
public List<double> LoadedCommandTimes

Field Value

List<double>

LoadedCommands

A list of loaded commands as JSON that have been read by the message writer from the received messages. Once the command has been executed, it will be removed from the list.

[Hidden]
public List<JObject> LoadedCommands

Field Value

List<JObject>

MinimumBatteryFraction

When the battery goes below this fraction, the guidance message will go to sun pointing mode.

[Unit(UnitType.NONE)]
[Range(0, 1)]
public double MinimumBatteryFraction

Field Value

double

Properties

PointingMode

Returns the current pointing mode that is being used by the guidance computer.

[Metadata(ContainedIn = "Out_GuidanceChainMsg")]
public override GuidancePointingType PointingMode { get; set; }

Property Value

GuidancePointingType

Methods

AddCommand(JObject?, double)

Adds a new command to the list of loaded commands that will be executed.

public void AddCommand(JObject? cmd, double time)

Parameters

cmd JObject

The command to add to the buffer

time double

[s] The simulation time to execute the command

Initialise()

Initialises the computer and attempts to connect up all the parameters and components together that are required for the computer to function. This is a spacecraft computer specific initialisation.

public bool Initialise()

Returns

bool

A successful initialisation

OnBegin(double)

Called when the object is beginning ticking for the first time. This is when the simulation calls the very first tick and will run before the update call.

protected override void OnBegin(double time)

Parameters

time double

[s] Current time of the simulation before the tick

OnLoad(double)

Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.

protected override void OnLoad(double time)

Parameters

time double

[s] The current clock time of the simulation

OnUpdate(double, double)

Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.

protected override void OnUpdate(double time, double step)

Parameters

time double

[s] Current time of the simulation before the update

step double

[s] The time-step to update during this tick

SafeMode()

Set the computer into a safe mode - ensuring that only the most important systems are running and the rest are in safety.

public override void SafeMode()

Shutdown()

Shut the computer down safely. Disable all software and set the status to SHUTDOWN.

public override void Shutdown()

Startup()

Start the computer safely. Enable all software and set the status to RUNNING.

public override void Startup()