Computer#
- public class Computer#
The Raster Prop Monitor computer of a part, which holds the variables its props show. Obtained by calling
RasterPropMonitor.computer(SpaceCenter.Part)orRasterPropMonitor.computers(SpaceCenter.Vessel).- SpaceCenter.Part getPart()#
The part the computer is on.
- Game Scenes:
Flight
- Double persistentVariable(String name)#
The value of a persistent variable of the part, or else of the vessel, or
nullif neither is set. Props read it asPERSISTENT_name.- Parameters:
name (
String) – The name of the variable, without thePERSISTENT_prefix.
- Game Scenes:
Flight
- void setPersistentVariable(String name, double value)#
Set a persistent variable of the part. The props that show it update.
- Parameters:
name (
String) – The name of the variable, without thePERSISTENT_prefix.value (
double) – The value.
- Game Scenes:
Flight
- void removePersistentVariable(String name)#
Remove a persistent variable of the part. The props that show it update.
- Parameters:
name (
String) – The name of the variable, without thePERSISTENT_prefix.
- Game Scenes:
Flight
- krpc.client.Event persistentVariableChanged(String name)#
An event that fires when
Computer.persistentVariable(String)changes, such as when a switch in the IVA sets it. The event lasts until it is removed.- Parameters:
name (
String) – The name of the variable, without thePERSISTENT_prefix.
- Game Scenes:
Flight
- VariableType variableType(String name)#
The type of a variable’s current value. Throws an exception if Raster Prop Monitor does not recognize the variable.
- Parameters:
name (
String) – The name of the variable, e.g.ALTITUDE.
- Game Scenes:
Flight
- double numberVariable(String name)#
The value of a number variable. Raster Prop Monitor gives a boolean as 0 or 1. Throws an exception if Raster Prop Monitor does not recognize the variable, or its value is a string.
- Parameters:
name (
String) – The name of the variable, e.g.ALTITUDE.
- Game Scenes:
Flight
- String stringVariable(String name)#
The value of a variable as a string. A number gives its invariant culture string. Throws an exception if Raster Prop Monitor does not recognize the variable.
- Parameters:
name (
String) – The name of the variable, e.g.ALTITUDE.
- Game Scenes:
Flight
- String formatVariables(String text)#
Text with its variables formatted as a monitor page formats them, e.g.
{0:SIP6.1}m $&$ ALTITUDE. Each line takes its own variables. Throws an exception if Raster Prop Monitor does not recognize a variable, or a format is invalid.- Parameters:
text (
String) – The text, in the format of a monitor page.
- Game Scenes:
Flight
- public enum VariableType#
The type of a Raster Prop Monitor variable. See
Computer.variableType(String).- public VariableType NUMBER#
A number. Access using
Computer.numberVariable(String).
- public VariableType STRING#
A string. Access using
Computer.stringVariable(String).