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
Check if this sensor is active
Value of the readout
Rate of required electric charge
Call to activate/deactivate
- Sensor:ACTIVE¶
- Access
Get only
- Type
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
The value of the sensor’s readout, usualy including the units.
- Sensor:POWERCONSUMPTION¶
- Access
Get only
- Type
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.