Configuration¶
The JavaScript file webmicfg.js can be found in Library ‣ ATVISE ‣ Resources ‣ webmicfg.js and allows to set the following configurations used in the webmi.js. All of these configurations can also be set by using JavaScript (e.g.: webMI.setConfig("data.enablelongpoll", false);). The main difference is that setting these properties in the file will happen earlier than setting the configurations by JavaScript when the webmi.js is already loaded.
- "alarm.management.global": true/false (boolean) - default: false
If you don't use an atvise standard header with alarm log, set this property to true to enable firing of the alarm triggers.
- "data.enabledeletesession": true/false (boolean) - default: true
Setting this property to true will guarantee that deletesession will explicitly be called on unload event and the session will be deleted.
- "data.enablelongpoll": true/false (boolean) - default: true
Setting this property to false will cause that publish will not happen event-driven. The server will always respond in the defined interval ("data.publishinterval") on publish requests. By setting this property to true, "data.publishinterval" should be set to 0 so that publish will happen event-driven.
- "data.keepaliveinterval": 4000 (number/ms) - default: 4000
This interval is being used to check if the server is reachable by sending a "read" request. In the case that the server is not reachable the index.html will trigger an errorscreen. Further details according to the keepalive mechanism and the errorscreen can also be found in the Quick Dynamic Help for "AutoReconnect".
Attention
In case that you have a slow internet connection (e.g. GSM), you need to chose an appropriate interval especially for data.keepaliveinterval and data.requesttimeout to avoid the errorscreen being displayed permanently. To avoid this case try setting a timeout of 30000 (ms) for keepalive and requesttimeout.
The data.keepaliveinterval must always be smaller than data.sessionstimeout.
- "data.permissionlogsize": 100 (number of entries) - default: 100
Defines the maximum number of entries in the access control event log.
- "data.publishmaxresults": 0 (number/ms) - default: 0
Limitation for results in publish response (0 = without limit). If more valuechanges occurred than the limit is set to, only the latest valuechanges will be sent according to the limit.
- "data.publishinterval": 0 (number/ms) - default: 0
See "data.enablelongpoll" for more information.
- "data.requesttimeout": 3000 (number/ms) - default: 3000
When a request is being sent to the server a timeout with the defined timespan will start. If the server does not respond within this timespan a specific timeout callback will be called, which is internally handled in the webmi.js.
- "data.sessiontimeout": 1 - 60 (number/s) - default: 0 (= 60 seconds)
This timeout specifies how long a session will be alive without any interaction between client and server. After running in the sessiontimeout the session will no longer be valid which means that the server will not respond with data on requests. The server will respond with the message "Invalid Session or Digest".
- "data.url": "/webMI/?" (string) - default: "/webMI/?"
This paramater enables setting a URL for requests.
- "frame.alignment": "left", "center", "right", "top", "bottom" (string) - default: "center"
This parameter defines the alignment of the visualization if "autofit" is activated.
- "frame.displaytype": "xhtml", "svg" (string) - Standardwert: depends on server type
Defines the format of the visualization:
"xhtml": The displays are delivered as xhtml files. To use the atvise visualization without limitations in redundancy mode, this setting should be used. Default for atvise scada.
"svg": The displays are delivered as svg files. Default for generation of the visualization for webMI servers.
If a webMI server supports the mime type "application/xhtml+xml", this setting can be changed to "xhtml".
- "frame.documentdomain": true/false (boolean) - default: true (only relevant for atvise scada)
Provided that Fully Qualified Domain Names (FQDN) and redundancy mode is used, activate this setting to ensure that the atvise visualization switches automatically to another connection in case of a broken current connection.
The setting can be deactivated in standalone mode.
If activated, check HTML and SVG documents in Library ‣ ATVISE ‣ Resources and Library ‣ PROJECT ‣ Resources for the following code and - if missing - add it to the respective files:
<script src="/webmicfg.js" type="text/javascript"></script> <script type="text/javascript">/*<![CDATA[*/ var docDomain = true; var displaytype = "xhtml"; if ("webMIConfig" in window) { var config = window["webMIConfig"]; if ("frame.documentdomain" in config) docDomain = config["frame.documentdomain"]; if ("frame.displaytype" in config) displaytype = config["frame.displaytype"]; } if (displaytype != "xhtml" && displaytype != "svg") { displaytype="xhtml" } if (docDomain == true) { try { if (displaytype == "svg" && navigator.userAgent.indexOf("Firefox") > -1) throw false; var domain = location["hostname"].split(".").slice(-2); document.domain = domain.join("."); } catch (e) {} } /*]]>*/</script> <script src="/webmi.js" type="text/javascript"></script>
- "frame.enableautofit": true/false (boolean) - default: true
Setting this property to true will guarantee that displays will automatically fit to the browser window.
- "frame.languages"
Configuration object for sorting the languages available in the visualization (see Visualization - language switch). Following options are available:
sort (Boolean, default: false) – Enables or disables the alphabetical sorting of languages. If disabled, the languages are displayed in the order they were created in the project.
order (Array of strings, default: []) – Allows to specify a prioritized order of specific languages. The languages specified here using the two-letter ISO code will be displayed first in the list. All other languages are sorted alphabetically afterwards. This option is only applied if sort is enabled.
Example: The languages German (de), English (en), French (fr), Korean (ko), and Hungarian (hu) are defined in a project. The following configuration:
var webMIConfig = { "frame.languages": { "sort": true, "order": ["hu", "ko"] } };
will result in the following order of languages: Hungarian, Korean, German, English, French.
- "frame.rememberwindows": true/false (boolean) - default: false
Defines if the last position and size of dialogs is saved.
- "frame.scaletype": "zoom", "transform", "native" (string) - default: "zoom" or "transform"
Defines the type of display scaling that shall be used by browsers. If not set, either "zoom" or "transform" is automatically selected depending on the browser. Following settings are possible:
"zoom": CSS-based scaling using "zoom", supported only by Chromium-based browsers. May cause rendering issues in other browsers.
"transform": CSS-based scaling using "transform".
"native": Scaling by adjusting the size of DOM elements (compatible to versions before atvise 3.1.0).
- "frame.zoomtype": "", "legacy" (string) - Default: "" or "legacy"
Defines the specific "zoom" method for "frame.scaletype", as the scaling behavior changed starting with Chromium-based browsers version 128. If not set, the method is selected automatically based on the browser version. Following settings are possible:
"": The "zoom" method is determined automatically based on the browser version. Starting with Chromium version 128, the new "zoom" method is applied.
"legacy": Explicitly enables the compatibility mode for "zoom" to ensure proper scaling in Chromium-based browsers prior to version 128.
Any other value than "" or "legacy" activates the new "zoom" behavior. "frame.zoomtype" has no effect on other browsers which default to the "transform" scaling method (e.g., Firefox).
- "performance.measurement": true/false (boolean) - default: false
Enables or disables the performance measurement.
- "responsiveLite"
Configuration object for generated Responsive Design Lite displays. The configuration has following options:
active (Boolean, default: false) – Activates or deactivates the Responsive Design Lite Framework.
config (Object) – Detailed configuration as object with following options:
forceDevice (String, default: "") – Forces the deviceType property of
webMI.getClientInfo()to "desktop", "tablet" or "mobile".forceTouch (Boolean, default: false) – Forces the isTouchDevice property of
webMI.getClientInfo()to true.ignoreTouch (Boolean, default: false) – Forces the isTouchDevice property of
webMI.getClientInfo()to false.mobile (Boolean, default: true) – Activates or deactivates mobile view.
tablet (Boolean, default: true) – Activates or deactivates tablet view.
desktop (Boolean, default: true) – Activates or deactivates desktop view.
portrait (Object) – Configuration for portrait views as object with following options:
active (Boolean, default: true) – Activates or deactivates portrait views. If this options is set to false, portrait mobile and tablet views will not be shown.
thresholdMobile (Pixel, default: 500) – Defines the threshold in physical pixels, when the Responsive Design Light Framework will switch to mobile view. E.g. if this option is set to 500, the visualization device has a physical width of 400 pixels and the device orientation is portrait mode, the Responsive Lite Framework will switch to the mobile version of portrait views. If the display width of the visualization device is between thresholdMobile and thresholdDesktop, the Responsive Lite Framework will switch to the tablet version of portrait views.
thresholdDesktop (Pixel, default: 1200) – Defines the threshold in physical pixels, when the Responsive Design Light Framework will switch to desktop view. E.g. if this option is set to 1200, the visualization device has a physical width of 1280 pixels and the device orientation is in portrait mode, the Responsive Lite Framework will switch to the desktop view. If the display width of the visualization device is between thresholdMobile and thresholdDesktop, the Responsive Lite Framework will switch to the tablet version of portrait views.
landscape (Object) – Configuration for landscape views as object with following options:
active (Boolean, default: true) – Activates or deactivates landscape views. If this options is set to false, landscape mobile and tablet views will not be shown.
thresholdMobile (Pixel, default: 850) – Defines the threshold in physical pixels, when the Responsive Design Light Framework will switch to mobile view. E.g. if this option is set to 850, the visualization device has a physical width of 680 pixels and the device orientation is landscape mode, the Responsive Lite Framework will switch to the mobile version of landscape views. If the display width of the visualization device is between thresholdMobile and thresholdDesktop, the Responsive Lite Framework will switch to the tablet version of landscape views.
thresholdDesktop (Pixel, default: 1400) – Defines the threshold in physical pixels, when the Responsive Design Light Framework will switch to desktop view. E.g. if this option is set to 1400, the visualization device has a physical width of 1920 pixels and the device orientation is in landscape mode, the Responsive Lite Framework will switch to the desktop view. If the display width of the visualization device is between thresholdMobile and thresholdDesktop, the Responsive Lite Framework will switch to the tablet version of landscape views.
deviceScaling (Object) – Configuration of scaling of elements on different devices
desktop (Object) – Scaling factors for desktop views
window (Object) – Scaling factors for windows
content (Double) – Scaling factor for the window content
titlebar (Double) – Scaling factor for the title bar of a window
table (Object) – Scaling factors for tables
rowheight (Double) – Scaling factor for the height of table rows
fontsize (Double) – Scaling factor for the font size in tables
contextmenu (Object) – Scaling factors for context menus
rowheight (Double) – Scaling factor for the height of context menu rows
fontsize (Double) – Scaling factor for the font size in context menus
tablet (Object) – Same as desktop above but for tablet views
mobile (Object) – Same as desktop above but for mobile views
Example configuration:
var webMIConfig = { "responsiveLite": { "active": true, "config": { "mobile": false, "tablet": true, "desktop": false, "forceDevice": "", "forceTouch": true, "ignoreTouch": false, "portrait": { "active": false }, "landscape": { "active": true, "thresholdMobile": 850, "thresholdDesktop": 1400 } }, "deviceScaling": { "desktop": { "window": { "content": 1.0, "titlebar": 1.0 }, "table": { "fontsize": 1.0, "rowheight": 1.0 }, "contextmenu": { "fontsize": 1.0, "rowheight": 1.0 } }, "tablet": { "window": { "content": 1.5, "titlebar": 1.5 }, "table": { "fontsize": 1.1, "rowheight": 1.5 }, "contextmenu": { "fontsize": 1.1, "rowheight": 1.5 } }, "mobile": { "window": { "content": 2.0, "titlebar": 2.0 }, "table": { "fontsize": 1.2, "rowheight": 2.0 }, "contextmenu": { "fontsize": 1.2, "rowheight": 2.0 } } } } }