Raster Prop Monitor#
Provides functionality to interact with the Raster Prop Monitor mod. Tested with Raster Prop Monitor 1.1.0.1.
Example#
kRPC adds a page named krpc to every Raster Prop Monitor screen. The page shows the screen’s
krpc_RasterPropMonitor_Display_t, which a script draws on.
The following example draws a page on the first screen in the active vessel’s IVA, showing
whether SAS is on, and makes the screen’s NAV button show it:
#include <krpc_cnano.h>
#include <krpc_cnano/services/raster_prop_monitor.h>
#include <krpc_cnano/services/space_center.h>
int main() {
krpc_connection_t conn;
if (krpc_open_serial(&conn, "COM0") != KRPC_OK) return 1;
if (krpc_connect(conn, "Raster Prop Monitor Example") != KRPC_OK)
return 1;
krpc_SpaceCenter_Vessel_t vessel;
krpc_SpaceCenter_ActiveVessel(conn, &vessel);
// The first screen in the IVA, and the content of its krpc page
krpc_list_object_t monitors = KRPC_NULL_LIST;
krpc_RasterPropMonitor_Monitors(conn, &monitors, vessel);
krpc_RasterPropMonitor_Monitor_t monitor = monitors.items[0];
krpc_RasterPropMonitor_Display_t display;
krpc_RasterPropMonitor_Monitor_Display(conn, &display, monitor);
// Raster Prop Monitor formats the SAS variable, and keeps it up to date
krpc_RasterPropMonitor_Display_set_Text(conn, display,
"SAS: {0:ON;OFF;OFF} $&$ SAS");
// A press of the NAV button shows the page
krpc_RasterPropMonitor_Monitor_CaptureButton(conn, monitor, "buttonR1",
"krpc");
}
The page text names Raster Prop Monitor’s SAS variable, and the format gives ON for 1 and
OFF for 0. Raster Prop Monitor updates the page as SAS changes, however it is switched. On the
screens of the Mk1 Lander Can, NAV is buttonR1.
This client has no events, so the example does not answer the ENTER button.