The 4.2 release contains a number of new features, including:
The chart plots can now display data in logarithmic scale. The log scale feature is supported by the new LogBase attribute of the Plot and Axis objects. The attribute can be used to define a logarithmic base of the user's choice. The default value of 0 is used to disable logarithmic scale. For the XY Scatter charts, the logarithmic scale of the X value may be defined by the LogBase attribute of the X axis.
If logarithmic scale is enabled, the data pushed into the plot's entry points are converted to the logarithmic scale, and the converted exponent value is used internally by the chart. When the chart is prefilled with data using the GlgAddDataSampleNode method, the value stored in data samples must be converted to the logarithmic scale by the application.
For logarithmic charts, the High and Low ranges, as well as values of Level and Annotation objects, are defined using the logarithmic scale as powers of the LogBase. When a chart tooltip is displayed, the internal value in the logarithmic scale is converted to the external representation as needed. New log_base, log_exp, sample_x_exp, sample_y_exp, input_x_exp, input_y_exp and axis_value_exp format elements may be used to display the LogBase value as well as internal exponent values.
Support for multi-colored plot lines has been added to the Plot object. In previous releases, a plot could have markers with different colors. In the new release, the plot line can also change the color of line segments.
The multi-colored plot line is enabled via the plot's ExtendedData attribute. Previously, setting this attribute to YES enabled multi-colored markers for charts with markers, or multi-colored bars for bar plots. In the new release, the ExtendedData attribute may be set to YES (AUTO) or YES (LINE).
The YES (AUTO) setting enables extended attributes for either lines or bars depending on the plot type. For plots with both line and markers, extended attributes are used for rendering markers. For these plots, the new YES (LINE) option override the default behavior and forces extended attributes to be used for lines instead of markers.
When extended attributes are used for line plots, all line attributes are handled as entry points. The color, line width and line type of each line segment may be defined by setting the corresponding attributes of the plot.
All extended line and marker attributes may have transformations attached to control their values. For example, instead of supplying an RGB value for the plot's EdgeColor, a color list transformation can be attached to the plot's EdgeColor attribute to select a color from a list based on a color index.
In addition to the grid lines drawn at major ticks, the grid lines can also be drawn at middle and minor ticks. The chart's new MinorGridOpacity attribute controls the opacity of the minor grid lines.
The chart's axes can now use middle ticks in addition to the major and minor ticks. The new MiddleInterval and MiddleTickSize axis attributes control the middle ticks position and size. Setting MiddleInterval to zero disables middle ticks. The middle ticks are activated for all real-time chart widgets by default.
Tick labels of any axis may now be formatted using a deployment platform's native format, which was previously available only for time axis labels. The native format is used via platform-specific escape strings, with different formats specified for different deployment platforms.
Touch interaction on mobile devices has been improved to allow scrolling and zooming an HTML page with two finger touch when a single finger touch is used by an application to perform a custom action in a GLG drawing, such as scrolling a chart or a map.
In previous releases, activating the touch mode for scrolling a chart via the SetTouchMode function on touch start cancelled default browser actions, such as scrolling or zooming the page. In the new release, it cancels default actions for a single touch, but still allows the browser to perform scrolling or zoooming the page on a two finger touch.
A new EnableMultiTouchDefaultAction function may be invoked to prevent all default actions in case if an application prefers to handle all multi-touch sequences itself.
A new Angular Axis object renders a circular axis with ticks and labels. This axis is used in radial gauges. It is similar to the linear Axis object used in charts, except for the round shape of the axis.
The new axis also can display a value band (a colored sector that indicates the gauge's current value), as well as color bands - colored sectors representing range thresholds. The range thresholds may be defined using either absolute values or percentages.
All radial gauge widgets, such as dials, meters and avionics widgets, have been redesigned to use the new Angular Axis object. A single Angular Axis object replaces multiple series objects previously used to render axis' ticks, labels and range thresholds. It also provides more convenient access to and better control over the tick and label properties.
The new axis also supports additional features previously available only for chart axes. For example, major tick labels may be positioned at round intervals, while the axis may start and end at any exact nonround value. It also supports both major, middle and minor ticks.
Support for delayed activation has been added to the GlgButton interaction handler. The activation delay is used in mission-critical applications to make sure a button or toggle is not activated by accident. A user has to keep the button or toggle pressed for a predefined time interval (delay interval) in order to activate it.
A delay timeout in seconds is defined by an optional DelayInterval resource of a button or toggle. The delayed activation is enabled if DelayInterval is greater than zero.
When a user presses a button or toggle with delayed activation, a delay timer is started and the widget changes its appearance to indicate the delay state. If the user releases the mouse or moves it away from the widget before the delay timer expires, the button or toggle resets its state without being activated.
When the delay timer expires, buttons and toggles that are activated on button press (ActOnPress=1) are activated right away. Buttons and toggles that are activated on button release (ActOnPress=0) change their appearance again to indicate that the delay has expired and the widget will be activated when the button is released. The user can still abort the widget action by moving the mouse outside the widget and then releasing the mouse button.
Button and toggle widgets with the DelayInterval parameter use the DelayState resource to change their appearance to indicate their state of readiness. This resource can control colors of the widget to provide visual cues about the widget delay state.
The DelayState resource is set to 1 when the delay timer starts. For widgets that are activated on button release, the resource is set to 2 when delay expires and the widget is ready to be activated when the mouse is released. The resource is reset to 0 when the widget is activated or the delayed action is aborted.
A new FIXED_BOX text object type has been added to better support text objects inside rectangular areas. Unlike the FIXED text object that has a single control point, the FIXED_BOX text has two control points that define its box. The text is anchored on the boundaries of the box according to its Anchoring attribute setting.
For example, if the control points of the FIXED_BOX text are positioned in the corners of a viewport, the text could be anchored on either the left edge, the center or the right edge of the viewport by simply setting its Anchoring attribute. Achieving this using the FIXED text would require adjusting the position of its control point in addition to changing its Anchoring. The new Value Display widgets use this new text type.
Same as the FIXED text, the FIXED_BOX text object may scale with the drawing depending on its TextScaling attribute setting, so that its font size changes to match the size of the box. When a drawing with several scaled FIXED_BOX text objects is resized, all text objects will change their font size uniformly regardless of the size of their boxes. This is a better alternative than using the FIT_TO_BOX text object, which required complicated constraints to accomplish the same result.
Support for the AnchorOffset attribute was added to the TRUNCATED, WRAPPED and FIT_TO_BOX text objects. The AnchorOffset attribute defines a pixel offset that may be used to fine-tune position of text objects located inside rectangular areas. In previous releases, this attribute was supported only for the FIXED text object and ignored for all other text object types.
In the new release, the stock List transformation may have two forms: with or without the NumListItems attribute that controls the number of items in the list. Changing the value of NumListItems changes the number of items in the list, adding or deleting elements from the list. This makes it easier to change the number of colors at run time and without the need for the GLG Extended API.
When a new stock list transformation is created in the Graphics Builder, the Options, Enable NumListItems menu option controls the presence of the NumListItems attribute. This option is disabled by default. For existing list transformations, the Edit, Xform List NumItems menu option may be used to add or delete the NumListItems attribute.
For list transformations without the NumListItems attribute, list items may be added or deleted using the corresponding buttons in the list editing dialog. For list transformations with the NumListItems attribute, list items may be added or deleted only by changing the NumListItems value.
If list elements have public properties attached, the names of public properties of the newly added elements will be automatically assigned for the convenience of editing. The public property names of new elements are generated by adding a zero-based item index to the base name of the public property of the last element in the list. The base name is formed by cutting out the trailing digits. For example, if the last list element's public property name is Color5, the base name will be Color and the newly added elements will have public property names Color6, Color7 and so on.
The logic of variable number of items described above is also supported for other transformations with an item list, such as Threshold and Map.
In the previous releases, the number of items of the predefined List transformation could not be changed in the HMI Configurator after the transformation has been created. The number of items in the list could be changed only in the Graphics Builder.
In the new release, the predefined List transformations are always created with a new NumListItems attribute that makes it possible to change the number of elements in the HMI Configurator. When editing predefined List transformations created in the previous releases, an Add Colors button in the transformation editing dialog may be used to convert the transformation to use NumListItems attribute which allows to change the number of list items.
The resource hierarchy of the converted transformation is changed to group list items. If an application relies on the exact resource hierarchy of the predefined List transformation, the ConvertPredefinedDynamicsResources property in the GLG configuration file may be set to 0 to preserve the resource hierarchy.
The new Clipping attribute of light viewport object can be used to control clipping of the objects inside the light viewport. If its value is set to NO, the objects inside the light viewport will not be clipped and can extend outside of the light viewport boundaries defined by its two control points. If the viewport background is also switched off, the light viewport will behave like a group object, but a group with its own coordinate system.
When Clipping=NO, the light viewport bounding box returned by the GlgGetBoxPtr method will encompass the bounding boxes of all objects inside the light viewport and will not be limited by the box defined by the light viewport's control points. This enables mouse selection of child objects extending outside of the light viewport. However, the light viewport mouse events will be reported only for the rectangular area defined by the light viewport control points.
A new Category attribute of the Export Tag object makes it possible to group public properties by categories, such as Colors, Ticks, etc. If an object's public properties use categories, the top level of the object's public properties dialog will display a button for each of the categories. Clicking on a category button displays public properties in that category. Any public properties without an assigned category will be displayed as a flat list at the top of the dialog.
Using categories makes editing object more convenient and minimizes amount of scrolling in the Public Properties dialog. For example, instead of displaying a large number of public properties for complex objects, such as dials and meters, only the most important properties, such as Value, High and Low, are displayed. The rest of the properties are grouped by category with only the category buttons displayed at the top level of the dialog. The properties of each category can be accessed by clicking on the category button.
When querying an object's public properties via the GlgGetTagObject function, the by_name parameter may be set to False to get a list of all export tags of a particular category specified by the search_string parameter.
NOTE: The category string should not contain the forward slash character, which is reserved for extending this functionality in future releases.
A new inversed binding type (BOUND_INV) option of the Global attribute makes it possible to define a value in a subdrawing and use this value to control parameters of other objects in the drawing.
The direct binding (BOUND) is used to pass a parameter value from a drawing to a subdrawing, to control parameters of objects in the subdrawing by a value defined in the drawing.
The inversed bound type accomplishes the reverse, passing a parameter value from a subdrawing to the drawing, to control parameters of objects in the drawing by a value defined in the subdrawing. Same as for the direct binding, the inversed bound attribute can be found in the subdrawing's Bindings, and attributes of other objects in the drawing can be constrained to it to use its value. If the value of the inversed bound attribute is changed in the subdrawing, the attribute values of objects in all drawing that are constrained to that subdrawing attribute will inherit the new value defined in the subdrawing.
In previous releases, a subdrawing's Public Properties dialog listed all public properties defined inside the subdrawing template. Changing the properties' values had no permanent effect, since it changed only the instantiated copy of the subdrawing template, and not the template stored in the file. The changes disappeared after the drawing was reset or reloaded.
In the new release, only bound public properties of a subdrawing or a subwindow are displayed in the Public Properties dialog. These are the only properties whose changes may be saved.
A new Export Prefix attribute of the reference object makes it possible to differentiate between public properties of multiple instances of the same subdrawing. If a subdrawing has public properties, and a custom component contains several instances of the subdrawing, the component's Public Properties dialog will show several instances of each public property, one for each subdrawing instance.
The Export Prefix attribute of each subdrawing instance may be used to define a string that will be used as a dot-separated prefix added to the names of that instance's properties. For example, if the subdrawing template has a public property named Value, and two instances of the subdrawing have Export Prefix set to SD1 and SD2, the subdrawings' public properties will be listed as SD1.Value and SD2.Value. This allows the user to differentiate between properties that control different subdrawing instances.
The new ValueObj parameter of the Set State action provides an option to define the value that is set when the action is activated. The Reset State action has been removed, since the Set State with the value of zero can be used instead.
When a drawing with the Reset State action from an older GLG version is loaded, the action will be automatically converted to the Set State action with a zero value, preserving the backward compatibility.
To differentiate between the Click and Ctrl-Click activation for the Set State actions activated on both Click and Ctrl-Click events, the value that is set is increased by 1 when the action is triggered by Ctrl-Click.
A new FlatType attribute was added to the Arc object to make it easier to edit two-dimensional arcs and circles. The attribute is set to YES by default, which disables the arc's Vector control point and leaves only a single Center control point. The attribute may be set to NO to enable the Vector control point. When loading drawings with arcs from previous releases, the FlatType attribute of arcs is automatically set to YES for flat arcs in the XY plane, and to NO for arcs that are rotated.
Three new marker rendering types have been added: a diagonal cross, a dash (horizontal line) and a vertical bar.
A new Anchor Offset attribute of a marker object is similar to the Anchor Offset attribute of the text object and allows to position the marker with a screen pixel offset relative to the marker's control point.
The new libglg_x11.a library improves handling of X11 visuals to better support the use of the GLG OpenGL renderer in Qt and Gtk environments on Linux.
This makes it possible to use QWidget as the base class of the QGlgWidget regardless of the GLG renderer type: GDI or OpenGL. In the previous releases, the QGLWidget or QOpenGLWidget base class had to be used to work with the GLG OpenGL rendeder.
The new library also makes it easier to use GLG OpenGL renderer in the Gtk integration. In previous releases, workarounds had to be used to get the OpenGL renderer working in the Gtk integration.
New Qt RealTime Chart and Qt Simple Viewer examples demonstrate using GLG features in the Qt environment. The new examples contain source code and are located in the integration/qt_5x_glg directory of the GLG installation.
GLG Real-Time Chart widgets are composed of a viewport object containing a Chart object inside. To access the chart's properties in previous releases, if was necessary to either use the Hierarchy Down button to go "down" into the viewport or to move editing focus inside the viewport in order to select the Chart object.
In the new release, the Public Properties dialog of the chart widget contains the Edit Chart button for accessing the chart's properties directly. If the chart has a legend, the dialog will also contain the Edit Legend button.
In contrast, the Properties dialog of the chart widget viewport displays only the viewport's attributes.
The Chart object's tick intervals and sizes are now contained in a separate property page accessible by the Tick Interval & Size button in the Properties dialog. With the introduction of the support for the axis middle tick, the separate property page allows to handle increased number of tick types without cluttering the main property page.
In the new release widgets inserted from widget palettes into resizable drawings are adjusted to maintain the same visual size regardless of the size of the window they are inserted too. Previously, widgets inserted in a small viewport would appear small, and vice versa. In the new release, the inserted widgets will always initially appear in the same size and may be resized by the user as needed. The initial size is the size of the widget as it appears when the widget file is loaded in the Graphics Builder with the default window size 800x600.
A new Palettes, Adjust Widget Size menu option may be used to disable this feature. If an application uses custom widgets of a defined size which are not supposed to be resized by the user, the Adjust Widget Size feature may be disabled to make sure that all widgets appear in their original design size regardless of the size of the GLG Editor window.
A new Palettes, Use Light Viewports menu option controls the type of a viewport to be used for viewport-based widgets inserted in the drawing from widget palettes. If the option is checked, the widgets will be converted to use light viewports. The option is unchecked by default. The default may be changed via the UseLightViewports variable in the GLG configuration file.
The Edit Group Elements feature of the Graphics Builder is used to set resources of multiple objects deep inside a group hierarchy using a resource path. In previous releases, this option was enabled only for groups and not for other composite objects, such as viewports or persistent series.
In the new release, it has been extended to allow setting resources of a single object. This makes it possible to set resources of objects inside any composite object without creating a temporary group to enable the Edit Group Elements feature.
The dialog that displays parameters of the Send Command action in the Graphics Builder now includes fields that display parameter names. This makes it easier to examine and edit parameter names used for programmatic access to the command action.
The Object menu of the HMI Configurator contains a new Disable User Interaction button that removes a widget's interaction handler. It can be used to disable user interaction for widgets such as dials and meters, making them output-only.
The Reset Scaling Xform Option was added to the Edit menu of the HMI Configurator to allow the user to reset subdrawings to their original geometry after they have been resized. In previous releases, this option was available only in the Graphics Builder.
A new Value Display widget palette contains a number of new value display widgets in a variety of shapes and formats. The new widgets provide the AlarmStatus resource that may be set to a value different from 0 to indicate WARNING, ALARM or some other widget status by changing widget colors. The NumStatusColors resource may be used to change the number of status colors.
Both fixed and scalable versions of each widget are provided.
Fixed size widgets have parameters that define their width and height in screen pixels, and their size does not change when the drawing is zoomed or resized. Fixed size widgets also have parameters that define position of their attachment point.
The size of scalable widgets is defined by their control points and can be adjusted using the mouse. Scalable widgets scale with the drawing when the drawing is zoomed or resized. The widget's TexScaling parameter may be set to enable text scaling when the drawing is resized.
Over half a dozen of new tank widgets have been added to the Process Control widget set. The new widgets have 3D look and feel, an integrated tank level indicator bar, as well as level value display indicator. Both indicators can change colors to indicate the tank status, which is controlled by their LevelAlarmStatus and LabelAlarmStatus resources.
Some of the new tanks use a new type of widget geometry management, as each tank consists of three separate objects: the tank itself, the level bar indicator and the level value indicator. These objects are still connected, so that moving the tank moves both indicators with it, and changing the tank level value is reflected in both indicators. However, each indicator can be selected and edited to adjust its position and size.
New parametric conveyor widgets with elaborate animation provide parameters that allow the user to change the conveyor geometry, including length, angle, wheel radius, etc. The conveyor belt is animated to move the belt as well as the items on top of it. The animation can be enabled or disabled by the application, and application-defined colors are used to indicate alarm conditions.
All meter are dial widgets have been redesigned to use the new Angular Axis object, which simplifies widget design, increases update performance and makes it easier to edit widget parameters. A dozen of new dial and meter widgets have also been added to the Controls widget set.
All widgets have been changed to use the new public property category feature. This allowed to increase the number of available public properties without overwhelming the Public Properties dialog with large number of scrollable properties. Unified category names also makes widget editing more intuitive.
A sample button with a delayed activation has been added to the Push Buttons palette. Buttons and toggles with an activation delay are used in mission-critical applications to make sure a button or toggle is not activated by accident. A user has to keep the button or toggle pressed for a predefined time interval in order to activate it.
The buttons provide sample implementations of the delayed activation and the corresponding visual feedback. Any button or toggle from the GLG palettes can be modified to implement delayed activation by using the DelayInterval and DelayState resources described above.
The button can use a delayed activation on button press or a delayed activation on button release depending on the setting of the button's ActOnPress property. The button or toggle with a delayed activation changes its appearance to provide the visual cue for different states of its readiness.
A new NumColors parameter of the color indicator widgets makes it possible to add colors via the Public Properties dialog. This is especially convenient for the HMI Configurator users.
Several new angular axis widgets have been added to the Special Widgets palette. It includes angular axes with and without color bands that annotate range thresholds. The new angular axis objects make it easier to design custom dials and meters.
A visual feedback for the disabled state was added to all toggle and menu widgets. The widgets will be grayed out when they are disabled.
All avionics widgets have been changed to use a viewport object. This makes it possible to use these widgets as stand-alone drawings with the $Widget viewport. The Palettes, Make Widget Viewport Transparent menu option may be used to eliminate the viewport background.
A new GlgTraverseObjectsExt function allows an application to invoke custom functions when traversing object hierarchy. Each time a next object is traversed, application-defined functions will be invoked on starting and finishing traversal of each object. The functions will be invoked with an application-defined data that can be used to keep track of the traversal state.
For example, to keep track of hierarchy depth, the custom functions could increment a hierarchy level counter when entering a new object, and decrement it when exiting the object. This allows the application to keep track of various conditions, such as determining if an object is a child of a certain composite object, for example a child of a series.
GlgTooltipFormater is a global callback invoked before displaying a tooltip to allow an application to supply a custom tooltip string or disable the tooltip based on the application logic. In previous releases, the tooltip formatter was invoked only once per tooltip before the tooltip was popped up. In the new release, the formatter is invoked twice: when the tooltip is displayed and also when it is erased. This makes it possible to have a global mechanism for tracing a tooltip being displayed and erased. Previously, this functionality required adding custom logic in each input callback.
The new functionality is controlled by the GlgTooltipFormatterOnErase global configuration resource. If it is set to 0, invoking the formatter on erasing the tooltip is disabled for backward compatibility. If it is set to 1, the formatter will also be invoked with NULL parameters when a tooltip is erased.
The method takes the data sample as a parameter and returns the value of its field, such as sample value or sample time stamp, specified by the method's type parameter.
A new GLG_DISABLE_OPENGL environment variable may be used to disable the OpenGL driver for C/C++ deployment. The variable can be set to true to disable OpenGL. It provides an easier to use alternative compared with the GLG_OPENGL_MODE variable.
A new -palette-file option of the gconvert drawing conversion utility may be used to convert all widget drawings in a .pal palette file specified by the option.
All binary executables on Linux have been compiled with _FORTIFY_SOURCE=2 to further harden them against buffer overflow attacks.
Fixed saving image on Windows when using OpenGL driver in the core profile mode. The problem was related to limitations of the Windows OpenGL driver that doesn't allow drawing into off-screen bitmaps. In the new release, the software-based OpenGL is used when saving an image with an OpenGL driver.
Coordinate rounding of viewport and light viewport control points was fixed to make sure they always shifted in the same direction regardless of the sign. In previous releases, coordinate value of both 0.5 and -0.5 rounded to the same value of 0, resulting in visual artifacts in some drawings. A new GLG_PRE_4_2 value of the GlgCompatibilityMode enum may be used to disable the new behavior for drawings that rely on it.
Fixed native widgets, such as text input fields and native buttons, not changing their visual appearance due to the changed dimming of their parent on Linux/Unix. Previously, their visual appearance was changed only if the drawing was reset. In the new release, the change happens right away after the Update call.
Improved handling of multiple screens for GLG popup dialogs that use a child viewport with the ShellType attribute set to DIALOG_SHELL or APPLICATION_SHELL. Previously, the dialog appeared on the default screen. In the new release, the dialog appears on the same screen as its parent viewport.
Fixed dongle ft.rules not working on newer Linux distributions, such as Ubuntu 20.04. An updated ft.rules file is provided in the new release.