Simulink block Mask Dialog Image updating

조회 수: 9 (최근 30일)
Robert Simpson
Robert Simpson 2017년 2월 17일
댓글: Hari Desanur 2017년 2월 22일
How do i force an image in a mask dialog to update/redraw?
I have a simple Simulink block Mask dialog with a popup and an image. I want to change the image based on the value in the popup The code in the popup callback is as below.
maskParams = Simulink.Mask.get(gcb);
selected = get_param(gcb,'popupMenu');
schematic = maskParams.getDialogControl('imageControl');
schematic.FilePath = ['.\pathtoImageFiles\' selected '.png']
set_param(gcb,'actuatorType',selected); %try to force intialisation
schematic.Enabled = 'off';
schematic.Enabled = 'on';
schematic.Visible = 'off';
schematic.Visible = 'on';
However, what actually happens is that the schematic. Filepath parameter gets updated correctly but the image does not get updated until the mask is closed and then opened again. How do I manually update the image?
Also removeDialogControl does not seem to work on the image so I cant remove the whole ImageDialogControl and then add another one.
  댓글 수: 1
Hari Desanur
Hari Desanur 2017년 2월 22일
Please can you upload the Simulink model on which you are trying this code?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by