Skip to content
Snippets Groups Projects
Commit 8a01f8c3 authored by Marco Luigi Gaibotti's avatar Marco Luigi Gaibotti Committed by Marco Luigi Gaibotti
Browse files

[to-struct-updates] Added ovverloads for toStruct in Airbrakes and Wind

parent 2a4d1852
No related branches found
No related tags found
1 merge request!27[to-struct-updates] Improved toStruct for classes
......@@ -136,8 +136,7 @@ classdef Rocket < Config
obj.rear = Rear(mission, varsIn);
obj.pitot = Pitot(mission, varsIn);
paraLoader = ParaLoader(mission);
obj.parachutes = paraLoader.parachutes;
obj.parachutes = Para(mission);
if options.loadCoefficients
if obj.dynamicDerivatives
......
......@@ -82,5 +82,13 @@ classdef Airbrakes < Bay
idx = sum(time >= obj.time);
extension = obj.extension(idx);
end
function str = toStruct(obj)
str = toStruct@Structured(obj);
% Remove angle function since Simulink does not support
% function handles
str = rmfield(str, {'angleFunction'});
end
end
end
\ No newline at end of file
......@@ -166,6 +166,15 @@ classdef Wind < Config
% Create gridded interpolant
obj.dataInerpolant = griddedInterpolant(gridVec, data', 'linear', 'nearest');
end
function str = toStruct(obj)
str = toStruct@Structured(obj);
% Remove unnecessary fields for class (also unsupported by simulink)
str = rmfield(str, { ...
'magnitudeDistribution', 'azimuthDistribution', 'elevationDistribution',...
'magnitudeParameters', 'azimuthParameters', 'elevationParameters'});
end
end
methods(Access = private)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment