Files
XPlaneConnectCSP/MATLAB/+XPlaneConnect/pauseSim.m
Jason Watkins e191537bc9 Refactored MATLAB client to use the Java client internally.
- Still need to implement selectDATA for all languages.
2015-04-18 09:16:23 -07:00

36 lines
782 B
Matlab

function pauseSim( pause, socket )
%pauseSim Pauses or unpauses X-Plane.
%
%Inputs
% pause: binary value 0=run, 1=pause
% socket (optional): The client to use when sending the command.
%
%Use
% 1. import XPlaneConnect.*;
% 2. status = pauseSim(1);
%
% Contributors
% [CT] Christopher Teubert (SGT, Inc.)
% christopher.a.teubert@nasa.gov
% [JW] Jason Watkins
% jason.w.watkins@nasa.gov
import XPlaneConnect.*
%% Get client
global clients;
if ~exist('socket', 'var')
assert(istrue(length(clients) < 2), '[pauseSim] ERROR: Multiple clients open. You must specify which client to use.');
if isempty(clients)
openUDP();
end
socket = clients(1);
end
%% Validate input
pause = logical(pause);
%% Send command
socket.pauseSim(pause);
end