Platform Package reference: Function _GetAutoObject()
Description of the function _GetAutoObject() available in all Platform Packages for WebGL JavaScript compatible target systems. This function is intended to be used when integrating the Embedded Wizard created GUI application with the underlying graphics subsystem, graphics hardware or other external GUI applications coexisting on the same system.
Declaration
function _GetAutoObject( aAutoObject )
Parameters
aAutoObject
Data structure representing the autoobject to access. This data structure and all associated contents are generated by Embedded Wizard.
Discussion
The function _GetAutoObject() returns an autoobject identified by aAutoObject. The function verifies whether the required object is already instantiated and if it's true, the existing instance is returned immediately. If no instance of the desired autoobject could be found, _GetAutoObject() prepares a new object of the corresponding class and initializes it properly. For example:
var device = EmWiApp._GetAutoObject( EmWiApp.Application.DeviceObject );
The created object will remain in memory as long as the object is in use. Objects, which are not in use anymore are automatically released during the next garbage collection.
Starting with version 15 of Embedded Wizard, the function _GetExistingAutoObject() is available as an alternative to _GetAutoObject(). Unlike _GetAutoObject(), the function _GetExistingAutoObject() does not instantiate the autoobject if it does not already exist and returns null instead.
Use _GetExistingAutoObject() when implementing middleware that should only interact with the UI when the corresponding autoobject is already active. This prevents unnecessary object instantiation from external events or data feeds. Use _GetAutoObject() when you need to ensure the autoobject is available and should be created if it doesn't exist.
