question

Erica B avatar image
2 Likes"
Erica B asked Chris Ligetti commented

Automatically save Performance Measure Report

Hi all -

I’m looking to automatically save the Performance Measure Report after running Experimenter and am unable to find the command that would do so. Can someone help?

Thanks!

FlexSim 17.2.0
saveautomaticperformance measure report
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Mischa Spelt avatar image
3 Likes"
Mischa Spelt answered Chris Ligetti commented

Since the code behind all buttons and options in FlexSim can be viewed in the tree, I had a look at the code of the "Generate Performance Measure Report" button in the Experimenter results window. This is what FlexSim does. It is pretty well-commented so I will post it verbatim, and leave it to you to figure out the relevant parts.

  1. function_s(ownerview(c), "refreshreportprefs");
  2. //export the experiment report
  3.  
  4.  
  5. //get a filename for the export and save it
  6. string directory = modeldir();
  7. if (stringlen(directory) < 3) directory = documentsdir();
  8.  
  9.  
  10. string filepath = getfilebrowse("*.html", "HTML Document", "", directory, 1);
  11. if (stringlen(filepath) < 4) return 0;
  12.  
  13.  
  14. treenode reportfilepath = getvarnode(ownerview(c), "reportfilepath");
  15. sets(reportfilepath, filepath);
  16.  
  17.  
  18. //change the cursor to the hourglass
  19. setcursor(3);
  20.  
  21.  
  22. function_s(ownerview(c), "generatedashboarddata");
  23. //generate the report html and images
  24. function_s(ownerview(c), "generatereport");
  25.  
  26.  
  27. //open the exported experiment report in the user's default web browser
  28. rundocument("open", filepath);
  29.  
  30.  
  31. //change the cursor back to the default arrow
  32. setcursor(1);

The code references some other event functions on the GUI, you can find the whole thing at VIEW:/standardviews/statistics/PerformanceMeasures/Generate Report>menupopup/Performance Measure Report

· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.