How can I programatically add and fill , a text editor to a plot in Data Inspector from Test Manager?

3 visualizaciones (últimos 30 días)
Hello ,
How can I programatically add and fill with content , a text editor attached to a plot in Data Inspector?
Which callback funtion of TestCase should I use for that purpose?
Is it possible to create the text based on some DataStore memory values mansged by Test Harness ,and fiil it in the Text Editor ?

Respuestas (1)

Rijuta
Rijuta el 18 de Oct. de 2023
Hi Justin,
I understand that you want to programmatically add and fill content in a text editor attached to a plot in Data Inspector.
  • In MATLAB's “TestCase” class, there is no specific callback function available for directly modifying the content of a text editor attached to a plot in Data Inspector. However, you can achieve the desired functionality by using the “addTearDown” method of the “TestCase” class. Define properties for the plot handle and text editor in your class. To attach a text editor to a plot in MATLAB, you can use the “uieditfield” function to create a text field or text area, respectively. Then, you can position and customize the text editor as needed. The “addTearDown” method should be called after each test case has finished executing. You can use this method to update the content of the text editor based on the data from the Test Harness.
  • If not the “TestCase” class, you can also use “matlab.unittest.plugins.DiagnosticsValidationPlugin”. You can generate a plot in Test Manager and retrieve the failed diagnostics. Then, identify the specific plot of interest and programmatically add a text editor to it. The text editor can be then filled with the desired content. This will enable you to analyse or annotate the plot further using Data Inspector in Test Manager.
Kindly refer the documentations below for more details:
I hope this solves your query.

Categorías

Más información sobre Live Scripts and Functions 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