Completed Preliminary MATLAB Test Scripts

This commit is contained in:
Chris Teubert
2014-11-28 17:08:41 -08:00
parent 2cb1d541d5
commit 4bfe4fe88d
21 changed files with 256 additions and 19 deletions

View File

@@ -0,0 +1,26 @@
function CTRLTest( )
%CTRLTest Summary of this function goes here
% Detailed explanation goes here
addpath('../../MATLAB')
import XPlaneConnect.*
DREFS = {'sim/cockpit2/controls/yoke_pitch_ratio',...
'sim/cockpit2/controls/yoke_roll_ratio',...
'sim/cockpit2/controls/yoke_heading_ratio',...
'sim/flightmodel/engine/ENGN_thro',...
'sim/cockpit/switches/gear_handle_status',...
'sim/flightmodel/controls/flaprqst'};
THROT = rand();
CTRL = [0.0, 0.0, 1.0, THROT, 0.0, 1.0];
sendCTRL(CTRL);
result = requestDREF(DREFS);
assert(isequal(length(result),6),'CTRLTest: requestDREF unsucessful-wrong number of elements returned');
assert(isequal(length(result{4}),8),'CTRLTest: requestDREF unsucessful- element 1 incorrect size (should be size 8)');
for i=1:length(CTRL)-1
assert(abs(result{i}(1)-CTRL(i))<1e-4,['CTRLTest: DATA set unsucessful-',num2str(i)]);
end
end