|
The 4.1 release introduces a number of new features, including:
Filled line plots are now supported in a real-time chart. The fill is activated by editing plot's attributes and changing FillType to FILL or FILL & EDGE. The FillColor attribute controls the fill color, and the Opacity attribute can be used to define the plot transparency.
A level object is a horizontal line that annotates some value threshold in a chart. A band level object contains two horizontal lines (one for minimum value and one for maximum) with a filled area in between the lines. Similarly, a band timeline contains two vertical lines with a filled area between them.
A new LevelType attribute controls the style of levels and timelines, and may be set to either LINE or AREA for the band versions. The band versions of these objects have two attributes that define position of each edge line, as well as additional FillType and FillColor attributes. Semi-transparent bands may be used for rendering intersecting bands.
To better control the drawing order of band levels and timelines, their drawing order is now controlled by their DrawOrder attribute, which allows to control the drawing order of each individual level or timeline. In addition to IN FRONT OF PLOT and BEHIND OF PLOT values, the attribute may also be set to SPLIT, in which case the fill of band levels and timelines will be drawn behind the plots, while their edge lines will be drawn in front of the plots. In the previous releases, the draw order of all level lines and timelines was controlled by the chart's DrawOrder attribute.
In the previous releases, chart autoscaling could be used to increase plot ranges when the new value goes outside the plot's range. In the new release, the autoscaling can also be used to decrease the chart range when a data sample with a large value falls out of the chart due to scrolling, and the remaining plot data samples fit in a smaller range. The autoscaling also supports scaling the visible part of the chart to adjust chart ranges when the chart is scrolled, to make sure the data samples in the currently visible part of the chart utilize the full vertical extent of the chart.
The new AutoScale chart attribute controls autoscaling and may be set to SCALE UP, SCALE UP & DOWN, SCALE VISIBLE or DISABLED. The SCALE UP & DOWN and SCALE VISIBLE options consume more CPU resources and may slow down scrolling charts with a large number of data samples.
New AutoScaleLow and AutoScaleHigh attributes of a plot may be used to define a minimum range extent that should always be shown. The existing AutoScaleDelta attribute of the chart defines the minimum value difference that triggers range change due to autoscaling.
Scrolling charts with large number of data samples need to access data samples in memory, making applications that use them memory-bound. Performance of such applications depends on the data samples memory layout: if adjacent data samples are located in continuous memory locations, it will minimize memory cache misses and will increase scrolling performance.
When an application uses multiple scrolling charts with a large number of datasamples updating in random order, it may cause data samples mixing up in memory. When the chart data buffer fills up, pushing a new data sample into the chart will cause a data sample at the other end of the buffer to fall out. Depending on the order in which charts are updated, data samples that are pushed out from one chart may be used in another chart. This will result in data samples in a chart being placed in non-continuous memory locations.
In a long-running application with multiple charts, the memory mix up will gradually increase, causing a lot of cache misses and resulting in gradual performance degradation over time, which is unacceptable in real-time applications. This effect is the most noticeable in C/C++ applications.
A chart data sample cache provides a solution by keeping data samples that fall out of a chart plot in a plot cache, to be used in the same plot when new data samples will be pushed in. A per-plot cache is implemented as a FIFO queue, which preserves the relative order of datasamples in a chart, minimizing memory cache misses and preventing performance degradation over time.
A plot's CacheUse attribute controls the use of a cache. It could be set to DISABLED for charts that display a small amount of data and/or are not continuously scrolled for a long time. Otherwise, it may be set to PREALLOCATED, which prefills a cache with data samples on start-up depending on the chart's buffer size (which must be set to a positive value), and places all data samples that fall out from the plot in the cache. The ENABLED setting is a compromise: the cache is not pre-allocated, but the data samples that fall out of the plot are still stored in the cache for reuse.
The GLG_CHART_CACHE_USE environment variable (for C/C++ applications) and the GlgChartCacheUse global configuration resource (for all environments) may be used to provide a global cache setting for all application's charts, which will override the plots' CacheUse attribute setting. This provides a convenient way to test application performance with and without a cache.
The GLG_CHART_CACHE_EXTRA_SAMPLES environment variable (for C/C++ applications) and the GlgChartCacheExtraSamples global configuration resource (for all environments) may be used to define a number of extra data samples created when a cache is prefilled. This number should be greater than the number of data samples pushed into each individual plot between GlgUpdate invocations used to display the changes. The size of the preallocated cache will be equal to the chart's buffer size plus the number of extra data samples.
When pre-filling charts that use chart cache, the new GlgCreateDataSampleNode and GlgAddDataSampleNode methods should be used instead of the deprecated GlgAddDataSample methods. If a chart plot is provided as a parameter of the GlgCreateDataSampleNode method, the method will return a data sample node from a plot cache (if any). More information on these API methods is provided in the New API Methods chapter.
The new GlgAddDataSampleNode method has a quick_mode parameter. Setting the parameter value to true activates the quick prefill mode, which bypasses autoscaling and scrolling for faster prefilling. The performance difference of the quick mode is especially profound in the JavaScript environment.
Since the quick mode bypasses scrolling, the chart may need to be scrolled when prefilling is finished. This may be done by setting its X Axis' EndValue to the time stamp of the last filled datasample.
The new demo demonstrates a custom real-time chart page with stacked charts, where a user can select variables to be displayed in the charts. Each variable is displayed in a separate chart with its own Y axis, but with a shared Time axis, so that all charts are scrolled together. The charts are stacked vertically. When a user adds or deletes a variable, the height of the displayed charts is shrunk or expanded to fill the available area (implemented via the new layout features of square series described below).
When the mouse is moved over one of the charts, vertical lines that trace the mouse position are displayed in all charts. The cursor feedback also includes tooltips that display value of each variable at the time corresponding to the mouse position. The demo also demonstrates interactive zooming and scrolling of charts with a shared time axis.
A new feature of reference objects (such as containers and subdrawings) makes it possible to define attachment points. The attachment points can be used for attaching other objects, for example, attaching pipes to tanks or valves that are defined as subdrawing or container objects. When using attachment points, the end of a pipe will stay connected to the exact position defined by the attachment point, with no need to precisely position the end of the pipe to coincide with the desired position in a subdrawing.
For example, if a valve with a pipe attached to the attachment point is moved, the end of the pipe will move with it. If the pipe is moved, the valve will move with it as well. All process control, electrical and electronic widgets have been modified by adding attachment points for convenience.
In the HMI configurator, the Magnetic Mode (enabled by default) simplifies connecting lines that represent pipes and wires to the attachment points of the widgets, such as tanks, valves or electric switches.
In the Graphics Builder, point constraining may be used to attach connecting lines to attachment points.
When connecting pipes and wire lines to widgets in the HMI Configurator, all valid connection points of an object are now highlighted when the mouse moves over an object. In the Graphics Builder, similar highlighting is activated when constraining connecting lines. This is described in more detail in the Editor Interface Enhancements section below.
In the Enterprise Edition of the Graphics Builder, attachment points can be added to any reference object using Edit, Add Attachment Point menu. The Use Point point creation mode may be use to position attachment point at the exact position of some control point inside the reference. When the Use Point mode is in effect, all points inside the reference that may be used for this operation are highlighted when the mouse moves over the reference.
The Options, Selection Options, Show Attachment Points menu option controls if the attachments points are displayed in addition to the object's control points when the object is selected in the Graphics Builder or HMI Configurator.
The attachment points are "glued" to the object and maintain their relative position when a reference object is resized. The Attachment Points button in the reference object's Properties dialog provides access to the list of the object's attachment points, where a user can delete attachment points as needed.
By default, when the attachment point is moved in a Graphics Builder, it moves the reference object it is attached to. The Edit, Move Attachment Point menu option can be used to change it, so that instead of moving the reference object, the attachment point is moved to adjust the point's position relatively to the reference object.
New methods to create and manipulate attachment points at run time were added to the GLG Extended API. These methods are described in the New API Methods section below.
The new feature is also useful for diagramming applications. The GLG Diagram Demo has been refactored to use attachment points, which reduced the amount of the demo source code.
The Magnetic Mode assists the user in connecting pipe and wires to the corresponding attachment points of process control and other widgets, such as tanks, valves, electric switches or transformers. When a new pipe, wire or other object is drawn in the Magnetic Mode, the Configurator highlights all available connection points of an object (including its control points and attachment points) when the mouse moves over the object. When the user clicks on any highlighted point, the end of the polygon representing the pipe or the line is constrained to it.
The user can use Control-click to position the polygon point in the vicinity of a connection point without constraining. The Options, Magnetic Connection Points menu may be used to disable Magnetic Mode, as well as modify it to use the position of a highlighted connection point without constraining to it. The Magnetic Mode default can also be changed using the MagneticMode variable in the glg_hmi_config file.
The Highlight Mode assists the user in constraining or using control points. It is active by default and highlights all control and attachment points of an object under the mouse in the Constrain and Use Point Creation modes. When the user clicks on a highlighted point, it is constrained to, or its position is used based on the current Point Creation mode. The Options, Highlight Control Points menu option can be used to enable or disable the Highlight Mode. The Highlight Mode default can be changed using the HighlightControlPoints variable in the glg_config file.
New Arrange, Delete Data Tags and Arrange, Delete Public Properties menu options of the Enterprise Edition of the Graphics Builder may be used to delete either all data tags or all public properties of the selected object.
The -delete-data-tags and -delete-public-properties of the GLG drawing file conversion utility may be used to delete all data tags and all public properties from all objects in a drawing in batch mode.
A new GlgDeleteTags API method may be used to perform these actions at run-time.
The new Edit, Keep Edit Ratio menu option of the HMI Configurator may be used to control the edit ratio of the drawing. If set, the drawing X/Y ratio is preserved to avoid stretching the shape of circles and other objects in the drawing. This option is set by default when creating new drawings, but is useful when editing older drawings that didn't set this attribute.
The new File, Load Template option was added to both the HMI Configurator and the Graphics Builder. The new option is similar to the File, Open option for loading a drawing. However, the Load Template option doesn't allow the user to save the modified drawing back to the same file, to avoid accidentally overwriting the drawing used as a template for creating other drawings.
In the previous release, the integrated scrollbars for scrolling and panning were supported only for the viewport objects. In the new release, this functionality is also extended to include light viewports. The light viewport's Pan attribute controls the integrated scrollbars the same way as the Pan attribute of a regular viewport. The GIS and Chart Zooming modes are now also supported for both regular viewports and light viewports.
Since native scrollbars use a window, and the light viewport is a light-weight component that doesn't use a window, native scrollbars in a light viewport may bleed through other light viewport siblings positioned on top of the light viewport. To avoid it, both window-based and light viewport-based scrollbars are now supported. The light viewport-based scrollbars do not bleed through other light viewports in front of this light viewport, while window-based scrollbars decrease CPU load by isolating scrollbar graphics in a separate window.
The ScrollbarType attribute of a regular viewport or a light viewport defines the type of a scrollbar to be used for the viewport and may be set to the following values:
The GLG_NATIVE_SCROLLBARS environment variable and the GlgNativeScrollbars global configuration resource may be used to disable native scrollbars and replace them with the GLG viewport-based scrollbars. By default, native scrollbars are disabled in the Qt and Gnome integrations, as well as in the JavaScript environment, and are enabled in C/C++, Java and C#. The integrated scrollbars saved with the drawing are automatically adjusted as needed when the drawing is displayed in different runtime environments. An application can also supply custom scrollbars using the GlgVScrollbar and GlgHScrollbar global configuration resources.
The GLG_NATIVE_SCROLLBAR_WIDTH environment variable and the GlgNativeScrollbarsWidth global configuration resource may be used to control the width of native scrollbars, while the GLG_SCROLLBAR_WIDTH environment variable and the GlgScrollbarsWidth global configuration resource may be used to control the width of the GLG scrollbars.
The new feature of a square series object makes it possible to use it as a layout manager that changes the layout of its elements when some elements become invisible. For example, if a drawing contains several charts, this feature may be used to extend the charts to fill vacant space when visibility of some charts is set to OFF by the user.
A square series replicates its template in a number of rows and columns, so that each template instance (element) is located in a kind of a "cell". The new HandleInvisible and FillSpace attributes of the series define the way the series lays out visible elements when visibility of some elements changes. The HandleInvisible attribute controls shifting of the elements to fill the vacant space of invisible elements, and may be set to shift elements across all rows and columns, or to shift elements inside of either rows or columns, or both. The FillSpace attribute may be used to either increase the row height to fill the free space of invisible rows, or increase the column width to fill the free space of invisible columns, or both.
A new Combo Chart Demo described above uses this new feature to control the layout of stacked charts. The demo displays charts for various variables, allowing the user to select the variables to be displayed in a chart. When charts are enabled or disabled, the size of the displayed charts shrinks or expands to adjust to the available space and fill the gaps formed by the disabled charts.
The new transformation makes it simpler to define colors that are dependent on other colors. For example, a button with a gradient may automatically adjust the gradient color when the button color changes, using a darker gradient color for bright buttons and lighter color for darker buttons.
The Color Scale transformation allows to define a color that is lighter or darker than the base color. Its BrightAdjustment attribute defines the adjustment coefficient for bright base color, and DarkAdjustment defines adjustment coefficient for light colors. When the base color defined by the BaseColor attribute changes, the transformation automatically uses the appropriate coefficient depending on the brightness of the base color. The MinBrightness attribute defines the brightness threshold below which the color is considered dark. It may be set to a negative value, such as -1, to disable handling of dark colors and to consider all colors bright. The PreserveHue attribute controls if the color hue needs to be preserved when the color's RGB components are scaled out of range and need to be clipped.
The new transformation is similar to the existing Pixel Offset transformation. Unlike the offsets of the Pixel Offset transformation, the offsets of the new transformation and their directional axes are preserved and do not change when the drawing is zoomed, or when the object containing the transformation is scaled or rotated. The new transformation is used by the new Electrical and Electronic Circuit Symbols widget set.
The Linux GLG Qt integration now supports native Qt input objects inside a GLG drawing, such as native buttons, text and combo boxes, sliders and list objects. These objects will be rendered as corresponding Qt objects when the drawing is displayed. In previous releases, native input objects in GLG drawings in Qt environment were supported only on Windows, and not on Linux.
The new integration also supports GLG Browser widgets that utilize native input objects, such as a Resource Browser, a Tag Browser, an Alarm Browser, a Data Browser and Font Browsers.
The new integration also uses the QGLWidget base class instead of QWidget to better support OpenGL rendering. If OpenGL is not used, GLG_OPENGL variable in the project file may be set to false to use QWidget as a base class.
The README_UPGRADE_4_1.TXT file in the Qt integration directory contains information on how to migrate code from the pre-4.1 versions of the Qt integration files.
Text input and other native input objects in both the Graphics Builder, the HMI Configurator, as well as GLG drawings at run time in Linux environment now transparently support UTF-8 and other locales without a need to change font settings.
The glg_x_resource_file file in the GLG src directory contains default XFT font settings used by the native input object in both the GLG editors and the GLG drawings at run time. These settings may be changed as needed, and the resource file can be placed in the directory of the executable or in the .glg_x_resource_file file in the user's home directory.
The GLG_X_RESOURCE_FILE environment variable, the GlgXResourceFile global configuration resource and the -glg-x-resource-file command-line option may be used to specify location of the resource file.
If needed, the GLG_NATIVE_WIDGETS_XFT environment variable, the GlgNativeWidgetsXft global configuration variable, as well as -glg-disable-native-widgets-xft and -glg-enable-native-widgets-xft command-line options, may be used to disable XFT fonts in native input objects on Linux/Unix for backward compatibility.
In the previous releases, line anti-aliasing was dependent on the graphics card support, which is optional in OpenGL core profile version 3.x and higher. Some high-end graphics card (such as NVidia) provide dedicated hardware that supports line anti-aliasing, while other cards (such as some ATI graphics cards and integrated Intel GPUs) do not support this feature.
The new release added an option of using shader-based anti-aliasing, which allows to consistently support line anti-aliasing over a range of graphics cards, regardless of the line anti-aliasing support in the card's OpenGL driver. The shader-based anti-aliasing requires a graphics card that supports OpenGL version 3.0 or higher.
By default, the GLG OpenGL driver detects if line anti-aliasing is supported by the graphics card. If it's not supported, the shader-based anti-aliasing is automatically activated. The shader-based anti-aliasing is also used for line widths that exceed the maximum line width supported by the card.
Some cards (such as some ATI cards) implement line anti-aliasing that is of a lower quality compared with the GLG shader-based anti-aliasing. Depending on the requirements, an application can chose either native line anti-aliasing provided by the graphics card for faster performance, or shader-based anti-aliasing for better rendering quality.
The GLG_OPENGL_NATIVE_LINE_AA environment variable and GlgOpenGLNativeLineAA global configuration resource may be used to explicitly control the type of line anti-aliasing to be used: native anti-aliasing capabilities of the graphics card, or the shader-based anti-aliasing.
The new GlgOpenGLHardwareVendor and GlgOpenGLHardwareRenderer global configuration resources may be used to query the vendor and renderer strings for the hardware OpenGL, while the GlgOpenGLSoftwareVendor and GlgOpenGLSoftwareRenderer provide information about the software OpenGL. These resources will be set after the viewport that uses a corresponding OpenGL driver is drawn the first time.
Applications deployed in the cloud may require a custom load method that may handle application state and authentication. A cloud application can use a custom method for loading the main drawing. However, if the drawing contains subdrawings, they could not be handled by the application code.
The CustomLoadFunc callback provides a solution. If defined by the application via the SetCustomLoadFunc API method, it will be invoked for every subdrawing load requests, providing the application an opportunity to use its own custom loading method to load the subdrawing. If necessary, the callback can also be used to modify the URL loading path at run time before it is used to load subdrawings or other assets.
The custom load callback will also be invoked for any other load requests from LoadObject, LoadWidget and LoadAsset methods, so that these requests can be handled uniformly. To switch an existing application to use a custom load method, the application can simply define a custom load callback at the start and provide custom load code inside the callback. The custom load callback will be invoked for all load requests with the URL of the resource to be loaded as a parameter. Based on the URL, the application can choose to load some resources using a custom method, and let the GLG engine load the rest of the resources.
In the new release, the ArrowShape rendering attribute allows the user to fine-tune the position of a polygon's arrow. The Z coordinate of the attribute is used as a pixel offset that shifts the arrow along the polygon from its original position.
A new zooming feature allows the user to zoom either the GIS map or the GLG drawing using the current mouse position as the zoom center, which mimics the way Google Maps zooming works. While the existing 'i' and 'o' zoom keys perform zoom in and zoom out operations with zoom center at the center of the drawing, the new 'I' and 'O' zoom keys zoom in and zoom out using the current mouse position as the zoom center. This ensures that the point of interest under the mouse stays in place and does not move outside of the visible area. Zooming relatively the current mouse position is supported for both regular zooming and the GIS zoom mode.
A new Electrical and Electronic Circuit Symbols widget set is now available. The new widget set contains several palettes containing electric switches and relays, transformers, fuses, resistors, capacitors, diodes, transistors, logic gates and many other electric and electronic symbols.
Several new styles of toggles and sliders, as well as new rectangular buttons with rounded corners were added to the Controls widget set. Two new spinners with "-" and "+" instead of arrow buttons were also added to the Special Widgets.
The numerical text input widgets on Windows can now change their fill color to indicate error conditions, such as an out of range value or an invalid entry. Previously, this functionality was only available for other run-time environments, but not in C/C++ on Windows.
The new Line Caps attribute may be used to define the round or butt caps for polygons and other objects, such as splines and arcs. In the previous releases, there was no way to explicitly control line caps, and it was indirectly controlled by the line width attribute: lines with an even line width used butt line caps, and lines with an odd line width used round caps. In the new release, the LineCaps attribute may be set to AUTO to determine line caps based on the line width for backward compatibility with previous releases, or it may be set to either BUTT or ROUND to explicitly define a line cap of each line object.
When the line width of an object with the AUTO setting is scaled, it is always changed in increments of two to maintain the line cap type, the way it was done in the previous releases. When scaling line widths of objects with the BUTT and ROUND cap settings, the line width is changed in increment of one.
New API methods allow an application to create and manipulate attachment points:
New GlgSetEnd and GlgIterateBack API methods were added to simplify reverse traversal of elements in a container object, such as dynamic array, group or list. Functionality of these methods is similar to the functionality of the corresponding methods for forward traversing: GlgSetStart and GlgIterate.
The new methods speed up reverse traversal of GLG list objects compared to the reverse traversal implemented using the GlgGetElement method. This is useful for traversing a real-time chart's data buffer, which is implemented as a list object.
A new GlgIsAt method provides functionality for checking if the traversal reached the start or the end of the container.
New methods for prefilling charts were added to handle charts with a cache:
A new GlgDeleteTags method may be used to delete all object's data tags or all public properties of an object. The method can be invoked on a drawing's viewport to delete all tags or all public properties from all objects in a drawing.
The GlgCreatePointArray Intermediate API method has an additional parameter that defines the type of control points to query: control points or control and attachment points.
The GlgGetDataExtent method was deprecated and replaced with GlgGetChartDataExtent.
The GlgCreateDataSample and GlgAddDataSample methods were deprecated and replaced with the new GlgCreateDataSampleNode and GlgAddDataSampleNode methods.
New GlgGetNodeDataSample and GlgFreeDataSampleNode methods were added to facilitate efficient use of data sample nodes for prefilling charts.
In the previous releases, the GLG lib directory on Linux contained a static version of system libraries. In the new release, these libraries were moved to the lib/syslib directory, so that the shared libraries provided by the OS will be used by default for linking C/C++ executables.
Fixed opening files with a double-click on Microsoft Windows when the file path contained a space.
Added a workaround for a known XCB/X11 bug that generated "Unknown sequence number while processing queue" XCB assertion error.
Added GlgPublicPropertiesMaxNum global configuration resource and a GLG_PUBLIC_PROPERTIES_MAX_NUM environment variable to control the maximum number of public properties displayed in the Public Properties dialog. This prevents a slowdown when selecting a viewport containing a large number of objects with public properties.
Fixed handling of the CommonRange logic when new plots are added to the chart. The attributes of the newly added plots are now automatically linked with other plots to support the common range.
Fixed JavaScript of the LED value widgets to eliminate errors when used in a web browser in the strict mode.
Fixed a one sample gap on the newest side of a real-time chart when scrolling a plot with a filter.
Fixed processing mouse events on top of a window border (and other non-client areas) in C/C++ on Windows. To query if the mouse event came from a non-client area of a window, invoke GlgGetModifierState method with a new GLG_NON_CLIENT_AREA_EVENT_MOD parameter value.