Borrar filtros
Borrar filtros

How do I force subsystems in a library to open in the same window in R2012a?

4 visualizaciones (últimos 30 días)
I am working with a large Simulink model in R2012a. I want to navigate the model in a single model window. In my Simulink preferences, I have set "Window reuse" to "reuse", which seems to work for models, but not libraries. That is, when I double-click on a subsystem in a model, the subsystem opens in the same window; but when I double-click on a subsystem in a library, the subsystem opens in a new window.
Is there a way to force Simulink to reuse windows when navigating both models and libraries?
On a related note, I sometimes open subsystems programmatically, and in these cases, I would also like to reuse the current window. If I know what subsystem is currently open in the window I can use the syntax:
% open 'f14' into the 'f14/Controller' window in 'reuse' mode
open_system('f14','f14/Controller','reuse');
But how can I find out--programmatically--which subsystem is currently open? For example, if the window is currently in 'f14/Nz pilot\ncalculation/Pilot\ng force (g)', the command above will fail:
Invalid system for 'replace' with OPEN_SYSTEM
If there is only one model open, then it is sufficient to use gcs:
open_system('f14', gcs, 'reuse');
But suppose I have two models open, and the current system is not in the same model as the one I want to open. Then Simulink complains:
The current system must be in the same hierarchy as the system being opened when reusing windows
I could verify that the model is open using
bdLoaded = find_system('Type', 'block_diagram');
But how would I check which subsystem is currently displayed in a model window for a model other than the current system?
  1 comentario
Vidya Viswanathan
Vidya Viswanathan el 30 de Ag. de 2016
The Window Reuse option in Simulink Preferences does not work with Simulink libraries. However, there is a programmatic approach to enable this:
set_param(0, 'WindowReuseForLibraries', 'reuse')

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by