%% Modeling System Architecture of Keyless Entry System

%% Overview
% This example shows how to set up the architecture for a keyless entry
% system for a vehicle. You also learn how to create different architecture
% views for different stakeholder concerns.
%
% Open the project:
[projectFolder,~]=matlab.internal.project.example.projectDemoSetUp(fullfile(matlabroot,'toolbox','systemcomposer','examples','TPMS.zip'),[],true);
openProject(projectFolder);

warning('off', 'SystemArchitecture:Allocation:AllocationSetModelOutdated');
allocSet = systemcomposer.allocation.load('FunctionalAllocation');
if (allocSet.NeedsRefresh)
    allocSet.synchronizeChanges();
    allocSet.save();
end
allocSet.close();

allocSet = systemcomposer.allocation.load('SoftwareDeployment');
if (allocSet.NeedsRefresh)
    allocSet.synchronizeChanges();
    allocSet.save();
end
allocSet.close();
close_system('TPMS_FunctionalArchitecture', 0);
close_system('TPMS_LogicalArchitecture', 0);
close_system('PlatformArchitecture', 0);
systemcomposer.loadProfile('TPMSProfile').close();

warning('on', 'SystemArchitecture:Allocation:AllocationSetModelOutdated');
