Select Git revision
-
Damiano Amatruda authoredDamiano Amatruda authored
Para.m NaN GiB
classdef Para < matlab.mixin.Heterogeneous & Component
% Parachute: Represents a parachute component.
%
% Constructor:
% - Parachute: Creates an instance of the Parachute class.
% Loaded config: rocketConfig.m > parachute
% Loaded data: -
% Arguments:
% - mission: Mission, mission object
% - varIn: (optional) config source. Alternative to config.m
% file
%
% WARNING: To preserve object type when creating an array, a third
% dimension is added to force the creation of an heterogeneous array.
% the third dimension can be trimmed away.
% Do NOT consider the third dimension as valid
properties(Access = protected)
configName = 'paraConfig.m'
variableName = 'para'
mission Mission
end
methods
function obj = Para(mission, varIn)
arguments(Input)
mission Mission = Mission()
varIn = []
end
obj@Component(mission, varIn);
%% Forcing creation of heterogeneous array
if any(size(obj) > 1)
switch class(obj)
% In case of homogeneous type, forces conversion to
% heterogeneous Para array
case 'Parachute'
obj(1, 1, 2) = Parafoil();
case 'Parafoil'
obj(1, 1, 2) = Parachute();
otherwise
end
end
end
end
methods (Static,Sealed,Access=protected)
function default = getDefaultScalarElement
default = Parachute;
end
end
end