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

1 次查看(过去 30 天)
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 ?

回答(1 个)

Rijuta
Rijuta 2023-10-18
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.

类别

Help CenterFile Exchange 中查找有关 Live Scripts and Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by