diff --git a/classes/Config.m b/classes/Config.m index 5c7b954c1ea39db7d9e46312d9bb3663dd138ff0..433876de7402fbc2cb8c2ccc7343ff34a1aa9eb9 100644 --- a/classes/Config.m +++ b/classes/Config.m @@ -166,10 +166,16 @@ classdef(Abstract) Config end configObj = varsIn.(varName); - fields = configObj.getProperties('writable'); - for field = fields - if isempty([configObj.(field)]), continue; end - obj.(field) = configObj.(field); + if isa(configObj, 'struct') + % If object is not initzialized yet, copy single fields + fields = configObj.getProperties('writable'); + for field = fields + if isempty([configObj.(field)]), continue; end + obj.(field) = configObj.(field); + end + else + % If object is already initialized, copy the object + obj = configObj; end end end diff --git a/classes/Environment.m b/classes/Environment.m index db82db889347ee082a8689a3ba72a7d7568e1184..23cc07b06eeda2c82218cbd381378694bad901cc 100644 --- a/classes/Environment.m +++ b/classes/Environment.m @@ -14,8 +14,9 @@ classdef Environment < Config %% Cached properties properties(Access = private) - PHI OMEGA + PHI + LAT0 LON0 Z0 @@ -29,8 +30,8 @@ classdef Environment < Config end properties (Dependent) - phi double % [rad] Launchpad Azimuth, user input in degrees omega double % [rad] Launchpad Elevation, user input in degrees + phi double % [rad] Launchpad Azimuth, user input in degrees lat0 double % [deg] Launchpad latitude lon0 double % [deg] Launchpad longitude