Common objects description
The PROMOTIC system is an object oriented system, it means that it fully takes the advantages of using objects.
The object is a data structure with which help it is possible to do various operations (e.g. reading, writing, starting algorithms, saving value, etc.).
Each object has its own specific functionality, e.g. the
PmaTimer object (
Timer) serves for regular repeating the algorithm defined by a designer. To utilize the object functionality, the object must be inserted in the application.
The object has
properties,
methods and
events that can also be
inherited from its parent objects.
-
Object properties are data that the object contains and that the object works with. Object properties include, for example, panel title, indication of active state, value (numeric or text) or data type of the variable.
For example the
PmaTimer object has the
Period property that is used for reading or setting the timer ticking period.
-
Object methods are functions that are performed within the bounds of the object. Methods include, for example, saving valued to disk, printing panel to a printer, etc. Object properties and methods can be arbitrarily used in algorithms from which they are also
accessed.
For example the
PmaTimer object has the
Emulate method that can be used for emulating the timer tick.
-
The object events are used for reporting that "something has happened" to the object.
For example the
PmaTimer object has the
onTick event that announces the "tick" of the object. An algorithm can be entered into each object event.
-
Object inheritance specifies bindings to other (parent) objects.
If the object is inherited from another object, then it means that it owns its properties, methods and events
For example the
PmaTimer object is inherited from the
PmaObject object, that has the properties, methods and events that are shared by all
Pma objects.
Methods of access to objects
To allow calling methods or writing (reading) into object properties, it must be understood how to access these objects in an algorithm (in the script) (how to get the reference to it).
1. Access to Pma objects and to their subobjects
It is possible to access Pma objects and their subobjects in the script by standard methods as follows:
- by parameters of an object event (e.g.
pMe).
The path describes the location of the object in the
Pma object tree. Each tree level adress is separated by the
/ character.
- The immersed Pma object is referenced by its name.
- The superior Pma object is referenced by .. characters.
- The
immersed implementation subobject (other than
PmaObject type) is referenced by
# character, followed by the implementation subobject type definition (e.g.
#vars).
It means that the
# addressing leaves the
Pma objects tree (created by user) and starts to address the implementation subobjects of the
Pma object. For example
"/appdata/data/#vars/Temperature".
2. Access to Pmg objects
It is possible to access
Pmg objects in the script by standard methods as follows:
- by parameters of an object event (e.g.
pMe).
3. Access to the Pm object
The reference to the
Pm object is stored in the
Pm variable that is a variable of the PROMOTIC system (hence it is not defined by a designer). For this reason, properties and methods of this object are accessed by writing
Pm.property in the script.
Example:
JavaScriptVBScriptSelect and copy to clipboard
Pm.Debug("Promotic");
Pm.Debug "Promotic"
4. Access to ActiveX objects