Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

ArrayViewer.Document Filename Property

ids-removed295
Beginner
516 Views
1) It appears that the Filename property must be set to the complete path of the file to load. It would be nice to be able to just set the filename with the assumption that the data are located in the cwd.
2) If the FileName property value set specifies a file that can't be found it would be nice to get some type of error.
3) Since this property really performs an action might it work easier as a method? (that returns a success/failure boolean)
4) What is the advantage of setting the property directly instead of using Avis.AvFileLoader?
beau
0 Kudos
1 Reply
Intel_C_Intel
Employee
516 Views
1) The problem is that the Array Viewer app doesn't share the cwd with the calling program. The Win32 API provides the GetFullPathName function that can be used to get the absolute path name.
2) I'll work on adding error codes to the Array Viewer automation interface for the next update. If you'd like to track this request, please file a Premier support issue.
3) Property set/gets can return an error code as well, so there's really no need to change this property to a function. For C++/Fortran clients an HRESULT code will be returned. For Script or .Net clients an exception will be generated.
4) Setting the AvFileLoader.FileName property enables you to get an in-process IAvGroup interface to theroot object for the file. In contrast, if you set IArrayViewer.FileName and then do a get of IArrayViewer.RootGroup, you'll get an out-of-process interface. Each access to an out-of-process interface will be much slower than the in-process case since the call will need to be marshaled to the server exe (AViewer.exe in this case).
If you wished to load a file and then manipulate the object hierarchy in some way (say add add a graph), the best approach is the following:
i) UseAvFileLoader to load the file.
ii) Set properties/invoke methods on AvFileLoader.Root.
iii) Create an instance or ArrayViewer.
iv) Set ArrayViewer.FileName to the filename.
At this point ArrayViewer will display the modified hierarchy (not the original file contents). This works since all AV processes share the same runtime image for each loaded file. If you make further changes using the AvFileLoader.Root interface, just call IArrayViewer.Update to have the Viewer update its display.
John
0 Kudos
Reply