Client UI API
Client UI API groups every Inscada.* method that is only meaningful in the browser: popup dialogs, value-input widgets, animation / page navigation, SVG zoom, audio. None of these methods exist on server-side ins.*.
Value-input Dialogs
Section titled “Value-input Dialogs”numpad(data)
Section titled “numpad(data)”Opens a numeric keypad popup bound to a variable; when the user confirms, setVariableValue is called automatically.
Inscada.numpad({ variableName: "SetpointTemperature" // required // projectName: "otherProject" // optional — defaults to current project});sliderPad(data)
Section titled “sliderPad(data)”Similar to numpad but with a slider UI. The variable’s min/max drive the slider bounds.
Inscada.sliderPad({ variableName: "MotorSpeed_RPM"});setStringValue(data)
Section titled “setStringValue(data)”Opens a text-input popup to write a string to a variable.
Inscada.setStringValue({ variableName: "OperatorNote"});customNumpad(data)
Section titled “customNumpad(data)”A generic, callback-driven numpad not tied to a variable. Forwards the entered number to your handler.
Inscada.customNumpad({ header: "Limit value", initialValue: 100, hasNegative: false, hasDecimal: true, minValue: 0, maxValue: 500, isInteger: false, sizeScale: 1.2, onScriptFunc: (xval, extraObj) => { console.log("Entered:", xval); }, extraObj: { context: "alarm" }});| Field | Description |
|---|---|
header | Popup title |
initialValue | Starting value |
hasNegative / hasDecimal | Allow negative / decimal |
minValue / maxValue | Bounds |
isInteger | Force integers |
sizeScale | Popup size multiplier |
onScriptFunc(val, extraObj) | Confirmation callback |
extraObj | Opaque data passed to callback |
customKeyboard(data)
Section titled “customKeyboard(data)”Generic virtual keyboard — the text counterpart of customNumpad.
Inscada.customKeyboard({ initialValue: "", onScriptFunc: (value) => console.log("Entered:", value)});customStringValue(data)
Section titled “customStringValue(data)”Lightweight text-input popup (no virtual keyboard).
Inscada.customStringValue({ initialValue: "notes", onScriptFunc: (value) => { /* ... */ }});confirm(type, title, message, object)
Section titled “confirm(type, title, message, object)”Confirmation dialog. type controls the icon / color (info, warning, error, success).
Inscada.confirm("warning", "Attention", "Stop the pump?", { onOkayFunc: () => { Inscada.setVariableValue("PumpRun", { value: false }); }});showPasswordPopup(options)
Section titled “showPasswordPopup(options)”Password prompt; verification uses either a static password or a variable’s value.
// Static passwordInscada.showPasswordPopup({ password: "1234", onPasswordVerified: () => { /* ... */ }});
// Password stored in a variableInscada.showPasswordPopup({ passwordVariableName: "SupervisorPassword", onPasswordVerified: () => { /* ... */ }, numpad: true // show a numpad for entry});objectEditor(data)
Section titled “objectEditor(data)”Opens the given object in a JSON editor; on confirm, onEditFunc is called with the edited object.
Inscada.objectEditor({ obj: { gain: 1.0, offset: 0.0, threshold: 50 }, onEditFunc: (updated) => { Inscada.setVariableValue("PidConfig", { value: JSON.stringify(updated) }); }});Popup / Animation / Page Navigation
Section titled “Popup / Animation / Page Navigation”showSystemPage(props)
Section titled “showSystemPage(props)”Navigate to one of the system pages (triggers the matching menu selection).
Inscada.showSystemPage({ systemPageName: "alarms" // pageData: { ... } // optional — data available when the page opens});showMapPage(obj)
Section titled “showMapPage(obj)”Navigate to the map page and focus the map on a given coordinate/zoom.
Inscada.showMapPage({ lon: 29.0, lat: 41.0, zoom: 12});showAnimation(options)
Section titled “showAnimation(options)”Swap the animation currently shown in the viewer.
Inscada.showAnimation({ name: "TankDetail", parameters: { tankId: 3 }, // optional — parameters for the target animation unselectMenu: true // optional — clear menu selection});showParentAnimation(options)
Section titled “showParentAnimation(options)”Swap the animation one level up from the current one (typical for drill-down “go back”).
Inscada.showParentAnimation({ name: "MainView"});popupAnimation(obj)
Section titled “popupAnimation(obj)”Open an animation in a popup window. If size is omitted, the popup auto-fits the SVG’s own dimensions.
Inscada.popupAnimation({ animationName: "TankDetail", modal: true, width: 600, height: 400});Extended usage:
| Field | Description |
|---|---|
animationName | Name of the animation to open (required) |
modal | Lock the background (true / false) |
windowId | Custom window ID (replaces a previous window with the same ID) |
leftPos / topPos | Window position (pixels) |
width / height | Size (omitted → use the SVG’s own size) |
extraHeight | Title-bar allowance for dynamic sizing (default 44 px) |
__parameters | Parameters passed to the target animation |
closePopup(windowId)
Section titled “closePopup(windowId)”Close an open popup window by windowId.
Inscada.closePopup("popupAnimationWindow12345");UI Controls
Section titled “UI Controls”setUiVisibility(type, status)
Section titled “setUiVisibility(type, status)”Show or hide parts of the main interface.
Inscada.setUiVisibility("top-toolbar", false);Inscada.setUiVisibility("top-menu", false);Inscada.setUiVisibility("sidebar-collapse", true);Inscada.setUiVisibility("animation-toolbar", false);Valid type values:
type | Effect |
|---|---|
"top-toolbar" | Show / hide the top toolbar |
"top-menu" | Show / hide the top menu and menu row |
"animation-toolbar" | Show / hide the animation toolbar |
"sidebar-collapse" | Collapse / expand the side menu |
setDayNightMode(isNight)
Section titled “setDayNightMode(isNight)”Toggle day / night mode.
Inscada.setDayNightMode(true); // nightInscada.setDayNightMode(false); // dayreload()
Section titled “reload()”Reload the browser tab (window.location.reload()).
Inscada.reload();svgZoomPan(data)
Section titled “svgZoomPan(data)”Programmatic zoom / pan control on an animation SVG.
Inscada.svgZoomPan({ zoomableId: "mainSvg", functionName: "zoomIn", params: {}});
Inscada.svgZoomPan({ zoomableId: "mainSvg", functionName: "zoomAtPoint", params: { scale: 2, x: 100, y: 150 }});
Inscada.svgZoomPan({ zoomableId: "mainSvg", functionName: "fit", params: {}});Valid functionName values: zoom, zoomBy, zoomAtPoint, zoomAtPointBy, zoomIn, zoomOut, pan, panBy, resetZoom, resetPan, reset, fit, center.
playAudio(isStart, name, isLoop)
Section titled “playAudio(isStart, name, isLoop)”Play / stop an audio file stored in the File System. The same name cannot start twice concurrently.
// Start (looping)Inscada.playAudio(true, "alarm_siren.wav", true);
// StopInscada.playAudio(false, "alarm_siren.wav", false);| Parameter | Description |
|---|---|
isStart | true to start, false to stop |
name | Audio file name in the File System |
isLoop | Loop mode (only meaningful when starting) |