C# Class RemoteTech.FlightComputer.FlightComputer

This class describe the RemoteTech Flight Computer (FC). A FC is mostly used to handle the delay ('normal' + manual delay) if any and queue commands.
Inheritance: IDisposable
Afficher le fichier Open project: RemoteTechnologiesGroup/RemoteTech Class Usage Examples

Méthodes publiques

Свойство Type Description
LastTarget RemoteTech.FlightComputer.Commands.TargetCommand
OnActiveCommandAbort System.Action
OnNewCommandPop System.Action
Tf double
TfMax double
TfMin double
kdFactor double
kiFactor double
kpFactor double

Méthodes publiques

Méthode Description
Dispose ( ) : void

Called when the flight computer is disposed. This happens when the ModuleSPU is destroyed.

Enqueue ( ICommand cmd, bool ignoreControl = false, bool ignoreDelay = false, bool ignoreExtra = false ) : void

Enqueue a command in the flight computer command queue.

FlightComputer ( ISignalProcessor s ) : System

Flight Computer constructor.

HasManeuverCommandByNode ( ManeuverNode node ) : bool

Looks for the passed node on the command queue and returns true if the node is already on the list.

HasManeuverCommands ( ) : bool

Returns true if there's a least one ManeuverCommand on the queue.

Load ( ConfigNode configNode ) : void

Restores the flight computer from the persistent save.

OnFixedUpdate ( ) : void

Called by the ModuleSPU.OnFixedUpdate method during the "Physics" engine phase.

OnUpdate ( ) : void

Called by the ModuleSPU.Update method during the Update() "Game Logic" engine phase.

This checks if there are any commands that can be removed from the FC queue if their delay has elapsed.

OnVesselChange ( Vessel vessel ) : void

After switching the vessel hide the current flight computer UI.

OrderCommandList ( ) : void

Orders the command queue to be chronological.

Remove ( ICommand cmd ) : void

Remove a command from the flight computer command queue.

RemoveManeuverCommandByNode ( ManeuverNode node ) : void

Triggers a CancelCommand for the given node

Reset ( ) : void

Abort all active commands.

Save ( ConfigNode n ) : void

Saves all values for the flight computer to the persistent.

setPIDParameters ( ) : void
updatePIDParameters ( ) : void

Private Methods

Méthode Description
Enqueue ( FlightCtrlState fs ) : void

Enqueue a FlightCtrlState to the flight control queue.

OnFlyByWirePost ( FlightCtrlState fcs ) : void

Control the flight. Called after the Vessel.OnFlyByWire method.

OnFlyByWirePre ( FlightCtrlState fcs ) : void

Control the flight. Called before the Vessel.OnFlyByWire method.

OnSceneSwitchRequested ( GameScenes>.GameEvents data ) : void

Called when a game switch is requested: close the current computer.

OnVesselSwitching ( Vessel fromVessel, Vessel toVessel ) : void

Called when there's a vessel switch, switching from `fromVessel` to `toVessel`.

PopCommand ( ) : void

Check whether there are commands that can be removed from the flight computer command queue (when their delay time has elapsed).

This is done during the Update() phase of the game engine. OnUpdate method.

PopFlightCtrl ( FlightCtrlState fcs, ISatellite sat ) : void

Remove a FlightCtrlState from the flight control queue.

UpdateLastTarget ( ) : void

Updates the last target command used by the flight computer.

Method Details

Dispose() public méthode

Called when the flight computer is disposed. This happens when the ModuleSPU is destroyed.
public Dispose ( ) : void
Résultat void

Enqueue() public méthode

Enqueue a command in the flight computer command queue.
public Enqueue ( ICommand cmd, bool ignoreControl = false, bool ignoreDelay = false, bool ignoreExtra = false ) : void
cmd ICommand The command to be enqueued.
ignoreControl bool If true the command is not enqueued.
ignoreDelay bool If true, the command is executed immediately, otherwise the light speed delay is applied.
ignoreExtra bool If true, the command is executed without manual delay (if any). The normal light speed delay still applies.
Résultat void

FlightComputer() public méthode

Flight Computer constructor.
public FlightComputer ( ISignalProcessor s ) : System
s ISignalProcessor A signal processor (most probably a instance.)
Résultat System

HasManeuverCommandByNode() public méthode

Looks for the passed node on the command queue and returns true if the node is already on the list.
public HasManeuverCommandByNode ( ManeuverNode node ) : bool
node ManeuverNode Node to search in the queued commands
Résultat bool

HasManeuverCommands() public méthode

Returns true if there's a least one ManeuverCommand on the queue.
public HasManeuverCommands ( ) : bool
Résultat bool

Load() public méthode

Restores the flight computer from the persistent save.
public Load ( ConfigNode configNode ) : void
configNode System.ConfigNode Node with the informations for the flight computer
Résultat void

OnFixedUpdate() public méthode

Called by the ModuleSPU.OnFixedUpdate method during the "Physics" engine phase.
public OnFixedUpdate ( ) : void
Résultat void

OnUpdate() public méthode

Called by the ModuleSPU.Update method during the Update() "Game Logic" engine phase.
This checks if there are any commands that can be removed from the FC queue if their delay has elapsed.
public OnUpdate ( ) : void
Résultat void

OnVesselChange() public méthode

After switching the vessel hide the current flight computer UI.
public OnVesselChange ( Vessel vessel ) : void
vessel Vessel The **new** vessel we are changing to.
Résultat void

OrderCommandList() public méthode

Orders the command queue to be chronological.
public OrderCommandList ( ) : void
Résultat void

Remove() public méthode

Remove a command from the flight computer command queue.
public Remove ( ICommand cmd ) : void
cmd ICommand The command to be removed from the command queue.
Résultat void

RemoveManeuverCommandByNode() public méthode

Triggers a CancelCommand for the given node
public RemoveManeuverCommandByNode ( ManeuverNode node ) : void
node ManeuverNode Node to cancel from the queue
Résultat void

Reset() public méthode

Abort all active commands.
public Reset ( ) : void
Résultat void

Save() public méthode

Saves all values for the flight computer to the persistent.
public Save ( ConfigNode n ) : void
n System.ConfigNode Node to save in
Résultat void

setPIDParameters() public méthode

public setPIDParameters ( ) : void
Résultat void

updatePIDParameters() public méthode

public updatePIDParameters ( ) : void
Résultat void

Property Details

LastTarget public_oe property

The last TargetCommand used by the Flight Computer.
public TargetCommand,RemoteTech.FlightComputer.Commands LastTarget
Résultat RemoteTech.FlightComputer.Commands.TargetCommand

OnActiveCommandAbort public_oe property

Action triggered if the active command is aborted.
public Action,System OnActiveCommandAbort
Résultat System.Action

OnNewCommandPop public_oe property

Action triggered if a new command popped to an active command.
public Action,System OnNewCommandPop
Résultat System.Action

Tf public_oe property

public double Tf
Résultat double

TfMax public_oe property

public double TfMax
Résultat double

TfMin public_oe property

public double TfMin
Résultat double

kdFactor public_oe property

public double kdFactor
Résultat double

kiFactor public_oe property

public double kiFactor
Résultat double

kpFactor public_oe property

public double kpFactor
Résultat double