Added support for VIEW command in MATLAB client.

This commit is contained in:
Jason Watkins
2015-05-08 14:37:58 -07:00
parent 255877eee3
commit 60795b10a5
4 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
function sendVIEWTest()
%% Setup
addpath('../../MATLAB')
import XPlaneConnect.*
if ~exist('gov.nasa.xpc.ViewType', 'class')
[folder, ~, ~] = fileparts(which('XPlaneConnect.openUDP'));
javaaddpath(fullfile(folder, 'XPlaneConnect.jar'));
end
dref = 'sim/graphics/view/view_type';
fwd = 1000;
chase = 1017;
%% Excecute
sendVIEW(gov.nasa.xpc.ViewType.Forwards);
result = getDREFs(dref);
assert(isequal(result, fwd))
sendVIEW(gov.nasa.xpc.ViewType.Chase);
result = getDREFs(dref);
assert(isequal(result, chase))
end