The parameter Result Location in the <<SimulationConfig>> allows you to record and save plot results on a Time series chart into the model when simulation is completed. You can save the plot results in the Result Location parameter in the following formats: PNG file, CSV, or HTML file by using the Record Plot Data As option in the Specification window of the Time series chart. The feature works with the Time series chart both stand-alone and in the UI diagram. You can then include the plot results into a generated document for reporting purposes.
Saving plot results using resultLocation in the <<SimulationConfig>>.
To save plot results using Result Location
Open the Specification window of a <<SimulationConfig>> and set Result Location to an InstanceSpecification.
Open the Specification window of a TimeSeriesChart and set Record Plot Data As to the PNG, CSV, or HTML format.
Run the <<SimulationConfig>> until it terminates. The expected plot result will be saved into the InstanceSpecification. You can review the result through specification of the InstanceSpecification.
Note
- If Result Location is set to a package, the plot results will be saved into a new InstanceSpecification at each runtime. However, if Result Location is set to an InstanceSpecification, the results will be saved into the selected InstanceSpecification.
- After the simulation stopped, the plot results (both image and CSV values) will be saved in the Image and Comment properties of the specified InstanceSpecification if the Record Plot Data As option in Time series chart is not specified.
The following figure shows the plot image saved in the Specification of Instance Specification of the bouncingBall model
The plot image saved in the Image property of the specified InstanceSpecification of the bouncingBall model.
The image is too large to show in the Image property in the Specification window; therefore, you can verify it by dragging the InstanceSpecification into the diagram.
To verify a plot image saved in the Image property of the selected InstancedSpecification
- Drag the InstanceSpecification to the diagram.
click on the top left of the InstanceSpecification. The Compartments shortcut menu will open.
The Compartments menu icon on the top left of the InstanceSpecification.
- Select Stereotypes > Shape Image.
The following figure shows the CSV values saved in the Specification of Instance Specification of the bouncingBall model
The plot CSV values are saved in the Body of the Comment property of the specified InstanceSpecification of bouncingBall model.
You can also specify the Record Plot Data As option in the Time series chart to your preferred plot result format (PNG, CSV, or HTML). If PNG is selected, you can verify the saved plot image by dragging the InstanceSpecification to the diagram and click on the top left of the InstanceSpecification to open the Compartments shortcut menu and select Stereotypes > Shape Image.
Verifying the saved plot image of the InstanceSpecification via Compartments > Stereotypes > Shape Image.
If the Record Plot Data As option is HTML, the HTML source will be generated into the Documentation/Hyperlinks property group. You can customize the title, logo, font, and other layouts of the generated HTML source and use them in other reports.
HTML generated into the Documentation/Hyperlinks field of the InstanceSpecification.
The generated HTML can be saved and opened with a browser as shown in the following figure