Completed Preliminary MATLAB Test Scripts
This commit is contained in:
26
TestScripts/MATLAB Tests/CTRLTest.m
Normal file
26
TestScripts/MATLAB Tests/CTRLTest.m
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user