Real time interface using App Designer for Simevents?

조회 수: 1 (최근 30일)
Ho Jung Kim
Ho Jung Kim 2022년 7월 27일
답변: Hari 2023년 9월 5일
Is there a way to make a real time interface using App Designer for Simevents?
I have an entity attribute called color, and when the entity reaches the last server, I want to show the user that the corresponding button of color is pressed. Is there a way to do this?

답변 (1개)

Hari
Hari 2023년 9월 5일
Hi Ho Jung Kim,
I understand that you have a SimEvents model where entities move through servers, each with a "color" attribute. You want to create a real-time interface using App Designer to show the user that the corresponding color button is pressed when an entity reaches the last server.
It is possible to do so using App Designer. I assume, you have created an App Designer GUI with all the visual elements required in your app. You can follow the below steps:
  1. Integrate “SimEvents” with the App Designer GUI: In the “SimEvents” model, utilize the “eventSend” block or a custom block to send events when an entity reaches the last server. Write a MATLAB callback function that receives these events and updates the GUI accordingly. This callback function can be defined within the App Designer code or in a separate MATLAB function file.
  2. Update the GUI in real time: In the callback function, update the status of the buttons based on the received events. Use appropriate MATLAB functions, such as set or “app.Button.Value”, to change the state or appearance of the buttons. You can also update the label or indicator to display the status information.
  3. Start the “SimEvents” simulation, which will generate events based on the model logic and run the App Designer GUI, which will display the buttons and update them in real time based on the events received.
By following these steps, you can create a real-time interface using App Designer to visualize the status of entities in a SimEvents model.
Refer to the below documentationsCallbacks in App Designer” andEvents and Listeners” for more information.

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by