Skip to content

Commit

Permalink
Simplify sim calls in BuildRefrigerator
Browse files Browse the repository at this point in the history
* Note that the command to start Simscape Results Explorer is sscexplore
* For the multiple sims, replace with parsim on desktop systems
* For the other sims, do not use Simulink.SimulationInput
* Close the parpool, if open, in PostBuildRefrigerator
* Make sure sim doesn't open sscexplore in PreBuildRefrigerator
  • Loading branch information
eszmw committed Oct 1, 2024
1 parent 4fdf8da commit 088ab9b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
Binary file modified Models/BuildRefrigerator.mlx
Binary file not shown.
Binary file modified Models/Model_Fridge.mlx
Binary file not shown.
2 changes: 2 additions & 0 deletions SoftwareTests/PostFiles/PostBuildRefrigerator.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
% Post-run script for BuildRefrigerator.mlx
% ---- Post-run commands -----

delete(gcp('nocreate'))

16 changes: 16 additions & 0 deletions SoftwareTests/PreFiles/PreBuildRefrigerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@
% ---- Known Issues -----
KnownIssuesID = ["physmod:common:simtypes:assert:Assertion","physmod:simscape:simtypes:assert:Assertion"];
% ---- Pre-run commands -----

sim = @(varargin) SimNoViewer(varargin);

function out = SimNoViewer(varargin)
mdl = varargin{1}{1};
p1 = get_param(mdl,"SimscapeLogOpenViewer");
set_param(mdl, 'SimscapeLogOpenViewer', 'off')
out = sim(mdl,varargin{2:end});
set_param(mdl,"SimscapeLogOpenViewer",p1)
end

% sscexplore = @(x) DontOpenExplorer(x);
%
% function DontOpenExplorer(varargin)
% disp("Opening Simscape Results Explorer here...")
% end

0 comments on commit 088ab9b

Please sign in to comment.