Skip to content

pauseSim

Jason Watkins edited this page May 8, 2015 · 10 revisions

Pauses or un-pauses the physics simulation engine in X-Plane.

Syntax

Language Signature
C int pauseSim(XPCSocket sock, char pause)
MATLAB pauseSim( pause, socket )
Java void pauseSim(boolean pause) OR void pauseSim(int pause)
Python pauseSim(self, pause)
Parameters

sock (C): The socket used to send the command.

pause: true (or 1) to pause the simulation; false (or 0) to resume. As of version 1.1, passing 2 will switch the pause state. That is, it will unpause a paused sim, and pause an unpaused sim.

socket (MATLAB): An optional reference to a socket opened with openUDP that should be used to send the command.

Return value

C: A negative value if an error occurs, otherwise 0.

Remarks

The pauseSim command varies from the built-in pause functionality of X-Plane. pauseSim only pauses the physics simulation, without affecting the rest of the X-Plane interface. This means that all planes will freeze in place, but many other functions of the simulator will still function. For example, it is still possible to raise or lower the landing gear while "paused".

Exceptions

C Error Code Java Exception Python Error Description
-1 IOException OSError The client is unable to send the command.

Examples

C
#include "xplaneConnect.h"

sock = aopenUDP("127.0.0.1", 49007);
pauseSim(sock, 1); // Pause simulation
pauseSim(sock, 0); // Unpause simulation

closeUDP(sock);
MATLAB
import XPlaneConnect.*;

pauseSim(1); % Pause simulation
pauseSim(0); % Unpause simulation
Java
import gov.nasa.xpc.XPlaneConnect;

try(XPlaneConnect xpc = new XPlaneConnect())
{
    xpc.pauseSim(true); // Pause simulation
    xpc.pauseSim(false); // Unpause simulation
}

Python

import xpc

with xpc.XPlaneConnect() as client:
    client.pauseSim(true) # Pause simulation
    client.pauseSim(false) # Unpause simulation