Sensor¶
The type of structures returned by LIST SENSORS IN SOMEVARIABLE. This is not fully understood because the type of PartModule
in the KSP API called ModuleEnviroSensor
, which all Sensors are a kind of, is not well documented. Here is an example of using Sensor
:
PRINT "Full Sensor Dump:".
LIST SENSORS IN SENSELIST.
// TURN EVERY SINGLE SENSOR ON
FOR S IN SENSELIST {
PRINT "SENSOR: " + S:TYPE.
PRINT "VALUE: " + S:DISPLAY.
IF S:ACTIVE {
PRINT " SENSOR IS ALREADY ON.".
} ELSE {
PRINT " SENSOR WAS OFF. TURNING IT ON.".
S:TOGGLE().
}
}
-
structure
Sensor
¶ Suffix Type Description All suffixes of Part
Sensor
objects are a type ofPart
ACTIVE
Boolean Check if this sensor is active TYPE
DISPLAY
string Value of the readout POWERCONSUMPTION
scalar Rate of required electric charge TOGGLE()
Call to activate/deactivate
-
Sensor:
ACTIVE
¶ Access: Get only Type: Boolean True of the sensor is enabled. Can SET to cause the sensor to activate or de-activate.
-
Sensor:
TYPE
¶ Access: Get only
-
Sensor:
DISPLAY
¶ Access: Get only Type: string The value of the sensor’s readout, usualy including the units.
-
Sensor:
POWERCONSUMPTION
¶ Access: Get only Type: scalar The rate at which this sensor drains ElectricCharge.
-
Sensor:
TOGGLE
()¶ Call this method to cause the sensor to switch between active and deactivated or visa versa.