index

BNCS V4.6 Core System

Overviews

Overview for V2/3 BNCS Users
Skins/Styles/States
Targeting UIs
Smart Button - custom popup editors

FAQ

FAQ

Installation

Overview

UI Developer

Common UI Panels/Components
Custom Controls
C++ Panel Classes

Applications

System

NetBios networking

Item | Notes
CSI | Control System Interface - how to get stuff on/off the network
v3caplog | A viewer of CSI traffic

DDS networking

Item | Notes
CSI | Control System Interface - how to get stuff on/off the network
bncs_netViewer | A viewer of CSI traffic

Workstation

Item | Notes
Workstation Manager | Launching applications, managing workstation status
File Sync | Updating a workstation from a server
Workstation Tracker | Showing the status of all the workstations on your system

UI

Item | Notes
Visual Editor | Lay out BNCS UIs
Panelman | Host for BNCS UIs
Automatics Host | Host for BNCS UIs where they perform some logic function
Single Panel Host | Simple BNCS UI host
Style/Drawing Plugin | How buttons are drawn (and how to configure)

Utilities

Item | Notes
bcommand | Send raw BNCS network messages
bncs_buildTool | Run <this tool> on <this path>
bncs_inst_env | Set the environment variables for your BNCS system
bncs_deferredCopy | A mechanism of updating the updater
cc_sys_check | A means of ironing out issues created when upgrading a system to a new release
db_loc_blast |
desktopbmp | Write a desktop background to positively identify this workstation
doSnapshot | Take a zip of the current BNCS system
paramTester | Set individual parameters on this system (like bcommand, only config aware)
pmTarget | A development helper to close/restart the UI that you're currently working on
setLana | Required only for NetBIOS-based systems - a means of setting the network interface to use
setCCEnvSetting | Install environment variables that start "CC_"
sql_script |
wiz | A wizard for creating code from templates
WritePrivateProfile |
ccDriverTest | A means of simulating all your entire system in a single app

Obsolete

CC_WS_Manager_Update

Configuration

File Formats

Driver/Application Developer

Overview

Inter Process Comms

References

C++ Interfacing Classes (grd, infodriver, client, config)
General Classes

Original C/C++ libraries

Infodriver Interface
GRD Interface
TCP Client
SNMP

Alarm System

Overview
Docs

Misc

Reserved Characters
Paths and Environment Variables
grd32fix.dll / grd32fix.exe
info32fix.dll / inf32fix.exe
Release Notes
Release Notes - Alarms and Config

Documentation

Docs on docs

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


README

BNCS Core System

What is this repository for?

All those things that are "core" for V3, V4.x and C/C++ interfacing libraries etc.


ReleaseNotes

V4.6 Toolkit Release Notes

Known issues

  • Alarm system may have a memory leak
  • VisEd leaves editor "handles" at the point you started dragging controls rather than where you let them go (most problematic with grid turned off)
  • Z order when calling V4.5 UI from ApplCore requires the ApplCore panel to be cooperative and hide itself

Release 4.6.5rc2

cc_sys_check / alarms config editor

BST-319 Debug builds of config plugins erroneously had DLL extensions which meant they were simultaneously loaded alongside the release versions of the same thing. Now corrected - but you need to run the "BNCS System Check/Upgrade Utility" when updating to latest v4.x.

config_server_passwords.ini

Now includes default file

Visual Studio Update

Updates compiler to VS2013 update 5 (with corresponding update of VC runtimes)

csi32

v1.2.74 Temporarily (I hope) removes structured exception handling so that the likes of WinCrashReport can be used to grab a call-stack.

ccDriverTest

v1.0.8 Fix to 1.0.6 to ensure clean close. Adds menu bar, import options, full cache clear, help-about and help-contents menu items
v1.0.7 surrounds import operation with transaction - reduces import time on a sample 22MB CapLog file from several minutes (I got bored waiting after 4 minutes) to 9 seconds
v1.0.6 now closes when CSI does

bncs_csi

v2.0.34 Messaging window was unnecessarily muting IPC traffic during closedown meaning that any closedown messages sent as drivers closed weren't able to hit the network. Now corrected.
v2.0.33 Formatting error on debug string - debug message appears about missing parameter for a message that doesn't need one - now corrected.

slinkClient

v1.0.27 Makes poll on connect (or at least no poll on connect) a command line options
v1.0.26 BST-310 Makes cache a command line option
v1.0.25 Expands socket error message (as per slinkServer)
v1.0.23/24 Docs update
v1.0.22 Adds traffic counters to BNCS and session. Adds missing editor for user credentials and status infodriver
v1.0.21.0 Cross checks the value from the ADP response against the local DB1 size, and flags in the debug if there's an anomaly

slinkServer

v1.0.40 Mix-minus local-turnaround of RM commands so that all other clients get the RD without bouncing via the network or returning the RM to the originating network
v1.0.39 Makes quote aware so that colons may be embedded in strings without tripping the command parser
v1.0.38 BST-310 Allows for no poll management command line override
v1.0.37 BST-313 Slightly careless < rather than <= when it came to dealing poll ranges. Gist was you couldn't poll a single slot - only ranges
v1.0.36 Adds SSL protocol configuration
v1.0.35 Changes main window UI layout to a splitter
v1.0.34 Bit of an edge case, but still a flaw: corrects delivery of poll responses from cache when that client hadn't registered for that range
v1.0.33 Implements un-register (de-register?) commands AIU ARU and AGU. Also now removes "managed" poll commands for devices that are no longer registered
v1.0.32 Socket error code just displayed a placeholder,not the value meant for that position. Now also rather less lazy and shows you the text description of this value.
v1.0.30/31 Docs update (SSL info)
v1.0.29 Adds server port to users config, with dynamic adding/removing of users and server ports
v1.0.28 Allows for port-per-user-login for legacy users of FABIAN
v1.0.27 uses zig-zag polling on startup, interpreting incoming poll commands and retrying as necessary. This reduces impact of slinkServer startup and opportunities for the poll-storms that FabianServer generates.

bcommand

v4.5.6 Names the widgets so that auto-testing software can tell them apart
v4.5.5 Removes second ccClient connection, uses ccClient directly rather than the shim wrapper for it

bncs_netViewer

v2.0.25 Removes debug message that repeats often, and doesn't aid debugging
v2.0.24 Error initialising timer used to generate test data. This meant that it could be confused with the display update timer. Effect was you get a log full of "entry_" lines and the display doesn't update. It's down to chance whether it works or not.

BST-298

info32fix.dll and grd32fix.dll were incorrectly storing handle values leading to problems starting some apps up (notably FabianServer32)

Release 4.6.5rc1

BST-297

V3CapLog: v3.15.07 Erroneous display of V1 GPI messages when paused now fixed

BST-293 (and some other things as I found them)

CSI32: v1.2.72: supports interpretation of internal identifier on end of RM commands for anti-howlround
CSI32: v1.2.73 Long-standing inexplicable hole in cache-get function - only returns the database name for the given router or GPI value not the numeric index. Now uses (previously unused) return value to give that value
slinkServer: v1.0.19: optimistation of anti-howlround database messages, also adds support for ADP command
slinkServer: v1.0.20.0 sends ADC for any registration not just within the range of the registration
slinkServer: v1.0.21.0 Adds local turn-around of polls if they exist in CSI's cache so as to not bother ALL the other remotely connected clients with one client's polls
slinkServer: v1.0.22.0 Adds permission checking of poll return values to each client
slinkServer: v1.0.23.0 Cache value now can also return numeric value of cache rather than the database name (allows feature in version 1.0.21 to work)
slinkServer: v1.0.24.0 Removes hard-checking of read access when doing polls. You can poll but the access sets whether you get the response
slinkServer: v1.0.25.0 Tidies up debug messages for incoming commands
ccClient - default option for "add handle" changed for routerModify messages (applications that shouldn't have been sending a handle were)
slinkClient: 1.0.15.0 RD support (to match FABIAN for anti-howlround)
slinkClient: 1.0.16.0 Now only sends revertives on change of state. Allows for wholesale polling of the server without bothering the local network with information that hasn't changed
slinkClient: 1.0.17.0 Persists state (as say an infodriver would) on closedown. Also implements ADP command which it uses for startup poll. NOTE change of ini file settings to include the device type
slinkClient: 1.0.18.0 Now doesn't barge the existing TxRx driver out of the way on startup. Another couple of messages logged to debug. Better behaved creating device connections from the UI.
slinkClient: 1.0.19.0 UI button relabelled "Force tx"
bncs_netViewer: 2.0.19.0 RD implementation
bncs_netViewer: 2.0.20.0 Makes log files more like caplog so that caplog tools can be used on them
bncs_netViewer: 2.0.21.0 Corrects display of the LOCK commands. Adds summary of what the commands means in the status bar whenever you click any command (but only when paused)
bncs_netViewer: 2.0.22.0 Adds status bar help for Net Broken. Adds open file and open folder toolbar and menu options. Writes to file when log disabled/enabled and app start/close.
bncs_netViewer: 2.0.23.0 Corrects icons for open log/folder toolbar
bncs_csi: 2.0.29.0 Implementation of RD command to make FABIAN/slink work
bncs_csi: 2.0.30.0 Long-standing inexplicable hole in cache-get function - only returns the database name for the given router or GPI value not the numeric index. Now uses (previously unused) return value to give that value
bncs_csi: 2.0.31.0 Device Profile now purely on existence of sizes not existence of database
bncs_csi: 2.0.32.0 Knotty thready issue not updating UI for Txrx states (UI interaction from non-UI thread), and thready issues around use of m_cache

BST-288

slinkServer: v1.0.17.0 FABIAN compatibility was lost by inconsistent line-endings. This version corrects. Also adds missing read/write access settings for GPI and router types

CORE-35

bncs_netViewer (aka DDS CapLog) v1.0.18 performance much improved - dumping the entire contents of an infodriver takes a similar time now to V3Caplog

Default IPC change

ccClient changed from WM_COPYDATA to BBC_COPYDATA. Only significant impact for core apps is bcommand (others were already explicitly set to BBC_COPYDATA)

Release 4.6.4

BST-277

infodriver32 v1.0.11.0. Pragmatic fix to workstation range checking to allow historic code (applcore) to work as it did before.

BST-276 (side issue)

pmTarget now part of build (useful utility to automatically close and run panels under development in Visual Studio)

BST-275 (side issue)

bncs_disklog v4.5.0.3 now uses decimal point for millisecond delimiter rather than colon. Add static version string to this lib

BST-274

bncs_csi: v2.0.28.0 Historic use of the top bit of the device number to indicate 32 bit messaging (that infodriver32/grd32 doesn't use) was confusing this app. Now masks appropriately.

Extended range support removed

BST-272

bncs_listview_extended: v1.0.14.0 Fix to tagRow..add so that it sets the tag as it adds

CORE-29

bncs_ssmart.dll: 4.6.165 Range control now able to use GPI and ROUTER devices from the device type (to match functionality of string and enum types)

paramTester v4.5.11

Now uses standard client interfacing library that understands interim extended ranges

BST-273

infodriver32: v1.0.10.0 now passes through workstation number supplied by CSI for BBC_REQDEVGORXONLY

core-26

bncs_csi v2.0.26 mutex lock-up problem discovered when trying to remove a device from slinkClient. Relates to redundancy mastering.

BST-268

CSI32 v1.2.70 Now distributes BBC_NETTXRXSTATUS messages on incoming "NO" message if the dest workstation is you or zero.

bncs_script_helper

Minute change to bncs_script_helper header - a decade-old definition of boolean type (rather than bool) was upsetting some compilers. Reworked to be simply "bool".

Example Tab UI

Simple change to the button IDs to allow the Visual Editor to auto increment IDs on copy/paste to allow for easier maintenance

bncs_csi v2.0.25.0

Typo with infoWrite commands and workstation number (dest rather than source workstation was used). Implements BBC_GETWORKSTATIONNUM IPC message - some things still use it

Infodriver32 v1.0.9

Rejects commands from workstations <1 and >999. Infodriver32 will never support extended ranges.

BST-254

"missing link in docs to bncs_stringlist" fixed

BST-260

bncs_listview_extended v1.0.13: "tag..add=" prepending rather than appending new entry - now fixed

ccDriverTest v1.0.4

This device/system simulator now supports a range of devices (as specified - originally 1-999).
Also supports importing of CapLog files in order to set the state of devices from live system data

BST-241

bncs_ssmart.dll v4.6.164: Correction to dest grid to only notify button pushes once (double connection issue)

BST-238

bncs_ssmart 4.6.163: bncs_listbox will attempt to scroll a listbox to the middle when setting an item to scroll to view

BST-236

uiAutomatic wizard was still using an MFC header - replaced so that it'll work with Express compilers etc.

BST-230

CSI32 v1.2.69: uses 32bit version of time as distributed in NetBIOS packet which was faulty on modern complier which uses a 64 bit value

BST-227

bncs_dateTime v1.0.9.0 - more discerning when dealing with null values which would otherwise report as Jan 1 1601 when converted to strings

bncs_script_loader v4.6.162

Sense of return value for a "panelShow" when the targeting param was used was inexplicably inverted. This version corrects

slinkClient v1.0.0.12

Now has rudimentary connection status slot

Revision 4369

info32fix and grd32fix (apps that allow Microsoft apps to hear historic messaages designed for Borland) now work with full range of device numbers. Limit is now not 999 devices but 1000 out of the full range available (so will stop working when you try and run the 1001st device on the same workstation)

Revision 4360

bncs_ssmart.dll v4.6.161: Fix to browse scripts to ignore all folders that start with a period - crasher with VS2017 that leaves .vs folders

Revision 4334

CSI32 v1.2.68: Adds BBC_GETMAXDEVICES call so that you can programatically work out how many devices this CSI supports (I suggest you default a null-return from this call to 999)
bncs_csi: v2.0.23.0: Implements max dests/sources/databases (BBC_GETMAXDESTS/BBC_GETMAXSOURCES/BBC_GETMAXSOURCENAMES/BBC_GETMAXDESTNAMES).

Revision 4330

bncs_netViewer v2.0.16

always on top (broken in Qt suddenly)
adds colour chooser for the UI
adds NV (slave) command
docs now define commands displayed
adds millisecond value to log files

bncs_csi v2.0.22:

return value for get redundancy state (returning internal flag rather than interface state)
now runs/closes Borland helper apps as appropriate
redundancy mastering implemented
fixes long-standing misunderstanding about the distribution of database change notifications (now distributes everything rather than FABIAN-style only things you're registered for)

BST-198

Panelman v4.6.17
fix to show/restore blank panel when hitting clear having been using an external UI app

slinkServer v1.0.15

now gives you "here's what you missed" database changes
closes with CSI

slinkClient v1.0.0.11

closes with CSI
doesn't now propogate database changes in rxonly

BST-190

ccSysCheck 4.5.10 now doesn't delete the debug binaries

BST-184

GRD32 v1.0.23 workstation number set properly from outset

bncs_log

colouring fix when using multiple instances of the control

bncs_range (bncs_ssmart v4.6.159)

Now uses lost focus setting on buttons so you can't slide finger off the button and leave it auto-repeating forever

infodriver32

Adds new BBC_IDUPDATESLOT call to save get/set pairs

Other

removes deprecated buildAllPanels app (use bncs_buildTool instead)
bncs_disklog now adds millisecond timestamp to logs
serial comms library now has "break" function (in the docs but never in the code - bizarre)

Revision 4201

bncs_csi: Thready fixes
bncs_csi/slink: Database fixes to slink so they propogate without howling-round (the issue with peer-to-peer messaging that is the RM command)
Adds "driverTest" which will simulate a block of devices of any kind
bncs_csi: Clearer warning on missing OSPL_URI env var
bncs_csi: Fixes for string sizes >256
bncs_netViewer: has pause toolbar item
bncs_netviewer: always on top/window position
Example panel projects now build without MFC dependency (also fixes to a few debug builds)
BST-259: slink: now cleans up registrations correctly on close (it's a crasher)
slink demo added to workstation 2
max indexes now 65535 across many apps (bncs_csi, UI etc.)
workstation manager: now copes with command lines that have spaces in
workstation manager: now allows command line arguments for bncs_csi

Revision 4126

Minor fix to workstation manager title bar to get file version not product version

Release 4.6.3

Revision 4123

slinkServer migration issue (Qt5.8 introduced a bug that prevented QTcpServer socket from listening)
adds slinkServer to the demo system config for workstation 2

Revision 4118

bncsif32 replaced by new version for IPC sizes > 512 bytes.

Revision 4097

bncs_style2 (current preference for control appearance configuration) documentation now part of main docs rather than an independent CHM
bncs_csi (DDS CSI) now shipped with correct binaries and default config/qos (this was faulty in toolkit release 4.6.2)

Release 4.6.2

Revision 4086

bncs_control 4.6.155. Restores the way popups used to work when used with smart buttons to position at top-left of parent rather than at cursor position. This allows external triggers to do the popup regardless of where the cursor is

Revision 4084

Bug 2870. BNCS base button. Careless placement of the code that persists the value for "initially disabled" this was not stored when a stylesheet was used. This has been corrected. Whilst in there I also added the very similar feature "initially hidden"

Revision 4074

Bug 2884. Text placeholder for error message wasn't right - corrected.

Revision 4069

Bug 2882. Small fix so that selecting item by index in a listbox is allowed if that item has focus.

Revision 4067

Bug 4879. Popup engineering PIN panel now appears every time not just the first time

Revision 4064

Bug 2880. Reinstates C++ redistributable support libraries that was inexplicably removed from the installer

Revision 4063

bncs_csi now using alternative DDS vendor.

Revision 3984

bncs_script_helper v4.8.6.0: removes restriction on only reading database size parameter for databases 0 and 1 only (now just accepts any number)

Revision 3962

Bug 2841 GRD32 v1.0.22.0: Adds keyboard shortcuts for "Clear Errors", "Set to TxRx" and "Enable Source Hold"

Revision 3959

Bug 2859 : Panelman v4.6.13.0. Now examines the params passed via a PX command to see if it's an instance (so display alt-id) or equals (in which case it's likely to be one or more params) or just a word to stick on the title bar. I don't believe that this is ideal but in the name of backwards compatibility....

Fixes bncs_listview_extended documentation
adds const and non-const bncs_stringlist iterators
adds router_dest example UI to master system
panel code wizard now uses correct debug libraries
std:string changes to prevent cross-compiler woes with bncs_string
script loader now uses style entry to indicate it can't load scripts (was previously just dark which doesn't show up in today's modern fashionable dark stylesheet)
updates uncontrolled builds of bncs_cc

Release 4.6.1

Revision 3893 12/05/17

Reinstates the debug build output. This had been removed so as to reduce the build time

Revision 3871 11/05/17

"full install" asks fewer questions and does what it says on the tin.
Corrects issue with the upgrade utility that it wasn't correcting the right path (would tell you the right path but then not actually use it)
masterSystem: workstation tracker now has default configuration of "localhost" so it works out of the box

Revision 3861 10/05/17

Panelman now uses "bncs_popup" style for the "start" menu dialog. This now pops up at the cursor location rather than a fixed offset from (what turned out to be) the wrong place.
Adds vertical panelman app. bar resource files. Run with /size=1280_vertical.

Revision 3851 08/05/17

Panelman now properly handles applcore applications as external apps (with original 8.3 titlebar naming e.g. MYPANEL_.001 )

Revision 3748 03/05/17

Example panels added, with supporting configuration

Revision 3708 29/04/17

bncs_ssmart custom controls 4.5.150. Now doesn't unnecessarily force an update on change of font or colour or text

Revision 3629 18/04/17

Adds configurable popup border options to the bncs_style2 drawing DLL

Revision 3561 08/04/17

Installers now reworked - split into 4 different installers to reflect the different release cycles of the different elements

Revision 3305 03/03/17

Wholesale conversion of documentation to Markdown and integrated into a single file for distribution

Revision 3143 21/02/17

bbcnb32.dll (network interface DLL that CSI uses) now traps datagram sizes >512

Revision 3141 21/02/17

config_editor VS2013 build now doesn't stall with a zlib error on transfering files.

Revision 3112 07/02/17

bncs_script_helper: ability to both create controls on the fly and destroy them too
desktopbmp: now writes file to the current bncs system data directory so as to not offend current Windows versions by writing to the root
bncs_buildTool: now captures STDERR tool output properly - also adds markdown (pandoc) tool
context menu crash fix for alarmControl (where no item was selected)
Internet Explorer control now exception-handles a delete-time crash (believed to be a flaw in the I.E. COM component)

Revision 2935 15/12/2016

CSI32 v1.2.65 flag to force drivers to be detected as V2 without the presence of a DEV_xxx.INI
file so that commands are not sent out in individual packets. Non-backwards compatible default.

bncs_control. v4.6.142. Disables stylesheet editor from bncs_control as it was eating style
values. This was never really the place to have it since it encourages generation of one
style-per panel rather than the whole point of stylesheets which is style per system.

Revision 2825 15/11/2016

AlarmControl - Fixes an issue specific to the VS2013 build where information was not being
displayed properly in the module list. VC6 build was not affected.

Revision 2783 08/11/16

ccLibrary (ccGrd and ccInfodriver), and extinfo, cXinfo, extclient, panelif & cGRD now don't
use HWND_BROADCAST if they can help it since Windows 10 apps seem particularly prone to sitting
on them and gumming things up

Revision 2718 12/10/16

GRD32 v1.0.21.0
Fixes remaining issues arising while making the GUI size variable (Bug #2618).

Revision 2699 11/10/2016

GRD32 and Infodriver32 now pass through set redundancy master messages

Revision 2652 06/09/16

lua_loader control (much the same as the C++ script) and can load lua panels as top level
panels or smart button popup editors (Note: lua in VS2013 build only)

Revision 2614 11/08/16

Resource management on every load of a bncs_ui not just the top level panel load. Always ensures
a headroom of 2500 USER objects

Revision 2604 11/08/16

Adds Visual Studio 2015 Express path to bncs_buildTool sample config path

Revision 2563 28/06/16

Bug 2809
CSI32 v1.2.64
If no V1/V2 flag database flag for any device is set then just do a quick check on incoming
database change message to see if the dev file exists so that you can add files to a running
server without having then to restart it

Revision 2504 28/06/16

Bug 2803
bncs_ssmart.dll version 4.6.139 fixes manual mapping of dest grid (strangely nearly working,
but only partially implemented)

Revision 2397 18/05/2016

Changes debug type in interfacing libraries to C7 (not independently shipped for V4.5, but still
a change)

Revision 2381 13/05/2016

dcw v4.5.31 - fix to connections handling so you can use this kinda command:
add=["bncs_listview_extended".cellText.2.0]
i.e. get the value of cell 2.0 from the named control. Previously the 2.0 bit would have been
ignored and caused the command to fail

Revision 2379 13/05/2016

bug 2763 bncs_listview_extended v1.0.12.0 - fix to default value for notify selection

Revision 2334 06/05/2016

Adds long-standing (but previously unreleased) singleton config class to the code wizard where
you can model you system in data & classes and then share that data round all the UIs that need
to know in an efficient way.

Revision 2309 05/05/2016

windows\bin, windows\lib and config\plugins binary paths now have hash.db files which contain
SHA1 hashes of the binaries as they were built. Adjacent to these files is a similarly named
batch file that will check database against reality

Revision 2263 22/04/2016

Original installer and VS2013 now code-signed (using internal certs.bncs.tv CA - this is not part
of Windows you need to install it)

Revision 2258 21/04/2016

CSI32 v1.2.63. Fix to 1.2.61. Redundancy switching not working since 1.2.60

Revision 2220 14/04/2016

CSI32 v1.2.62. Fix to 1.2.60 - poll responses satisfied from cache now contain this workstation's
number to distinguish these poll responses from change of state

Revision 2217 12/04/2016

CSI32 v1.2.61. When setting the TxRx state of a device don't bother the network with a change of
state when the state hasn't actually changed. This is important for requesting rxonly when
already in rxonly state - otherwise you send out an NC message which implies Tx driver going
rxonly when it's not

Revision 2179 16/03/2016

Added 'RN' command to bCommand to allow a database entry to be queried.

Revision 2127 07/03/2016

applicationScreenGrab utility: v1.0.2.0
adds timeout value to grab settings (set in the UI)

Revision 2122 07/03/2016

Experimental new utility "pmTarget" can be used to clear panels from panelman when you hit the
build button in a compiler and then re-run on successful build. Look for pmTarget executable and
chm (help file) in windows\lib (not windows\bin - there's a good reason for this!)

Revision 2108 03/03/2016

panelman v4.6.7.0: adds "PA /CLEAR" navigation command which does the same as hitting the clear
button on panelman's popup (start-menu-like) UI. This is designed for use with pmtarget for
active control of panelman when compiling panels.

Revision 2024 17/02/2016

Build output now includes extinfo.lib again (and needs to be further reviewed for the other
interfacing libraries)

Revision 2022 17/02/2016

ccConfig class now has methods to read the list of sections

Revision 1926 04/02/2016

CSI32: 1.2.60 revertive messages now set target workstation in wParam (previously hard-coded
to zero) so that you can tell if this was a poll response or change of state

Revision 1914 04/02/2016

CSI32 v1.2.58 adds BBC_SETREDUNDANCYMASTER a new API feature so that redundancy mastering can
be set on the fly by drivers that understand it. This will reduce the redundancy changeover time
from
t * <number of BNCS devices>
to just
t * <number of DRIVERS>
where this may be a single driver hosting all 999 devices, but all 999 follow the master in a
single cycle

Revision 1891 11/01/2016

Fix to ## Revision 1858 to allow infodriver32 to work (IS BROKEN IN ## Revision 1858)

Revision 1858 11/01/2016

GRD32/Infodriver32 now try and use handle-sharing DLL in preference to HWND_BROADCAST. The tip
of a very large iceberg....

Revision 1854 07/01/2016

bncs_listview_extended v1.0.11.0 - removeTag will now remove row by tag name. Bug 2713

Revision 1850 07/01/2016

bncs_listview_extended v1.0.10.0 - tagRow now has option to force add of non-existent entry
if we didn't find it. Bug 2712

Revision 1848 07/01/2016

bncs_listview_extended v1.0.9.0 - now has rowFG and rowBG to set entire row colours, also
column equivalent with columnFG and columnBG. Bug 2683

Revision 1839 17/12/2015

CSI32 1.2.57 adds "deaf to self" setting so that CSI32 can be used as a gateway interface

Revision 1834 15/12/2015

UI host wizard now spits out VS2013 project files (local conversions from DSW aren't always
that successful and don't address "the well-known faults")

Revision 1821 10/12/2015

bncs_bargraph now supports VU-style colouring of mid and upper ranges. Also selectable shading.

Revision 1816 08/12/2015

CC_Sys_Check now uses a Splitter for its layout, so it's easier to manipulate to see its diagnostics.

Revision 1766 12/11/2015

Added some default size for range control and made it be big up down by default
Added icon for Instance viewer

Revision 1763 12/11/2015

CSI's redundancy docs now have clearer examples of what to implement at the lowest interfacing
level

Revision 1758 12/11/2015

bncs_ssmart v4.6.138 - range control (up/down buttons) now uses the same tooltip code as enum

Revision 1727 05/11/2015

bncs_script_helper 4.8.4.0 simplification of getWorkstationSetting and getObjectSettingto break
out of the loop earlier

Revision 1723 05/11/2015

Bug #2679
bncs_listview_extended v1.0.8.0
Rationlisation of internal passing of encoded strings so that auto cell-width works on the text
not the encoded version of the text

Revision 1718 05/11/2015

bncs_vis_ed: 4.6.25 - fix to open sln files not just offer to create a new project even though
one already exists. Also removes old icon from the project

Revision 1714 03/11/2015

Bug #2714
bncs_listview_extended v1.0.7.0 - merely setting the sort column isn't enough to force a sort
if it's already set to that column - so force a sort if the column turns out to be the same one
as we already had

Revision 1711 03/11/2015

Bug #2711
bncs_listview_extended v1.0.6.0 - now supports return value for tags or tags.<delim>

Revision 1706 02/11/2015

UI: (bncs_ssmart.dll 4.6.137) Instance viewer control will now accept other attributes than
available in the drop-down list (i.e. any that appears in instances.xml) e.g. ip_address

Revision 1701 30/10/2015

Bug #2618
GRD32: v1.0.16.0 Now uses device number for the file it uses to store location and UI state,
saves size/pos on closedown (doesn't save if dialog never got displayed e.g. error box)

Revision 1698 29/10/2015

V3Caplog: 3.15.06 New config setting (with legacy default) to allow turning off of setting local clock
from incoming TS message

Revision 1688 19/10/2015

Various project changes, icon updates etc. for VS2013 build of core_system (impacts on VC6 build
too - e.g. icon changes)

Revision 1640 09/10/2015

Adds bncs_style2 help to the distribution

Revision 1597 25/09/2015

Bug 2525.
Fix to core toolkit library to fix handle leak (a couple of handles every 10 seconds under certain
circumstances

Revision 1595 17/09/2015

Bug 2724.
Wizard VS2013 project files now builds to project directory not solution directory (for when
you're working with multiple panels in one solution)

Revision 1593 17/09/2015

Bug 2618.
GRD32 v1.0.15 GUI better behaved when in small screen mode and allows dynamic resizing of the listboxes

Revision 1572 10/09/2015

Bug 2723.
UI host now won't try and use instance from both its own dialog and if it appears in the param list of the UI that it loads

Revision 1568 04/09/2015

enableCaption method on v4.5 dll "scripts" now has explicit title parameter

Revision 1558 01/09/2015

Workstation Tracker documentation updated. Substantially revised, especially to clarify InfoDriver
interaction (Bug 2706).

Log Control date/time filter changes (Bug 2530).
Functional changes as follows:

  • Addition of Date/Time filtering.
  • Addition of Between filters.
  • Addition of Compare Mode (selection of inclusive/exclusive match). Default is exclusive, which most closely
    matches the existing implementation.
    Also fixes to search implementations, both SQL and Update variants, so both give the same results and behave
    in an intuitive way, in conjunction with all the options, old and new.
    (Also addition of various test applications to implement automated testing of as much as possible of the above.
    For development use - not accessible by users.)

Revision 1550 28/08/2015

Numerous typos in custom control documentation resolved

Revision 1540 27/08/2015

Incorporated the V2/V3 "VT Clock" custom control

Revision 1503 17/08/2015

Updates wstracker docs with slot information

Revision 1495 13/08/2015

ccInfodriver previously forced TxRx state when setRedundancyState() rather than asking. Now
has additional parameter to give the option of either.

Revision 1399 14/07/2015

V3CapLog now sticks a banner at the top of the dialog if any of the device filter settings
exclude devices

Revision 1381 14/07/2015

Vis Ed has additional edit menu item and keyboard shortcut for access to the dialog properties
which is otherwise difficult to get hold of when using full-screen components

Revision 1377 14/07/2015

A line in the vs2013 build output installer licence file to note that it's not for production use
and isn't required for systems where UI development is on VS2013 - this seems to have caused
unnecessary confusion

Revision 1370 13/07/2015

Panelman v4.6.4: configurable engineering PIN was being mucked up if the system used workstation
tracker.
Config filename was being overwritten with the value for the tracker - so if you need to work-
around this issue, you'll find the engineering PIN in the workstation tracker ini file.

Revision 1367 10/07/2015

Panel docs now include bncs_dateTime (though if you want to use this class you need to include
bncs_dateTime.lib in your project settings)

Revision 1360 10/07/2015

Build output now includes alternative bncsif32.dll (called bncsif32_32.dll) that can kill of stalled apps
To use it you have to remove the old bncsif32.dll and rename this new one to take its place

Revision 1336 06/07/2015

ccClient now has deviceMode notification parameter the right way round
CSI32 now accepts environment variables in path arguments (e.g. temp path within bncs_system.ini)
Includes BBC_NETTXRXSTATUS_BROADCAST_ENABLED, BBC_NETMSGUPDATE_BROADCAST_ENABLED IPC messages so
that you know whether to manually register for these messages or they'll be broadcast to every client (a CSI setting)

Revision 1287 30/06/2015

bncs_dateTime v1.0.5 Fixed stupid formatting error with blind-fix to ddddd formating of bncs_dateTime string

Revision 1281 26/06/2015

CSI32 now has IPC timing information on the clients/drivers dialog (see Diagnostics menu)

Revision 1276 16/06/2015

bncs_ssmart.dll: 4.6.131 enum buttons now will dynamically update their display if state list
is dynamically adjusted

Revision 1274 22/06/2015

bncs_ws_man will now resolve environment variable references (e.g. %CC_ROOT%) for both arguments
and working directory

Revision 1268 16/06/2015

bncs_vis_ed: finally "test" has been made "save and test" - toolbar icon changed to draw your
attention to this change and the tooltip/menu item text changed too

Revision 1266 16/06/2015

Fix to calculation of sizes relating to shrinking of text (manifests itself on shrunk text on
enum buttons)

Revision 1243 16/06/2015

bncs_datetime version 1.0.4: fixes to toString functions using (so you don't get 11st and 12nd)
and it gets the day of the week right (when using ddd rather than dddd). Fix to fromString docs
to show using dashes for date delimiter rather than colons

Revision 1223 11/06/2015

bncs_ws_man: 4.5.25 makes start/stop buttons double height for ease of operation on a touchscreen

Revision 1223 11/06/2015

IMPORTANT FIX
All V4.5 builds since December 2013 have a flaw with the bncs_enum control that means a change of
device number does not de-register with the previous slot so the control can pick up values from
a device at which it's no longer supposed to be targeted

Revision 1218 10/06/2015

bncs_log. Some changes to handling of BNCS revertives and database connection related messages
so that updates that arrive before the connection is made get displayed. Includes some changes
relating to selections and ensuring things are visible, and ensuring all database related messages
are considered OK rather than some OK and some Fail for no particular reason. (Bug 2479)

Revision 1210 05/06/2015

bncs_listview_extended 1.0.3.0 - Crashfix to edit-time bncs_listview_extended control
bncs_listview_extended 1.0.4.0 - enableSorting now set on design-time dialog from the value used
bncs_listview_extended 1.0.5.0 - column alignment now actually sets the alignment on the control

Revision 1202 05/06/2015

Adds difference functions to bncs_dateTime class

Revision 1193 29/05/2015

To prevent update issues, installer now gives you a presync.bat file with blunt deletion of all
residual ".bncs_update" files that prevents the new mechanism from working properly

Original update-updater (InnoSetup script) now has logging enabled by default

Revision 1187 26/05/2015

Allows for the filtering of connections on the sub-parameter so you can distinguish between
button.1=released and button.2=released (previously the rule would have ignored anything after
the period)

Revision 1178 21/05/2015

Not and Truth processes now treat Latched as an Ok state, rather than an Alarm state. (Bug 2626)

Revision 1168 19/05/2015

bncs_range/enum fix to notify setting where setting notify.<anything>=true would set the button
notify true - now will only accept notify=true or notify=false

Revision 1167 19/05/2015

GRD32 now returns virtual tallies to XG (external client) requests rather than real tally table entries

Revision 1162 18/05/2015

navigateCanAdjust marginally more discerning in that it'll check that the typehandler entry exists
AND has length, not just that the XML entry exists

Revision 1160 18/05/2015

Cancel button on the filesync application was found to be non-functional after all these years -
now fixed...though you wouldn't really wanna use it

Revision 1156 18/05/2015

Minor change to ## Revision 1107 and bncs_filesync - regular expressions now use "search" rather than
"exactMatch" so that you have to explicitly specify start and end tags (e.g. ^old$ ) rather than
have them implied by the function call

Revision 1152 15/05/2015

Speculative fix to log control to fix crash problem (initial UAT suggests a positive move)

Revision 1149 15/05/2015

GRD32 v1.0.7.0 crashfix to out-of-range array value when using virtual dests with unset tallies

Revision 1140 14/05/2015

<2015 release 2> - candidate for release

Revision 1124 11/05/2015

Alarm config editor:

  • BNCS Input - Right-click context menu for inputs is now enabled whichever column is selected.

Revision 1121 11/05/2015

Alarm config editor:

  • BNCS Input - Fixed enabling Delete and Edit Process buttons in the Dependant Inputs area.
    Should now be enabled only when a process is actually selected.

Revision 1119 11/05/2015

Alarm config editor:

  • BNCS Output - Duplicate module now fully working.
  • BNCS Output - Delete module now on Del key (was ctrl-x).

Revision 1117 11/05/2015

Fix to uiHost control docs - was missing images

Revision 1110 08/05/2015

Fix to bncs_cachedData (rev 868) to not spit out debug messages that end up visible in the file-sync window

Revision 1107 07/05/2015

bncs_filesync (launched as part of bncs_ws_mgr's startup sequence) now accepts regular expression
configuration so that individual file types may be excluded

Revision 1101 06/05/2015

Alarm config editor:

  • Processes - Dialog area now also shows invalid process references.

Revision 1083 01/05/2015

CSI, Infodriver and GRD now use new-style of icons

Revision 1076 30/04/2015

bncs_cachedData v4.6.6: was pretty casual about what it loaded from instances - would accept any tag with an id value
now changed to be more discerning

Revision 1073 30/04/2015

Panelman v4.6.3: Fix to 1041 where relative paths to SHARED panelman image resources got upset

Revision 1069 29/04/2015

Alarm config editor:

  • Processes - Added a column to show process validity, and mark invalid process by colours.
    Process input selection dialog now shows invalid processes, greyed-out.
    They can't be manually removed but (as before) will be removed on selecting OK.

Revision 1067 27/04/2015

Alarm config editor:

  • Processes - Copy process using template has been changed visually to be clearer regarding the functionality.
    And now accesible using Ctrl-T.
  • Processes - Added "Clear Filter" button.
  • Processes - Changed "Delete Process" from Ctrl-X to the Delete key.

Revision 1065 27/04/2015

bncs_clock (digital/lcd variants) now only updates the value written to the display when it changes rather than every tick
panelman now only updates the clock display when the value changes rather than every tick

Revision 1060 24/04/2015

BNCS_SIGNATURE version string name clashes in certain libraries. Renamed (shouldn't cause any issue -
these are there to verify version of static libraries used to build projects)

Revision 1058 23/04/2015

Script wizard now allows you to select VC6 and/or VS20xx versions of the project files.
Setting is persisted between sessions so that you shouldn't have to set this more than once

Revision 1055 23/04/2015

runVisEd can now be used without command line parameters to just run the current vis ed (i.e. pin runVisEd to your task bar and it'll always open the correct vis ed according to your env vars)
runVisEd and bncs_vis_ed now have the new-style app icon

Revision 1052 23/04/2015

Alarm Control.

  • Added context (right-click) menu to select a process name as a filter (main or input). Still able to double-click to set an input filter.
  • Fixed odd handling of which items are left selected when a filter is removed.

Revision 1048 22/04/2015

Alarm config editors:

  • BNCS Acquisition - Fixed enable state of signal-on controls according to Input Type (ie not available for Alarm System Input).
  • BNCS Acquisition - Now able to automatically insdert nwe input processes into per-group overalls.
  • BNCS Output - Second column of module list-view now shows file-name.
  • BNCS Output - Deleting module now works (Save buttons should be enabled when this is done so action can be confirmed, ie written back to the server).
  • Database Output - Second column of module list-view now shows file-name.

Revision 1041 21/04/2015

**** COMPATABILITY WARNING ****
Panelman now accepts the command line parameter /size as a profile name rather than a fixed size.
It then looks in a folder of that name for its resources. ie. a command line parameter of /size=mySize
will load the title bar from panelman/mySize/pm_title.bncs_ui
Note: the resources are just the same as they were, but now in their own sub-folder and lose the numeric suffix
The layout of the final panelman UI is then down to the configuration within the pm_title, pm_app, pm_status and pm_blank
You MUST have a pm_blank.bncs_ui of the correct dimensions in order to set the location of the main client area of panelman

To make it easy, the upgrade tool that runs when you upgrade: "V4.5 System Check" will move these files, copy the PNGs
and create a likely pm_blank.bncs_ui for all known panelman sizes

Revision 1021 14/04/2015

GRD32: v1.0.5.0 Will now return a tally if you route a virtual source to a dest that's already got the real source on there (and wouldn't otherwise return a tally)

Revision 974 31/03/15

Now has renamed builds of database_vs2013.lib and ccLibrary_vs2013.lib as they don't play happily together in a mixed VC6 environment

Revision 945 24/03/15

adds 3840x2160 panel size to panelman

Revision 896 19/03/15

bncs_cc.dll now included from the freshly built version not an "uncontrolled lib" previously manually included
PDF docs now generated from Office internally rather than "printing" to an external PDF writer

Revision 868 16/03/15

bncs_cachedData version 4.6.4.0 -checks to see if complex_instances directory exists before trying
to get a list of entries or else it throws a visible debug message (filesync)

Revision 862 13/03/15

Router name grid & dest grid now support databases 8-65535 for names and mapping
CSI32 v1.2.50 - memory database now uses default filenames for databases which are in the format DEV_nnn.DByyyy where
yyyy is four character zero padded database name. You do not need to specify a filename explicitly for any level in bncs_system.ini/csi.ini if you're happy this format

Revision 857 12/03/15

First round of updates to alarm system documentation. Part of Bug 2585.

Revision 844 11/03/15

All version resource fields should now be set consistently, and copyright years set, in exes, dlls and installers.

Revision 817 09/03/15

CSI32 and V4.5 client now supports 65536 databases rather than just 10 when in "UseMemoryDatabaseOnly" mode.
All usual rules apply except you do not have to supply the path to the file in the DEV_nnn.INI file

  • it defaults to DEV_xxx.DBnnnnn where nnnnn is a number 0 to 65535 with no zero padding e.g. DEV_123.DB20 or DEV_123.DB65535<<<<<<this changes in ## Revision 862
    The number of databases supported my be retrieved using the new IPC message: BBC_GETMAXDATABASES

Revision 801 06/03/15

doSnapShot version 4.5.2 now writes a log to "the usual place" so that its activities can be traced

Revision 790 05/03/15

Small fix to the context link in the editor to the docs for the (deprecated) router source grid

Revision 714 19/02/15

Panel scripts docs-only wizard now works (broken by previous script wizard changes)
bncs_buildTool now creates a default configuration if it doesn't exist

Revision 705 16/02/15

bncs_listbox: force a recalculation of the layout when changing sort mode (otherwise you end up with cropped names)

Revision 702 16/02/15

extinfo:
better behaved wrt interprocess comms.
COMPATIBILITY WARNING: Fixes notification value when being set to RxOnly (previously it would return raw IPC value BBC_DEVICEIDINUSE rather than the wrapped up TO_RXONLY)

Revision 691 12/02/15

UI Connections rewriting now extended to [id.param] or ["buttonName".param] to allow retrieval of values from controls within the connection itself

Revision 675 10/02/15

File-sync is now case-insensitive when considering exclude lists. Workstation manager includes "source" in the exclude
list it passes to file-sync, but the folder is usually "Source" so was not being properly excluded from the sync.
There is now a "<<" operator available in bncs_string for C++ stream output.

Revision 648 29/01/15

ui host now reads connection information of its configured UI so that you can populate a script like table with those senders/receivers that contain the [parent] keyword

Revision 635 27/01/15

Fixed careless handling of = when setting params on a cpp scripted component meant you couldn't have = within the value itself

Revision 632 27/01/15

The name grid control was not marking the state as dirty when assigning new sources - this was preventing it from saving

Revision 629 26/01/15

Note about using [startup] in connections (feature there but not previously made the docs)

Revision 625 23/01/15

Minor enhancement to listbox to stop it moving about (quite so much) when updating entries

Revision 622 22/01/15

adds multi-column options to the normal listbox control

Revision 615 22/01/15

IMPORTANT FIX to bncs_cachedData which was not correctly loading device type information (smart buttons wouldn't target properly)

Revision 593 15/01/15

Panelman now has a 1920 profile e.g. windows\bin\paneman /size=1920

Revision 547 02/12/14

Shim now no longer re-polls for slots that do not have a registration (it relies on the fact there's
a client registration to know to stop polling).

Revision 531 28/11/14

The quest to tidy up the rounded edge - this now works on components that have only a single child or are not transparent

Revision 503: 18/11/14

bncs_ssmart.dll (smart controls): v4.6.112
cascades the edge masking code to the right place for different button presentations

Revision 494: 17/11/14

bncs_ssmart.dll (smart controls): v4.6.111
Base control now better behaved with all possible combinations of press/release/focus/doublepush
Fixes an obscure issue where an enum with no style set in the device description would cause a crash
if you then manually select the "line" style

Revision 452: 31/10/2014

Installer now won't blast local changes of "blank system" components (such as panelman resources or images)

Revision 447: 30/10/2014

CSI32 now allows for BBC_CONFIGCHANGE clients that are not normal (revertive) clients by defaulting to BBC_COPYDATA IPC

Revision 441: 30/10/2014

Renames mis-named bncs_stylesheet to be bncs_cachedData to better reflect its actual use

Revision 437: 27/10/2014

Revision number/URL now stamped into executables so that any release may be rebuilt from source

Revision 402:

Scripting "Control Move" fixed (had been broken by earlier update)

Revision 399

Workstation manager now creates well-known directories on startup

Revision 396

bncs_buildTool now has sample config included in the zipper

Revision 378

Panelman now clears the navigation history when switching out of the engineering menu

Revision 334:

Added more docs that always existed but never made the release
New Docs index document (documentation.html in the root of the system)

Revision 331:

Docs are now not written to docs_updated - I'm not sure why this was ever so, the only local modification was likely to tree_items.js file which is unsustainable since it means you can never update it with new core system docs.

So COMPATIBILITY WARNING HERE - your next update will overwrite not only all your system binaries but also the docs. I'm rather hoping you'd take a copy (or use source control) before embarking on a system update anyway....

Revision 313:

MySQL library updated to 5.6.20 - this may mean that mySQL databases that use "OLD PASSWORDS" e.g. alarm systems may need the user account changing to use the new (>version 4) mySQL password

Revision 312:

Changes script loader to use explicit DLL path rather than leave it to the loadlibrary to infer one. It was found that it didn't work on Win Sever 2008r2 as implicit path.

Revision 295:

minor tweak to inst env to explain how the environment is only set when you create a process and how launching
apps from an already running explorer window will pick up the old environment

D20140519T140852:

Alarm System

  • Added facility to manually request that AlarmControl go RxOnly when it is TxRx.

CSI32 - v1.2.44 - adds redundancy master feature

v4.5 custom controls

  • minor correction to range button default state so that it updates when set dynamically

D20140407T103348:

bncs_control
removes debug messages
removes stop and immediate restart of deferredstartup control

Workstation manager:

  • new mechanism to chain execution to a deferred update application so in-use files can be updated without fuss
  • adds command line option to resync/restart - simply attempt to run a new instance of workstation manager with
    this as a command line option and it will force the existing instance to resync/restart
    CSI32:
  • new message type for configuration change - this is just the delivery mechanism and a proposal for packet format
    Alarm System
  • Alarm Log files are now written into named sub-folders (once the alarm system name is known). Bug 2509.
  • Erroneous indication of "Fail" from database output modules has been fixed. Bug 2505.
  • Erroneous display of unselectable instances in the Manage Templates dialog (BNCS Output module) has been fixed. Bug 2487.
  • Complex instances now display correctly in the BNCS Acquisitions editor. Bug 2485.
  • Substition of alt_id values (using %alt_id%) is now working properly. Bug 2458.
  • Other information from the instance may be substituted in the same way as alt_id. Bug 2452.
    • Available values are: location, composite, type, ref, device, offset, complex (use %location% etc).
  • If the process number goes above 9999 the alarm system will now either provide an indication or work properly. Bug 2455.
  • An issue was noted where the BNCS acquisition startup poll would continue to run long after the diagnostics
    indicated that all required data had arrived. This has been fixed.
  • A re-poll may now be manually requested. This may be done for all the BNCS Acquisition modules, or individual modules.
  • Copying processes using a template now allows the number of leading zeroes to be specified.
  • *** There is an undocumented restriction that the database output module will not work properly if more than one instance
    of the module is running on any one PC. Work is ongoing to remedy this but for the time beig it should be avoided.
    Bugs 2507 and 2510.
    GRD32
  • updated GUI
  • Filters RC messages from destinations that are locked by external driver - Bug #2532.
    bncs_stringlist
  • small change to documentation to correct misunderstanding with sort function
    Workstation Tracker
  • The "restart the whole system" button is now only available if it is configured ([WSTracker]EnableRestartAllButton). Bug 2516.
    Log control
  • The Log Control may now be configured not to connect to a database. Bug 2451.
    This is relevant if it displays a single line, in which case there is no room for historical data.

14/3/14

Smart Controls
Fixes a bug in ListView where using the Reset command adds an extra connection each time. So mulitple connections are send out on each click

10/02/14

Smart Controls - 4.6.103
makes navigateCanExecute do something sensible (based entirely on the filename rather than applications.xml config)

07/02/14

dCW - 4.5.27
trying to set path of null widget pointer - crasher

07/02/14

Smart Controls - 4.6.102
careless problem introduced reworking DLL-controls comms to allow for spaces - upshot was that PR didn't work

03/02/14

bncs_buildTool
Generic tool born out of VS2013 conversion/building that searching a path for filename pattern matches and then run a tool against them

28/01/14

GRD32 - v1.0.0.7
Adds button/menu option to view virtual routes - Bug #2503
Reinstates original NetUpdateOnStart mechanism - Bug #2508
Revised GUI layout (bug 2503)

23/01/14

Smart Controls - 4.6.98
two mechanisms font scaling now tidied up

16/01/14

dCW (connections) - 4.5.26
fix to parent connections filtering
adds startup connection event

14/01/14

Smart Controls- 4.6.97
schoolboy trig and now shrink to fit works with angled text - both vertical and arbitrary angles (vertical more efficient than arbitrary)

09/12/13

Smart Controls - 4.6.95
fix to fader control to not use the multiplier internally

16/12/13

Smart Controls - 4.6.96 Changes to ensure that upsidedown faders (min>max) work properly for faders"

17/12/13

Workstation Manager - 4.5.17
if configured uses "wait for input idle" so that apps that take an age to start up can be monitored and wait for launch
scope of bncs_disklog changed so that the scope of one logging function doesn't block a second call from opening the file

09/12/13

Smart Controls - 4.6.94 fix to fader control to update the range on the fader when incoming min/max changes

09/12/13

Smart Controls - 4.6.93
small fix to ensure that the router name grid updates correctly when targeted with device rather than instance

06/12/13

CSI32 - 1.2.38
Updates database functions to be the same as those just optimised for bncslink
cache function now returns the correct value on not reading a cache entry

26/11/13

CSI32 - 1.2.37
Makes buffer for NetDisable big enough to hold the data (crash fix)

11/13 - 12/13

Changes to creation of UIs, use of timers, deferred startup

14/11/13

Smart Controls - 4.6.89 enum now clears current state if not targeted and won't target when only instance is valid but parameter not

12/11/13

CSI32 1.2.34/35
now has memory cache functions using same code as memory databases
heartbeats now sent out for all registered devices even when there are 999 of them

11/11/13

bncs_string - 4.5.18
adds rfind(char) option

11/11/13

bncs_string - 4.5.17
silly fault with bncs_string::find( char, index, cs ).... that meant it always searched from the first char not the given index

11/11/13

v3Caplog 3.15.01
now filters RD messages according to the revertive filter"

04/11/13

Smart Controls 4.6.87
Now doesn't display the ""extra"" 9 fixed position pixmaps when the button is disabled.
Clears the pixmap values on the dest button when changing pages.

24/10/13

Smart Controls 4.6.86
Fix to popup navigate destination so that popup controls the lifetime of the child widget properly and that the signals off it don't get connected multiple times"

22/10/13

Alarms System Inputs
Will now support more than 10000 inputs

15/10/13

autohost - 4.5.2.0
adds ability to load .bncs_ui files instead of just DLLs (usual prioritisatiom rules apply)

15/10/13

CSI32 - 1.2.33
reworks packet recovery to use NetBIOS not AF_NETBIOS socket so that it works on 64 bit OSs

15/10/13

V3Caplog 3.15.00
now doesn't use external DLL for packet recovery messages but uses normal NetBIOS "buffers" - this means it'll work on Win7/64"

11/10/2013

Panelman - 4.5.20.0
now allows bottom row (the original buttons) to appear on the extension app bar dialogs - if this is present (not compulsory) the "more" button becomes a "less" button so that the UI can be dismissed"

07/10/13

bncs_filesync 4.5.4.0
has new flag to control the readonly state of the destination. Setting the flag changes the attributes of the file so that it can be replaced - otherwise sync fails.

07/10/13

bncs_config 4.5.4.0
fixes to ensure that comments in the XML file are not misinterpretted as real data

07/10/13

Smart Controls 4.6.85
now allows return of "name" parameter from smart button types

04/10/13

Smart Controls 4.6.84
clears smart string value when retargeting
bncs_instance control now has full bncs_control editor to set style, states, notifications etc
fixes "next" in bncs_enum button mode when one of the states is null"

30/09/13

autohost 4.5.1.0
Now closes with CSI

30/09/13

Smart Controls 4.6.83
splits info/gpi/router poll/query commands into separate things - previously IP and IQ (etc) would both have just polled...

30/09/13

Panelman - 4.5.19.0
mod so that you don't get an unnecessary blank page when using multiples of the number of buttons on the application bar

25/09/13

bncs_log
Added ability to control vertical scroll bar visibility - auto, always on, always off.

Alarm System
Allows selection of system folder to read config from. Some plug-ins ignore it as they only use the main config file which was already passed in in full.

23/09/13

Panelman - 4.5.18.0
Adds titlebar targeting information for custom titlebar
adds abiltiy to override the panelman button text (caption) from the default taken from applications.xml with a value in panelsets

19/09/2013

Panelman - 4.5.17.0
optimisation of retrieval of "instances" data


ReleaseNotes-AlarmsConfig

V4.6.5.rc2.1 Alarms and Config Supplementary Toolkit Elements Release Notes

Version | Date | Writer
4.6.5.rc2.1 | 25/06/2018 | Richard Kerry.

This release addresses a number of issues that have arisen with 4.6.5.rc1.1.
Due to the subsequent release of 4.6.5.rc2, this release branch has been changed to be based on that release version.

Alarms Database Output Module

  • BST-301 The crash has been fixed.
    A crash was found to occur at the end of the process of transferring the file buffer to the database in certain circumstances. This has been fixed.
  • BST-67 (possibly also BST-245) Failure to transfer data from file buffer to database no longer causes the record to be reinserted in the file buffer.
    It was noticed that while doing the transfer of data from the file buffer into the database, if the write to the database was deemed to have failed, the record that it was trying to write would be written back into the file buffer. The effect of this was to cause duplication of the record, unncecessarily increasing the size of the buffer file. This is no longer being done.
    It was noted that this can easily be caused by not having one of the two tables present in the database. Therefore both the tables should be present, even if one (typically process_data) is not going to be read.

Although BST-67 mentions CPU usage this would not appear to be obviously affected by this fix, so it isn't certain that it is a full fix for the issue.

There have also been fixes to the multi-threading aspects of this system to improve its reliability.

AlarmControl - Alarm System Main Application

  • BST-308 The internal value used to enable the UDP system is now initialized properly.
    This may not fix the issue as reported, as that has not been seen on a development system, but should ensure that all systems start in a consistent state.

The Smart Controls library (bncs_ssmart.dll) has been removed. The only reason for it being a part of this supplement was to provide the bncs_data_button control. As far as the BNCS team is aware that control is not in use anywhere, so it will shortly be made unavailable in main releases. For this supplement it is also being removed to avoid requiring a build or release of the Smart Controls library.

Version | Date | Writer
4.6.5.rc1.1 | 25/05/2018 | Richard Kerry. Except BST-62 by David Yates.

This release contains a number of improvements that have been done over a period of time. There is a further list of improvements that are planned to be done but due to the time these are expected to take a release is being done with items already completed.

Alarms BNCS Acquisition Module

  • BST-58 (2753) Some improvements in logging. Relating mainly to the BNCS acquisition module and the Database output module.

Alarms Database Output Module and its Configuration plug-in

  • BST-34 (2510) Location of database output buffer files.
    These were previously stored as %CC_ROOT%\%CC_SYSTEM%\data\logioNode<various numbers and extensions>.
    They are now in %CC_ROOT%\%CC_SYSTEM%\data\<alarm system name>\<module number>logioNode<various numbers and extensions>.
    Where <alarm system name> is the name of the alarm system, as seen in the /AlarmSystem parameter, and <module number> is the number from the corresponding al_out_nnnn.cfg configuration file.
  • BST-58 (2753) Some improvements in logging. Relating mainly to the BNCS acquisition module and the Database output module.
  • BST-62 (2772) An issue has been fixed whereby an exception would cause a thread in part of the system to stop running, but the remainder of the system would continue to run. The effect of this would be likely to be similar to what is described here, ie the system would not stop completely (crash or hang) but appear to continue to run, but with some functionality broken.
  • There is now an extra control to allow the port number to be set for a mySql server. This is present in the alarm output configuration and in all controls that are able to access the alarm logging database.
  • Configuring the reserve database Driver to ODBC would disable the main database's host entry control (ODBC doesn't need a host).
    This has been fixed, so now configuring the reserve database Driver to ODBC will disable the reserve database's host and port number controls, and configuring the main database Driver to ODBC will disable the main database's host and port number controls. This applies to the alarm output module and to all controls that reference the alarm logging database.
  • BST-235 The values used for initialization of date-times in a mySql database have been changed to comply with stricter validation that has become the default in approximately mySql version 5.7. Specifically 0000-00-00 is no longer permitted as a null value for dates, so this has been changed to 1000-01-01. Thanks to Andy Woodhouse for spotting this issue and for researching the cause.
    This only affects mySql servers; the values used for ODBC (SQL Server) have not been changed but may be in the future.

Log Control (bncs_log)

  • There is now an extra control to allow the port number to be set for a mySql server. This is present in the alarm output configuration and in all controls that are able to access the alarm logging database.
  • Configuring the reserve database Driver to ODBC would disable the main database's host entry control (ODBC doesn't need a host).
    This has been fixed, so now configuring the reserve database Driver to ODBC will disable the reserve database's host and port number controls, and configuring the main database Driver to ODBC will disable the main database's host and port number controls. This applies to the alarm output module and to all controls that reference the alarm logging database.

AlarmControl - Alarm System Main Application

  • BST-256 Location of AlarmControl's stored state file.
    AlarmControl maintains a list of all current states to improve the efficiency of starting-up.
    Formerly this was at c:\Users\<user>\AppData\Local\Temp\colledia_alarms\%CC_SYSTEM%\<alarm_system_name>\AlarmControl.dat, which is not clearly part of the BNCS system and this location was not widely known.
    It is now at %CC_ROOT%\%CC_SYSTEM%\data\<alarm_system_name>\AlarmControl.dat.
  • BST-46 (2702) Timed overrides of alarm states, as entered via the BNCS output interface, are now preserved in the AlarmControl stored state file so will be persisted over restarts.


_core_components

Core UI Components

These are released independently, with their own help file.

Look here: panels_core_components\core_components.chm


faq

BNCS V4.6 FAQ

Development

What compilers are supported?

  • Visual Studio 2013
  • Visual Studio 2013 Express

error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL'
Earlier compilers were a bit chilled about mixing release/debug versions of libraries but VS2013 is fussy

For a debug build you need the debug version of the libraries - these typically have a "db" suffix. E.g. bncs_string.lib has a debug version bncs_stringdb.lib

System

CSI32-based Workstations can't see each other

Ensure that the adaptor/lana number is correct. Use the setlana tool. This number is specific to each workstation.

Workstations not updating

The update mechanism requires that the workstation user has an account on the system server you want to get the files on. Typically this has meant having the same user (often called bncs_runtime) on both client and server and with matching credentials. It's just normal Windows file-sharing. On the machine that won't update, try opening a share to the server in Windows Explorer - if it needs you to enter credentials to do this then you have a mismatch in your set-up. The update mechanism doesn't understand how to supply the credentials.

"Can't find entry point...."

This sort of DLL error are almost always mixing DLLs and EXEs from different systems. Have you just updated or changed your active system from one path to another? See next FAQ item...

Things not working after installing/switching BNCS systems

Environment variables are used for BNCS paths and are set when an application starts. So if you change BNCS system any existing Windows Explorer window will still be running with the old values. So try and run up what you think is your new system and things get very confused.

Also possible to get both "System" and "User" copies of the CC_ROOT/CC_SYSTEM/CC_SERVER_ROOT environment variables so ensure there's only one set.

My device/panel doesn't work

There's much case sensitivity across V4.6 - make sure you're consistent with your CapItAlIsatIon
Make sure spelling is the same across the different configs.
Ensure there aren't duplicates.
Use an XML-checking editor (e.g. Notepad++) to ensure you don't save invalid XML

Database names don't appear

Have you told CSI where to look by specifiying the filename right in the DEV_nnn.ini file? Have you got duplicate entries? Files do not need to be in numerical order.

My driver doesn't work after a restart

Update mechanism is frisky in that it will forcibly copy files from the server. If you made changes locally they will have been lost. Make sure changes get applied back to the server.

Workstation Stalling

Some applications use internal-to-the-PC "broadcast" messages to notify other applications of something an unfortunately everything must process these messages before things continue. If you suffer a stall use "Analyse Wait Chain" in Win 8/10 Task Manager (or the same thing can be found in "Resource Monitor" on Win 7) to find out what things are hung up on.

UI

How do I turn tooltips on/off

Look in g_pnlman.ini here

Why can't I right click the UI to edit it?

You need a CC_DEVELOPER environment variable set to "true" (without the quotes)


alarm_overview

Overview

This document describes the BNCS Alarm Main Application. It is a configurable, scalable and modular application for monitoring diverse types of equipment. The application gathers data from devices, pre-conditions it, processes it, and presents it to the output modules, enabling current status and historical log information to be viewed. It is configured using configuration components contained in the BNCS V4.5 configuration client set.

Description

The BNCS Alarm Main Application runs as an executable on the BNCS network. This host application, AlarmControl.exe and the required input (acquisition) and output (presentation) modules, which are dynamic link libraries are loaded by the host application. Without any configuration the application does nothing useful. The key to using this application is setting up a configuration that fits your system and testing it with your system. There may be one or more Alarm Systems on a BNCS System and more than one alarm system may run on the same machine.

Multiple independent configured Alarms systems can coexist in the same BNCS System. There may be one or more input and output modules configured with any individual Alarm system.

overview
The diagram above shows an overview of the system components, these are briefly explained below.

Acquisition / Inputs and Preconditioning

The BNCS Acquisition module gathers data from devices that have BNCS drivers e.g. GPI Crates, Satellite receivers, Glue components. It is also possible to gather information from devices that are not being controlled.

The incoming data is normalised to three standard states: OK, Alarm, or Unknown. Other processing e.g. timed hold-off can be applied at this point.

Processing

All configured processes are calculated at runtime and made available to the output module(s) for reporting. Inputs, fixed time functions, holdoff plus logical operators (OR, AND, NOT, TRUTH) may be configured at configuration time. Changes to the configuration cannot be made at runtime.
Note: there is no inherent severity/priority for processes, they are all equal.

Native States

The ‘native’ states supplied by the Alarm System are: OK, Alarm, Latched and Unknown. The Unknown state is supplied if the acquisition module has never had a revertive from the said input. The latched state is optional and is configured for each process.

Override States

A panel element (button) may be configured to override the native states. The possibilities are any of the following:

  1. Acknowledged. This is when the operator acknowledges the process.
  2. Forced Off. This is forcing the process to appear OK.
  3. Forced On. This is forcing the process to appear Alarm.
  4. Ignored. One shot Force Off. It resets the next time the process goes to OK.
  5. Normal. This removes any override. The process reverts to its true, native state.

Note: A process cannot be made to be OK. This will only happen when the input has returned to an OK state.
The diagram below shows the state cycle of a process. It shows the possible states that a process can be in as it goes from OK to Alarm to OK again. If the process is not configured to latch then acknowledgement is optional. If it is configured to latch then it may be configured to only require one acknowledgement per alarm-OK transition. This configuration is done at configuration time.

Output/Presentation

At present there are two output modules available the BNCS Output module and the Database output module.

BNCS Output

This module will present the states of configured processes as devices on the BNCS network (Infodriver presentation). The panels interact with these devices to show the status of the processes and to perform any overrides.

Database Output

This module will present process information to a SQL database on the network to store the current states of configured processes and as a historical log. It can log the date/time, process name, device name, state, group, severity (5 =major alarm to 1= information). It also broadcasts changes to the BNCS network to enable appropriate clients to display a view of the information.
When an alarm is forced off, this will be logged, but any changes to the actual source will not be logged until the override is cleared.

BNCS Client

This is a normal BNCS client and is not part of the alarms system itself. It could be an alarm panel, or a mixture of a control, navigation and alarms functionality. If alarms are presented to the client it is possible for the operator to override the state. For example, the operator could acknowledge an alarm in the Alarm state or Force On an intermittent alarm while the fault is being dealt with by an engineer. A BNCS V2 client can display the current states and action overrides via the BNCS Output module. In order to display the historical log control the BNCS V4.5 client is required ( or any 2 bit client with SQL support).

Implementation Description

The installation and configuration of the BNCS Alarms System requires an installation of the V4.6 BNCS System. The Alarms System maybe included in the shipped version of the BNCS System.
The Alarms System software consists of the host application, AlarmControl.exe and the required input (acquisition) and output (presentation) modules, which are dynamic link libraries loaded by the host application. Without any configuration the software does nothing useful. The key to using this software is setting up a configuration that fits your system and testing it with your system. There may be one or more alarm systems on a BNCS System and more than one alarm system may run on the same machine.

A typical system will have one or more input modules and one or more output modules configured. At present the input module available is the BNCS Acquisition Module, which gathers information from devices on the BNCS network. There are two output modules available the BNCS Output, which presents the outputs to the BNCS network. The other is the Database Interface Output which writes the to an SQL database, it writes the current state of processes to one table and appends another table to form a historical log. It can also supply change information to a BNCS network and allow BNCS Clients to add information to the historical log. The database interface expects to have access to an SQL database containing the two tables: historical_log and process_data.

Configuration procedure

Each module must be configured for the system to do anything useful. It is assumed that you can run the BNCS Configuration Client and have access to a configuration server on your network. The configuration client allows you to add new alarms systems and configure the inputs, processes and the outputs. See configuration documentation for details.

Starting up

This is typically done from the BNCS Workstation Manager. To do this you must include the required elements in the Launch configuration. For the BNCS Acquisition Module to work CSI.exe must be running in client mode. For the BNCS Output to work CSI.exe must be running in driver mode and the appropriate infodriver (i.e. the one set in the output configuration) must be running prior to AlarmControl.exe. The application AlarmControl.exe is run with the command line “/AlarmSystem=name”, where “name” is the alarm system name. AlarmControl.exe will load the process configuration and the appropriate input and output modules on start-up.

See Appendix for this and all other command-line options.

Diagnostics

The system shown below has one BNCS Acquisition module, one BNCS Output module and one Database Output module. The path is “ C:\CollediaControl\btp” and the alarm system name is PO9.

Note: the display is updated once per second.
The system is displayed at the top of the screen along with the TxRx status.
The “Calculation” box contains: The number of processes in this configuration; the “CalcLoopCount” which is the number of times the programme runs through the calculation in order to calculate all the processes. If the number is 200 there is a serious fault with the configuration that needs to be fixed (it is unable to calculate one or more processes possibly because of a logical tautology or a non-existent input); and the “Process Cycles” which is the number of process cycles completed since the programme was started.

The listview display in the centre of the dialog displays the input and output modules. Their type, module type, instance, name, configuration file name, Tx and Rx counts along with their status is displayed. Any error messages for a module will appear in the bottom display when you click on a module in the list. For the BNCS Acquisition module, the message “ all valid inputs received” will be displayed once a revertive has been received from each configured input.

In the top menu there is a “Diagnostics” tab. Click on this to view the state of and override the processes. The screen is shown below, for each process the name, rule and state are shown. Depending on their state the processes have different colors; the related alarms have the same color on the device panels. It is possible to override the state of any process using this screen. This can be used for testing and to track down errors in configuration.

There are filtering possibilities on process name and process inputs. The process name filter will be disabled if there is anything typed into the input filter. It can only be activated again by clearing the input filter. The input filter can be filled automatically by double clicking on an item from the process list.
The input filter is for detecting the cause of the current process state. E.g. it can be checked quickly from the input list of an “OR” process where an “ON” state is coming from.

The input filter can also be used for detecting configuration errors in the process input list. The invalid (not existing) processes will be listed on the bottom of the right side panel.

Extensions for testing – “Greening”

The greening can be used for setting an alarm system to normal state by correcting all the failed devices. It has only meaning for testing purposes!

The greening can be activated by a greening.ini file, which must be placed into the root directory of an alarm system (\config\alarms\\greening.ini).

The SetInitialStateOK parameter is for activating the greening. If it is switched on the greening will be started automatically after startup. The greening will be stopped after the configured SetInitialStateOKTimeout seconds. If it couldn’t be finished the remaining failed devices keep their states. The updated devices and the devices which couldn’t be updated because of the timeout will appear in the log of the input file.

If the greening is activated a new button will appear on the alarm system GUI for starting or stopping the greening manually. If the greening is running, the failed devices will be updated automatically in each AutomaticGreeningTimeout seconds.

The greening can only be started manually, if the alarm control application is in state Tx/Rx.
If the greening is active, the usage of the state "LATCHED" is switched off on the alarm panels.

The ini file contains the following lines (in the example below the default values are shown):

[Greening]
#initial "greening" - setting the control and alarm instances automatically to state 'OK' after startup
SetInitialStateOK=false

#timeout in seconds for the "greening" after startup
SetInitialStateOKTimeout= 300

#Loop interval in seconds for the "automatic greening" started by the Greening button
AutomaticGreeningTimeout=30

If the file doesn't exist or any of the above mentioned property is not available it will be generated automatically during startup.

Dependencies

AlarmControl.exe requires Calarm_process.dll do any calculation. It addition it requires the QT dll, currently qtmt323.dll.

Appendix

There are a number of command-line options for this program.

/AlarmSystem

This must always be provided.
Syntax is : /AlarmSystem=’name’, where ‘name’ is the name of the alarm system. Ie the folder name within the config folder where the alarm configuration is found.

/Period

(Optional)
Syntax is : /Period=20
This is the time interval for running the alarm process calculations. Unit is milliseconds. Default value is 20(ms).
The alarm system will wait for a short period after startup and then will attempt to perform all the process calculations repeatedly at this interval. This can be a drain on CPU resources and may be reduced by using this parameter.

/Log

(Optional)
This controls logging from certain parts of the program.
Syntax is : /Log=’number’. The number should be in the range 0 to 15. The four bits control four diagnostic flags as follows.
1: AlarmControl itself.
2: The acquisition and output Plug-ins
4: UDP. Ie the mechanism used to ascertain bus mastership.
8: Mastership. Transitions of bus mastership.

/ASFU

(Optional)
This stands for “Acquisition Startup Failure Unrecoverable”.
The program usually assumes that any problem in any plug-in can be recovered from and that the plug-in will do so as soon as it can. In some circumstances, with some plug-ins, this is not possible. In particular it is sometimes found that a problem reported by the Acquisition plug-in is an indication of a fundamental problem from which the plug-in (and the main program) is not able to recover. In this case it is necessary that the whole program should be shut down. To activate this behaviour use this option.

/NetStart

(Optional)
Syntax is : /NetStart=’number’.
Some output plug-ins have the facility to start-up with a reduction to the amount of network traffic (ie BNCS traffic) they produce. A certain time after start-up these will be requested to return to the normal amount of traffic. The purpose is to reduce the amount of unnecessary information being sent to the network during the start-up of the alarm system, which always prouces a large amount of traffic during its start-up.
This time delay, in milliseconds, is calculated by multiplying the parameter by the number of processes in the system. The default is 60ms per process.

Version Control

Version | Date | Author | Comments
1.0 | 31/03/2004 | Charlotte Bell | Original Release
1.1 |  | Charlotte Bell | Processing configuration details
2.0 | 17/11/2005 | Charlotte Bell | Reworking
2.1 | 30/11/2005 | Charlotte Bell | Reworking to fill out bulleted sections
2.2 | 27/04/2009 | Pete Lasko | Updated formatting to bring in line with other existing docs
3.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


index

V4.5 Alarm System

  • Overview
  • Config Files

Modules

  • Main Application (AlarmControl)
  • BNCS Acquisition
  • BNCS Driver Status Acquisition
  • BNCS Output
  • Database Output

Config Editing

  • Alarm Process
  • BNCS Acquisition
  • BNCS Driver Status Acquisition
  • BNCS Output
  • Database Output


convertingDocumentation

Docs on docs

Converting Documentation to Markdown

Overview

I've done lots of these...over 100 in fact and there's no magic way to do it. It's all been done manually!

This isn't however that hard - usually take the text, reinsert the headers, remove a few irrelevances and typos, add the images - all pretty easy if a bit tedious.

Tables

Tables are ok in markdown, so long as they're simple. Use lots of whitespace to make the table readable.

Sadly, lots of tables used for BNCS are far from simple, with the occasional example of single table cell stretching for over half a page.

Text formatting within cells is awkward & fussy in markdown, requiring fragments of HTML. I admitted defeat when importing some of the more complicated HTML tables - those with very large multi-line cells with formatting. This were imported verbatim into markdown as raw HTML with a view to reworking at a later date.

Perhaps the moral of the tale is to recognise when a table isn't appropriate!

Microsoft Word

Take the text and paste into your markdown editor (I'm using Microsoft Code to write this).

The trick with images is use a docx format. If the doc. hasn't started life as a docx then open/save as docx.

Docx is just zip format - so open the zip, find the word->media directory. This contains all the images in your doc. Helpfully, Word seems to number them incrementally from 1 so they're easy to track. Not so helpfully some of them might not be "web format" (i.e. suitable for rendering in HTML). You'll need to convert these. Internet explorer is OK with emf files for example, but Google Chrome not. png, jpg etc. a safer alternative.

HTML

Take the text from a browser window (not the raw HTML) and paste into your markdown editor.

Then pickout the headers as before.

Images are less easily wrangled as their names/formats are as defined by whoever did the page (not like Word incrementing from 1).

Testing / QA

Best thing I've found for this is to open up both docs side by side (windows key and left/right arrow is useful for arranging the windows side-by-side).

Then scroll through them both looking for matching headers, highlights, images etc. You don't have to read every word, but the differences in format are easy to spot.

A final word

Don't invent your own formatting & convensions - similarly don't throw lots of HTML to create your own style. Whilst you may get several points for making it look "better", you lose several million points for it looking different.

Version Control

Version | Date | Author | Comments
1.0 | 09/03/2017 | David Yates | First version


index

Documentation on Documentation

Helpers and Guides

Cheat sheet
Converting Documentation

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


markdownCheatsheet

Docs on docs

Markdown Cheat-sheet

Markdown docs are text with a few simple ways of marking text as a particular style or formatting.

Headers

# This is <h1> tag - use for page titles - only one of these per document
## This is <h2> tag - use for section headers - these are the underlined major headings in your doc
### This is <h3> tag - use for sub-headings
...
###### This is <h6> tag - not sure when you'd need this!

Basic Text

Plain text just appears but if you carriage return once [CR]
the text will continue inline on the output.
If you want to start a newline and remain within paragraph [space][space][CR]
.... add two spaces before pressing carriage return where as [CR]
[CR]
.... two carriage returns start a new paragraph.

Emphasis

Be careful not to leave whitespace between asterisks and text

*This text will be italic*
**This text will be bold**
~~This text will be struck-out~~.

Block

> This item will be shown as an indented block

Lists

May be mixed sub-items (ordered list, unordered sub-items) in the same list by indenting with tabs/spaces

Unordered

* Item 1
* Item 2
    * Sub-item 1
    * Sub-item 2
        * Sub-sub-item 1
        * Sub-sub-item 2

Ordered

1. Item 1
2. Item 2
    1. Sub-item 1
    2. Sub-item 2
3. Item 3

Images

![AltText](url)

For example

![Overview](images/overview.png)

Links

[LinkName](url)

Examples

[Internal Link](#headers)
[Local Link](page2.html)
[External Link](http://bncs.tv/)

Note: Headers implicitly have id tags set so the Internal Link above would link to the top of this page.

Tables

Header | Notes | AnotherCol
-------|-------|-----------
Item1  | Note1 | More 1
Item2  | Note2 | More 2<br/>Second Line
Italic | Note3 | *italic*
Bold   | Note4 | **bold**
Code   | Note5 | `code`

Note For tables with line-breaks in the data - you have to sneak a fragment of HTML in there as shown by adding <br/> tags.

Code/XML samples

Surround a block with backticks (little slanty quotes, usually top left of the keyboard). These are quite hard to represent as text in markdown itself.

```xml

<someXml>
    stuff
</someXml>

```

Markdown can be told what kind of code follows by specifying xml, c++ etc.

Escaped Characters

The following need escaping by preceding with a back-slash:

\ - backslash
` - backtick
* - asterisk
_ - underscore
{} - curly braces
[] - square brackets
() - brackets
# - hash
+ - plus
- - minus/dash
. - period
! - exclamation

HTML Tags

You can embed HTML directly if you really really have to...indeed the only way to control line-breaks in tables is to do exactly this. This kinda however misses the point about leaving formatting out of the markdown, so try not to do it!

Editing

You can edit direct with any text editor (e.g. notepad or notepad++) but better still is to use a more sophisticaed editor such as Microsoft Code which has the ability to preview the markdown. Here's a view of this documented being edited with live (ish!) preview. It's not wholly representitive of the final formatting but it's a good sanity check:

Note Markdown preview in Microsoft Code requires the poorly documented Ctrl->Shift->V keyboard shortcut (this has no menu item)

Creating/Building the markdown into HTML/CHM

This requires two additional tools:

  • pandoc - binary already part of the core_system and can be deployed to your windows\bin directory
  • htmlhelp workshop - a rather old but readily downloadable HTML to CHM compiler

You can "compile" markdown in the following ways:

  • run createDocs.bat (from core_system\docs\common) giving it the path to your ".md" file. I actually associate ".md" files with this batch file so double clicking the file compiles it
  • run the bncs_buildTool selecting the markdown build option - this will "compile" everything in the given path with the current docs template.

Checklist

  • Docs should have a single # header tag.
  • All other headings should be ##
  • doc should be in its own directory with assocated image resources
  • doc should not contain any generic branding/copyright (that's added by the template)

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | First version
1.1 | 09/03/2017 | David Yates Steve Leatherbarrow | Valuable input from Steve to add examples


g_pnlman_ini

File Format Index

g_pnlman.ini

Introduction

The configuration file g_pnlman.ini is an INI file that stores a configuration setting for the Panelman application.

Location

This file is located at:

%CC_ROOT%\%CC_SYSTEM%\config\g_pnlman.ini

Contents

The file contains the following sections: Styles and Debug

Section - Styles

The Style entry in this section defines the bncs_style variant that will be used for all user interface controls. Each variant of bncs_style affects the way every control appears. The following attributes may be affected:

  • Fill style – flat or shaded
  • Rectangle corners – squared or rounded
  • Base font – the size and face
  • Background - colours and textures

NOTE: Values of BackgroundColour, ButtonColour, TextColour, FontSize and Font are only valid when using bncs_style5

Section – Debug

Entries in this section enable functions which may be useful for testing or diagnostics.
Using the Tooltips entry (with value true) in this section will result in showing debug tooltips in PanelMan over any panel or component. The tooltip text contains all parameters and values received by the SetCaption method of the given control.
Using the RightPopup entry (with value true) in this section will enable presenting a popup dialog when pushing the right mouse-button on an Enum label or button control. The popup contains buttons for selecting any pre-defined value of the given enum. The selected value will be written into the associated infodriver slot

Section – Title

This section sets the text that appears in the title bar when no panels are otherwise showing

Section – Engineering

Engineering PIN value. The PIN is NOT this number as such – this is an encoded form of it.
There is a utility that can be used to create the key.

Example Configuration

[Styles]
Style=bncs_style5
UseStyleInEditor=true
BackgroundColour=#4d4d4d
ButtonColour=#bfbfbf
TextColour=black
FontSize=12
Font=Arial

[Debug]
Tooltips=true
RightPopup=true

[Title]
DefaultTitle=BNCS

[Engineering]
PIN=05c85bca

Sample contents for g_pnlman.ini

Notes

  • The default style variant that will be used by Panelman if no entry is found is bncs_style3
  • The style bncs_style3 features shaded buttons and rounded corners
  • The style bncs_style4 features flat buttons and squared corner
  • The style bncs_style5 features rounded buttons, configurable colours (defined in g_pnlman.ini)

Version Control

Version | Date | Author | Comments
0.1 | 10/06/2006 | Chris Gil |
0.2 | 10/08/2009 | Kornel Keseru | Added description for the Debug section
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


index

Config File Formats

Notes

The very nature of XML is that it's eXtensible - so various systems and applications have extended their use beyond what's documented here.

For example, workstations.xml is a very handy place to put the IP address of the workstation and other such information.

System Defintion

launch.xml
object_settings.xml
panelsets.xml
stylesheet.xml
users.xml
workstation_settings.xml
workstations.xml

Application Settings

vised/buttons.xml
logdelete.xml
g_pnlman.ini

Alarms

Alarm System File Formats

Obsolete File Formats

navPluginConfig.xml


launch_xml

File Format Index

launch.xml

Introduction

The configuration file launch.xml is a XML file that stores details about what applications are run on which workstation and how they are handled. For details on exactly how this file is used refer to the workstation manager documentation.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\launch.xml

File Format

Section - Workstation

For each workstation there is a section, there are several attributes for each workstation:

<workstation rebootoncrash="true" csi="csi32" id="1" >
Entry | Mandatory | Description
id | Mandatory | Each workstation has a unique id in the range 1 to 999, this is the BNCS workstation number.
csi | Mandatory | The version of CSI that is run is detailed in the csi setting; this can be any version of CSI.
rebootoncrash | Optional | If set to true it means that the workstation will be restarted if CSI crashes.

Section - Application

For each workstation there is a list of the applications that are run:

<application restartoncrash="true" arguments="151" delay="2000" waitforidle="10000" name="grd32.exe" workingdir=c:\ />
Entry | Mandatory | Description
name | Mandatory | application name typically in the %CC_ROOT%\%CC_SYSTEM%\windows\bin directory.
workingdir | Optional | Working directory for this executable
parameter | Optional | Command line arguments such as device number can be set for each application using the arguments parameter.
delay | Optional | Allow this application to have time to run-up by delaying the following application by the given time period in milliseconds.
waitforidle | Optional | Windows monitors the state of the message loop for the app and can tell when it's stopped doing initialisation and started processing events. This time (in milliseconds) says how long we should wait before continuting to the next application. This can be a more reliable mechanism than a simple delay. For monster drivers with significant initialisation to do, this value can be very large. Note. This is the maximum delay - the actual wait time is as long as it takes the app. to settle (which might be within the blink of an eye)
restartoncrash | Optional | parameter indicates that if the application crashes then it should be re-started.

Example Configuration

<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE instances SYSTEM "launch.dtd">
<launch>
    <workstation rebootoncrash="true" csi="csi32" id="1" >
        <application restartoncrash="true" arguments="998" name="infodriver32" />
        <application restartoncrash="true" arguments="123" name="infodriver32" />
        <application restartoncrash="true" arguments="123" name="drivers\umddrv.exe" />
        <application restartoncrash="true" arguments="151" delay="2000" name="grd32.exe" />
        <application name="config_server" />
    </workstation>
    <workstation csi="csi32" id="100" >
        <application arguments="101" name="grd32" />
        <application arguments="102" name="infodriver32" />
        <application arguments="/size=1024" name="panelman" />
    </workstation>
</launch>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


logdelete_xml

File Format Index

logdelete.xml

Introduction

The configuration file logdelete.xml is a XML file that stores configuration settings for the workstation manager application to delete log files.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\logdelete.xml

Contents

A logdelete.xml element consists of an optional id indicating a specific workstation and a global section that is used if there is not a specific workstation section.

For each workstation entry the following items are required:-

Attribute | Description
id | this is the ID of the workstation, or “global”
enable | when set to true allows the workstation manager to delete the specified logs
daysback | the number of day of logs that are kept, older logs are deleted. Note that this is based on the last date the file was modified.

There can then be a list of directories that are to be searched and old items deleted, this is shown in the example configuration.

Example Configuration

<?xml version="1.0" ?>
<!DOCTYPE logdelete SYSTEM "logdelete.dtd">
<logdelete>
    <workstation id="global" enable="true" daysback="24">
        <dir name="c:\bncslogssssss"/>
    </workstation>
    <workstation id="10" enable="true" default=”false” daysback="24">
        <dir name="c:\bncslogs"/>
    </workstation>
</logdelete>

Version Control

Version | Date | Author | Comments
0.1 | 02/04/2007 | Mark Baldry | Initial document
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


navPluginConfig_xml

File Format Index

navPluginConfig.xml

Introduction

The configuration file navPluginConfig.xml is an xml file that defines the menu structure that appears in the configuration tool main navigation menu, but not the tree-view.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\plugins\navPluginConfig.xml

Contents

For each page on the navigation system there is an XML section detailing the items that appear, the items may be either another navigation page, an editor or a mixture. For each page there is a key, and a desc (description). The starting point is always the “Home” page.. For each item the following items of information are stored.

Name | Detail
name | The name that appears on the navigation page.
target | The target item that is called when the user presses the menu item. Note that this can either be the reference coded in to the plug-in module or a key to another section of this file for a sub-page of items.
pixmap | The image that appears on the navigation page.

Example Configuration

In the example configuration shown has a “Home” page with 4 items on it, shown are the target sub-pages for the alarms as well as the targets that are the actual editor plug-ins.

<?xml version="1.0" ?>
<ConfigNavPages>
    <page key="Home" desc="Home Page" >
        <link name="Alarms" target="Home/Alarms" pixmap="alarm.png" />
        <link name="Developer" target="Home/Developer" pixmap="developer.png" />
        <link name="User Interface" target="Home/User Interface" pixmap="ui.png"/>
        <link name="System" target="Home/System" pixmap="system.png"/>
    </page>
    <page key="Home/Alarms" desc="Alarm System Inputs" >
        <link name="System" target="Home/Alarms/Overview" pixmap="alarm.png" />
        <link name="Processes" target="Home/Alarms/Processes" pixmap="alarm.png" />
        <link name="Inputs" target="Home/Alarms/Inputs" pixmap="alarm.png" />
        <link name="Outputs" target="Home/Alarms/Outputs" pixmap="alarm.png" />
    </page>
    <page key="Home/Alarms/Inputs" desc="Alarm System Inputs" >
        <link name="BNCS Acquisition" target="Home/Alarms/Inputs/cBNCS acquisition" pixmap="alarm.png" />
    </page>
    <page key="Home/Alarms/Outputs" desc="Alarm System Outputs" >
        <link name="BNCS Output" target="Home/Alarms/Outputs/Bncs Output" pixmap="alarm.png"/>
        <link name="Database" target="Home/Alarms/Outputs/Database" pixmap="alarm.png"/>
    </page>
</ConfigNavPages>

Version Control

Version | Date | Author | Comments
0.1 | 13/11/2006 | Mark Baldry | Initial document
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


object_settings_xml

File Format Index

object_settings.xml

Introduction

The configuration file object_settings.xml stores miscillaneous configuration settings associated with objects used BNCS panels and automatics. "Objects" in this case can be anything from details that are not in instances.xml about an instance of a device to details about a room, such as router destinations etc.

Items associated with a workstation are not expected to be held here, they should be in workstation_settings.xml.

By putting information about objects in to a configuration file rather than coding it into an application it becomes easier to make changes and also to have a single application that is re-used for several areas, picking up information about it’s location from this file.objects in to a configuration file rather than coding it into an application it becomes easier to make changes and also to have a single application that is re-used for several areas, picking up information about it’s location from this file.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\object_settings.xml

Contents

For each object there is an XML element, the unique “id” attribute defines the name of the object. For each object element there can be multiple settings saved as an “id” and “value” pair.

Example Configuration

The shown example show s that there are 3 objects, in this case the PCR stack has a list of HD destinations and a list of SDI destinations. There are also 2 PO1 mixers, each with there own set of associated items.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE object_settings SYSTEM "object_settings.dtd">
<object_settings>
    <object id="pcr_stack">
        <setting id="hd_dests" value="49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,0,0,67,68,69,70,0,0,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,1,2,3,0,0"/>
        <setting id="sdi_dests" value="48,49"/>
    </object>
    <object id="po1_mixer_1">
        <setting id="rs422source" value="4" />
        <setting id="pgm_dest" value="9" />
        <setting id="pgm_sce" value="57" />
        <setting id="aux_mon" value="17" />
        <setting id="aux_sce" value="193" />
    </object>
    <object id="po1_mixer_2">
        <setting id="rs422source" value="8" />
        <setting id="pgm_dest" value="73" />
        <setting id="pgm_sce" value="60" />
        <setting id="aux_mon" value="81" />
        <setting id="aux_sce" value="194" />
    </object>
</object_settings>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


panelsets_xml

File Format Index

panelsets.xml

Introduction

The configuration file panelsets.xml is configuration settings for the Panelman application. A panel-set is a list of applications that appears on the menu for one or more workstations. The file can contain multiple panel sets for the entire system.

Location

This is located at: %CC_ROOT%\%CC_SYSTEM%\config\panelsets.xml

File Contents

A panelsets.xml element consists of an id, level and one or more items. Each item refers to an item that appears on the menu bar.
For each item the following items are required:

Attribute | Description
id | this is the name of the application, and points to the directory that contains the application, it is relative to the %CC_ROOT%\%CC_SYSTEM%\panels directory. This should match exactly the corresponding entry in the applications.xml file for captions, icons and titles to be correctly displayed.
class | this indicates the type of panel see below
param | optional parameter that is passed to the application when it is launched.

"class" may be:

  • “application” this launches the application of that name.
  • “instance” this puts an instance on the menu-bar, the appropriate panel for that instance is launched.
  • “devtype”, when the menu item is pushed the user is presented with a liat of all of the instances of that type, the panel for the selected instance is then launched.

Example Configuration

<?xml version="1.0" ?>
<!DOCTYPE panelsets SYSTEM "panelsets.dtd">
<panelsets>
    <set id="eng" level="user">
        <item id="multiview_eca" class="application" param=""/>
        <item id="outputctlp" class="application" param=""/>
        <item id="allrtrp" class="application" param=""/>
        <item id="alarms/logpanel" class="application" param=""/>
        <item id="DatabaseNames" class="application" param=""/>
    </set>
    <set id="eng_bca" level="user">
        <item id="outputctlp" class="application" param=""/>
        <item id="allrtrp" class="application" param=""/>
        <item id="alarms/logpanel" class="application" param=""/>
    </set>
</panelsets>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


stylesheet_xml

File Format Index

stylesheet.xml

Introduction

The configuration file stylesheet.xml is a XML file that defines the settings for states and styles. For a detailed description of states and styles please refer to the separate user documentation.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\stylesheet.xml

Contents

For each object there is an XML element, the unique “name” attribute defines the name of the object. For each style the following XML attributes are detailed.

Name | Detail
name | Unique name for the style.
type | state/style/setting, detailing what type of item it is.
suitablefor | Type of control the setting is suitable for.
description | Short description of use

For each style element there can be multiple settings saved as a “value”, the value can be any string that a control understands, see the separate documentation for each control for specifics.

Example Configuration

The shown example show s that there are 3 objects, in this case the PCR stack has a list of PAL destinations and a list of SDI destinations. There are also 2 PO1 mixers, each with there own set of associated items.

<?xml version="1.0" ?>
<stylesheet>
    <style name="pm_title" type="setting" suitablefor="panelman" description="Panelman title”>
        <setting value="style=label"/>
        <setting value="labelstyle=lowered"/>
        <setting value="colour.background=#000066"/>
        <setting value="colour.text=#ffffff"/>
        <setting value="font.face=Arial" />
        <setting value="font.size=14" />
        <setting value="font.style=bold " />
    </style>
    <style name="enum_selected" type="state" suitablefor="generic" description="Enum button selected”>
        <setting value="colour.background=#80e080" />
        <setting value="colour.text=#black" />
    </style>
    <style name="enum_deselected" type="state" suitablefor="generic" description="Enum button deselected”>
        <setting value="colour.background=" />
        <setting value="colour.text=" />
    </style>
</stylesheet>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


users_xml

File Format Index

users.xml

Introduction

The configuration file users.xml stores a configuration settings for a user.

Each workstation has a default user, there may be more than one workstation with the same user, for instance multiple desks in an MCR have the same user.

This file also contains some panelset configuration relating to the panelmanger.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\users.xml

Contents

For each user the following table shows what parameters are used.

Name | Required | Details
Id | Yes | The user ID
panelset | Yes | The panelset that panelmanager uses for this user.
engset | Yes | The engineering panelset that panelmanager uses for this user.
level | No | see below

Level can be one of the following values and may be readily read in the C++ script helper:

Level | Description | Notes
0 | Read Only | No write privileges
1 | User | Basic privileges
2 | Supervisor | Enhanced privileges
3 | Administrator | Full privileges
4 | Developer | Full privileges and access to developer features and functions

Example Configuration

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE users SYSTEM "users.dtd">
<users>
    <user id="Playout" panelset="playout" engset="test_andrew" level="1" />
    <user id="CMTXR"  panelset="CMTXR" engset="test_andrew" level="1" />
    <user id="CMTXL" panelset="CMTXL" engset="test_andrew" level="1" />
    <user id="VOB"  panelset="VOB" engset="test_andrew" level="4" />
</users>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


vised_buttons_xml

File Format Index

vised/buttons.xml

Introduction

The configuration file buttons.xml is an xml file that defines what types of controls are presented to the user in the Visual Editor.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\vised\buttons.xml

Contents

For each button type the following information is stored.

Name | Required | Details
name | Yes | The name of the control the user can see.
class | Yes | The C++ class name for the control
w | No | The initial width of the control – if absent defaults to 100
h | No | The initial width of the control – if absent defaults to 100
x | No | The X position of the control This shouldn’t be supplied since the control will be dropped at the cursor location. It may occasionally be useful when a control is required at a particular fixed location.
y | No | The Y position of the control See note above.

Each button then may have as many “settings” as are required. These are the same format as “.bncs_ui” files but are a fixed tag with simple text <param>=<value> pairs. E.g.

    <setting value="style=button" />

Example Configuration

The format is fundamentally the same as ".bncs_ui" so you can paste the <control> tags from there.

Note in the example below there are two "bncs_script_loader" entries - one has explicit config for a particular script.

<?xml version="1.0" ?>
<buttons>
    <control name="Button" class="bncs_control" w="100" h="40" >
        <setting value="style=button" />
    </control>
    <control name="Label" class="bncs_control" >
        <setting value="style=label" />
    </control>
    <control name="Enum" class="bncs_enum" >
        <setting value="style=button" />
    </control>
    <control name="Range" class="bncs_range">
        <setting value="style=updown" />
    </control>
    <control name="Browser" class="bncs_ie" />
    <control name="Router" class="bncs_sourcegrid" />
    <control name="Line" class="bncs_line" />
    <control name="Listbox" class="bncs_listbox" />
    <control name="Line Edit" class="bncs_edittext" />
    <control name="Log" class="bncs_log" />
    <control name="db Form" class="bncs_data_form" />
    <control name="db Table" class="bncs_data_Table" />
    <control name="Instance Viewer" class="bncs_instance" />
    <control name="Keyboard" class="keyboard_ctrl" />
    <control name="String" class="bncs_smart_string">
        <setting value="style=button" />
    </control>
    <control name="Clock" class="bncs_clock" style="Analogue" />
    <control name="Whiteboard" class="bncs_whiteboard" />
    <control name="Name Grid" class="bncs_rtrNameGrid" />
    <control name="Dest Grid" class="bncs_rtrDestGrid">
    </control>
    <control name="Script" class="bncs_script_loader" />
    <control class="bncs_script_loader" name="adjust" >
        <setting value="scriptname=/components/adjust" />
    </control>
</buttons>

Version Control

Version | Date | Author | Comments
0.1 | 13/11/2006 | Mark Baldry | Initial document created
1.1 | 27/09/2010 | David Yates | Following updates to the Visual Editor
1.2 | 27/02/2017 | David Yates | Markdown conversion Minor revisions
1.3 | 22/05/2018 | Richard Kerry | Fixed a couple of places where less than character needed to be escaped, especially for the param tag which otherwise causes syntax errors during chm conversion.


workstation_settings_xml

File Format Index

workstation_settings.xml

Introduction

The configuration file workstation_settings.xml is a XML file that stores a configuration settings associated with a workstation used by BNCS panels and automatics.

By putting information about workstations in to a configuration file rather than coding it into an application it becomes easier to make changes and also to have a single application that is re-used for several areas, picking up information about it’s location from this file.

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\workstation_settings.xml

Contents

For each workstation there is an XML element, the unique “id” attribute defines the workstation number.

For each workstation element there can be multiple settings saved as an “id” and “value” pair.

Example Configuration

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workstation_settings SYSTEM "workstation_settings.dtd">
<workstation_settings>
    <workstation id="20">
        <setting id="desk" value="playout_PRESA"/>
        <setting id="suite" value="playout"/>
    </workstation>
    <workstation id="21">
        <setting id="desk" value="playout_PRESB"/>
        <setting id="suite" value="playout"/>
</workstation_settings>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


workstations_xml

File Format Index

workstations.xml

Introduction

The configuration file defines the workstations in a BNCS system and sets the default user. User relates directly to the value in users.xml

Location

This file is located at: %CC_ROOT%\%CC_SYSTEM%\config\workstations.xml

Contents

For each workstation there are the following entries:

Name | Detail
id | The BNCS workstation number.
name | The user friendly name for the workstation.
user | The default user for the workstation, this is used by panel-manager to lookup which panel set to use for this workstation.

Example Configuration

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workstations SYSTEM "workstations.dtd">
<workstations>
    <workstation id="1" name="BNCS File Server" user="Playout" />
    <workstation id="2" name="Alarms Database" user="Playout" />
    <workstation id="3" name="Alarm System" user="Playout" />
    <workstation id="10" name="Router Driver Main" user="Playout" />
    <workstation id="13" name="Axon Driver" user="dev_andrew" />
    <workstation id="14" name="Automatics 1" user="dev_andrew" />
    <workstation id="15" name="Automatics 2" user="dev_andrew" />
    <workstation id="20" name="Pres A" user="Playout" />
    <workstation id="21" name="Pres B" user="Playout" />
    <workstation id="22" name="CMTXL" user="CMTXL" />
    <workstation id="23" name="CMTXR" user="Playout" />
    <workstation id="24" name="Voice Over Booth" user="VOB" />
</workstations>

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


index

File Format Index

Alarms System File Formats

proc_def.cfg
io.cfg

Inputs

acq_bncs_drv_stat.cfg
bncs_acq.cfg

Outputs

alm_db_output.cfg
bncs_output.cfg


io_cfg

io.cfg

Introduction

This document describes the generic settings in the BNCS alarm system input and output configuration files.
The intended audience for the document is system developers and system maintainers.

For each input or output module there is a configuration file. The contents of the file vary depending on the type of module. In each file there is a section called “System”, which this document describes. For all other sections refer to the details for each type.

Note that these files should only be edited using the configuration tools.

Location

The input configuration files are located at:

%CC_ROOT%\%CC_SYSTEM%\config\alarms\x\inputs\al_acq_nnnn.cfg

The output configuration files are located at:

%CC_ROOT%\%CC_SYSTEM%\config\alarms\x\outputs\al_out_nnnn.cfg

where “x” is the alarm system name and “nnnn” is the unique module number.

File Contents

The file is in the standard Windows ini file format, with a “.cfg” extension. All settings that are common are in the “System” section, detailed below.

Name | Description
Name | User-specified name of the module, for example “MDU inputs”. This is only displayed by the config tool plugin and is not required to run an alarm system which uses the module.
ConfigTool | The path for the configuration tool plug-in to edit this file. This path is internal to the configuration system, not a directory path.
Module | The name of the alarm module dll that is loaded at run time that will use this configuration information.
AlmSystem | The name of the alarm system. This is only present for output modules.

Example of File Contents

Sample contents for the System section of an alarm input/output configuration file.

[System]
Name=Alarm_Output
ConfigTool=Home/Alarms/Outputs/Bncs Output
Module=alm_bncs_op
AlmSystem=MCR

Version Control

Version | Date | Author | Comments
0.1 | 16/11/2006 | Mark Baldry | Initial document created
1.0 | 28/01/2015 | Richard Kerry | Document revised to current conventions and template.
1.1 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


proc_def_cfg

Introduction

This document describes the BNCS alarm system configuration file proc_def.cfg.

The intended audience for the document is system developers and system maintainers.

The file proc_def.cfg is a configuration file that stores the configuration settings for the alarm system processes.

Note that this file should only be edited using the configuration tools.

Location

The proc_def.cfg file is located at: %CC_ROOT%\%CC_SYSTEM%\config\alarms\x\proc_def.cfg where “x” is the alarm system name.

File Contents

The file is in the standard Windows ini file format, with a “.cfg” extension.

Each process is represented by one section, named by the process name.

Within each section the following may be specified.

Name | Required | Details
Rule | Yes | The function of the process, valid entries are AND, OR, NOT, TRUTH, INPUT, TIME, HOLDOFF
Mask | No | The name of another process that masks this one.
Latch | No | If set to 1 the output is latched until overridden.
AckOnce | No | If set and the process is a latch during a cycle from OK to fail to OK you only acknowledge once
Inputs | Not required if Rule=“TIME”. Required for all others. | For a process that is an “INPUT” this is xxx,yyy where xxx is the acquisition module number and yyy is the input number on that module. For most other process this is either a single process name or comma-separated list of names of the processes used by this process. Not needed for “Time” processes.
Retrigger | Only used if Rule=”OR”, where it is optional. Not used otherwise. | Only used on “OR” processes. When this has been acknowledged any inputs going to alarm will retrigger this to alarm, otherwise they stay at acknowledge.
Table_nnnn | Required if Rule=“TRUTH”. Not used otherwise. | A list of truth table entries. If the inputs match the output is on. * is a wildcard. for example : Table_0001=00011*1 Table_0002=1001111
Days | Required if Rule= “TIME”. Not used otherwise. | Comma-separated list of days that the output will be true. 0=Sunday, 6=Saturday
Start | Required if Rule= “TIME”. Not used otherwise. | Start time for output to be true. Time should use 24-hour clock, with hours and minutes separated by colon.
End | Required if Rule= “TIME”. Not used otherwise. | End time for output to be true. Time should use 24-hour clock, with hours and minutes separated by colon.
Holdoff | Required if Rule=“HOLDOFF”. Not used otherwise. | Time in seconds that the input must be on before the output is on. Decimal fractions of a second are allowed.
IgnoreIntermediateStates | Only used if Rule=”OR”, where it is optional. Not used otherwise. | Only used on “OR” processes. If this is set the process will ignore intermediate states such as latched.

Using the configuration tool is the safest way of creating this configuration.

The configuration of each type of process has two compulsory entries, the unique name for the process and the rule. The rule must be one of the following: INPUT, OR, AND, NOT, TRUTH, HOLDOFF or TIME. In addition there are other entries which depend on the rule specified:

INPUT

This requires one entry - ‘Inputs’.
The value should be the acquisition module number and the input number separated by a comma.
For example:

[SatRx1_Lock]
Rule=Input
Input=342,7

This means acquisition module 342’s input 7 is the input process ‘SatRx1_Lock’.

OR

This requires one entry ‘Inputs’.
It should be a comma separated list of the process names to be ‘ORed’.
For example

[PSUs1-3]
Rule=OR
Inputs= PSU1, PSU2, PSU3

An optional setting ‘IgnoreIntermediateStates’ may be used.

AND

This requires one entry ‘Inputs’.
It should be a comma separated list of the process names to be ‘ANDed’.
For example

[SatRx1_lost_signal]
Rule=AND
Inputs=SatRx1_OnAir,SatRx1_Lock

TRUTH

This requires one entry ‘Inputs’, and a number of ‘Table’ entries.
The Inputs entry should be a comma separated list of the names of the processes to be considered in the TRUTH TABLE. These are the Truth table ‘rows’.
There should also be a number of ‘Table’ entries for the Truth Table ‘columns’ which indicate the required states of the inputs to make a TRUE (i.e. Fail, or Alarm) output.
For example the following TRUTH TABLE

Inputs \Outputs | Table_0001 | Table_0002
Proc1 | TRUE (1) | Not Interested (?)
Proc2 | Not interested (?) | TRUE (1)
Proc3 | FALSE(0) | TRUE(1)

Is represented as

[Truth1]
Rule=TRUTH
Inputs=Proc1, Proc2, Proc3
Table_0001=1*0
Table_0002=*11

The ‘Table_nnnn’ entries are the outputs of the truth table. If any of these is TRUE, the output of the process will be true (Alarm). In this example if both Proc1 is true and Proc3 is false or both Proc2 and Proc3 are true then the output will be true (Alarm).

NOT

This requires one entry ‘Inputs’ which contains the input (one only) to be inverted.
For example:

[NOT_Proc1]
Rule=NOT
Inputs=Proc1

This means that whenever ‘Proc1’ is in the Fail state ‘NOT_Proc1’ will be OK and vice versa.

HOLDOFF

The output is on once the input has been on for the designated number of seconds. Fractions of a second are allowed, expressed to two decimal places. This can be used when you don’t want to see any failure lasting less than a particular time period.
If possible it is suggested that the holdoff is done in the Acquisition module to avoid unnecessary processing.
For example:

[Holdoff_Proc1]
Rule=HOLDOFF
Inputs=Proc1
Holdoff=1.5

This means that whenever ‘Proc1’ is in the Fail state for longer than 1.5 seconds ‘Holdoff _Proc1’ will also be FAIL.

TIME

This has the entries Days, Start and End.
If the day matches (0=Sunday,1=Monday etc.) and the time is between Start and End the output will be TRUE (Fail).
For example:

[time1]
Rule=TIME
Days=0,4
Start=07:30
End=16:05

This process will be in the Fail state each Monday and Friday between 0730 and 1605.

In addition there two optional entries for each process, Latch and Mask.

Latch

Latch means that a process will go from Ok to Fail instantly but will not go from Fail to OK unless it has been acknowledged.
For example:

[PSUs1-3]
Rule=OR
Inputs= PSU1, PSU2, PSU3
Latch=1

Mask

Mask means that the process will not fail unless the masking process has failed too (it is very similar to AND).
For example:

[Proc_video]
Rule=Input
Inputs=12,3
Mask=time1

This process will only fail when the input has failed and it is within the time specified by the time1 process (see above).

Example of Configuration file details

The following tables list some typical entries in the configuration file (proc_def.cfg). The examples below are for reference only - the BNCS V4.5 configuration tool should always be used to configure the system, as it ensures all the entries are written correctly.

Example | Notes
[BNCS1_PSU1] | Process’s unique name
Rule=Input | This is an Input process
Inputs=1,8 | Acquisition module 1, input 8
Example | Notes
BNCS1_Proc1_video_Input] | Process’s unique name
Rule=Input | This is an Input process
Inputs=1,19 | Acquisition module 1, input 19
Example | Notes
[Device_PSU_agg] | Name
Rule=OR | This is an OR process
Inputs=PSU1,PSU2,PSU3 | The processes that are used separated by commas
Example | Notes
[time1] | Name
Rule=Time | This is a time of day process
Days=0,1,2,3,4,5 | Sunday – Friday. Sunday is 0, Saturday is 6.
Start=09:30 | Start time
End=22:30 | End time
Example | Notes
[Proc_video] | Name
Rule=AND | This is an AND process
Inputs= BNCS1_Proc1_video_Input, BNCS1_Proc1_video_Input | The inputs used
Mask=time1 | The mask used is process time1
Example | Notes
[Chain1] | Name
Rule=TRUTH | This is a TRUTH TABLE process
Inputs=Proc1,Proc2,Proc3,Proc4 | The inputs list
Table_0001=01*1 | Which inputs are OK or Fail cause the output to be true * means this input can be either Ok or Fail.

This is Proc1 is OK AND Proc2 is Fail AND Proc4 is Fail. We are not interested in Proc3.
Table_0002=111*|If the above condition OR this condition are Fail then the output is Fail

Example | Notes
[Not_Chain1] | Name
Rule=NOT | This is a NOT process
Inputs=Chain1 | The input is process Chain1
Example | Notes
[Chain1 Holdoff] | Name
Rule=HOLDOFF | This is a holdoff process
Inputs=Chain1 | The input is process Chain1
Holdoff=1.5 | Holdoff period in seconds
[AXON_1_PSU_Bottom]
Rule=Input
Group=Axon_PSU
Latch=1
AckOnce=1
Mask=AXON_1_comms
Inputs=1,1
[AXON_1_PSU_Top]
Rule=INPUT
Group=Axon_PSU
Latch=1
AckOnce=1
Mask=AXON_1_comms
Inputs=1,2
[AXON_1_comms]
Rule=Input
Group=Axon_comms
Latch=1
AckOnce=1
Inputs=1,53 [Axon_PSU_Overall]
Rule=OR
Retrigger=1
Inputs=AXON_1_comms,AXON_1_PSU_Bottom,AXON_1_PSU_Top

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 02/02/2015 | Richard Kerry | Document revised to current conventions and template.
1.1 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


acq_bncs_drv_stat_cfg

acq_bncs_drv_stat.cfg

Introduction

This document describes the BNCS alarm acquisition configuration files.
The intended audience for the document is system developers and system maintainers.
The various files store the configuration settings for the alarm system’s modules for input from the BNCS network.
Note that this file should only be edited using the configuration tools.

Location

The input configuration files are located at:

%CC_ROOT%\%CC_SYSTEM%\config\alarms\x\inputs\al_aq_nnnn.cfg

where “x” is the alarm system name and “nnnn” is the unique input module number.

File Contents

The file is in the standard Windows ini file format, with a “.cfg” extension.
For details of the “System" section see the generic IO file documentation and the example.

For each input there is a section called “Input_nnnn” where nnnn is a unique number. For example “[Input_0001]”
Within each section the following may be specified.

Name | Required | Details
Name | Yes | Name of the input. If the input is specified using New Input from Instances the default for this name will be the instance and parameter concatenated.
SourceInstance SourceParameter | Must both be present with or Source | Instance name is used with parameter name to generate device and slot number.
Source | Either Source, or both SourceInstance and SourceParameter must be present. | Explicit driver type, device number and slot number.
SourceType | Yes | Specifies how the incoming divertive data is interpreted. The value must be one of the following: Discrete Analogue AlarmInput
OK Alarm | Either Ok or Alarm must be present. | Specifies the set of values, or range, to be used to signal either an alarm or ok condition.
Holdoff | Required only if hold-off is configured | Floating-point number giving hold-off time, in seconds.
ChatterPeriod ChatterThreshold | Both required if chatter filtering is required. | Floating-point number giving period over which chatter will be counted. In seconds. 0.1 second resolution.
PulseStretchPeriod PulseStretchTrigger | Both required if pulse-stretch (hold-on) filtering is required. | Floating-point number giving stretch time. In seconds. 0.1 second resolution.

Example File Contents

Sample contents for alarm system BNCS input configuration file.

[System]
Module=alm_bncs_acq
Name=Axon_Inputs
ConfigTool=Home/Alarms/Inputs/cBNCS acquisition
[Input_0003]
Name=AXON_10_PSU_Bottom
SourceInstance=AXON_10
SourceParameter=PSU_Bottom
SourceType=Discrete
OK=1
[Input_0004]
Name=AXON_10_PSU_Top
SourceInstance=AXON_10
SourceParameter=PSU_Top
SourceType=Discrete
OK=1

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 29/01/2015 | Richard Kerry | Document revised to current conventions and template.
1.1 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


bncs_acq_cfg

bncs_acq.cfg

Introduction

This document describes the BNCS alarm acquisition configuration files.

The intended audience for the document is system developers and system maintainers.

The various files store the configuration settings for the alarm system’s modules for input from the BNCS network.

Note that this file should only be edited using the configuration tools.

Location

The input configuration files are located at:

%CC_ROOT%\%CC_SYSTEM%\config\alarms\x\inputs\al_aq_nnnn.cfg

where “x” is the alarm system name and “nnnn” is the unique input module number.

File Contents

The file is in the standard Windows ini file format, with a “.cfg” extension.
For details of the “System" section see the generic IO file documentation and the example.

For each input there is a section called “Input_nnnn” where nnnn is a unique number. For example “[Input_0001]”
Within each section the following may be specified.

Name | Required | Details
Name | Yes | Name of the input. If the input is specified using New Input from Instances the default for this name will be the instance and parameter concatenated.
SourceInstance SourceParameter | Must both be present, or Source | Instance name is used with parameter name to generate device and slot number.
Source | Either Source, or both SourceInstance and SourceParameter must be present. | Explicit driver type, device number and slot number.
SourceType | Yes | Specifies how the incoming divertive data is interpreted. The value must be one of the following: Discrete Analogue AlarmInput
OK Alarm | Either OK or Alarm must be present. | Specifies the set of values, or range, to be used to signal either an alarm or ok condition.
Holdoff | Required only if hold-off is configured | Floating-point number giving hold-off time, in seconds.
ChatterPeriod | Required with ChatterThreshold if chatter filtering is required. | Floating-point number giving period over which chatter will be counted. In seconds. 0.1 second resolution.
ChatterThreshold | Required with ChatterPeriod if chatter filtering is required. | Integer giving number of transitions required within chatter period to signal fault or OK condition.
PulseStretchPeriod | Required with PulseStretchTrigger if pulse-stretch (hold-on) filtering is required. | Floating-point number giving stretch time. In seconds. 0.1 second resolution.
PulseStretchTrigger | Required with PulseStretchTrigger if pulse-stretch (hold-on) filtering is required. | Indicates which edge of the incoming signal triggers the start of the stretched pulse. Negative Positive

Example File Contents

Sample contents for alarm system BNCS input configuration file.

[System]
Module=alm_bncs_acq
Name=Axon_Inputs
ConfigTool=Home/Alarms/Inputs/cBNCS acquisition
[Input_0003]
Name=AXON_10_PSU_Bottom
SourceInstance=AXON_10
SourceParameter=PSU_Bottom
SourceType=Discrete
OK=1
[Input_0004]
Name=AXON_10_PSU_Top
SourceInstance=AXON_10
SourceParameter=PSU_Top
SourceType=Discrete
OK=1

Version Control

Version | Date | Author | Comments
0.1 | 09/11/2006 | Mark Baldry | Initial document created
1.0 | 29/01/2015 | Richard Kerry | Document revised to current conventions and template.
1.1 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


alm_db_output_cfg

alm_db_output.cfg

Introduction

This document describes the database alarm output configuration files.

The intended audience for the document is system developers and system maintainers.

These files store the configuration settings for the alarm system’s modules for output logging to an SQL database.

Note that this file should only be edited using the configuration tools.

Location

This configuration module writes files named in the format al_out_<nnnn>.cfg, where <nnnn> is the output module number.
The files are located at:

%CC_ROOT%\%CC_SYSTEM%\config\alarms\x\outputs\al_out_nnnn.cfg

where “x” is the alarm system name and “nnnn” is the unique output module number.

File Contents

The file is in the standard Windows ini file format, but has the extension “.cfg”.

[System] Section

For details of the “System" section see the generic IO file documentation and the example.

In addition to the generic items in the “System” section the following are required:

Item Name | Example | Description
dbHost | 192.168.0.14 | Address of the primary database server
dbDatabase | bncs_alm | Name of the primary database
dbUser | bncs | User name for primary database
dbPassword | psion | Password for primary database
dbDriver | QMYSQL3 | Database driver for primary database Either QMYSQL3 or QODBC
dbHost2 | 192.168.0.15 | Address of the secondary database server
dbDatabase2 | bncs_alm2 | Name of the secondary database
dbUser2 | bncs | User name for secondary database
dbPassword2 | psion | Password for secondary database
dbDriver2 | QMYSQL3 | Database driver for secondary database Either QMYSQL3 or QODBC
Bncs_log_driver |  | The BNCS driver number that the driver appears as on the network.

If any of dbHost2, dbDatabase2, dbUser2, dbPassword2, dbDriver2 are present the secondary database will be configured.
Within the generic System section certain values must be present, with specific values, for the system to work.

Item Name | Example | Notes
Module | alm_db_output (must be this value) | Alarm plug-in module name to be used when this configuration file is found in an alarm system. This must have this value to ensure that the correct module is used.
ConfigTool | Home/Alarms/Output/database (must be this value) | Config editor plugin to be used, not required to run the application. This must have this value to ensure that the correct editor plug-in is used.

Note: In development usage alm_db_outputdb may be found as the Module setting. This requires a debug version of the module which is not present in delivered systems. If this setting is found it is an accident and should be changed to alm_db_output.

Process Sections (eg [Proc_0001])

There is one section for each process from the process list which has any database output required. The section name matches the process name.

Within each section the following may be specified.

Name | Required | Example or Default | Details
OK | No | GPI 1 OK | Text to log for the OK or Forced OK states
Fail | No | GPI 1 Fail | Text to log for the Fail or Forced Fail states
Ack | No | GPI 1 Ack | Text to log for the Acknowledged state
Ignore | No | GPI 1 Ignored | Text to log for the Ignored state
Unknown | No | GPI 1??? | Text to log for the Unknown state
Latched | No |  | Text to log for the Latched state
Device | No | Sat1 | The name of the device
UserGroup | No |  | A user field that can be used as required.
Level | Yes | 3 | Alarm level: 1=information 2=minor warning 3=major warning 4=minor alarm 5=major alarm

Example of File Contents

Sample contents for an alarm system database output configuration file.

[System]
dbHost=10.160.9.36
dbDatabase=bncs_alarms
dbUser=bncs
dbPassword=bncs
dbDriver=QMYSQL3
bncs_log_driver=280
ConfigTool=Alarms/Outputs/Database
AlmSystem=misc
Module=alm_db_output
Name=database

[MDU_12A12-A_GPI1]
OK=SPG 12A12.44 Fan  OK
Fail=SPG 12A12.44 Fan  fail
Ack=SPG 12A12.44 Fan  ack.
Device=MDU_12A12-A
UserGroup=MDU 12A12-A
Level=3

Version Control

Version | Date | Author | Comments
0.1 | 16/11/2006 | Mark Baldry | Initial document created
1.0 | 02/02/2015 | Richard Kerry | Document revised to current conventions and template.
1.1 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


bncs_output_cfg

bncs output.cfg

Introduction

This document describes the BNCS alarm output configuration files.

The intended audience for the document is system developers and system maintainers.

These files store the configuration settings for the alarm system’s modules for output onto the BNCS network.

Note that the files should only be edited using the configuration tools.

Location

The output configuration files are located at:

%CC_ROOT%\%CC_SYSTEM%\config\alarms\x\outputs\al_out_nnnn.cfg

where “x” is the alarm system name and “nnnn” is the unique output module number.

File Contents

The file is in the standard Windows ini file format, with a “.cfg” extension.

[System] Section

For details of the “System" section see the generic IO file documentation and the example.

[BNCS_CONFIG] Section

There is one BNCS_CONFIG section.

Name | Required | Details
Driver | Yes | the BNCS info-driver number that this output will attach to as an external.

[Process] Section

There is one “Process” section.

The Process section has an entry named for each process that is to be output on to the BNCS network.

The value is the infodriver slot number that will be used for that process.

Name | Required | Details
“Process name” | All processes that require BNCS output should be present. | The info-driver slot number to be used for outputting the named process’s value.

[Templates] Section

The “Templates” section will be present if any templates have been used in the module’s configuration.

Name | Required | Details
“Template name” | An entry is needed for each named template. | Two numbers and one string, comma-separated. The first number is the base slot. The second number is the offset. The string is the template’s prefix.

[Instances] Section

The “Instances” section will be present if any templates have been used in the module’s configuration.

Name | Required | Details
Template name | An entry is needed for each template used. | Comma-separated list of strings. Each string will be substituted into the named template.

Example of File Contents

Sample contents for alarm system BNCS output configuration file

[System]
Name=Alarm_Output
ConfigTool=Home/Alarms/Outputs/Bncs Output
Module=alm_bncs_op
AlmSystem=MCR

[BNCS_CONFIG]
Driver=90

[Process]
AXON_1_comms=201
AXON_1_PSU_Bottom=101
AXON_1_PSU_Top=1
Axon_PSU_Overall=4000

Version Control

Version | Date | Author | Comments
0.1 | 16/11/2006 | Mark Baldry | Initial document created
1.0 | 29/01/2015 | Richard Kerry | Document revised to current conventions and template.
1.1 | 27/02/2017 | David Yates | Markdown conversion Minor revisions


General_Docs

BNCS V4.6 Overview

Introduction

What does this document tell you?

This document will provide an overview of BNCS version 4.6. For those that require further details on each module, including detailed specifications, separate documentation is provided.
It is assumed that the reader has an understanding of and previous experience with BNCS.

What is v4.6?

BNCS v4.6 is designed to:

  • Provide a standard way of achieving various tasks including:-
    • Simple installation with a coherent set of files
    • Workstation updates
    • Panels configuration
    • Common tasks
  • Encourage a standard approach
  • Provide configuration tools
  • Allow drag and drop panel creation for simple panels
  • Allow creation of re-usable panel components
  • Allow the power of C++ to be used for automatics and complex panels
  • Speed up delivery of projects
  • Provide a consistent means of navigation between applications

This all leads to greater supportability

What v4.6 is not.

BNCS v4.6 is not:

  • A closed system. Panel code is supplied in the same way that Applcore is, but like earlier versions the source code for the core system is not
  • C++ is not closed, it is just a different, more powerful language
  • Completely new. It still uses the same drivers and CSI as the network layer is identical
  • Designed to restrict usage. It should help do things in a standard way, thus making the system easier to maintain.

Concepts

System

BNCS v4.6 is designed to allow a developer to easily switch between systems in their entirety without any manual moving, renaming or deleting of files. To achieve that all files for a system are within a single directory structure. The current system is selected using environment variables, these being

  • CC_ROOT
  • CC_SYSTEM

The path also needs to have

  • %CC_ROOT%\%CC_SYSTEM%\windows\bin
  • %CC_ROOT%\%CC_SYSTEM%\windows\lib

The installer will set these items automatically.

Once v4.6 has been installed there is a utility to enable a developer to rapidly switch between systems by changing these settings.

Note that there should be no BNCS files in the c:\windows, or equivalent, directory.

File System

The directory structure for a single system called “latest” is shown in Figure 1 Directory Structure; there may be other systems (not shown) in the CC_ROOT directory (“c:\bncs” in this case.)

Figure 1 Directory Structure
Figure 1 Directory Structure

All the binary files are located in the project ‘windows’ directory, with the ‘bin’ directory containing all of the executables while the ‘lib’ directory contains all of the DLLs. The project specific drivers should go in a subdirectory of the ‘bin’ directory called ‘drivers’

Devices and Parameters

Simple Devices

In a broadcast system there are often many types of equipment - Routers, ARCs, Satellite receivers etc. These are called device-types, and for each type there can be many of that device-type installed, called instances.

V4.6 uses the idea of an instance to allow panels to ask the system to adjust an instance. The system will then lookup the device-type for that instance, and start the appropriate panel.

Each device-type can be described as a group of parameters, each with different attributes. For instance a processing amplifier may have a gain parameter, which has a range from -127 to +127, and an output parameter, which is an enumerated list with input, bypass and test as valid settings.

Complex Devices

Some devices will present themselves through other devices. For instance an ARC may present itself directly for most parameters, but the PSU status may be through a GPI. This is known as a complex device-type. The system will treat these in the same way that it treats simple instances.

Composite Devices

In many cases there are virtual devices formed of several real devices in a chain, these are called composite devices. The system will treat these in the same way that it treats simple instances.

Type Handlers

For each type of device a default panel can be assigned for making adjustments to that device, this is called a type-handler. Type Handlers also apply to both composite and complex devices. In the case of a composite device the panel can be designed to control all of the individual items in the composite device.

States, Styles and Skins

Rather than hard-coding how a button looks it can be configured. This is achieved using states, styles and skins. This leads to a consistent appearance, makes it easy to change and can speed up re-use.

Skins

How a control is drawn is determined by the skin, which defines the shape of the button, the edge shading etc. The skins are hard-coded, but can be selected for a system.

Styles

Controls are given a style, which will typically set static items such as fonts and possibly colours. For example a style called “ParamLabel” may set the font to size 14 with white text on a blue background. Setting all parameter labels to use this style will make them appear the same and easy to change globally.

States

Controls can have a state applied to convey information, for example a control may have a state applied called “AlarmOK” which is defined as having a green background. When the state of a parameter has changed the state of the button can be changed to “AlarmFail” which could have a red background. More than one setting can be applied in a single state. In the given example the text, font size and text colour could all be different. The important thing being that the changing appearance of the control is set using a state. It should be noted that a style can be applied as well as a state. The style should contain the settings that do not change, i.e. font name.
Figure 2 Styles, States & Modern Skin shows two controls set with style ‘label’, in this case with white text on a blue background. It also shows two buttons with the same style but different states, indicated by the colour change. Figure 3 Styles, States & Traditional Skin shows the same panel with a different skin applied, but with the same styles and states.

Figure 2 Styles, States & Modern Skin
Figure 2 Styles, States & Modern Skin

Figure 2 Styles, States & Modern Skin
Figure 3 Styles, States & Traditional Skin

Configuration

To aid with configuration of the system there is a configuration tool, which consists of a server and client. The configuration server runs on the nominated server machine while the client can run on any or multiple BNCS workstations.

The aims of the configuration tool include:-

  • Reduce the need for the developer to manually change the files
  • Incorporate some cross-checking where appropriate
  • Guide the developer through various configuration tasks.

The configuration client application will copy the files that the user wants to edit to a temporary directory on the local machine. The configuration tool will then allow the user to edit these files. While a client has the files open on their machine for editing no other client can change the same file.

The configuration client will load various plug-ins to perform the various configuration tasks. Each of these plug-ins works on the same temporary files, so there will be interactions between them. Therefore it is recommended that changes are all saved or rejected as a group otherwise partial changes may be applied.

It should be noted that not all of the configuration tasks can be completed without some knowledge of the files, and some files still require manual editing. If you do manually edit files remember to put them on the server, see "Workstation update" for the reasons why!

Start-up

At start up the main application workstation manager (BNCS_WS_MAN.EXE) is run. It manages the workstation performing several tasks detailed below. It replaces typical tasks that were previously done using batch files and ‘launch’. It is expected that a shortcut to the workstation manager is placed in Windows Startup so that it is automatically run whenever a workstation is started. The overall procedure is shown in Figure 4 Workstation manager run order.
The workstation manager will log activity to the “%CC_ROOT%\%CC_SYSTEM%\logs” directory.

Figure 4 Workstation manager run order
Figure 4 Workstation manager run order

Workstation update

The workstation manager will operate in two modes, stand-alone or client. The mode is set using the bncs_inst_env.exe application. Each mode will run relevant batch files.

All of the batch files are expected in the “%CC_ROOT%\%CC_SYSTEM%\windows\bin” directory. If the batch files do not exist, as they may not be needed for every system, workstation manager will carry on. The batch files must complete if they exist, which means that they should not wait for user input otherwise the workstation manager will be paused until that has happened.

Stand-alone mode

In stand-alone mode no files are copied from anywhere but ‘nosync.bat’ is run. Stand-alone mode is expected to be used for developer machines and the main system server. Typical uses of ‘nosync.bat’ include copying files on the server that need to be in the v2 path, for instance driver configuration for older drivers that run on the server, or for implementing custom settings on development machines.

Client mode

In client mode ‘presync.bat’ is run before performing a file sync, then ‘postsync.bat’ is run.

Important
The file sync ensures that the local machine is exactly the same as the server; this includes removing local files that are not on the server and deleting newer files. The file sync ensures that the master of any given file is on the server and allows a backup of the server to actually be a complete snapshot of the system. If you manually make changes on a local machine, and you want to keep them, then copy the files back to the server otherwise they will get over-written.

Some directories are excluded from the synchronisation process; these are ‘source’, ‘temp’, ‘docs’, ‘data’, ‘install’, ‘backup’ and ‘logs’.
A reserve server can also be defined such that if the main server is not available the update can still take place - in this case you need to ensure that the reserve server is kept in sync with the main server.

Typical uses of postsync.bat include copying files on the local machine that need to be in the v2 path, for instance driver configuration for older drivers, or workstation specific files such as bncs_system.ini. We would recommend that older drivers, if required to be used in new projects, be updated to conform to the new configuration file locations.

Copy settings

This part of the workstation manager copies settings from the local machine into the newly copied files to ensure that any workstation specific settings are maintained, including the adapter number and the workstation number.

Launch

The workstation manager will launch the applications that are required on the workstation. The first application that is launched is CSI, followed by all the other applications which get queued until CSI has fully loaded. Setting the launch order and any options is done using the configuration tools.

Normal running

Unlike previous launch applications, the workstation manager will stay running and monitor the applications that it has started. If an application crashes workstation manager can be set to re-start it. If CSI crashes the workstation can be set to re-start. For applications to be able to restart they must not put up a dialog when they crash as this means that the application is still running. Each application will re-start a maximum of 10 times; after that the workstation manager will stop re-starting the application.

When the workstation manager is shut down it will close all of the applications that it started, including CSI.

Installation Procedure

PC Setup

Note that the following instructions are intended as a guide not a step-by-step set of instructions as these may vary depending on your PC and operating system.

  • Bios settings
    • Disable any power saving settings
    • Start-up automatically after power loss
    • Do not report keyboard errors on boot
    • Disable hyper threading.
  • Create user accounts to be used as required. It is suggested that there is a single user account for all machines to make file sharing easier, e.g. cc_runtime.
  • Date/Time
    • Set the time zone as required
    • Disable auto-adjust for daylight savings on all machines, except the master. On the master time server you may need it set depending on how or if you are locking to an external reference.
  • Security settings are specific to your project, but typically:-
    • Automatic updates off
    • Disable firewall
    • Disable security centre alerts.
  • Network settings are specific to your project, but typically:-
    • Set the IP address
    • Enable NetBIOS over IP
    • Enable file and printer sharing on the server.
  • Power options
    • Set to always on
    • Do not turn off hard disks, displays etc.
  • User password options
    • Ensure that the user does not need to change the password at next logon
    • Set the user not to be able to change the password
    • Set the password never to expire
    • Automatic logon for normal user
      • either
        • Edit the following settings in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon
        • DefaultUserName Set as required
        • DefaultPassword Set as required.
        • AutoAdminLogon Set to 1. You may need to create this entry
      • or
        • Start>Run “control userpasswords2”
        • Clear “Users must enter a user name and password to use this computer”
        • Select Apply
        • Set user name and password as required.
      • Note that these settings can be set using TweakUI from Microsoft.
  • Display properties (in Appearance|Effects…)
    • Ensure that there are no effects set for menus and tool-tips
    • Set the display resolution to match the system.
  • Taskbar settings
    • Set not to keep the task bar on top of other windows.

You may have other settings that you wish to set such as explorer display preferences and Start Menu appearance.

Server

Run the BNCS installer, selecting the options as required.
Using the configuration server/client

  • Create the workstation
  • Set the workstation to launch:-
    • CSI, this ensures that the router database files on the server are kept up to date when there are database names changed on the system
    • Configuration server (config_server.exe)
    • Any other applications required, such as drivers etc.
  • Create a shortcut to workstation manager in Windows->Startup so that it automatically starts
  • Share the BNCS system directory to enable the update mechanism to work; you can set this to be read-only if required.

Workstation

To install a workstation:-

  • Navigate to the share on the server.
  • Locate & run the workstation installer. <c:...\installer\CC_Workstation_Install.exe> This will install the minimum number of files to run the workstation manager, including update, and guide you through the rest of the setup.
  • Set the options required; note that the server path needs to include the share on the server
  • Select the correct network adapter
  • Start the workstation manager. This will do an update from the server to install the rest of the system.

Panels

Panels are edited using the Visual Editor application, bncs_vis_ed.exe. Note that panels are expected to be in the ‘panels’ subdirectory for the system, and the panel directory must match the name of the main panel loaded, e.g. “%CC_ROOT%\%CC_SYSTEM%\panels\test1\test1.bncs_ui”. The same applies to script panels that are DLLs.

Panels are loaded at runtime by the panel manager <%CC_ROOT%\%CC_SYSTEM%\windows\bin\panelman.exe>. For client machines it is normal that this is one of the applications that the workstation manager launches. The end user can not and does not need to know if the panel that they are currently using is a simple panel or a scripted panel.

Icons for the panels that the panel manager uses on the menu buttons are stored in the folder with the panel. The name does not have to match the application; the icon association is set in one of the configuration files.

Controls

There are a range of controls, known as smart controls, which require no programming to communicate with a device, just configuration. The list of buttons that are available for use in the visual editor is in “%CC_ROOT%\%CC_SYSTEM%\config\vised\buttons.xml” enabling buttons to be removed or added to a specific project as required.

Images for range controls are stored in the “%CC_ROOT%\%CC_SYSTEM%\panels\images” directory; which is also the suggested location for any other images that are used so that they can be accessed by all panels.

Targeting Controls

Smart controls can be targeted at a specific instance of a device; this can be done automatically by the system at run time, programmatically at run time, or at design time. To target a control at an instance that forms part of a composite instance the ‘group’ parameter of the control needs to be set to the group element in a composite instance. See separate document for more details.

Simple Panels

Simple panels have no code associated with them; any buttons or labels that perform a function are smart controls.
Only the visual editor is required to create simple panels.
Note the term simple can be misleading as script controls can be placed on to the panel and a lot can be done using only smart controls.

Script Panels

Script panels have code associated with them in the form of a DLL, which contains whatever functionality is required. To create a DLL either use the wizard to create a new panel, or if you already have a panel that you need to create a script for, create the script using the appropriate toolbar item in the visual editor.

The panel layout and any simple controls are configured using the visual editor. Any coding that is required is completed using Visual Studio. The Visual Studio project is created using a wizard, which will leave you only to add your code, all other settings being done for you.

When looking at the code created by the wizard it will be seen that there are several functions already created, these supply you with basic functionality. For full documentation on all of the available helper functions see the separate Web documentation.

Re-usable components

One of the controls that can be added to a panel is a script control. A script control itself then hosts another panel, which means that you can create a component that is re-used many times on one or many panels. The script control is designed to be used where the standard smart buttons do not provide the required functionality. Note that script controls are the same as script panels, the difference being that a panel is hosted by the panel manager while a script is hosted within a panel.

Figure 5 Script Controls shows an example panel where there are many instances of a component depicting a switch. In this case pressing the component pops up a control to toggle the switch. In this case a normal smart button could not provide the required functionality as the outgoing switch needed a momentary closure and the incoming status was on a different GPI.

Figure 5 Script Controls
Figure 5 Script Controls
To set parameters on a script at design time the function “parentCallback( parentNotify *p )” in the script must return a list of items when the command is “return”. See Table 1 Script parentCallback function for an example where the parameter “Label” can be set at design time.

// all parent notifications come here i.e. when this script is just one
//  component of another dialog then our host might want to tell us things
bncs_string test::parentCallback( parentNotify *p )
{
    if (p->command() == "Label")
    {
        sLabel = p->value();
        //Add code to action this change
    }
    else if (p->command() == "return")
    {
        bncs_string sRet;
        sRet += "Label="+sLabel + "\n";

Table 1 Script parentCallback function

Pre-defined panels

There are certain pre-defined panels that the panel manager uses that can be altered for any system; these are detailed in Table 2 Predefined Panels. All of these panels exist in the “%CC_ROOT%\%CC_SYSTEM%\panels\panelman” directory.

Name | Usage
pm_app_1024.bncs_ui pm_app_1280.bncs_ui | Menu-bar. This can be altered, typically to add to the menu bar a script control to act as alarm indicator.
pm_blank.bncs_ui | Blank panel brought up when panel manager starts.
pm_confirm_exit.bncs_ui | Optional panel that is called when the user wants to exit. It gives a Yes/No option to confirm closing panel manager.
pm_popup_pin.bncs_ui | PIN entry panel to access the engineering menu.
pm_start.bncs_ui | Panel that is shown when the “Start” button is pressed.
pm_status_1024.bncs_ui pm_status_1280.bncs_ui | Panel seen at the top-left hand corner of the screen. Typically this will show system information that needs to be seen at all times.
pm_title_1024.bncs_ui pm_title_1024.bncs_ui | Panel seen at the top-right hand corner of the screen where the current panel title is shown. This is also where the clock is shown.
pm_wait.bncs_ui | Optional panel displayed while a panel is loading. This is normally only appropriate when there is a panel that has many controls and hence takes a while to load.

Table 2 Predefined Panels

Calling panels

Panels can be activated programmatically in two different ways, described below. In both cases the command is written to the workstation slot on infodriver 998, which allows one workstation to invoke an application on another workstation. When writing script controls or panels there are helper functions for calling other panels on the local workstation, these are also detailed below.

Panel Execute (PX)

To call a specific panel either write “PX applicationName” directly to infodriver 998 or from a script panel use the helper function navigateExecute(“applicationName”). The requested panel will then be loaded and brought to the front of the panel stack for the user to use.

Panel Adjust (PA)

Panel adjust allows the user to request that the panel to change settings on a specific device to be made active. The system then decides what the correct panel is and activates it, thus the calling panel does not need to know what type of panel is being called. The command syntax is similar to Panel Execute, either write “PA instanceName” directly to infodriver 998 or from a script panel use the helper function navigateAdjust(“instanceName”)

Applications

Runtime applications

These are the main applications that are used when a v4.6 BNCS system is running in a standard system. Note that these may well call other applications at start-up and this list does not include drivers and automatics for a specific system.

Name | Description
AlarmControl.exe | Main alarm application
AutoHost.exe | Runs script panels as automatics. This saves having to write a full automatic for a simple action
Bncs_ws_man.exe | Manages the workstation from start-up to shut down, including updates.
Panelman.exe | Hosts all of the UI panels.
CSI32.exe | Network interface for all applications on the workstation.
grd32.exe | Generic router driver.
infoDriver32.exe | Infodriver.

Tools

This section describes the tools that a developer will use to create, maintain, edit and test a BNCS v4.6 system.

Name | Description
bCommand.exe | Utility to send and receive commands on the network.
Bncs_inst_env.exe | Tool to allow changing of various workstation settings. Including system, server and workstation number.
Bncs_vis_ed.exe | Application to create and edit panels.
Config_editor.exe | Configuration tool client to allow a system maintainer to change the configuration of the alarm system.
Config_server.exe | Allows the configuration client to get the alarm system files to edit, ensuring only one person can do this at a time.
Dosnapshot.exe | Creates a snapshot, as a zip file, of all of the currently active system for backup.
Paramtester.exe | Tool to allow a tester to change values of any parameter of any instance of any device.
Sql_script.exe | Tool to create and run SQL scripts, primarily to maintain the historical database used by the alarm system.
Wiz.exe | Utility to create various new modules including script controls.

Utilities

This section describes the utilities that are used in a BNCS v4.6 system, most of which the developer will not normally use but are called by other applications.

Name | Description
Bncs_filesync.exe | Synchronises files with a server. Internal application, do not run!
CC_Sys_Check.exe | Application to update or remove files, used when upgrading a system. Called by the installer.
CC_WS_Manager_update.exe | Updates workstation manager. Internal application, do not run!
Db_loc_blast.exe | Takes the location information from the instance.xml file and writes it to a database for use with the historical log.
DesktopBmp.exe | Takes a bitmap, adds workstation information and sets it as the desktop bitmap.
Setlana.exe | Tool to set the lana number the BNCS system will use.
WritePrivateProfile.exe | Command line utility to amend ini files. For example used on a test system to set simulation flags to 1.

Alarm system

The alarm system is a programmable logic engine mainly used for alarms although; it can be used for other logic functionality such as working out if a source is live having gone through various switches.
Figure 6 Alarm overview
Figure 6 Alarm overview

The alarm system is designed to be extendable. It is has the structure shown above; a main logic block which is an executable and input and output modules which are separate DLLs. The configuration is done using the standard BNCS v4.6 configuration tools. The whole system has been designed so that with appropriate input and output modules there is no reliance on a full BNCS solution.

Inputs

Currently there is only a single input module; others could be produced that take data directly from hardware.

BNCS acquisition

This module gathers information from any driver on the BNCS network, performing any preconditioning to produce an OK or fail; this includes filtering out short term faults if required.

Processing

The processing takes the form of as many individual processes as required to perform the logic required. Each process can be an

  • OR gate
  • AND gate.
  • truth table
  • timed event, pre-programmed. Not from a varying schedule
  • hold-off

Each process gate type can also be set to be latching so that fleeting alarms can be captured.

The state of each process can be

  • On or off. These are normal states.
  • Forced on or forced off. These states are set manually.
  • Ignored. This is forced off until the alarm clears at which point it goes to off, this can be considered as ignore this instance of the alarm, but tell me next time it happens.
  • Latched. The alarm occurred but has now cleared.
  • Acknowledged. The user acknowledged the alarm, and it is still active.
  • Unknown.

Outputs

Currently there are only two output modules, but others could be produced that report alarms to SNMP managers, SMS text systems or email groups of people.

BNCS

This module outputs the results back to the BNCS network for use on any clients that need the data. The module also allows clients to interact with the alarm system by forcing and acknowledging alarms.

Database

This module writes the current state of all processes to a database table as well as logging to a historical log, both database tables are on a standard SQL database, either a Microsoft SQL Server database or MySql database.

Client controls

There is a special control, for use with the database, which provides a log display that can be configured to show various views of the data, both historical and live. As this control needs to display historical information as well as live information it will talk directly to the database server as well as using the standard messaging via CSI.

Appendix

Developer mode

Developer mode is just a flag - it can be used by any app that cares to read it. This is not therefore a definitive list.

Setting ‘developer mode’ on a workstation will:

  • Confirm update from the server before starting it, unless started in quiet mode.
  • Prevent the workstation manager re-starting the workstation if CSI crashes.
  • Some drivers use this flag to optionally close down host devices (e.g. their infodrivers) when they close

Example batch files

Post sync batch file

echo off

IF EXIST "%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\%CC_WORKSTATION%\bncs_system.ini" (
    echo "Copying ws specific bncs_system.ini"
    xcopy "%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\%CC_WORKSTATION%\bncs_system.ini" "%CC_ROOT%\%CC_SYSTEM%\CONFIG\system" /c/i/f/y
) ELSE (
    echo "Copying default bncs_system.ini"
    xcopy "%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\_default\bncs_system.ini" "%CC_ROOT%\%CC_SYSTEM%\CONFIG\system" /c/i/f/y
)

REM WRITE A BACKGROUND BITMAP
desktopbmp.exe

Figure 7 PostSync batch file

The example ‘postsync.bat’ in Figure 7 PostSync batch file copies the bncs_system.ini file for the local workstation to the correct location, then tries to run the ‘wspostsync.bat’ file if it exists and then sets the desktop bitmap. In the example shown ‘wspostsync.bat’ could be used to copy device configuration files for v2 drivers to use on selected workstations only.


bncsif32

bncsif32 IPC

Description

This is also known as DLL messaging or bncsif32 (the name of the DLL that it's wrapped in).

There are two variants of this library - both by necessity are deployed as bncsif32.dll.

The two variants are (taking the project name and the "original filename" as it appears in the version resources):

  • bncsif32 - the original mechanism that uses memory mapped files to share data between applications
  • bncsif32_32 - copies memory direct and provides "stall recovery"

The calling application sends a Windows message to the destination - the function that receives this single message then extracts the data and forwards the message to the local window.

DLL API

Send Message to remote application

There are two versions of the same call - the only difference is the iReceiveLen parameter.

c LRESULT BNCS32TxMessage( HWND hWnd, WORD msg, WPARAM wParam, LPARAM lParam, int type, int iSendLen); LRESULT BNCS32TxMessage2( HWND hWnd, WORD msg, WPARAM wParam, LPARAM lParam, int type, int iSendLen, int iReceiveLen);

Param | in/out | Notes
hWnd | in | Window handle of the target application
msg | in | Message constant of message we're sending
wParam | in | 16 bit value to send
lParam | in/out | 32 bit value to send - depending on the iDataType value this might be an LPARAM value (32 bit) or a pointer to memory.
type | in | This may be one of the following numeric values: 0 - CBDATA_SIZE_POINTER 1 - CBDATA_SIZE_NUMERIC For pointer types, lParam points to a buffer of length iSendLen

iSendLen|in|Length of data pointed to by lParam. For BNCS32TxMessage this is also the maximum size of the returned data.
iReceiveLen|in|BNCS32TxMessage2 only. The length of data to be copied back to lParam

Handle message sent by remote application

LRESULT BNCS32RxMessage( HWND hWnd, WPARAM wParam, LPARAM lParam);
Param | Notes
hWnd | handle of the receiving window
wParam | This is wParam passed in the WM_COPYDATA message
lParam | This is lParam passed in the WM_COPYDATA message

Typically this is implemented in the receiving application WndProc like this:

case BBC_COPYDATA:
      return BNCS32RxMessage( hWnd, wParam, lParam );

Library

This API is wrapped in a DLL and may be linked dynamically or via link library.

Header Files

  • bncsif32.h
  • bncs32.h

Library

  • bncsif32.lib

16 bit Applications

16 bit compatible versions of this library had other function calls. These have been removed in all current versions of this library.

BNCSIF32_32

This refers to a later release of the library with alternative data copy mechanism and stall recovery.

Stall recovery is implemented by using SendMessageTimeout in place of plain-old SendMessage. In theory SendMessageTimeout should never flag a timeout if the receiving application is alive. If it does time out the only sensible option is to assume the receiving application is dead and terminate it.

The file is bncsif32.ini in the config->system for your version of system (i.e. alongside DEV_nnn.INI files). The following options are available:

Section/Entry | Description
[bncsif32] |
TerminateProcessOnStall=1 | Flag (0 or 1) to enable termination of processes that timeout
SendMessageTimeout(ms)=10000 | How long in millseconds to wait before declaring a receiving application stalled

You'd normally expect applications to process messages well within 1 second - but some may stall the machine whilst reading/building configuration. The SendMessageTimeout(ms) value should be set to a value greater than the period a machine may be stalled for. Some drivers, depending upon how they're written however may stall for a long time - one driver (Delec comms system) was found that a machine may stall for over a minute - and so the timeout value for this particular driver would need to be set to > 60000.

Logging

BNCSIF32_32 logs when it's terminated an application to the usual BNCS logging location (c:\bncslogs for a V2/V3 system, and %CC_ROOT%\%CC_SYSTEM%\logs\bncsif32 for a V4 based system).

Using BNCSIF32_32

The whole idea of this mechanism is that it's a drop-in replacement for BNCSIF32 - so for it to run it has to have the same name as the original. So....remove the old one and rename BNCSIF32_32.DLL to be BNCSIF32.DLL


bncsIPC

BNCS Inter Process Communications (IPC)

Description

BNCS exists as many different applications (Windows executables) which are glued together in various combinations to make a control solution.

This means that these applications have to be able to share data between each other and notify each other that interesting things have happened.

BNCS originally ran on 16 bit Windows 3.1 as a collection of Windows programs. Common to each of these applications was a "main window" that could be used to direct messages at. The Windows API call SendMessage() was used to notify another application of an event and pass data. This call has 4 parameters -

  • the window to send the message to
  • a numeric message type which defines the transaction we're trying to do
  • wParam - a 16 bit value (although on 32 bit systems this value is actually 32 bits)
  • lParam - a 32 bit value

lParam is often used as a pointer to a block of memory that contained string data - or other data structure.

This call glues together all BNCS applications. The BNCS internal APIs are defined as a message number and definitions of what wParam and lParam are used for.

For example - to set the value of an Infodriver slot here's how to do it (from a 16 bit application.....more later):

SendMessage( hWndInfo, BBC_IDSETSLOT, 1, (LPARAM) "Hello!" );

where hWndInfo identifies the Infodriver window on which we're trying to set slot 1 to "Hello!".

Message from external driver to InfoDriver requesting to set the contents of a slot:

Param | Notes
Message | BBC_IDSETSLOT (WM_USER+1702)
wParam | <wParam> should hold the slot number
lParam | <lParam> should be a pointer to the string you want to store.

These were simple times - all 16 bit applications share one memory space and applications could simply send pointers to strings of bytes.

With the advent of 32 bit applications with Windows 95 it was no longer possible to simply pass a reference to some local data. A pointer to memory in one application has no meaning in a different application as the whole point is that they run in entire separate memory spaces. So, the data has to be shared, or more likely copied between applications.

32-bit Applications

Migration to 32 bit applications with BNCS was slow - right into the 21st century many 16 bit applications were being deployed. These happily ran on 32 bit operating systems in a virtual 16-bit machine.

This meant that there's quite a back-catalogue of software that still used simple SendMessage() calls. A simple means of migrating was needed so the SendMessage call was replaced with BNCS32SendMessage which had very similar signature (parameter list) and needed a very minimum of support code to operate.

Microsoft provided a mechanism using SendMessage that would copy the data from one application to another. This is what early 32 bit BNCS applications used, but wrapped up in this new BNCS32SendMessage() function to make its use nearly the same as the old 16 interface. This uses WM_COPYDATA mechanism (stick this into Google and you'll get material relating to its use). This appeared an ideal choice since BNCS applications already used a SendMessage mechanism.

Our example above turns into:

BNCS32SendMessage( hWndThisApp, hWndInfo, BBC_IDSETSLOT, 1, (LPARAM) "Hello!", 0, CBDATA_TYPE_POINTER );

The extra parameters are required with this "32 bit" call to specify the data type, and if there's any return data expected. The underlined parameters though are the same as the call above. In reality the other parameters just clarify the data being sent/returned.

BNCS's Two IPC Mechanisms

The initial IPC mechanism using WM_COPYDATA showed fault where a machine would temporarily stall and require a keypress to kick the machine back into life. A different mechanism was devised that did not use WM_COPYDATA. It's still based on SendMessage notificaition but using a different means of copying data around.

The alternate mechanism is called BBC_COPYDATA, DLL messaging or BNCSIF32.

IPC Mechanisms Compared

Feature | WM_COPYDATA | BBC_COPYDATA
SendMessage() between applications | Y | Y
Data copy mechanism | WM_COPYDATA | Memory Mapped File1 / Direct Memory Copy2
Process switches for single transaction | 4 | 2
How incorporated into applications | Discrete Source or Static Library | DLL
Maximum Message Size | 512 | 512/unlimited3

1 "classic" BNCSIF32
2 new BNCSIF32_32
3 BNCSIF32_32 from version 4.5.1 can support any message size

Whilst both mechanisms do pretty much the same thing their API is sadly not identical. For example:

The WM_COPYDATA version:

LRESULT BNCS32SendMessage( HWND hWndThisApp, HWND hWndTargetApp, UINT uMsg,
                           WPARAM wParam, LPARAM lParam, int iReturnDataLen, int iDataType );

and the BBC_COPYDATA (DLL) version:

From version 4.2.1 bncsif32 implements two versions of the function to better control send and receive data sizes (note the 2 suffix)

LRESULT BNCS32TxMessage( HWND hWndTargetApp, WORD msg, WPARAM wParam,
                         LPARAM lParam, int iDataType, int iSendLen);
LRESULT BNCS32TxMessage2(HWND hWndTargetApp, WORD msg, WPARAM wParam,
                         LPARAM lParam, int type, int iSendLen, int iReceiveLen);

Process Synchronisation

32 bit applications are independent. They have both separate memory space and independent processor time in which to do their thing (pre-emptive multi-tasking rather than the cooperative multitasking that 16 bit BNCS was based on).

Sending a message from one process to another requires a process switch. The machine must stop executing one application and start executing the other - you have to wait for Windows to do this, though in reality this is a very short time.

This works OK but has the disadvantage that you can't return to the calling application until the message has been completely dealt with.

Practically this means that on receiving a message you should not attempt to do much with it except return as quickly as possible to the calling application.

For example an incoming "revertive" should be buffered and handled later. This ensures the calling application isn't stalled whilst the application slowly processes an incoming message by say storing the value, decoding it and passing it right up to the UI.

There are other considerations too such as process synchronisation: As noted above, Windows synchronises applications when using SendMessage so that the calling application waits whilst a message is processed. There are circumstances however where this breaks down. When a SendMessage call is made to another application, if it then does a SendMessage before returning process synchronisation breaks down. This is described in an MSDN article (search Google for "about messages and message queues msdn").

Inherently the BNCS implementation of WM_COPYDATA always does exactly this - nests one SendMessage within a SendMessage. WM_COPYDATA suffers from process synchronisation problems. This can result in loss of return values from some calls and thread-like behaviour in applications that are not threaded - it's even been seen within 16 bit applications (running in the 16 bit VM) which definitely can't be threaded!

Because of the widespread use of WM_COPYDATA, and that it's individually compiled into each and every application that uses it, it's extremely difficult to do much about this problem.

WM_COPYDATA should not be used for new applications and is only included for backwards compatibility.

Inter Process Comms API

The two different API mechanisms are described here:

WM_COPYDATA / bncswm32
BBC_COPYDATA (DLL) / bncsif32

Performance Comparison

I compared four different versions of IPC and summarised the results here.

Credits

Credits for the various mechanisms here

Version Control

Version | Date | Author | Comments
0.1 |  | David Yates | Initial release
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


bncswm32

WM_COPYDATA - BNCS Inter Process Communications (IPC)

THIS MECHANISM IS DEPRECATED

This API has synchronisation and return value corruption issues under high load.

Because of the widespread use of WM_COPYDATA, and that it's individually compiled into each and every application that uses it, it's extremely difficult to fix.

Core applications are being migrated to BBC_COPYDATA and the recommendation is that other BNCS applications do.

This API will continue to be available for legacy drivers but it's long-term use is not recommended.

Description

This implements the WM_COPYDATA Microsoft mechanism to share data between applications using SendMessage.

API

Send Message to remote application

LRESULT BNCS32SendMessage( HWND hWndThisApp, HWND hWndTargetApp, UINT uMsg, WPARAM wParam, LPARAM lParam, int iReturnDataLen, int iDataType );
Param | in/out | Notes
hWndThisApp | in | Window handle of the calling application
hWndTargetApp | in | Window handle of the target application
uMsg | in | Message constant of message we're sending
wParam | in | 16 bit value to send
lParam | in/out | 32 bit value to send - depending on the iDataType value this might be an LPARAM value (32 bit) or a pointer to memory.
iReturnDataLen | in | If lParam points to memory (set by iDataType) then this is how many bytes to copy back over the lParam pointer.
iDataType | in | This may be one of the following numeric values: 0 - CBDATA_SIZE_POINTER 1 - CBDATA_SIZE_NUMERIC For pointer types, lParam points to a buffer where a fixed 513 bytes is copied, and 513 bytes are copied back as the return type but only the number specified in iReturnDataLen are copied back to the buffer. For numeric types the 32 bit value contained in lParam is still copied by the WM_COPYDATA mechanism.....this is very curious since it could just have been passed as the 32 bit value in lParam direct.

The 32 bit return value is also copied using WM_COPYDATA mechanism - this too is curious since this value could have just been passed via the normal SendMessage return value.

Handle message sent by remote application

void BNCS32ReceiveMessage(HWND hWndThisApp, HWND hWndTargetApp, PCOPYDATASTRUCT lpCDS);
Param | Notes
hWndThisApp | handle of the receiving window
hWndTargetApp | This is wParam passed in the WM_COPYDATA message
lpCDS | This is lParam passed in the WM_COPYDATA message

Typically this is implemented in the receiving application WndProc like this:

case WM_COPYDATA:
      BNCS32ReceiveMessage( hWnd, (HWND) wParam, (COPYDATASTRUCT*) lParam );
      return true;

Library

This API may be compiled into each application as discrete source, and several different instances of source/header files etc. are in use.

This API is also available as a static library: bncswm32.lib with unified headers:

Header Files

  • bncswm32.h
  • bncs32.h

Library

  • bncswm32.lib


credits

BNCS IPC - Credits

WM_COPYDATA

Simon Dowson

BNCSIF32 (also known as DLL messaging or BBC_COPYDATA)

Adam Brocklesby & Tim Alden with enhancements by David Yates

BNCSIF32_32

David Yates

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


performance

IPC Performance Comparison

Notes

This was a simple test transferring data between two applications sending 100,000 messages.

Test was on a "Intel® Core™i7 Quad Core Processor i7-4770 (3.4GHz)" machine with 16GB RAM (a pretty sprightly developer machine), using custom-written IPC testing applications written in Qt5.

Original bncsif32 and WM_COPYDATA mechanisms tested by a client sending 512 bytes of 'a', capitalising in the server app to return 512 bytes of 'A' to the client. The same test was applied to bncsif32_32 but with 1024 bytes, though buffer sizes of these general dimensions were found to have insignificant effect on performance.

Results

100000 messages | straight send message (no data) | original bncsif32 DLL | WM_COPYDATA | bncsif32_32 v4.4.1 | bncsif32_32 v4.5.1
Test 1 (ms) | 844 | 1156 | 2125 | 2156 | 2094
Test 2 | 797 | 1078 | 2156 | 2140 | 2218
Test 3 | 797 | 1203 | 2188 | 2125 | 2172
Test 4 | 1140 | 1109 | 2188 | 2140 | 2125
Test 5 | 860 | 1093 | 2047 | 2157 | 2140
average (ms) | 887 | 1127.8 | 2140 | 2143 | 2149
messages/second | 112663 | 88668 | 46711 | 46650 | 46515


pathsAndEnvironmentVariables

BNCS V4.6 Paths and Environment Variables

Introduction

This document describes the location of BNCS directories and how they are referenced.

There are 2 things to consider when specifying the path to any BNCS files:

  • The root path for BNCS
  • The current system

The root path specifies the top level directory where one or more BNCS systems can be found. e.g.

c:\bncs

The current system specifies the sub-directory for an individual system.e.g.

mySystem

So, to find the location of the files for the "mySystem" project you’d use the two combined giving the path of:

c:\bncs\mySystem

Environment Variables

The paths are stored in environment variables. These can be seen programmatically using simple function calls, and can be used in batch files, registry entries, compiler settings etc. etc.

Theses are the BNCS specific variables (prefixed with CC), and the system variables

Variable | Example | Use
CC_ROOT | c:\bncs | The path to find one or more BNCS systems The CC_SYSTEM variable must qualify this path.
CC_SYSTEM | mySystem | The current system name / subdirectory. To use this to determine file paths it must be prefixed with the CC_ROOT environment variable.
CC_WORKSTATION | 99 | Workstation number (as used in csi.ini)
CC_SERVER_ROOT | \bncs-lo\root\bncs | The means of contacting a server for updates to this BNCS system. The format of this string is determined by the update mechanism. The CC_SYSTEM variable must qualify this path.
CC_DEVELOPER | true false | Used by some apps to control behaviour on developer machines
PATH |  | the windows\bin directory and windows\lib directory are added to the Windows path variable so that BNCS executables can find their dependencies

The workstation number has to be stored in an environment variable and not in a file as all files must be stored on the server. This is the one piece of information that this machine needs to know to give it its unique identity. Also, if it is an environment variable it can be used in batch files.

Data files

Data files are those which contain persistent data. These can exist under the normal CC_ROOT\CC_SYSTEM directory structure under a “data” directory. A good example of this is infodriver “.dat” files.
This directory is explicitly excluded from the file synchronism mechanism.
The method for ensuring that important data files are archived to the server has never been defined.

Version Control

Version | Date | Author | Comments
1.0 | 28/02/2017 | David Yates | Conversion to markdown minor revisions


reservedCharacters

BNCS Reserved Characters

Description

This is a list of those characters that are reserved within a BNCS system.

Some are at system level and have serious impact – e.g. may completely disrupt the transmission or nterpretation of a message. These are flagged below with !

Character | Impact | Module/Layer | Notes
: (colon) | ! | Network / FABIAN / ApplCore | Command delimiter e.g. IW 123 ‘1’ 1:IW 123 ‘1’ 2
‘ (single quote) | ! | Network / FABIAN / ApplCore | String Delimiter See example above
“ (double quote) |  | ApplCore | This is only an ApplCore restricted character and may be used in other modules
. (period) | ! | BNCS V4.6 Clients | Delimiter e.g. colour.background=red
= | ! | BNCS V4.6 Clients | See example above
(pipe) |  | ApplCore / BNCS V4.5 Clients | New line delimiter in strings – may be used for other purposes
% | ! | Everywhere | Whilst in theory shouldn’t be a show-stopper the % symbol is very often used with applications as a target for text replacement when building strings in C/C++ applications. Finding it in the data therefore can cause all sorts of problems if that application hasn’t been designed for it (the author’s experience shows this is most places)

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


Skins, styles & states

Introduction

When designing the user interface it is useful to be able to:

  • have consistent appearance of the UI components. This helps develop a “visual language” - that means that buttons that do similar jobs have a similar appearance.
  • change the appearance of the UI components outside the application that uses them.

Developing a consistent user interface helps with reuse of components between systems.

An example

Let’s take just one element of the following application as an example:
example

Let’s consider the master alarm button which resides at the bottom right of this display.

Here’s a closer look – this button shows the current state of the master alarm. To put this control in context, the text changes to “ALARM” and the button turns red when there is an active alarm.

What can we say about this button? It’s a green button with “ALARM OK” written on it. Technically correct, but we need to consider it further – there are three things we can pick out.

State: The button is shown is coloured green for “good” with appropriate text on it. The display can change depending upon the state of a particular thing on our system – this button goes red when there is an active master alarm.
If any other alarm buttons appear in this system they will share the same set of colours.
State refers to the dynamic settings of a component.

Style: The button has a larger than normal font as this display needs to be clear. This style is unlikely to change between the various states that this button can display.
Style refers to the set-once settings of a component (usually stuff you set-up at the beginning).

Skin: The button is drawn with slightly rounded corners, shaded background colour and against a background of “rock” effect.
Skins are the static stuff that are set for a system and can’t easily change.

Same but different?

Consider this example.

State: The same as the example above.
Style: The same as the example above.
Skin: The edges of the button are different to the above example shaded up from the edge towards a flat-filled text area. The background behind this button is “traditional” Windows grey.

How the panel is designed – a team effort

When the panel designer put this master alarm control on the screen they needed to specify:

  • Size and position of the control
  • The larger than normal font size (I choose these words carefully)
  • The “alarm good” state (note – not actually specifiying green)

A system designer has to have specified:

  • what the “alarm good” state (and all the others) actually means i.e. green

The skin designer specifies

  • how the buttons and other components are drawn – the edges and fills
  • backgrounds to dialogs – whether flat filled or tiled pixmaps
  • the base font face and normal font size

The upshot of all this is that it makes no difference to the panel designer whether the final appearance of the control is the first or second example – both these are generated from the same UI description that the panel designer produced.

Stylesheets

One of the goals stated at the start of this document was to be able to change the appearance of a system externally to the applications that make it up.

It is no good therefore hard-coding fonts/sizes/colours deep into an application. Instead use a lookup to where that setting is stored.

Stylesheets are a means of translating a named value into individual control settings.
So using our example above (don’t worry if the actual settings don’t make sense, it’s the concept that’s important):

Stylesheet entry | Settings
alarm_ok | colour.background=dark green colour.text=white
alarm_active | colour.background=red colour.text=white

Use of stylesheets:

  • encourages the consistent user interface by using similar settings for similar things
  • is faster than passing individual settings
  • allows us to change the appearance of externally to the application

Some controls only allow the use of stylesheets to define appearance.
Stylesheets can actually be used to store any setting at all and so can be used to store styles, states or even complete settings for a control.

Version Control

Version | Date | Author | Comments
0.1 | 30/11/2003 | David Yates | First Version
0.2 | 19/12/2011 | Andrew Prince | New format
0.3 | 18/09/2014 | David Yates | Removes inaccurate last paragraph (about hard coding colours – this is neither true on real systems nor possible with smart buttons)
1.0 | 28/02/2017 | David Yates | Markdown conversion


targetingPanels

Targeting V4.6 Panels

Introduction

This document describes how to “target” panels hosted within panel manager application panelman.exe. Targeting a view refers to the process of telling the controls what device to look at. You may have 10 identical ARCs in a system but you don’t write a panel for each of them but rather one panel that you target to the ARC you want to adjust.

It is necessary to understand the way in which panel manager launches panels with the “Panel adjust” mechanism (e.g. PA ARC1). Please see the panel manager documentation for this.

Definition of Terms

Term | Definition
A view | Traditionally an entire ApplCore application within “traditional” BNCS. A view describes a single UI “panel” (dialog), or perhaps several UI “panels” (dialogs) that go together to enable control of a particular piece of equipment or logical function.
An instance | An “adjustable” thing. This can refer to a single piece of equipment or several associated together that will be presented to the user in a single “view”
“Target” a view | tell a view which device(s) it should be looking at

Instances

It is necessary to understand the notion of an “instance”. An instance is an “adjustable thing”. This can mean either a single piece of equipment or a collection of associated equipment that makes up a view. An instance is the collection of data required to define that “adjustable thing”.

Let’s say you have a number of identical network chains with two ARCs one for “main” and one for “reserve”. This is to be used for 2 network chains “Network A” and “Network B”. “Network A” uses “ARC1” and “ARC2”, and “Network B” uses “ARC3” and “ARC4”.

Let’s use this example and write down the information required to make this panel work.

Instance Name | Data
ARC1 | device number=101
ARC2 | device number=102
ARC3 | device number=103
ARC4 | device number=104
Chain1 | “main” Instance=ARC1 “reserve” Instance=ARC2
Chain2 | “main” Instance=ARC3 “reserve” Instance=ARC4

The table above describes 4 single instances (those that describe a single device) and 2 “composite” instances that describe 2 or more devices.

If we tell a view that it is to deal with ARC1 the controls on this view can determine for themselves that this is BNCS device number 101. It can then go and direct all the relevant controls on that view to look at ARC1.

Note: Quite often a device number must be qualified with an “offset” but this is left out of this example for clarity.

If we tell a view that it is to deal with “Network A” the view can determine that this is made up of two ARCs, one called “main” and one called “reserve” and that the ARC instances to use are “ARC1” and “ARC2” respectively. The view will then go off and find all the components in the view that are associated with “main” and target them to “ARC1”, and similarly for “reserve”/”ARC2”.

Example – simple instance

Let’s take this simple view to which is determined as the view for instance “ARC1” (see the panelman documentation for this, but this is done in the type handlers documentation).

Controls must not be a member of a group. All controls are passed the instance of “ARC1” direct from the parent. It’s then up to the controls to determine what that instance means to them.
Simple instances are normally a single UI loaded without a script from a bncs_ui description file.

Example – composite instance

Let’s take this composite view to which is determined as the view for instance “Chain1”.

The red “group” indications are actually configuration settings within each smart control rather than any external or graphical representation of group.

Controls must be a member of a group to be targeted. When the view is targeted, the group of each control is determined and this is tied up with the instance information and the relevant instance passed on to the controls. Note that no instance information is passed onto controls that aren’t in a group.
Non-smart controls are not “targeted” to anything since they have no notion of a “target” or “group”.

NOTE: Version 4.5.9 of dcw.dll allows for a “special group” on panels targeted to a composite instance. If the group is “_COMPOSITE” then the component is targeted at the top level instance not one of the named groups.

Example – composite instance with sub-script controls

This shows what happens with a simple script component placed on a normal dialog.
The script component acts just like another top level view. i.e. if you pass a simple instance to a script component it will pass it on to all its smart controls not in a group.
But what about script components that have multiple dialogues? Smart Controls are all treated equally as if all the controls existed on a single dialog.

This opens up another mind blowing topic. Considering the same example how do we target the “sub” group on the script control?

The gist is to remember that Script components are treated in exactly the same way as top level views. So if you pass it a composite instance it will target controls in groups. This means that you have to setup instances that point to instances that point to instances.

This would be an example that could be used for targeting the “sub” group:

Instance Name | Data
ARC1 | device number=101
ARC2 | device number=102
ARC3 | device number=103
ARC4 | device number=104
Chain 1 | “main” Instance=ARC1 “reserve” Instance= Sub Chain 1
Sub Chain 1 | “sub” Instance=ARC3

This means you can nest as many script controls as you like.

Complex instance

A complex instance is an instance that is presented via several other instances, for example a device may be presented via GPIs, several of these devices may be represented on a single GPI device, and a device may be spread across more than one GPI device. Provision is also given for devices that may have some parameters from GPIs, for instance a PSU may be via GPI but all other parameters via a normal control link.
To represent a complex instance the device type will the parameter slot set to zero, this indicated that the ref in instances needs to use the complex target to locate the real instance. The complex reference tells the client to look at a specific file for the instance information, this file contains details of each parameter for the selected instance, these details are the instance and parameter of the real presenting item.

Example - Complex instance

Device description

    <param name="comms" slot="49" class="enum" style="button" access="readonly">
        <state value="0" caption="OK" style="" msg=""/>
        <state value="1" caption="Fail" style="" msg=""/>
    </param>
    <param name="PSU " slot="0" class="enum" style="label" access="readonly">
        <state value="0" caption="Fail" style="alarm_alarm" msg=""/>
        <state value="1" caption="OK" style="alarm_ok" msg=""/>
    </param>

This device has 2 parameters, the comms state is from a standard driver, slot 49, it also has a PSU status from a separate device.

Instances

    <instance id="gpi_crate_1" type="CC_GPI96" ref="device=124,offset=0" location="13B4.20.9" composite="no"/>

    <instance id=" arc1" type="complex_dev" ref="device=123,offset=1000,complex=complex_dev_instances" location="" composite="no"/>

    <instance id=" arc2" type="complex_dev" ref="device=123,offset=1100,complex=complex_dev_instances" location="" composite="no"/>

The instance file shown shows 3 instances, the gpi_crate_1 is a standard instance, while the arcs are complex instances, with the detail in “complex_instances\complex_dev_instances.xml”

Complex instance file

    <instance id="arc1">
        <param id="PSU " device="gpi_crate_1" param="GPI Input 03"/>
    </instance>
    <instance id="arc2">
        <param id="PSU " device="gpi_crate_1" param="GPI Input 06"/>
    </instance>

This file shows the details for the arc instances, in this case the only parameter that is via a separate device is the GPI, the real device and parameter for this parameter are detailed here, and require further lookups from instances and the device type to get the real device and slot numbers.

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


bncs_install

BNCS Installation / Updating

Installation Tasks

The installers cover:

  1. the basic V4.6 environment on a workstation
  2. the system-update mechanism to make a workstation part of a larger system
  3. the installation/update of a full set of applications
  4. the installation/update of core UI components
  5. the installation/update of a demonstration system

1 & 2 are likely to be on site, deploying a basic workstation configuration. Once a system is up-and-running, the current live system is not "installed" as such, but updated from a system server
3, 4 & 5 are likely to install and update a developer's machine. To try stuff out or to update to a new release. The developer then updates the master system server as appropriate to deploy any changes to to the live system.

Installers

There are 5 different installers

  1. Full Installer for demonstration/developer/evaluation
  2. Binaries
  3. Core UI components
  4. Demonstration System Configuration
  5. Workstation install

To make things easy, and as a one-stop shop, the full installer does environment & demonstration system

To be able to positively identify installers of a particular build they're stamped with the branch and revision number from source control. So you'll see filenames like: bncs_fullInstall_trunk_3557.exe telling me that it's the main code line (the trunk) and revision 3557. You can then easily tell what's what.

The workstation install (for when you want to deploy a system on site) is not included in this installer package but is part of the binaries that are included in the full or binaries installer

To install a system to try...

Run the "full installer", select all the options (master system, components etc. etc). Set as workstation 1 or 2 (which is NetBIOS CSI or DDS CSI otherwise they're the same). Default resolution is 1280x1024.

Note The application path you select in this installer is the root of one or more BNCS systems. The system name you select separately is then a sub-folder off this path.

Before Updating...

Copy your existing system (or fully committed to source control if you use it). Easy way to do this is to run the doSnapshot utility.

Updating an existing system to a new release

Run the binaries installer - this will give you a complete set of the executables used to make a V4.5+ system. The path you select is for the actual system to update - so if your systems live in "c:\bncs" and your system name is "mySystem" then the path to use is "c:\bncs\mySystem".

This will ask to run the update helper app which will move stuff about, correct settings, maybe even delete stuff so that all the files/settings are in the right place for the binaries that you're about to use. This doesn't do anything it shouldn't or you can skip - you can always compare with your back-up copy (you took a copy right?)

After updating, run the bncs_buildTool to re-build all your C++ UI's against this new release.

This installer only contains executables, libraries and associated headers - your existing panels & configuration aren't touched.

Note: Do not be tempted to take bits-and-pieces of an updated system and apply it to another one - this is just asking for things to not work properly (a bit of DLL-hell).

Note: Do not be tempted to "save time" by not rebuilding your UI projects having updated the system binaries. Using bncs_buildTool makes a rebuild trivial to do.

Updating the core UI components

These are separately released so that you can update just your core_components independently of anything else. You must however then build the updated source code to match the binaries on your system. Again, it's bncs_buildTool that makes this easy.

The path to use on the installer is the full path to your system.

Note: You must not have done any local modifictions of applications contained within the core_components directory. You can reuse/modify and adapt any of these components, but you must have done it on your own local copy of the code.

We try very hard to keep source compatability between the UI release and the core code release, but occasionally you might find that something that has a particular dependency

Master / Demonstration System

This is a stand-alone system that demonstrates how a system goes together and has a full set of workstations, configuration, panels etc. to make something work.

The path to use on the installer is the full path to your system.

Note: This will overwrite configuration on your existing system - giving you the demo-system list of workstaions, applications and associated configuration. So, don't install it over the top of a system that you wanted to keep.

As it's just configuration and panel source-code you can apply the master/demo system over the top of another system if you want to try exercising the binaries of an existing system against a known configuration.

Uninstalling BNCS

Files

BNCS V4.6 mosty installs to a single tree - you can just remove that.

The BNCS utility runVisEd.exe is added to the Windows directory and can be removed

Environment Variables

The following environment variables are also added and can be manually removed:

  • CC_DEVELOPER
  • CC_ROOT
  • CC_SYSTEM
  • CC_SERVER_ROOT
  • CC_RESERVE_SERVER_ROOT
  • CC_WORKSTATION

and being very careful with this one the following are added to the PATH variable and can be removed:

  • %CC_ROOT%\%CC_SYSTEM%\windows\bin
  • %CC_ROOT%\%CC_SYSTEM%\windows\lib

Registry

The following registry paths/keys are added by the installer (though this is not a comprehensive list of everything every BNCS app might use)

  • HKEY_CLASSES_ROOT.bncs_ui
  • HKEY_CLASSES_ROOT\BNCS_UI_File


CC_WS_Manager_Update

Introduction

This application is designed to be run by the workstation manager (BNCS_WS_Man.exe) so that it can update itself. The normal update mechanism will fail on some files as they are in use, this application uses a standard Windows installer that will allow the files to be updated during the next re-boot.

Configuration

There are no configuration files required to run this application.

Execution

It is not expected that this will be run manually as the workstation manager checks for new files and runs it if it has changed, thus running it manually may have un-desired effects. The information about when workstation manager last ran the update is stored in the registry.
When run automatically the user will not be prompted for any input, when run manually the user will be prompted for the location of the files to be updated.

Version Control

Version | Date | Author | Comments
0.1 | 07/11/2006 | Mark Baldry | Initial document created.
1.0 | 27/02/2017 | David Yates | Conversion to markdown


alarm-Configuration-CollediaControlacquisition

Alarm System – BNCS Acquisition Module Config config_alm_bncs_acq

Overview

This module (config_alm_bncs_acq.dll) is part of the suite of modules that form the BNCS Alarm System. This module is used to configure the module which gathers input information for the alarm system from BNCS devices.

Description

The BNCS Acquisition module registers with and then polls the required parameters on the required BNCS devices and presents their states to the logic module, which is part of the host application. In addition some pre-processing can be achieved, including timed holdoffs, frequency detection and pulse stretching.

Configuration Procedure

To configure the module the BNCS v4.5 configuration tool should be used. The following explanation assumes that you are running the configuration editor and that this is connected to the relevant configuration server.
Select Alarms, then Inputs, then BNCS Acquisition.
The Current System will show “select a system” if you have not yet selected one, in which case then select the Change System button, then select an alarm system from the drop down list. This step is needed because there may be several alarm systems within one BNCS installed system.

If there are no BNCS Acquisition modules configured yet, create a new one. This may be achieved in two ways, either from the context (right-click) menu in the left hand pane or using the “New” icon in the tool menu at the top of the dialog.

Add Inputs

Inputs may be added manually using the New Numeric Input control, or in groups based on instances and device descriptions.

New Numeric Input

On selecting New Numeric Input a new input is created and the cursor left in the name field. Once this has been set the other parameters may be set using the parameter dialog at the bottom of the page.
When adding inputs to a system there are several required settings. These are detailed below along with an example of adding some inputs.

New Input from Instances

See below for an example of creating inputs from instances and device descriptions.

Required Settings

Name

Each input must have a unique name.
This may only be set using Rename in the context menu (or F2), and not from the parameter values dialog.

Instance or Numeric type

This is whether the input is defined in an “Instance” or a “Numeric” type. Instance is where the input location is expressed as a parameter on an instance of a device on the system, where the instance of the device appears in the “instances” table e.g. ARC2 of type “Axon_ARC20”. Numeric is for a BNCS input specified numerically e.g. slot 283 on infodriver 114 – this might be the output of an automatic or a driver that does conform to the “instance” format.
For the “Instance” type, the “Instance” and “Parameter” must be supplied, the tool leads you through this when you press the “New Input from Instances” button. For the numeric type, the driver type (I, G, or R), the device number and slot/index must be supplied. The instance type will be resolved to its driver type, number and index when the runtime module starts.

Input type

The next aspect is whether the input is “Discrete”, “Analogue” or “Alarm System Input”. Discrete means one or more of the possible states is considered to be in alarm e.g. for a “SDI-Input” parameter “present” is an OK state and “NA” is an Alarm state, i.e. it is picking states from a list (usually enumerated but can be textual). Analogue is used where the value of a parameter is a range e.g. >25 is considered an alarm. Alarm System Input is a special case where the input is an output of another alarm system. In this case there is no normalisation to the three states (OK, Fail, or Unknown) – the state from the previous alarm system is passed directly to the calculation process.

Signal On

The next aspect is “Signal On”; this can be either “Alarm” or “OK” whichever is more appropriate e.g. If “OK” is selected then the state(s) listed will be considered to be OK and if “Alarm” is selected then the state value(s) listed will be considered to be in the Alarm state. See below for a configuration example.

Optional Pre-Conditioning

There are three optional timed functions which can be used to precondition the data: Holdoff, Chatter and Pulse Stretch.

Holdoff

A holdoff delays the Ok to Alarm transition by a fixed period of time. It does not delay the Alarm to OK transition.
Note Holdoff period must be between 0.1 second and 24 hours (minimum resolution of 0.1 second). The units are seconds.
This is configured and enabled using the ‘Holdoff’ tab in the editor.

Chatter Filter

The chatter filter will note the number of positive (OK -> Alarm) transitions in a given (rolling) time period. If the number exceeds the threshold set, then the input will go into the Alarm state. When the number falls below the threshold it will return to the OK state.
The Chatter Period is the time period (rolling) in seconds over which we are monitoring the input for OK to Alarm transitions. The Chatter Threshold is the number of OK to Alarm transitions that need to occur in a Chatter Period for the state to be considered to be Alarm. For example if the Chatter Period is 60 seconds and the Chatter Threshold is 5 then an alarm condition will be notified if the input changes to alarm state more than 5 times in any one minute. It changes to OK when the number of triggers falls below the threshold.
Note. It is advisable also to set a holdoff period when using the Chatter parameters. If the example is as above with a holdoff of 5 seconds then the input will be considered to be in Alarm if the input triggers more than 5 times in a minute or if it stays in an ‘Alarm’ state for more than five seconds.
If no Holdoff is set then the alarm will trigger when the input is chattering, as set above and not if it triggers once (or less than the chatter Threshold) and stays in the fault condition. When the number of triggers falls below the threshold in any period the alarm will be OK whether the incoming value corresponds to an OK or Alarm state.
Note Chatter Threshold must be less than ten times the period in seconds. The period may be from 1 second up to 24 hours. Periods less than 60 seconds may have a resolution of 0.1 seconds. The units are seconds.

Pulse Stretcher (Hold On)

This is a standalone feature and cannot be used in conjunction with Holdoff or Chatter settings. This feature enables the alarm signal to be generated as if the length of a pulse has been stretched.
There are two modes for this feature, one where it will stay in the Alarm state until a time period after the last positive edge, the other where it will stay in the Alarm state until a time period after the last negative edge.
For example if the Pulse Stretch Period is 2.5 seconds and the Pulse Stretch Trigger is positive then the alarm will remain triggered until 2.5 seconds after the last positive transition. If it is in the Alarm state for longer than this period it will remain so until it changes to the OK state.
The Pulse Stretch Trigger set to negative can be useful if you wish to hide short periods of OK state in a long period of being in the Alarm state as shown below.

Note Pulse Stretch Period must be between 0.1 second and 24 hours (minimum resolution of 0.1 second).

Configuring Inputs Examples

The following are some examples of configuration, showing the main features.

Configuring Inputs From Instances Example

The New Input from Instances dialog allows multiple inputs to be created from sets of instances of the same device type.
To add some new inputs that are from device instances click on the “New Input from Instances” button. The following dialog is displayed.

Select the device type from the drop-down list at the top of the screen which lists all the device types in the BNCS System. In this case “arc20” has been selected.
Note that this control is populated using the devicetypes.xml config file. Only types listed in that file will be available for selection.
From the Instances tab select all the instances of devices for which you want to generate Inputs.
From the Parameters tab select a parameter to monitor. Its possible values will appear in the bottom left pane. If the parameter is not “enum” nothing will appear. The Type columns shows the parameter types.
In the bottom left pane select which state(s) you wish to generate an input entry for. Then click the “New Input from States” button. The parameter will then appear in the bottom right pane of the dialog.
In the bottom right hand pane decide whether you want to specify that the selected States are “Alarm” state(s) or the “OK” state(s). In this case we are looking at “SDI_Input” and have selected “Present” as the “OK” state. This means that all other states will be considered as “Alarm” conditions. Repeat this for all the parameters that you wish to monitor for this type of device.
Then click “Create Inputs”. The dialog disappears and the new inputs are listed in the main display.

Clicking on an individual input is shown above. The name is also shown above the tab controls in the dialog in the bottom left hand corner. All the input parameters can be edited here.

Editing Several Inputs

To edit more than one input, select a number of inputs and press the “Edit Selected” button. Use the tab control to change the features. This is useful when you want to add the same parameter to more than one input. For example, we want to add a Holdoff to all the inputs that are from the “Format-Det” parameter of a video ARC card (called an ARC20). We sort the view by parameter, select all the “Format-Det” inputs, and then press the “Edit Selected” button.
On the popup, select the Holdoff tab, tick “Change Holdoff Settings” the box, then tick the “Holdoff” box and enter the time period required, say 5 seconds (enter 50 for this as the value is in 1/10 second units). Then press “Apply” to assert the changes.

Creating Inputs by Duplication

Inputs may be copied using the Duplicate function. It also allows changes to be made to the slot number or instance as well as copying of all the other fields.
If all the items selected for copying are within the same instance then they may be copied with their instances replaced by another instance of the same device type. If this situation is detected the instance selectin combo-box is enabled and populated with all the instances with the same device type.
The slot numbers may be offset for each new copy made.

Validation

If the required elements are all present the screen will be monochrome. If there are any errors in the features then the affected inputs will be coloured yellow and “NOT VALID” will be shown in the Valid column. For example the example below shows an input where the instance name is not valid.

When the line itself is selected a message is shown in the Status Messages area. In this case it says Parameter Not Valid, which actually means it is unable to find the given instance/parameter combination. Note that in this circumstance the Device Type and Parameter controls are disabled.

Importing and Exporting data

It is possible to copy one or more rows to the clipboard by using the “Copy to Clipboard” button. The data is tab delimited so is easy to paste into other applications such as Excel.
It is also possible to paste in suitably formatted data into the tool. If the clipboard data is suitable then the “Paste from Clipboard” button will be enabled.

Documents Referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm - Colledia Control Acquisition
alarm – mainapplication
The documentation relating to file formats may also be useful.

Software Version history

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.0.0 | 19/11/2003 | Charlotte Bell | Original Release
1.0.1 | 10/12/2003 | Charlotte Bell | Remove excessive debugging + tidy diagnostics + minimise
1.1.0 | 06/01/2004 | Charlotte Bell | Add Pulse Stretcher Code
1.1.1 | 12/01/2004 | Charlotte Bell | Add negative trigger for pulse stretcher
1.1.2 | 13/01/2004 | Charlotte Bell | Add 0.1 second resolution for Holdoff and Pulse
1.1.3 | 27/01/2004 | Charlotte Bell | Add 0.1 second resolution for Chatter < 60 seconds
1.2.0 | 28/01/2004 | Charlotte Bell | Added analogue inputs
2.0.1 | 31/03/2004 | Charlotte Bell | Now a plugin dll with proper range polling for each device
2.0.4 | 01/06/2004 | Charlotte Bell | Now able to take inputs from instance data
4.5.0.3 | 04/02/2008 | Charlotte Bell | Speeded up creation of new processes. Fixed issue of not always loading processes.
?? | ?? | ?? | ??
4.5.2 | 22/06/2018 | David Yates | changes debug extension so it doesn't get loaded alongside the release version

Document Version Control

Version | Date | Author | Comments
1.00.00 | 19/11/2003 | Charlotte Bell | Original Release
1.00.1 | 10/12/2003 | Charlotte Bell | Remove excessive debugging + tidy diagnostics + minimise
1.1.0 | 06/01/2004 | Charlotte Bell | Add Pulse Stretcher Code
1.1.1 | 12/01/2004 | Charlotte Bell | Add negative trigger for pulse stretcher
1.1.2 | 27/01/2004 | Charlotte Bell | Add notes about time resolutions
1.2.0 | 28/01/2004 | Charlotte Bell | Added analogue inputs section
2.0.0 | 31/03/2004 | Charlotte Bell | Now a plugin dll updates
2.0.1 | 1/06/2004 | Richard Kerry | Instance information added 27/10/2014 Document revised to current conventions and template
2.0.1 | 08/01/2015 | Richard Kerry | Corrections and amendments. Images reworked from current versions of software.
3.0 | 27/02/2017 | David Yates | Conversion to markdown


alarm-Configuration-CollediaControloutput

Alarm System – BNCS Output Module config_alm_bncs_output

Overview

This module (config_alm_bncs_output.dll) is part of the suite of modules that form the BNCS Alarm System. This module is used to configure the module which provides a method of interfacing between the Alarms System and a BNCS system via an infodriver.

Description

The BNCS output module connects to the configured infodriver. If it succeeds then whenever there is a change to the state of a process, this change, if configured, will be passed on to the infodriver, and vice versa.

Configuration Procedure

To configure the BNCS Output module use the BNCS v4.5 configuration tool. What follows assumes that you are running the configuration editor and that this is connected to a suitable configuration server. It also assumes that you have already configured some inputs and processes in the Alarm System.
There can be one or more BNCS Output modules per Alarm system. Any BNCS Output module can have up to a maximum of 4096 slots defined to represent alarm processes.
There is some information about the format of the file documented separately, though it is preferable to edit the files using the config editor.

Configuring the Outputs

In the configuration editor, select Alarms, then Outputs, then BNCS Output.
Select the Alarm System to be edited.
It should already exist and processes should already exist as this editor needs to reference existing processes.
The Current System will show “select a system” if you have not yet selected one, in which case select the Change System button, then select an alarm system from the drop-down list. This step is needed because there may be several alarm systems within one installed BNCS system.

Actions relating to the whole module may be done either by right clicking in the bottom left hand pane (ie the context menu), via icons on the tool bar, or the BNCS Output menu item. Descriptions will not repeat this.
config1

Create a new BNCS Output Module

If there are no BNCS Output modules configured yet create a new one.
Select New BNCS Output.
This may be given a more meaningful name using the menu or pressing F2.
Change the name to a meaningful one and press return.

Copy a BNCS Output Module

Alternatively an existing module may be copied as the starting point for the new one.

Note: There is a possibility of a type of file-name clash not detected by the plug-in. If there is already a corresponding file in config/devicetypes there will be an error reported that the file is already checked out, and will be available read-only. This has only been seen to occur when a device description file has been created, then deleted, then created again.
The files where this occurs have the name in the format:
[alarm system]_Copy [n] of [module name]_[device type].xml

Configuring the Outputs

Once the config file has been loaded you will see a list of the processes.
Each one may also show a group name, device type and instance name, as well as the infodriver number, if one has been configured.
Only if the process has been configured using Manage Templates will the device type and instance name be shown.

Configure the Infodriver

The next action should be to select the Infodriver number you want the module to appear as. Each output module must have a unique number. Use the control in the top right hand corner to set the infodriver number.

Configure the Outputs

There are three main ways to do this.

Manual Number

This is useful for a small number of slots. Double click on the process and manually type in the slot number.

Note that if a process has had a number assigned using Manage Templates it is not possible to change it manually. The template-based assignment must first be removed.

Auto Number

This is useful for setting numbers for multiple processes that do not fit into an instance-like pattern.
This function can act on all the processes, selected processes or all processes in a specified group.
To affect selected processes, select the processes that you wish to configure and press the “Auto Number” button. In the pop-up dialog select the Selected check-box.
Select All to number all the processes (the process’s selection state is ignored). All the processes will be numbered in the order in which they appear in the display.
Use Select Group and select the required group from the drop-down menu to number all the processes within a specific group processes (the process’s selection state is ignored).
If the process list is sorted by Group a Group Offset may also be entered. In this case each new group found will have its base offset moved by the given amount. The Base value will also be applied, so if that is 20 and the group offset is 100 then the groups being processed will be given numbers starting with 20, 120, 220, 320 etc.

Select the base slot (and Group Offset if required and enabled) then press the OK button. The result is shown below.

Creating Alarm Instance Outputs - Templates

This option is useful if you have alarms from a number of instances of similar devices. This option will produce instance-like outputs with all the parameters having the same slot number, with a different offset for each instance of the “device type”.
Each parameter may have a number set. The repeat interval for “device type” templates
The following example will use the alarm processes from all of the “Axon PSU” devices. Press the “Manage Templates” button. At the top of the popup select the “New” button to create a new template. Enter a template name “Axon_Psu”.
We then pick one particular “instance” to use as the template. Only processes that are named using this convention can be used (i.e. prefix, underscore, suffix - global_more detailed) the aim is to isolate the common processes for each instance of the device. In this example we will choose “AXON_1_”.
Note that as this is entered into “Prefix for Template” the characters are removed from the start of the names showing in the list and any resulting duplicates are removed. Type this in carefully and see the number of processes reduce. If at any point they all disappear then you have typed incorrectly.

You should see a small number of parameters listed in the parameter column. Only the popup will now be shown, for clarity.

In the “Slot” column, the required slot numbers may be entered manually for the parameters you want to use. To do this double-click in the number area then enter the slot number, as shown below.

Alternatively the numbers may be entered automatically. The Auto Number button will assign numbers to all selected rows, starting at 1.
Clear Slots will clear the number from all selected rows.

We now need to set the base slot (say 100) and the slot offset , which should be at least the number of parameters (5 in this case). If the offset is less than the number of parameters with numbers assigned, duplicates will be generated.
Next click on the “Instances” tab to select the instances you want to configure. Here we select the first four instances.

The four buttons below - Select/Unselect All/Selected - allow this to be done more easily, especially if there are a large number of “instances” available.

Click the “OK” button to create the outputs. The result is shown below.

When this alarm configuration is written, new instances are written to the instances file, and device type files are also created or modified.
The instance names and device types are created with the alarm system name and the output module name as prefixes to the instance name and the device type name.
The examples above create instance entries as shown below. The alarm system name is “MCR” , the module name is “Alarm_Output”and the device type is “Axon_Psu”.

    <instance id="MCR_Alarm_Output" type="MCR_Alarm_Output" composite="no" ref="device=90,offset=0"/>
    <instance id="MCR_Alarm_Output_AXON_10_" type="MCR_Alarm_Output_Axon_Psu" composite="no" ref="device=90,offset=0"/>
    <instance id="MCR_Alarm_Output_AXON_11_" type="MCR_Alarm_Output_Axon_Psu" composite="no" ref="device=90,offset=5"/>
    <instance id="MCR_Alarm_Output_AXON_12_" type="MCR_Alarm_Output_Axon_Psu" composite="no" ref="device=90,offset=10"/>
    <instance id="MCR_Alarm_Output_AXON_13_" type="MCR_Alarm_Output_Axon_Psu" composite="no" ref="device=90,offset=15"/>    <instance id="MCR_Alarm_Output_AXON_13_"

The MCR_Alarm_Output instance represents processes with a BNCS output that are not set using any template, ie manually or using auto number.
"MCR_Alarm_Output_AXON_10_" to "MCR_Alarm_Output_AXON_13_" correspond to the Axon_Psu template shown in the example above.
New device description files will be created for any new instances and will be listed in the "devicetypes.xml" file in the normal way.

Templates generated in this way will be stored in the alarm config file so may be recalled and reused, or edited, at a later time.
When a process has its slot number set using this template system it is “locked” and may not have the number changed manually. It is necessary to “unlock” it from the Manage Templates dialog before it may have a number set manually.

Importing and Exporting using the clipboard or a file

It is possible to copy the processes to the clipboard and then paste them into a text editor or tool, such as Excel. As processes with numbers managed using templates may not be selected they may not be copied to the clipboard.
It is also possible to paste from the clipboard into the configuration tool. In practice this is only useful for outputs which are not instance types as the instance name and device-type are not copied.

Slot Duplication

Whichever method is used to allocate processes to slots there is the possibility of creating slot clashes i.e. more than one process being allocated to the same slot. These need to be avoided for the system to work properly; only single process can be allocated to a slot. The configuration editor will mark any duplicated slots with visual warnings as shown below. Any processes with duplicate slots will be highlighted as yellow if not selected and dark red if selected.

Here we can overcome the duplicate slots problem either by changing the slot numbers of the processes whose numbers have been assigned manually, or use the “manage templates” tool to change the base slot for those assigned by templates.

Documents referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm – Colledia Control output
alarm – config server/editor
The documentation relating to file formats may also be useful.

Software Version History

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.00.00 | 13/11/2003 |  | Original Release
1.00.00 | 13/01/2004 |  | Demo system
2.00.00 | 31/03/2004 |  | System now one application with plugin dlls

Version Control

Version | Date | Author | Comments
1.0 | 15/11/2005 |  | Original Release
2.0 | 05/12/2005 |  | Full explanation of configuring outputs
2.1 | 19/01/2015 | Richard Kerry | Corrections and amendments. Images reworked from current versions of software.
3.0 | 27/02/2017 | David Yates | Conversion to markdown


alarm-Configuration-databaseOutput

Alarm System – Database Outputs Configuration

Overview

This module (config_alm_db_output.dll) is part of the suite of modules that form the BNCS Alarm System. Its purpose is to edit the configuration of the Database Output module.
The Database Output module can write the current state of the alarm system to a database, and also add to a log of historical data.
The module can also supply historical log change information to a BNCS network, and allows BNCS panels to add information to the historical log.

Description

There are two database tables used be the alarm system. One (process_data) holds the current state of the processes and the other (historical_log) holds changes.
Whenever there is a change to a process the process_data table is updated accordingly.
If there is anything to log the historical_log has a new entry added to it.
Records in both tables are time stamped with the date-time, including a millisecond time. This later is not frame accurate, but there to allow the user to see the order in which messages arrived.
Only processes that are configured to do so will appear in the database tables.
See the document for more information about the available functionality of the module.

Configuration Procedure

To configure the module the BNCS v4.5 configuration tool should be used. The following explanation assumes that you are running the configuration editor and that this is connected to the relevant configuration server. It also assumes that you have already configured some inputs and some processes in the Alarm System.
It also assumes that you have a connection to the database server. We will create the tables below so an empty, unconfigured, database is fine as this will be done in due course. Alternatively an existing database might be used, in which case the configuration steps would apply but without the initialization actions.
There may be zero or more Database Output modules per alarm system. In practice most systems need only one database so only have one database output module.
There is some further information about MySQL and the required settings for the server in Appendix B.
There is some information about the format of the config file in Appendix C, though it is preferable to edit the files using the config editor.

Configuring the Outputs

In the configuration editor, select Alarms, Outputs, Database.
Select the Alarm System to be edited. It should already exist and processes should already exist as this editor needs to reference existing processes.
Actions relating to the whole module may be done either by right clicking in the bottom left hand pane (ie the context menu), via icons on the tool bar, or the Database Output menu item. Descriptions will not repeat this.

Creating a New Database Output Module

Select New Db I/F, or the icon on the toolbar.
This may be given a more meaningful name using the menu or pressing F2.
Change the name to a meaningful one and press return.

There are four tabs: System, Processes, Database Tools and Database Edit. We will look at them in the order needed if starting from scratch i.e. empty database and no Database output.

System

Items in this tab must be configured to enable the module to connect to the Database.
The items needed to configure a server are:

Driver

If the database is MySQL then chose the “QMYSQL3” driver in the drop down list otherwise choose “QODBC3”.

Host

This is the host PC. Enter either the IP address or the DNS name.

Database

This is the database name. A database of this name must already exist on the database server and be accessible from this PC; this module is not able to create it.
If it doesn’t already exist then the Database Tools and Edit tabs will not be able to display data.

User Name & Password

These are the username and password that you wish the alarm system to use. An account using these values should already exist on your database server. If they don’t already exist then the Database Tools and Edit tabs will not be able to display data.

BNCS Driver

This is the driver number used for updates to the BNCS System. No external infodriver is required. The module connects directly to CSI as a driver.
The Database Output module will report Fail status if it is not able to connect to CSI using this driver number, or if it is zero.

Main and Reserve

If a Reserve database is configured all data will be written to both Main and Reserve databases.
It is not necessary to have a Reserve database. If it is not required the Reserve database connection fields should all be left blank.

Database Tools

Creating the tables

If the tables “historical_log” and “process_data” don’t exist then they will need to be created. Select the Database Tools tab.
If the settings on the System tab are not correct the Status will show “No Connection”. In this case the user settings for the database server need to be corrected or the settings changed on the server.

If the settings on the System tab are correct then after a few seconds it will read “Connected”.
If the settings on the System tab are correct but the tables have not been created “Invalid” will be shown under each table heading – Historical Log and Process Data.
In that case the screen will look like this.

In order to create the tables press the “Create New” button for each table. This will create the tables with the correct variables and settings.
If this is successful then the indications will read “0” to indicate that the number of rows is zero.
There also tools to clear the tables of all entries and to delete old log messages before a certain date.
If the database connection is not available it is still possible to configure the outputs. It just means that nothing will actually be written to the database until the user connections and tables are defined correctly and the database is accessible.
See Appendix A for the details of the tables and the commands used to create them. In normal circumstances it will not be necessary to create them manually – this information is provided in case it is necessary to diagnose any problems.

Processes

Selecting the Processes tab will show a page with all of the processes listed at the left of the main pane and configuration details on the right of the main pane. A process that has yet to be configured is shown below.

The configuration for each process allows us to set all the information that will be written to the database when the process enters any of the available states.
The elements available are as follows.

Level

There are 5 possible levels. This will determine the display parameters (ie colours) in the Log Control.
1 Information
2 Minor Warning
3 Major Warning
4 Minor Alarm
5 Major Alarm

Text to Log

This is the text that will be logged in the historical log table when the process changes to any of the states listed. One or more of the states may cause text to be logged. The most commonly logged states are OK and Fail. Pressing the “Default” button will set the text to its default, which is usually to append the state to the process name (this may be configured in the Defaults tab). Pressing the “set all to Default” will set all the states to their default text.
To configure any one process, click on it and fill in the text on the right hand side. The following shows a process set to “Minor Warning” with default text for “OK” and “Fail” states. To edit more than one process Set Selected Procs may be used – see below.
If the Level is set to zero the Text to Log controls will be disabled.

Optional elements are as follows.

Device

This can be used to display the (instance) device name on the Log Control. The log control can be filtered on any of the columns and it is useful to narrow the display down to a single device.
It is also possible for the panel to be written to use this information to navigate to a panel to adjust this device.

Group

This can also optionally be displayed in the Log Control. The default is the Process group but can be changed.

Editing Multiple Processes

To edit several processes, highlight the processes and press the “Set Selected Procs” button.
** A popup appears with the Device, Group and Level details of the current process (the last one you selected). ** (no it doesn’t. Probably used to, until changed to allow selection of no processes)

If you check any of the set/clear boxes, you can change the property for all of the selected processes. This is useful when there are many processes in the same group that require the same settings. Select OK to make the changes.
Selecting “Use device Alt_id” will replace the text that matches the device instance name with “%alt_id%”. At run time this will be replaced by the “alt_id” from instances.xml for that device.

Copy/Paste via the Clipboard

It is also possible to export and import data using the “Copy to Clipboard” and “Paste Selection” buttons. The data copied is tab delimited, so is suitable for use in spreadsheet applications.

Database Edit

Provided there is a connection to the database this tool allows for basic database editing.
For SQL queries use the “SQL_script.exe” tool which is documented elsewhere.

Defaults

Use of the Default buttons in the “Text to Log” section is particularly useful if the default alarm state strings and Level may be configured. This may be done in the “Defaults” tab page.

The following default parameters may be set:

Format

The format of the log messages may be set based on either the alt_id string, or the device name. %alt_id% is followed by the parameter name and a string representing the state. The devicename (processname) is followed by the state string.
In either case the separator characters are also selectable here: space, underscore or dash/hyphen.

Text Defaults

The default alarm level and the default state strings may be set here.
The Reset button sets all these value to the standard “defaults of defaults” values.
All of these default parameters are saved between sessions on the client machine, so it is not necessary to set them at each restart.

General Notes and Tips

It is usually the case that when a process goes into alarm state there is more than one process affected, for example if the processes is also the input to an OR gate. It is possible (indeed likely) that the user only wants to see one event logged and not two (or more) for the same event. The way to achieve this is to avoid logging “Overall” or summary alarms.
Note that if an alarm is Forced On or Forced Off that the text logged will be identical to the Fail or OK text.

Process Filtering

On the Processes tab there are facilities to filter the set of processes displayed, by name or level.

Filter

A regular expression string may be entered here; the list will show only the processes which contain a string matching the regular expression.

Level Filter

Only those processes will be shown which log at the given level. If “not filtered” is chosen (the default), then no filtering is applied.

Process list-view

This list view shows all of the database output properties of the processes. Although the whole content is hard to see due to the number of columns and the length of the text usually in them; it presents an overview, to more easily see gaps, or corrupted data.
The size of the whole dialog, the list view, and the column widths are saved on the client machine between sessions.

Clear all

The Clear All button deletes all properties for the currently selected process.

Edit Template

The Template system allows a number of processes to be edited in one step.

Configuration

Press the “Edit Template” button to open the Manage Templates dialog window. This looks similar to the main panel, but if something is present in the Prefix for Template edit field, it lists only those processes starting with the given prefix, with that prefix removed. The first column name is not Process, but Parameter; the prefix having been removed from the process name. The other columns show the current settings of each process.
If on the main panel several processes are selected when Edit Template is pressed, the prefix on the opening dialog is filled automatically with any common prefix of the selected processes. Processes not matching it will not be shown.

Here the user may edit the data at the same way as the main panel, i.e. select one process, and edit the fields on the right hand side by hand or through pressing the Default, Set all to Default, or Clear All buttons. Or use the Set all to Default for each parameter button, which fills the data of every parameter with default values; or use the Clear all for each parameter button.
If, in the Defaults tab (see above), the mode is used, rather than %alt_id%, then the state strings will be set to start with the given prefix. This will be replaced with the current device name later in the process.
Editing causes the edit field Prefix for Template to be disabled to prevent losing data, because changing the prefix would trigger reloading.

Devices

On the Devices tab page the devices which fit the set of the parameters are listed. The user should select those devices to be affected. The unselected ones remain unchanged.
The Select/Deselect Selected/All buttons at the bottom allow the selection state of groups of these to be changed more easily.
To update the selected processes, press the Create Outputs button.

Notes and Tips

Some uses of this feature in practice:

New Device Type

First scenario: You have processes of a new device type.
Step 0: Set the default texts at the default tab page. Usually they are the same during a project, so it has to be done only once at your client machine.
Step 1: Select the processes belonging to one instance of the new device type on the Process tab page, and click on Edit Template.
Step 2: On the Manage Template dialog window, click on Set all to Default for each parameters button, which fills everything with default values.
Step 3: Tune the settings, e.g. change the log level for some parameters, clear the row for overalls, etc.
Step 4: Navigate to the Devices tab, and select the new devices.
Step 5: Click on Create Outputs.

Change Existing Device Type

Second scenario: You have new processes of an existing device type, and for its instances there are already database outputs set. (This is a more common case than the previous one.)
Step 0: Set the defaults if you haven’t yet done so.
Step 1: Select the processes belonging to one old instance of the device type on the Process tab page, and click on Edit Template.
Step 2: Navigate to the Devices tab, and select the new devices.
Step 3: Click on Create Outputs.

Replacement Text

There are a number of special text elements which, if present in any of the Text to Log strings, will be replaced by the corresponding attribute values from the device instance.
All the markers start and end with ’%’.
The references should be fairly obvious, and are listed below.

Marker | Attribute | Notes
%alt_id% | alt_id |
%location% | location |
%composite% | composite | “yes” or “no”
%type% | type |
%ref% | ref This is the entire ref attribute
%device% | device section of ref attribute | Integer
%offset% | device section of ref attribute | Integer
%complex% | device section of ref attribute |

Documents Referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm – Database Output
alarm – mainapplication
The documentation relating to file formats may also be useful.

Appendix A – Creating the Database tables

This section shows the SQL commands required to create the tables used by this module.
These operations are detailed here only for reference; they should NOT normally be used.
In normal circumstances the controls within the config editor should be used for creating the tables.
In normal circumstances it will not be necessary to create them manually – this information is provided in case it is necessary to repair any problems.
The syntax of SQL commands sometimes varies between different implementations. We allow the MySQL and SQL Server/ODBC variants; the two sets of commands are shown here.

Historical Log (historical_log)

This table is always present.

For MySql

CREATE TABLE historical_log (
  index_number int(8) unsigned NOT NULL auto_increment,
  date_time datetime NOT NULL default '1000-01-01 00:00:00',
  mSec int(3) NOT NULL default '0',
  device_name varchar(100) default '0',
  text varchar(100) default '',
  level int(1) default '0',
  state int(1) default '0',
  usergroup varchar(100) default '',
  process_id varchar(100) default '',
  PRIMARY KEY  (index_number)
);

For SQL Server

CREATE TABLE historical_log (
  index_number INT NOT NULL  IDENTITY(1,1),
  date_time datetime NOT NULL default '0000-00-00 00:00:00',
  mSec int NOT NULL default '0',
  device_name varchar(100) default '0',
  text varchar(100) default '',
  level int default '0',
  state int default '0',
  usergroup varchar(100) default '',
  process_id varchar(100) default '',
  PRIMARY KEY  (index_number)
);

Process Data (process_data)

This table is always present.

For MySql

CREATE TABLE process_data (
  process_id varchar(100) NOT NULL default '',
  date_time datetime NOT NULL default '1000-01-01 00:00:00',
  mSec int NOT NULL default '0',
  current_state int default '0',
  current_text varchar(100) default '',
  device_name varchar(100) default '',
  current_level int default '0',
  usergroup varchar(100) default '',
  PRIMARY KEY  (process_id)
);

For SQL Server

CREATE TABLE process_data (
  process_id varchar(100) NOT NULL default '',
  date_time datetime NOT NULL default '0000-00-00 00:00:00',
  mSec int NOT NULL default '0',
  current_state int default '0',
  current_text varchar(100) default '',
  device_name varchar(100) default '',
  current_level int default '0',
  usergroup varchar(100) default '',
  PRIMARY KEY  (process_id)
);

Device Details

This table is not required, but is listed here as an example of further data that could be held.

CREATE TABLE device_details (
  device_name varchar(100) NOT NULL default '',
  building varchar(100) default '',
  room varchar(100) default '',
  bay varchar(100) default '',
  rack varchar(100) default '',
  slot varchar(100) default '',
  manufacturer varchar(100) default '',
  model varchar(100) default '',
  serial_no varchar(100) default '',
  usage varchar(100) default '',
  user_info varchar(100) default '',
  contact varchar(100) default '',
  web_link varchar(100) default '',
  PRIMARY KEY  (device_name)
);

Contact Details

This table is not required, but is listed here as an example of further data that could be held.

CREATE TABLE contact_details (
  contact varchar(100) NOT NULL default '',
  name varchar(100) default '',
  address1 varchar(100) default '',
  address2 varchar(100) default '',
  address3 varchar(100) default '',
  tel1 varchar(100) default '',
  tel2 varchar(100) default '',
  email varchar(100) default '',
  misc varchar(100) default '',
  PRIMARY KEY  (contact)
);

Appendix B – MySQL

Installing MySql

The MySQL Server installer provides a command-line tool which may be used for most of the necessary configuration.
MySQL Workbench is a separate install and provides a GUI-based means of creating servers and users and executing SQL commands.
Follow the instructions to install the Server and any other applications required.
It will be necessary to create and configure a server and a user. Note that the settings for a user specify which client addresses may connect using that user-name, and privileges may be granted on a per-host basis. It is necessary that these are set to permit the computer running the configuration editor to connect and perform the relevant operations.
New historical log and process tables may be created using the BNCS configuration tool.
The database itself may not be created from the BNCS Config Editor but must be done directly using one of the MySQL tools.

Permissions

In order to create the database and the tables the MySQL server needs the required user to have Create permission from the client (ie the one running the config editor).
In order to write to the database the server needs the required user to have Insert and Alter permissions from the client (ie the one running the alarm system).

Passwords – Old and New Formats

The MySQL database driver which is now in use expects the server to support the current format of passwords (also known as “new” or “long”). Earlier versions of the library support the old format (“old”, “short”, “16 character” or “pre 4.1”). See the version history to ascertain which version applies. See the MySQL documentation if it is necessary to set a recent server to accept the old format.
This is controlled by the DLL windows/lib/libmySQL.dll.
If it is version 5.6.20 then the new format is in use.
It is not clear what the version should be for the old version.

Software Version History

Version | Date | Author | Comments
1.00.00 | 15/11/2005 | Charlotte Bell | Original Release
1.00.00 | 13/01/2004 | Charlotte Bell | Demo system
2.00.00 | 31/03/2004 | Charlotte Bell | System now one application with plugin dlls
4.5.1.0 | 01/11/2007 | Charlotte Bell | Added the alt_id
4.5.2.0 | 28/05/2009 | Robert Bagyinszki | Added filtering/defaults/edit template.
Version | Date | Writer
4.6.5.rc1.1 | 25/05/2018 | Richard Kerry. Except BST-62 by David Yates.

This release contains a number of improvements that have been done over a period of time. There is a further list of improvements that are planned to be done but due to the time these are expected to take a release is being done with items already completed.

  • BST-256 Location of AlarmControl's stored state file.
    AlarmControl maintains a list of all current states to improve the efficiency of starting-up.
    Formerly this was at c:\Users\<user>\AppData\Local\Temp\colledia_alarms\%CC_SYSTEM%\<alarm_system_name>\AlarmControl.dat, which is not clearly part of the BNCS system and this location was not widely known.
    It is now at %CC_ROOT%\%CC_SYSTEM%\data\<alarm_system_name>\AlarmControl.dat.
  • BST-58 (2753) Some improvements in logging. Relating mainly to the BNCS acquisition module and the Database output module.
  • BST-34 (2510) Location of database output buffer files.
    These were previously stored as %CC_ROOT%\%CC_SYSTEM%\data\logioNode<various numbers and extensions>.
    They are now in %CC_ROOT%\%CC_SYSTEM%\data\<alarm system name>\<module number>logioNode<various numbers and extensions>.
    Where <alarm system name> is the name of the alarm system, as seen in the /AlarmSystem parameter, and <module number> is the number from the corresponding al_out_nnnn.cfg configuration file.
  • BST-46 (2702) Timed overrides of alarm states, as entered via the BNCS output interface, are now preserved in the AlarmControl stored state file so will be persisted over restarts.
  • BST-235 The values used for initialization of date-times in a mySql database have been changed to comply with stricter validation that has become the default in approximately mySql version 5.7. Specifically 0000-00-00 is no longer permitted as a null value for dates, so this has been changed to 1000-01-01. Thanks to Andy Woodhouse for spotting this issue and for researching the cause.
    This only affects mySql servers; the values used for ODBC (SQL Server) have not been changed but may be in the future.
  • BST-62 (2772) An issue has been fixed whereby an exception would cause a thread in part of the system to stop running, but the remainder of the system would continue to run. The effect of this would be likely to be similar to what is described here, ie the system would not stop completely (crash or hang) but appear to continue to run, but with some functionality broken.
  • There is now an extra control to allow the port number to be set for a mySql server. This is present in the alarm output configuration and in all controls that are able to access the alarm logging database.
  • Configuring the reserve database Driver to ODBC would disable the main database's host entry control (ODBC doesn't need a host).
    This has been fixed, so now configuring the reserve database Driver to ODBC will disable the reserve database's host and port number controls, and configuring the main database Driver to ODBC will disable the main database's host and port number controls. This applies to the alarm output module and to all controls that reference the alarm logging database.

Document Version History

Version | Date | Author | Comments
1.00.00 | 15/11/2005 | Charlotte Bell | Original Release –separate from the Database Outputs doc
2.00.00 | 06/12/2005 |
2.01.00 | 01/11/2007 | Charlotte Bell | Added alt_id
2.02.00 | 28/05/2009 | Robert Bagyinszki | Added: New features of version 4.5.2
2.03.00 | 10/02/2015 | Richard Kerry | Corrections and amendments. Images reworked from current versions of software.
3.0 | 27/02/2017 | David Yates | Conversion to markdown


alarm-Configuration-proceses

Alarm System – Process Configuration

Overview

The logic module takes the input processes, performs the operations defined in the processing configuration and passes the results to the output modules. This document describes how to configure the processes in a typical system – as seen in the logic block in the diagram below.
The following is a block diagram of the Alarm System - the logic block is built in to the main application but needs to be configured in order to do anything useful.

Description

The logic module takes the input processes, performs the operations defined in the processing configuration and passes the results to the output modules. These operations can be logical operations (OR, AND, NOT or TRUTH). In addition there are time of day functions and holdoffs.
Any process may be masked by another.

Configuration Procedure

To configure the processes the BNCS v4.5 configuration tool should be used. The following explanation assumes that you are running the configuration editor and that this is connected to the relevant configuration server. It also assumes that you have already configured some inputs in the Alarm System.
The Current System will show “select a system” if you have not yet selected one, in which case then select the Change System button, then select an alarm system from the drop down list. This step is needed because there may be several alarm systems within one BNCS installed system.

There is only one process configuration file (proc_def.cfg) per Alarm System.

Configuring the Processes

Input Processes

The first step is to define some input processes. For most systems these will correspond to all of the inputs created using the acquisition module configuration tools. The example below shows how to create input processes from the BNCS inputs already created. Using the BNCS Acquisition tool it is possible to edit the name, add a prefix to the name and associate different processes with different group names. It is advisable to group the processes according to their use as the processes can be sorted by this group.
Using the BNCS Acquisition Module Configuration tool select all the processes that are to be in one group, as shown. Press the “Create Input Process” button. A popup dialog appears.
All inputs may have processes created, or just those selected.
There are options to add a prefix to the input name and to associate these processes with a group name. We will not add any prefix, because the input names are already sensible. We will associate the group “SIM10” with our inputs. Press OK to create the processes.
It is also possible to automatically add the new processes to “overall” OR processes, based on each process’s instance name or device type. If these options are selected the new processes will be created if not already present.

We now have some input processes. From the BNCS Acquisition configuration tool it is also possible to delete processes and also to directly navigate to the Alarms Process Configuration editor. For the rest of the configuration we will be using the Alarms Processes Configuration editor.
Select Alarms, then Processes.

General Notes

The screenshot below shows a configuration with all the processes listed in the bottom left hand pane. Highlighting any one process will show its details in the right hand pane. For example, the process highlighted is “AXON_10_PSU_Top”, it is in group “Axon_PSU” and it is an ”INPUT” process. The right hand pane also tells us which input module it comes from and which input it is. On the right hand side we can also see that this process contributes to another process called “Axon_PSU _Overall”. From this screen it is also possible to navigate to the input configuration screen to look at the input and to navigate to the output configuration screens.

Logic Functions

OR Process - Grouping alarms

Simple aggregates of a group of alarms, such as all those from one device, may be grouped using an OR process. The output will be the same as the highest of the following levels of the inputs: -

  • On/Force On (appears as Alarm)
  • Latched
  • Acknowledged
  • Off/Ignored/ Force off (appears as OK)

If you have some alarms that all need to contribute to the same OR process you will need to create a new process. You may either create a new process or duplicate an existing one. Either way, rename it and set its rule to “OR”. The drop down list under the action label lists all of the types of process available.

In order to add the inputs to the process (or change them) press the “Change Inputs” button. Select the inputs required into or out of the right hand pane of the popup using the arrows. Select “OK” to assert the new settings.
An OR process has an option to re-trigger after it has been acknowledged if one of its inputs subsequently goes into the Alarm state. To configure this check the “Re-trigger on new error” box.

An additional option is for an OR process to treat latched or acknowledged inputs as if they are off. This can be useful when you need a sounder to latch and the inputs to latch, acknowledging the sounder will then go to OK rather than stay at latched because an input is latched. This setting is sometimes referred to as “ignore intermediate states”.

Note: it is important to bear in mind which processes will be presented to the panels and if you intend them to be overridden (i.e. acknowledged, forced off etc.). This is because an override affects a single process only and will not directly affect any other process. It may indirectly affect dependant processes but never contributing processes. For example, if a process were to feed an OR process and it had been acknowledged and all other inputs to the OR process were in the OK state then the output of the OR process would be in the acknowledge state.
Conversely, if a process feeding an OR process is in alarm state and the resulting alarm on the output of the OR process is acknowledged, then the original process will not be acknowledged as a result. This means where a summary alarm on a screen is acknowledged, any contributing alarms (which may show on another panel) will remain in their Alarm state.

AND Process

The output of an AND process will be the same as the lowest of the following levels of its inputs: -

  • On/Force On (appears as Alarm)
  • Latched
  • Acknowledged
  • Ignored
  • Off/ Force off (appears as OK)

The inputs are configured in the same way as for the OR process.

NOT Process

The result of this type of process is the inverse of its input. The input is selected from a drop down list.

TRUTH Table Process

This process works as a logic truth table. The inputs are selected in the same way as for the OR and AND processes. The “inputs” are the truth table “rows”. It also has a number of truth table “Columns” which indicate the required states of the inputs to make a TRUE (i.e. FAIL= Alarm) output. For example the TRUTH table in the image below has three inputs.
To add a column press the “Add Column” button.
Each entry must be one of either:

0 this input must be OK
1 this input must be Alarm
? not interested in this input for this column.

Add more columns as necessary.
The output of the truth table will be TRUE (i.e. Alarm) if any of the columns are TRUE (it’s an OR of the columns). In the example below the output will be true if either “Axon_1_PSU_Bottom” AND “Axon_1_comms” are both in Alarm OR “Axon_1_PSU_Top” is in Alarm AND “Axon_1_comms” is OK.

Holdoff

The output state becomes Alarm once the input has been in Alarm state for the designated number of seconds. Fractions of a second are allowed, to two decimal point resolution (ie hundredths of a second).
This may be used when you don’t want to see a failure that lasted less than the given time period.
If possible it is suggested that the holdoff is done in the Acquisition module to avoid unnecessary processing.

Time

This has parameters for a set of days and start and end times.
If the day matches and the time is between the given start and end time the output will be TRUE (Alarm). For example the process below will be in the Alarm state every Tuesday, Thursday and Saturday between 0800 and 1200.

Properties Available for all Processes

Actions relating to processes may be done either by right clicking in the processes pane (ie using its context menu), via icons on the tool bar, or the Process menu item. Descriptions will not repeat this.

Group

This is a way of grouping alarms for ease of configuration. It has no effect on the logic or on the outputs.
New groups may be added using the Groups entry in the menu. From this groups may also be delete or renamed. A group must exist before a process may be assigned to it.
The group associated with a highlighted selection of processes may be set or changed by using “Set Group”.

Mask

It is possible to mask one process with another. Mask means that the process will not fail unless the masking process has failed too (similar to an AND process). This is often used when one process has to mask several others.
For example a timed function may be used to mask a process so that the alarm will only trigger at certain times of every day.

Latch

Latch means that a process will go from Ok to Alarm instantly but will not go from Alarm to OK unless it has been acknowledged. See the Alarm State diagram below.
The setting may be changed using “Latch / Ack”.
There are three possible options for the Alarm to OK transition.
If there is no latch then if the operator is able to acknowledge an alarm the steps will be Alarm -> Ack ->OK, the left hand path.
If the operator is not able/allowed to acknowledge the steps will be Alarm -> OK, the straight through path.

Acknowledge Once Only

If the process is set to “latch” but not to “Ack once only” then the steps will be Alarm -> Acknowledge ->Latched -> OK, or Alarm -> Latched -> OK if the fault has cleared before the operator is able to acknowledge. It may be desirable for the operator only to have to acknowledge the process once. If this is the case then set the “Ack Once Only” box.

Duplicating Processes

Simple Duplication

One or more processes may be duplicated by selecting “Duplicate Proc”. This will duplicate each process selected. The new processes will be named “copy_n_of_processname”, where “n” is a number and “processname” is the source process’s name.
Any logic process (AND, OR etc.) copied will keep its original inputs.

Template Duplication

Duplication using a template may be used to duplicate a selection of processes with an option to maintain the relationships between them. This may be useful when there are groups of alarms that are repeated, for example for similar pieces of equipment or transmission chains.
Note that if you want to duplicate an OR process you must also select all its inputs before duplicating in order to maintain the relationships. When input processes are duplicated if there isn’t a valid input with the new name the tool will create new processes and take the actual input from the original process.
What follows is an example of a duplication of all alarms from a device, where one alarm is an aggregate (OR process) of all of the others.
First select all the alarms that are to be used as a template, in this case it is all the alarms from AXON_3. There are already input alarms from AXON_4, but no OR process.

Then select “Copy Proc Using Template”.
The tick boxes “Replace any existing processes” should be ticked, as should “Maintain relationships”. Make sure the number of copies is 1. Replace the prefix “MDU_17B10-A_” with “MDU_17B10-B_”. Press OK.

You should find a process “AXON_4_Overall” has been created and has the correct inputs and settings (Ack once only etc.). All the selected process have the AXON_3_ prefix removed and replaced with AXON_4_.
If making more than one copy it is necessary to select an option for how the new ones will be numbered. In that case both the new prefix and new suffix should be supplied.

The new processes’ names are generated by concatenating the New Prefix value, the generated number and New Suffix value. In this example the two new processes will be numbered 31 and 32, as shown selected in the following image.

If the range to be generated would result in numbers of differing lengths they may be padded with leading zeroes to prevent sort order issues. The value supplied is the length the number strings will be extended to.
It is also possible to do multiple copies adding letters rather than numbers, for which use “Add Letter” and select the first.

Naming Convention

Careful selection of naming convention for processes makes sorting and duplicating inputs processes and outputs more straightforward. This is especially true for a large system with lots of similar devices or alarms.
It is recommended always to go from more general to more specific.
For example:

*area*_* chain/group of devices*_*device*_*parameter*_*Alarm-parameter*

It is often not necessary for all of these to be in the name, but the general principal should be followed.

Documents Referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
Configuration Server/Editor
alarm – mainapplication
File Format – Process Module
The documentation relating to file formats may also be useful.

Software Version History

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.00.00 | 15/11/2005 | Charlotte Bell | Original Release
1.00.00 | 13/01/2004 | Charlotte Bell | Demo system
2.00.00 | 31/03/2004 | Charlotte Bell | System now one application with plugin dlls
4.5.0.2 | 19/09/2007 |  | Added the ignore intermediate states to the OR gate.
4.5.1.0 | 21/01/2008 | Added the ability to filter the displayed processes.

Document Version History

Version | Date | Author | Comments
1.00.2 | 19/01/2015 | This is now a separate document from the main app doc
1.00.3 |  |  | Reformatted to make more sense
1.00.10 | 27/04/2009 | Pete Lasko | Added section about duplicating processes
1.00.11 |  |  | Added the ignore intermediate states to the OR gate.
1.00.12 | 26/01/2015 | Richard Kerry | Document revised to current conventions and template. Corrections and amendments. Images reworked from current versions of software.
2.0 | 27/02/2017 | David Yates | Conversion to markdown


alarm - configuration-Bncs driver status acquisition

Alarm System - BNCS Driver Status Acquisition Module

Overview

This module (config_alm_acq_bncs_drv_stat.dll) is part of the suite of modules that form the BNCS Alarm System.
This module is used to configure the module which gathers input information for the alarm system from CSI regarding the status of BNCS device drivers.

Description

The module registers with CSI. It reads CSI’s configuration to find the driver status infodriver number, and then polls the slots as required to monitor the Tx/Rx status of the various BNCS devices’ drivers. The status values are presented to the logic module, which is part of the host application.

Configuration Procedure

To configure the module the BNCS v4.5 configuration tool should be used. The following explanation assumes that you are running the configuration editor and that this is connected to the relevant configuration server.

Select Alarms, then Inputs, then BNCS Acquisition.

The Current System will show “select a system” if you have not yet selected one, in which case then select the Change System button, then select an alarm system from the drop down list. This step is needed because there may be several alarm systems within one BNCS installed system.

If there are no BNCS Driver Status Acquisition modules configured yet create a new one. This can be achieved in two ways, either from the context (right-click) menu in the left hand pane or using the “New” icon in the tool menu at the top of the dialog.

(*** being reworded)

The new module may be given a more meaningful name using the menu or pressing F2.

Change the name to a meaningful one and press return.

Add Inputs

Inputs may be added manually using the New Numeric Input control. On selecting this a new input is created and the cursor left in the name field. Once this has been set the other parameters may be set using the parameter dialog at the bottom of the page.

Each acquisition entry corresponds to one driver running in the system.

When adding inputs to a system there are several required settings. These are detailed below along with an example of adding some inputs.

Required Settings

The system is able to generate alarms based on whether a number of resilience-related issues are detected.

Name

Each input must have a unique name.

This may only be set using Rename in the context menu (or F2), not from the parameter values dialog.

Resilience Type

This section is where the expected resilience for the specified driver specified. It doesn’t specify any actual alarms, but tells the system what the expected level of resilience is for this driver.

No

The driver is being run without resilience. There is one instance of the driver running in the system. It is presumed always to be in Tx/Rx state.

In some places this is referred to as a resilience level of one.

Yes

The driver is being run with resilience. There are two instances of the driver running in the system. One driver will be Tx/Rx and the other RxOnly at all times. This is managed by CSI using various messages dedicated to this purpose.

In some places this is referred to as a resilience level of two.

More

This setting works in conjunction with the adjacent numeric value.

The driver is being run with resilience, but there are more than two instances of the driver running in the system, the number being given by the associated numeric control. One driver will be Tx/Rx and the others should be RxOnly at all times. This is managed by CSI using various messages dedicated to this purpose.

This is referred to as a resilience level of greater than two.

Note that if More is selected a level of one or two may be selected, being equivalent to No and Yes as described above.

Note that levels above two, although often found to work satisfactorily, are not properly supported by the BNCS resilience mechanism.

Driver Definition - Instance or Numeric

This selects the driver to be monitored.

It may be defined via an Instance name or by its device number. This setting corresponds to the slot number in the driver status infodriver.

Numeric

If Numeric is selected, the device number should be entered in the numeric entry box.

If the device is set numerically the instance name will not be shown as it is not necessarily possible to work it out.

Instance

If Instance is selected the instance name may be selected from the drop-down combo box, or it may be entered in the text edit box. Once a valid name is detected the combo box will change to show the value. If a name is selected from the combo box it will appear in the edit control.

Once a valid instance is present the device type and number will appear in the other controls, greyed-out.

If the device is set by an instance name which is a complex instance the device number will show as 1. Composite instances are not shown.

The driver status infodriver device number is read from CSI’s configuration file and shown greyed-out.

Workstations

The system is able to monitor whether the workstations where the driver is running are as configured. To use this alarm it is necessary to configure the workstations on which the driver is expected.

This may be done either by supplying the workstation numbers explicitly, or by entering the name of the driver application name and number. In the latter case the system will look up the workstation details in the launch configuration file – launch.xml.

Workstation List from Driver name

If the name is used it is combined with the driver number as configured above. The driver name is looked for as the application name and the device number in the arguments attribute.

If the driver name and number are found the numbers will be displayed, greyed-out in the workstation number controls.

The application name is searched for using the base name, ie the file-name excluding any folder names or extension.

Alarm Type

The alarm type selects the properties which will generate alarms.

Presence

This will signal a fault condition if no instance of the driver can be found with Tx/Rx state.

Resilience

This will signal a fault condition if the number of drivers reporting RxOnly status doesn’t correspond to the selected resilience level. Ie if it isn’t one less than the configured resilience level.

Ie. if resilience is yes/two, there should always be one instance in RxOnly state.

Config

This will signal a fault condition if the workstations on which the drive is seen to be running doesn’t match the list of workstations on which it is configured to run.

Breakage

This will signal a fault condition if any instance of the driver is in Broken state.

Treat RxBroken as RxOnly

This causes any instances of RxBroken to be treated as RxOnly.

See below for an example.

Configuring Inputs Examples

The following are some examples of configuration, showing the main features. They are not intended to be exhaustive.

Clicking on an individual input is shown above. The name is also shown in the dialog. All the input parameters can be edited here.

Editing Several Inputs

To edit more than one input, select a number of inputs and press the “Edit Selected” button. Use the dialog to change the features. This is useful when you want to add the same setting to more than one input. For example, we want to remove Resilience Alarm from of all the instances of the info driver test_infodriver_1. We sort the view if necessary to see all the required inputs, select all the “test_infodriver_1” inputs, and then press the “Edit Selected” button.

On the popup dialog, tick the “Change Csi Driver Status Settings” box, tick the “Change Alarm Type” box, then uncheck the “Resilience” box.

Then press “Apply” to assert the changes.

Validation

If the required elements are all present the screen will be monochrome. If there are any errors in the features then the affected inputs will be coloured yellow and “NOT VALID” will be shown in the Valid column. For example the example below shows an input where the instance name is not valid and one where the workstation list is not valid.

When the line itself is selected a message is shown in the Status Messages area showing one specific fault with the selected input.

Importing and Exporting data

It is possible to copy one or more rows to the clipboard by using the “Copy to Clipboard” button. The data is tab delimited so is easy to paste into other applications such as Excel.

It is also possible to paste in suitably formatted data into the tool. If the clipboard data is suitable then the “Paste from Clipboard” button will be enabled.

Documents Referenced

This document should be read in conjunction with other documents in the tree.
In particular:

  • Alarm – overview
  • alarm - Colledia Control Acquisition
  • alarm – mainapplication

The documentation relating to file formats may also be useful.

Version History

Software Version

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | State / Changes | Author
1.00.00 | March 2012 | Original Release | Richard Kerry

Document Version

Version | Date | State / Changes | Author
1.00.00 | 11 February 2015 | First version of documentation for this module. | Richard Kerry
1.00.01 | 21 May 2018 | Richard Kerry | Conversion to markdown


ccDriverTest

ccDriverTest - Generic Driver Simulator App

Description

The purpose of this application is to simulate some or all of a system for testing purposes.

Write to it and it'll respond and persist the value, and respond in whatever way you asked. i.e. if you info poll you'll get info responses.

It's "well behaved" in that it'll always defer TxRx status to any other app on the network, and won't register devices that are already locally registered.

This app is fine to run hundreds of devices on a single workstation but will start to struggle if you ask for thousands. Absolute tops is thereabouts of 9900.

Configuration

This app. used to just run up all 999 BNCS devices - and still does by default, but extended ranges mean this is no longer possible so the following command line options have been added.

/min=<device>

Set the minimum device number to run up. You must also supply the max parameter.

/max=<device>

Sets the maximum device number to run up. You must also supply the min parameter.

So to run up devices 10001 to 11001 you'd use the command line:

ccDriverTest.exe /min=10001 /max=11001

/maxloglines=<num-lines>

The maximum number of lines the logging control on the dialog should show

Importing data from CapLog files

If you drag and drop caplog files this application will read "revertive" messages and store the last one it sees in the caplogs you give it as the current value.

It's smart enough to order standard CapLog files in date order to ensure you can drop multiple files at once.

Files should be of the (standard) format:

LOG_20180313.19

and it'll load data from entries of the format:

19:02:50-17 - [001] IR 402 355 '0' [011]
19:02:51-16 - [001] RR 1 141 1 [011]
19:02:57-16 - [001] GR 1 22 0 [011]

but ignore everything else

Version History

Version | Date | Author | Notes
(none) |  | DY | First Version (no version resources)
1.0.2 | 15/10/2017 | DY | Makes work with full range of slots/devices
1.0.3 | 15/01/2018 | DY | Tiny fix to range of devices used (so you can use a single device if yer want). Small note above the max number of devices
1.0.4 | 13/03/2018 | DY | Now understands caplog files if you drag and drop them on the application
1.0.5 | 08/05/2018 | DY | removes misunderstood formatting chars from the infodriver debug message
1.0.6 | 31/05/2018 | DY | now closes when CSI does
1.0.7 | 31/05/2018 | DY | surrounds import operation with transaction - reduces import time on a sample 22MB CapLog file from several minutes (I got bored waiting after 4 minutes) to 9 seconds
1.0.8 | 31/05/2018 | DY | fix to 1.0.7 to ensure clean close. Adds menu bar, import options, full cache clear, help-about and help-contents menu items


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/cc.h Source File

  • include
cc.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_CC_H__2F6043C9_824C_427B_A99E_BEB42E154EE6__INCLUDED_)
6 #define AFX_CC_H__2F6043C9_824C_427B_A99E_BEB42E154EE6__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include "bncs.h"
13
14 namespace cc
15 {
16 enum ipcType
17 {
18 none=0,
19 wm,
20 bbc
21 };
22
23 enum redundancyState
24 {
25 unknown = IFMODE_NONE,
26 rx = IFMODE_RXONLY,
27 tx = IFMODE_TXRX,
28 broken = IFMODE_RXONLYBROKEN,
29 forceTx = IFMODE_FORCETXRX
30 };
31
32 enum redundancyMode
33 {
34 singleControllerCapable = 1,
35 multipleControllerCapable
36 };
37
38 enum driverState
39 {
40 ok = 1,
41 fail
42 };
43
44 enum pollType
45 {
46 UnknownType = 0,
47 IP,
48 RP,
49 GP
50 };
51 };
52
53 #ifndef BBC_IDSLOTMSGPOSTED
54 #define BBC_IDSLOTMSGPOSTED WM_APP + 5001
55 #endif
56
57 #ifndef BBC_DEVCOMMANDMSGPOSTED
58 #define BBC_DEVCOMMANDMSGPOSTED WM_APP + 5002
59 #endif
60
61 #ifndef BBC_DRIVERMSGPOSTED
62 #define BBC_DRIVERMSGPOSTED WM_APP + 5003
63 #endif
64
65 #endif // !defined(AFX_CC_H__2F6043C9_824C_427B_A99E_BEB42E154EE6__INCLUDED_)
cc::forceTx
Definition: cc.h:29
cc::tx
Definition: cc.h:27
cc::UnknownType
Definition: cc.h:46
cc::ok
Definition: cc.h:40
cc::unknown
Definition: cc.h:25
cc::RP
Definition: cc.h:48
cc::broken
Definition: cc.h:28
cc::wm
Definition: cc.h:19
cc::fail
Definition: cc.h:41
cc::GP
Definition: cc.h:49
cc
Definition: cc.h:14
cc::bbc
Definition: cc.h:20
cc::redundancyMode
redundancyMode
Definition: cc.h:32
cc::IP
Definition: cc.h:47
cc::ipcType
ipcType
Definition: cc.h:16
cc::redundancyState
redundancyState
Definition: cc.h:23
cc::multipleControllerCapable
Definition: cc.h:35
cc::pollType
pollType
Definition: cc.h:44
cc::none
Definition: cc.h:18
cc::singleControllerCapable
Definition: cc.h:34
cc::driverState
driverState
Definition: cc.h:38
cc::rx
Definition: cc.h:26
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccCheck.h Source File

  • include
ccCheck.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_CCCHECK_H__D895F3E1_2518_4A19_84C5_E1FF7230D416__INCLUDED_)
6 #define AFX_CCCHECK_H__D895F3E1_2518_4A19_84C5_E1FF7230D416__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <windows.h>
13 #include <string>
14 using namespace std;
15
16 class ccCheck
17 {
18 public:
19 ccCheck( const string & header="" );
20 virtual ~ccCheck();
21 public:
22 void setHeader( const string & header );
23 bool checkDevice(unsigned int device);
24 bool checkIndex( unsigned int index );
25 bool checkSource( int index );
26 bool checkRange(unsigned int start, unsigned int end);
27 bool checkIndexRange(unsigned int start, unsigned int end);
28 bool checkDbIndexRange(unsigned int start, unsigned int end);
29 bool checkDatabase(unsigned int db, unsigned int max = 10);
30 bool checkV1Database(unsigned int db);
31 bool checkString( const string & );
32 bool checkString(const string &, unsigned int);
33 bool checkWorkstation(unsigned int ws);
34 void log( const string & log );
35 private:
36 string m_header;
37 };
38
39 #endif // !defined(AFX_CCCHECK_H__D895F3E1_2518_4A19_84C5_E1FF7230D416__INCLUDED_)
ccCheck
Check ranges for common BNCS values (e.g. device number, slot number etc.).
Definition: ccCheck.h:16
std
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccClient.h Source File

  • include
ccClient.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_CCCLIENT_H__5BC0221D_E447_4DF8_9175_8C8AB169AAAE__INCLUDED_)
6 #define AFX_CCCLIENT_H__5BC0221D_E447_4DF8_9175_8C8AB169AAAE__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <windows.h>
13 #include <string>
14 #include <queue>
15 using namespace std;
16
17 #ifdef CCCLIENT_AS_DLL
18 #ifdef DO_EXPORT_CCCLIENT
19 #define EXPORT_CCCLIENT __declspec(dllexport)
20 #else
21 #define EXPORT_CCCLIENT __declspec(dllimport)
22 #endif
23 #else
24 #define EXPORT_CCCLIENT
25 #endif
26
27 #pragma warning( disable : 4786)
28
29 #include "ccCheck.h"
30 #include "cc.h"
31
38 class EXPORT_CCCLIENT IccClientCallback
39 {
40 protected:
42 virtual void cccConnected( void ){};
44 virtual void cccDisconnected( void ){};
45
51 virtual void cccInfoRevertive( int device, int index, const string & value ){};
58 virtual void cccRtrRevertive( int device, int index, int info ){};
64 virtual void cccGpiRevertive( int device, int index, bool state ){};
71 virtual void cccDatabaseChange( int device, int index, int database ){};
78 virtual void cccDeviceMode( int workstation, int device, enum cc::redundancyState state ){};
79
88 virtual void cccDeviceMessage( int workstation, int device, const string & message, int reference ){};
89
95 virtual void cccPollError( int device, int slot ){};
96
102 virtual void cccSerialNumberError( int workstation, int device ){};
103
107 virtual void cccConfigChangeMessage( const string & msg ){};
108
109 friend class ccClient;
110 friend class bncs_dll_client_shim;
111 };
112
113 class EXPORT_CCCLIENT ccClient : public ccCheck
114 {
115 public:
116
117 ccClient( IccClientCallback * c = 0, const string & debugStringHeader = "ccClient" );
118 virtual ~ccClient();
119 long version( void );
120
121 // router commands
122 void routerCrosspoint( int device, int index, int info, const string & mask = ",---", bool now = false );
123 void routerPoll( int device, int start, int end, bool now = false );
124 void routerQuery( int device, int start, int end, bool now = false );
125 void routerLock( int device, int start, int end, bool lock, bool now = false );
126 void routerFile( int device );
127 // infodriver commands
128 void infoWrite( int device, int index, const string & value, bool now = false );
129 void infoPoll( int device, int start, int end, bool now = false );
130 void infoQuery( int device, int start, int end, bool now = false );
131 void infoLock( int device, int start, int end, bool lock, bool now = false );
132 // void infoFile( int device, const string & value, const string & filename, bool append ); // NEEDS INVESTIGATION!!
133 // void infoDirectory( ); // NEEDS INVESTIGATION!!
134 // gpi commands
135 void gpiSwitch( int device, int index, bool state, bool now = false );
136 void gpiFile( int device );
137 void gpiLock( int device, int start, int end, bool lock, bool now = false );
138 void gpiPoll( int device, int start, int end, bool now = false );
139 void gpiQuery( int device, int start, int end, bool now = false );
140
141 // redundancy commands
142 void deviceMessage( int workstation, int device, const string & message, int reference );
143
144 // profile
145 void deviceProfile(int driver, int & version, int & sources, int & dests, string & db = string());
146
147 // database commands
148 bool databaseName( int device, int index, int database, string & out );
149 int databaseIndex( int device, int database, const string & name );
150 bool databaseModify(int device, int index, int database, const string & name, bool tallyDump = false, bool includeHandle=false);
151
152 // registrations
153 void revertiveRegister( int device, int start, int end, bool overwrite = true, int iType = cc::IP );
154 void revertiveDeregister( int device, int start=0 , int end =0 );
155 void revertiveDeregisterAll( void );
156
157 // cache commands
158 bool cacheValue(int device, int index, string & out, int * num =0 );
159 int cacheIndex( int device, int start, int end, const string & value );
160 void cacheEnable( bool );
161 bool cacheTest( int device, int start, int end );
162 void cacheFlush( int device );
163 bool isCacheEnabled( void );
164
165 // class connection commands
166 bool connect( enum cc::ipcType ipc = cc::bbc, long ipcOptions=0 );
167 bool isConnected( void );
168 bool disconnect( void );
169
170 void writeEnable( bool );
171 bool isWriteEnabled( void );
172
173 void setCloseHostOnExit( bool close = false );
174 bool counters( unsigned int & tx, unsigned int & rx );
175 void resetCounters( void );
176
177 void setCallback( IccClientCallback * callback );
178 bool getClientRegistrationExtent( int device, int & min, int & max );
179 void sendBufferedCommands( void );
180
181 void registerForNetMessage( void );
182 void deregisterForNetMessage( void );
183
184 void registerForConfigChangeMessage( void );
185 void deregisterForConfigChangeMessage( void );
186 void sendConfigChangeMessage( const string & msg );
187
188 void flushDatabaseCache( int device = 0 );
189 private:
190 IccClientCallback *m_callback;
191 HWND m_hWndMessage;
192 HWND m_hCSI;
193 enum cc::ipcType m_ipc;
194 long m_ipcOptions;
195 int m_workstation;
196 bool m_writeEnabled;
197 bool m_closeHostOnExit;
198 unsigned int m_txCounter;
199 unsigned int m_rxCounter;
200 unsigned int m_lastTxCounter;
201 unsigned int m_lastRxCounter;
202 unsigned int m_maxDatabaseIndex;
203 unsigned int m_maxDatabases;
204
205 #pragma warning (disable: 4251 )
206 queue< string > revertiveQueue;
207 #pragma warning (default: 4251 )
208 static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
209 //LRESULT BNCSSendMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, int iReturnDataLen, int iDataType );
210 LRESULT BNCSSendMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, int dataLen, int expectedReturnDataLen, int iDataType );
211 void deviceQuery( char type, int device, int start, int end, bool now );
212 void devicePoll( char type, int device, int start, int end, bool now );
213 void deviceLock( char type, int device, int start, int end, bool lock, bool now = false );
214 void deviceFile( char type, int device );
215 };
216
217 #endif // !defined(AFX_CCCLIENT_H__5BC0221D_E447_4DF8_9175_8C8AB169AAAE__INCLUDED_)
ccClient
A BNCS Client class.
Definition: ccClient.h:113
ccCheck
Check ranges for common BNCS values (e.g. device number, slot number etc.).
Definition: ccCheck.h:16
std
IccClientCallback
Callback interface class for ccClient class.
Definition: ccClient.h:38
IccClientCallback::cccPollError
virtual void cccPollError(int device, int slot)
Definition: ccClient.h:95
IccClientCallback::cccDeviceMessage
virtual void cccDeviceMessage(int workstation, int device, const string &message, int reference)
Definition: ccClient.h:88
IccClientCallback::cccRtrRevertive
virtual void cccRtrRevertive(int device, int index, int info)
Definition: ccClient.h:58
IccClientCallback::cccDeviceMode
virtual void cccDeviceMode(int workstation, int device, enum cc::redundancyState state)
Definition: ccClient.h:78
cc::bbc
Definition: cc.h:20
IccClientCallback::cccDisconnected
virtual void cccDisconnected(void)
Definition: ccClient.h:44
cc::IP
Definition: cc.h:47
cc::ipcType
ipcType
Definition: cc.h:16
IccClientCallback::cccSerialNumberError
virtual void cccSerialNumberError(int workstation, int device)
Definition: ccClient.h:102
cc::redundancyState
redundancyState
Definition: cc.h:23
IccClientCallback::cccGpiRevertive
virtual void cccGpiRevertive(int device, int index, bool state)
Definition: ccClient.h:64
IccClientCallback::cccInfoRevertive
virtual void cccInfoRevertive(int device, int index, const string &value)
Definition: ccClient.h:51
IccClientCallback::cccConnected
virtual void cccConnected(void)
Definition: ccClient.h:42
IccClientCallback::cccDatabaseChange
virtual void cccDatabaseChange(int device, int index, int database)
Definition: ccClient.h:71
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccConfig.h Source File

  • include
ccConfig.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_CCCONFIG_H__0A931BB2_1970_48D9_8C01_80C1813801B9__INCLUDED_)
6 #define AFX_CCCONFIG_H__0A931BB2_1970_48D9_8C01_80C1813801B9__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #pragma warning( disable : 4786 )
13
14 #include <string>
15 #include <map>
16 #include <list>
17 using namespace std;
18
19 class ccConfig
20 {
21 public:
22 // static functions are quickies meant to get the odd entry
23 static void readConfigSection( const string & file, const string & section, map< string, string > & out );
24 static void readConfigSectionRoot( const string & file, const string & section, map< string, string > & out );
25 static void readConfigSection( int device, const string & section, map< string, string > & out );
26 static void deleteKeysFromSectionRoot(const string & file, const string & section, const string & key);
27
28 static void writeConfigSection( const string & file, const string & section, const map< string, string > & out );
29 static void writeConfigSectionRoot( const string & file, const string & section, const map< string, string > & out );
30 static void writeConfigSection( int device, const string & section, const map< string, string > & out );
31
32 static string getString( const string & file, const string & section, const string &key, const string & def, bool createOnDefault=false );
33 static string getString( int device, const string & section, const string &key, const string & def, bool createOnDefault );
34 static void setString( const string & file, const string & section, const string &key, const string & value );
35 static void setString( int device, const string & section, const string &key, const string & value );
36 static int getInt( const string & file, const string & section, const string &key, int def, bool createOnDefault=false );
37 static int getInt( int device, const string & section, const string &key, int def, bool createOnDefault=false );
38 static string getDevPath( void );
39 static string getSystem( void );
40 static string getDevPath( int device );
41 static string getDevPath( const string & filename );
42 static bool isV4Based( void );
43 static bool isV3Based( void );
44 static int workstation( void );
45
46 static void sectionsAbs(const string & absFilename, list< string> & out);
47 static void sections(const string & file, list< string> & out);
48 static void sectionsRoot(const string & file, list< string> & out);
49 static void sections(int device, list< string> & out);
50 static void deleteSectionRoot(const string & file, const string & section);
51
52 ccConfig();
53 // these are the class based functions where we construct a config class to retrieve and access an entire section as key value pairs
54 ccConfig( const string & file, const string & section );
55 ccConfig( int device, const string & section );
56 virtual ~ccConfig();
57 string getString( const string & key, const string & def, bool createOnDefault=false );
58 void setString( const string & key, const string & value );
59 int getInt( const string & key, int def, bool createOnDefault=false );
60
61 static bool developerMode( void );
62 static string getLogPath(const string & dir, const string &file);
63
64 private:
65 map< string, string > m_sectionMap;
66 string m_file;
67 string m_section;
68 // helper function to get section with an absolute filename
69 static void readConfigSectionAbs( const string & absFilename, const string & section, map< string, string > & out );
70 static void writeConfigSectionAbs( const string & absFilename, const string & section, const map< string, string > & in );
71 };
72
73 #endif // !defined(AFX_CCCONFIG_H__0A931BB2_1970_48D9_8C01_80C1813801B9__INCLUDED_)
std
ccConfig
A BNCS Driver / Client Configuration Class.
Definition: ccConfig.h:19
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccDriver.h Source File

  • include
ccDriver.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_ccDriver_H__0EF3B407_6B86_49D2_92FF_9737960379E3__INCLUDED_)
6 #define AFX_ccDriver_H__0EF3B407_6B86_49D2_92FF_9737960379E3__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <windows.h>
13 #include <string>
14 #include <queue>
15 using namespace std;
16
17 #include "ccCheck.h"
18 #include "cc.h"
19
26 class IccDriverCallback
27 {
28 friend class ccDriver;
29 protected:
34 virtual void ccdCommand(ccDriver *, const char * msg) = 0;
35
44 virtual void ccdClientMessage( int workstation, int device, const string & message, const string & clientHandle, const string & reference ){};
48 virtual void ccdRedundancyState( ccDriver *, enum cc::redundancyState state ){};
50 virtual void ccdConnected( int ){};
52 virtual void ccdDisconnected( int ){};
53 virtual void ccdDatabaseChange(unsigned int device, unsigned int database, unsigned int index)=0;
54 };
55
56 class ccDriverPost
57 {
58 public:
59 ccDriverPost( int type, int slot, const string & contents )
60 {
61 m_type = type;
62 m_slot = slot;
63 m_contents = contents;
64 };
65 int m_type;
66 int m_slot;
67 string m_contents;
68 };
69
70 class ccDriver : public ccCheck
71 {
72 public:
73 ccDriver( IccDriverCallback * callback = 0, const string & debugStringHeader = "ccDriver" );
74 virtual ~ccDriver();
75
76 long version( void );
77
78 bool connect( int device, enum cc::ipcType ipc = cc::bbc, long ipcOptions=0 );
79 bool disconnect();
80 bool isConnected( void );
81
82 int device( void );
83
84 void clientMessage( int workstation, int device, const string & message, const string & client, const string & reference );
85
86 void setRedundancyState(enum cc::redundancyState state, bool force = false);
87 void setDriverState( enum cc::driverState state, bool forceNow=false );
88 enum cc::redundancyState redundancyState( void );
89 unsigned int setRedundancyMaster(unsigned int masterDevice);
90
91 bool counters( unsigned int & tx, unsigned int & rx );
92 void resetCounters( void );
93 void sendBufferedRevertives( void );
94
95 void sendPollResponse( int workstation, const char* data, bool sendNow = false ); // BBC_DEVDRVREVMSG
96 void sendQueryResponse( int workstation, const char* data, bool sendNow ); // BBC_DEVDRVPOLLMSG
97 bool databaseModify(int device, int index, int database, const string & name, bool tallyDump);
98 bool routerDatabase(int device, int index, int database, const string & name);
99
100 bool setType(char type);
101 char type(void);
102
103 private:
104 char m_type;
105 IccDriverCallback * m_callback;
106 HWND m_hCSI;
107 HWND m_hWndMessage;
108 enum cc::ipcType m_ipc;
109 long m_ipcOptions;
110 int m_workstation;
111 int m_device;
112 unsigned int m_txCounter;
113 unsigned int m_rxCounter;
114 unsigned int m_lastTxCounter;
115 unsigned int m_lastRxCounter;
116
117 enum cc::redundancyState m_redundancyState;
118 enum cc::driverState m_driverState;
119
120 queue< ccDriverPost > postedQueue;
121 static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
122 LRESULT BNCSSendMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, int dataLen, int expectedReturnDataLen, int iDataType );
123 };
124
125 #endif // !defined(AFX_ccDriver_H__0EF3B407_6B86_49D2_92FF_9737960379E3__INCLUDED_)
ccDriverPost
Definition: ccDriver.h:56
IccDriverCallback::ccdDisconnected
virtual void ccdDisconnected(int)
Definition: ccDriver.h:52
ccCheck
Check ranges for common BNCS values (e.g. device number, slot number etc.).
Definition: ccCheck.h:16
IccDriverCallback
Callback interface class for ccDriver class.
Definition: ccDriver.h:26
std
ccDriver
A BNCS Driver class.
Definition: ccDriver.h:70
IccDriverCallback::ccdRedundancyState
virtual void ccdRedundancyState(ccDriver *, enum cc::redundancyState state)
Definition: ccDriver.h:48
cc::bbc
Definition: cc.h:20
ccDriverPost::ccDriverPost
ccDriverPost(int type, int slot, const string &contents)
Definition: ccDriver.h:59
cc::ipcType
ipcType
Definition: cc.h:16
cc::redundancyState
redundancyState
Definition: cc.h:23
IccDriverCallback::ccdConnected
virtual void ccdConnected(int)
Definition: ccDriver.h:50
ccDriverPost::m_slot
int m_slot
Definition: ccDriver.h:66
IccDriverCallback::ccdClientMessage
virtual void ccdClientMessage(int workstation, int device, const string &message, const string &clientHandle, const string &reference)
Definition: ccDriver.h:44
ccDriver::device
int device(void)
Definition: ccDriver.cpp:583
cc::driverState
driverState
Definition: cc.h:38
ccDriverPost::m_contents
string m_contents
Definition: ccDriver.h:67
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccGrd.h Source File

  • include
ccGrd.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_ccGrd_H__959C69A9_22CC_4486_8F52_4687AE0071A8__INCLUDED_)
6 #define AFX_ccGrd_H__959C69A9_22CC_4486_8F52_4687AE0071A8__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <windows.h>
13 #include "ccCheck.h"
14 #ifdef USEINDEXMAPPING
15 #include "indexMapping.h"
16 #endif
17 #include "cc.h"
18
19 #pragma warning( disable : 4786)
20
21 #include <queue>
22 using namespace std;
23
30 class IccGrdCallback
31 {
32 public:
34 virtual void ccgConnected( int )=0;
36 virtual void ccgDisconnected( int )=0;
41 virtual void ccgCrosspointRequest( int device, int dest, int source ){};
48 virtual void ccgCrosspointRequest( int device, int dest, int source, const string & mask, int workstation ){};
57 virtual void ccgClientMessage( int workstation, int device, const string & message, const string & clientHandle, const string & reference ){};
61 virtual void ccgRedundancyState( enum cc::redundancyState state ){};
62 };
63
64 class ccGrdPost
65 {
66 public:
67 ccGrdPost( int type, int index, int info, const string & str )
68 {
69 m_type = type;
70 m_index = index;
71 m_info = info;
72 m_str = str;
73 };
74 int m_type;
75 int m_index;
76 int m_info;
77 string m_str;
78 };
79
80 class ccGrd : ccCheck
81 {
82 public:
83 ccGrd( IccGrdCallback * callback, const string & debugHeader = "ccGrd" );
84 virtual ~ccGrd();
85
86 void setTally( int dest, int source, bool send=true );
87 bool updateTally( int dest, int source );
88 bool connect( int device );
89 bool disconnect( void );
90 bool isConnected( void );
91 int tally( int dest );
92 int size( int database );
93
94 void setRedundancyState( enum cc::redundancyState state );
95 void setDriverState( enum cc::driverState state, bool forceNow=false );
96 enum cc::redundancyState redundancyState( void );
97 int setRedundancyMaster(int device);
98 void clientMessage(int workstation, int device, const string & message, const string & client, const string & reference);
99
100 void setCloseHostOnExit( bool close = false );
101 bool counters( unsigned int & tx, unsigned int & rx );
102 void resetCounters( void );
103 void loadIndexMapping( void );
104 private:
105 IccGrdCallback *m_callback;
106 HWND m_hWndMessage;
107 HWND m_hGRD;
108 int m_device;
109 queue< ccGrdPost > postedQueue;
110 int m_workstation;
111 static LRESULT CALLBACK WndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
112 enum cc::redundancyState m_redundancyState;
113 enum cc::driverState m_driverState;
114
115 bool m_closeHostOnExit;
116 unsigned int m_txCounter;
117 unsigned int m_rxCounter;
118 unsigned int m_lastTxCounter;
119 unsigned int m_lastRxCounter;
120 LRESULT BNCSSendMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, int dataLen, int expectedReturnDataLen, int iDataType );
121 #ifdef USEINDEXMAPPING
122 indexMapping *m_indexMapping;
123 #endif
124 };
125
126 #endif // !defined(AFX_ccGrd_H__959C69A9_22CC_4486_8F52_4687AE0071A8__INCLUDED_)
IccGrdCallback::ccgRedundancyState
virtual void ccgRedundancyState(enum cc::redundancyState state)
Definition: ccGrd.h:61
ccCheck
Check ranges for common BNCS values (e.g. device number, slot number etc.).
Definition: ccCheck.h:16
ccGrdPost::m_index
int m_index
Definition: ccGrd.h:75
ccGrdPost::m_str
string m_str
Definition: ccGrd.h:77
std
IccGrdCallback
Callback interface class for ccGrd class.
Definition: ccGrd.h:30
ccGrdPost::m_info
int m_info
Definition: ccGrd.h:76
IccGrdCallback::ccgCrosspointRequest
virtual void ccgCrosspointRequest(int device, int dest, int source, const string &mask, int workstation)
Definition: ccGrd.h:48
cc::redundancyState
redundancyState
Definition: cc.h:23
ccGrd
A BNCS GRD class.
Definition: ccGrd.h:80
IccGrdCallback::ccgClientMessage
virtual void ccgClientMessage(int workstation, int device, const string &message, const string &clientHandle, const string &reference)
Definition: ccGrd.h:57
IccGrdCallback::ccgCrosspointRequest
virtual void ccgCrosspointRequest(int device, int dest, int source)
Definition: ccGrd.h:41
ccGrdPost::ccGrdPost
ccGrdPost(int type, int index, int info, const string &str)
Definition: ccGrd.h:67
cc::driverState
driverState
Definition: cc.h:38
ccGrdPost
Definition: ccGrd.h:64
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccInfodriver.h Source File

  • include
ccInfodriver.h
1 /*************************************/
2 /* Written by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #if !defined(AFX_CCINFODRIVER_H__0EF3B407_6B86_49D2_92FF_9737960379E3__INCLUDED_)
6 #define AFX_CCINFODRIVER_H__0EF3B407_6B86_49D2_92FF_9737960379E3__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <windows.h>
13 #include <string>
14 #include <queue>
15 using namespace std;
16
17 #include "ccCheck.h"
18 #include "cc.h"
19
26 class IccInfodriverCallback
27 {
28 friend class ccInfodriver;
29 protected:
36 virtual void cciSlotRequest( int device, int index, const string & slot ){};
45 virtual void cciClientMessage( int workstation, int device, const string & message, const string & clientHandle, const string & reference ){};
49 virtual void cciRedundancyState( enum cc::redundancyState state ){};
51 virtual void cciConnected( int ){};
53 virtual void cciDisconnected( int ){};
54
55 };
56
57 class ccInfodriverPost
58 {
59 public:
60 ccInfodriverPost( int type, int slot, const string & contents )
61 {
62 m_type = type;
63 m_slot = slot;
64 m_contents = contents;
65 };
66 int m_type;
67 int m_slot;
68 string m_contents;
69 };
70
71 class ccInfodriver : public ccCheck
72 {
73 public:
74 ccInfodriver( IccInfodriverCallback * callback = 0, const string & debugStringHeader = "ccInfodriver" );
75 virtual ~ccInfodriver();
76
77 long version( void );
78
79 bool connect( int device, enum cc::ipcType ipc = cc::bbc, long ipcOptions=0 );
80 bool disconnect();
81 bool isConnected( void );
82
83 bool setSlotOnly( int index, const string & value );
84
85 bool setSlot( int index, const string & value, bool sendNow = false );
86 bool setSlot( int index, int value, const string & format = "%d", bool sendNow = false );
87 bool setSlot( int index, double value, const string & format = "%f", bool sendNow = false );
88
89 bool updateSlot( int index, const string & value, bool & updated );
90 bool updateSlot( int index, int value, const string & format = "%d" );
91 bool updateSlot( int index, double value, const string & format = "%f" );
92 bool sendSlotRange( int start, int end );
93 bool slot( int index, string & value );
94
95 void clientMessage( int workstation, int device, const string & message, const string & client, const string & reference );
96
97 void setRedundancyState( enum cc::redundancyState state, bool force = true );
98 void setDriverState( enum cc::driverState state, bool doNow=false, bool force = true );
99 enum cc::redundancyState redundancyState( void );
100 int setRedundancyMaster(int device);
101 void setCloseHostOnExit( bool close = false );
102 bool counters( unsigned int & tx, unsigned int & rx );
103 void resetCounters( void );
104 void sendBufferedRevertives( void );
105 private:
106 IccInfodriverCallback * m_callback;
107 HWND m_hInfo;
108 HWND m_hWndMessage;
109 enum cc::ipcType m_ipc;
110 long m_ipcOptions;
111 int m_workstation;
112 int m_device;
113 bool m_closeHostOnExit;
114 unsigned int m_txCounter;
115 unsigned int m_rxCounter;
116 unsigned int m_lastTxCounter;
117 unsigned int m_lastRxCounter;
118
119 enum cc::redundancyState m_redundancyState;
120 enum cc::driverState m_driverState;
121
122 queue< ccInfodriverPost > postedQueue;
123 static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
124 LRESULT BNCSSendMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, int dataLen, int expectedReturnDataLen, int iDataType );
125 };
126
127 #endif // !defined(AFX_CCINFODRIVER_H__0EF3B407_6B86_49D2_92FF_9737960379E3__INCLUDED_)
IccInfodriverCallback::cciSlotRequest
virtual void cciSlotRequest(int device, int index, const string &slot)
Definition: ccInfodriver.h:36
ccCheck
Check ranges for common BNCS values (e.g. device number, slot number etc.).
Definition: ccCheck.h:16
ccInfodriverPost::ccInfodriverPost
ccInfodriverPost(int type, int slot, const string &contents)
Definition: ccInfodriver.h:60
std
ccInfodriver
A BNCS Control Infodriver class.
Definition: ccInfodriver.h:71
IccInfodriverCallback::cciConnected
virtual void cciConnected(int)
Definition: ccInfodriver.h:51
ccInfodriverPost::m_contents
string m_contents
Definition: ccInfodriver.h:68
IccInfodriverCallback
Callback interface class for ccInfodriver class.
Definition: ccInfodriver.h:26
cc::bbc
Definition: cc.h:20
IccInfodriverCallback::cciRedundancyState
virtual void cciRedundancyState(enum cc::redundancyState state)
Definition: ccInfodriver.h:49
cc::ipcType
ipcType
Definition: cc.h:16
cc::redundancyState
redundancyState
Definition: cc.h:23
ccInfodriverPost::m_slot
int m_slot
Definition: ccInfodriver.h:67
IccInfodriverCallback::cciDisconnected
virtual void cciDisconnected(int)
Definition: ccInfodriver.h:53
ccInfodriver::slot
bool slot(int index, string &value)
Definition: ccInfodriver.cpp:420
cc::driverState
driverState
Definition: cc.h:38
ccInfodriverPost
Definition: ccInfodriver.h:57
IccInfodriverCallback::cciClientMessage
virtual void cciClientMessage(int workstation, int device, const string &message, const string &clientHandle, const string &reference)
Definition: ccInfodriver.h:45
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccLibrary.h Source File

  • include
ccLibrary.h
1 #define __CCLIBRARY_VERSION__ "1.6.2"
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/ccTimer.h Source File

  • include
ccTimer.h
1 /***********************************************/
2 /* Derived from original source by David Yates */
3 /* Copyright Atos 2013 */
4 /***********************************************/
5 #if !defined(AFX_CCTIMER_H__5DFCCA94_D1CA_431F_890F_3EA7489AD2EE__INCLUDED_)
6 #define AFX_CCTIMER_H__5DFCCA94_D1CA_431F_890F_3EA7489AD2EE__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #pragma warning( disable : 4786)
13
14 #include <windows.h>
15 #include <map>
16 using namespace std;
17
22 class IccTimerCallback
23 {
24 public:
25 virtual void ccTimerCallback( int timerId )=0;
26 };
27
28
29 class ccTimerClient
30 {
31 private:
32 ccTimerClient(){};
33 public:
34 ccTimerClient( IccTimerCallback *c, int id )
35 {
36 m_callback = c;
37 m_id = id;
38 };
39
40 IccTimerCallback * m_callback;
41 int m_id;
42 };
43
44 class ccTimer
45 {
46 public:
47 ccTimer( IccTimerCallback * c );
48 virtual ~ccTimer();
49
50 int timerStart( int id, int duration );
51 int timerStop( int id );
52
53 const int getId( int id ) const;
54 private:
55
56 // first is timer identifer as allocated by Windows...second is our internal reference to that timer
57 static map< int, ccTimerClient > m_timers;
58 IccTimerCallback * m_callback;
59
60 static HWND m_hWndMessageWindow;
61 static unsigned int m_referenceCount;
62 static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
63
64 void timerFired( int id );
65
66 static void showLastError( char * szHeading );
67 };
68
69 #endif // !defined(AFX_CCTIMER_H__5DFCCA94_D1CA_431F_890F_3EA7489AD2EE__INCLUDED_)
std
ccTimerClient::ccTimerClient
ccTimerClient(IccTimerCallback *c, int id)
Definition: ccTimer.h:34
ccTimerClient::m_id
int m_id
Definition: ccTimer.h:41
ccTimer
Definition: ccTimer.h:44
IccTimerCallback
Callback interface class for ccTimer class.
Definition: ccTimer.h:22
ccTimerClient
Definition: ccTimer.h:29
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: IccClientCallback Class Reference

IccClientCallback Class Reference

Callback interface class for ccClient class. More...

#include <ccClient.h>

Protected Member Functions

virtual void | cccConnected (void)
virtual void | cccDisconnected (void)
virtual void | cccInfoRevertive (int device, int index, const string &value)
virtual void | cccRtrRevertive (int device, int index, int info)
virtual void | cccGpiRevertive (int device, int index, bool state)
virtual void | cccDatabaseChange (int device, int index, int database)
virtual void | cccDeviceMode (int workstation, int device, enum cc::redundancyState state)
virtual void | cccDeviceMessage (int workstation, int device, const string &message, int reference)
virtual void | cccPollError (int device, int slot)
virtual void | cccSerialNumberError (int workstation, int device)
virtual void | cccConfigChangeMessage (const string &msg)

Friends

class | ccClient
class | bncs_dll_client_shim

Detailed Description

Callback interface class for ccClient class.

For clarity because this class must be inherited, the function names are prepended with ccc (for Colledia Control Client)

See also
ccClient

Member Function Documentation

◆ cccConfigChangeMessage()

virtual void IccClientCallback::cccConfigChangeMessage ( const string & msg )
inlineprotectedvirtual

Message from CSI telling us of a configuration change - clients should do whatever they see fit with this CSI itself won't update the configuration - if you want it saved then write something (a singleton) to do it

◆ cccConnected()

virtual void IccClientCallback::cccConnected ( void )
inlineprotectedvirtual

Connected event - usually generated by ccClient connect function

◆ cccDatabaseChange()

virtual void IccClientCallback::cccDatabaseChange | ( | int | device,
 |  | int | index,
 |  | int | database
 | ) |  |
inlineprotectedvirtual

Database change notification

Parameters
device | Device number
index | index number
database | database number (0-9)
name | New name

◆ cccDeviceMessage()

virtual void IccClientCallback::cccDeviceMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | int | reference
 | ) |  |
inlineprotectedvirtual

Direct driver message Message from a specific device instance to a specific client regardless of TXRX state of the driver

Parameters
workstation | The workstation number issuing this command
device | The device number eminating the status message
message | The message!
reference | A number assigned by the client when issuing requests to keep track of requests. See: ccClient::deviceMessage()
Note
See registerForNetMessage - certain CSI configurations require explicit actions in this class to work

◆ cccDeviceMode()

virtual void IccClientCallback::cccDeviceMode | ( | int | workstation,
 |  | int | device,
 |  | enum cc::redundancyState | state
 | ) |  |
inlineprotectedvirtual

Device mode Sent regularly when a device broadcasts its state to the network

Parameters
workstation | Workstation number hosting the device
device | Device number
mode | The current mode of the device

◆ cccDisconnected()

virtual void IccClientCallback::cccDisconnected ( void )
inlineprotectedvirtual

Disconnected event - possibly asynchronous if our host disappears, but also called on ccClient::disconnect()

◆ cccGpiRevertive()

virtual void IccClientCallback::cccGpiRevertive | ( | int | device,
 |  | int | index,
 |  | bool | state
 | ) |  |
inlineprotectedvirtual

GPI revertive

Parameters
device | Device number
index | destination number
state | on/off state

◆ cccInfoRevertive()

virtual void IccClientCallback::cccInfoRevertive | ( | int | device,
 |  | int | index,
 |  | const string & | value
 | ) |  |
inlineprotectedvirtual

Infodriver revertive

Parameters
device | Device number
index | Slot number
value | Slot contents

◆ cccPollError()

virtual void IccClientCallback::cccPollError | ( | int | device,
 |  | int | slot
 | ) |  |
inlineprotectedvirtual

Poll Error Message from the bncs_shim telling us that a single poll message we'd sent out failed to solicit a response

Parameters
device | The device number at fault
index | The index at fault

◆ cccRtrRevertive()

virtual void IccClientCallback::cccRtrRevertive | ( | int | device,
 |  | int | index,
 |  | int | info
 | ) |  |
inlineprotectedvirtual

GRD revertive

Parameters
device | Device number
index | destination number
info | Integer value of source
name | Source name (derived from local database)

◆ cccSerialNumberError()

virtual void IccClientCallback::cccSerialNumberError | ( | int | workstation,
 |  | int | device
 | ) |  |
inlineprotectedvirtual

Serial Number Error Message from CSI telling us that a packet serial number error has been detected

Parameters
workstation | The workstation we missed the message(s) from
device | The device number at fault

Friends And Related Function Documentation

◆ bncs_dll_client_shim

friend class bncs_dll_client_shim
friend

◆ ccClient

friend class ccClient
friend
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

IccClientCallback Member List

This is the complete list of members for IccClientCallback, including all inherited members.

bncs_dll_client_shim class | IccClientCallback | friend
cccConfigChangeMessage(const string &msg) | IccClientCallback | inlineprotectedvirtual
cccConnected(void) | IccClientCallback | inlineprotectedvirtual
cccDatabaseChange(int device, int index, int database) | IccClientCallback | inlineprotectedvirtual
cccDeviceMessage(int workstation, int device, const string &message, int reference) | IccClientCallback | inlineprotectedvirtual
cccDeviceMode(int workstation, int device, enum cc::redundancyState state) | IccClientCallback | inlineprotectedvirtual
cccDisconnected(void) | IccClientCallback | inlineprotectedvirtual
cccGpiRevertive(int device, int index, bool state) | IccClientCallback | inlineprotectedvirtual
cccInfoRevertive(int device, int index, const string &value) | IccClientCallback | inlineprotectedvirtual
ccClient class | IccClientCallback | friend
cccPollError(int device, int slot) | IccClientCallback | inlineprotectedvirtual
cccRtrRevertive(int device, int index, int info) | IccClientCallback | inlineprotectedvirtual
cccSerialNumberError(int workstation, int device) | IccClientCallback | inlineprotectedvirtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: IccDriverCallback Class Reference

IccDriverCallback Class Referenceabstract

Callback interface class for ccDriver class. More...

#include <ccDriver.h>

Protected Member Functions

virtual void | ccdCommand (ccDriver *, const char *msg)=0
virtual void | ccdClientMessage (int workstation, int device, const string &message, const string &clientHandle, const string &reference)
virtual void | ccdRedundancyState (ccDriver *, enum cc::redundancyState state)
virtual void | ccdConnected (int)
virtual void | ccdDisconnected (int)
virtual void | ccdDatabaseChange (unsigned int device, unsigned int database, unsigned int index)=0

Friends

class ccDriver

Detailed Description

Callback interface class for ccDriver class.

For clarity because this class must be inherited, the function names are prepended with cci (for Colledia Control Infodriver)

See also
ccDriver

Member Function Documentation

◆ ccdClientMessage()

virtual void IccDriverCallback::ccdClientMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | const string & | clientHandle,
 |  | const string & | reference
 | ) |  |
inlineprotectedvirtual

Direct message from a client requesting workstation specific information on this device

Parameters
[in] | workstation | The workstation requesting the information
[in] | device | The device number
[in] | message | The message string from the client
[in] | reference | An arbitary message reference that should be returned with the reply to this command
See also
ccDriver::clientMessage();
Note
Implementation of this messaging mechanism is patchy so beware....

◆ ccdCommand()

virtual void IccDriverCallback::ccdCommand | ( | ccDriver * | ,
 |  | const char * | msg
 | ) |  |
protectedpure virtual

Request from client to change a slot

Parameters
[in] | device | The device number
[in] | msg | The message

◆ ccdConnected()

virtual void IccDriverCallback::ccdConnected ( int )
inlineprotectedvirtual

Connected event

◆ ccdDatabaseChange()

virtual void IccDriverCallback::ccdDatabaseChange | ( | unsigned int | device,
 |  | unsigned int | database,
 |  | unsigned int | index
 | ) |  |
protectedpure virtual

◆ ccdDisconnected()

virtual void IccDriverCallback::ccdDisconnected ( int )
inlineprotectedvirtual

Disconnected event

◆ ccdRedundancyState()

virtual void IccDriverCallback::ccdRedundancyState | ( | ccDriver * | ,
 |  | enum cc::redundancyState | state
 | ) |  |
inlineprotectedvirtual

Notification of redundancy state

Parameters
[in] state The current state

Friends And Related Function Documentation

◆ ccDriver

friend class ccDriver
friend
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

IccDriverCallback Member List

This is the complete list of members for IccDriverCallback, including all inherited members.

ccdClientMessage(int workstation, int device, const string &message, const string &clientHandle, const string &reference) | IccDriverCallback | inlineprotectedvirtual
ccdCommand(ccDriver *, const char *msg)=0 | IccDriverCallback | protectedpure virtual
ccdConnected(int) | IccDriverCallback | inlineprotectedvirtual
ccdDatabaseChange(unsigned int device, unsigned int database, unsigned int index)=0 | IccDriverCallback | protectedpure virtual
ccdDisconnected(int) | IccDriverCallback | inlineprotectedvirtual
ccdRedundancyState(ccDriver *, enum cc::redundancyState state) | IccDriverCallback | inlineprotectedvirtual
ccDriver class | IccDriverCallback | friend
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: IccGrdCallback Class Reference

IccGrdCallback Class Referenceabstract

Callback interface class for ccGrd class. More...

#include <ccGrd.h>

Public Member Functions

virtual void | ccgConnected (int)=0
virtual void | ccgDisconnected (int)=0
virtual void | ccgCrosspointRequest (int device, int dest, int source)
virtual void | ccgCrosspointRequest (int device, int dest, int source, const string &mask, int workstation)
virtual void | ccgClientMessage (int workstation, int device, const string &message, const string &clientHandle, const string &reference)
virtual void | ccgRedundancyState (enum cc::redundancyState state)

Detailed Description

Callback interface class for ccGrd class.

For clarity because this class must be inherited, the function names are prepended with ccg (for Colledia Control Grd)

See also
ccGrd

Member Function Documentation

◆ ccgClientMessage()

virtual void IccGrdCallback::ccgClientMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | const string & | clientHandle,
 |  | const string & | reference
 | ) |  |
inlinevirtual

Direct message from a client requesting workstation specific information on this device

Parameters
[in] | workstation | The workstation requesting the information
[in] | device | The device number
[in] | message | The message string from the client
[in] | reference | An arbitary message reference that should be returned with the reply to this command
See also
ccInfodriver::clientMessage();
Note
Implementation of this messaging mechanism is patchy so beware....

◆ ccgConnected()

virtual void IccGrdCallback::ccgConnected ( int )
pure virtual

Notification that we've connected to this device (also available as return value from connect()

◆ ccgCrosspointRequest() [1/2]

virtual void IccGrdCallback::ccgCrosspointRequest | ( | int | device,
 |  | int | dest,
 |  | int | source
 | ) |  |
inlinevirtual

Simple notification of crosspoint request - note that the mask parameter is not available

Parameters
[in] | dest | The destination number
[in] | source | The source number

◆ ccgCrosspointRequest() [2/2]

virtual void IccGrdCallback::ccgCrosspointRequest | ( | int | device,
 |  | int | dest,
 |  | int | source,
 |  | const string & | mask,
 |  | int | workstation
 | ) |  |
inlinevirtual

Full notification of crosspoint request

Parameters
[in] | dest | The destination number
[in] | source | The source number
[in] | mask | The "metadata" of how to make this route
[in] | workstation | The workstation requesting the route

◆ ccgDisconnected()

virtual void IccGrdCallback::ccgDisconnected ( int )
pure virtual

Notification that we've disconnected - this may be received as a resuilt of the host application closing

◆ ccgRedundancyState()

virtual void IccGrdCallback::ccgRedundancyState ( enum cc::redundancyState state )
inlinevirtual

Notification of redundancy mode

Parameters
[in] mode The current mode
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

IccGrdCallback Member List

This is the complete list of members for IccGrdCallback, including all inherited members.

ccgClientMessage(int workstation, int device, const string &message, const string &clientHandle, const string &reference) | IccGrdCallback | inlinevirtual
ccgConnected(int)=0 | IccGrdCallback | pure virtual
ccgCrosspointRequest(int device, int dest, int source) | IccGrdCallback | inlinevirtual
ccgCrosspointRequest(int device, int dest, int source, const string &mask, int workstation) | IccGrdCallback | inlinevirtual
ccgDisconnected(int)=0 | IccGrdCallback | pure virtual
ccgRedundancyState(enum cc::redundancyState state) | IccGrdCallback | inlinevirtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: IccInfodriverCallback Class Reference

IccInfodriverCallback Class Reference

Callback interface class for ccInfodriver class. More...

#include <ccInfodriver.h>

Protected Member Functions

virtual void | cciSlotRequest (int device, int index, const string &slot)
virtual void | cciClientMessage (int workstation, int device, const string &message, const string &clientHandle, const string &reference)
virtual void | cciRedundancyState (enum cc::redundancyState state)
virtual void | cciConnected (int)
virtual void | cciDisconnected (int)

Friends

class ccInfodriver

Detailed Description

Callback interface class for ccInfodriver class.

For clarity because this class must be inherited, the function names are prepended with cci (for Colledia Control Infodriver)

See also
ccInfodriver

Member Function Documentation

◆ cciClientMessage()

virtual void IccInfodriverCallback::cciClientMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | const string & | clientHandle,
 |  | const string & | reference
 | ) |  |
inlineprotectedvirtual

Direct message from a client requesting workstation specific information on this device

Parameters
[in] | workstation | The workstation requesting the information
[in] | device | The device number
[in] | message | The message string from the client
[in] | reference | An arbitary message reference that should be returned with the reply to this command
See also
ccInfodriver::clientMessage();
Note
Implementation of this messaging mechanism is patchy so beware....

◆ cciConnected()

virtual void IccInfodriverCallback::cciConnected ( int )
inlineprotectedvirtual

Connected event

◆ cciDisconnected()

virtual void IccInfodriverCallback::cciDisconnected ( int )
inlineprotectedvirtual

Disconnected event

◆ cciRedundancyState()

virtual void IccInfodriverCallback::cciRedundancyState ( enum cc::redundancyState state )
inlineprotectedvirtual

Notification of redundancy state

Parameters
[in] state The current state

◆ cciSlotRequest()

virtual void IccInfodriverCallback::cciSlotRequest | ( | int | device,
 |  | int | index,
 |  | const string & | slot
 | ) |  |
inlineprotectedvirtual

Request from client to change a slot

Parameters
[in] | device | The device number
[in] | index | The slot number
[in] | slot | The requested contents to use
Note
This command does not automatically update the contents of the slot

Friends And Related Function Documentation

◆ ccInfodriver

friend class ccInfodriver
friend
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

IccInfodriverCallback Member List

This is the complete list of members for IccInfodriverCallback, including all inherited members.

cciClientMessage(int workstation, int device, const string &message, const string &clientHandle, const string &reference) | IccInfodriverCallback | inlineprotectedvirtual
cciConnected(int) | IccInfodriverCallback | inlineprotectedvirtual
cciDisconnected(int) | IccInfodriverCallback | inlineprotectedvirtual
ccInfodriver class | IccInfodriverCallback | friend
cciRedundancyState(enum cc::redundancyState state) | IccInfodriverCallback | inlineprotectedvirtual
cciSlotRequest(int device, int index, const string &slot) | IccInfodriverCallback | inlineprotectedvirtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: IccTimerCallback Class Reference

IccTimerCallback Class Referenceabstract

Callback interface class for ccTimer class. More...

#include <ccTimer.h>

Public Member Functions

virtual void ccTimerCallback (int timerId)=0

Detailed Description

Callback interface class for ccTimer class.

See also
ccTimer

Member Function Documentation

◆ ccTimerCallback()

virtual void IccTimerCallback::ccTimerCallback ( int timerId )
pure virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

IccTimerCallback Member List

This is the complete list of members for IccTimerCallback, including all inherited members.

ccTimerCallback(int timerId)=0 IccTimerCallback pure virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccCheck Class Reference

ccCheck Class Reference

Check ranges for common BNCS values (e.g. device number, slot number etc.). More...

#include <ccCheck.h>

Inheritance diagram for ccCheck:
ccClient ccDriver ccGrd ccInfodriver

Public Member Functions

ccCheck (const string &header="")
virtual | ~ccCheck ()
void | setHeader (const string &header)
bool | checkDevice (unsigned int device)
bool | checkIndex (unsigned int index)
bool | checkSource (int index)
bool | checkRange (unsigned int start, unsigned int end)
bool | checkIndexRange (unsigned int start, unsigned int end)
bool | checkDbIndexRange (unsigned int start, unsigned int end)
bool | checkDatabase (unsigned int db, unsigned int max=10)
bool | checkV1Database (unsigned int db)
bool | checkString (const string &)
bool | checkString (const string &, unsigned int)
bool | checkWorkstation (unsigned int ws)
void | log (const string &log)

Detailed Description

Check ranges for common BNCS values (e.g. device number, slot number etc.).

Constructor & Destructor Documentation

◆ ccCheck()

ccCheck::ccCheck ( const string & header = "" )

Construct ccCheck

Parameters
header The header to use on the front of any debug messages
See also
log()

◆ ~ccCheck()

ccCheck::~ccCheck ( )
virtual

Member Function Documentation

◆ checkDatabase()

bool ccCheck::checkDatabase | ( | unsigned int | db,
 |  | unsigned int | max = 10
 | ) |  |

Check BNCS database number

Parameters
[in] db The database number to test (valid range is 0-9)
Returns
Returns true on error

◆ checkDbIndexRange()

bool ccCheck::checkDbIndexRange | ( | unsigned int | start,
 |  | unsigned int | end
 | ) |  |

◆ checkDevice()

bool ccCheck::checkDevice ( unsigned int device )

Check device number. This value must be between 1 and 999 inclusive

Parameters
[in] device The device number to check
Returns
Returns true on error

◆ checkIndex()

bool ccCheck::checkIndex ( unsigned int index )

Check index (slot, or destination number). This value must be between 1 and 4096 inclusive

Parameters
[in] index The index to check
Returns
Returns true on error

◆ checkIndexRange()

bool ccCheck::checkIndexRange | ( | unsigned int | start,
 |  | unsigned int | end
 | ) |  |

Check range and index values. This function uses checkIndex() to validate start and end values

Parameters
[in] | start | The beginning of the range to test
[in] | end | The end of the range to test
Returns
Returns true when either start or end are invalid indexes or start > end

◆ checkRange()

bool ccCheck::checkRange | ( | unsigned int | start,
 |  | unsigned int | end
 | ) |  |

Check range

Parameters
[in] | start | The beginning of the range to test
[in] | end | The end of the range to test
Returns
Returns true on start > end The values of start and end are not checked otherwise - see checkIndexRange()

◆ checkSource()

bool ccCheck::checkSource ( int index )

Check source index. This value must be between -1 and 4096 inclusive

Parameters
[in] index The index to check
Returns
Returns true on error

◆ checkString() [1/2]

bool ccCheck::checkString ( const string & in )

Check Colledia Control string - these are almost always limited to 255 characters

Parameters
[in] in String to test
Returns
Returns true on error

◆ checkString() [2/2]

bool ccCheck::checkString | ( | const string & | in,
 |  | unsigned int | len
 | ) |  |

◆ checkV1Database()

bool ccCheck::checkV1Database ( unsigned int db )

Check V1 Colledia Control database number

Parameters
[in] db The database number to test (valid values are 0 or 1)
Returns
Returns true on error

◆ checkWorkstation()

bool ccCheck::checkWorkstation ( unsigned int ws )

Check workstation number. This value must be between 1 and 999 inclusive

Parameters
[in] ws The workstation number to check
Returns
Returns true on error

◆ log()

void ccCheck::log ( const string & log )

Write message to debug window

Parameters
[in] log The message to write

◆ setHeader()

void ccCheck::setHeader ( const string & header )

Set the debug message header

Parameters
header The header to use on the front of any debug messages
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccCheck Member List

This is the complete list of members for ccCheck, including all inherited members.

ccCheck(const string &header="") | ccCheck |
checkDatabase(unsigned int db, unsigned int max=10) | ccCheck |
checkDbIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkDevice(unsigned int device) | ccCheck |
checkIndex(unsigned int index) | ccCheck |
checkIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkRange(unsigned int start, unsigned int end) | ccCheck |
checkSource(int index) | ccCheck |
checkString(const string &) | ccCheck |
checkString(const string &, unsigned int) | ccCheck |
checkV1Database(unsigned int db) | ccCheck |
checkWorkstation(unsigned int ws) | ccCheck |
log(const string &log) | ccCheck |
setHeader(const string &header) | ccCheck |
~ccCheck() | ccCheck | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccClient Class Reference

ccClient Class Reference

A BNCS Client class. More...

#include <ccClient.h>

Inheritance diagram for ccClient:
ccCheck

Public Member Functions

ccClient (IccClientCallback *c=0, const string &debugStringHeader="ccClient")
virtual | ~ccClient ()
long | version (void)
void | routerCrosspoint (int device, int index, int info, const string &mask=",---", bool now=false)
void | routerPoll (int device, int start, int end, bool now=false)
void | routerQuery (int device, int start, int end, bool now=false)
void | routerLock (int device, int start, int end, bool lock, bool now=false)
void | routerFile (int device)
void | infoWrite (int device, int index, const string &value, bool now=false)
void | infoPoll (int device, int start, int end, bool now=false)
void | infoQuery (int device, int start, int end, bool now=false)
void | infoLock (int device, int start, int end, bool lock, bool now=false)
void | gpiSwitch (int device, int index, bool state, bool now=false)
void | gpiFile (int device)
void | gpiLock (int device, int start, int end, bool lock, bool now=false)
void | gpiPoll (int device, int start, int end, bool now=false)
void | gpiQuery (int device, int start, int end, bool now=false)
void | deviceMessage (int workstation, int device, const string &message, int reference)
void | deviceProfile (int driver, int &version, int &sources, int &dests, string &db=string())
bool | databaseName (int device, int index, int database, string &out)
int | databaseIndex (int device, int database, const string &name)
bool | databaseModify (int device, int index, int database, const string &name, bool tallyDump=false, bool includeHandle=false)
void | revertiveRegister (int device, int start, int end, bool overwrite=true, int iType=cc::IP)
void | revertiveDeregister (int device, int start=0, int end=0)
void | revertiveDeregisterAll (void)
bool | cacheValue (int device, int index, string &out, int *num=0)
int | cacheIndex (int device, int start, int end, const string &value)
void | cacheEnable (bool)
bool | cacheTest (int device, int start, int end)
void | cacheFlush (int device)
bool | isCacheEnabled (void)
bool | connect (enum cc::ipcType ipc=cc::bbc, long ipcOptions=0)
bool | isConnected (void)
bool | disconnect (void)
void | writeEnable (bool)
bool | isWriteEnabled (void)
void | setCloseHostOnExit (bool close=false)
bool | counters (unsigned int &tx, unsigned int &rx)
void | resetCounters (void)
void | setCallback (IccClientCallback *callback)
bool | getClientRegistrationExtent (int device, int &min, int &max)
void | sendBufferedCommands (void)
void | registerForNetMessage (void)
void | deregisterForNetMessage (void)
void | registerForConfigChangeMessage (void)
void | deregisterForConfigChangeMessage (void)
void | sendConfigChangeMessage (const string &msg)
void | flushDatabaseCache (int device=0)
- Public Member Functions inherited from ccCheck
ccCheck (const string &header="")
virtual | ~ccCheck ()
void | setHeader (const string &header)
bool | checkDevice (unsigned int device)
bool | checkIndex (unsigned int index)
bool | checkSource (int index)
bool | checkRange (unsigned int start, unsigned int end)
bool | checkIndexRange (unsigned int start, unsigned int end)
bool | checkDbIndexRange (unsigned int start, unsigned int end)
bool | checkDatabase (unsigned int db, unsigned int max=10)
bool | checkV1Database (unsigned int db)
bool | checkString (const string &)
bool | checkString (const string &, unsigned int)
bool | checkWorkstation (unsigned int ws)
void | log (const string &log)

Detailed Description

A BNCS Client class.

This is a class that provides full client functionality for BNCS.

Simple usage example
#include <ccClient.h>
class myClient : public IccClientCallback
{
public:
myClient()
{
m_client = new ccClient( this );
m_client->connect();
m_client->revertiveRegister( 101, 1, 10 );
m_client->infoWrite( 101, 1, "hi there");
};
~myClient() { delete m_client; };
protected:
// reimplement those functions we need to (declared in IccClientCallback)
virtual void cccInfoRevertive( int device, int index, const string & value )
{
Debug( "Infodriver Revertive %d %d '%s'", device, index, value.c_str() );
};
private:
ccClient *m_client;
}
The example shows our own client implementation "myClient" which inherits the callback class so that it can be notified of events generated by the ccClient class. We've only implemented a single event in this example - the Infodriver Revertive
Note
Watch out for parameter order (compared to other versions of BNCS Clients). The only thing you probably really need to remember about this is that index always follows device. e.g. routerCrosspoint( device, index, source ); infoWrite( device, index, slotContents ); This then matches the change of state callbacks e.g. cccInfoRevertive( device, index, slotContents );

Constructor & Destructor Documentation

◆ ccClient()

ccClient::ccClient | ( | IccClientCallback * | callback = 0,
 |  | const string & | debugStringHeader = "ccClient"
 | ) |  |

Construct a BNCS client and tell it where to send notifications too (i.e. pass it an interface to the class to callback). If the callback is not specified this class will be able to get database names or cache values, but be unable to receive asynchronous notifications of change of state etc.

Parameters
[in] | callback | pointer to the class that implements the IccClientCallback class
[in] | debugStringHeader | The member functions of this class generate debug messages for out of range values to which this string is prepended. A message such as "Error: Device=0" message in itself is not useful without some context!

◆ ~ccClient()

ccClient::~ccClient ( )
virtual

Member Function Documentation

◆ cacheEnable()

void ccClient::cacheEnable ( bool enable )

Enable the local CSI cache.

Parameters
[in] enable true to enable the local cache, false to disable
Note
This is a global setting for this workstation, not solely for this particular client

◆ cacheFlush()

void ccClient::cacheFlush ( int device )

Flush the local cache of all entries for the specified device

Parameters
[in] device CC Device number
Note
The cache must be enabled for this function to have an effect.

◆ cacheIndex()

int ccClient::cacheIndex | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | const string & | value
 | ) |  |

Determine whether the local cache contains valid entries for the given parameters

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to check
[in] | end | End of range to check
[in] | value | The value to search the cache for
Returns
index of the value in the cache if it exists or zero if it wasn't found or the cache isn't enabled.
Note
This function requires that the local cache is enabled

◆ cacheTest()

bool ccClient::cacheTest | ( | int | device,
 |  | int | start,
 |  | int | end
 | ) |  |

Determine whether the local cache contains valid entries for the given parameters

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to check
[in] | end | End of range to check
Returns
true on valid values existing in the local cache, false on error or invalid cache
See also
isCacheEnabled(), cacheFlush()

◆ cacheValue()

bool ccClient::cacheValue | ( | int | device,
 |  | int | index,
 |  | string & | value,
 |  | int * | num = 0
 | ) |  |

Get a value from CSI cache

Parameters
[in] | device | The device number to use
[in] | index | The index required
[out] | value | The returned cache entry
Returns
true on failure, false on success
Note
This function requires that the cache is enabled.

◆ connect()

bool ccClient::connect | ( | enum cc::ipcType | ipc = cc::bbc,
 |  | long | ipcOptions = 0
 | ) |  |

Connect to CSI using the specified IPC mechanism

Parameters
[in] | ipc | IPC type as defined in the cc::ipcType enumeration
[in] | ipcOptions | values relevant to the ipc type chosen (none are defined at the time of writing)
Returns
true on error, false on success

◆ counters()

bool ccClient::counters | ( | unsigned int & | tx,
 |  | unsigned int & | rx
 | ) |  |

Return current state of counters. This class maintains counts of received and sent messages which may be retrieved using this function

Parameters
tx | Refernce to the integer to pass the value back in
tx | Refernce to the integer to pass the value back in
Returns
true if the counters have changed since the last time this function was called. This can be used to determine whether its worth writing these values to the display
See also
resetCounters()

◆ databaseIndex()

int ccClient::databaseIndex | ( | int | device,
 |  | int | database,
 |  | const string & | name
 | ) |  |

Get index for name from local database

Parameters
[in] | device | The device number to use
[in] | database | The database number to use
[in] | name | The name to search for
Returns
index of specified name or zero if not found
Note
This function is only able to find the first instance of a name

◆ databaseModify()

bool ccClient::databaseModify | ( | int | device,
 |  | int | index,
 |  | int | database,
 |  | const string & | name,
 |  | bool | tallyDump = false,
 |  | bool | includeHandle = false
 | ) |  |

Send a database modify command. This updates the local copy of the databases on any workstation that receives it and should result in a IccClientCallback::cccDatabaseChange() callback notification to this client if it has any registration with that device. This command is only sent if this class is enabled to do so see writeEnable()

Parameters
[in] | device | The device number to use
[in] | index | The index within that devices databases
[in] | database | The database number to use
[in] | name | The new name to set
[in] | tallyDump | A request of the remote device to send a complete tally dump to the network - this has the (rather brute force) effect of updating names on panels

◆ databaseName()

bool ccClient::databaseName | ( | int | device,
 |  | int | index,
 |  | int | database,
 |  | string & | name
 | ) |  |

Get local database name

Parameters
[in] | device | The device number to use
[in] | index | The index within that devices databases
[in] | database | The database number to use
[out] | name | The returned database entry
Returns
true on failure, false on success

◆ deregisterForConfigChangeMessage()

void ccClient::deregisterForConfigChangeMessage ( void )

◆ deregisterForNetMessage()

void ccClient::deregisterForNetMessage ( void )

◆ deviceMessage()

void ccClient::deviceMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | int | reference
 | ) |  |

Send a message to the specified device running on a specified workstation regardless of is TxRx state. Any response to this message is returned asynchronously in a IccClientCallback::cccDeviceMessage() callback.

Parameters
[in] | workstation | The workstation that is running the device
[in] | device | CC Device number
[in] | message | The message to send
[in] | reference | arbitary value that is returned with any response

◆ deviceProfile()

void ccClient::deviceProfile | ( | int | device,
 |  | int & | version,
 |  | int & | sources,
 |  | int & | dests,
 |  | string & | db = string()
 | ) |  |
Parameters
[in] | device | CC Device number
[out] | version
[out] | sources | The database_0 size (generally the number of sources) of this device as specified in its DEV_nnn.INI file
[out] | dests | The database_1 size (generally the number of destinations) of this device as specified in its DEV_nnn.INI file

◆ disconnect()

bool ccClient::disconnect ( void )

Disconnect from CSI. This calls our cccDisconnected event if we successfully disconnected from CSI

Returns
false on successful disconnection or false on there being no connection to disconnect.

◆ flushDatabaseCache()

void ccClient::flushDatabaseCache ( int device = 0 )

Clear CSIs cache of database names

Parameters
[in] device Device number to clear or zero to clear all
Note
This command requires CSI32 1.2.28 or later

◆ getClientRegistrationExtent()

bool ccClient::getClientRegistrationExtent | ( | int | device,
 |  | int & | min,
 |  | int & | max
 | ) |  |

Get the min/max range of registrations for a device

Parameters
[in] | device | The device number to query
[out] | min | The minimum registered index
[out] | max | The maximum registered index
Returns
true on no registration found

◆ gpiFile()

void ccClient::gpiFile ( int device )

GPI File command Sends a request for remote GPI device to reload its configuration. There is no confirmation of success or acknowledgement for this command. This command is only sent if this class is enabled to do so see writeEnable()

Parameters
[in] device CC Device number

◆ gpiLock()

void ccClient::gpiLock | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | lock,
 |  | bool | now = false
 | ) |  |

GPI Lock command Sends a request to lock GPI destinations. This command is only sent if this class is enabled to do so see writeEnable()

Note
Use of this command is discouraged since it is not possible to remotely determine its state
Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to lock
[in] | end | End of range to lock
[in] | lock | whether to lock (value=true) or unlock (false) destinations
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately

◆ gpiPoll()

void ccClient::gpiPoll | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | now = false
 | ) |  |

GPI Poll command Sends a poll request to the network. Reponses are returned asynchronously in a IccClientCallback::cccGpiRevertive() callback

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to poll
[in] | end | End of range to poll
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
See also
gpiQuery()

◆ gpiQuery()

void ccClient::gpiQuery | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | now = false
 | ) |  |

GPI Query command Sends a query request to the network. This command is functionally identical to a gpiPoll() command but implies that a session should be used as the transport for the data. Reponses are returned asynchronously in a IccClientCallback::cccGpiRevertive() callback

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to query
[in] | end | End of range to query
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
See also
gpiPoll()

◆ gpiSwitch()

void ccClient::gpiSwitch | ( | int | device,
 |  | int | index,
 |  | bool | state,
 |  | bool | now = false
 | ) |  |

GPI switch command Sends a GPI switch request to the network. This command is only sent if this class is enabled to do so see writeEnable() Reponse (if any) is returned asynchronously in a IccClientCallback::cccGpiRevertive() callback

Parameters
[in] | device | CC Device number
[in] | index | Destination number
[in] | state | On (true) or Off (false) state for the GPI
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately

◆ infoLock()

void ccClient::infoLock | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | lock,
 |  | bool | now = false
 | ) |  |

Info Lock command Sends a request to lock infodriver slots. This command is only sent if this class is enabled to do so see writeEnable()

Note
Use of this command is discouraged since it is not possible to remotely determine its state
Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to lock
[in] | end | End of range to lock
[in] | lock | whether to lock (value=true) or unlock (false) destinations
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately

◆ infoPoll()

void ccClient::infoPoll | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | now = false
 | ) |  |

Infodriver Poll command Sends a poll request to the network. Reponses are returned asynchronously in a IccClientCallback::cccInfoRevertive() callback

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to poll
[in] | end | End of range to poll
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
See also
infoQuery()

◆ infoQuery()

void ccClient::infoQuery | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | now = false
 | ) |  |

Info Query command Sends a query request to the network. This command is functionally identical to a infoPoll() command but implies that a session should be used as the transport for the data. Reponses are returned asynchronously in a IccClientCallback::cccInfoRevertive() callback

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to query
[in] | end | End of range to query
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
See also
infoPoll()

◆ infoWrite()

void ccClient::infoWrite | ( | int | device,
 |  | int | index,
 |  | const string & | value,
 |  | bool | now = false
 | ) |  |

Write infodriver value Reponse (if any) is returned asynchronously in a IccClientCallback::cccInfoRevertive() callback. This command is only sent if this class is enabled to do so see writeEnable()

Parameters
[in] | device | CC Device number
[in] | index | Slot number
[in] | value | New slot value
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
Note
This function is equivalent to the ApplCore IW command, but note the change in the order of the parameters

◆ isCacheEnabled()

bool ccClient::isCacheEnabled ( void )

Determine whether the local cache is enabled on this workstation

Returns
true on cache enabled, false on cache disabled

◆ isConnected()

bool ccClient::isConnected ( void )

Are we connected to CSI? This is also checks whether the handle we have for CSI is valid

Returns
true on connected, false on not connected

◆ isWriteEnabled()

bool ccClient::isWriteEnabled ( void )

Whether this class can make "writes" to the network.

See also
writeEnable()

◆ registerForConfigChangeMessage()

void ccClient::registerForConfigChangeMessage ( void )

Register for uni-notification of BBC_NETMSGUPDATE that allows callback cccDeviceMode to work. You do not need to explicitly enable this if the CSI setting DistributeBBC_NETMSGUPDATE is 1

◆ registerForNetMessage()

void ccClient::registerForNetMessage ( void )

Register for uni-notification of BBC_NETMSGUPDATE that allows callback cccDeviceMode to work. You do not need to explicitly enable this if the CSI setting DistributeBBC_NETMSGUPDATE is 1

◆ resetCounters()

void ccClient::resetCounters ( void )

Reset the counters back to zero This class maintains a count of sent and received messages

See also
counters()

◆ revertiveDeregister()

void ccClient::revertiveDeregister | ( | int | device,
 |  | int | start = 0,
 |  | int | end = 0
 | ) |  |

Remove a change of state notification registration If start/end are present the specified range is unregistered, otherwise the registration for device is completely removed for this client

Parameters
[in] | device | CC Device number
[in] | start | Lower index of registration range
[in] | end | Upper index of registration range
Note
This function is equivalent to the ApplCore RU, GU and IU commands

◆ revertiveDeregisterAll()

void ccClient::revertiveDeregisterAll ( void )

Remove all change of state notification registrations

Note
This function is equivalent to the ApplCore RU, GU and IU commands with a zero device parameter

◆ revertiveRegister()

void ccClient::revertiveRegister | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | overwrite = true,
 |  | int | iType = cc::IP
 | ) |  |

Register to receive change of state information from the specified device. Any registration with a device also enables notification of datbase change event.

Parameters
[in] | device | CC Device number
[in] | start | Lower index of registration range
[in] | end | Upper index of registration range
[in] | overwrite | Whether to replace any existing registrations or add this request
[in] | iType | The type of the expected revertive
Note
This function is equivalent to the ApplCore RR, GR and IR commands

◆ routerCrosspoint()

void ccClient::routerCrosspoint | ( | int | device,
 |  | int | index,
 |  | int | info,
 |  | const string & | mask = ",---",
 |  | bool | now = false
 | ) |  |

Router Crosspoint command Sends a crosspoint request to the network Reponse (if any) is returned asynchronously in a IccClientCallback::cccRtrRevertive() callback

Parameters
[in] | device | CC Device number
[in] | index | Destination number
[in] | info | Source number
[in] | mask | Optional mask - typically comma delimited list of router device numbers e.g. ",1,2,3,4"
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately

◆ routerFile()

void ccClient::routerFile ( int device )

Router File command Sends a request for remote router device to reload its configuration. There is no confirmation of success or acknowledgement for this command. This command is only sent if this class is enabled to do so see writeEnable()

Parameters
[in] device CC Device number

◆ routerLock()

void ccClient::routerLock | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | lock,
 |  | bool | now = false
 | ) |  |

Router Lock command Sends a request to lock destinations. This command is only sent if this class is enabled to do so see writeEnable()

Note
Use of this command is discouraged since it is not possible to remotely determine its state
Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to lock
[in] | end | End of range to lock
[in] | lock | whether to lock (value=true) or unlock (false) destinations
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately

◆ routerPoll()

void ccClient::routerPoll | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | now = false
 | ) |  |

Router Poll command Sends a poll request to the network. Reponses are returned asynchronously in a IccClientCallback::cccRtrRevertive() callback

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to poll
[in] | end | End of range to poll
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
See also
routerQuery()

◆ routerQuery()

void ccClient::routerQuery | ( | int | device,
 |  | int | start,
 |  | int | end,
 |  | bool | now = false
 | ) |  |

Router Query command Sends a query request to the network. This command is functionally identical to a routerPoll() command but implies that a session should be used as the transport for the data. Reponses are returned asynchronously in a IccClientCallback::cccRtrRevertive() callback

Parameters
[in] | device | CC Device number
[in] | start | Beginning of range to query
[in] | end | End of range to query
[in] | now | Whether to buffer up commands to send in a block, or send this command (and any others buffered) immediately
See also
routerPoll

◆ sendBufferedCommands()

void ccClient::sendBufferedCommands ( void )

Send commands held in temporary buffer (if there is any) By default commands are queued and held for up to 100ms - this command enables immediate flushing of that buffer

Note
This command requires CSI32 1.1.33 or later

◆ sendConfigChangeMessage()

void ccClient::sendConfigChangeMessage ( const string & msg )

Send a raw config change string to anyone that's listening for them

Parameters
[in] msg Message to send

◆ setCallback()

void ccClient::setCallback ( IccClientCallback * callback )

◆ setCloseHostOnExit()

void ccClient::setCloseHostOnExit ( bool close = false )

Force a close of the host device when this class is destroyed This is to ensure that the closure of a driver doesn't leave an active device on the network

Parameters
[in] close Set true to close host on destroying this class
Note
This class simply posts a WM_CLOSE notification to the infodriver

◆ version()

long ccClient::version ( void )

Simple function to ensure that we can tell what version this class is programatically

Returns
HIWORD( version()) returns major version number, LOWORD(version()) the minor revision number

◆ writeEnable()

void ccClient::writeEnable ( bool enable )

Sets whether this class can make "writes" to the network - i.e. issue commands that can make changes. Query/poll commands are not affected. By default writes are enabled.

Parameters
[in] enable Whether to enable write commands (true) or not (false)
See also
isWriteEnabled()
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccClient Member List

This is the complete list of members for ccClient, including all inherited members.

cacheEnable(bool) | ccClient |
cacheFlush(int device) | ccClient |
cacheIndex(int device, int start, int end, const string &value) | ccClient |
cacheTest(int device, int start, int end) | ccClient |
cacheValue(int device, int index, string &out, int *num=0) | ccClient |
ccCheck(const string &header="") | ccCheck |
ccClient(IccClientCallback *c=0, const string &debugStringHeader="ccClient") | ccClient |
checkDatabase(unsigned int db, unsigned int max=10) | ccCheck |
checkDbIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkDevice(unsigned int device) | ccCheck |
checkIndex(unsigned int index) | ccCheck |
checkIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkRange(unsigned int start, unsigned int end) | ccCheck |
checkSource(int index) | ccCheck |
checkString(const string &) | ccCheck |
checkString(const string &, unsigned int) | ccCheck |
checkV1Database(unsigned int db) | ccCheck |
checkWorkstation(unsigned int ws) | ccCheck |
connect(enum cc::ipcType ipc=cc::bbc, long ipcOptions=0) | ccClient |
counters(unsigned int &tx, unsigned int &rx) | ccClient |
databaseIndex(int device, int database, const string &name) | ccClient |
databaseModify(int device, int index, int database, const string &name, bool tallyDump=false, bool includeHandle=false) | ccClient |
databaseName(int device, int index, int database, string &out) | ccClient |
deregisterForConfigChangeMessage(void) | ccClient |
deregisterForNetMessage(void) | ccClient |
deviceMessage(int workstation, int device, const string &message, int reference) | ccClient |
deviceProfile(int driver, int &version, int &sources, int &dests, string &db=string()) | ccClient |
disconnect(void) | ccClient |
flushDatabaseCache(int device=0) | ccClient |
getClientRegistrationExtent(int device, int &min, int &max) | ccClient |
gpiFile(int device) | ccClient |
gpiLock(int device, int start, int end, bool lock, bool now=false) | ccClient |
gpiPoll(int device, int start, int end, bool now=false) | ccClient |
gpiQuery(int device, int start, int end, bool now=false) | ccClient |
gpiSwitch(int device, int index, bool state, bool now=false) | ccClient |
infoLock(int device, int start, int end, bool lock, bool now=false) | ccClient |
infoPoll(int device, int start, int end, bool now=false) | ccClient |
infoQuery(int device, int start, int end, bool now=false) | ccClient |
infoWrite(int device, int index, const string &value, bool now=false) | ccClient |
isCacheEnabled(void) | ccClient |
isConnected(void) | ccClient |
isWriteEnabled(void) | ccClient |
log(const string &log) | ccCheck |
registerForConfigChangeMessage(void) | ccClient |
registerForNetMessage(void) | ccClient |
resetCounters(void) | ccClient |
revertiveDeregister(int device, int start=0, int end=0) | ccClient |
revertiveDeregisterAll(void) | ccClient |
revertiveRegister(int device, int start, int end, bool overwrite=true, int iType=cc::IP) | ccClient |
routerCrosspoint(int device, int index, int info, const string &mask=",---", bool now=false) | ccClient |
routerFile(int device) | ccClient |
routerLock(int device, int start, int end, bool lock, bool now=false) | ccClient |
routerPoll(int device, int start, int end, bool now=false) | ccClient |
routerQuery(int device, int start, int end, bool now=false) | ccClient |
sendBufferedCommands(void) | ccClient |
sendConfigChangeMessage(const string &msg) | ccClient |
setCallback(IccClientCallback *callback) | ccClient |
setCloseHostOnExit(bool close=false) | ccClient |
setHeader(const string &header) | ccCheck |
version(void) | ccClient |
writeEnable(bool) | ccClient |
~ccCheck() | ccCheck | virtual
~ccClient() | ccClient | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccConfig Class Reference

ccConfig Class Reference

A BNCS Driver / Client Configuration Class. More...

#include <ccConfig.h>

Public Member Functions

ccConfig ()
ccConfig (const string &file, const string &section)
ccConfig (int device, const string &section)
virtual | ~ccConfig ()
string | getString (const string &key, const string &def, bool createOnDefault=false)
void | setString (const string &key, const string &value)
int | getInt (const string &key, int def, bool createOnDefault=false)

Static Public Member Functions

static void | readConfigSection (const string &file, const string &section, map< string, string > &out)
static void | readConfigSectionRoot (const string &file, const string &section, map< string, string > &out)
static void | readConfigSection (int device, const string &section, map< string, string > &out)
static void | deleteKeysFromSectionRoot (const string &file, const string &section, const string &key)
static void | writeConfigSection (const string &file, const string &section, const map< string, string > &out)
static void | writeConfigSectionRoot (const string &file, const string &section, const map< string, string > &out)
static void | writeConfigSection (int device, const string &section, const map< string, string > &out)
static string | getString (const string &file, const string &section, const string &key, const string &def, bool createOnDefault=false)
static string | getString (int device, const string &section, const string &key, const string &def, bool createOnDefault)
static void | setString (const string &file, const string &section, const string &key, const string &value)
static void | setString (int device, const string &section, const string &key, const string &value)
static int | getInt (const string &file, const string &section, const string &key, int def, bool createOnDefault=false)
static int | getInt (int device, const string &section, const string &key, int def, bool createOnDefault=false)
static string | getDevPath (void)
static string | getSystem (void)
static string | getDevPath (int device)
static string | getDevPath (const string &filename)
static bool | isV4Based (void)
static bool | isV3Based (void)
static int | workstation (void)
static void | sectionsAbs (const string &absFilename, list< string > &out)
static void | sections (const string &file, list< string > &out)
static void | sectionsRoot (const string &file, list< string > &out)
static void | sections (int device, list< string > &out)
static void | deleteSectionRoot (const string &file, const string &section)
static bool | developerMode (void)
static string | getLogPath (const string &dir, const string &file)

Detailed Description

A BNCS Driver / Client Configuration Class.

This is a convenience class for loading configuration information.

Note
Please take care with paths - some are config root, some config/system

Constructor & Destructor Documentation

◆ ccConfig() [1/3]

ccConfig::ccConfig ( )

Default constructor - not really very useful.....

◆ ccConfig() [2/3]

ccConfig::ccConfig | ( | const string & | file,
 |  | const string & | section
 | ) |  |

Load a single section of configuration file. The file is parsed once on load and is very efficient for reading subsequent entries.

Parameters
[in] file Filename to retrieve string from see note below on paths
[in] section The section to load
ccConfig c( "myFile.ini", "Settings" );
int iPort = c.getInt( "Port" );
Note
File path is the root of the config directory (for V4 based this is config NOT config/system where dev_xxx.ini files are)

◆ ccConfig() [3/3]

ccConfig::ccConfig | ( | int | device,
 |  | const string & | section
 | ) |  |

Load a single section of configuration file. The file is parsed once on load and is very efficient for reading subsequent entries.

Parameters
[in] device Device number used to take configuraiton from (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[in] section The section to load
ccConfig c( 123, "Settings" ); // loads from dev_123.ini
int iPort = c.getInt( "Port" );
Note
Path is taken from the environnment detected see getDevPath - typically this means where the dev_xxx.ini files are

◆ ~ccConfig()

ccConfig::~ccConfig ( )
virtual

Default destructor - not really very useful.....

Member Function Documentation

◆ deleteKeysFromSectionRoot()

void ccConfig::deleteKeysFromSectionRoot | ( | const string & | file,
 |  | const string & | section,
 |  | const string & | key
 | ) |  |
static

◆ deleteSectionRoot()

void ccConfig::deleteSectionRoot | ( | const string & | file,
 |  | const string & | section
 | ) |  |
static

◆ developerMode()

bool ccConfig::developerMode ( void )
static

◆ getDevPath() [1/3]

string ccConfig::getDevPath ( void )
static

Get configuration path

Returns
Path to the configuration directory of the current system "Current System" is defined as V4 if the environment variables CC_ROOT and CC_SYSTEM are defined V3 if a ConfigPath is set in "c:\bncs_config.ini" V2 otherwise (which is the Windows directory).

◆ getDevPath() [2/3]

string ccConfig::getDevPath ( int device )
static

Return filename formatted for the given device number in the current environment

Parameters
[in] device The device number to use
Returns
Path and filename formatted
string fnamev2 = getDevPath( 123 ); // for V2 "fname" typically contains c:\windows\dev_123.ini
string fnamev4 = getDevPath( 123 ); // for V4 "fname" typically contains %CC_ROOT%\%CC_SYSTEM%\config\system\dev_123.ini

◆ getDevPath() [3/3]

string ccConfig::getDevPath ( const string & filename )
static

Return filename formatted for the given filename in the current environment

Parameters
[in] filename Filename to use
Returns
Path and filename formatted
string fnamev2 = getDevPath( "myFile.ini" ); // for V2 "fname" typically contains c:\windows\myFile.ini
string fnamev4 = getDevPath( "myFile.ini" ); // for V4 "fname" typically contains %CC_ROOT%\%CC_SYSTEM%\config\myFile.ini

◆ getInt() [1/3]

int ccConfig::getInt | ( | const string & | file,
 |  | const string & | section,
 |  | const string & | key,
 |  | int | def,
 |  | bool | createOnDefault = false
 | ) |  |
static

Get integer configuration value from Windows ini file

Parameters
[in] | file | Filename to retrieve string from - see note below on paths
[in] | section | Section within the file
[in] | key
[in] | def | Default parameter
[in] | createOnDefault | If the value is at default the write the ini file section
Returns
Integer value for given key or default value if that key does not exist
Note
Path is taken from the config directory (not the config/system directory on V4)

◆ getInt() [2/3]

int ccConfig::getInt | ( | int | device,
 |  | const string & | section,
 |  | const string & | key,
 |  | int | def,
 |  | bool | createOnDefault = false
 | ) |  |
static

Get integer configuration value from device configuration file

Parameters
[in] | device | Device number used to take configuraiton from (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[in] | section | Section within the file
[in] | key
[in] | def | Default parameter
[in] | createOnDefault | If the value is at default the write the ini file section
Returns
Integer value for given key or default value if that key does not exist
Note
Path is taken from the environnment detected see getDevPath - where the dev_xxx.ini files are

◆ getInt() [3/3]

int ccConfig::getInt | ( | const string & | key,
 |  | int | def,
 |  | bool | createOnDefault = false
 | ) |  |

Get integer configuration value from configuration section loaded from the constructor parameters

Parameters
[in] | key
[in] | def | Default parameter
[in] | createOnDefault | If the value is at default the write the ini file section
Returns
Integer value for given key or default value if that key does not exist

◆ getLogPath()

string ccConfig::getLogPath | ( | const string & | dir,
 |  | const string & | file
 | ) |  |
static

◆ getString() [1/3]

string ccConfig::getString | ( | const string & | file,
 |  | const string & | section,
 |  | const string & | key,
 |  | const string & | def,
 |  | bool | createOnDefault = false
 | ) |  |
static

Get string configuration value from Windows ini file

Parameters
[in] | file | Filename to retrieve string from - see note below on paths
[in] | section | Section within the file
[in] | key
[in] | def | Default parameter
[in] | createOnDefault | If the value is at default the write the ini file section
Returns
String value for given key or default value if that key does not exist Ini file typical format:
[Section]
Key=Value
Note
Path is taken from the config directory (not the config/system directory on V4)

◆ getString() [2/3]

string ccConfig::getString | ( | int | device,
 |  | const string & | section,
 |  | const string & | key,
 |  | const string & | def,
 |  | bool | createOnDefault
 | ) |  |
static

Get string configuration value from device configuration file

Parameters
[in] | device | Device number used to take configuraiton from (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[in] | section | Section within the file
[in] | key
[in] | def | Default parameter
[in] | createOnDefault | If the value is at default the write the ini file section
Returns
String value for given key or default value if that key does not exist Ini file typical format:
[Section]
Key=Value
Note
Path is taken from the environnment detected see getDevPath

◆ getString() [3/3]

string ccConfig::getString | ( | const string & | key,
 |  | const string & | def,
 |  | bool | createOnDefault = false
 | ) |  |

Get string configuration value from configuration section loaded from the constructor parameters

Parameters
[in] | key
[in] | def | Default parameter
[in] | createOnDefault | If the value is at default the write the ini file section
Returns
String value for given key or default value if that key does not exist Ini file typical format:
[Section]
Key=Value

◆ getSystem()

string ccConfig::getSystem ( void )
static

Return path to root of installation formatted for the current environment

Returns
Path formatted
string fname = getSystem(); // for V2 returns nothing, for V4 returns c:\bncs\drivers

◆ isV3Based()

bool ccConfig::isV3Based ( void )
static

Determine whether we're in a V3 environment

Returns
true on finding setting for V3 configuration path in "c:\bncs_config.ini"
[Config]
ConfigPath=C:\WINDOWS
SystemPath=C:\WINDOWS

◆ isV4Based()

bool ccConfig::isV4Based ( void )
static

Determine whether we're in a V4 environment

Returns
true on finding V4 environment variables CC_ROOT and CC_SYSTEM are set

◆ readConfigSection() [1/2]

void ccConfig::readConfigSection | ( | const string & | file,
 |  | const string & | section,
 |  | map< string, string > & | out
 | ) |  |
static

Get whole configuration section from device configuration file

Parameters
[in] | file | Filename to retrieve string from - see note below on paths
[in] | section | Section within the file
[out]

◆ readConfigSection() [2/2]

void ccConfig::readConfigSection | ( | int | device,
 |  | const string & | section,
 |  | map< string, string > & | out
 | ) |  |
static

Get whole configuration section from device configuration file

Parameters
[in] | device | Device number used to take configuraiton from (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[in] | section | Section within the file
[out]

◆ readConfigSectionRoot()

void ccConfig::readConfigSectionRoot | ( | const string & | file,
 |  | const string & | section,
 |  | map< string, string > & | out
 | ) |  |
static

Get whole configuration section from configuration file in root of configuration directory

Parameters
[in] | file | Filename to retrieve string from - see note below on paths
[in] | section | Section within the file
[out]

◆ sections() [1/2]

void ccConfig::sections | ( | const string & | file,
 |  | list< string > & | out
 | ) |  |
static

Get a list of the sections from named configuration file

Parameters
[in] file Filename to retrieve string from - see note below on paths
[out]

◆ sections() [2/2]

void ccConfig::sections | ( | int | device,
 |  | list< string > & | out
 | ) |  |
static

Get a list of the sections from device configuration file

Parameters
[in] device Device number used to take configuraiton from (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[out]

◆ sectionsAbs()

void ccConfig::sectionsAbs | ( | const string & | absFilename,
 |  | list< string > & | out
 | ) |  |
static

◆ sectionsRoot()

void ccConfig::sectionsRoot | ( | const string & | file,
 |  | list< string > & | out
 | ) |  |
static

Get a list of the sections from named configuration file

Parameters
[in] file Filename to retrieve string from - see note below on paths
[out]

◆ setString() [1/3]

void ccConfig::setString | ( | const string & | file,
 |  | const string & | section,
 |  | const string & | key,
 |  | const string & | value
 | ) |  |
static

Set string configuration value from Windows ini file

Parameters
[in] | file | Filename to set string - see note below on paths
[in] | section | Section within the file
[in] | key
[in] | value
Returns
String value for given key or default value if that key does not exist Ini file typical format:
[Section]
Key=Value
Note
Path is taken from the config directory (not the config/system directory on V4)

◆ setString() [2/3]

void ccConfig::setString | ( | int | device,
 |  | const string & | section,
 |  | const string & | key,
 |  | const string & | value
 | ) |  |
static

Set string configuration value from device configuration file

Parameters
[in] | device | Device number used to take configuraiton from (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[in] | section | Section within the file
[in] | key
[in] value Ini file typical format:
[Section]
Key=Value
Note
Path is taken from the environnment detected see getDevPath

◆ setString() [3/3]

void ccConfig::setString | ( | const string & | key,
 |  | const string & | value
 | ) |  |

Set string configuration value in configuration section loaded from the constructor parameters

Parameters
[in] | key
[in] | value
Returns
String value for given key or default value if that key does not exist Ini file typical format:
[Section]
Key=Value

◆ workstation()

int ccConfig::workstation ( void )
static

Get workstation number Workstation number is a special case - this can come either from file (in more locations than one.....) or from environment variables For a V4 system the workstation number comes from the environment variable CC_WORKSTATION For a V2 or V3 system the workstation number is taken from "csi.ini" in the path specified by getDevPath()

Returns
workstation number

◆ writeConfigSection() [1/2]

void ccConfig::writeConfigSection | ( | const string & | file,
 |  | const string & | section,
 |  | const map< string, string > & | in
 | ) |  |
static

Write a whole configuration section to device configuration file

Parameters
[in] | file | Filename to retrieve string from - see note below on paths
[in] | section | Section within the file
[in] in map containing key/value pairs Ini file typical format would result in a map filled with a single entry of key "Key" and value "Value".
[Section]
Key=Value
Note
Path is taken from the environnment detected see getDevPath and is CC_ROOT%%CC_SYSTEM% for V4-based systems

◆ writeConfigSection() [2/2]

void ccConfig::writeConfigSection | ( | int | device,
 |  | const string & | section,
 |  | const map< string, string > & | in
 | ) |  |
static

Write a whole configuration section from device configuration file

Parameters
[in] | device | Device number used to write configuraiton to (e.g. for device 101 filename used is dev_101.ini) - see note below on paths
[in] | section | Section within the file
[in] in map containing key/value pairs Ini file typical format would result in a map filled with a single entry of key "Key" and value "Value".
[Section]
Key=Value
Note
Path is taken from the environnment detected see getDevPath and is CC_ROOT%%CC_SYSTEM% for V4-based systems

◆ writeConfigSectionRoot()

void ccConfig::writeConfigSectionRoot | ( | const string & | file,
 |  | const string & | section,
 |  | const map< string, string > & | in
 | ) |  |
static

Write a whole configuration section to device configuration file

Parameters
[in] | file | Filename to retrieve string from - see note below on paths
[in] | section | Section within the file
[in] in map containing key/value pairs Ini file typical format would result in a map filled with a single entry of key "Key" and value "Value".
[Section]
Key=Value
Note
Path is taken from the environnment detected see getDevPath - typically CC_ROOT%%CC_SYSTEM% on V4-based systems
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccConfig Member List

This is the complete list of members for ccConfig, including all inherited members.

ccConfig() | ccConfig |
ccConfig(const string &file, const string &section) | ccConfig |
ccConfig(int device, const string &section) | ccConfig |
deleteKeysFromSectionRoot(const string &file, const string &section, const string &key) | ccConfig | static
deleteSectionRoot(const string &file, const string &section) | ccConfig | static
developerMode(void) | ccConfig | static
getDevPath(void) | ccConfig | static
getDevPath(int device) | ccConfig | static
getDevPath(const string &filename) | ccConfig | static
getInt(const string &file, const string &section, const string &key, int def, bool createOnDefault=false) | ccConfig | static
getInt(int device, const string &section, const string &key, int def, bool createOnDefault=false) | ccConfig | static
getInt(const string &key, int def, bool createOnDefault=false) | ccConfig |
getLogPath(const string &dir, const string &file) | ccConfig | static
getString(const string &file, const string &section, const string &key, const string &def, bool createOnDefault=false) | ccConfig | static
getString(int device, const string &section, const string &key, const string &def, bool createOnDefault) | ccConfig | static
getString(const string &key, const string &def, bool createOnDefault=false) | ccConfig |
getSystem(void) | ccConfig | static
isV3Based(void) | ccConfig | static
isV4Based(void) | ccConfig | static
readConfigSection(const string &file, const string &section, map< string, string > &out) | ccConfig | static
readConfigSection(int device, const string &section, map< string, string > &out) | ccConfig | static
readConfigSectionRoot(const string &file, const string &section, map< string, string > &out) | ccConfig | static
sections(const string &file, list< string > &out) | ccConfig | static
sections(int device, list< string > &out) | ccConfig | static
sectionsAbs(const string &absFilename, list< string > &out) | ccConfig | static
sectionsRoot(const string &file, list< string > &out) | ccConfig | static
setString(const string &file, const string &section, const string &key, const string &value) | ccConfig | static
setString(int device, const string &section, const string &key, const string &value) | ccConfig | static
setString(const string &key, const string &value) | ccConfig |
workstation(void) | ccConfig | static
writeConfigSection(const string &file, const string &section, const map< string, string > &out) | ccConfig | static
writeConfigSection(int device, const string &section, const map< string, string > &out) | ccConfig | static
writeConfigSectionRoot(const string &file, const string &section, const map< string, string > &out) | ccConfig | static
~ccConfig() | ccConfig | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccDriver Class Reference

ccDriver Class Reference

A BNCS Driver class. More...

#include <ccDriver.h>

Inheritance diagram for ccDriver:
ccCheck

Public Member Functions

ccDriver (IccDriverCallback *callback=0, const string &debugStringHeader="ccDriver")
virtual | ~ccDriver ()
long | version (void)
bool | connect (int device, enum cc::ipcType ipc=cc::bbc, long ipcOptions=0)
bool | disconnect ()
bool | isConnected (void)
int | device (void)
void | clientMessage (int workstation, int device, const string &message, const string &client, const string &reference)
void | setRedundancyState (enum cc::redundancyState state, bool force=false)
void | setDriverState (enum cc::driverState state, bool forceNow=false)
enum cc::redundancyState | redundancyState (void)
unsigned int | setRedundancyMaster (unsigned int masterDevice)
bool | counters (unsigned int &tx, unsigned int &rx)
void | resetCounters (void)
void | sendBufferedRevertives (void)
void | sendPollResponse (int workstation, const char *data, bool sendNow=false)
void | sendQueryResponse (int workstation, const char *data, bool sendNow)
bool | databaseModify (int device, int index, int database, const string &name, bool tallyDump)
bool | routerDatabase (int device, int index, int database, const string &name)
bool | setType (char type)
char | type (void)
- Public Member Functions inherited from ccCheck
ccCheck (const string &header="")
virtual | ~ccCheck ()
void | setHeader (const string &header)
bool | checkDevice (unsigned int device)
bool | checkIndex (unsigned int index)
bool | checkSource (int index)
bool | checkRange (unsigned int start, unsigned int end)
bool | checkIndexRange (unsigned int start, unsigned int end)
bool | checkDbIndexRange (unsigned int start, unsigned int end)
bool | checkDatabase (unsigned int db, unsigned int max=10)
bool | checkV1Database (unsigned int db)
bool | checkString (const string &)
bool | checkString (const string &, unsigned int)
bool | checkWorkstation (unsigned int ws)
void | log (const string &log)

Detailed Description

A BNCS Driver class.

This is a class that low-level driver functionality for BNCS drivers.

Usage Example
class myDriver: public IccDriverCallback
{
public:
myDriver( int device )
{
m_driver = new ccDriver( this );
m_driver->connect( 101 );
};
virtual ~myDriver() { delete m_driver; };
protected:
// reimplement those functions we need to (declared in IccDriverCallback)
void ccdCommand(ccDriver *, const char * msg)
{
debug( "command %s" msg );
};
private:
ccDriver *m_driver;
}

Redudndancy. Multiple device sof the same identity can run on a BNCS network. There is a simple mechanism to enable automatic changeover in case of failure which takes a previously passive device on the network and enable it to take over.

Modes There are a couple of distinct modes that redundancy can run in. Most of the time either of two (or more) drivers can run with any one of them able to provide the service to the network. This is cc::multipleControllerCapable mode. Occasionally however there are devices, such as serially controlled devices, where there is only a single control port that cannot be shared. this is cc::singleControllerCapable mode. In this case only one instance of the driver can be active on the network at one time - importantly in this mode if a driver detects it has active comms it will aggresively try and force itself onto the network since no other driver can have communications with the controlled device.

Constructor & Destructor Documentation

◆ ccDriver()

ccDriver::ccDriver | ( | IccDriverCallback * | callback = 0,
 |  | const string & | debugStringHeader = "ccDriver"
 | ) |  |

Construct a BNCS generic driver interface class and tell it where to send notifications too (i.e. pass it an interface to the class to callback). If the callback is not specified this class will be able to get slots but be unable to receive asynchronous notifications of change of state etc.

Parameters
[in] | callback | pointer to the class that implements the IccDriverCallback class
[in] | debugStringHeader | The member functions of this class generate debug messages for out of range values to which this string is prepended. A message such as "Error: Device=0" message in itself is not useful without some context!

◆ ~ccDriver()

ccDriver::~ccDriver ( )
virtual

Member Function Documentation

◆ clientMessage()

void ccDriver::clientMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | const string & | client,
 |  | const string & | reference
 | ) |  |

Send a response to a ccdClientMessage

Parameters
[in] | workstation | The client that requested this message
[in] | device | The CC device number
[in] | message | The message to be sent
[in] | client | The client identifier (simply passed on from the client notification)
[in] | reference | The client reference (simply passed on from the client notification)

Typical usage follows.....

virtual void myApp::ccdClientMessage( int ws, int dev, const string & msg, const string & client, const string & ref )
{
string myMsg;
// do something interesting here to answer the message sent to us in "message"
// and send the reply back to the client that sent it (i.e. keep the parameters we're passed intact)
clientMessage( ws, dev, myMsg, client, ref);
}
Note
Implementation of this messaging mechanism is patchy so beware....

◆ connect()

bool ccDriver::connect | ( | int | device,
 |  | enum cc::ipcType | ipc = cc::bbc,
 |  | long | ipcOptions = 0
 | ) |  |

Connect to CSI as the specified device number using the specified IPC mechanism

Parameters
[in] | ipc | IPC type as defined in the cc::ipcType enumeration
[in] | ipcOptions | values relevant to the ipc type chosen (none are defined at the time of writing)
Returns
true on error, false on success

◆ counters()

bool ccDriver::counters | ( | unsigned int & | tx,
 |  | unsigned int & | rx
 | ) |  |

Return current state of counters. This class maintains counts of received and sent messages which may be retrieved using this function

Parameters
tx | Refernce to the integer to pass the value back in
tx | Refernce to the integer to pass the value back in
Returns
true if the counters have changed since the last time this function was called. This can be used to determine whether its worth writing these values to the display
See also
resetCounters()

◆ databaseModify()

bool ccDriver::databaseModify | ( | int | device,
 |  | int | index,
 |  | int | database,
 |  | const string & | name,
 |  | bool | tallyDump
 | ) |  |

Send a database modify command. This updates the local copy of the databases on any workstation that receives it and should result in a IccClientCallback::cccDatabaseChange() callback notification to this client if it has any registration with that device. This command is only sent if this class is enabled to do so see writeEnable()

Parameters
[in] | device | The device number to use
[in] | index | The index within that devices databases
[in] | database | The database number to use
[in] | name | The new name to set
[in] | tallyDump | A request of the remote device to send a complete tally dump to the network - this has the (rather brute force) effect of updating names on panels

◆ device()

int ccDriver::device ( void )

◆ disconnect()

bool ccDriver::disconnect ( void )

Disconnect from CSI. This calls our ccdDisconnected event if we successfully disconnected

Returns
false on successful disconnection or false on there being no connection to disconnect.

◆ isConnected()

bool ccDriver::isConnected ( void )

Are we connected to csi as a device? This is also checks whether the handle we have for it is valid

Returns
true on connected, false on not connected

◆ redundancyState()

enum cc::redundancyState ccDriver::redundancyState ( void )

Return the current redundancy state

Returns
Redundancy state

◆ resetCounters()

void ccDriver::resetCounters ( void )

Reset the counters back to zero This class maintains a count of sent and received messages

See also
counters()

◆ routerDatabase()

bool ccDriver::routerDatabase | ( | int | device,
 |  | int | index,
 |  | int | database,
 |  | const string & | name
 | ) |  |

◆ sendBufferedRevertives()

void ccDriver::sendBufferedRevertives ( void )

Ask CSI to send all buffered revertives

◆ sendPollResponse()

void ccDriver::sendPollResponse | ( | int | workstation,
 |  | const char * | data,
 |  | bool | sendNow = false
 | ) |  |

◆ sendQueryResponse()

void ccDriver::sendQueryResponse | ( | int | workstation,
 |  | const char * | data,
 |  | bool | sendNow
 | ) |  |

◆ setDriverState()

void ccDriver::setDriverState | ( | enum cc::driverState | state,
 |  | bool | fNow = false
 | ) |  |

Set the current driver state

Parameters
[in] | state | The current overall status of the driver as single, simple ok or fail
[i] | fNow Whether this change in state should trigger and immediate event or just let the normal redundancy switching take care of it

◆ setRedundancyMaster()

unsigned int ccDriver::setRedundancyMaster ( unsigned int masterDevice )

◆ setRedundancyState()

void ccDriver::setRedundancyState | ( | enum cc::redundancyState | state,
 |  | bool | force = false
 | ) |  |

Force the TXRX status of this driver

Parameters
[in] mode Either tx or rx

Typical usage follows.....

setRedundancyState( cc:rx ); // I'm broken - allow to go RX only
...
setRedundancyState( cc:tx ); // I'm working - force myself TX/RX

◆ setType()

bool ccDriver::setType ( char type )

◆ type()

char ccDriver::type ( void )

◆ version()

long ccDriver::version ( void )

Simple function to ensure that we can tell what version this class is programatically

Returns
HIWORD( version()) returns major version number, LOWORD(version()) the minor revision number
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccDriver Member List

This is the complete list of members for ccDriver, including all inherited members.

ccCheck(const string &header="") | ccCheck |
ccDriver(IccDriverCallback *callback=0, const string &debugStringHeader="ccDriver") | ccDriver |
checkDatabase(unsigned int db, unsigned int max=10) | ccCheck |
checkDbIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkDevice(unsigned int device) | ccCheck |
checkIndex(unsigned int index) | ccCheck |
checkIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkRange(unsigned int start, unsigned int end) | ccCheck |
checkSource(int index) | ccCheck |
checkString(const string &) | ccCheck |
checkString(const string &, unsigned int) | ccCheck |
checkV1Database(unsigned int db) | ccCheck |
checkWorkstation(unsigned int ws) | ccCheck |
clientMessage(int workstation, int device, const string &message, const string &client, const string &reference) | ccDriver |
connect(int device, enum cc::ipcType ipc=cc::bbc, long ipcOptions=0) | ccDriver |
counters(unsigned int &tx, unsigned int &rx) | ccDriver |
databaseModify(int device, int index, int database, const string &name, bool tallyDump) | ccDriver |
device(void) | ccDriver |
disconnect() | ccDriver |
isConnected(void) | ccDriver |
log(const string &log) | ccCheck |
redundancyState(void) | ccDriver |
resetCounters(void) | ccDriver |
routerDatabase(int device, int index, int database, const string &name) | ccDriver |
sendBufferedRevertives(void) | ccDriver |
sendPollResponse(int workstation, const char *data, bool sendNow=false) | ccDriver |
sendQueryResponse(int workstation, const char *data, bool sendNow) | ccDriver |
setDriverState(enum cc::driverState state, bool forceNow=false) | ccDriver |
setHeader(const string &header) | ccCheck |
setRedundancyMaster(unsigned int masterDevice) | ccDriver |
setRedundancyState(enum cc::redundancyState state, bool force=false) | ccDriver |
setType(char type) | ccDriver |
type(void) | ccDriver |
version(void) | ccDriver |
~ccCheck() | ccCheck | virtual
~ccDriver() | ccDriver | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccDriverPost Class Reference

ccDriverPost Class Reference

#include <ccDriver.h>

Public Member Functions

ccDriverPost (int type, int slot, const string &contents)

Public Attributes

int | m_type
int | m_slot
string | m_contents

Constructor & Destructor Documentation

◆ ccDriverPost()

ccDriverPost::ccDriverPost | ( | int | type,
 |  | int | slot,
 |  | const string & | contents
 | ) |  |
inline

Member Data Documentation

◆ m_contents

string ccDriverPost::m_contents

◆ m_slot

int ccDriverPost::m_slot

◆ m_type

int ccDriverPost::m_type
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccDriverPost Member List

This is the complete list of members for ccDriverPost, including all inherited members.

ccDriverPost(int type, int slot, const string &contents) | ccDriverPost | inline
m_contents | ccDriverPost |
m_slot | ccDriverPost |
m_type | ccDriverPost |
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccGrd Class Reference

ccGrd Class Reference

A BNCS GRD class. More...

#include <ccGrd.h>

Inheritance diagram for ccGrd:
ccCheck

Public Member Functions

ccGrd (IccGrdCallback *callback, const string &debugHeader="ccGrd")
virtual | ~ccGrd ()
void | setTally (int dest, int source, bool send=true)
bool | updateTally (int dest, int source)
bool | connect (int device)
bool | disconnect (void)
bool | isConnected (void)
int | tally (int dest)
int | size (int database)
void | setRedundancyState (enum cc::redundancyState state)
void | setDriverState (enum cc::driverState state, bool forceNow=false)
enum cc::redundancyState | redundancyState (void)
int | setRedundancyMaster (int device)
void | clientMessage (int workstation, int device, const string &message, const string &client, const string &reference)
void | setCloseHostOnExit (bool close=false)
bool | counters (unsigned int &tx, unsigned int &rx)
void | resetCounters (void)
void | loadIndexMapping (void)

Detailed Description

A BNCS GRD class.

This is a class that provides full GRD functionality for BNCS drivers.

Usage Example
class myDriver: public IccGrdCallback
{
public:
myDriver( int device )
{
m_grd = new ccGrd( this );
m_grd->connect( 101 );
};
virtual ~myDriver() { delete m_grd; };
protected:
// reimplement those functions we need to (declared in IccGrdCallback)
void ccgCrosspointRequest( int device, int dest, int source );
{
debug( "slot request. Device %d, dest %d source %d", device, dest, source );
};
private:
ccGrd *m_grd;
}

Constructor & Destructor Documentation

◆ ccGrd()

ccGrd::ccGrd | ( | IccGrdCallback * | callback,
 |  | const string & | debugHeader = "ccGrd"
 | ) |  |

Construct a BNCS GRD class and tell it where to send notifications too (i.e. pass it an interface to the class to callback). If the callback is not specified this class will be able to get slots but be unable to receive asynchronous notifications of change of state etc.

Parameters
[in] | callback | pointer to the class that implements the IccGrdCallback class
[in] | debugStringHeader | The member functions of this class generate debug messages for out of range values to which this string is prepended. A message such as "Error: Device=0" message in itself is not useful without some context!

◆ ~ccGrd()

ccGrd::~ccGrd ( )
virtual

Member Function Documentation

◆ clientMessage()

void ccGrd::clientMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | const string & | client,
 |  | const string & | reference
 | ) |  |

Send a response to a ccgClientMessage

Parameters
[in] | workstation | The client that requested this message
[in] | device | The CC device number
[in] | message | The message to be sent
[in] | client | The client identifier (simply passed on from the client notification)
[in] | reference | The client reference (simply passed on from the client notification)

Typical usage follows.....

virtual void myApp::ccgClientMessage( int ws, int dev, const string & msg, const string & client, const string & ref )
{
string myMsg;
// do something interesting here to answer the message sent to us in "message"
// and send the reply back to the client that sent it (i.e. keep the parameters we're passed intact)
clientMessage( ws, dev, myMsg, client, ref);
}
Note
Implementation of this messaging mechanism is patchy so beware....

◆ connect()

bool ccGrd::connect ( int device )

Connect to the specified GRD

Any existing connection is first disconnected

Parameters
[in] device The device number to attempt to connect to
Returns
true on failure to connect

◆ counters()

bool ccGrd::counters | ( | unsigned int & | tx,
 |  | unsigned int & | rx
 | ) |  |

Return current state of counters. This class maintains counts of received and sent messages which may be retrieved using this function

Parameters
tx | Refernce to the integer to pass the value back in
tx | Refernce to the integer to pass the value back in
Returns
true if the counters have changed since the last time this function was called. This can be used to determine whether its worth writing these values to the display
See also
resetCounters()

◆ disconnect()

bool ccGrd::disconnect ( void )

Disconnect from the current GRD

Returns
true on failure to disconnect or not currently connected

◆ isConnected()

bool ccGrd::isConnected ( void )

Are we connected to a GRD?

Returns
true on connected to GRD
Note
this function checks both validity of handle value and whether this handle exists

◆ loadIndexMapping()

void ccGrd::loadIndexMapping ( void )

◆ redundancyState()

enum cc::redundancyState ccGrd::redundancyState ( void )

◆ resetCounters()

void ccGrd::resetCounters ( void )

Reset the counters back to zero This class maintains a count of sent and received messages

See also
counters()

◆ setCloseHostOnExit()

void ccGrd::setCloseHostOnExit ( bool close = false )

Force a close of the host device when this class is destroyed This is to ensure that the closure of a driver doesn't leave an active device on the network

Parameters
[in] close Set true to close host on destroying this class
Note
This class simply posts a WM_CLOSE notification to the infodriver

◆ setDriverState()

void ccGrd::setDriverState | ( | enum cc::driverState | state,
 |  | bool | forceNow = false
 | ) |  |

◆ setRedundancyMaster()

int ccGrd::setRedundancyMaster ( int device )

Ask the GRD to ask CSI to set the redundancy master for this device to the given master

Parameters
device Master device number
Returns
master device on success, -1 on failure
Note
This feature requires GRD32 version 1.0.20 or later

◆ setRedundancyState()

void ccGrd::setRedundancyState ( enum cc::redundancyState state )

Force the TXRX status of this driver

Parameters
[in] mode Either tx or rx

Typical usage follows.....

setRedundancyState( cc:rx ); // I'm broken - allow to go RX only
...
setRedundancyState( cc:tx ); // I'm working - force myself TX/RX

◆ setTally()

void ccGrd::setTally | ( | int | dest,
 |  | int | source,
 |  | bool | send = true
 | ) |  |

Set the source for the given destination

Parameters
[in] | dest | The dest to set
[in] | source | The source to set it to

◆ size()

int ccGrd::size ( int database )

◆ tally()

int ccGrd::tally ( int dest )

Return the current source for the given dest

Parameters
dest The destination number whose tally is required
Returns
the current source or -1 if that tally is not set

◆ updateTally()

bool ccGrd::updateTally | ( | int | dest,
 |  | int | source
 | ) |  |

Set the source for the given dest but only if different to the current state

Parameters
[in] | dest | The dest to set
[in] | source | The source to set it to If the source supplied is the same value as the current tally then nothing is sent to the network
See also
setTally
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccGrd Member List

This is the complete list of members for ccGrd, including all inherited members.

ccCheck(const string &header="") | ccCheck | private
ccGrd(IccGrdCallback *callback, const string &debugHeader="ccGrd") | ccGrd |
checkDatabase(unsigned int db, unsigned int max=10) | ccCheck | private
checkDbIndexRange(unsigned int start, unsigned int end) | ccCheck | private
checkDevice(unsigned int device) | ccCheck | private
checkIndex(unsigned int index) | ccCheck | private
checkIndexRange(unsigned int start, unsigned int end) | ccCheck | private
checkRange(unsigned int start, unsigned int end) | ccCheck | private
checkSource(int index) | ccCheck | private
checkString(const string &) | ccCheck | private
checkString(const string &, unsigned int) | ccCheck | private
checkV1Database(unsigned int db) | ccCheck | private
checkWorkstation(unsigned int ws) | ccCheck | private
clientMessage(int workstation, int device, const string &message, const string &client, const string &reference) | ccGrd |
connect(int device) | ccGrd |
counters(unsigned int &tx, unsigned int &rx) | ccGrd |
disconnect(void) | ccGrd |
isConnected(void) | ccGrd |
loadIndexMapping(void) | ccGrd |
log(const string &log) | ccCheck | private
redundancyState(void) | ccGrd |
resetCounters(void) | ccGrd |
setCloseHostOnExit(bool close=false) | ccGrd |
setDriverState(enum cc::driverState state, bool forceNow=false) | ccGrd |
setHeader(const string &header) | ccCheck | private
setRedundancyMaster(int device) | ccGrd |
setRedundancyState(enum cc::redundancyState state) | ccGrd |
setTally(int dest, int source, bool send=true) | ccGrd |
size(int database) | ccGrd |
tally(int dest) | ccGrd |
updateTally(int dest, int source) | ccGrd |
~ccCheck() | ccCheck | privatevirtual
~ccGrd() | ccGrd | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccGrdPost Class Reference

ccGrdPost Class Reference

#include <ccGrd.h>

Public Member Functions

ccGrdPost (int type, int index, int info, const string &str)

Public Attributes

int | m_type
int | m_index
int | m_info
string | m_str

Constructor & Destructor Documentation

◆ ccGrdPost()

ccGrdPost::ccGrdPost | ( | int | type,
 |  | int | index,
 |  | int | info,
 |  | const string & | str
 | ) |  |
inline

Member Data Documentation

◆ m_index

int ccGrdPost::m_index

◆ m_info

int ccGrdPost::m_info

◆ m_str

string ccGrdPost::m_str

◆ m_type

int ccGrdPost::m_type
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccGrdPost Member List

This is the complete list of members for ccGrdPost, including all inherited members.

ccGrdPost(int type, int index, int info, const string &str) | ccGrdPost | inline
m_index | ccGrdPost |
m_info | ccGrdPost |
m_str | ccGrdPost |
m_type | ccGrdPost |
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccInfodriver Class Reference

ccInfodriver Class Reference

A BNCS Control Infodriver class. More...

#include <ccInfodriver.h>

Inheritance diagram for ccInfodriver:
ccCheck

Public Member Functions

ccInfodriver (IccInfodriverCallback *callback=0, const string &debugStringHeader="ccInfodriver")
virtual | ~ccInfodriver ()
long | version (void)
bool | connect (int device, enum cc::ipcType ipc=cc::bbc, long ipcOptions=0)
bool | disconnect ()
bool | isConnected (void)
bool | setSlotOnly (int index, const string &value)
bool | setSlot (int index, const string &value, bool sendNow=false)
bool | setSlot (int index, int value, const string &format="%d", bool sendNow=false)
bool | setSlot (int index, double value, const string &format="%f", bool sendNow=false)
bool | updateSlot (int index, const string &value, bool &updated)
bool | updateSlot (int index, int value, const string &format="%d")
bool | updateSlot (int index, double value, const string &format="%f")
bool | sendSlotRange (int start, int end)
bool | slot (int index, string &value)
void | clientMessage (int workstation, int device, const string &message, const string &client, const string &reference)
void | setRedundancyState (enum cc::redundancyState state, bool force=true)
void | setDriverState (enum cc::driverState state, bool doNow=false, bool force=true)
enum cc::redundancyState | redundancyState (void)
int | setRedundancyMaster (int device)
void | setCloseHostOnExit (bool close=false)
bool | counters (unsigned int &tx, unsigned int &rx)
void | resetCounters (void)
void | sendBufferedRevertives (void)
- Public Member Functions inherited from ccCheck
ccCheck (const string &header="")
virtual | ~ccCheck ()
void | setHeader (const string &header)
bool | checkDevice (unsigned int device)
bool | checkIndex (unsigned int index)
bool | checkSource (int index)
bool | checkRange (unsigned int start, unsigned int end)
bool | checkIndexRange (unsigned int start, unsigned int end)
bool | checkDbIndexRange (unsigned int start, unsigned int end)
bool | checkDatabase (unsigned int db, unsigned int max=10)
bool | checkV1Database (unsigned int db)
bool | checkString (const string &)
bool | checkString (const string &, unsigned int)
bool | checkWorkstation (unsigned int ws)
void | log (const string &log)

Detailed Description

A BNCS Control Infodriver class.

This is a class that provides full Infodriver functionality for BNCS drivers.

Usage Example
class myDriver: public IccInfodriverCallback
{
public:
myDriver( int device )
{
m_info = new ccInfodriver( this );
m_info->connect( 101 );
};
virtual ~myDriver() { delete m_info; };
protected:
// reimplement those functions we need to (declared in IccInfodriverCallback)
void cciSlotRequest( int device, int index, const string & slot )
{
debug( "slot request. Device %d, index %d contents %s", device, index, slot.c_str());
};
private:
ccInfodriver *m_info;
}

Redudndancy. Multiple infodrivers of the same identity can run on a BNCS network. There is a simple mechanism to enable automatic changeover in case of failure which takes a previously passive device on the network and enable it to take over.

Modes There are a couple of distinct modes that redundancy can run in. Most of the time either of two (or more) drivers can run with any one of them able to provide the service to the network. This is cc::multipleControllerCapable mode. Occasionally however there are devices, such as serially controlled devices, where there is only a single control port that cannot be shared. this is cc::singleControllerCapable mode. In this case only one instance of the driver can be active on the network at one time - importantly in this mode if a driver detects it has active comms it will aggresively try and force itself onto the network since no other driver can have communications with the controlled device.

Constructor & Destructor Documentation

◆ ccInfodriver()

ccInfodriver::ccInfodriver | ( | IccInfodriverCallback * | callback = 0,
 |  | const string & | debugStringHeader = "ccInfodriver"
 | ) |  |

Construct a BNCS infodriver class and tell it where to send notifications too (i.e. pass it an interface to the class to callback). If the callback is not specified this class will be able to get slots but be unable to receive asynchronous notifications of change of state etc.

Parameters
[in] | callback | pointer to the class that implements the IccInfodriverCallback class
[in] | debugStringHeader | The member functions of this class generate debug messages for out of range values to which this string is prepended. A message such as "Error: Device=0" message in itself is not useful without some context!

◆ ~ccInfodriver()

ccInfodriver::~ccInfodriver ( )
virtual

Member Function Documentation

◆ clientMessage()

void ccInfodriver::clientMessage | ( | int | workstation,
 |  | int | device,
 |  | const string & | message,
 |  | const string & | client,
 |  | const string & | reference
 | ) |  |

Send a response to a cciClientMessage

Parameters
[in] | workstation | The client that requested this message
[in] | device | The CC device number
[in] | message | The message to be sent
[in] | client | The client identifier (simply passed on from the client notification)
[in] | reference | The client reference (simply passed on from the client notification)

Typical usage follows.....

virtual void myApp::cciClientMessage( int ws, int dev, const string & msg, const string & client, const string & ref )
{
string myMsg;
// do something interesting here to answer the message sent to us in "message"
// and send the reply back to the client that sent it (i.e. keep the parameters we're passed intact)
clientMessage( ws, dev, myMsg, client, ref);
}
Note
Implementation of this messaging mechanism is patchy so beware....

◆ connect()

bool ccInfodriver::connect | ( | int | device,
 |  | enum cc::ipcType | ipc = cc::bbc,
 |  | long | ipcOptions = 0
 | ) |  |

Connect to the specified infodriver using the specified IPC mechanism

Parameters
[in] | ipc | IPC type as defined in the cc::ipcType enumeration
[in] | ipcOptions | values relevant to the ipc type chosen (none are defined at the time of writing)
Returns
true on error, false on success

◆ counters()

bool ccInfodriver::counters | ( | unsigned int & | tx,
 |  | unsigned int & | rx
 | ) |  |

Return current state of counters. This class maintains counts of received and sent messages which may be retrieved using this function

Parameters
tx | Refernce to the integer to pass the value back in
tx | Refernce to the integer to pass the value back in
Returns
true if the counters have changed since the last time this function was called. This can be used to determine whether its worth writing these values to the display
See also
resetCounters()

◆ disconnect()

bool ccInfodriver::disconnect ( void )

Disconnect from infodriver. This calls our cciDisconnected event if we successfully disconnected

Returns
false on successful disconnection or false on there being no connection to disconnect.

◆ isConnected()

bool ccInfodriver::isConnected ( void )

Are we connected to an Infodriver? This is also checks whether the handle we have for it is valid

Returns
true on connected, false on not connected

◆ redundancyState()

enum cc::redundancyState ccInfodriver::redundancyState ( void )

Return the current redundancy state

Returns
Redundancy state

◆ resetCounters()

void ccInfodriver::resetCounters ( void )

Reset the counters back to zero This class maintains a count of sent and received messages

See also
counters()

◆ sendBufferedRevertives()

void ccInfodriver::sendBufferedRevertives ( void )

Ask the infodriver to ask CSI to send all buffered revertives

◆ sendSlotRange()

bool ccInfodriver::sendSlotRange | ( | int | start,
 |  | int | end
 | ) |  |

◆ setCloseHostOnExit()

void ccInfodriver::setCloseHostOnExit ( bool close = false )

Force a close of the host device when this class is destroyed This is to ensure that the closure of a driver doesn't leave an active device on the network

Parameters
[in] close Set true to close host on destroying this class
Note
This class simply posts a WM_CLOSE notification to the infodriver

◆ setDriverState()

void ccInfodriver::setDriverState | ( | enum cc::driverState | state,
 |  | bool | fNow = false,
 |  | bool | force = true
 | ) |  |

Set the current driver state

Parameters
[in] | state | The current overall status of the driver as single, simple ok or fail
[in] | fNow | Whether this change in state should trigger and immediate event or just let the normal redundancy switching take care of it
[in] | force | Whether an attempt to set to TxRx should actively barge another instance to RxOnly. Has no effect when if state is "fail"

◆ setRedundancyMaster()

int ccInfodriver::setRedundancyMaster ( int device )

Ask the infodriver to ask CSI to set the redundancy master for this device to the given master

Parameters
device Master device number
Returns
master device on success, -1 on failure
Note
This feature requires infodriver32 version 1.0.5 or later

◆ setRedundancyState()

void ccInfodriver::setRedundancyState | ( | enum cc::redundancyState | state,
 |  | bool | force = true
 | ) |  |

Force the TXRX status of this driver

Parameters
[in] mode Either tx or rx

Typical usage follows.....

setRedundancyState( cc:rx ); // I'm broken - allow to go RX only
...
setRedundancyState( cc:tx ); // I'm working - force myself TX/RX
setRedundancyState( cc:tx, false ); // I'm working - can go TX/RX but prepare to be knocked back to RxOnly

◆ setSlot() [1/3]

bool ccInfodriver::setSlot | ( | int | index,
 |  | const string & | value,
 |  | bool | sendNow = false
 | ) |  |

Set the value of an infodriver slot

Parameters
[in] | index | The slot number
[in] | value | The new contents of the slot
[in] | sendNow | Whether to buffer and send with other pending commands or send immediately
Returns
true on error

◆ setSlot() [2/3]

bool ccInfodriver::setSlot | ( | int | index,
 |  | int | value,
 |  | const string & | format = "%d",
 |  | bool | sendNow = false
 | ) |  |

Set the value of an infodriver slot to an integer value

Parameters
[in] | index | The slot number
[in] | value | The new contents of the slot
[in] | format | Format specifier e.g. for zero padded string to 6 characters format would be "%06d". Format may be decimal (d) or hex (x or X)
[in] | send | Whether to send a change of state message to the network or just update the slot contents silently
Returns
true on error
Note
The format parameter is the argument to "sprintf" and so must not contain more than one placeholder. If a percentage symbol is required then this should be entered as "%%" e.g. "%d%%".

◆ setSlot() [3/3]

bool ccInfodriver::setSlot | ( | int | index,
 |  | double | value,
 |  | const string & | format = "%f",
 |  | bool | sendNow = false
 | ) |  |

Set the value of an infodriver slot to a double value

Parameters
[in] | index | The slot number
[in] | value | The new contents of the slot
[in] | format | Format specifier e.g. for 3 decimal places the format string would be "%1.3f", to add the units "MHz" the format string would be "%1.3fMHz"
[in] | send | Whether to send a change of state message to the network or just update the slot contents silently
Returns
true on error
Note
The format parameter is the argument to "sprintf" and so must not contain more than one placeholder. If a percentage symbol is required then this should be entered as "%%" e.g. "%1.1f%%"

◆ setSlotOnly()

bool ccInfodriver::setSlotOnly | ( | int | index,
 |  | const string & | value
 | ) |  |

◆ slot()

bool ccInfodriver::slot | ( | int | index,
 |  | string & | value
 | ) |  |

Get value of an infodriver slot

Parameters
[in] | index | The slot number
[out] | value | The variable to stick return value
Returns
Returns true on error

◆ updateSlot() [1/3]

bool ccInfodriver::updateSlot | ( | int | index,
 |  | const string & | value,
 |  | bool & | updated
 | ) |  |

Update slot contents. This function is equivalent to setSlot() but only sends any message to the network if old and new contents are different

Parameters
[in] | index | The slot number
[in] | value | The slot contents
[out] | updated | Return value which indicates whether the slot had changed (true) or was the same (false)
See also
setSlot();

◆ updateSlot() [2/3]

bool ccInfodriver::updateSlot | ( | int | index,
 |  | int | value,
 |  | const string & | format = "%d"
 | ) |  |

◆ updateSlot() [3/3]

bool ccInfodriver::updateSlot | ( | int | index,
 |  | double | value,
 |  | const string & | format = "%f"
 | ) |  |

◆ version()

long ccInfodriver::version ( void )

Simple function to ensure that we can tell what version this class is programatically

Returns
HIWORD( version()) returns major version number, LOWORD(version()) the minor revision number
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccInfodriver Member List

This is the complete list of members for ccInfodriver, including all inherited members.

ccCheck(const string &header="") | ccCheck |
ccInfodriver(IccInfodriverCallback *callback=0, const string &debugStringHeader="ccInfodriver") | ccInfodriver |
checkDatabase(unsigned int db, unsigned int max=10) | ccCheck |
checkDbIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkDevice(unsigned int device) | ccCheck |
checkIndex(unsigned int index) | ccCheck |
checkIndexRange(unsigned int start, unsigned int end) | ccCheck |
checkRange(unsigned int start, unsigned int end) | ccCheck |
checkSource(int index) | ccCheck |
checkString(const string &) | ccCheck |
checkString(const string &, unsigned int) | ccCheck |
checkV1Database(unsigned int db) | ccCheck |
checkWorkstation(unsigned int ws) | ccCheck |
clientMessage(int workstation, int device, const string &message, const string &client, const string &reference) | ccInfodriver |
connect(int device, enum cc::ipcType ipc=cc::bbc, long ipcOptions=0) | ccInfodriver |
counters(unsigned int &tx, unsigned int &rx) | ccInfodriver |
disconnect() | ccInfodriver |
isConnected(void) | ccInfodriver |
log(const string &log) | ccCheck |
redundancyState(void) | ccInfodriver |
resetCounters(void) | ccInfodriver |
sendBufferedRevertives(void) | ccInfodriver |
sendSlotRange(int start, int end) | ccInfodriver |
setCloseHostOnExit(bool close=false) | ccInfodriver |
setDriverState(enum cc::driverState state, bool doNow=false, bool force=true) | ccInfodriver |
setHeader(const string &header) | ccCheck |
setRedundancyMaster(int device) | ccInfodriver |
setRedundancyState(enum cc::redundancyState state, bool force=true) | ccInfodriver |
setSlot(int index, const string &value, bool sendNow=false) | ccInfodriver |
setSlot(int index, int value, const string &format="%d", bool sendNow=false) | ccInfodriver |
setSlot(int index, double value, const string &format="%f", bool sendNow=false) | ccInfodriver |
setSlotOnly(int index, const string &value) | ccInfodriver |
slot(int index, string &value) | ccInfodriver |
updateSlot(int index, const string &value, bool &updated) | ccInfodriver |
updateSlot(int index, int value, const string &format="%d") | ccInfodriver |
updateSlot(int index, double value, const string &format="%f") | ccInfodriver |
version(void) | ccInfodriver |
~ccCheck() | ccCheck | virtual
~ccInfodriver() | ccInfodriver | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccInfodriverPost Class Reference

ccInfodriverPost Class Reference

#include <ccInfodriver.h>

Public Member Functions

ccInfodriverPost (int type, int slot, const string &contents)

Public Attributes

int | m_type
int | m_slot
string | m_contents

Constructor & Destructor Documentation

◆ ccInfodriverPost()

ccInfodriverPost::ccInfodriverPost | ( | int | type,
 |  | int | slot,
 |  | const string & | contents
 | ) |  |
inline

Member Data Documentation

◆ m_contents

string ccInfodriverPost::m_contents

◆ m_slot

int ccInfodriverPost::m_slot

◆ m_type

int ccInfodriverPost::m_type
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccInfodriverPost Member List

This is the complete list of members for ccInfodriverPost, including all inherited members.

ccInfodriverPost(int type, int slot, const string &contents) | ccInfodriverPost | inline
m_contents | ccInfodriverPost |
m_slot | ccInfodriverPost |
m_type | ccInfodriverPost |
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccTimer Class Reference

ccTimer Class Reference

#include <ccTimer.h>

Public Member Functions

ccTimer (IccTimerCallback *c)
virtual | ~ccTimer ()
int | timerStart (int id, int duration)
int | timerStop (int id)
const int | getId (int id) const

Constructor & Destructor Documentation

◆ ccTimer()

ccTimer::ccTimer ( IccTimerCallback * c )

◆ ~ccTimer()

ccTimer::~ccTimer ( )
virtual

Member Function Documentation

◆ getId()

const int ccTimer::getId ( int id ) const

◆ timerStart()

int ccTimer::timerStart | ( | int | id,
 |  | int | duration
 | ) |  |

◆ timerStop()

int ccTimer::timerStop ( int id )
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccTimer Member List

This is the complete list of members for ccTimer, including all inherited members.

ccTimer(IccTimerCallback *c) | ccTimer |
getId(int id) const | ccTimer |
timerStart(int id, int duration) | ccTimer |
timerStop(int id) | ccTimer |
~ccTimer() | ccTimer | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: ccTimerClient Class Reference

ccTimerClient Class Reference

#include <ccTimer.h>

Public Member Functions

ccTimerClient (IccTimerCallback *c, int id)

Public Attributes

IccTimerCallback * m_callback
int m_id

Constructor & Destructor Documentation

◆ ccTimerClient()

ccTimerClient::ccTimerClient | ( | IccTimerCallback * | c,
 |  | int | id
 | ) |  |
inline

Member Data Documentation

◆ m_callback

IccTimerCallback* ccTimerClient::m_callback

◆ m_id

int ccTimerClient::m_id
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

ccTimerClient Member List

This is the complete list of members for ccTimerClient, including all inherited members.

ccTimerClient(IccTimerCallback *c, int id) | ccTimerClient | inline
m_callback | ccTimerClient |
m_id | ccTimerClient |
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include Directory Reference

  • include
include Directory Reference

Files

file | cc.h [code]
file | ccCheck.h [code]
file | ccClient.h [code]
file | ccConfig.h [code]
file | ccDriver.h [code]
file | ccGrd.h [code]
file | ccInfodriver.h [code]
file | ccLibrary.h [code]
file | ccTimer.h [code]
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C++ Interfacing Libraries for BNCS

C++ Interfacing Libraries for BNCS

These are C++ interfacing classes for BNCS Client, Infodriver and GRD as well as a few helper classes to get configuration and do range checking etc.

Interfacing Libraries

  • ccInfodriver
  • ccGrd
  • ccClient
  • ccDriver

Helper Libraries

  • ccConfig
  • ccCheck
  • ccTimer

Select "Classes" tab for more information

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: cc Namespace Reference

Enumerations
cc Namespace Reference

Enumerations

enum | ipcType { none =0, wm, bbc }
enum redundancyState {
unknown = IFMODE_NONE, rx = IFMODE_RXONLY, tx = IFMODE_TXRX, broken = IFMODE_RXONLYBROKEN,
forceTx = IFMODE_FORCETXRX
}
enum | redundancyMode { singleControllerCapable = 1, multipleControllerCapable }
enum | driverState { ok = 1, fail }
enum | pollType { UnknownType = 0, IP, RP, GP }

Enumeration Type Documentation

◆ driverState

enum cc::driverState
Enumerator
ok
fail

◆ ipcType

enum cc::ipcType
Enumerator
none
wm
bbc

◆ pollType

enum cc::pollType
Enumerator
UnknownType
IP
RP
GP

◆ redundancyMode

enum cc::redundancyMode
Enumerator
singleControllerCapable
multipleControllerCapable

◆ redundancyState

enum cc::redundancyState
Enumerator
unknown
rx
tx
broken
forceTx
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_dateTime.h Source File

  • include
bncs_dateTime.h
1 #if !defined(AFX_BNCS_DATETIME_H__4CA966ED_5AE0_439D_9938_99A6FC3EAD87__INCLUDED_)
2 #define AFX_BNCS_DATETIME_H__4CA966ED_5AE0_439D_9938_99A6FC3EAD87__INCLUDED_
3
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
7
8 #include <windows.h>
9 #include <stdio.h>
10
11 struct bncs_date
12 {
13 int day;
14 int month;
15 int year;
16 int dayOfWeek;
17 };
18
19 struct bncs_time
20 {
21 int hour;
22 int minute;
23 int second;
24 int millisecond;
25 };
26
27 class bncs_dateTime
28 {
29 public:
30 bncs_dateTime();
31 virtual ~bncs_dateTime();
32
33 bncs_dateTime( const bncs_dateTime & dt );
34 bncs_dateTime( const SYSTEMTIME & st );
35 bncs_dateTime( const FILETIME & ft );
36 bncs_dateTime( const char * isoDateTime );
37
38 static bncs_dateTime nowUTC( void );
39 static bncs_dateTime now( void );
40 const char* toString( const char* format = "dd MMM yyyy" );
41 void toString( char * out, int len, const char* format = "dd MMM yyyy" );
42
43 bool fromString( const char* in );
44 bool fromStringTime( const char * inStr );
45 bool fromStringDate( const char * inStr );
46
47 bool addSeconds( int seconds );
48 bool addMinutes( int minutes );
49 bool addHours( int hours );
50 bool addDays( int days );
51 bool addWeeks( int weeks );
52 bool addMonths( int months );
53 bool addYears( int years );
54
55 bool setDate( int day, int month, int year );
56 bool setTime( int hour, int minute, int second, int millisecond = 0 );
57
58 bool operator<( const bncs_dateTime & in ) const;
59 bool operator<=( const bncs_dateTime & in ) const;
60 bool operator>( const bncs_dateTime & in ) const;
61 bool operator>=( const bncs_dateTime & in ) const;
62 bool operator==( const bncs_dateTime & in ) const;
63 bool operator!=( const bncs_dateTime & in ) const;
64
65 __int64 difference( const bncs_dateTime & in ) const;
66 __int64 difference_seconds(const bncs_dateTime & in) const;
67 __int64 difference_milliseconds( const bncs_dateTime & in ) const;
68
69 operator __int64() const;
70 void clear( void );
71 bool isNull( void ) const;
72 void dump( const char* ) const;
73
74 bncs_time time( void ) const;
75 bncs_date date( void ) const;
76 private: // vars
77 FILETIME m_ftDateTime;
78 char m_outputString[ 64 ];
79 bool m_valid;
80 private: // funcs
81 void insertString( char * p, int delCount, const char* str );
82 };
83
84
85 #endif // !defined(AFX_BNCS_DATETIME_H__4CA966ED_5AE0_439D_9938_99A6FC3EAD87__INCLUDED_)
bncs_dateTime::toString
const char * toString(const char *format="dd MMM yyyy")
Definition: bncs_dateTime.cpp:192
bncs_dateTime::operator<=
bool operator<=(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:118
bncs_dateTime::operator>
bool operator>(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:131
bncs_dateTime::fromStringDate
bool fromStringDate(const char *inStr)
Definition: bncs_dateTime.cpp:698
bncs_time::hour
int hour
Definition: bncs_dateTime.h:21
bncs_dateTime::nowUTC
static bncs_dateTime nowUTC(void)
Definition: bncs_dateTime.cpp:83
bncs_dateTime::now
static bncs_dateTime now(void)
Definition: bncs_dateTime.cpp:97
bncs_date
Definition: bncs_dateTime.h:11
bncs_time::second
int second
Definition: bncs_dateTime.h:23
bncs_dateTime::addMinutes
bool addMinutes(int minutes)
Definition: bncs_dateTime.cpp:814
bncs_dateTime::addSeconds
bool addSeconds(int seconds)
Definition: bncs_dateTime.cpp:789
bncs_date::year
int year
Definition: bncs_dateTime.h:15
bncs_time::millisecond
int millisecond
Definition: bncs_dateTime.h:24
bncs_dateTime::operator<
bool operator<(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:105
bncs_time::minute
int minute
Definition: bncs_dateTime.h:22
bncs_dateTime::difference_milliseconds
__int64 difference_milliseconds(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:989
bncs_dateTime::setDate
bool setDate(int day, int month, int year)
Definition: bncs_dateTime.cpp:906
bncs_dateTime::isNull
bool isNull(void) const
Definition: bncs_dateTime.cpp:962
bncs_dateTime::bncs_dateTime
bncs_dateTime()
Definition: bncs_dateTime.cpp:29
bncs_dateTime::operator!=
bool operator!=(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:170
bncs_date::month
int month
Definition: bncs_dateTime.h:14
bncs_dateTime::addMonths
bool addMonths(int months)
Definition: bncs_dateTime.cpp:850
bncs_dateTime
This is a simple date/time class.
Definition: bncs_dateTime.h:27
bncs_dateTime::operator>=
bool operator>=(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:144
bncs_dateTime::addYears
bool addYears(int years)
Definition: bncs_dateTime.cpp:883
bncs_dateTime::difference_seconds
__int64 difference_seconds(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:1002
bncs_date::day
int day
Definition: bncs_dateTime.h:13
bncs_dateTime::fromStringTime
bool fromStringTime(const char *inStr)
Definition: bncs_dateTime.cpp:564
bncs_dateTime::addWeeks
bool addWeeks(int weeks)
Definition: bncs_dateTime.cpp:841
bncs_dateTime::operator==
bool operator==(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:157
bncs_dateTime::clear
void clear(void)
Definition: bncs_dateTime.cpp:952
bncs_date::dayOfWeek
int dayOfWeek
Definition: bncs_dateTime.h:16
bncs_dateTime::fromString
bool fromString(const char *in)
Definition: bncs_dateTime.cpp:652
bncs_dateTime::difference
__int64 difference(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:972
bncs_dateTime::addHours
bool addHours(int hours)
Definition: bncs_dateTime.cpp:823
bncs_dateTime::addDays
bool addDays(int days)
Definition: bncs_dateTime.cpp:832
bncs_dateTime::~bncs_dateTime
virtual ~bncs_dateTime()
Definition: bncs_dateTime.cpp:34
bncs_dateTime::dump
void dump(const char *) const
Definition: bncs_dateTime.cpp:1023
bncs_dateTime::date
bncs_date date(void) const
Definition: bncs_dateTime.cpp:1045
bncs_dateTime::time
bncs_time time(void) const
Definition: bncs_dateTime.cpp:1030
bncs_dateTime::setTime
bool setTime(int hour, int minute, int second, int millisecond=0)
Definition: bncs_dateTime.cpp:931
bncs_time
Definition: bncs_dateTime.h:19
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_disklog.h Source File

  • include
bncs_disklog.h
1 // log.h: interface for the log class.
2 //
4
5 #if !defined(AFX_LOG_H__FEDBCE6D_E085_4C7B_BC86_943250FD9939__INCLUDED_)
6 #define AFX_LOG_H__FEDBCE6D_E085_4C7B_BC86_943250FD9939__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <windows.h>
13
14 class bncs_disklog
15 {
16 public:
18 enum filetype
19 {
20 SINGLE = 1,
21 TIMESTAMP_DAY ,
22 TIMESTAMP_HOUR
23 };
24 bncs_disklog( const char * root, enum filetype mode, const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0 );
25 bncs_disklog( const char * root, enum filetype mode = SINGLE );
26 void write( const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0 );
27 virtual ~bncs_disklog();
28 const char * ref( void );
29 void clear( void );
30 private:
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 void openLogFile( const char * root, enum filetype mode );
33 void initVars( void );
34 void createDirectory( const char* inpath );
35 void cleanup( void );
36
37 char m_ref[ 64 ];
38 char m_root[ 32 ];
39 HANDLE hFile;
40 enum filetype m_mode;
41 char filename[MAX_PATH];
42 int lastTimePeriod;
43 #endif
44 };
45
46 #endif // !defined(AFX_LOG_H__FEDBCE6D_E085_4C7B_BC86_943250FD9939__INCLUDED_)
bncs_disklog
This is a simple Log-to-disk class.
Definition: bncs_disklog.h:14
bncs_disklog::write
void write(const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0)
Definition: bncs_disklog.cpp:238
bncs_disklog::clear
void clear(void)
Definition: bncs_disklog.cpp:335
bncs_disklog::TIMESTAMP_HOUR
File-name is generated using date+hour.
Definition: bncs_disklog.h:22
bncs_disklog::SINGLE
Definition: bncs_disklog.h:20
bncs_disklog::filetype
filetype
Format of log-file name.
Definition: bncs_disklog.h:18
bncs_disklog::ref
const char * ref(void)
Definition: bncs_disklog.cpp:218
bncs_disklog::bncs_disklog
bncs_disklog(const char *root, enum filetype mode, const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0)
Definition: bncs_disklog.cpp:84
bncs_disklog::~bncs_disklog
virtual ~bncs_disklog()
Definition: bncs_disklog.cpp:200
bncs_disklog::TIMESTAMP_DAY
Definition: bncs_disklog.h:21
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include/cBncsVersion.h Source File

  • include
cBncsVersion.h
1 // cBncsVersion.h: interface for the cBncsVersion class.
2 //
4
5 #if !defined(AFX_CBNCSVERSION_H__ED778E2D_D8CF_486A_9007_D0D8277156B5__INCLUDED_)
6 #define AFX_CBNCSVERSION_H__ED778E2D_D8CF_486A_9007_D0D8277156B5__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 class cBncsVersion
13 {
14 public:
15 cBncsVersion(const char* szFile);
16 virtual ~cBncsVersion();
17
18
19 char* szComments;
20 char* szInternalName;
21 char* szProductName;
22 char* szCompanyName;
23 char* szLegalCopyright;
24 char* szProductVersion;
25 char* szLegalTradeMarks;
26 char* szPrivateBuild;
27 char* szOriginalFileName;
28 char* szSpecialBuild;
29 char* szFileVersion;
30 char* szFileDescription;
33 private:
34 char* szFileName;
35 };
36
37 #endif // !defined(AFX_CBNCSVERSION_H__ED778E2D_D8CF_486A_9007_D0D8277156B5__INCLUDED_)
cBncsVersion::szInternalName
char * szInternalName
Definition: cBncsVersion.h:20
cBncsVersion::szProductVersion
char * szProductVersion
Definition: cBncsVersion.h:24
cBncsVersion::szLegalTradeMarks
char * szLegalTradeMarks
Definition: cBncsVersion.h:25
cBncsVersion::szCompanyName
char * szCompanyName
Definition: cBncsVersion.h:22
cBncsVersion
Provides an easy way of getting file versions short description.
Definition: cBncsVersion.h:12
cBncsVersion::cBncsVersion
cBncsVersion(const char *szFile)
Definition: cBncsVersion.cpp:58
cBncsVersion::szFileDescription
char * szFileDescription
Definition: cBncsVersion.h:30
cBncsVersion::szOriginalFileName
char * szOriginalFileName
Definition: cBncsVersion.h:27
cBncsVersion::szPrivateBuild
char * szPrivateBuild
Definition: cBncsVersion.h:26
cBncsVersion::szProductName
char * szProductName
Definition: cBncsVersion.h:21
cBncsVersion::szSpecialBuild
char * szSpecialBuild
Definition: cBncsVersion.h:28
cBncsVersion::~cBncsVersion
virtual ~cBncsVersion()
Definition: cBncsVersion.cpp:232
cBncsVersion::szLegalCopyright
char * szLegalCopyright
Definition: cBncsVersion.h:23
cBncsVersion::szComments
char * szComments
Definition: cBncsVersion.h:19
cBncsVersion::szFileVersion
char * szFileVersion
Definition: cBncsVersion.h:29
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: bncs_dateTime Class Reference

bncs_dateTime Class Reference

This is a simple date/time class. More...

#include <bncs_dateTime.h>

Public Member Functions

bncs_dateTime ()
virtual | ~bncs_dateTime ()
bncs_dateTime (const bncs_dateTime &dt)
bncs_dateTime (const SYSTEMTIME &st)
bncs_dateTime (const FILETIME &ft)
bncs_dateTime (const char *isoDateTime)
const char * | toString (const char *format="dd MMM yyyy")
void | toString (char *out, int len, const char *format="dd MMM yyyy")
bool | fromString (const char *in)
bool | fromStringTime (const char *inStr)
bool | fromStringDate (const char *inStr)
bool | addSeconds (int seconds)
bool | addMinutes (int minutes)
bool | addHours (int hours)
bool | addDays (int days)
bool | addWeeks (int weeks)
bool | addMonths (int months)
bool | addYears (int years)
bool | setDate (int day, int month, int year)
bool | setTime (int hour, int minute, int second, int millisecond=0)
bool | operator< (const bncs_dateTime &in) const
bool | operator<= (const bncs_dateTime &in) const
bool | operator> (const bncs_dateTime &in) const
bool | operator>= (const bncs_dateTime &in) const
bool | operator== (const bncs_dateTime &in) const
bool | operator!= (const bncs_dateTime &in) const
__int64 | difference (const bncs_dateTime &in) const
__int64 | difference_seconds (const bncs_dateTime &in) const
__int64 | difference_milliseconds (const bncs_dateTime &in) const
operator __int64 () const
void | clear (void)
bool | isNull (void) const
void | dump (const char *) const
bncs_time | time (void) const
bncs_date | date (void) const

Static Public Member Functions

static bncs_dateTime | nowUTC (void)
static bncs_dateTime | now (void)

Detailed Description

This is a simple date/time class.

Internally it uses the SYSTEMTIME and FILETIME structures - maximum extent is set by these structures.

Constructor & Destructor Documentation

◆ bncs_dateTime() [1/5]

bncs_dateTime::bncs_dateTime ( )

Constructs null object

◆ ~bncs_dateTime()

bncs_dateTime::~bncs_dateTime ( )
virtual

◆ bncs_dateTime() [2/5]

bncs_dateTime::bncs_dateTime ( const bncs_dateTime & dt )

Copy Constructor

◆ bncs_dateTime() [3/5]

bncs_dateTime::bncs_dateTime ( const SYSTEMTIME & st )

Construct object using Windows SYSTEMTIME structure

Parameters
[in] st Windows SYSTEMTIME structure

◆ bncs_dateTime() [4/5]

bncs_dateTime::bncs_dateTime ( const FILETIME & ft )

Construct object using Windows FILETIME structure

Parameters
[in] ft Windows FILETIME structure

◆ bncs_dateTime() [5/5]

bncs_dateTime::bncs_dateTime ( const char * isoDateTime )

Member Function Documentation

◆ addDays()

bool bncs_dateTime::addDays ( int days )

Add days (or subtract if the value is negative)

Parameters
[in] days The number of days to add The number of days is not constrained by anything other than the range of an int

◆ addHours()

bool bncs_dateTime::addHours ( int hours )

Add hours (or subtract if the value is negative)

Parameters
[in] hours The number of hours to add The number of hours is not constrained by anything other than the range of an int

◆ addMinutes()

bool bncs_dateTime::addMinutes ( int minutes )

Add minutes (or subtract if the value is negative)

Parameters
[in] minutes The number of minutes to add The number of minutes is not constrained by anything other than the range of an int

◆ addMonths()

bool bncs_dateTime::addMonths ( int months )

Add months (or subtract if the value is negative)

Parameters
[in] months The number of months to add The number of months is not constrained by anything other than the range of an int

◆ addSeconds()

bool bncs_dateTime::addSeconds ( int seconds )

Add seconds (or subtract if the value is negative)

Parameters
[in] seconds The number of seconds to add The number of seconds is not constrained by anything other than the range of an int

◆ addWeeks()

bool bncs_dateTime::addWeeks ( int weeks )

Add weeks (or subtract if the value is negative)

Parameters
[in] weeks The number of weeks to add The number of weeks is not constrained by anything other than the range of an int

◆ addYears()

bool bncs_dateTime::addYears ( int years )

Add years (or subtract if the value is negative)

Parameters
[in] years The number of years to add The number of years is not constrained by anything other than the range of an int

◆ clear()

void bncs_dateTime::clear ( void )

Reset back to null Sets the date/time reference and the internal string back to null

◆ date()

bncs_date bncs_dateTime::date ( void ) const

◆ difference()

__int64 bncs_dateTime::difference ( const bncs_dateTime & in ) const

The difference between this object and another in 100's of nanoseconds. If in is later than us the return value is negative.

Parameters
in bncs_dateTime object to compare to
Returns
difference in 100ns resolution

◆ difference_milliseconds()

__int64 bncs_dateTime::difference_milliseconds ( const bncs_dateTime & in ) const

The difference between this object and another in milliseconds. If in is later than us the return value is negative.

Parameters
in bncs_dateTime object to compare to
Returns
difference in milliseconds

◆ difference_seconds()

__int64 bncs_dateTime::difference_seconds ( const bncs_dateTime & in ) const

The difference between this object and another in seconds. If in is later than us the return value is negative.

Parameters
in bncs_dateTime object to compare to
Returns
difference in seconds

◆ dump()

void bncs_dateTime::dump ( const char * header ) const

◆ fromString()

bool bncs_dateTime::fromString ( const char * inStr )

Convert date/time from string

Parameters
[in] inStr string to convert
Returns
true on failure - either badly formatted input or out of range values

This function only accepts ISO formatted dates e.g. 2012-10-01T12:27:48

This function reset the current datetime value back to null before staring parsing the new value.

◆ fromStringDate()

bool bncs_dateTime::fromStringDate ( const char * inStr )

Convert date from BNCS date string

Parameters
[in] inStr string to convert
Returns
true on failure - either badly formatted input or out of range values

This function accepts BNCS formatted dates and some variants e.g. 10 Jan 12, 10 Jan 2012, Jan 10 2012 This function does NOT clear the value before trying to set it (so you can use it at the same time as the time setting functions).

◆ fromStringTime()

bool bncs_dateTime::fromStringTime ( const char * inStr )

Convert time from BNCS date string

Parameters
[in] inStr string to convert
Returns
true on failure - either badly formatted input or out of range values

This function accepts BNCS formatted time e.g. 12:34:56, or 1234 This function does NOT clear the value before trying to set it (so you can use it at the same time as the date setting functions).

◆ isNull()

bool bncs_dateTime::isNull ( void ) const

Has this date/time object been set to any sensible value?

Returns
true on null value

◆ now()

bncs_dateTime bncs_dateTime::now ( void )
static

Return the local time allowing for daylight saving offsets

Returns
Current time
bncs_dateTime dt = bncs_dateTime::now();

◆ nowUTC()

bncs_dateTime bncs_dateTime::nowUTC ( void )
static

Return the UTC time

Returns
Current time (UTC)
bncs_dateTime dt = bncs_dateTime::nowUTC();

◆ operator __int64()

bncs_dateTime::operator __int64 ( ) const

Converts this dateTime object to int64 value

◆ operator!=()

bool bncs_dateTime::operator!= ( const bncs_dateTime & in ) const

◆ operator<()

bool bncs_dateTime::operator< ( const bncs_dateTime & in ) const

◆ operator<=()

bool bncs_dateTime::operator<= ( const bncs_dateTime & in ) const

◆ operator==()

bool bncs_dateTime::operator== ( const bncs_dateTime & in ) const

◆ operator>()

bool bncs_dateTime::operator> ( const bncs_dateTime & in ) const

◆ operator>=()

bool bncs_dateTime::operator>= ( const bncs_dateTime & in ) const

◆ setDate()

bool bncs_dateTime::setDate | ( | int | day,
 |  | int | month,
 |  | int | year
 | ) |  |

Set date to given values

Parameters
[in] | day | The day
[in] | month | The month
[in] | year | The year
Returns
true on failure - usually from out of range values
Note
This function does not set the time - this is left at whatever value it was

◆ setTime()

bool bncs_dateTime::setTime | ( | int | hour,
 |  | int | minute,
 |  | int | second,
 |  | int | millisecond = 0
 | ) |  |

Set time to given values

Parameters
[in] | hour | The hour value
[in] | minute | The minute value
[in] | second | The second value
[in] | millisecond | The millisecond value
Returns
true on failure - usually from out of range values
Note
This function does not set the date - this is left at whatever value it was

◆ time()

bncs_time bncs_dateTime::time ( void ) const

◆ toString() [1/2]

const char * bncs_dateTime::toString ( const char * format = "dd MMM yyyy" )

Convert to string using the format specified.

Parameters
[in] format - see toString( char *, int, const char* )

Same as toString( char *, int, const char* ) function but uses internal string buffer (of 64 characters) for convenience

bncs_dateTime dt = bncs_dateTime::now();
char *p = dt.toString( "hh:mm:ss" ); // p points at a string of the format "13:00:00". This is valid until the next call of this function or the object is destroyed.

◆ toString() [2/2]

void bncs_dateTime::toString | ( | char * | out,
 |  | int | len,
 |  | const char * | format = "dd MMM yyyy"
 | ) |  |

Convert to string

Parameters
[out] | out | Where to write the string
[in] | len | The length of the out parameter
[in] | format | The formatting string - how you want the date/time to appear
Note
The size of out should be at least the size of the format string plus whatever is required extra for expansion of long-form data e.g. day/month names

The format string has various placeholders for date/time in various formats or can be one of the following values:

Value | Meaning
BNCSDATE | Date in traditional BNCS format (ApplCore) e.g. 01 Jan 2012
BNCSTIME | Time in traditional BNCS format (ApplCore) e.g. 13:00:00
ISO | Time in ISO format i.e. YYYY-MM-DDTHH:MM:SS

If it isn't one of these fixed values then it can be made up with the following formatting characters.

Note
Any vales that aren't recognised are just left intact so you can include some punctuation characters when you build your string
Placeholder | Meaning
h | Hours without leading zero
hh | Hours with leading zero
m | Minutes without leading zero
mm | Minutes with leading zero
s | Seconds without leading zero
ss | Seconds with leading zero
z | Milliseconds without leading zero
zzz | Milliseconds with leading zeros
d | Day without leading zero
dd | Day with leading zero
ddd | Day name - short form (Mon, Tue, Wed, Thu, Fri, Sat)
dddd | Day name - long form (Monday etc.)
ddddd | Day with suffix - e.g. 1st, 23rd
M | Month without leading zero
MM | Month with leading zero
MMM | Month name - short form (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
MMMM | Month name - long form (January etc.)
yy | Year - short form e.g. Jan 12
yyyy | Year - long form e.g. Jan 2012
bncs_dateTime dt = bncs_dateTime::now(); // assuming this is 01 Feb 2012, 13:00:00
const char *p;
p = dt.toString( "BNCSDATE" ); // p points to "01 Feb 2012"
p = dt.toString( "BNCSTIME" ); // p points to "13:00:00"
p = dt.toString( "ISO" ); // p points to "2012-02-01T13:00:00"
p = dt.toString( "dddd ddddd MMMM yyyy hh:mm:ss:zzz" ); // p points to "Wednesday 1st February 2012 13:00:00:000"

An invalid/null datetime will result in a null/zero length string

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

bncs_dateTime Member List

This is the complete list of members for bncs_dateTime, including all inherited members.

addDays(int days) | bncs_dateTime |
addHours(int hours) | bncs_dateTime |
addMinutes(int minutes) | bncs_dateTime |
addMonths(int months) | bncs_dateTime |
addSeconds(int seconds) | bncs_dateTime |
addWeeks(int weeks) | bncs_dateTime |
addYears(int years) | bncs_dateTime |
bncs_dateTime() | bncs_dateTime |
bncs_dateTime(const bncs_dateTime &dt) | bncs_dateTime |
bncs_dateTime(const SYSTEMTIME &st) | bncs_dateTime |
bncs_dateTime(const FILETIME &ft) | bncs_dateTime |
bncs_dateTime(const char *isoDateTime) | bncs_dateTime |
clear(void) | bncs_dateTime |
date(void) const | bncs_dateTime |
difference(const bncs_dateTime &in) const | bncs_dateTime |
difference_milliseconds(const bncs_dateTime &in) const | bncs_dateTime |
difference_seconds(const bncs_dateTime &in) const | bncs_dateTime |
dump(const char *) const | bncs_dateTime |
fromString(const char *in) | bncs_dateTime |
fromStringDate(const char *inStr) | bncs_dateTime |
fromStringTime(const char *inStr) | bncs_dateTime |
isNull(void) const | bncs_dateTime |
now(void) | bncs_dateTime | static
nowUTC(void) | bncs_dateTime | static
operator __int64() const | bncs_dateTime |
operator!=(const bncs_dateTime &in) const | bncs_dateTime |
operator<(const bncs_dateTime &in) const | bncs_dateTime |
operator<=(const bncs_dateTime &in) const | bncs_dateTime |
operator==(const bncs_dateTime &in) const | bncs_dateTime |
operator>(const bncs_dateTime &in) const | bncs_dateTime |
operator>=(const bncs_dateTime &in) const | bncs_dateTime |
setDate(int day, int month, int year) | bncs_dateTime |
setTime(int hour, int minute, int second, int millisecond=0) | bncs_dateTime |
time(void) const | bncs_dateTime |
toString(const char *format="dd MMM yyyy") | bncs_dateTime |
toString(char *out, int len, const char *format="dd MMM yyyy") | bncs_dateTime |
~bncs_dateTime() | bncs_dateTime | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: bncs_disklog Class Reference

bncs_disklog Class Reference

This is a simple Log-to-disk class. More...

#include <bncs_disklog.h>

Public Types

enum filetype { SINGLE = 1, TIMESTAMP_DAY, TIMESTAMP_HOUR }
Format of log-file name. More...

Public Member Functions

bncs_disklog (const char *root, enum filetype mode, const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0)
bncs_disklog (const char *root, enum filetype mode=SINGLE)
void | write (const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0)
virtual | ~bncs_disklog ()
const char * | ref (void)
void | clear (void)

Detailed Description

This is a simple Log-to-disk class.

There are many instances where you want to be able to simply log a message to the disk

This class puts logs in the logs directory under the %CC_ROOT%\%CC_SYSTEM% path (these are environment variables used for a standard V4.5 installation)

Logs can be written as a single ever-growing single file or as multiple timestamped files.

If you use a timestamped file it's anticipated that an external application will delete unwanted files. This class does nothing but create them!

Logs are written to a path given when you construct a bncs_disklog object - this is so that you can run multiple logs for multple purposes.

Log File Example:
The format of the log files is the same regardless of the timestamping options selected
14/08/2004 22:45:48: hello mum
14/08/2004 22:46:30: hello mum
14/08/2004 22:47:34: baarf
14/08/2004 22:47:34: hello mum
Note
The last file is left open until the bncs_disklog object is destroyed. For timestamped files this will be the last file written to (not necessarily the current file if there has been no recent writes). Open files are shared for reading but not writing.
Examples
// The following examples use CC_ROOT of "c:\bncs" and CC_SYSTEM of "v4.5"
// write "hello mum" to a daily timestamped file e.g. c:\bncs\v4.5\logs\mything\20040814.log
bncs_disklog log1( "mything", bncs_disklog::TIMESTAMP_DAY );
log1.write( "hello mum" );
// write "hello mum" to an hourly timestamped file e.g. c:\bncs\v4.5\logs\mything\20040814-09.log
bncs_disklog log2( "mything", bncs_disklog::TIMESTAMP_HOUR );
log2.write( "hello mum" );
// write "hello mum" to a plain file e.g. c:\bncs\v4.5\logs\mything\mything.log
bncs_disklog log3( "mything" ); // SINGLE is the default.....
log3.write( "hello mum" );

Member Enumeration Documentation

◆ filetype

enum bncs_disklog::filetype

Format of log-file name.

Enumerator
SINGLE | File-name as given.
TIMESTAMP_DAY | File-name is generated using date.
TIMESTAMP_HOUR | File-name is generated using date+hour.

Constructor & Destructor Documentation

◆ bncs_disklog() [1/2]

bncs_disklog::bncs_disklog | ( | const char * | root,
 |  | enum filetype | mode,
 |  | const char * | msg1,
 |  | const char * | msg2 = 0,
 |  | const char * | msg3 = 0,
 |  | const char * | msg4 = 0,
 |  | const char * | msg5 = 0,
 |  | const char * | msg6 = 0
 | ) |  |

Constructs a bncs_disklog using the name supplied and immediately writes the supplied messages

Parameters
root | The subdirectory to use
mode | whether to use a single file (SINGLE), hourly files (TIMESTAMP_HOUR), or daily files (TIMESTAMP_DAY)
msg1 | Message to log
msg2 | Optional message to log
msg3 | Optional message to log
msg4 | Optional message to log
msg5 | Optional message to log
msg6 | Optional message to log
Example:
// The following examples use CC_ROOT of "c:\bncs" and CC_SYSTEM of "v4.5"
// write "hello mum" to timestamped file e.g. c:\bncs\v4.5\logs\mything\20040814.log
bncs_disklog log1( "mything", bncs_disklog::TIMESTAMP_DAY, "hello mum" );
// write "hello mum" to timestamped file e.g. c:\bncs\v4.5\logs\mything\20040814-09.log
bncs_disklog log2( "mything", bncs_disklog::TIMESTAMP_HOUR, "hello mum" );
// write "hello mum" to a plain file e.g. c:\bncs\v4.5\logs\mything\mything.log
bncs_disklog log3( "mything", bncs_disklog::SINGLE, "hello mum" );

◆ bncs_disklog() [2/2]

bncs_disklog::bncs_disklog | ( | const char * | root,
 |  | enum filetype | mode = SINGLE
 | ) |  |

Constructs a bncs_disklog using the name supplied

Parameters
root | The subdirectory to use
mode | whether to use a single file (SINGLE), hourly files (TIMESTAMP_HOUR), or daily files (TIMESTAMP_DAY)
Example:
bncs_disklog log( "mything", bncs_disklog::SINGLE );
Note
The file is left open until the bncs_disklog object is destroyed

◆ ~bncs_disklog()

bncs_disklog::~bncs_disklog ( )
virtual

Cleanup this disklog object and closes the log file

Member Function Documentation

◆ clear()

void bncs_disklog::clear ( void )

Clear current log file Clear the contents of the current log file

◆ ref()

const char * bncs_disklog::ref ( void )

Return reference (date/time) to the log just written This is useful in telling the user a reference so that a developer may find the log entry easily on disk

Returns
reference string (not valid between bncs_disklog calls)
Example
bncs_disklog log( "mything" );
char *p = log.ref(); // p points to string of format "14/08/04 12:08:20 "

If you don't want to give a user an impossble to decipher error message tell them to log this reference for the developer to investigate later

◆ write()

void bncs_disklog::write | ( | const char * | msg1,
 |  | const char * | msg2 = 0,
 |  | const char * | msg3 = 0,
 |  | const char * | msg4 = 0,
 |  | const char * | msg5 = 0,
 |  | const char * | msg6 = 0
 | ) |  |

Write message(s) to log file

Parameters
msg1 | Message to log
msg2 | Optional message to log
msg3 | Optional message to log
msg4 | Optional message to log
msg5 | Optional message to log
msg6 | Optional message to log
Example:
bncs_disklog log( "mything" );
log.write( "Hello" "mum" );
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

bncs_disklog Member List

This is the complete list of members for bncs_disklog, including all inherited members.

bncs_disklog(const char *root, enum filetype mode, const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0) | bncs_disklog |
bncs_disklog(const char *root, enum filetype mode=SINGLE) | bncs_disklog |
clear(void) | bncs_disklog |
filetype enum name | bncs_disklog |
ref(void) | bncs_disklog |
SINGLE enum value | bncs_disklog |
TIMESTAMP_DAY enum value | bncs_disklog |
TIMESTAMP_HOUR enum value | bncs_disklog |
write(const char *msg1, const char *msg2=0, const char *msg3=0, const char *msg4=0, const char *msg5=0, const char *msg6=0) | bncs_disklog |
~bncs_disklog() | bncs_disklog | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: cBncsVersion Class Reference

cBncsVersion Class Reference

Provides an easy way of getting file versions short description. More...

#include <cBncsVersion.h>

Public Member Functions

cBncsVersion (const char *szFile)
virtual ~cBncsVersion ()

Public Attributes

char * | szComments
char * | szInternalName
char * | szProductName
char * | szCompanyName
char * | szLegalCopyright
char * | szProductVersion
char * | szLegalTradeMarks
char * | szPrivateBuild
char * | szOriginalFileName
char * | szSpecialBuild
char * | szFileVersion
char * | szFileDescription

Detailed Description

Provides an easy way of getting file versions short description.

This class allows access to the version information about any file, althought it is assummed that it will normally be used for your current file. Create the class, passing it the file name, including path, this will then populate the strings for the relevant vwersion information.

Currently this class is for windows only, and utilisses the Windows file version information, available by right clicking on a file , is is possible to add Linux code later, but this will get the information from within the code - yet to be written/confirmed

If the file does not contain these items the pointers will be set to zero.

An example QT use would be

cBncsVersion info(qApp->argv()[0]);
qDebug(info.szVersion);
qDebug(info.szDate);
qDebug(info.szTime);
qDebug(info.szDescription);

A standard windows app could use

szModFileName[256];
GetModuleFileName(hInst,szModFileName,256);
cBncsVersion info(szModFileName);
qDebug(info.szVersion);
qDebug(info.szDate);
qDebug(info.szTime);
qDebug(info.szDescription);

Operating system Notes

For Windows you will also need to link to version.lib

Constructor & Destructor Documentation

◆ cBncsVersion()

cBncsVersion::cBncsVersion ( const char * szFile )

The function cBncsVersion::cBncsVersion(char* szFile) creates an instance of the version class for the file szFile

Parameters
szFile
Returns

◆ ~cBncsVersion()

cBncsVersion::~cBncsVersion ( )
virtual

Member Data Documentation

◆ szComments

char* cBncsVersion::szComments

Comment value

◆ szCompanyName

char* cBncsVersion::szCompanyName

Company Name

◆ szFileDescription

char* cBncsVersion::szFileDescription

File Description

◆ szFileVersion

char* cBncsVersion::szFileVersion

File version

◆ szInternalName

char* cBncsVersion::szInternalName

Internal name

◆ szLegalCopyright

char* cBncsVersion::szLegalCopyright

Copyright information

◆ szLegalTradeMarks

char* cBncsVersion::szLegalTradeMarks

Legal trademarks

◆ szOriginalFileName

char* cBncsVersion::szOriginalFileName

Original file name

◆ szPrivateBuild

char* cBncsVersion::szPrivateBuild

Private build

◆ szProductName

char* cBncsVersion::szProductName

Product Name

◆ szProductVersion

char* cBncsVersion::szProductVersion

Product version

◆ szSpecialBuild

char* cBncsVersion::szSpecialBuild

Special build

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

cBncsVersion Member List

This is the complete list of members for cBncsVersion, including all inherited members.

cBncsVersion(const char *szFile) | cBncsVersion |
szComments | cBncsVersion |
szCompanyName | cBncsVersion |
szFileDescription | cBncsVersion |
szFileVersion | cBncsVersion |
szInternalName | cBncsVersion |
szLegalCopyright | cBncsVersion |
szLegalTradeMarks | cBncsVersion |
szOriginalFileName | cBncsVersion |
szPrivateBuild | cBncsVersion |
szProductName | cBncsVersion |
szProductVersion | cBncsVersion |
szSpecialBuild | cBncsVersion |
~cBncsVersion() | cBncsVersion | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: decodeBNCSString Class Reference

decodeBNCSString Class Reference

This is a class to split up strings in BNCS format. e.g. IR 123 001 001 'hello mum'. More...

#include <decodeBNCSString.h>

Public Member Functions

decodeBNCSString (const char *in, char delim='\'')
decodeBNCSString (const decodeBNCSString &in)
virtual ~decodeBNCSString ()

Public Attributes

const char * | sub [BNCS_STRING_SUBS]
int | subs

Detailed Description

This is a class to split up strings in BNCS format. e.g. IR 123 001 001 'hello mum'.

Constructor & Destructor Documentation

◆ decodeBNCSString() [1/2]

decodeBNCSString::decodeBNCSString | ( | const char * | in,
 |  | char | delim = '\''
 | ) |  |

Constructs a decodeBNCSString

Parameters
in input string

The maximum number of elements is BNCS_STRING_SUBS, which is currently 32

Example:
decodeBNCSString str( "IR 123 001 001 'hello mum'");
int count = str.subs; // count contains 5
printf( "first: %s", str.sub[ 0 ] ); // output "IR"
printf( "second: %s", str.sub[ 1 ] ); // output "123"
printf( "third: %s", str.sub[ 2 ] ); // output "001"
printf( "forth: %s", str.sub[ 3 ] ); // output "001"
printf( "fifth: %s", str.sub[ 4 ] ); // output "hello mum"
Note
Single quotes are stripped off the string

◆ decodeBNCSString() [2/2]

decodeBNCSString::decodeBNCSString ( const decodeBNCSString & in )

Copy Constructor

◆ ~decodeBNCSString()

decodeBNCSString::~decodeBNCSString ( )
virtual

Member Data Documentation

◆ sub

const char* decodeBNCSString::sub[BNCS_STRING_SUBS]

List of sub elements from the input string

◆ subs

int decodeBNCSString::subs

The number of sub elements from the input string

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

decodeBNCSString Member List

This is the complete list of members for decodeBNCSString, including all inherited members.

decodeBNCSString(const char *in, char delim='\'') | decodeBNCSString |
decodeBNCSString(const decodeBNCSString &in) | decodeBNCSString |
sub | decodeBNCSString |
subs | decodeBNCSString |
~decodeBNCSString() | decodeBNCSString | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: decodeCaptionString Class Reference

decodeCaptionString Class Reference

This is a class to split up strings in <parameter>=<value> format. More...

#include <decodecaptionstring.h>

Public Member Functions

decodeCaptionString (const char *)
~decodeCaptionString ()
decodeCaptionString (const decodeCaptionString &in)

Public Attributes

const char * | command
const char * | sub [SUBS]
const char * | value
int | subs
bool | valid

Detailed Description

This is a class to split up strings in <parameter>=<value> format.

Constructor & Destructor Documentation

◆ decodeCaptionString() [1/2]

decodeCaptionString::decodeCaptionString ( const char * in )

Constructs a decodeCaptionString

Parameters
in input string

The maximum number of elements is SUBS, which is currently

Example:
decodeCaptionString str( "param.1.2.3=abc");
int count = str.subs; // count contains 3
printf( "command: %s", str.command ); // output "param"
printf( "first: %s", str.sub[ 0 ] ); // output "1"
printf( "second: %s", str.sub[ 1 ] ); // output "2"
printf( "third: %s", str.sub[ 2 ] ); // output "3"
printf( "value: %s", str.value ); // output "abc"

◆ ~decodeCaptionString()

decodeCaptionString::~decodeCaptionString ( )

◆ decodeCaptionString() [2/2]

decodeCaptionString::decodeCaptionString ( const decodeCaptionString & in )

Copy Constructor

Member Data Documentation

◆ command

const char* decodeCaptionString::command

Pointer to the "command" part of the string

◆ sub

const char* decodeCaptionString::sub[SUBS]

Pointer list to the sub elements of the string

◆ subs

int decodeCaptionString::subs

The number of sub elements from the input string

◆ valid

bool decodeCaptionString::valid

true if the data in this class is valid

◆ value

const char* decodeCaptionString::value

Pointer to the value part of the string

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

decodeCaptionString Member List

This is the complete list of members for decodeCaptionString, including all inherited members.

command | decodeCaptionString
decodeCaptionString(const char *) | decodeCaptionString
decodeCaptionString(const decodeCaptionString &in) | decodeCaptionString
sub | decodeCaptionString
subs | decodeCaptionString
valid | decodeCaptionString
value | decodeCaptionString
~decodeCaptionString() | decodeCaptionString
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: sizedBuffer Class Reference

sizedBuffer Class Reference

#include <sizedBuffer.h>

Public Member Functions

sizedBuffer ()
sizedBuffer (const unsigned char *buf, int size, int ref=0)
sizedBuffer (const sizedBuffer &)
virtual | ~sizedBuffer ()
int | size () const
const unsigned char * | data () const
int | ref (void) const
sizedBuffer & | operator= (const sizedBuffer &in)
unsigned char | operator[] (int) const

Friends

bool operator== (const sizedBuffer &left, const sizedBuffer &right)

Constructor & Destructor Documentation

◆ sizedBuffer() [1/3]

sizedBuffer::sizedBuffer ( )

◆ sizedBuffer() [2/3]

sizedBuffer::sizedBuffer | ( | const unsigned char * | buf,
 |  | int | size,
 |  | int | ref = 0
 | ) |  |

◆ sizedBuffer() [3/3]

sizedBuffer::sizedBuffer ( const sizedBuffer & in )

◆ ~sizedBuffer()

sizedBuffer::~sizedBuffer ( )
virtual

Member Function Documentation

◆ data()

const unsigned char * sizedBuffer::data ( ) const

◆ operator=()

sizedBuffer & sizedBuffer::operator= ( const sizedBuffer & in )

◆ operator[]()

unsigned char sizedBuffer::operator[] ( int offset ) const

◆ ref()

int sizedBuffer::ref ( void ) const

◆ size()

int sizedBuffer::size ( ) const

Friends And Related Function Documentation

◆ operator==

bool operator== | ( | const sizedBuffer & | left,
 |  | const sizedBuffer & | right
 | ) |  |
friend
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

sizedBuffer Member List

This is the complete list of members for sizedBuffer, including all inherited members.

data() const | sizedBuffer |
operator=(const sizedBuffer &in) | sizedBuffer |
operator==(const sizedBuffer &left, const sizedBuffer &right) | sizedBuffer | friend
operator[](int) const | sizedBuffer |
ref(void) const | sizedBuffer |
size() const | sizedBuffer |
sizedBuffer() | sizedBuffer |
sizedBuffer(const unsigned char *buf, int size, int ref=0) | sizedBuffer |
sizedBuffer(const sizedBuffer &) | sizedBuffer |
~sizedBuffer() | sizedBuffer | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include/decodeBNCSString.h Source File

  • include
decodeBNCSString.h
1 #if !defined(AFX_DECODEBNCSSTRING_H__E35F7688_22E3_4717_BE27_D3C54B16D051__INCLUDED_)
2 #define AFX_DECODEBNCSSTRING_H__E35F7688_22E3_4717_BE27_D3C54B16D051__INCLUDED_
3
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
7
8 #define BNCS_STRING_SUBS 32
9
10 class decodeBNCSString
11 {
12 public:
13 decodeBNCSString( const char * in, char delim = '\'' );
14 decodeBNCSString(const decodeBNCSString & in);
15 virtual ~decodeBNCSString();
17 const char *sub[ BNCS_STRING_SUBS ];
19 int subs;
20 private:
21 char *copy;
22 char m_delim;
23 void split(const char * in);
24 };
25
26 #endif // !defined(AFX_DECODEBNCSSTRING_H__E35F7688_22E3_4717_BE27_D3C54B16D051__INCLUDED_)
decodeBNCSString::subs
int subs
Definition: decodeBNCSString.h:19
decodeBNCSString::decodeBNCSString
decodeBNCSString(const char *in, char delim='\'')
Definition: decodeBNCSString.cpp:30
decodeBNCSString::sub
const char * sub[BNCS_STRING_SUBS]
Definition: decodeBNCSString.h:17
decodeBNCSString::~decodeBNCSString
virtual ~decodeBNCSString()
Definition: decodeBNCSString.cpp:122
decodeBNCSString
This is a class to split up strings in BNCS format. e.g. IR 123 001 001 &#39;hello mum&#39;.
Definition: decodeBNCSString.h:10
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include/decodecaptionstring.h Source File

  • include
decodecaptionstring.h
1 #if !defined(AFX_DECODECAPTIONSTRING_H__E3CC3545_2B29_4323_9D26_7AF0057EB3D5__INCLUDED_)
2 #define AFX_DECODECAPTIONSTRING_H__E3CC3545_2B29_4323_9D26_7AF0057EB3D5__INCLUDED_
3
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
7
8
9 #ifdef _WIN32
10 #include <windows.h>
11 #endif
12 #include <stdio.h>
13
14 #define SUBS 32
15
16 class decodeCaptionString
17 {
18 public:
19 decodeCaptionString( const char * );
20 ~decodeCaptionString();
21 decodeCaptionString(const decodeCaptionString & in);
23 const char *command;
25 const char *sub[ SUBS ];
27 const char *value;
29 int subs;
31 bool valid;
32 #ifdef _WIN32
33 void dump( void );
34 char * toString( char * );
35 #endif
36 private:
37 char *copy;
38 void split(const char * in);
39 };
40
41 #endif // !defined(AFX_DECODECAPTIONSTRING_H__E3CC3545_2B29_4323_9D26_7AF0057EB3D5__INCLUDED_)
decodeCaptionString
This is a class to split up strings in <parameter>=<value> format.
Definition: decodecaptionstring.h:16
decodeCaptionString::command
const char * command
Definition: decodecaptionstring.h:23
decodeCaptionString::decodeCaptionString
decodeCaptionString(const char *)
Definition: decodecaptionstring.cpp:29
decodeCaptionString::subs
int subs
Definition: decodecaptionstring.h:29
decodeCaptionString::sub
const char * sub[SUBS]
Definition: decodecaptionstring.h:25
decodeCaptionString::valid
bool valid
Definition: decodecaptionstring.h:31
decodeCaptionString::~decodeCaptionString
~decodeCaptionString()
Definition: decodecaptionstring.cpp:93
decodeCaptionString::value
const char * value
Definition: decodecaptionstring.h:27
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include Directory Reference

  • include
include Directory Reference

Files

file | bncs_dateTime.h [code]
file | bncs_disklog.h [code]
file | cBncsVersion.h [code]
file | decodeBNCSString.h [code]
file | decodecaptionstring.h [code]
file | sizedBuffer.h [code]
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: BNCS V4.5 General Classes

BNCS V4.5 General Classes

These are general C++ classes for system/application development

Classes

  • bncs_disklog
  • cBncsVersion
  • decodeBNCSString
  • decodeCaptionString
  • bncs_dateTime
  • sizedBuffer
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: C:/bncs/build_auto/Core_System/Source/include/sizedBuffer.h Source File

  • include
sizedBuffer.h
1 // sizedBuffer.h: interface for the sizedBuffer class.
2 //
4
5 #if !defined(AFX_SIZEDBUFFER_H__94F01DA0_F09C_46E6_BE65_F9F98A7909B4__INCLUDED_)
6 #define AFX_SIZEDBUFFER_H__94F01DA0_F09C_46E6_BE65_F9F98A7909B4__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 class sizedBuffer
13 {
14 public:
15 sizedBuffer();
16 sizedBuffer( const unsigned char* buf, int size, int ref = 0 );
17
18 sizedBuffer( const sizedBuffer & );
19 virtual ~sizedBuffer();
20
21 #if _MSC_VER >= 1600
22 sizedBuffer( sizedBuffer&& x );
23 sizedBuffer& operator= ( sizedBuffer&& x);
24 #endif
25 int size() const;
26 const unsigned char * data() const;
27 int ref( void ) const;
28
29 sizedBuffer & operator=( const sizedBuffer & in );
30 friend bool operator==( const sizedBuffer & left, const sizedBuffer & right );
31
32 unsigned char operator[]( int ) const;
33 private:
34 unsigned char * m_buf;
35 int m_size;
36 int m_ref;
37 void doCopy( const sizedBuffer & in );
38 };
39
40
41 #endif // !defined(AFX_SIZEDBUFFER_H__94F01DA0_F09C_46E6_BE65_F9F98A7909B4__INCLUDED_)
sizedBuffer::~sizedBuffer
virtual ~sizedBuffer()
Definition: sizedBuffer.cpp:28
sizedBuffer::size
int size() const
Definition: sizedBuffer.cpp:103
sizedBuffer
Definition: sizedBuffer.h:12
sizedBuffer::ref
int ref(void) const
Definition: sizedBuffer.cpp:136
sizedBuffer::sizedBuffer
sizedBuffer()
Definition: sizedBuffer.cpp:5
sizedBuffer::operator==
friend bool operator==(const sizedBuffer &left, const sizedBuffer &right)
Definition: sizedBuffer.cpp:115
sizedBuffer::operator=
sizedBuffer & operator=(const sizedBuffer &in)
Definition: sizedBuffer.cpp:62
sizedBuffer::operator[]
unsigned char operator[](int) const
Definition: sizedBuffer.cpp:128
sizedBuffer::data
const unsigned char * data() const
Definition: sizedBuffer.cpp:109
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: bncs_date Struct Reference

bncs_date Struct Reference

#include <bncs_dateTime.h>

Public Attributes

int | day
int | month
int | year
int | dayOfWeek

Member Data Documentation

◆ day

int bncs_date::day

◆ dayOfWeek

int bncs_date::dayOfWeek

◆ month

int bncs_date::month

◆ year

int bncs_date::year
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

bncs_date Member List

This is the complete list of members for bncs_date, including all inherited members.

day | bncs_date
dayOfWeek | bncs_date
month | bncs_date
year | bncs_date
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: bncs_time Struct Reference

bncs_time Struct Reference

#include <bncs_dateTime.h>

Public Attributes

int | hour
int | minute
int | second
int | millisecond

Member Data Documentation

◆ hour

int bncs_time::hour

◆ millisecond

int bncs_time::millisecond

◆ minute

int bncs_time::minute

◆ second

int bncs_time::second
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 General Classes: Member List

bncs_time Member List

This is the complete list of members for bncs_time, including all inherited members.

hour | bncs_time
millisecond | bncs_time
minute | bncs_time
second | bncs_time
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_config.h Source File

  • include
bncs_config.h
1
2 #if !defined(AFX_BNCS_CONFIG_H__2AE549C3_AC8E_48DB_A1D1_D786DF7F1969__INCLUDED_)
3 #define AFX_BNCS_CONFIG_H__2AE549C3_AC8E_48DB_A1D1_D786DF7F1969__INCLUDED_
4
5 #if _MSC_VER > 1000
6 #pragma once
7 #endif // _MSC_VER > 1000
8
9 #ifdef BNCS_CONFIG_EXPORTS
10 #define DO_CONFIG_EXPORT __declspec(dllexport)
11 #else
12 #define DO_CONFIG_EXPORT __declspec(dllimport)
13 #endif
14
15 #include <bncs_string.h>
16
17 class QDomDocument;
18 class QDomNode;
19
20 // Note: the Qxxx classes are only referenced here as pointers
21 // this saves anyone using this class having to have a Qt licence
22
23 class DO_CONFIG_EXPORT bncs_config
24 {
25 public:
26 bncs_config( const bncs_string & name );
27 bncs_config( const bncs_config & c );
28 bncs_config();
29 bncs_config & operator=( const bncs_config & c );
30 virtual ~bncs_config();
31 bool isValid( void );
32 bool isChildValid( void );
33 bool nextChild( void);
34 bncs_string childAttr( const bncs_string & name );
35 bncs_string childTag( void );
36 bncs_string attr( const bncs_string & name );
37 bncs_string tag( void );
38 void drillDown( void );
39 bncs_string data( void );
40 static QDomDocument * cachedDoc( const bncs_string & name );
41 static bool isDirty( const bncs_string & name );
42 static int changeSerial( const bncs_string & name );
43 static bool save( void );
44 static int incSerial( const bncs_string & name );
45 static int decSerial( const bncs_string & name );
46 static void setEnv( const bncs_string & env );
47 static void clearCache();
48 static void overrideFileName(const bncs_string & sConfigName, const bncs_string & sFileName);
49 private:
50 QDomNode *parentNode;
51 QDomNode *currentNode;
52 static QDomDocument * loadDoc( const bncs_string & file );
53 inline bool correctNodeForComments( QDomNode & d );
54 };
55
56 #endif // !defined(AFX_BNCS_CONFIG_H__2AE549C3_AC8E_48DB_A1D1_D786DF7F1969__INCLUDED_)
bncs_config
This is a simple XML data access class.
Definition: bncs_config.h:23
bncs_string
This is a STL like string handling class.
Definition: bncs_string.h:24
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_dateTime.h Source File

  • include
bncs_dateTime.h
1 #if !defined(AFX_BNCS_DATETIME_H__4CA966ED_5AE0_439D_9938_99A6FC3EAD87__INCLUDED_)
2 #define AFX_BNCS_DATETIME_H__4CA966ED_5AE0_439D_9938_99A6FC3EAD87__INCLUDED_
3
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
7
8 #include <windows.h>
9 #include <stdio.h>
10
11 struct bncs_date
12 {
13 int day;
14 int month;
15 int year;
16 int dayOfWeek;
17 };
18
19 struct bncs_time
20 {
21 int hour;
22 int minute;
23 int second;
24 int millisecond;
25 };
26
27 class bncs_dateTime
28 {
29 public:
30 bncs_dateTime();
31 virtual ~bncs_dateTime();
32
33 bncs_dateTime( const bncs_dateTime & dt );
34 bncs_dateTime( const SYSTEMTIME & st );
35 bncs_dateTime( const FILETIME & ft );
36 bncs_dateTime( const char * isoDateTime );
37
38 static bncs_dateTime nowUTC( void );
39 static bncs_dateTime now( void );
40 const char* toString( const char* format = "dd MMM yyyy" );
41 void toString( char * out, int len, const char* format = "dd MMM yyyy" );
42
43 bool fromString( const char* in );
44 bool fromStringTime( const char * inStr );
45 bool fromStringDate( const char * inStr );
46
47 bool addSeconds( int seconds );
48 bool addMinutes( int minutes );
49 bool addHours( int hours );
50 bool addDays( int days );
51 bool addWeeks( int weeks );
52 bool addMonths( int months );
53 bool addYears( int years );
54
55 bool setDate( int day, int month, int year );
56 bool setTime( int hour, int minute, int second, int millisecond = 0 );
57
58 bool operator<( const bncs_dateTime & in ) const;
59 bool operator<=( const bncs_dateTime & in ) const;
60 bool operator>( const bncs_dateTime & in ) const;
61 bool operator>=( const bncs_dateTime & in ) const;
62 bool operator==( const bncs_dateTime & in ) const;
63 bool operator!=( const bncs_dateTime & in ) const;
64
65 __int64 difference( const bncs_dateTime & in ) const;
66 __int64 difference_seconds(const bncs_dateTime & in) const;
67 __int64 difference_milliseconds( const bncs_dateTime & in ) const;
68
69 operator __int64() const;
70 void clear( void );
71 bool isNull( void ) const;
72 void dump( const char* ) const;
73
74 bncs_time time( void ) const;
75 bncs_date date( void ) const;
76 private: // vars
77 FILETIME m_ftDateTime;
78 char m_outputString[ 64 ];
79 bool m_valid;
80 private: // funcs
81 void insertString( char * p, int delCount, const char* str );
82 };
83
84
85 #endif // !defined(AFX_BNCS_DATETIME_H__4CA966ED_5AE0_439D_9938_99A6FC3EAD87__INCLUDED_)
bncs_dateTime::toString
const char * toString(const char *format="dd MMM yyyy")
Definition: bncs_dateTime.cpp:192
bncs_dateTime::operator<=
bool operator<=(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:118
bncs_dateTime::operator>
bool operator>(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:131
bncs_dateTime::fromStringDate
bool fromStringDate(const char *inStr)
Definition: bncs_dateTime.cpp:698
bncs_time::hour
int hour
Definition: bncs_dateTime.h:21
bncs_dateTime::nowUTC
static bncs_dateTime nowUTC(void)
Definition: bncs_dateTime.cpp:83
bncs_dateTime::now
static bncs_dateTime now(void)
Definition: bncs_dateTime.cpp:97
bncs_date
Definition: bncs_dateTime.h:11
bncs_time::second
int second
Definition: bncs_dateTime.h:23
bncs_dateTime::addMinutes
bool addMinutes(int minutes)
Definition: bncs_dateTime.cpp:814
bncs_dateTime::addSeconds
bool addSeconds(int seconds)
Definition: bncs_dateTime.cpp:789
bncs_date::year
int year
Definition: bncs_dateTime.h:15
bncs_time::millisecond
int millisecond
Definition: bncs_dateTime.h:24
bncs_dateTime::operator<
bool operator<(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:105
bncs_time::minute
int minute
Definition: bncs_dateTime.h:22
bncs_dateTime::difference_milliseconds
__int64 difference_milliseconds(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:989
bncs_dateTime::setDate
bool setDate(int day, int month, int year)
Definition: bncs_dateTime.cpp:906
bncs_dateTime::isNull
bool isNull(void) const
Definition: bncs_dateTime.cpp:962
bncs_dateTime::bncs_dateTime
bncs_dateTime()
Definition: bncs_dateTime.cpp:29
bncs_dateTime::operator!=
bool operator!=(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:170
bncs_date::month
int month
Definition: bncs_dateTime.h:14
bncs_dateTime::addMonths
bool addMonths(int months)
Definition: bncs_dateTime.cpp:850
bncs_dateTime
This is a simple date/time class.
Definition: bncs_dateTime.h:27
bncs_dateTime::operator>=
bool operator>=(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:144
bncs_dateTime::addYears
bool addYears(int years)
Definition: bncs_dateTime.cpp:883
bncs_dateTime::difference_seconds
__int64 difference_seconds(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:1002
bncs_date::day
int day
Definition: bncs_dateTime.h:13
bncs_dateTime::fromStringTime
bool fromStringTime(const char *inStr)
Definition: bncs_dateTime.cpp:564
bncs_dateTime::addWeeks
bool addWeeks(int weeks)
Definition: bncs_dateTime.cpp:841
bncs_dateTime::operator==
bool operator==(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:157
bncs_dateTime::clear
void clear(void)
Definition: bncs_dateTime.cpp:952
bncs_date::dayOfWeek
int dayOfWeek
Definition: bncs_dateTime.h:16
bncs_dateTime::fromString
bool fromString(const char *in)
Definition: bncs_dateTime.cpp:652
bncs_dateTime::difference
__int64 difference(const bncs_dateTime &in) const
Definition: bncs_dateTime.cpp:972
bncs_dateTime::addHours
bool addHours(int hours)
Definition: bncs_dateTime.cpp:823
bncs_dateTime::addDays
bool addDays(int days)
Definition: bncs_dateTime.cpp:832
bncs_dateTime::~bncs_dateTime
virtual ~bncs_dateTime()
Definition: bncs_dateTime.cpp:34
bncs_dateTime::dump
void dump(const char *) const
Definition: bncs_dateTime.cpp:1023
bncs_dateTime::date
bncs_date date(void) const
Definition: bncs_dateTime.cpp:1045
bncs_dateTime::time
bncs_time time(void) const
Definition: bncs_dateTime.cpp:1030
bncs_dateTime::setTime
bool setTime(int hour, int minute, int second, int millisecond=0)
Definition: bncs_dateTime.cpp:931
bncs_time
Definition: bncs_dateTime.h:19
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_script_helper.h Source File

  • include
bncs_script_helper.h
1 /*************************************/
2 /* Original Version by David Yates */
3 /* Copyright Atos 2007 */
4 /*************************************/
5 #ifndef BNCS_SCRIPT_HELPER_INCLUDED
6 #define BNCS_SCRIPT_HELPER_INCLUDED
7
8 #include <bncs_client_callback.h>
9
10 #include <bncs_string.h>
11 #include <bncs_stringlist.h>
12
13
14 static char BNCS_SCRIPTHELPER_SIG[]="BNCS_SIG,name=bncs_script_helper,type=LIB,version=4.8.6.0,date=16/06/2017,author=David Yates";
15 /* enum revertiveType
16 {
17 ROUTER=1,
18 INFODRIVER,
19 GPI,
20 DATABASE,
21 };
22 // the following may be optionally filled by different revertive types
23 // e.g. database is not used by the infodriver revertive type
24 int iDevice;
25 int iDatabase;
26 int iIndex; // infodriver slot number / router index
27 int iInfo; // router source number
28 char szInfo[ 256 ]; // infodriver slot contents / router source name
29 enum revertiveType type;
30 const char *szDevice; // NYI
31 const char *szIndex; // NYI
32 */
33
34
74 class revertiveNotify
75 {
76 private:
77 CB_REVERTIVE *r;
78 public:
79 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80
81 revertiveNotify( CB_REVERTIVE * in )
82 {
83 r = in;
84 };
85 #endif // DOXYGEN_SHOULD_SKIP_THIS
86
90 int device( void )
91 {
92 return r->iDevice;
93 };
99 int database( void )
100 {
101 return r->iDatabase;
102 };
107 int index( void )
108 {
109 return r->iIndex;
110 };
115 int info( void )
116 {
117 return r->iInfo;
118 };
123 bncs_string sInfo( void )
124 {
125 return r->szInfo;
126 };
141 int type( void )
142 {
143 return r->type;
144 };
145
149 void dump( const char* header = 0 )
150 {
151 bncs_string out;
152
153 switch( r->type )
154 {
155 case 1:
156 out = bncs_string( "RR %1 %2 %3 '%4'" ).arg( r->iDevice ).arg( r->iIndex ).arg( r->iInfo ).arg( r->szInfo );
157 break;
158 case 2:
159 out = bncs_string( "IR %1 %2 '%3'" ).arg( r->iDevice ).arg( r->iIndex ).arg( r->szInfo );
160 break;
161 case 3:
162 out = bncs_string( "GR %1 %2 %3" ).arg( r->iDevice ).arg( r->iIndex ).arg( r->iInfo );
163 break;
164 case 4:
165 out = bncs_string( "RD %1 %2 %3 '%4'" ).arg( r->iDevice ).arg( r->iIndex ).arg( r->iDatabase ).arg( r->szInfo );
166 break;
167 }
168
169 if( header )
170 OutputDebugString( bncs_string( "%1: %2" ).arg( header ).arg( out ));
171 else
172 OutputDebugString( out );
173 }
174
175 };
176
220 class buttonNotify
221 {
222 private:
223 CB_BUTTON * b;
224 public:
225 #ifndef DOXYGEN_SHOULD_SKIP_THIS
226
227 buttonNotify( CB_BUTTON * in )
228 {
229 b = in;
230 };
231 #endif // DOXYGEN_SHOULD_SKIP_THIS
232
236 bncs_string id()
237 {
238 return b->szId;
239 };
244 bncs_string panel()
245 {
246 return b->szPanel;
247 };
256 int subs()
257 {
258 return b->dec->subs;
259 };
272 bncs_string sub( int in )
273 {
274 return b->dec->sub[ in ];
275 };
286 bncs_string command()
287 {
288 return b->dec->command;
289 };
300 bncs_string value()
301 {
302 return b->dec->value;
303 };
304
308 void dump( const char* header = 0 )
309 {
310 if( b && b->dec )
311 {
312 bncs_string out = b->szId;
313
314 out += ": ";
315 out += b->dec->command;
316
317 for( int x = 0 ; x < b->dec->subs ; x++ )
318 out += bncs_string( ".%1" ).arg( b->dec->sub[ x ] );
319
320 out += "=";
321 out += b->dec->value;
322
323 if( header )
324 OutputDebugString( bncs_string( "%1: %2" ).arg( header ).arg( out ));
325 else
326 OutputDebugString( out );
327 }
328 }
329 };
330
335 class parentNotify
336 {
337 private:
338 decodeCaptionString *dec;
339 public:
340 #ifndef DOXYGEN_SHOULD_SKIP_THIS
341
342 parentNotify( decodeCaptionString *in)
343 {
344 dec = in;
345 }
346 #endif // DOXYGEN_SHOULD_SKIP_THIS
347
355 int subs()
356 {
357 return dec->subs;
358 };
371 bncs_string sub( int in )
372 {
373 return dec->sub[ in ];
374 };
385 bncs_string command()
386 {
387 return dec->command;
388 };
399 bncs_string value()
400 {
401 return dec->value;
402 };
403
407 void dump( const char* header = 0 )
408 {
409 if( dec )
410 {
411 bncs_string out = dec->command;
412
413 for( int x = 0 ; x < dec->subs ; x++ )
414 out += bncs_string( ".%1" ).arg( dec->sub[ x ] );
415
416 out += "=";
417 out += dec->value;
418
419 if( header )
420 OutputDebugString( bncs_string( "%1: %2" ).arg( header ).arg( out ));
421 else
422 OutputDebugString( out );
423 }
424 }
425 };
426
427
428
429
448 class httpNotify
449 {
450 private:
451 CB_HTTP * h;
452 public:
453 #ifndef DOXYGEN_SHOULD_SKIP_THIS
454
455 httpNotify( CB_HTTP * in )
456 {
457 h = in;
458 };
459 #endif // DOXYGEN_SHOULD_SKIP_THIS
460
464 bncs_string url( void )
465 {
466 return h->url;
467 };
472 bncs_string data( void )
473 {
474 return h->data;
475 };
476
481 bool string( void )
482 {
483 return h->string;
484 };
485
490 bool ok( void )
491 {
492 return h->ok;
493 };
494
499 bncs_string err( void )
500 {
501 return h->err;
502 };
503
504 };
505
506 class bncs_script_helper : public bncs_client_callback
507 {
508 public:
509 bool getDevSlot(const bncs_string & instance, const bncs_string & param, int* dev, int* slot, char* type);
510 bool getDevSlot( const bncs_string & instance, const bncs_string & param, bncs_string & altId, int *dev, int *slot, char *type);
511 bool getDev(bncs_string instance, int* dev, int* offset = 0);
512 void audioStopAll();
513 void audioDestroy(const bncs_string &name);
514 void audioStop(const bncs_string &name);
515 void audioPlay(const bncs_string & name, int repeat);
516 void audioPlay(const bncs_string & name, const bncs_string & file, int repeat);
517 bncs_script_helper( bncs_client_callback * parent, const char * path );
518 virtual ~bncs_script_helper();
519 void* callback( const void *, int );
520
521 // panel commands
522 bool panelShow( const bncs_string & pnl, const bncs_string & path, const bncs_string & target="" );
523 bool panelInit( const bncs_string & pnl, const bncs_string & path, const bncs_string & target="" );
524 bool panelTarget( const bncs_string & pnl, const bncs_string & target);
525 bool panelPopup( const bncs_string & pnl, const bncs_string & path, int width = 0, int height = 0 );
526 bool panelRemove( const bncs_string & pnl );
527 bool panelDestroy( const bncs_string & pnl );
528
529 // text commands
530 void textPut( const bncs_string & what, const bncs_string & pnl, const bncs_string & id );
531 void textPut( const bncs_string & param, const bncs_string & value, const bncs_string & pnl, const bncs_string & id );
532 void textGet( const bncs_string & what, const bncs_string & pnl, const bncs_string & id, bncs_string & ret);
533
534 // router commands
535 void routerName( int dev, int db, int index, bncs_string & ret );
536 int routerIndex( int dev, int db, const bncs_string & name );
537 void routerCrosspoint( int dev, int source, int dest, const bncs_string & mask="", bool now = false );
538 void routerRegister( int dev, int start, int end, bool add=false );
539 void routerUnregister( int dev );
540 void routerPoll( int dev, int start, int end );
541 void routerQuery( int dev, int start, int end );
542 void routerModify( int dev, int database, int index, const bncs_string& name, bool reload );
543
544 // info commands
545 void infoUnregister( int dev );
546 void infoPoll( int dev, int start, int end );
547 void infoWrite( int dev, const bncs_string & what, int index, bool now = false );
548 void infoWrite( const bncs_string & format, ... );
549 void infoQuery( int dev, int start, int end );
550 void infoRegister( int dev, int start, int end, bool add=false );
551
552 // gpi commands
553 void gpiRegister( int dev, int start, int end, bool add=false );
554 void gpiSwitch( int dev, bool state, int index, bool now = false );
555 void gpiPoll( int dev, int start, int end );
556 void gpiQuery( int dev, int start, int end );
557 void gpiUnregister( int dev );
558
559 // other commands
560 void timerStart( int timer, int duration );
561 void timerStop( int timer );
562 void captionEnable( bool captionOn, const bncs_string & title, const bncs_string & args = "" );
563 void setGeometry( int x, int y, int w, int h );
564 void setSize( int w, int h );
565 void setSize( const bncs_string & pnl );
566
567 // control commands
568 void controlEnable( const bncs_string & panel, const bncs_string & id );
569 void controlDisable( const bncs_string & panel, const bncs_string & id );
570
571 void controlShow( const bncs_string & panel, const bncs_string & id );
572 void controlHide( const bncs_string & panel, const bncs_string & id );
573
574 void controlMove( const bncs_string & panel, const bncs_string & id, int x, int y );
575 void controlPosition( const bncs_string & panel, const bncs_string & id, bncs_string & x, bncs_string & y);
576
577 bncs_string controlCreate( const bncs_string & panel, const bncs_string & id, const bncs_string & buttonClass, int x, int y, int w, int h, const bncs_string & settings );
578 bool controlDestroy( const bncs_string & panel, const bncs_string & id );
579
580 // host commands
581 void hostNotify( const bncs_string & message );
582 bncs_string id( void );
583
584 // callbacks
590 #ifdef BNCS_CALLBACK_BY_REF
591 virtual void buttonCallback( buttonNotify &b )=0;
592 #else
593 virtual void buttonCallback( buttonNotify *b )=0;
594 #endif
595
600 #ifdef BNCS_CALLBACK_BY_REF
601 virtual int revertiveCallback( revertiveNotify & r )=0;
602 #else
603 virtual int revertiveCallback( revertiveNotify * r )=0;
604 #endif
605
611 #ifdef BNCS_CALLBACK_BY_REF
612 virtual bncs_string parentCallback( parentNotify &p )=0;
613 #else
614 virtual bncs_string parentCallback( parentNotify *p )=0;
615 #endif
616
622 #ifdef BNCS_CALLBACK_BY_REF
623 virtual void httpCallback( httpNotify &p ){}; // this has an implementation so that existing scripts don't throw an error
624 #else
625 virtual void httpCallback( httpNotify *p ){};
626 #endif
627
633 virtual void timerCallback( int )=0;
634
640 virtual void databaseCallback( revertiveNotify * r ){};
641
642 void debug( const bncs_string & str );
643 void debug( const bncs_string & format, const bncs_string & in1, const bncs_string & in2="", const bncs_string & in3="", const bncs_string & in4="", const bncs_string & in5="", const bncs_string & in6="", const bncs_string & in7="", const bncs_string & in8="", const bncs_string & in9="" );
644
645 int workstation( void );
646
647 void navigateAdjust( const bncs_string & str );
648 void navigateExecute( const bncs_string & str );
649 bool navigateCanExecute( const bncs_string & str );
650 bool navigateCanAdjust( const bncs_string & str );
651 bncs_stringlist getWorkstationSettings( void );
652 bncs_string getWorkstationSetting(const bncs_string & setting);
653 bncs_string getObjectSetting(const bncs_string & object, const bncs_string & setting);
654 int getRouterSize(int intDevice, int intSwitch);
655 bncs_string getUser( void );
656 bncs_string getUserLevel( void );
657 int getUserLevelInt( void );
658 bncs_stringlist getIdList( const bncs_string & pnl, const bncs_string & startsWithFilter="" );
659 void enableActionAll();
660 void actionAll(const bncs_string & sValue);
661
662 void httpGet( const bncs_string & url, const bncs_string & localFile );
663 void httpGetString( const bncs_string & url );
664
665 void httpPut( const bncs_string & url, const bncs_string & localFile );
666 void httpPutString( const bncs_string & url, const bncs_string & string );
667
668 private:
669 bncs_client_callback * logic;
670 bncs_string exePath;
671 bool m_bEnableAck;
672 };
673
674 #define EXPORT_BNCS_SCRIPT( a ) extern "C" \
675 {\
676 EXPORT_SCRIPT bncs_client_callback * load_bncs_client_script( bncs_client_callback * parent, const char * path ) {return new a( parent, path );};\
677 }\
678
679 #define DESCRIBE_BNCS_SCRIPT( a ) extern "C" \
680 {\
681 EXPORT_SCRIPT const char * describe_bncs_client_script( void ) {return a;};\
682 }\
683
684 #endif // BNCS_SCRIPT_HELPER_INCLUDED
bncs_script_helper::routerQuery
void routerQuery(int dev, int start, int end)
Definition: bncs_script_helper.cpp:825
bncs_script_helper::revertiveCallback
virtual int revertiveCallback(revertiveNotify *r)=0
buttonNotify::subs
int subs()
Definition: bncs_script_helper.h:256
buttonNotify::command
bncs_string command()
Definition: bncs_script_helper.h:286
revertiveNotify::sInfo
bncs_string sInfo(void)
Definition: bncs_script_helper.h:123
buttonNotify::panel
bncs_string panel()
Definition: bncs_script_helper.h:244
bncs_script_helper::panelInit
bool panelInit(const bncs_string &pnl, const bncs_string &path, const bncs_string &target="")
Definition: bncs_script_helper.cpp:238
bncs_script_helper::hostNotify
void hostNotify(const bncs_string &message)
Definition: bncs_script_helper.cpp:1181
bncs_script_helper::enableActionAll
void enableActionAll()
Definition: bncs_script_helper.cpp:1865
bncs_string::arg
bncs_string arg(const bncs_string &in) const
Definition: bncs_string.cpp:1344
bncs_script_helper::controlPosition
void controlPosition(const bncs_string &panel, const bncs_string &id, bncs_string &x, bncs_string &y)
Definition: bncs_script_helper.cpp:1099
parentNotify::parentNotify
parentNotify(decodeCaptionString *in)
Definition: bncs_script_helper.h:342
bncs_script_helper::httpGetString
void httpGetString(const bncs_string &url)
Definition: bncs_script_helper.cpp:1961
bncs_script_helper::actionAll
void actionAll(const bncs_string &sValue)
Definition: bncs_script_helper.cpp:1792
buttonNotify::dump
void dump(const char *header=0)
Definition: bncs_script_helper.h:308
bncs_script_helper::timerCallback
virtual void timerCallback(int)=0
bncs_script_helper::getUserLevel
bncs_string getUserLevel(void)
Definition: bncs_script_helper.cpp:1476
bncs_script_helper::gpiRegister
void gpiRegister(int dev, int start, int end, bool add=false)
Definition: bncs_script_helper.cpp:847
bncs_script_helper::infoUnregister
void infoUnregister(int dev)
Definition: bncs_script_helper.cpp:703
bncs_script_helper::debug
void debug(const bncs_string &str)
Definition: bncs_script_helper.cpp:1198
parentNotify::command
bncs_string command()
Definition: bncs_script_helper.h:385
bncs_script_helper::timerStart
void timerStart(int timer, int duration)
Definition: bncs_script_helper.cpp:961
buttonNotify::sub
bncs_string sub(int in)
Definition: bncs_script_helper.h:272
httpNotify::ok
bool ok(void)
Definition: bncs_script_helper.h:490
bncs_script_helper::controlShow
void controlShow(const bncs_string &panel, const bncs_string &id)
Definition: bncs_script_helper.cpp:1047
parentNotify::sub
bncs_string sub(int in)
Definition: bncs_script_helper.h:371
httpNotify::err
bncs_string err(void)
Definition: bncs_script_helper.h:499
bncs_script_helper::infoWrite
void infoWrite(int dev, const bncs_string &what, int index, bool now=false)
Definition: bncs_script_helper.cpp:758
revertiveNotify::device
int device(void)
Definition: bncs_script_helper.h:90
bncs_script_helper::audioStop
void audioStop(const bncs_string &name)
Definition: bncs_script_helper.cpp:1565
bncs_script_helper::getWorkstationSetting
bncs_string getWorkstationSetting(const bncs_string &setting)
Definition: bncs_script_helper.cpp:1359
revertiveNotify::type
int type(void)
Definition: bncs_script_helper.h:141
bncs_script_helper::getRouterSize
int getRouterSize(int intDevice, int intSwitch)
Definition: bncs_script_helper.cpp:1387
bncs_script_helper::getIdList
bncs_stringlist getIdList(const bncs_string &pnl, const bncs_string &startsWithFilter="")
Definition: bncs_script_helper.cpp:1755
revertiveNotify::info
int info(void)
Definition: bncs_script_helper.h:115
bncs_script_helper::infoPoll
void infoPoll(int dev, int start, int end)
Definition: bncs_script_helper.cpp:721
bncs_script_helper::id
bncs_string id(void)
Definition: bncs_script_helper.cpp:1880
bncs_script_helper::panelTarget
bool panelTarget(const bncs_string &pnl, const bncs_string &target)
Definition: bncs_script_helper.cpp:270
revertiveNotify
A class that passes on information about BNCS events.
Definition: bncs_script_helper.h:74
bncs_script_helper::navigateExecute
void navigateExecute(const bncs_string &str)
Definition: bncs_script_helper.cpp:1258
bncs_script_helper::callback
void * callback(const void *, int)
Definition: bncs_script_helper.cpp:57
httpNotify::data
bncs_string data(void)
Definition: bncs_script_helper.h:472
bncs_script_helper::panelPopup
bool panelPopup(const bncs_string &pnl, const bncs_string &path, int width=0, int height=0)
Definition: bncs_script_helper.cpp:303
bncs_script_helper::getObjectSetting
bncs_string getObjectSetting(const bncs_string &object, const bncs_string &setting)
Definition: bncs_script_helper.cpp:1428
httpNotify::httpNotify
httpNotify(CB_HTTP *in)
Definition: bncs_script_helper.h:455
buttonNotify
A class that passes on information about button notifications.
Definition: bncs_script_helper.h:220
bncs_script_helper::gpiUnregister
void gpiUnregister(int dev)
Definition: bncs_script_helper.cpp:929
bncs_script_helper::getDev
bool getDev(bncs_string instance, int *dev, int *offset=0)
Definition: bncs_script_helper.cpp:1718
bncs_script_helper::setSize
void setSize(int w, int h)
Definition: bncs_script_helper.cpp:389
parentNotify
A class that passes on information about parent notifications.
Definition: bncs_script_helper.h:335
parentNotify::dump
void dump(const char *header=0)
Definition: bncs_script_helper.h:407
bncs_script_helper::routerUnregister
void routerUnregister(int dev)
Definition: bncs_script_helper.cpp:685
bncs_script_helper::bncs_script_helper
bncs_script_helper(bncs_client_callback *parent, const char *path)
Definition: bncs_script_helper.cpp:41
bncs_script_helper::gpiQuery
void gpiQuery(int dev, int start, int end)
Definition: bncs_script_helper.cpp:911
revertiveNotify::revertiveNotify
revertiveNotify(CB_REVERTIVE *in)
Definition: bncs_script_helper.h:81
bncs_script_helper::httpPutString
void httpPutString(const bncs_string &url, const bncs_string &string)
Definition: bncs_script_helper.cpp:1984
bncs_script_helper::buttonCallback
virtual void buttonCallback(buttonNotify *b)=0
bncs_script_helper::routerName
void routerName(int dev, int db, int index, bncs_string &ret)
Definition: bncs_script_helper.cpp:540
httpNotify::string
bool string(void)
Definition: bncs_script_helper.h:481
bncs_string
This is a STL like string handling class.
Definition: bncs_string.h:24
bncs_script_helper::controlDestroy
bool controlDestroy(const bncs_string &panel, const bncs_string &id)
Definition: bncs_script_helper.cpp:1162
bncs_script_helper::workstation
int workstation(void)
Definition: bncs_script_helper.cpp:1312
bncs_script_helper::databaseCallback
virtual void databaseCallback(revertiveNotify *r)
Definition: bncs_script_helper.h:640
bncs_script_helper::setGeometry
void setGeometry(int x, int y, int w, int h)
Definition: bncs_script_helper.cpp:371
parentNotify::value
bncs_string value()
Definition: bncs_script_helper.h:399
bncs_script_helper::gpiSwitch
void gpiSwitch(int dev, bool state, int index, bool now=false)
Definition: bncs_script_helper.cpp:869
bncs_script_helper::routerCrosspoint
void routerCrosspoint(int dev, int source, int dest, const bncs_string &mask="", bool now=false)
Definition: bncs_script_helper.cpp:589
buttonNotify::buttonNotify
buttonNotify(CB_BUTTON *in)
Definition: bncs_script_helper.h:227
bncs_script_helper::audioDestroy
void audioDestroy(const bncs_string &name)
Definition: bncs_script_helper.cpp:1583
bncs_script_helper::getUserLevelInt
int getUserLevelInt(void)
Definition: bncs_script_helper.cpp:1496
bncs_script_helper::infoRegister
void infoRegister(int dev, int start, int end, bool add=false)
Definition: bncs_script_helper.cpp:663
bncs_script_helper::httpCallback
virtual void httpCallback(httpNotify *p)
Definition: bncs_script_helper.h:625
bncs_script_helper::gpiPoll
void gpiPoll(int dev, int start, int end)
Definition: bncs_script_helper.cpp:887
parentNotify::subs
int subs()
Definition: bncs_script_helper.h:355
bncs_stringlist
This is bncs_string helper class to deal with lists of string.
Definition: bncs_stringlist.h:57
httpNotify::url
bncs_string url(void)
Definition: bncs_script_helper.h:464
bncs_script_helper::routerRegister
void routerRegister(int dev, int start, int end, bool add=false)
Definition: bncs_script_helper.cpp:616
bncs_script_helper::routerIndex
int routerIndex(int dev, int db, const bncs_string &name)
Definition: bncs_script_helper.cpp:569
revertiveNotify::database
int database(void)
Definition: bncs_script_helper.h:99
bncs_script_helper::audioStopAll
void audioStopAll()
Definition: bncs_script_helper.cpp:1600
bncs_script_helper::panelShow
bool panelShow(const bncs_string &pnl, const bncs_string &path, const bncs_string &target="")
Definition: bncs_script_helper.cpp:195
bncs_script_helper::getUser
bncs_string getUser(void)
Definition: bncs_script_helper.cpp:1450
bncs_script_helper::getWorkstationSettings
bncs_stringlist getWorkstationSettings(void)
Definition: bncs_script_helper.cpp:1333
bncs_script_helper::routerPoll
void routerPoll(int dev, int start, int end)
Definition: bncs_script_helper.cpp:739
bncs_script_helper::controlHide
void controlHide(const bncs_string &panel, const bncs_string &id)
Definition: bncs_script_helper.cpp:1064
bncs_script_helper::panelRemove
bool panelRemove(const bncs_string &pnl)
Definition: bncs_script_helper.cpp:333
bncs_script_helper::audioPlay
void audioPlay(const bncs_string &name, int repeat)
Definition: bncs_script_helper.cpp:1547
bncs_script_helper::textPut
void textPut(const bncs_string &what, const bncs_string &pnl, const bncs_string &id)
Definition: bncs_script_helper.cpp:444
bncs_script_helper::textGet
void textGet(const bncs_string &what, const bncs_string &pnl, const bncs_string &id, bncs_string &ret)
Definition: bncs_script_helper.cpp:489
bncs_script_helper::captionEnable
void captionEnable(bool captionOn, const bncs_string &title, const bncs_string &args="")
Definition: bncs_script_helper.cpp:353
bncs_script_helper::getDevSlot
bool getDevSlot(const bncs_string &instance, const bncs_string &param, int *dev, int *slot, char *type)
Definition: bncs_script_helper.cpp:1692
bncs_script_helper::navigateCanExecute
bool navigateCanExecute(const bncs_string &str)
Definition: bncs_script_helper.cpp:1275
bncs_script_helper::infoQuery
void infoQuery(int dev, int start, int end)
Definition: bncs_script_helper.cpp:801
revertiveNotify::dump
void dump(const char *header=0)
Definition: bncs_script_helper.h:149
buttonNotify::value
bncs_string value()
Definition: bncs_script_helper.h:300
bncs_script_helper::controlCreate
bncs_string controlCreate(const bncs_string &panel, const bncs_string &id, const bncs_string &buttonClass, int x, int y, int w, int h, const bncs_string &settings)
Definition: bncs_script_helper.cpp:1140
bncs_script_helper::~bncs_script_helper
virtual ~bncs_script_helper()
Definition: bncs_script_helper.cpp:51
bncs_script_helper::httpPut
void httpPut(const bncs_string &url, const bncs_string &localFile)
Definition: bncs_script_helper.cpp:1939
bncs_script_helper
The base class for QtUI C++ scripts.
Definition: bncs_script_helper.h:506
bncs_script_helper::parentCallback
virtual bncs_string parentCallback(parentNotify *p)=0
bncs_script_helper::controlMove
void controlMove(const bncs_string &panel, const bncs_string &id, int x, int y)
Definition: bncs_script_helper.cpp:1081
bncs_script_helper::httpGet
void httpGet(const bncs_string &url, const bncs_string &localFile)
Definition: bncs_script_helper.cpp:1917
bncs_script_helper::panelDestroy
bool panelDestroy(const bncs_string &pnl)
Definition: bncs_script_helper.cpp:422
bncs_script_helper::routerModify
void routerModify(int dev, int database, int index, const bncs_string &name, bool reload)
Definition: bncs_script_helper.cpp:641
bncs_script_helper::controlEnable
void controlEnable(const bncs_string &panel, const bncs_string &id)
Definition: bncs_script_helper.cpp:1013
buttonNotify::id
bncs_string id()
Definition: bncs_script_helper.h:236
revertiveNotify::index
int index(void)
Definition: bncs_script_helper.h:107
bncs_script_helper::timerStop
void timerStop(int timer)
Definition: bncs_script_helper.cpp:995
httpNotify
A class that passes on information about HTTP (file transfer) notifications.
Definition: bncs_script_helper.h:448
bncs_script_helper::navigateAdjust
void navigateAdjust(const bncs_string &str)
Definition: bncs_script_helper.cpp:1240
bncs_script_helper::navigateCanAdjust
bool navigateCanAdjust(const bncs_string &str)
Definition: bncs_script_helper.cpp:1294
bncs_script_helper::controlDisable
void controlDisable(const bncs_string &panel, const bncs_string &id)
Definition: bncs_script_helper.cpp:1030
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_string.h Source File

  • include
bncs_string.h
1 #ifndef bncs_string_included
2 #define bncs_string_included
3
4 #ifdef BNCS_STRING_EXPORTS
5 #ifndef NO_BNCS_STRING_EXPORTS
6 #define DO_STRING_EXPORT __declspec(dllexport)
7 // #pragma message( "string exports" )
8 #else
9 #define DO_STRING_EXPORT
10 // #pragma message( "no string exports or imports" )
11 #endif
12 #else
13 #ifndef NO_BNCS_STRING_EXPORTS
14 #define DO_STRING_EXPORT __declspec(dllimport)
15 // #pragma message( "string imports" )
16 #else
17 #define DO_STRING_EXPORT
18 // #pragma message( "no string exports or imports 2" )
19 #endif
20 #endif
21
22 #include <string>
23
24 class DO_STRING_EXPORT bncs_string
25 {
26 friend class bncs_stringlist;
27 private:
28 char * buf;
29 unsigned int len;
30 bncs_string & decrementPlaceholders( void );
31 bool iswhitespace( char c ) const;
32 public:
33 // construction / destruction
34 bncs_string( const char* in);
35 bncs_string( void );
36 bncs_string( const bncs_string & in );
37 bncs_string( int in, char pad = 0, unsigned int padto =0 , int base = 10 );
38 bncs_string( double in, int digits, char pad = 0, unsigned int padto = 0 );
39 bncs_string( char in );
40 bncs_string( const std::string & in) { (*this) = in.c_str(); }
41
42 // // Move constructor.
43 // bncs_string( bncs_string && other );
44
45 virtual ~bncs_string();
46
47 // operators
48 const char operator[]( unsigned int pos ) const;
49 char & operator[]( int pos );
50 operator const char*() const;
51 operator int() const;
52
53 // removed to save cross-compiler version woes - std::string will just happily construct with a const char*
54 //operator std::string() const;
55
56 // operator double() has been removed as it causes ambiguity problems.
57 // Use toDouble().
58 // operator double() const;
59
60 bncs_string & operator=( const char* in );
61 bncs_string & operator=( const bncs_string &in );
62
63 // // Move assignment operator.
64 // bncs_string & operator=( bncs_string && other );
65
66 friend DO_STRING_EXPORT const bncs_string operator+ ( const bncs_string & in, const bncs_string & in2 );
67 friend DO_STRING_EXPORT const bncs_string operator+ ( const bncs_string & in, int in2);
68 friend DO_STRING_EXPORT const bncs_string operator+ ( int in2, const bncs_string & in);
69 friend DO_STRING_EXPORT const bncs_string operator+ ( const bncs_string & in, const char* in2);
70 friend DO_STRING_EXPORT const bncs_string operator+ ( const char* in2, const bncs_string & in );
71
72 bncs_string & operator+= ( const bncs_string & in );
73 friend DO_STRING_EXPORT bool operator==( const bncs_string &, const bncs_string & );
74 friend DO_STRING_EXPORT bool operator!=( const bncs_string &, const bncs_string & );
75
76 friend DO_STRING_EXPORT bool operator==( const bncs_string & in1, const char* in2 );
77 friend DO_STRING_EXPORT bool operator!=( const bncs_string & in1, const char* in2 );
78
79 friend DO_STRING_EXPORT bool operator==( const char* in2, const bncs_string & in1);
80 friend DO_STRING_EXPORT bool operator!=( const char* in2, const bncs_string & in1);
81
82 friend DO_STRING_EXPORT bool operator==( const bncs_string & in1, int in2 );
83 friend DO_STRING_EXPORT bool operator!=( const bncs_string & in1, int in2 );
84
85 friend DO_STRING_EXPORT bool operator==( int in2, const bncs_string & in1 );
86 friend DO_STRING_EXPORT bool operator!=( int in2, const bncs_string & in1 );
87 /* technically correct but redundant as the above friend operators take care of all we need
88 bool operator!=( const bncs_string & in ) const;
89 bool operator!=( const char * in ) const;
90 bool operator==( const bncs_string & in ) const;
91 bool operator==( const char * in ) const;
92 */
93 // debug
94 void dump( void );
95
96 // misc
97 bncs_string & append( const bncs_string & in );
98 bncs_string & append( char in );
99 bncs_string & append( int in, char pad = 0, int padto = 0, int base = 10 );
100
101 int toInt( void ) const;
102 int firstInt( void ) const;
103 long toLong( void ) const;
104 unsigned int toUInt( int base = 10 ) const;
105 unsigned long toULong( int base = 10 ) const;
106 double toDouble( void ) const;
107
108 unsigned int length( void ) const;
109 void truncate( unsigned int newlength );
110
111 int find( char c, int index=0, bool cs=true ) const;
112 int rfind( char c, int index=2147483647, bool cs=true ) const;
113 int find( const bncs_string & s, int index=0, bool cs=true ) const;
114 int contains( char c, bool cs=true ) const;
115 // int contains( const bncs_string & substring, bool cs=true ) const;
116 bool startsWith( const bncs_string & s) const;
117 bool endsWith( const bncs_string & s) const;
118
119
120 bncs_string left( unsigned int length ) const;
121 bncs_string right( unsigned int length ) const;
122
123 bncs_string mid( unsigned int start, unsigned int length ) const;
124
125 bncs_string lower( void ) const;
126 bncs_string upper( void ) const;
127 bncs_string stripWhiteSpace( void ) const;
128 bncs_string simplifyWhiteSpace( void ) const;
129
130 bncs_string arg( const bncs_string & in ) const;
131 bncs_string arg( const char* in ) const;
132 bncs_string arg( int in, char pad=0, unsigned int padto = 0, int base = 10 ) const;
133 bncs_string arg( long in ) const;
134
135 bncs_string & remove( unsigned int where, unsigned int howmany );
136 bncs_string & insert( unsigned int where, const bncs_string & what );
137 bncs_string & replace( const bncs_string & what, const bncs_string & with );
138 bncs_string & replace( char what, char with );
139
140 bncs_string & cleanup( bool BNCSi = true );
141 int split( char delim, bncs_string & part1, bncs_string & part2 ) const;
142
143 bncs_string justifyLeft( int howMany, char with ) const;
144 bncs_string justifyRight( int howMany, char with ) const;
145
146 friend DO_STRING_EXPORT bool operator<( const bncs_string & in1, const bncs_string & in2 );
147
148 friend DO_STRING_EXPORT std::ostream & operator<<( std::ostream & os, const bncs_string & s );
149
150 // using std::string;
151 // friend DO_STRING_EXPORT string::string( const bncs_string & s );
152 };
153
154 #endif // bncs_string_included
155
bncs_stringlist::operator+=
bncs_stringlist & operator+=(const bncs_string &)
Definition: bncs_stringlist.cpp:447
bncs_stringlist::operator=
bncs_stringlist & operator=(const bncs_stringlist &in)
Assignment operator. Assigns one bncs_stringlist to another.
Definition: bncs_stringlist.cpp:172
bncs_stringlist::operator[]
bncs_string & operator[](int pos)
Definition: bncs_stringlist.cpp:266
bncs_string
This is a STL like string handling class.
Definition: bncs_string.h:24
bncs_stringlist::operator<<
bncs_stringlist & operator<<(const bncs_string &)
Definition: bncs_stringlist.cpp:495
bncs_stringlist
This is bncs_string helper class to deal with lists of string.
Definition: bncs_stringlist.h:57
bncs_stringlist::operator+
bncs_stringlist & operator+(const bncs_string &)
Definition: bncs_stringlist.cpp:433
bncs_stringlist::append
bncs_stringlist & append(const bncs_string &in)
Definition: bncs_stringlist.cpp:376
bncs_stringlist::find
int find(const bncs_string &in, bool cs=false)
Definition: bncs_stringlist.cpp:691
bncs_string::bncs_string
bncs_string(const std::string &in)
Definition: bncs_string.h:40
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include/bncs_stringlist.h Source File

  • include
bncs_stringlist.h
1 // bncs_stringlist.h: interface for the bncs_stringlist class.
2 //
4
5 #if !defined(AFX_BNCS_STRINGLIST_H__308C68B0_E1E0_4DFE_9CCD_80DB90C813FA__INCLUDED_)
6 #define AFX_BNCS_STRINGLIST_H__308C68B0_E1E0_4DFE_9CCD_80DB90C813FA__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #pragma warning( disable : 4786)
13
14 #include <bncs_string.h>
15
16
17 #ifdef BNCS_STRING_EXPORTS
18 #define DO_STRINGLIST_EXPORT __declspec(dllexport)
19 // #pragma message( "string list exports" )
20 // #define DO_EXTERN extern
21 #else
22 #define DO_STRINGLIST_EXPORT __declspec(dllimport)
23 // #pragma message( "string list imports" )
24 // #define DO_EXTERN extern
25 #endif
26
27 using namespace std;
28
29 class DO_STRINGLIST_EXPORT bncs_string;
30
31
32 class bncs_stringlist;
33
34 class DO_STRINGLIST_EXPORT bncs_stringlistIterator
36 {
37 public:
38 bncs_stringlistIterator( const bncs_stringlist * list = 0, bool end = false );
39 bncs_string * operator->() const;
40 bncs_string &operator*() const;
41 bool operator==( const bncs_stringlistIterator & ) const;
42 bool operator!=( const bncs_stringlistIterator & ) const;
43 bncs_stringlistIterator operator++(); // prefix
44 const bncs_stringlistIterator operator++ (int); // postfix
45 bncs_stringlistIterator operator--();
46
47 private:
48 int m_currentIndex;
49 bool m_end;
50
51 const bncs_stringlist *m_sl;
52 static bncs_string m_safeReturn;
53 };
54
55 class bncs_stringlistPrivate;
56
57 class DO_STRINGLIST_EXPORT bncs_stringlist
58 {
59 friend class bncs_stringlistIterator;
60 public:
70 typedef bncs_stringlistIterator const_iterator;
71
81 typedef bncs_stringlistIterator iterator;
82
83 bncs_stringlist & operator=( const bncs_stringlist & in );
84
85 bncs_stringlist();
86 bncs_stringlist( const bncs_string & in, const char delim = ',' );
87 bncs_stringlist( const bncs_stringlist & in );
88 virtual ~bncs_stringlist();
89 bncs_string & operator[]( int pos );
90 const bncs_string & operator[]( int pos ) const;
91 operator const char*( void );
92 int count( void ) const;
93 bncs_string toString( const char delim = ',' );
94 // REMOVED TO SAVE AMBIGUITY PROBLEMS WITH CHAR VARIANT
95 // bncs_string toString( const bncs_string & delim );
96 bncs_stringlist & fromString( const bncs_string & in, const char delim = ',' );
97 bncs_stringlist & append( const bncs_string & in );
98 bncs_stringlist & prepend( const bncs_string & in );
99 bncs_stringlist & deleteItem( int pos );
100 bncs_stringlist & replaceItem( const bncs_string &, int pos );
101 bncs_stringlist & operator+( const bncs_string & );
102 bncs_stringlist & operator+=( const bncs_string & );
103 bncs_stringlist & operator+( const bncs_stringlist & in );
104 bncs_stringlist & operator+=( const bncs_stringlist & in );
105 bncs_stringlist & operator<<( const bncs_string & );
106 bncs_stringlist & operator=( const bncs_string & );
107 const iterator begin( void );
108 const iterator end( void );
109 const const_iterator begin( void ) const;
110 const const_iterator end( void ) const;
111 bncs_stringlist sort( bool asc = true ) const;
112 int valueCount( const bncs_string & in, bool cs=false );
113 int find( const bncs_string & in, bool cs=false );
114 bncs_string getNamedParam( const bncs_string & in );
115 void clear();
116 void setCount( int, const bncs_string & def = "" );
117 private:
118 bncs_stringlistPrivate *m_priv;
119 bncs_string outputString;
120 };
121
122 #endif // !defined(AFX_BNCS_STRINGLIST_H__308C68B0_E1E0_4DFE_9CCD_80DB90C813FA__INCLUDED_)
123
std
bncs_stringlistIterator
Const iterator for the bncs_stringlist.
Definition: bncs_stringlist.h:34
bncs_string
This is a STL like string handling class.
Definition: bncs_string.h:24
bncs_stringlist
This is bncs_string helper class to deal with lists of string.
Definition: bncs_stringlist.h:57
bncs_stringlist::const_iterator
bncs_stringlistIterator const_iterator
Definition: bncs_stringlist.h:70
bncs_stringlist::iterator
bncs_stringlistIterator iterator
Definition: bncs_stringlist.h:81
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_config Class Reference

bncs_config Class Reference

This is a simple XML data access class. More...

#include <bncs_config.h>

Public Member Functions

bncs_config (const bncs_string &name)
bncs_config (const bncs_config &c)
bncs_config ()
bncs_config & | operator= (const bncs_config &c)
virtual | ~bncs_config ()
bool | isValid (void)
bool | isChildValid (void)
bool | nextChild (void)
bncs_string | childAttr (const bncs_string &name)
bncs_string | childTag (void)
bncs_string | attr (const bncs_string &name)
bncs_string | tag (void)
void | drillDown (void)
bncs_string | data (void)

Static Public Member Functions

static QDomDocument * | cachedDoc (const bncs_string &name)
static bool | isDirty (const bncs_string &name)
static int | changeSerial (const bncs_string &name)
static bool | save (void)
static int | incSerial (const bncs_string &name)
static int | decSerial (const bncs_string &name)
static void | setEnv (const bncs_string &env)
static void | clearCache ()
static void | overrideFileName (const bncs_string &sConfigName, const bncs_string &sFileName)

Detailed Description

This is a simple XML data access class.

Much data is stored in XML files and this class gives very quick and simple method of accessing that data. This is not a fully featured XML class - it is deliberately simple to use and therefore less fully featured.

This class also implies something about the structure of the XML file - the one key thing is that the XML file must contain elements that contain an "id" attribute that uniquely identifies them.

Example data used throughout this document
Consider the following simplified XML document "instances.xml" stored in the <CC_ROOT>\<CC_SYSTEM>\config folder
<instances>
<instance id="ARC1" type="ARC2000">
<instanceInfo device="223" offset="100" />
</instance>
<instance id="ARC Chain" type="ARCOverview" composite="yes" >
<group id="main" instance="ARC1" />
<group id="reserve" instance="ARC2" />
<group id="another" instance="ARC3" />
</instance>
</instances>
Simple Examples
Lets say I want to find out the "type" of ARC1. This is the code required:
bncs_config c( "instances.ARC1" );
bncs_string a = c.attr( "type" ); // for the above example a contains "ARC2000"
Lets say I want to find out the "device" number within the "instance" for a device instance of ARC1. We know from the data that there will only ever be one child "instance" tag. This is the code required:
bncs_config c( "instances.ARC1" );
bncs_string d = c.childAttr( "device" ); // for the above example s contains 223
The dotted notation of the bncs_config constructor tells us the file to look for is instances.xml, and then to search for an entry whose id is "ARC1".
Note
The important thing to note is is that every level we want to be able to uniquely identify MUST have an "id" attribute
Going down more levels
Lets say I want to find out the "instance" for the group "reserve" for "ARC Chain". You'd use code that looks like this:
bncs_config c( "instances.ARC Chain.reserve" );
bncs_string s = c.attr( "instance" ); // for the above example s contains ARC2
The first part of the constructor string says look in "instances.xml". The second says "find me a child uniquely identified by "ARC Chain". The third says "find me a child of "ARC Chain" uniquely identified by "reserve".
Cacheing
For efficiency this function caches the last 100 files that its been asked to load. This number of files is subject to change. This also means that a change made to a file whilst an application is running may not be available since the application will still be using the cached version.

Constructor & Destructor Documentation

◆ bncs_config() [1/3]

bncs_config::bncs_config ( const bncs_string & name )

Constructs a bncs_config using the file/keyname supplied

Parameters
name path and key to locate (see below)

The name is made up of one or more components, separated by periods.

Example:
bncs_config s( "instances.mything.subthing" );
The First part of the key name is the file in which to look. The environment variables CC_ROOT and CC_SYSTEM are used to determine the root path for this file and configuration files are always to be found in the config subdirectory. So, this example looks in a file <CC_ROOT>\<CC_SYSTEM>\config\instances.xml

The subsequent parameters are optional and determine the number of levels down the XML tree to search the "id" attributes.

◆ bncs_config() [2/3]

bncs_config::bncs_config ( const bncs_config & c )

Copy constructor Make a duplicate of this object

◆ bncs_config() [3/3]

bncs_config::bncs_config ( )

Default constructor Doesn't do much!

◆ ~bncs_config()

bncs_config::~bncs_config ( )
virtual

Destructor Destroy this object and free any resources it uses

Member Function Documentation

◆ attr()

bncs_string bncs_config::attr ( const bncs_string & name )

Return an attribute current element

Returns
attribute value of of element
Example: (using example data above)
bncs_config c( "instances.ARC Chain" ); // search for the "ARC Chain" entry
bncs_string tag = c.attr( "type" ); // the tag name (in this case "ARCOverview")
}

◆ cachedDoc()

QDomDocument * bncs_config::cachedDoc ( const bncs_string & name )
static

Get the DOM document corresponding to this name, if available.

Returns
pointer to DOM document.

◆ changeSerial()

int bncs_config::changeSerial ( const bncs_string & name )
static

Returns the serial number controlling the "dirty" status.

Returns
integer value of change serial number.

◆ childAttr()

bncs_string bncs_config::childAttr ( const bncs_string & name )

Return the named child attribute

Parameters
name attribute name
Example: (using example data above)
bncs_config c( "instances.ARC1" );
bncs_string d = c.childAttr( "device" ); // for the above example s contains 223

◆ childTag()

bncs_string bncs_config::childTag ( void )

Return the tag name of the current child element

Returns
tag name of of element
Example: (using example data above)
bncs_config c( "instances.ARC Chain" ); // search for the "ARC Chain" entry
while( c.isChildValid()) // are we sitting on a valid entry?
{
bncs_string tag = c.childTag(); // the tag name (in this case "group")
c.nextChild(); // go on to the next sibling (if there is one)
}

◆ clearCache()

void bncs_config::clearCache ( )
static

The function bncs_config::clearCache() clears the document cache. Note that if using the accessor classes this clears the data underneath them, you will need to delete the instances of those clases.

Returns
void

◆ data()

bncs_string bncs_config::data ( void )

Get the text data for the current element (note this is a text child of this element)

Returns
Data
Example: (using example data above)

◆ decSerial()

int bncs_config::decSerial ( const bncs_string & name )
static

Decrement the change serial number to cancel a request that the files be saved.

Returns
the new change serial number value.

◆ drillDown()

void bncs_config::drillDown ( void )

Move down to the next child element

Example: (using example data above)
bncs_config c( "instances" );

This leaves the current and child elements like this:

current---> <instances>
child ---> <instance id="ARC1" type="ARC2000">
<instanceInfo device="223" offset="100" />

calling drillDown() from this poisition leaves them here:

<instances>
current---> <instance id="ARC1" type="ARC2000">
child ---> <instanceInfo device="223" offset="100" />
Example
bncs_config c("instances" );
bncs_string s1 = c.childAttr( "id" ); // s1 contains "ARC1"
c.drillDown(); // move down one level in the XML
bncs_string s2 = c.childAttr( "device" ); // s2 contains "223"
c.drillDown();
bool b1 = c.isValid(); // b1 contains true (pointing at <instanceInfo device="223" offset="100" />)
bool b2 = c.isChildValid(); // b2 contains false - current entry does not have any children
Note
You can use isValid() and isChildValid to determine the success of this command

◆ incSerial()

int bncs_config::incSerial ( const bncs_string & name )
static

Increment the change serial number to add a request that the files be saved.

Returns
the new change serial number value.

◆ isChildValid()

bool bncs_config::isChildValid ( void )

Return whether this child is valid

Returns
true on valid element
Example: (using example data above)
bncs_config c( "instances.ARC Chain" ); // search for the "ARC Chain" entry
while( c.isChildValid()) // are we sitting on a valid entry?
{
bncs_string tag = c.childTag(); // the tag name (in this case "group")
bncs_string inst = c.childAttr( "instance" ); // the instance "attribute"
...
c.nextChild(); // go on to the next sibling (if there is one)
}

◆ isDirty()

bool bncs_config::isDirty ( const bncs_string & name )
static

Returns whether the config has been changed since last written.

Returns
boolean indicating whether "dirty".

◆ isValid()

bool bncs_config::isValid ( void )

Return whether the current element is valid

Returns
true on valid element
Example: (using example data above)
bncs_config c( "instances.ARC Chain" ); // search for the "ARC Chain" entry
if( !c.isValid()) // are we sitting on a valid entry?
{
debug( "oops - this filename/key is not valid" );
}

◆ nextChild()

bool bncs_config::nextChild ( void )

go to the next sibling element

Returns
true on valid element
Example: (using example data above)
bncs_config c( "instances.ARC Chain" ); // search for the "ARC Chain" entry
while( c.isChildValid()) // are we sitting on a valid entry?
{
bncs_string tag = c.childTag(); // the tag name (in this case "group")
bncs_string inst = c.childAttr( "instance" ); // the instance "attribute"
...
c.nextChild(); // go on to the next sibling (if there is one)
}

◆ operator=()

bncs_config & bncs_config::operator= ( const bncs_config & c )

Assignment operator Assign another bncs_config object to this one

◆ overrideFileName()

void bncs_config::overrideFileName | ( | const bncs_string & | sConfigName,
 |  | const bncs_string & | sFileName
 | ) |  |
static

◆ save()

bool bncs_config::save ( void )
static

Save all modified configurations to their files.

Returns
false, always.

◆ setEnv()

void bncs_config::setEnv ( const bncs_string & env )
static

Write an environment variable.

Parameters
env the environment variable to be written.

◆ tag()

bncs_string bncs_config::tag ( void )

Return the tag name of the current element

Returns
tag name of of element
Example: (using example data above)
bncs_config c( "instances.ARC Chain" ); // search for the "ARC Chain" entry
bncs_string tag = c.tag(); // the tag name (in this case "instance")
}
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_config Member List

This is the complete list of members for bncs_config, including all inherited members.

attr(const bncs_string &name) | bncs_config |
bncs_config(const bncs_string &name) | bncs_config |
bncs_config(const bncs_config &c) | bncs_config |
bncs_config() | bncs_config |
cachedDoc(const bncs_string &name) | bncs_config | static
changeSerial(const bncs_string &name) | bncs_config | static
childAttr(const bncs_string &name) | bncs_config |
childTag(void) | bncs_config |
clearCache() | bncs_config | static
data(void) | bncs_config |
decSerial(const bncs_string &name) | bncs_config | static
drillDown(void) | bncs_config |
incSerial(const bncs_string &name) | bncs_config | static
isChildValid(void) | bncs_config |
isDirty(const bncs_string &name) | bncs_config | static
isValid(void) | bncs_config |
nextChild(void) | bncs_config |
operator=(const bncs_config &c) | bncs_config |
overrideFileName(const bncs_string &sConfigName, const bncs_string &sFileName) | bncs_config | static
save(void) | bncs_config | static
setEnv(const bncs_string &env) | bncs_config | static
tag(void) | bncs_config |
~bncs_config() | bncs_config | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_dateTime Class Reference

bncs_dateTime Class Reference

This is a simple date/time class. More...

#include <bncs_dateTime.h>

Public Member Functions

bncs_dateTime ()
virtual | ~bncs_dateTime ()
bncs_dateTime (const bncs_dateTime &dt)
bncs_dateTime (const SYSTEMTIME &st)
bncs_dateTime (const FILETIME &ft)
bncs_dateTime (const char *isoDateTime)
const char * | toString (const char *format="dd MMM yyyy")
void | toString (char *out, int len, const char *format="dd MMM yyyy")
bool | fromString (const char *in)
bool | fromStringTime (const char *inStr)
bool | fromStringDate (const char *inStr)
bool | addSeconds (int seconds)
bool | addMinutes (int minutes)
bool | addHours (int hours)
bool | addDays (int days)
bool | addWeeks (int weeks)
bool | addMonths (int months)
bool | addYears (int years)
bool | setDate (int day, int month, int year)
bool | setTime (int hour, int minute, int second, int millisecond=0)
bool | operator< (const bncs_dateTime &in) const
bool | operator<= (const bncs_dateTime &in) const
bool | operator> (const bncs_dateTime &in) const
bool | operator>= (const bncs_dateTime &in) const
bool | operator== (const bncs_dateTime &in) const
bool | operator!= (const bncs_dateTime &in) const
__int64 | difference (const bncs_dateTime &in) const
__int64 | difference_seconds (const bncs_dateTime &in) const
__int64 | difference_milliseconds (const bncs_dateTime &in) const
operator __int64 () const
void | clear (void)
bool | isNull (void) const
void | dump (const char *) const
bncs_time | time (void) const
bncs_date | date (void) const

Static Public Member Functions

static bncs_dateTime | nowUTC (void)
static bncs_dateTime | now (void)

Detailed Description

This is a simple date/time class.

Internally it uses the SYSTEMTIME and FILETIME structures - maximum extent is set by these structures.

Constructor & Destructor Documentation

◆ bncs_dateTime() [1/5]

bncs_dateTime::bncs_dateTime ( )

Constructs null object

◆ ~bncs_dateTime()

bncs_dateTime::~bncs_dateTime ( )
virtual

◆ bncs_dateTime() [2/5]

bncs_dateTime::bncs_dateTime ( const bncs_dateTime & dt )

Copy Constructor

◆ bncs_dateTime() [3/5]

bncs_dateTime::bncs_dateTime ( const SYSTEMTIME & st )

Construct object using Windows SYSTEMTIME structure

Parameters
[in] st Windows SYSTEMTIME structure

◆ bncs_dateTime() [4/5]

bncs_dateTime::bncs_dateTime ( const FILETIME & ft )

Construct object using Windows FILETIME structure

Parameters
[in] ft Windows FILETIME structure

◆ bncs_dateTime() [5/5]

bncs_dateTime::bncs_dateTime ( const char * isoDateTime )

Member Function Documentation

◆ addDays()

bool bncs_dateTime::addDays ( int days )

Add days (or subtract if the value is negative)

Parameters
[in] days The number of days to add The number of days is not constrained by anything other than the range of an int

◆ addHours()

bool bncs_dateTime::addHours ( int hours )

Add hours (or subtract if the value is negative)

Parameters
[in] hours The number of hours to add The number of hours is not constrained by anything other than the range of an int

◆ addMinutes()

bool bncs_dateTime::addMinutes ( int minutes )

Add minutes (or subtract if the value is negative)

Parameters
[in] minutes The number of minutes to add The number of minutes is not constrained by anything other than the range of an int

◆ addMonths()

bool bncs_dateTime::addMonths ( int months )

Add months (or subtract if the value is negative)

Parameters
[in] months The number of months to add The number of months is not constrained by anything other than the range of an int

◆ addSeconds()

bool bncs_dateTime::addSeconds ( int seconds )

Add seconds (or subtract if the value is negative)

Parameters
[in] seconds The number of seconds to add The number of seconds is not constrained by anything other than the range of an int

◆ addWeeks()

bool bncs_dateTime::addWeeks ( int weeks )

Add weeks (or subtract if the value is negative)

Parameters
[in] weeks The number of weeks to add The number of weeks is not constrained by anything other than the range of an int

◆ addYears()

bool bncs_dateTime::addYears ( int years )

Add years (or subtract if the value is negative)

Parameters
[in] years The number of years to add The number of years is not constrained by anything other than the range of an int

◆ clear()

void bncs_dateTime::clear ( void )

Reset back to null Sets the date/time reference and the internal string back to null

◆ date()

bncs_date bncs_dateTime::date ( void ) const

◆ difference()

__int64 bncs_dateTime::difference ( const bncs_dateTime & in ) const

The difference between this object and another in 100's of nanoseconds. If in is later than us the return value is negative.

Parameters
in bncs_dateTime object to compare to
Returns
difference in 100ns resolution

◆ difference_milliseconds()

__int64 bncs_dateTime::difference_milliseconds ( const bncs_dateTime & in ) const

The difference between this object and another in milliseconds. If in is later than us the return value is negative.

Parameters
in bncs_dateTime object to compare to
Returns
difference in milliseconds

◆ difference_seconds()

__int64 bncs_dateTime::difference_seconds ( const bncs_dateTime & in ) const

The difference between this object and another in seconds. If in is later than us the return value is negative.

Parameters
in bncs_dateTime object to compare to
Returns
difference in seconds

◆ dump()

void bncs_dateTime::dump ( const char * header ) const

◆ fromString()

bool bncs_dateTime::fromString ( const char * inStr )

Convert date/time from string

Parameters
[in] inStr string to convert
Returns
true on failure - either badly formatted input or out of range values

This function only accepts ISO formatted dates e.g. 2012-10-01T12:27:48

This function reset the current datetime value back to null before staring parsing the new value.

◆ fromStringDate()

bool bncs_dateTime::fromStringDate ( const char * inStr )

Convert date from BNCS date string

Parameters
[in] inStr string to convert
Returns
true on failure - either badly formatted input or out of range values

This function accepts BNCS formatted dates and some variants e.g. 10 Jan 12, 10 Jan 2012, Jan 10 2012 This function does NOT clear the value before trying to set it (so you can use it at the same time as the time setting functions).

◆ fromStringTime()

bool bncs_dateTime::fromStringTime ( const char * inStr )

Convert time from BNCS date string

Parameters
[in] inStr string to convert
Returns
true on failure - either badly formatted input or out of range values

This function accepts BNCS formatted time e.g. 12:34:56, or 1234 This function does NOT clear the value before trying to set it (so you can use it at the same time as the date setting functions).

◆ isNull()

bool bncs_dateTime::isNull ( void ) const

Has this date/time object been set to any sensible value?

Returns
true on null value

◆ now()

bncs_dateTime bncs_dateTime::now ( void )
static

Return the local time allowing for daylight saving offsets

Returns
Current time
bncs_dateTime dt = bncs_dateTime::now();

◆ nowUTC()

bncs_dateTime bncs_dateTime::nowUTC ( void )
static

Return the UTC time

Returns
Current time (UTC)
bncs_dateTime dt = bncs_dateTime::nowUTC();

◆ operator __int64()

bncs_dateTime::operator __int64 ( ) const

Converts this dateTime object to int64 value

◆ operator!=()

bool bncs_dateTime::operator!= ( const bncs_dateTime & in ) const

◆ operator<()

bool bncs_dateTime::operator< ( const bncs_dateTime & in ) const

◆ operator<=()

bool bncs_dateTime::operator<= ( const bncs_dateTime & in ) const

◆ operator==()

bool bncs_dateTime::operator== ( const bncs_dateTime & in ) const

◆ operator>()

bool bncs_dateTime::operator> ( const bncs_dateTime & in ) const

◆ operator>=()

bool bncs_dateTime::operator>= ( const bncs_dateTime & in ) const

◆ setDate()

bool bncs_dateTime::setDate | ( | int | day,
 |  | int | month,
 |  | int | year
 | ) |  |

Set date to given values

Parameters
[in] | day | The day
[in] | month | The month
[in] | year | The year
Returns
true on failure - usually from out of range values
Note
This function does not set the time - this is left at whatever value it was

◆ setTime()

bool bncs_dateTime::setTime | ( | int | hour,
 |  | int | minute,
 |  | int | second,
 |  | int | millisecond = 0
 | ) |  |

Set time to given values

Parameters
[in] | hour | The hour value
[in] | minute | The minute value
[in] | second | The second value
[in] | millisecond | The millisecond value
Returns
true on failure - usually from out of range values
Note
This function does not set the date - this is left at whatever value it was

◆ time()

bncs_time bncs_dateTime::time ( void ) const

◆ toString() [1/2]

const char * bncs_dateTime::toString ( const char * format = "dd MMM yyyy" )

Convert to string using the format specified.

Parameters
[in] format - see toString( char *, int, const char* )

Same as toString( char *, int, const char* ) function but uses internal string buffer (of 64 characters) for convenience

bncs_dateTime dt = bncs_dateTime::now();
char *p = dt.toString( "hh:mm:ss" ); // p points at a string of the format "13:00:00". This is valid until the next call of this function or the object is destroyed.

◆ toString() [2/2]

void bncs_dateTime::toString | ( | char * | out,
 |  | int | len,
 |  | const char * | format = "dd MMM yyyy"
 | ) |  |

Convert to string

Parameters
[out] | out | Where to write the string
[in] | len | The length of the out parameter
[in] | format | The formatting string - how you want the date/time to appear
Note
The size of out should be at least the size of the format string plus whatever is required extra for expansion of long-form data e.g. day/month names

The format string has various placeholders for date/time in various formats or can be one of the following values:

Value | Meaning
BNCSDATE | Date in traditional BNCS format (ApplCore) e.g. 01 Jan 2012
BNCSTIME | Time in traditional BNCS format (ApplCore) e.g. 13:00:00
ISO | Time in ISO format i.e. YYYY-MM-DDTHH:MM:SS

If it isn't one of these fixed values then it can be made up with the following formatting characters.

Note
Any vales that aren't recognised are just left intact so you can include some punctuation characters when you build your string
Placeholder | Meaning
h | Hours without leading zero
hh | Hours with leading zero
m | Minutes without leading zero
mm | Minutes with leading zero
s | Seconds without leading zero
ss | Seconds with leading zero
z | Milliseconds without leading zero
zzz | Milliseconds with leading zeros
d | Day without leading zero
dd | Day with leading zero
ddd | Day name - short form (Mon, Tue, Wed, Thu, Fri, Sat)
dddd | Day name - long form (Monday etc.)
ddddd | Day with suffix - e.g. 1st, 23rd
M | Month without leading zero
MM | Month with leading zero
MMM | Month name - short form (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
MMMM | Month name - long form (January etc.)
yy | Year - short form e.g. Jan 12
yyyy | Year - long form e.g. Jan 2012
bncs_dateTime dt = bncs_dateTime::now(); // assuming this is 01 Feb 2012, 13:00:00
const char *p;
p = dt.toString( "BNCSDATE" ); // p points to "01 Feb 2012"
p = dt.toString( "BNCSTIME" ); // p points to "13:00:00"
p = dt.toString( "ISO" ); // p points to "2012-02-01T13:00:00"
p = dt.toString( "dddd ddddd MMMM yyyy hh:mm:ss:zzz" ); // p points to "Wednesday 1st February 2012 13:00:00:000"

An invalid/null datetime will result in a null/zero length string

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_dateTime Member List

This is the complete list of members for bncs_dateTime, including all inherited members.

addDays(int days) | bncs_dateTime |
addHours(int hours) | bncs_dateTime |
addMinutes(int minutes) | bncs_dateTime |
addMonths(int months) | bncs_dateTime |
addSeconds(int seconds) | bncs_dateTime |
addWeeks(int weeks) | bncs_dateTime |
addYears(int years) | bncs_dateTime |
bncs_dateTime() | bncs_dateTime |
bncs_dateTime(const bncs_dateTime &dt) | bncs_dateTime |
bncs_dateTime(const SYSTEMTIME &st) | bncs_dateTime |
bncs_dateTime(const FILETIME &ft) | bncs_dateTime |
bncs_dateTime(const char *isoDateTime) | bncs_dateTime |
clear(void) | bncs_dateTime |
date(void) const | bncs_dateTime |
difference(const bncs_dateTime &in) const | bncs_dateTime |
difference_milliseconds(const bncs_dateTime &in) const | bncs_dateTime |
difference_seconds(const bncs_dateTime &in) const | bncs_dateTime |
dump(const char *) const | bncs_dateTime |
fromString(const char *in) | bncs_dateTime |
fromStringDate(const char *inStr) | bncs_dateTime |
fromStringTime(const char *inStr) | bncs_dateTime |
isNull(void) const | bncs_dateTime |
now(void) | bncs_dateTime | static
nowUTC(void) | bncs_dateTime | static
operator __int64() const | bncs_dateTime |
operator!=(const bncs_dateTime &in) const | bncs_dateTime |
operator<(const bncs_dateTime &in) const | bncs_dateTime |
operator<=(const bncs_dateTime &in) const | bncs_dateTime |
operator==(const bncs_dateTime &in) const | bncs_dateTime |
operator>(const bncs_dateTime &in) const | bncs_dateTime |
operator>=(const bncs_dateTime &in) const | bncs_dateTime |
setDate(int day, int month, int year) | bncs_dateTime |
setTime(int hour, int minute, int second, int millisecond=0) | bncs_dateTime |
time(void) const | bncs_dateTime |
toString(const char *format="dd MMM yyyy") | bncs_dateTime |
toString(char *out, int len, const char *format="dd MMM yyyy") | bncs_dateTime |
~bncs_dateTime() | bncs_dateTime | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_script_helper Class Reference

bncs_script_helper Class Referenceabstract

The base class for QtUI C++ scripts. More...

#include <bncs_script_helper.h>

Inheritance diagram for bncs_script_helper:

Public Member Functions

bool | getDevSlot (const bncs_string &instance, const bncs_string &param, int *dev, int *slot, char *type)
bool | getDevSlot (const bncs_string &instance, const bncs_string &param, bncs_string &altId, int *dev, int *slot, char *type)
bool | getDev (bncs_string instance, int *dev, int *offset=0)
void | audioStopAll ()
void | audioDestroy (const bncs_string &name)
void | audioStop (const bncs_string &name)
void | audioPlay (const bncs_string &name, int repeat)
void | audioPlay (const bncs_string &name, const bncs_string &file, int repeat)
bncs_script_helper (bncs_client_callback *parent, const char *path)
virtual | ~bncs_script_helper ()
void * | callback (const void *, int)
bool | panelShow (const bncs_string &pnl, const bncs_string &path, const bncs_string &target="")
bool | panelInit (const bncs_string &pnl, const bncs_string &path, const bncs_string &target="")
bool | panelTarget (const bncs_string &pnl, const bncs_string &target)
bool | panelPopup (const bncs_string &pnl, const bncs_string &path, int width=0, int height=0)
bool | panelRemove (const bncs_string &pnl)
bool | panelDestroy (const bncs_string &pnl)
void | textPut (const bncs_string &what, const bncs_string &pnl, const bncs_string &id)
void | textPut (const bncs_string &param, const bncs_string &value, const bncs_string &pnl, const bncs_string &id)
void | textGet (const bncs_string &what, const bncs_string &pnl, const bncs_string &id, bncs_string &ret)
void | routerName (int dev, int db, int index, bncs_string &ret)
int | routerIndex (int dev, int db, const bncs_string &name)
void | routerCrosspoint (int dev, int source, int dest, const bncs_string &mask="", bool now=false)
void | routerRegister (int dev, int start, int end, bool add=false)
void | routerUnregister (int dev)
void | routerPoll (int dev, int start, int end)
void | routerQuery (int dev, int start, int end)
void | routerModify (int dev, int database, int index, const bncs_string &name, bool reload)
void | infoUnregister (int dev)
void | infoPoll (int dev, int start, int end)
void | infoWrite (int dev, const bncs_string &what, int index, bool now=false)
void | infoWrite (const bncs_string &format,...)
void | infoQuery (int dev, int start, int end)
void | infoRegister (int dev, int start, int end, bool add=false)
void | gpiRegister (int dev, int start, int end, bool add=false)
void | gpiSwitch (int dev, bool state, int index, bool now=false)
void | gpiPoll (int dev, int start, int end)
void | gpiQuery (int dev, int start, int end)
void | gpiUnregister (int dev)
void | timerStart (int timer, int duration)
void | timerStop (int timer)
void | captionEnable (bool captionOn, const bncs_string &title, const bncs_string &args="")
void | setGeometry (int x, int y, int w, int h)
void | setSize (int w, int h)
void | setSize (const bncs_string &pnl)
void | controlEnable (const bncs_string &panel, const bncs_string &id)
void | controlDisable (const bncs_string &panel, const bncs_string &id)
void | controlShow (const bncs_string &panel, const bncs_string &id)
void | controlHide (const bncs_string &panel, const bncs_string &id)
void | controlMove (const bncs_string &panel, const bncs_string &id, int x, int y)
void | controlPosition (const bncs_string &panel, const bncs_string &id, bncs_string &x, bncs_string &y)
bncs_string | controlCreate (const bncs_string &panel, const bncs_string &id, const bncs_string &buttonClass, int x, int y, int w, int h, const bncs_string &settings)
bool | controlDestroy (const bncs_string &panel, const bncs_string &id)
void | hostNotify (const bncs_string &message)
bncs_string | id (void)
virtual void | buttonCallback (buttonNotify *b)=0
virtual int | revertiveCallback (revertiveNotify *r)=0
virtual bncs_string | parentCallback (parentNotify *p)=0
virtual void | httpCallback (httpNotify *p)
virtual void | timerCallback (int)=0
virtual void | databaseCallback (revertiveNotify *r)
void | debug (const bncs_string &str)
void | debug (const bncs_string &format, const bncs_string &in1, const bncs_string &in2="", const bncs_string &in3="", const bncs_string &in4="", const bncs_string &in5="", const bncs_string &in6="", const bncs_string &in7="", const bncs_string &in8="", const bncs_string &in9="")
int | workstation (void)
void | navigateAdjust (const bncs_string &str)
void | navigateExecute (const bncs_string &str)
bool | navigateCanExecute (const bncs_string &str)
bool | navigateCanAdjust (const bncs_string &str)
bncs_stringlist | getWorkstationSettings (void)
bncs_string | getWorkstationSetting (const bncs_string &setting)
bncs_string | getObjectSetting (const bncs_string &object, const bncs_string &setting)
int | getRouterSize (int intDevice, int intSwitch)
bncs_string | getUser (void)
bncs_string | getUserLevel (void)
int | getUserLevelInt (void)
bncs_stringlist | getIdList (const bncs_string &pnl, const bncs_string &startsWithFilter="")
void | enableActionAll ()
void | actionAll (const bncs_string &sValue)
void | httpGet (const bncs_string &url, const bncs_string &localFile)
void | httpGetString (const bncs_string &url)
void | httpPut (const bncs_string &url, const bncs_string &localFile)
void | httpPutString (const bncs_string &url, const bncs_string &string)

Detailed Description

The base class for QtUI C++ scripts.

This class is a means of writing simple C++ programs to "script" BNCS.
This class can be used to create top level "panels" or write simple components to be used as "smart buttons" on panels

You aren't expected to write applications by hand using this class - there is a Wizard application that will create the applications for you.

Note
Important information for ApplCore users:
All button push notifications come back to buttonCallback()
All network revertive notifications come back to revertiveCallback()
All database change notifications come back to databaseCallback()
ET (executive timer) calls are now timerStart() and timerStop(). Notifications come back to timerCallback()
EC is now captionEnable()
EB is partly replaced by setGeometry() and setSize()

Constructor & Destructor Documentation

◆ bncs_script_helper()

bncs_script_helper::bncs_script_helper | ( | bncs_client_callback * | parent,
 |  | const char * | path
 | ) |  |

Construct the bncs_script_helper class

Parameters
parent | the other endpoint for comms
path | the path to this script dll

◆ ~bncs_script_helper()

bncs_script_helper::~bncs_script_helper ( )
virtual

Member Function Documentation

◆ actionAll()

void bncs_script_helper::actionAll ( const bncs_string & sValue )

Set all of the alarm controls to a specified state.

The writing of this method was motivated by the CCM project where it is a common use case to force all alarm controls on a panel to the same state or to acknowledge all alarms on a panel by pushing a single button. This method collects all controls with identifiers starting with "alm_" and sets them to the specified state. When the specified state is "acknowledge", then only controls that are not in off, acknowledged, forced or ignored state will be set to acknowledged. The method supports single popup-buttons as well as script components. When a script component is to be addressed by this method, then it will be necessary to support the "alarm" command by the component.

Parameters
sValue The value to be set. It must be a number as specified in <bncs_alm_common.h>, or "ack"

◆ audioDestroy()

void bncs_script_helper::audioDestroy ( const bncs_string & name )

Destroy the relevant audio player

Parameters
name The name of the player
Example:
audioDestroy( "bang"); // destroy player "bang"
See also
audioDestroy(const bncs_string & name)

◆ audioPlay() [1/2]

void bncs_script_helper::audioPlay | ( | const bncs_string & | name,
 |  | int | repeat
 | ) |  |

Play the relevant player

Parameters
name | The name of the player
repeat | 0=play once, else loop
Example:
audioPlay( "bang", -1); // play player "bang" infinitively
See also
audioPlay(const bncs_string & name, int repeat)

◆ audioPlay() [2/2]

void bncs_script_helper::audioPlay | ( | const bncs_string & | name,
 |  | const bncs_string & | file,
 |  | int | repeat
 | ) |  |

Play the relevant audio file

Parameters
name | The name of the player to use
file | The file the clip is in
repeat | 0=play once, else loop
Example:
audioPlay( "bang", "tada.wav",0); // play tada.wav once, to be known as player "bang"
See also
audioPlay(const bncs_string & name, const bncs_string & file, int repeat)

◆ audioStop()

void bncs_script_helper::audioStop ( const bncs_string & name )

Stop the relevant audio player

Parameters
name The name of the player
Example:
audioStop( "bang"); // stop player "bang" playing
See also
audioStop(const bncs_string & name)

◆ audioStopAll()

void bncs_script_helper::audioStopAll ( )

Stop all audio players

Example:
audioDestroy( "bang"); // destroy player "bang"
See also
audioDestroy(const bncs_string & name)

◆ buttonCallback()

virtual void bncs_script_helper::buttonCallback ( buttonNotify * b )
pure virtual

Button notification

This gets called whenever a button wants to notify us of something
See the buttonNotify documentation for the values it returns

◆ callback()

void * bncs_script_helper::callback | ( | const void * | in,
 |  | int | type
 | ) |  |

Comms end point Internal use only!

◆ captionEnable()

void bncs_script_helper::captionEnable | ( | bool | captionOn,
 |  | const bncs_string & | title,
 |  | const bncs_string & | args = ""
 | ) |  |

Enable/disable caption for this component

Parameters
captionOn | true to turn caption on, false to turn off
title | The text displayed on the windows caption
args | At time of writing, not used
Example:
captionEnable( true, "MyTitle" ); // give this dll a caption and sets the caption to "MyTitle"
Note
This is only relevant for a dll that is a top level window

◆ controlCreate()

bncs_string bncs_script_helper::controlCreate | ( | const bncs_string & | panel,
 |  | const bncs_string & | id,
 |  | const bncs_string & | buttonClass,
 |  | int | x,
 |  | int | y,
 |  | int | w,
 |  | int | h,
 |  | const bncs_string & | settings
 | ) |  |

Create new control

Parameters
[in] | panel | The host panel
[in] | id | The new id of the control (this may not be the id of the control that was created - see below)
[in] | buttonClass | The class of the button (see buttons.xml for examples)
[in] | x | coordinate
[in] | y | coordinate
[in] | w | Width
[in] | h | Height
[in] | settings | Newline delimited list of command=value settings
bncs_string createdId = controlCreate( "mainPanel", "something", "bncs_control", 10, 10, 100, 100, "colour.background=red\ncolour.text=blue" );

◆ controlDestroy()

bool bncs_script_helper::controlDestroy | ( | const bncs_string & | panel,
 |  | const bncs_string & | id
 | ) |  |

Destroy a control

Parameters
[in] | panel | The host panel
[in] | id | The id of the control
Returns
true on failure

◆ controlDisable()

void bncs_script_helper::controlDisable | ( | const bncs_string & | panel,
 |  | const bncs_string & | id
 | ) |  |

Disable a control

Parameters
panel | The identifier of the panel
id | The id of the control to disable
controlDisable( "1", "2" ); // disable control 2 on panel 1
See also
controlEnable()

◆ controlEnable()

void bncs_script_helper::controlEnable | ( | const bncs_string & | panel,
 |  | const bncs_string & | id
 | ) |  |

Enable a control

Parameters
panel | The identifier of the panel
id | The id of the control to enable
controlEnable( "1", "2" ); // disable control 2 on panel 1
See also
controlDisable()

◆ controlHide()

void bncs_script_helper::controlHide | ( | const bncs_string & | panel,
 |  | const bncs_string & | id
 | ) |  |

Make a control invisible

Parameters
panel | The identifier of the panel
id | The id of the control to disable
controlHide( "1", "2" ); // hide control 2 on panel 1
See also
controlShow()

◆ controlMove()

void bncs_script_helper::controlMove | ( | const bncs_string & | panel,
 |  | const bncs_string & | id,
 |  | int | x,
 |  | int | y
 | ) |  |

Move control's position

Parameters
panel | The identifier of the panel
id | The id of the control to disable
x | coordinate
y | coordinate
controlMove( "1", "2", 100, 200); // move control 2 on panel 1 to X 100 and Y 200

◆ controlPosition()

void bncs_script_helper::controlPosition | ( | const bncs_string & | panel,
 |  | const bncs_string & | id,
 |  | bncs_string & | x,
 |  | bncs_string & | y
 | ) |  |

Get control's position

Parameters
panel | The identifier of the panel
id | The id of the control to disable
x | The x co-ordinate
y | The y co-ordinate
Returns
int x, int y
controlPosition( "1", "2", int X, int Y); // returns position of control 2 on panel 1, int X and int Y

◆ controlShow()

void bncs_script_helper::controlShow | ( | const bncs_string & | panel,
 |  | const bncs_string & | id
 | ) |  |

Make a control visible

Parameters
panel | The identifier of the panel
id | The id of the control
controlShow( "1", "2" ); // show control 2 on panel 1
See also
controlHide()

◆ databaseCallback()

virtual void bncs_script_helper::databaseCallback ( revertiveNotify * r )
inlinevirtual

Timer notification

This gets called whenever a database change event occurs See the CB_REVERTIVE documentation for the values it returns

◆ debug() [1/2]

void bncs_script_helper::debug ( const bncs_string & in )

Debug Helper function

Parameters
in The string to send to the debug viewer

Use this to output to the standard Windows debuger

// a simple example
debug( "hello mum" );

◆ debug() [2/2]

void bncs_script_helper::debug | ( | const bncs_string & | format,
 |  | const bncs_string & | in1,
 |  | const bncs_string & | in2 = "",
 |  | const bncs_string & | in3 = "",
 |  | const bncs_string & | in4 = "",
 |  | const bncs_string & | in5 = "",
 |  | const bncs_string & | in6 = "",
 |  | const bncs_string & | in7 = "",
 |  | const bncs_string & | in8 = "",
 |  | const bncs_string & | in9 = ""
 | ) |  |

Debug Helper function

Parameters
format | The string to send to the debug viewer including format characters
in1,in2,in3,in4,in5,in6,in7,in8,in9 | The strings to use to replace the placeholders in the format input parameter

Use this to output to the standard Windows debuger.

// this example outputs "hello my mum 123" to the debugger
debug( "hello %1 mum %2", "my", 123 );
Note
The placeholders in the string are bncs_string placeholders NOT sprintf

If you need more precise control of over the formatting of your output string you must use something like this

// both of these examples put "hello 0012" to the Windows debug
bncs_string s = bncs_string( "hello %1" ).arg( 12, '0', 4 );
debug( s );
// or an equivalent (less easy to read)
debug( bncs_string( "hello %1" ).arg( 12, '0', 4 ) );
Note
This function isn't very good at resolving the placeholders where the data itself contains the % symbol

◆ enableActionAll()

void bncs_script_helper::enableActionAll ( )

Enables broadcasting alarm state to all controls with identifiers starting with "_alm".

This method places a trigger in the "callback" method of this class. As soon as a notification is received form a button or component with identifier "ActionAll" or "AckAll", the trigger will call actionAll() that will broadcast a message to all controls with identifier starting with "alm_" on the panel.

See actionAll()

◆ getDev()

bool bncs_script_helper::getDev | ( | bncs_string | instance,
 |  | int * | dev,
 |  | int * | offset = 0
 | ) |  |

get device (and optionally also the offset) for an instance

Parameters
instance | The name of the instance
*dev | Pointer to an integer to return the device number
*offset | Pointer to an integer to return the offset. Paremeter is optional.
Returns
true if all OK, otherwise false
Example:
int iDev, iOffset;
getDev( "ARC1",& iDev, & iOffset); // iDev and iOffset will now contain correct information.
debug("Arc 1 dev=%1, offset =%2",iDev, iOffset);
getDev( "ARC1",& iDev); // iDev will now contain correct information.
debug("Arc 1 dev=%1",iDev);

◆ getDevSlot() [1/2]

bool bncs_script_helper::getDevSlot | ( | const bncs_string & | instance,
 |  | const bncs_string & | param,
 |  | int * | dev,
 |  | int * | slot,
 |  | char * | type
 | ) |  |

get device, slot and type for an instance, parameter pair

Parameters
[in] | instance | The name of the instance
[in] | param | The name of the parameter
[out] | *dev | Pointer to an integer to return the device number
[out] | *slot | Pointer to an integer to return the slot number
[out] | *type | Pointer to an character to return the device type, for example 'I' for infodriver
Returns
true if all OK, otherwise false
Example:
int iDev, iSlot;
char cType;
getDevSlot( "ARC1","Input", & iDev, & iSlot, & cType); // iDev, iSlot and cType will now contain correct information.
debug("Arc 1 dev=%1, slot=%2, type=%3",iDev, iSlot, cType);

◆ getDevSlot() [2/2]

bool bncs_script_helper::getDevSlot | ( | const bncs_string & | instance,
 |  | const bncs_string & | param,
 |  | bncs_string & | altId,
 |  | int * | dev,
 |  | int * | slot,
 |  | char * | type
 | ) |  |

get altId, device, slot and type for an instance, parameter pair

Parameters
[in] | instance | The name of the instance
[in] | param | The name of the parameter - if this is zero length then only the device/offset values are found - not the parameter slot
[out] | altId | The alternative id for this instance
[out] | *dev | Pointer to an integer to return the device number
[out] | *slot | Pointer to an integer to return the slot number
[out] | *type | Pointer to an character to return the device type, for example 'I' for infodriver
Returns
true if all OK, otherwise false
Example:
int iDev, iSlot;
char cType;
getDevSlot( "ARC1","Input", & iDev, & iSlot, & cType); // iDev, iSlot and cType will now contain correct information.
debug("Arc 1 dev=%1, slot=%2, type=%3",iDev, iSlot, cType);

◆ getIdList()

bncs_stringlist bncs_script_helper::getIdList | ( | const bncs_string & | panel,
 |  | const bncs_string & | filter = ""
 | ) |  |

Get list of buttons ids on the given panel

Parameters
panel | The panel whose children we want listed
filter | Simple text filter - button ids that don't start with this string are excluded. If not present, or null then all IDs are returned.
Returns
bncs_stringlist of identifiers

◆ getObjectSetting()

bncs_string bncs_script_helper::getObjectSetting | ( | const bncs_string & | object,
 |  | const bncs_string & | setting
 | ) |  |

Return named setting for this object (from object_settings.xml)

Parameters
object | the name of the object to get information about
setting | name of setting to return
Returns
object setting or null string if not found
bncs_string s = getObjectSetting( "mything" ); // s contains the "mything" setting

This function written by Chris Gil

◆ getRouterSize()

int bncs_script_helper::getRouterSize | ( | int | device,
 |  | int | database
 | ) |  |

Return the size of a device from its device settings file. This value is taken from the following ini file setting

[Database]
DatabaseSize_0=2000
DatabaseSize_1=2000
Parameters
device | The device number
database | The database number
Returns
the size of the database
int y = getRouterSize( 123, 1 ); // y contains the number of destinations in the database for device 123

◆ getUser()

bncs_string bncs_script_helper::getUser ( void )

Return name of current user

Returns
user name or null string if not found
bncs_string u = getUser(); // u contains the current user

This function currently only returns the default user as contained within workstations.xml

◆ getUserLevel()

bncs_string bncs_script_helper::getUserLevel ( void )

Return the level name of the current user

Returns
user level name
bncs_string ul = getUserLevel(); // ul contains the current user level (e.g. "User" )

User levels are defined as:

0 Read Only No write privileges
1 User Basic privileges
2 Supervisor Enhanced privileges
3 Administrator Full privileges
4 Developer Full privileges and access to developer features and functions
See also
getUserLevelInt();

◆ getUserLevelInt()

int bncs_script_helper::getUserLevelInt ( void )

Return the level integer of the current user

Returns
user level integer
int ul = getUserLevelInt(); // ul contains the current user level (e.g. 1 for "User")
See also
getUserLevel();

◆ getWorkstationSetting()

bncs_string bncs_script_helper::getWorkstationSetting ( const bncs_string & setting )

Return named setting for this workstation

Parameters
setting name of setting to return
Returns
workstation setting or null string if not found
bncs_string s = getWorkstationSetting( "SDI-Monitoring" ); // s contains the "SDI-Monitoring" setting

This function written by Chris Gil

◆ getWorkstationSettings()

bncs_stringlist bncs_script_helper::getWorkstationSettings ( void )

Return a list of settings for this workstation

Returns
bncs_stringlist of workstation settings
bncs_stringlist sl = getWorkstationSettings();

This function written by Chris Gil

◆ gpiPoll()

void bncs_script_helper::gpiPoll | ( | int | dev,
 |  | int | start,
 |  | int | end
 | ) |  |

Poll GPI network device

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
Example:
gpiPoll( 123, 1, 2 ); // poll for slots 1 and 2 on device 123

◆ gpiQuery()

void bncs_script_helper::gpiQuery | ( | int | dev,
 |  | int | start,
 |  | int | end
 | ) |  |

Poll (query) GPI network device

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
Example:
gpiQuery( 123, 1, 2 ); // poll for slots 1 and 2 on device 123
This differs from infoPoll in that revertives are returned on a session if they have to be retreived from the network
Note
You cannot query two ranges on the the same device simultaneously
gpiQuery( 123, 100, 200 ); // this won't work
gpiQuery( 123, 900, 1000 ); // this won't work

◆ gpiRegister()

void bncs_script_helper::gpiRegister | ( | int | dev,
 |  | int | start,
 |  | int | end,
 |  | bool | add = false
 | ) |  |

Register to receive network messages

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
add | Optional, if true the registration is added, if false (default) registration replaces previous registrations
Example:
gpiRegister( 123, 1, 2 ); // register for network messages for device 123 slots 1 and 2
gpiRegister( 123, 11, 11, true );
This function is entirely equivalent to infoRegister() and routerRegister()

◆ gpiSwitch()

void bncs_script_helper::gpiSwitch | ( | int | dev,
 |  | bool | state,
 |  | int | index,
 |  | bool | now = false
 | ) |  |

Set the state of a GPI slot

Parameters
dev | The BNCS device number
state | What to switch this GPI to (0/1)
index | Which GPI to switch
now | Whether to send the command immediately or buffer it
Example:
gpiSwitch( 123, 0, 12 ); // make output 12 on device 123 state 0

◆ gpiUnregister()

void bncs_script_helper::gpiUnregister ( int dev )

Unregister for receiving network messages

Parameters
dev The BNCS device number
Example:
gpiUnregister( 123 ); // unregister for network messages for device 123
This function is entirely equivalent to infoUnregister() and routerUnregister()

◆ hostNotify()

void bncs_script_helper::hostNotify ( const bncs_string & message )

Notify Host Tell our host (our parent) that something's happened

Parameters
message The string to send to our host
hostNotify( "value=12.456MHz" ); // tell our parent we've a new value

◆ httpCallback()

virtual void bncs_script_helper::httpCallback ( httpNotify * p )
inlinevirtual

HTTP notification

This gets called whenever HTTP wants to tell us something See the parentNotify documentation for the values it returns

◆ httpGet()

void bncs_script_helper::httpGet | ( | const bncs_string & | url,
 |  | const bncs_string & | localFile
 | ) |  |

Get a file via HTTP

Parameters
[in] | url | the URL - this should be of the format http://host.domain/path
[in] | localFile | the file to write with the data received
Example:
httpGet( "http://myserver/image.png", "/panels/images/image.png" );
Path is taken to be from the system root.
Note
HTTP proxy is not currently supported. You can use Apache Web Server to do this with config directives like this:
ProxyRemote * http://www-cache.reith.bbc.co.uk
ProxyPass /home/ http://path_to_remote_host/
so the path to the webserver of the form: http://my_local_webserver/home/XXX gets proxied to http://path_to_remote_host/XXX
httpCallback does not work for local errors (file doesn't exist) if this function is called in the constructor of a script Success or fail is signalled by the httpCallback function

◆ httpGetString()

void bncs_script_helper::httpGetString ( const bncs_string & url )

Get a string via HTTP

Parameters
[in] url the URL - this should be of the format http://host.domain/path
Example:
httpGetString( "http://myserver/text.txt" );
Note
HTTP proxy is not currently supported. See note for httpGet()

Success or fail is signalled by the httpCallback function where the return string is also returned

◆ httpPut()

void bncs_script_helper::httpPut | ( | const bncs_string & | url,
 |  | const bncs_string & | localFile
 | ) |  |

Send a file via HTTP. Data is sent as POST data

Parameters
[in] | url | the URL - this should be of the format http://host.domain/path
[in] | localFile | the file to send
Example:
httpPut( "http://myserver/myscript", "/config/myconfig.ini" );
Note
HTTP proxy is not currently supported. See note for httpGet()
httpCallback does not work for local errors (file doesn't exist) if this function is called in the constructor of a script Success or fail is signalled by the httpCallback

◆ httpPutString()

void bncs_script_helper::httpPutString | ( | const bncs_string & | url,
 |  | const bncs_string & | string
 | ) |  |

Send a string via HTTP. Data is sent as POST data

Parameters
[in] | url | the URL - this should be of the format http://host.domain/path
[in] | string | the value to send
Example:
httpPutString( "http://myserver/myscript", "Hello World!" );
Note
HTTP proxy is not currently supported See note for httpGet()

Success or fail is signalled by the httpCallback

◆ id()

bncs_string bncs_script_helper::id ( void )

Get the id of this script control

Returns
the id of the control
Example:
bncs_string ret = id( ret ); // ret now contains the id of this control

◆ infoPoll()

void bncs_script_helper::infoPoll | ( | int | dev,
 |  | int | start,
 |  | int | end
 | ) |  |

Poll infodriver network device

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
Example:
infoPoll( 123, 1, 2 ); // poll for slots 1 and 2 on device 123

◆ infoQuery()

void bncs_script_helper::infoQuery | ( | int | dev,
 |  | int | start,
 |  | int | end
 | ) |  |

Poll (query) infodriver network device

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
Example:
infoQuery( 123, 1, 2 ); // poll for slots 1 and 2 on device 123
This differs from infoPoll in that revertives are returned on a session if they have to be retreived from the network
Note
You cannot query two ranges on the the same device simultaneously
infoQuery( 123, 100, 200 ); // this won't work
infoQuery( 123, 900, 1000 ); // this won't work

◆ infoRegister()

void bncs_script_helper::infoRegister | ( | int | dev,
 |  | int | start,
 |  | int | end,
 |  | bool | add = false
 | ) |  |

Register to receive network messages

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
add | Optional, if true the registration is added, if false (default) registration replaces previous registrations
Example:
infoRegister( 123, 1, 2 ); // register for network messages for device 123 slots 1 and 2
infoRegister( 123, 11, 11, true );
This function is entirely equivalent to routerRegister() and gpiRegister()

◆ infoUnregister()

void bncs_script_helper::infoUnregister ( int dev )

Unregister for receiving network messages

Parameters
dev The BNCS device number
Example:
infoUnregister( 123 ); // unregister for network messages for device 123
This function is entirely equivalent to routerUnregister() and gpiUnregister()

◆ infoWrite() [1/2]

void bncs_script_helper::infoWrite | ( | int | dev,
 |  | const bncs_string & | what,
 |  | int | index,
 |  | bool | now = false
 | ) |  |

Write an infodriver network message

Parameters
dev | The BNCS device number
what | The data to write
index | The index of the last in the range
now | Whether this command should be send immediately
Example:
infoWrite( 123, "hello mum", 1 ); // write "hello mum" to slot 1 on device 123

◆ infoWrite() [2/2]

void bncs_script_helper::infoWrite | ( | const bncs_string & | format,
 |  |  | ...
 | ) |  |

Write an infodriver network message

Parameters
format Message to send
Example
infoWrite("IW 123 'hello mum' 1"); //write "hello mum" to slot 1 on device 123
infoWrite("IW 123 'hello mum' 1 1"); //write "hello mum" to slot 1 on device 123 with "Now" flag set

◆ navigateAdjust()

void bncs_script_helper::navigateAdjust ( const bncs_string & str )

Navigate to another view for given adjustable device

Parameters
str the name of the device to be adjusted
navigateAdjust( "ARC1" );

Nothing will happen if this device is not adjustable See navigateCanAdjust()

◆ navigateCanAdjust()

bool bncs_script_helper::navigateCanAdjust ( const bncs_string & str )

Return whether this device can be adjusted

Parameters
str the name of the device
Returns
true if this device could be adjusted, otherwise false "Adjustable" means the given name appears in "instances.xml" and the type specified in instances has an associated type handler (in typehandlers.xml)
bool f = navigateCanAdjust( "ARC1" );

◆ navigateCanExecute()

bool bncs_script_helper::navigateCanExecute ( const bncs_string & str )

Return whether this view can be executed

Parameters
str the name of the view
Returns
true if this view could be executed, otherwise false
bool f = navigateCanExecute( "myPanel" );

This function looks for a file called myPanel.dll or if not found one called myPanel.bncs_ui. If still not found then returns false.

◆ navigateExecute()

void bncs_script_helper::navigateExecute ( const bncs_string & str )

Navigate to another view

Parameters
str the name of the view
navigateExecute( "myPanel" );

Nothing will happen if this view cannot be found See navigateCanExecute()

◆ panelDestroy()

bool bncs_script_helper::panelDestroy ( const bncs_string & pnl )

Destroy a panel - this completely removes it and all its children from memory

Parameters
pnl The name of the panel to destroy
Returns
zero on no error, or true on failure
Example:
panelDestroy( "main" );

◆ panelInit()

bool bncs_script_helper::panelInit | ( | const bncs_string & | pnl,
 |  | const bncs_string & | path,
 |  | const bncs_string & | target = ""
 | ) |  |

Prepares a panel for showing from a dialog template or script component

Parameters
pnl | the name of the panel which is how we'll refer to it in later calls
path | the path to the panel to show
target | the instance to target the panel at (Optional)
Returns
zero on no error, or true on failure
Example:
panelInit( 1, "mypanel.bncs_ui", "ARC1" ); // show a panel called mypanel which we'll
// refer to as panel 1
// target at ARC1
textPut( "text", "hello mum", 1, 22 ); // set text on panel 1 button 22
panelInit( "main", "panel2.bncs_ui" ); // show a panel called panel2 which we'll
// refer to as panel "main"
textPut( "text", "hello mum", "main", 33 ); // set text on panel "main" button 33
panelInit( "1", "scripted.dll" ); // show a panel based on a script named scripted.dll
// which we'll refer to as panel "1"
textPut( "text", "hello mum", "1", 44 ); // set text on panel "1" button 44
Note
The panel name sets the value that is sent when a button notification comes back. If a panel is based on a script dll then the id of the "button" is always 0.

◆ panelPopup()

bool bncs_script_helper::panelPopup | ( | const bncs_string & | pnl,
 |  | const bncs_string & | path,
 |  | int | width = 0,
 |  | int | height = 0
 | ) |  |

Shows a popup panel from a dialog template or script component

The difference between this and the normal panelShow() command is that this panel is automatically dismissed and destroyed when the user clicks away from the panel. This is the same behaviour (and uses the same code as) a popup menu.

Parameters
pnl | the name of the panel which is how we'll refer to it in later calls
path | the path to the panel to show - this may be zero length string
width | Width of the dialog - overrides the value read from the .bncs_ui file
height | Height of the dialog - overrides the value read from the .bncs_ui file
Returns
zero on no error, or true on failure
Example:
panelPopup( 1, "mypanel.bncs_ui" ); // show a popup panel called mypanel which
// we'll refer to as panel 1
textPut( "text", "hello mum", 1, 22 ); // set text on panel 1 button 22

If path is zero length string then a blank dialog is created and width and height should be set. This can be used to create dynamic dialogs using the createControl() function

See also
panelShow()

◆ panelRemove()

bool bncs_script_helper::panelRemove ( const bncs_string & pnl )

Remove a panel from view, but do not destroy it

Parameters
pnl the name of the panel
Returns
zero on no error, or true on failure
Example:
panelShow( 1, "mypanel.bncs_ui" ); // show a popup panel called mypanel which we'll
// refer to as panel 1
...
...
panelRemove( 1 ); // remove the panel but don't destroy it
See also
panelShow(), panelPopup()

◆ panelShow()

bool bncs_script_helper::panelShow | ( | const bncs_string & | pnl,
 |  | const bncs_string & | path,
 |  | const bncs_string & | target = ""
 | ) |  |

Shows a panel from a dialog template or script component

Parameters
pnl | the name of the panel which is how we'll refer to it in later calls
path | the path to the panel to show
target | the instance to target the panel at (Optional)
Returns
zero on no error, or true on failure
Example:
panelShow( 1, "mypanel.bncs_ui", "ARC1" ); // show a panel called mypanel which we'll
// refer to as panel 1
// target at ARC1
textPut( "text", "hello mum", 1, 22 ); // set text on panel 1 button 22
panelShow( "main", "panel2.bncs_ui" ); // show a panel called panel2 which we'll
// refer to as panel "main"
textPut( "text", "hello mum", "main", 33 ); // set text on panel "main" button 33
panelShow( "1", "scripted.dll" ); // show a panel based on a script named scripted.dll
// which we'll refer to as panel "1"
textPut( "text", "hello mum", "1", 44 ); // set text on panel "1" button 44
Note
The panel name sets the value that is sent when a button notification comes back. If a panel is based on a script dll then the id of the "button" is always 0.

◆ panelTarget()

bool bncs_script_helper::panelTarget | ( | const bncs_string & | pnl,
 |  | const bncs_string & | target
 | ) |  |

Targets a panel from a dialog template or script component

Parameters
pnl | the name of the panel which is how we'll refer to it in later calls
target | the instance to target the panel at.
Returns
zero on no error, or true on failure
Example:
panelTarget( 1, "ARC1" ); // target panel 1 at ARC1
panelShow( "main", "panel2.bncs_ui" ); // show a panel called panel2 which we'll

◆ parentCallback()

virtual bncs_string bncs_script_helper::parentCallback ( parentNotify * p )
pure virtual

Parent notification

This gets called whenever our parent wants to tell us something See the parentNotify documentation for the values it returns

◆ revertiveCallback()

virtual int bncs_script_helper::revertiveCallback ( revertiveNotify * r )
pure virtual

Revertive notification

This gets called whenever network event occurs See the CB_REVERTIVE documentation for the values it returns

◆ routerCrosspoint()

void bncs_script_helper::routerCrosspoint | ( | int | dev,
 |  | int | source,
 |  | int | dest,
 |  | const bncs_string & | mask = "",
 |  | bool | now = false
 | ) |  |

Make a crosspoint on a router

Parameters
dev | The BNCS device number
source | The source to use
dest | The destination to set
mask | Optional mask to use to set this crosspoint
now | Whether this command should be send immediately
Example:
routerCrosspoint( 123, 1, 2, ",1,2,3," );

◆ routerIndex()

int bncs_script_helper::routerIndex | ( | int | dev,
 |  | int | db,
 |  | const bncs_string & | name
 | ) |  |

Get the index of a BNCS router name

Parameters
dev | The BNCS device number
db | The BNCS database number
name | The name to find
Returns
the index within the database or 0 if not found
Example:
bncs_string ret;
int i = routerIndex( 123, 0, "hello mum" ); // i now contains the index within the database

◆ routerModify()

void bncs_script_helper::routerModify | ( | int | dev,
 |  | int | database,
 |  | int | index,
 |  | const bncs_string & | name,
 |  | bool | reload
 | ) |  |

Issue database change message on the network

Parameters
dev | The BNCS device number
database | The BNCS database number (0-9)
index | The index of the router name to change
name | The new name
reload | Whether or not the driver sent out a tally dump to the network following this change
Example:
routerModify( 123, 1, 2, "Hello", false ); // change device 123 database 1, index 2 to name "Hello" and do not send a tally dump to the network
This function is entirely equivalent to infoRegister() and gpiRegister()

◆ routerName()

void bncs_script_helper::routerName | ( | int | dev,
 |  | int | db,
 |  | int | index,
 |  | bncs_string & | ret
 | ) |  |

Get a BNCS router name

Parameters
dev | The BNCS device number
db | The BNCS database number
index | The index within the BNCS database
ret | Where to put the return value
Example:
bncs_string ret;
routerName( 123, 0, 456, ret ); // ret now contains the router name for device 123 index 456

◆ routerPoll()

void bncs_script_helper::routerPoll | ( | int | dev,
 |  | int | start,
 |  | int | end
 | ) |  |

Poll router network device

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
Example:
routerPoll( 123, 1, 2 ); // poll for destinations 1 and 2 on device 123

◆ routerQuery()

void bncs_script_helper::routerQuery | ( | int | dev,
 |  | int | start,
 |  | int | end
 | ) |  |

Poll (query) router network device

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
Example:
routerQuery( 123, 1, 2 ); // poll for destinations 1 and 2 on device 123
This differs from routerPoll in that revertives are returned on a session if they have to be retreived from the network
Note
You cannot query two ranges on the the same device simultaneously
routerQuery( 123, 100, 200 ); // this won't work
routerQuery( 123, 900, 1000 ); // this won't work

◆ routerRegister()

void bncs_script_helper::routerRegister | ( | int | dev,
 |  | int | start,
 |  | int | end,
 |  | bool | add = false
 | ) |  |

Register to receive network messages

Parameters
dev | The BNCS device number
start | The index of the start of the range
end | The index of the last in the range
add | Optional, if true the registration is added, if false (default) registration replaces previous registrations
Example:
routerRegister( 123, 1, 2 ); // register for network messages for device 123 slots 1 and 2
routerRegister( 123, 11, 11, true );
This function is entirely equivalent to infoRegister() and gpiRegister()

◆ routerUnregister()

void bncs_script_helper::routerUnregister ( int dev )

Unregister for receiving network messages

Parameters
dev The BNCS device number
Example:
routerUnregister( 123 ); // unregister for network messages for device 123
This function is entirely equivalent to infoUnregister() and gpiUnregister()

◆ setGeometry()

void bncs_script_helper::setGeometry | ( | int | x,
 |  | int | y,
 |  | int | w,
 |  | int | h
 | ) |  |

Set the geometry of this component

Parameters
x | The horizontal origin of this component
y | The vertical origin of this component
w | The width of this component
h | The height of this component
Example:
setGeometry( 0,40, 1024, 668 );

◆ setSize() [1/2]

void bncs_script_helper::setSize | ( | int | w,
 |  | int | h
 | ) |  |

Set the size of this component

Parameters
w | The width of this component
h | The height of this component
Example:
setSize( 1024, 668 );

◆ setSize() [2/2]

void bncs_script_helper::setSize ( const bncs_string & pnl )

Set the size of this component

Parameters
pnl Panel identifier
Example:
setSize( "main" );

◆ textGet()

void bncs_script_helper::textGet | ( | const bncs_string & | what,
 |  | const bncs_string & | pnl,
 |  | const bncs_string & | id,
 |  | bncs_string & | ret
 | ) |  |

Get a parameter off a control

Parameters
what | The parameter to get on this control
pnl | The name of the panel
id | The id of the control
ret | Where to put the return value
Example:
bncs_string ret;
textGet( "text", 1, 2, ret ); // ret now contains the text value from control 2 on panel 1

◆ textPut() [1/2]

void bncs_script_helper::textPut | ( | const bncs_string & | what,
 |  | const bncs_string & | pnl,
 |  | const bncs_string & | id
 | ) |  |

Set the text on a control

Parameters
what | The text to send to the control
pnl | The name of the panel
id | The id of the control
Example:
textPut( "text=hello mum", 1, 2 ); // put hello mum on bncs_control "2" on panel "1"
Note
The text is sent entirely asis.
See also
textPut( const bncs_string & param, const bncs_string & value, const bncs_string & pnl, const bncs_string & id )

◆ textPut() [2/2]

void bncs_script_helper::textPut | ( | const bncs_string & | param,
 |  | const bncs_string & | value,
 |  | const bncs_string & | pnl,
 |  | const bncs_string & | id
 | ) |  |

Set the text on a control with a parameter/value pair

Parameters
param | The parameter to set on this control
value | The value to set to
pnl | The name of the panel
id | The id of the control
Example:
textPut( "text", "hello mum", 1, 2 ); // put hello mum on bncs_control "2" on panel "1"
Note
The param and value parameters are joined into a single string and then sent to the control
See also
textPut( const bncs_string & what, const bncs_string & pnl, const bncs_string & id )

◆ timerCallback()

virtual void bncs_script_helper::timerCallback ( int )
pure virtual

Timer notification

This gets called whenever a timer event occurs See the timerStart() / timerStop() documentation for usage information

◆ timerStart()

void bncs_script_helper::timerStart | ( | int | timer,
 |  | int | duration
 | ) |  |

Start a timer

Parameters
timer | The identifier of the timer - this is returned in the callback
duration | Time in milliseconds
#define MYTIMER 1
timerStart( MYTIMER, 1000 ); // starts a 1 second timer
...
// timer events come here
void mypanel::timerCallback( int id )
{
switch( id )
{
case MYTIMER:
doStuff();
break;
}
}
See also
timerStop();

◆ timerStop()

void bncs_script_helper::timerStop ( int timer )

Stop a timer

Parameters
timer The identifier of the timer
#define MYTIMER 1
timerStart( MYTIMER, 1000 ); // starts a 1 second timer
...
// timer events come here
void mypanel::timerCallback( int id )
{
switch( id )
{
case MYTIMER:
timerStop( id ); // make this a once-shot timer
doStuff();
break;
}
}
See also
timerStart();

◆ workstation()

int bncs_script_helper::workstation ( void )

Return the number of this workstation

Returns
number of workstation
int ws = workstation();
Note
This value is the (integer) contents of the CC_WORKSTATION environment variable
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_script_helper Member List

This is the complete list of members for bncs_script_helper, including all inherited members.

actionAll(const bncs_string &sValue) | bncs_script_helper |
audioDestroy(const bncs_string &name) | bncs_script_helper |
audioPlay(const bncs_string &name, int repeat) | bncs_script_helper |
audioPlay(const bncs_string &name, const bncs_string &file, int repeat) | bncs_script_helper |
audioStop(const bncs_string &name) | bncs_script_helper |
audioStopAll() | bncs_script_helper |
bncs_script_helper(bncs_client_callback *parent, const char *path) | bncs_script_helper |
buttonCallback(buttonNotify *b)=0 | bncs_script_helper | pure virtual
callback(const void *, int) | bncs_script_helper |
captionEnable(bool captionOn, const bncs_string &title, const bncs_string &args="") | bncs_script_helper |
controlCreate(const bncs_string &panel, const bncs_string &id, const bncs_string &buttonClass, int x, int y, int w, int h, const bncs_string &settings) | bncs_script_helper |
controlDestroy(const bncs_string &panel, const bncs_string &id) | bncs_script_helper |
controlDisable(const bncs_string &panel, const bncs_string &id) | bncs_script_helper |
controlEnable(const bncs_string &panel, const bncs_string &id) | bncs_script_helper |
controlHide(const bncs_string &panel, const bncs_string &id) | bncs_script_helper |
controlMove(const bncs_string &panel, const bncs_string &id, int x, int y) | bncs_script_helper |
controlPosition(const bncs_string &panel, const bncs_string &id, bncs_string &x, bncs_string &y) | bncs_script_helper |
controlShow(const bncs_string &panel, const bncs_string &id) | bncs_script_helper |
databaseCallback(revertiveNotify *r) | bncs_script_helper | inlinevirtual
debug(const bncs_string &str) | bncs_script_helper |
debug(const bncs_string &format, const bncs_string &in1, const bncs_string &in2="", const bncs_string &in3="", const bncs_string &in4="", const bncs_string &in5="", const bncs_string &in6="", const bncs_string &in7="", const bncs_string &in8="", const bncs_string &in9="") | bncs_script_helper |
enableActionAll() | bncs_script_helper |
getDev(bncs_string instance, int *dev, int *offset=0) | bncs_script_helper |
getDevSlot(const bncs_string &instance, const bncs_string &param, int *dev, int *slot, char *type) | bncs_script_helper |
getDevSlot(const bncs_string &instance, const bncs_string &param, bncs_string &altId, int *dev, int *slot, char *type) | bncs_script_helper |
getIdList(const bncs_string &pnl, const bncs_string &startsWithFilter="") | bncs_script_helper |
getObjectSetting(const bncs_string &object, const bncs_string &setting) | bncs_script_helper |
getRouterSize(int intDevice, int intSwitch) | bncs_script_helper |
getUser(void) | bncs_script_helper |
getUserLevel(void) | bncs_script_helper |
getUserLevelInt(void) | bncs_script_helper |
getWorkstationSetting(const bncs_string &setting) | bncs_script_helper |
getWorkstationSettings(void) | bncs_script_helper |
gpiPoll(int dev, int start, int end) | bncs_script_helper |
gpiQuery(int dev, int start, int end) | bncs_script_helper |
gpiRegister(int dev, int start, int end, bool add=false) | bncs_script_helper |
gpiSwitch(int dev, bool state, int index, bool now=false) | bncs_script_helper |
gpiUnregister(int dev) | bncs_script_helper |
hostNotify(const bncs_string &message) | bncs_script_helper |
httpCallback(httpNotify *p) | bncs_script_helper | inlinevirtual
httpGet(const bncs_string &url, const bncs_string &localFile) | bncs_script_helper |
httpGetString(const bncs_string &url) | bncs_script_helper |
httpPut(const bncs_string &url, const bncs_string &localFile) | bncs_script_helper |
httpPutString(const bncs_string &url, const bncs_string &string) | bncs_script_helper |
id(void) | bncs_script_helper |
infoPoll(int dev, int start, int end) | bncs_script_helper |
infoQuery(int dev, int start, int end) | bncs_script_helper |
infoRegister(int dev, int start, int end, bool add=false) | bncs_script_helper |
infoUnregister(int dev) | bncs_script_helper |
infoWrite(int dev, const bncs_string &what, int index, bool now=false) | bncs_script_helper |
infoWrite(const bncs_string &format,...) | bncs_script_helper |
navigateAdjust(const bncs_string &str) | bncs_script_helper |
navigateCanAdjust(const bncs_string &str) | bncs_script_helper |
navigateCanExecute(const bncs_string &str) | bncs_script_helper |
navigateExecute(const bncs_string &str) | bncs_script_helper |
panelDestroy(const bncs_string &pnl) | bncs_script_helper |
panelInit(const bncs_string &pnl, const bncs_string &path, const bncs_string &target="") | bncs_script_helper |
panelPopup(const bncs_string &pnl, const bncs_string &path, int width=0, int height=0) | bncs_script_helper |
panelRemove(const bncs_string &pnl) | bncs_script_helper |
panelShow(const bncs_string &pnl, const bncs_string &path, const bncs_string &target="") | bncs_script_helper |
panelTarget(const bncs_string &pnl, const bncs_string &target) | bncs_script_helper |
parentCallback(parentNotify *p)=0 | bncs_script_helper | pure virtual
revertiveCallback(revertiveNotify *r)=0 | bncs_script_helper | pure virtual
routerCrosspoint(int dev, int source, int dest, const bncs_string &mask="", bool now=false) | bncs_script_helper |
routerIndex(int dev, int db, const bncs_string &name) | bncs_script_helper |
routerModify(int dev, int database, int index, const bncs_string &name, bool reload) | bncs_script_helper |
routerName(int dev, int db, int index, bncs_string &ret) | bncs_script_helper |
routerPoll(int dev, int start, int end) | bncs_script_helper |
routerQuery(int dev, int start, int end) | bncs_script_helper |
routerRegister(int dev, int start, int end, bool add=false) | bncs_script_helper |
routerUnregister(int dev) | bncs_script_helper |
setGeometry(int x, int y, int w, int h) | bncs_script_helper |
setSize(int w, int h) | bncs_script_helper |
setSize(const bncs_string &pnl) | bncs_script_helper |
textGet(const bncs_string &what, const bncs_string &pnl, const bncs_string &id, bncs_string &ret) | bncs_script_helper |
textPut(const bncs_string &what, const bncs_string &pnl, const bncs_string &id) | bncs_script_helper |
textPut(const bncs_string &param, const bncs_string &value, const bncs_string &pnl, const bncs_string &id) | bncs_script_helper |
timerCallback(int)=0 | bncs_script_helper | pure virtual
timerStart(int timer, int duration) | bncs_script_helper |
timerStop(int timer) | bncs_script_helper |
workstation(void) | bncs_script_helper |
~bncs_script_helper() | bncs_script_helper | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_string Class Reference

bncs_string Class Reference

This is a STL like string handling class. More...

#include <bncs_string.h>

Public Member Functions

bncs_string (const char *in)
bncs_string (void)
bncs_string (const bncs_string &in)
bncs_string (int in, char pad=0, unsigned int padto=0, int base=10)
bncs_string (double in, int digits, char pad=0, unsigned int padto=0)
bncs_string (char in)
bncs_string (const std::string &in)
virtual | ~bncs_string ()
const char | operator[] (unsigned int pos) const
char & | operator[] (int pos)
operator const char * () const
operator int () const
bncs_string & | operator= (const char *in)
bncs_string & | operator= (const bncs_string &in)
bncs_string & | operator+= (const bncs_string &in)
void | dump (void)
bncs_string & | append (const bncs_string &in)
bncs_string & | append (char in)
bncs_string & | append (int in, char pad=0, int padto=0, int base=10)
int | toInt (void) const
int | firstInt (void) const
long | toLong (void) const
unsigned int | toUInt (int base=10) const
unsigned long | toULong (int base=10) const
double | toDouble (void) const
unsigned int | length (void) const
void | truncate (unsigned int newlength)
int | find (char c, int index=0, bool cs=true) const
int | rfind (char c, int index=2147483647, bool cs=true) const
int | find (const bncs_string &s, int index=0, bool cs=true) const
int | contains (char c, bool cs=true) const
bool | startsWith (const bncs_string &s) const
bool | endsWith (const bncs_string &s) const
bncs_string | left (unsigned int length) const
bncs_string | right (unsigned int length) const
bncs_string | mid (unsigned int start, unsigned int length) const
bncs_string | lower (void) const
bncs_string | upper (void) const
bncs_string | stripWhiteSpace (void) const
bncs_string | simplifyWhiteSpace (void) const
bncs_string | arg (const bncs_string &in) const
bncs_string | arg (const char *in) const
bncs_string | arg (int in, char pad=0, unsigned int padto=0, int base=10) const
bncs_string | arg (long in) const
bncs_string & | remove (unsigned int where, unsigned int howmany)
bncs_string & | insert (unsigned int where, const bncs_string &what)
bncs_string & | replace (const bncs_string &what, const bncs_string &with)
bncs_string & | replace (char what, char with)
bncs_string & | cleanup (bool BNCSi=true)
int | split (char delim, bncs_string &part1, bncs_string &part2) const
bncs_string | justifyLeft (int howMany, char with) const
bncs_string | justifyRight (int howMany, char with) const

Friends

class | bncs_stringlist
DO_STRING_EXPORT const bncs_string | operator+ (const bncs_string &in, const bncs_string &in2)
DO_STRING_EXPORT const bncs_string | operator+ (const bncs_string &in, int in2)
DO_STRING_EXPORT const bncs_string | operator+ (int in2, const bncs_string &in)
DO_STRING_EXPORT const bncs_string | operator+ (const bncs_string &in, const char *in2)
DO_STRING_EXPORT const bncs_string | operator+ (const char *in2, const bncs_string &in)
DO_STRING_EXPORT bool | operator== (const bncs_string &, const bncs_string &)
DO_STRING_EXPORT bool | operator!= (const bncs_string &, const bncs_string &)
DO_STRING_EXPORT bool | operator== (const bncs_string &in1, const char *in2)
DO_STRING_EXPORT bool | operator!= (const bncs_string &in1, const char *in2)
DO_STRING_EXPORT bool | operator== (const char *in2, const bncs_string &in1)
DO_STRING_EXPORT bool | operator!= (const char *in2, const bncs_string &in1)
DO_STRING_EXPORT bool | operator== (const bncs_string &in1, int in2)
DO_STRING_EXPORT bool | operator!= (const bncs_string &in1, int in2)
DO_STRING_EXPORT bool | operator== (int in2, const bncs_string &in1)
DO_STRING_EXPORT bool | operator!= (int in2, const bncs_string &in1)
DO_STRING_EXPORT bool | operator< (const bncs_string &in1, const bncs_string &in2)
DO_STRING_EXPORT std::ostream & | operator<< (std::ostream &os, const bncs_string &s)

Detailed Description

This is a STL like string handling class.

It is more fully featured than the STL class and like the Qt class QString only not quite as sophisticated.

The class members are as far as possible like the QString equivalent - so blame any inconsistancies on Trolltech and not me! A Qt developer licence is not required to use it.

It is also designed with a couple of BNCS helper functions

Constructing strings
This can be done in several different ways. Consider the following examples:
bncs_string contents( "Hello mum" );
bncs_string s1 = bncs_string( "IW ")
+ 123
+ " '" + contents + "' "
+ 456;
bncs_string s2 = bncs_string( "IW %1 '%2' %3" )
.arg( 123 )
.arg( contents )
.arg( 456 );
Both of these expressions produce the same output of:
IW 123 'hello mum' 456
S1 is scrappy and difficult to read, the quotes and spaces around the string have to be added separately which does not help.
S2 is easier to read - the "shape" of the string is already apparent in the first line, this method also allows more options for formatting the string (see the documenation for arg(int, char, unsigned int, int) ).
Splitting strings
A single function exists within the bncs_string class for splitting strings - split(). This is an equivalent to ApplCore's TD command.
An external helper class bncs_stringlist() is required to split strings into multiple parts

Constructor & Destructor Documentation

◆ bncs_string() [1/7]

bncs_string::bncs_string ( const char * in )

Constructs a bncs_string by deep copy of input character array

◆ bncs_string() [2/7]

bncs_string::bncs_string ( void )

Constructs and empty string

◆ bncs_string() [3/7]

bncs_string::bncs_string ( const bncs_string & in )

Copy constructor

◆ bncs_string() [4/7]

bncs_string::bncs_string | ( | int | in,
 |  | char | pad = 0,
 |  | unsigned int | padto = 0,
 |  | int | base = 10
 | ) |  |

Constructs a bncs_string from a signed integer

Parameters
in | input integer
pad | character to use to pad this string
padto | how many characters to pad this string out to (right justified)
base | use 2 for binary, 8 for octal, 10 for decimal, 16 for hex
Example:
bncs_string s1( 12 ); // s1 contains "12"
bncs_string s2( 12, '0', 4, 16 ); // s2 contains "000c"

◆ bncs_string() [5/7]

bncs_string::bncs_string | ( | double | in,
 |  | int | digits,
 |  | char | pad = 0,
 |  | unsigned int | padto = 0
 | ) |  |

Constructs a bncs_string from a double

Parameters
in | input double
digits | how many digits to convert
pad | character to use to pad this string
padto | how many characters to pad this string out to (right justified)
Example:
bncs_string s1( 12.34 , 2); // s1 contains "12" (integer constructor)
bncs_string s2( 12.34, 4, '0', unsigned int(8) ); // s2 contains "00012.34"

◆ bncs_string() [6/7]

bncs_string::bncs_string ( char in )

Constructs a bncs_string of length 1 from the single character supplied

Parameters
in input character
Example:
bncs_string s( 'x' ); // s contains "x"

◆ bncs_string() [7/7]

bncs_string::bncs_string ( const std::string & in )
inline

◆ ~bncs_string()

bncs_string::~bncs_string ( )
virtual

Frees all resources associated with this bncs_string

Member Function Documentation

◆ append() [1/3]

bncs_string & bncs_string::append ( const bncs_string & in )

Append bncs_string to this bncs_string

◆ append() [2/3]

bncs_string & bncs_string::append ( char in )

Append character to this bncs_string

◆ append() [3/3]

bncs_string & bncs_string::append | ( | int | in,
 |  | char | pad = 0,
 |  | int | padto = 0,
 |  | int | base = 10
 | ) |  |

Append integer to this bncs_string

◆ arg() [1/4]

bncs_string bncs_string::arg ( const bncs_string & in ) const

Return string with placeholder exchanged for a bncs_string

Parameters
in input bncs_string
Example:
bncs_string s1( "my" )
bncs_string s2 = bncs_string( "hello %1 mum" ).arg( s1 ); // s2 contains "hello my mum"
Note
Subsequent placeholders are decremented so that consecutive.arg calls may be used. Placeholders must be sequential values 1-9 (%%1 to %%9).
bncs_string s1( "my" )
bncs_string s2 = bncs_string( "hello %1 %2 mum" ).arg( s1 ); // s2 contains "hello my %1 mum"
Using the % symbol in the data itself can easily confuse this mechanism - you can always build strings using + or append

◆ arg() [2/4]

bncs_string bncs_string::arg ( const char * in ) const

Return string with placeholder exchanged for a character array

Parameters
in input character array
Example:
bncs_string s = bncs_string( "hello %1 mum" ).arg( "my" ); // s contains "hello my mum"
Note
Subsequent placeholders are decremented so that consecutive.arg calls may be used. Placeholders must be sequential values 1-9 (%%1 to %%9).
Using the % symbol in the data itself can easily confuse this mechanism - you can always build strings using + or append

◆ arg() [3/4]

bncs_string bncs_string::arg | ( | int | in,
 |  | char | pad = 0,
 |  | unsigned int | padto = 0,
 |  | int | base = 10
 | ) |  | const

Return string with placeholder exchanged for a signed integer

Parameters
in | input integer
pad | character to use to pad this string
padto | how many characters to pad this string out to (right justified)
base | use 2 for binary, 8 for octal, 10 for decimal, 16 for hex
Example:
bncs_string s1( "hello %1 mum" ).arg( 12 ); // s1 contains "hello 12 mum"
bncs_string s2 = bncs_string( "hello %1 mum" ).arg( 12, '0', 4, 16 ); // s2 contains "hello 000c mum"
Note
Subsequent placeholders are decremented so that consecutive.arg calls may be used. Placeholders must be sequential values 1-9 (%%1 to %%9).

◆ arg() [4/4]

bncs_string bncs_string::arg ( long in ) const

Return string with placeholder exchanged for an unsigned integer

Parameters
in input unsigned integer
Example:
bncs_string s = bncs_string( "hello %1 mum" ).arg( 12 ); // s contains "hello 12 mum"
Note
Subsequent placeholders are decremented so that consecutive.arg calls may be used. Placeholders must be sequential values 1-9 (%%1 to %%9).

◆ cleanup()

bncs_string & bncs_string::cleanup ( bool BNCSi = true )

Replace undesirable (for BNCS) characters

Parameters
BNCSi whether to strip BNCSi characters
Note
Don't blindly use the BNCSi version if you're using the <param>=<value> method of parameter passing
Example:
bncs_string s( "this is illegal :'.= end" );
s.cleanup(); // s contains this is illegal " end
s.cleanup( false ); // s contains this is illegal ".= end

◆ contains()

int bncs_string::contains | ( | char | c,
 |  | bool | cs = true
 | ) |  | const

Return the number of instances of a character within the string

Returns
count of the character within the string or 0 if the character is not found
Parameters
c | the character to find
cs | whether this search is case sensitive
Example:
bncs_string s( "5678abcba876566" );
int i = s.contains( '6' ); // i contains 4

◆ dump()

void bncs_string::dump ( void )

Display the object contents for debugging

◆ endsWith()

bool bncs_string::endsWith ( const bncs_string & s ) const

Checks if a string ends with a specified bncs_string

Returns
true, if the string ends with the specified suffix
Parameters
s the suffix to check
Example:
bncs_string s( "London" );
bool b = s.endsWith( "don" ); // b is true in this case

◆ find() [1/2]

int bncs_string::find | ( | char | c,
 |  | int | index = 0,
 |  | bool | cs = true
 | ) |  | const

Find a single character in the string

Returns
index within the string of the character or -1 if the character is not found
Example:
bncs_string s( "5678abc" );
int i = s.find( '6' ); // i contains 1

◆ find() [2/2]

int bncs_string::find | ( | const bncs_string & | f,
 |  | int | index = 0,
 |  | bool | cs = true
 | ) |  | const

Find a bncs_string within in the string

Returns
index within the string of the string or -1 if the string is not found
Example:
bncs_string s( "5678abc" );
int i = s.find( "78" ); // i contains 2

◆ firstInt()

int bncs_string::firstInt ( void ) const

Convert the first numeric characters in this bncs_string to an integer

Returns
integer value
Example:
bncs_string s( "abc1234abc" );
int i = s.firstInt(); // i contains 1234
Remarks
Non numeric characters stop the conversion

◆ insert()

bncs_string & bncs_string::insert | ( | unsigned int | where,
 |  | const bncs_string & | what
 | ) |  |

Insert characters from a string

Parameters
where | the index of where to put the string
what | the string to insert
Example:
bncs_string s( "hello mum" );
s.insert( 6, "my " ); // s contains "hello my mum"

◆ justifyLeft()

bncs_string bncs_string::justifyLeft | ( | int | howMany,
 |  | char | with
 | ) |  | const

Justify a string to the left

Parameters
howMany | how many characters the string should be
with | the character to used to fill
Returns
reference to this string
Example:
bncs_string s( "hello" );
bncs_string ex = s.justifyLeft( 10, '_' ); ex contains "hello_____"
Note
If the string is already longer than the required number of characters then nothing will happen

◆ justifyRight()

bncs_string bncs_string::justifyRight | ( | int | howMany,
 |  | char | with
 | ) |  | const

Justify a string to the right

Parameters
howMany | how many characters the string should be
with | the character to used to fill
Returns
reference to this string
Example:
bncs_string s( "hello" );
bncs_string ex = s.justifyRight( 10, '_' ); ex contains "_____hello"
Note
If the string is already longer than the required number of characters then nothing will happen

◆ left()

bncs_string bncs_string::left ( unsigned int length ) const

Return the left n characters of a string

Returns
the truncated string
Example:
bncs_string s1( "5678abc" );
bncs_string s2 = s.left( 4 ); // s2 contains 5678
Note
If the length parameter is greater than the length of the string then the entire string is returned

◆ length()

unsigned int bncs_string::length ( void ) const

Return the length of this bncs_string

Returns
unsigned long integer value
Example:
bncs_string s( "hello mum" );
int i = s.length(); // i contains 9

◆ lower()

bncs_string bncs_string::lower ( void ) const

Return the string in entirely lower case

Returns
upper case version of the bncs_string
Example:
bncs_string s1( "abcDEF" );
bncs_string s2 = s1.lower(); // s2 contains "abcdef"

◆ mid()

bncs_string bncs_string::mid | ( | unsigned int | start,
 |  | unsigned int | length
 | ) |  | const

Return the middle section of a string

◆ operator const char *()

bncs_string::operator const char * ( ) const

Cast this bncs_string to character array

Example:
char out[ 256 ];
bncs_string s( "hello mum" );
sprintf( out, "result: %s", (const char*) s ); // out contains "result: hello mum"
Note
You may not use the resulting pointer to modify the data. This pointer can't be considered valid after any other bncs_string call.

◆ operator int()

bncs_string::operator int ( ) const

Cast this bncs_string to an integer This automatically returns the toInt() value whereever appropriate - see example

Example:
bncs_string s( "123" );
switch( s ) // converts s to an integer
{
case 123: doStuff(); break;
}

◆ operator+=()

bncs_string & bncs_string::operator+= ( const bncs_string & in )

Concatenate two bncs_strings

◆ operator=() [1/2]

bncs_string & bncs_string::operator= ( const char * in )

Cast this bncs_string to a double This automatically returns the toDouble() value whereever appropriate - see example

Example:
bncs_string s( "123.456" );
double d = s; // converts s to a double
if (d == 123.456)
doStuff();
operator double() has been removed as it causes ambiguity problems. Use toDouble().Assign character array to this bncs_string

◆ operator=() [2/2]

bncs_string & bncs_string::operator= ( const bncs_string & in )

Assign bncs_string to this bncs_string

◆ operator[]() [1/2]

const char bncs_string::operator[] ( unsigned int pos ) const

Return a character within the string

Parameters
pos the index within the string of the character to return
Returns
the character requested or NULL is returned if pos is bigger than the length of the string
Example:
bncs_string s( "hello mum" );
char c = s[ 4 ] // c contains 'o'
Note
This is the old function (included for backwards compatibility)

◆ operator[]() [2/2]

char & bncs_string::operator[] ( int pos )

Return a character within the string

Parameters
pos the index within the string of the character to return
Returns
the character requested or NULL is returned if pos is bigger than the length of the string
Example:
bncs_string s( "hello mum" );
char c = s[ 4 ] // c contains 'o'
s[ 4 ] = 'O'; // s contains "hellO mum"
Note
This is the new function - can use as lvalue

◆ remove()

bncs_string & bncs_string::remove | ( | unsigned int | where,
 |  | unsigned int | howmany
 | ) |  |

Remove characters from a string

Parameters
where | the index of where to start removing characters
howmany | how many characters to remove
Example:
bncs_string s( "hello mum" );
s.remove( 1, 4 ); // s contains "h mum"

◆ replace() [1/2]

bncs_string & bncs_string::replace | ( | const bncs_string & | what,
 |  | const bncs_string & | with
 | ) |  |

Replace part of the string with another string

Parameters
what | the substring to replace
with | the string to insert
Example:
bncs_string s( "hello mum" );
s.replace( "hello", "goodbye" ); // s contains "goodbye mum"

◆ replace() [2/2]

bncs_string & bncs_string::replace | ( | char | what,
 |  | char | with
 | ) |  |

Substitute a single character

Parameters
what | the character to replace
with | the replacement character
Example:
bncs_string s( "hello mum" );
s.replace( 'e', 'E' ); // s contains "hEllo mum"

◆ rfind()

int bncs_string::rfind | ( | char | c,
 |  | int | index = 2147483647,
 |  | bool | cs = true
 | ) |  | const

Find a single character in the string - searching backwards

Returns
index within the string of the character or -1 if the character is not found
Example:
bncs_string s( "1_2_3_4_3_2_1_" );
int c = 2147483647;
while( (c = s.rfind( '1', c )) > -1 )
{
debug( "found at %1", c ); // "found at..." 12 and 0
c--;
}

◆ right()

bncs_string bncs_string::right ( unsigned int length ) const

Return the right n characters of a string

Returns
the truncated string
Example:
bncs_string s1( "5678abc" );
bncs_string s2 = s.right( 3 ); // s2 contains abc
Note
If the length parameter is greater than the length of the string then the entire string is returned

◆ simplifyWhiteSpace()

bncs_string bncs_string::simplifyWhiteSpace ( void ) const

Return the string with the all redundant whitespace removed.

Multiple whitespace (spaces, tabs, newlines etc) are replaced by a single space character except at the beginning and end of the string where it is removed

Example:
bncs_string s1( " this \t is \r\n a test " );
bncs_string s2 = s1.simplifyWhiteSpace(); // s2 contains "this is a test"
See also
stripWhiteSpace

◆ split()

int bncs_string::split | ( | char | delim,
 |  | bncs_string & | part1,
 |  | bncs_string & | part2
 | ) |  | const

Split a string in two This function is intended as a convenience rather than a comprehensive split routine. "Proper" string splitting into multiple parts, with multiple delimiters is undertaken outside of this class.

Parameters
delim | the character to split on
part1 | the string before the first delimiter
part2 | the string after the delimiter - this may include more delimiter characters
Returns
index of the delimiter or -1 if no delimiter was found
Example:
bncs_string s( "param=value" );
bncs_string p1;
bncs_string p2;
s.split( '=', p1, p2 ); // p1 contains "param", p2 contains "value"
Note
If no delimiter is found neither part1 or part2 are modified - you should check the return value is >-1 to ensure that the input string was split up. If you want part1 to default to the same value as the input string if no delimiter is found then explicitly set it before calling split e.g.:
bncs_string s( "param&value" );
bncs_string p1 = s;
bncs_string p2;
s.split( '=', p1, p2 ); // p1 contains "param&value", p2 contains nothing

◆ startsWith()

bool bncs_string::startsWith ( const bncs_string & s ) const

Checks if a string starts with a specified bncs_string

Returns
true, if the string starts with the specified prefix
Parameters
s the prefix to check
Example:
bncs_string s( "London" );
bool b = s.startsWith( "Lon" ); // b is true in this case

◆ stripWhiteSpace()

bncs_string bncs_string::stripWhiteSpace ( void ) const

Removes all whitespace from the string

Returns
string without whitespace
Example:
bncs_string s1( " this \t is \r\n a test " );
bncs_string s2 = s1.stripWhiteSpace(); // s2 contains "thisisatest"
See also
simplifyWhiteSpace

◆ toDouble()

double bncs_string::toDouble ( void ) const

Convert this bncs_string to a double value

Returns
double value
Example:
bncs_string s( "123.456" );
double d = s.toDouble(); // d contains 123.456
Remarks
Non numeric characters stop the conversion

◆ toInt()

int bncs_string::toInt ( void ) const

Convert this bncs_string to an integer

Returns
integer value
Example:
bncs_string s( "-1234abc" );
int i = s.toInt(); // i contains -1234
Remarks
Non numeric characters stop the conversion

◆ toLong()

long bncs_string::toLong ( void ) const

Convert this bncs_string to a long integer

Returns
long integer value
Example:
bncs_string s( "-1234abc" );
long i = s.toLong(); // i contains -1234
Remarks
Non numeric characters stop the conversion

◆ toUInt()

unsigned int bncs_string::toUInt ( int base = 10 ) const

Convert this bncs_string to a unsigned integer

Returns
unsigned integer value
Example:
bncs_string s( "5678abc" );
unsigned int i = s.toUInt(); // i contains 5678
Remarks
Non numeric characters stop the conversion

◆ toULong()

unsigned long bncs_string::toULong ( int base = 10 ) const

Convert this bncs_string to an unsigned long integer

Returns
unsigned long integer value
Example:
bncs_string s( "5678abc" );
unsigned long i = s.toULong(); // i contains 5678
Remarks
Non numeric characters stop the conversion

◆ truncate()

void bncs_string::truncate ( unsigned int newlength )

Truncate this string to the specified length

Parameters
newlength The new length of the string
Example:
bncs_string s( "5678abc" );
s.truncate( 3 ); // s contains "567"
Remarks
Nothing happens if the string is at or longer than newlength

◆ upper()

bncs_string bncs_string::upper ( void ) const

Return the string in entirely upper case

Returns
upper case version of the bncs_string
Example:
bncs_string s1( "abcDEF" );
bncs_string s2 = s1.upper(); // s2 contains "ABCDEF"

Friends And Related Function Documentation

◆ bncs_stringlist

friend class bncs_stringlist
friend

◆ operator!= [1/5]

DO_STRING_EXPORT bool operator!= | ( | const bncs_string & | in1,
 |  | const bncs_string & | in2
 | ) |  |
friend

Compare bncs_string objects

Returns
true on in1 != in2

◆ operator!= [2/5]

DO_STRING_EXPORT bool operator!= | ( | const bncs_string & | in1,
 |  | const char * | in2
 | ) |  |
friend

Compare bncs_string with char buffer

Returns
true on in1 != in2

◆ operator!= [3/5]

DO_STRING_EXPORT bool operator!= | ( | const char * | in2,
 |  | const bncs_string & | in1
 | ) |  |
friend

Compare bncs_string with char buffer

Returns
true on in1 != in2

◆ operator!= [4/5]

DO_STRING_EXPORT bool operator!= | ( | const bncs_string & | in1,
 |  | int | in2
 | ) |  |
friend

Compare bncs_string and integer

Returns
true on in1 != in2

◆ operator!= [5/5]

DO_STRING_EXPORT bool operator!= | ( | int | in2,
 |  | const bncs_string & | in1
 | ) |  |
friend

Compare bncs_string and integer

Returns
true on in1 != in2

◆ operator+ [1/5]

DO_STRING_EXPORT const bncs_string operator+ | ( | const bncs_string & | in,
 |  | const bncs_string & | in2
 | ) |  |
friend

Compare bncs_string and character array

Returns
true on in1 != in2 Compare bncs_strings
true on in1 != in2 Compare bncs_string and character array
true on in1 != in2 Compare bncs_strings
true on in1 != in2Concatenate two bncs_strings

◆ operator+ [2/5]

DO_STRING_EXPORT const bncs_string operator+ | ( | const bncs_string & | in,
 |  | int | in2
 | ) |  |
friend

Concatenate bncs_string and integer

◆ operator+ [3/5]

DO_STRING_EXPORT const bncs_string operator+ | ( | int | in2,
 |  | const bncs_string & | in
 | ) |  |
friend

Concatenate bncs_string and integer value

◆ operator+ [4/5]

DO_STRING_EXPORT const bncs_string operator+ | ( | const bncs_string & | in,
 |  | const char * | in2
 | ) |  |
friend

Concatenate bncs_string and character array

◆ operator+ [5/5]

DO_STRING_EXPORT const bncs_string operator+ | ( | const char * | in2,
 |  | const bncs_string & | in
 | ) |  |
friend

Concatenate bncs_string and character array

◆ operator<

DO_STRING_EXPORT bool operator< | ( | const bncs_string & | in1,
 |  | const bncs_string & | in2
 | ) |  |
friend

Sorting function

Parameters
in1 | first string
in2 | second string
Returns
true if in1 < in2
Example:
bncs_string str1( "bbb" );
bncs_string str2( "aaa" );
if( str1 < str2 )
doStuff(); // this won't get called

◆ operator<<

DO_STRING_EXPORT std::ostream& operator<< | ( | std::ostream & | os,
 |  | const bncs_string & | s
 | ) |  |
friend

Write bncs_string to output stream. This follows the conventional form for stream output functions.

Returns
inputted stream value.
Example:
bncs_string sHello( "Hello!" );
cout << sHello << endl;
// Will write "Hello!" and a newline to the standard output stream.

◆ operator== [1/5]

DO_STRING_EXPORT bool operator== | ( | const bncs_string & | in1,
 |  | const bncs_string & | in2
 | ) |  |
friend

Compare bncs_string objects

Returns
true on in1 = in2

◆ operator== [2/5]

DO_STRING_EXPORT bool operator== | ( | const bncs_string & | in1,
 |  | const char * | in2
 | ) |  |
friend

Compare bncs_string and character array

Returns
true on in1 = in2

◆ operator== [3/5]

DO_STRING_EXPORT bool operator== | ( | const char * | in2,
 |  | const bncs_string & | in1
 | ) |  |
friend

Compare character array and bncs_string

Returns
true on in1 = in2

◆ operator== [4/5]

DO_STRING_EXPORT bool operator== | ( | const bncs_string & | in1,
 |  | int | in2
 | ) |  |
friend

Compare bncs_string and integer

Returns
true on in1 = in2

◆ operator== [5/5]

DO_STRING_EXPORT bool operator== | ( | int | in2,
 |  | const bncs_string & | in1
 | ) |  |
friend

Compare bncs_string and integer

Returns
true on in1 = in2
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_string Member List

This is the complete list of members for bncs_string, including all inherited members.

append(const bncs_string &in) | bncs_string |
append(char in) | bncs_string |
append(int in, char pad=0, int padto=0, int base=10) | bncs_string |
arg(const bncs_string &in) const | bncs_string |
arg(const char *in) const | bncs_string |
arg(int in, char pad=0, unsigned int padto=0, int base=10) const | bncs_string |
arg(long in) const | bncs_string |
bncs_string(const char *in) | bncs_string |
bncs_string(void) | bncs_string |
bncs_string(const bncs_string &in) | bncs_string |
bncs_string(int in, char pad=0, unsigned int padto=0, int base=10) | bncs_string |
bncs_string(double in, int digits, char pad=0, unsigned int padto=0) | bncs_string |
bncs_string(char in) | bncs_string |
bncs_string(const std::string &in) | bncs_string | inline
bncs_stringlist class | bncs_string | friend
cleanup(bool BNCSi=true) | bncs_string |
contains(char c, bool cs=true) const | bncs_string |
dump(void) | bncs_string |
endsWith(const bncs_string &s) const | bncs_string |
find(char c, int index=0, bool cs=true) const | bncs_string |
find(const bncs_string &s, int index=0, bool cs=true) const | bncs_string |
firstInt(void) const | bncs_string |
insert(unsigned int where, const bncs_string &what) | bncs_string |
justifyLeft(int howMany, char with) const | bncs_string |
justifyRight(int howMany, char with) const | bncs_string |
left(unsigned int length) const | bncs_string |
length(void) const | bncs_string |
lower(void) const | bncs_string |
mid(unsigned int start, unsigned int length) const | bncs_string |
operator const char *() const | bncs_string |
operator int() const | bncs_string |
operator!=(const bncs_string &, const bncs_string &) | bncs_string | friend
operator!=(const bncs_string &in1, const char *in2) | bncs_string | friend
operator!=(const char *in2, const bncs_string &in1) | bncs_string | friend
operator!=(const bncs_string &in1, int in2) | bncs_string | friend
operator!=(int in2, const bncs_string &in1) | bncs_string | friend
operator+(const bncs_string &in, const bncs_string &in2) | bncs_string | friend
operator+(const bncs_string &in, int in2) | bncs_string | friend
operator+(int in2, const bncs_string &in) | bncs_string | friend
operator+(const bncs_string &in, const char *in2) | bncs_string | friend
operator+(const char *in2, const bncs_string &in) | bncs_string | friend
operator+=(const bncs_string &in) | bncs_string |
operator<(const bncs_string &in1, const bncs_string &in2) | bncs_string | friend
operator<<(std::ostream &os, const bncs_string &s) | bncs_string | friend
operator=(const char *in) | bncs_string |
operator=(const bncs_string &in) | bncs_string |
operator==(const bncs_string &, const bncs_string &) | bncs_string | friend
operator==(const bncs_string &in1, const char *in2) | bncs_string | friend
operator==(const char *in2, const bncs_string &in1) | bncs_string | friend
operator==(const bncs_string &in1, int in2) | bncs_string | friend
operator==(int in2, const bncs_string &in1) | bncs_string | friend
operator[](unsigned int pos) const | bncs_string |
operator[](int pos) | bncs_string |
remove(unsigned int where, unsigned int howmany) | bncs_string |
replace(const bncs_string &what, const bncs_string &with) | bncs_string |
replace(char what, char with) | bncs_string |
rfind(char c, int index=2147483647, bool cs=true) const | bncs_string |
right(unsigned int length) const | bncs_string |
simplifyWhiteSpace(void) const | bncs_string |
split(char delim, bncs_string &part1, bncs_string &part2) const | bncs_string |
startsWith(const bncs_string &s) const | bncs_string |
stripWhiteSpace(void) const | bncs_string |
toDouble(void) const | bncs_string |
toInt(void) const | bncs_string |
toLong(void) const | bncs_string |
toUInt(int base=10) const | bncs_string |
toULong(int base=10) const | bncs_string |
truncate(unsigned int newlength) | bncs_string |
upper(void) const | bncs_string |
~bncs_string() | bncs_string | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_stringlist Class Reference

bncs_stringlist Class Reference

This is bncs_string helper class to deal with lists of string. More...

#include <bncs_stringlist.h>

Public Types

typedef bncs_stringlistIterator | const_iterator
typedef bncs_stringlistIterator | iterator

Public Member Functions

bncs_stringlist & | operator= (const bncs_stringlist &in)
Assignment operator. Assigns one bncs_stringlist to another. More...
bncs_stringlist ()
bncs_stringlist (const bncs_string &in, const char delim=',')
bncs_stringlist (const bncs_stringlist &in)
Copy constructor. Initialize one bncs_stringlist to the value of another. More...
virtual | ~bncs_stringlist ()
bncs_string & | operator[] (int pos)
const bncs_string & | operator[] (int pos) const
operator const char * (void)
int | count (void) const
bncs_string | toString (const char delim=',')
bncs_stringlist & | fromString (const bncs_string &in, const char delim=',')
bncs_stringlist & | append (const bncs_string &in)
bncs_stringlist & | prepend (const bncs_string &in)
bncs_stringlist & | deleteItem (int pos)
bncs_stringlist & | replaceItem (const bncs_string &, int pos)
bncs_stringlist & | operator+ (const bncs_string &)
bncs_stringlist & | operator+= (const bncs_string &)
bncs_stringlist & | operator+ (const bncs_stringlist &in)
bncs_stringlist & | operator+= (const bncs_stringlist &in)
bncs_stringlist & | operator<< (const bncs_string &)
bncs_stringlist & | operator= (const bncs_string &)
const iterator | begin (void)
const iterator | end (void)
const const_iterator | begin (void) const
const const_iterator | end (void) const
bncs_stringlist | sort (bool asc=true) const
int | valueCount (const bncs_string &in, bool cs=false)
int | find (const bncs_string &in, bool cs=false)
bncs_string | getNamedParam (const bncs_string &in)
void | clear ()
void | setCount (int, const bncs_string &def="")

Friends

class bncs_stringlistIterator

Detailed Description

This is bncs_string helper class to deal with lists of string.

Member Typedef Documentation

◆ const_iterator

typedef bncs_stringlistIterator bncs_stringlist::const_iterator

Const iterator for the bncs_stringlist

Example:
for( bncs_stringlist::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
{
printf( *it );
}

◆ iterator

typedef bncs_stringlistIterator bncs_stringlist::iterator

Iterator for the bncs_stringlist

Example:
for( bncs_stringlist::iterator it = sl.begin() ; it != sl.end() ; ++it )
{
printf( *it );
}

Constructor & Destructor Documentation

◆ bncs_stringlist() [1/3]

bncs_stringlist::bncs_stringlist ( )

◆ bncs_stringlist() [2/3]

bncs_stringlist::bncs_stringlist | ( | const bncs_string & | in,
 |  | const char | delim = ','
 | ) |  |

Constructs a bncs_stringlist from a delimited bncs_string

Parameters
in | input string
delim | delimiter used by "in"
Example:
bncs_stringlist sl( "1,2,3,4,5," );
bncs_string s = sl[ 1 ]; // s contains "2" (the second item in the list)

◆ bncs_stringlist() [3/3]

bncs_stringlist::bncs_stringlist ( const bncs_stringlist & in )

Copy constructor. Initialize one bncs_stringlist to the value of another.

◆ ~bncs_stringlist()

bncs_stringlist::~bncs_stringlist ( )
virtual

Member Function Documentation

◆ append()

bncs_stringlist & bncs_stringlist::append ( const bncs_string & in )

Append an item to the end of the stringlist

Parameters
in string to append
Returns
a reference to this bncs_stringlist
Example:
bncs_stringlist sl( "1,2,3,4,5," );
sl.append( "6" );
bncs_string s = sl.toString( '-' ); // s contains "1-2-3-4-5-6"

◆ begin() [1/2]

const bncs_stringlist::iterator bncs_stringlist::begin ( void )

Return an iterator to the start of the bncs_stringlist

Example:
for( bncs_stringlist::iterator it = sl.begin() ; it != sl.end() ; ++it )
{
printf( *it );
}

◆ begin() [2/2]

const bncs_stringlist::const_iterator bncs_stringlist::begin ( void ) const

Return a const iterator to the start of the bncs_stringlist

Example:
for( bncs_stringlist::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
{
printf( *it );
}

◆ clear()

void bncs_stringlist::clear ( void )

Clears the bncs_stringlist

Example:
bncs_stringlist sl( "1-2-3-4-5", '-' );
sl.clear(); // clear the list

◆ count()

int bncs_stringlist::count ( void ) const

Return the number of items in this string list

Returns
the number of items in the list
Example:
bncs_stringlist sl( "1,2,3,4,5," );
int c = sl.count(); // c contains 5

◆ deleteItem()

bncs_stringlist & bncs_stringlist::deleteItem ( int pos )

Delete the item at the given position

Parameters
pos position of item to delete
Returns
a reference to this bncs_stringlist
Example:
bncs_stringlist sl( "1,2,3,4,5," );
sl.deleteItem( 1 );
bncs_string s = sl.toString( '-' ); // s contains "1-3-4-5"

◆ end() [1/2]

const bncs_stringlist::iterator bncs_stringlist::end ( void )

Return an iterator to the end of the bncs_stringlist

Example:
for( bncs_stringlist::iterator it = sl.begin() ; it != sl.end() ; ++it )
{
printf( *it );
}

◆ end() [2/2]

const bncs_stringlist::const_iterator bncs_stringlist::end ( void ) const

Return a const iterator to the end of the bncs_stringlist

Example:
for( bncs_stringlist::const_iterator it = sl.begin() ; it != sl.end() ; ++it )
{
printf( *it );
}

◆ find()

int bncs_stringlist::find | ( | const bncs_string & | in,
 |  | bool | cs = false
 | ) |  |

Search for the first instance of an item in the list

Parameters
in | string to search for
cs | whether the search is case sensitive
Returns
position in the list (where 0 is the first item, and count()-1 is the last item.) If the item is not found the return value is -1.
Example:
bncs_stringlist sl( "1,2,3,4,4,4,");
int c = sl.find( "2" ); // c contains 1
int d = sl.find( "4" ); // c contains 3

◆ fromString()

bncs_stringlist & bncs_stringlist::fromString | ( | const bncs_string & | in,
 |  | const char | delim = ','
 | ) |  |

Replaces the current contents of this bncs_stringlist from a delimited bncs_string

Parameters
in | input string
delim | delimiter used by "in"
Example:
bncs_stringlist sl( "1,2,3,4,5," );
bncs_string s = sl[ 1 ]; // s contains "2" (the second item in the list)

◆ getNamedParam()

bncs_string bncs_stringlist::getNamedParam ( const bncs_string & in )

Extract a named parameter from a bncs_stringlist

Note
This is a BNCS V4.5 specific function

The purpose of this function is to extract a single <parameter>=<value> pair and return the value

Example:
device=1,offset=0,
bncs_stringlist sl( "device=123,offset=100," );
bncs_string d = sl.getNamedParam( "device" ); // d contains 123
bncs_string o = sl.getNamedParam( "offset" ); // o contains 100
Note
This isn't the most efficient function - the list has to be split up and searched for each parameter requested

◆ operator const char *()

bncs_stringlist::operator const char * ( void )

Convert this bncs_stringlist to a bncs_string

Note
It's assumed that the delimiter is a comma
Example:
bncs_stringlist sl( "1-2-3-4-5", '-' );
printf( (const char*) sl ); // print "1,2,3,4,5,"

◆ operator+() [1/2]

bncs_stringlist & bncs_stringlist::operator+ ( const bncs_string & in )

Append an item to the end of the stringlist

Example:
bncs_stringlist sl( "1,2,3,4,5," );
bncs_stringlist sl2 = sl + "6";
bncs_string s = sl2.toString( '-' ); // s contains "1-2-3-4-5-6"

◆ operator+() [2/2]

bncs_stringlist & bncs_stringlist::operator+ ( const bncs_stringlist & in )

Append a bncs_stringlist to the end of the bncs_stringlist

Example:
bncs_stringlist sl1( "1,2,3,4,5," );
bncs_stringlist sl2( "6,7,8,9,10" );
bncs_stringlist sl3 = sl1 + sl2
bncs_string s = sl3.toString( '-' ); // s contains "1-2-3-4-5-6-7-8-9-10"

◆ operator+=() [1/2]

bncs_stringlist & bncs_stringlist::operator+= ( const bncs_string & in )

Append an item to the end of the stringlist

Example:
bncs_stringlist sl( "1,2,3,4,5," );
bncs_stringlist sl2 = sl + "6";
bncs_string s = sl2.toString( '-' ); // s contains "1-2-3-4-5-6"

◆ operator+=() [2/2]

bncs_stringlist & bncs_stringlist::operator+= ( const bncs_stringlist & in )

Append a bncs_stringlist to the end of the bncs_stringlist

Example:
bncs_stringlist sl( "1,2,3,4,5," );
sl += bncs_stringlist( "6,7,8,9,10" );
bncs_string s = sl.toString( '-' ); // s contains "1-2-3-4-5-6-7-8-9-10"

◆ operator<<()

bncs_stringlist & bncs_stringlist::operator<< ( const bncs_string & in )

Append an item to the end of the stringlist

Example:
bncs_stringlist sl( "1,2,3,4,5," );
sl << "6";
bncs_string s = sl.toString( '-' ); // s contains "1-2-3-4-5-6"

◆ operator=() [1/2]

bncs_stringlist & bncs_stringlist::operator= ( const bncs_stringlist & in )

Assignment operator. Assigns one bncs_stringlist to another.

◆ operator=() [2/2]

bncs_stringlist & bncs_stringlist::operator= ( const bncs_string & in )

Assign the contents of this bncs_stringlist to a delimited string

Note
It's assumed that the input string is comma delimited
Example:
bncs_stringlist sl;
sl = "1,2,3,4,5,";
bncs_string s = sl.toString( '-' ); // s contains "1-2-3-4-5"

◆ operator[]() [1/2]

bncs_string & bncs_stringlist::operator[] ( int pos )

Return the n'th item in the list

Parameters
pos item in the list to return
Returns
item if found or zero length string if not
Example:
bncs_stringlist sl( "1,2,3,4,5," );
bncs_string s = sl[ 1 ]; // s contains "2" (the second item in the list)
From version 4.5.1 can also be used to set the value at that index
bncs_stringlist sl( "1,2,3,4,5," );
bncs_string s = sl[ 1 ]; // s contains "2" (the second item in the list)
sl[ 1 ] = "blibble";
s = sl[ 1 ]; // s contains "blibble" (the changed second item in the list)
sl[ 11 ] = "blibble"; // nothing happens (there is no item 11)
Note
Use as l-value only possible where an entry already exists
See also
setCount

◆ operator[]() [2/2]

const bncs_string & bncs_stringlist::operator[] ( int pos ) const

◆ prepend()

bncs_stringlist & bncs_stringlist::prepend ( const bncs_string & in )

Insert an item at the start of the stringlist

Parameters
in string to prepend
Returns
a reference to this bncs_stringlist
Example:
bncs_stringlist sl( "1,2,3,4,5," );
sl.prepend( "6" );
bncs_string s = sl.toString( '-' ); // s contains "6-1-2-3-4-5"

◆ replaceItem()

bncs_stringlist & bncs_stringlist::replaceItem | ( | const bncs_string & | in,
 |  | int | pos
 | ) |  |

Replace the item at the given position with another string

Parameters
pos | position of item to replace
in | string to replace with
Returns
a reference to this bncs_stringlist
Example:
bncs_stringlist sl( "1,2,3,4,5," );
sl.replaceItem( 1 );
bncs_string s = sl.toString( '-' ); // s contains "1-3-4-5"

◆ setCount()

void bncs_stringlist::setCount | ( | int | newSize,
 |  | const bncs_string & | def = ""
 | ) |  |

Sets the bncs_stringlist to the specified number of elements

Example:
bncs_stringlist sl( "1-2-3-4-5", '-' );
sl.clear(); // clear the list

◆ sort()

bncs_stringlist bncs_stringlist::sort ( bool asc = true ) const

Sort the list

Parameters
asc sort ascending if true
Returns
new bncs_stringlist
Example:
bncs_stringlist sl( "2,1,5,4,3,");
bncs_stringlist sortedSl = sl.sort(); // sl itself is unchanged (this function is const)
bncs_string s = sortedSl.toString( '-' ); // s contains "1-2-3-4-5"

◆ toString()

bncs_string bncs_stringlist::toString ( const char delim = ',' )

Convert this bncs_stringlist to a bncs_string

Parameters
delim the delimiter used to separate the items
Returns
the delimited string
Example:
bncs_stringlist sl( "1,2,3,4,5," );
bncs_string s = sl.toString( '-' ); // s contains "1-2-3-4-5"

◆ valueCount()

int bncs_stringlist::valueCount | ( | const bncs_string & | in,
 |  | bool | cs = false
 | ) |  |

Return the number of times an item appears in the list

Parameters
in | string to search for
cs | whether the search is case sensitive
Returns
count
Example:
bncs_stringlist sl( "1,2,3,4,4,4,");
int c = sl.valueCount( "4" ); // c contains 3

Friends And Related Function Documentation

◆ bncs_stringlistIterator

friend class bncs_stringlistIterator
friend
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_stringlist Member List

This is the complete list of members for bncs_stringlist, including all inherited members.

append(const bncs_string &in) | bncs_stringlist |
begin(void) | bncs_stringlist |
begin(void) const | bncs_stringlist |
bncs_stringlist() | bncs_stringlist |
bncs_stringlist(const bncs_string &in, const char delim=',') | bncs_stringlist |
bncs_stringlist(const bncs_stringlist &in) | bncs_stringlist |
bncs_stringlistIterator class | bncs_stringlist | friend
clear() | bncs_stringlist |
const_iterator typedef | bncs_stringlist |
count(void) const | bncs_stringlist |
deleteItem(int pos) | bncs_stringlist |
end(void) | bncs_stringlist |
end(void) const | bncs_stringlist |
find(const bncs_string &in, bool cs=false) | bncs_stringlist |
fromString(const bncs_string &in, const char delim=',') | bncs_stringlist |
getNamedParam(const bncs_string &in) | bncs_stringlist |
iterator typedef | bncs_stringlist |
operator const char *(void) | bncs_stringlist |
operator+(const bncs_string &) | bncs_stringlist |
operator+(const bncs_stringlist &in) | bncs_stringlist |
operator+=(const bncs_string &) | bncs_stringlist |
operator+=(const bncs_stringlist &in) | bncs_stringlist |
operator<<(const bncs_string &) | bncs_stringlist |
operator=(const bncs_stringlist &in) | bncs_stringlist |
operator=(const bncs_string &) | bncs_stringlist |
operator[](int pos) | bncs_stringlist |
operator[](int pos) const | bncs_stringlist |
prepend(const bncs_string &in) | bncs_stringlist |
replaceItem(const bncs_string &, int pos) | bncs_stringlist |
setCount(int, const bncs_string &def="") | bncs_stringlist |
sort(bool asc=true) const | bncs_stringlist |
toString(const char delim=',') | bncs_stringlist |
valueCount(const bncs_string &in, bool cs=false) | bncs_stringlist |
~bncs_stringlist() | bncs_stringlist | virtual
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_stringlistIterator Class Reference

bncs_stringlistIterator Class Reference

Const iterator for the bncs_stringlist. More...

#include <bncs_stringlist.h>

Public Member Functions

bncs_stringlistIterator (const bncs_stringlist *list=0, bool end=false)
Copy constructor. Initialize based on the given string-list. More...
bncs_string * | operator-> () const
Dereference the iterator. More...
bncs_string & | operator* () const
Dereference the iterator. More...
bool | operator== (const bncs_stringlistIterator &) const
Equality operator. Compare two iterators. More...
bool | operator!= (const bncs_stringlistIterator &) const
Inequality operator. Compare two iterators. More...
bncs_stringlistIterator operator++ ()
Pre-increment the iterator to point at the next item. More...
const bncs_stringlistIterator | operator++ (int)
Post-increment the iterator to point at the next item. More...
bncs_stringlistIterator operator-- ()
Decrement the iterator to point at the previous item. More...

Detailed Description

Const iterator for the bncs_stringlist.

Constructor & Destructor Documentation

◆ bncs_stringlistIterator()

bncs_stringlistIterator::bncs_stringlistIterator | ( | const bncs_stringlist * | list = 0,
 |  | bool | end = false
 | ) |  |

Copy constructor. Initialize based on the given string-list.

Member Function Documentation

◆ operator!=()

bool bncs_stringlistIterator::operator!= ( const bncs_stringlistIterator & in ) const

Inequality operator. Compare two iterators.

◆ operator*()

bncs_string & bncs_stringlistIterator::operator* ( ) const

Dereference the iterator.

◆ operator++() [1/2]

bncs_stringlistIterator bncs_stringlistIterator::operator++ ( void )

Pre-increment the iterator to point at the next item.

◆ operator++() [2/2]

const bncs_stringlistIterator bncs_stringlistIterator::operator++ ( int )

Post-increment the iterator to point at the next item.

◆ operator--()

bncs_stringlistIterator bncs_stringlistIterator::operator-- ( void )

Decrement the iterator to point at the previous item.

◆ operator->()

bncs_string * bncs_stringlistIterator::operator-> ( ) const

Dereference the iterator.

◆ operator==()

bool bncs_stringlistIterator::operator== ( const bncs_stringlistIterator & in ) const

Equality operator. Compare two iterators.

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_stringlistIterator Member List

This is the complete list of members for bncs_stringlistIterator, including all inherited members.

bncs_stringlistIterator(const bncs_stringlist *list=0, bool end=false) | bncs_stringlistIterator
operator!=(const bncs_stringlistIterator &) const | bncs_stringlistIterator
operator*() const | bncs_stringlistIterator
operator++() | bncs_stringlistIterator
operator++(int) | bncs_stringlistIterator
operator--() | bncs_stringlistIterator
operator->() const | bncs_stringlistIterator
operator==(const bncs_stringlistIterator &) const | bncs_stringlistIterator
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: buttonNotify Class Reference

buttonNotify Class Reference

A class that passes on information about button notifications. More...

#include <bncs_script_helper.h>

Public Member Functions

buttonNotify (CB_BUTTON *in)
bncs_string id ()
bncs_string panel ()
int | subs ()
bncs_string | sub (int in)
bncs_string command ()
bncs_string value ()
void | dump (const char *header=0)

Detailed Description

A class that passes on information about button notifications.

This class gives easy access to the id of the button that generated a notification and the panel on which it sits.
Parameter passing is using
<parameter>=<value>
method and this class also provides direct access to the <parameter> and <value>.

Example
// for button called "mybutton" on panel "main" notifying us of "button.colour.top=red"
void mypanel::buttonCallback( buttonNotify *b )
{
bncs_string s1 = b->id(); // s1 contains "mybutton"
bncs_string s2 = b->panel(); // s2 contains "main"
bncs_string s3= b->command(); // s3 contains "button"
int i = b->subs(); // i contains 2
bncs_string s4 = b->sub( 0 ); // s4 contains "colour"
bncs_string s5 = b->sub( 1 ); // s5 contains "top"
bncs_string s6 = b->value(); // s6 contains "red"
}
In reality panel and button ids are likely to be numeric so you're likely to write something like this
Note that the bncs_string takes care of the conversion to type int to keep the switch-case happy.
// for button called "mybutton" on panel "main" notifying us of "button.colour.top=red"
void mypanel::buttonCallback( buttonNotify *b )
{
switch( b->panel())
{
case 1:
switch( b->id())
{
case 2:
textPut( "text", "you pressed button 2 on panel 1", 1, 1 );
}
break;
}
}

Constructor & Destructor Documentation

◆ buttonNotify()

buttonNotify::buttonNotify ( CB_BUTTON * in )
inline

Used internally

Member Function Documentation

◆ command()

bncs_string buttonNotify::command ( )
inline

Return the notification command

Example:
// for a notification of "button.colour=red"
void mypanel::buttonCallback( buttonNotify *b )
{
bncs_string s = b->command(); // s contains "button"
}

◆ dump()

void buttonNotify::dump ( const char * header = 0 )
inline

Send the raw notification string to the debugger with optional header

Parameters
[in] header Text that will prepend the debug string for identification purposes

◆ id()

bncs_string buttonNotify::id ( )
inline

Button ID

Return the ID of the button that generated this notification

◆ panel()

bncs_string buttonNotify::panel ( )
inline

Panel ID

Return the name of the panel which hosted the button

◆ sub()

bncs_string buttonNotify::sub ( int in )
inline

Return the sub parameters at given index

Parameters
in zero based index of parameter to return
Example:
// for a notification of "button.colour.top=red"
void mypanel::buttonCallback( buttonNotify *b )
{
bncs_string s1 = b->sub( 0 ); // s1 contains "colour"
bncs_string s2 = b->sub( 1 ); // s2 contains "top"
}

◆ subs()

int buttonNotify::subs ( )
inline

Number of sub command parameters

Return the number of sub parameters this notification had

button.colour=red

has a subs() count of 1

◆ value()

bncs_string buttonNotify::value ( )
inline

Return the notification value

Example:
// for a notification of "button.colour=red"
void mypanel::buttonCallback( buttonNotify *b )
{
bncs_string s = b->value(); // s contains "red"
}
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

buttonNotify Member List

This is the complete list of members for buttonNotify, including all inherited members.

buttonNotify(CB_BUTTON *in) | buttonNotify | inline
command() | buttonNotify | inline
dump(const char *header=0) | buttonNotify | inline
id() | buttonNotify | inline
panel() | buttonNotify | inline
sub(int in) | buttonNotify | inline
subs() | buttonNotify | inline
value() | buttonNotify | inline
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: httpNotify Class Reference

httpNotify Class Reference

A class that passes on information about HTTP (file transfer) notifications. More...

#include <bncs_script_helper.h>

Public Member Functions

httpNotify (CB_HTTP *in)
bncs_string | url (void)
bncs_string | data (void)
bool | string (void)
bool | ok (void)
bncs_string | err (void)

Detailed Description

A class that passes on information about HTTP (file transfer) notifications.

This class tells you the end-state of an HTTP file transfer

Example
// for a remote file from http://myhost.com/file.png to a local file /panels/images/myfile.png
void mypanel::buttonCallback( buttonNotify *b )
{
bncs_string s1 = b->url(); // s1 contains "http://myhost.com/file.png"
bncs_string s2 = b->data(); // s2 contains "/panels/images/myfile.png"
bool b1 = b->string(); // b1 is false - this was a file download
bool b2 = b->ok(); // b2 is true - the file transferred ok
}

Constructor & Destructor Documentation

◆ httpNotify()

httpNotify::httpNotify ( CB_HTTP * in )
inline

Used internally

Member Function Documentation

◆ data()

bncs_string httpNotify::data ( void )
inline

file

Return the local file name or actual data of the item transferred

◆ err()

bncs_string httpNotify::err ( void )
inline

err

Return the error message string (null if nothing interesting happened)

◆ ok()

bool httpNotify::ok ( void )
inline

ok

Return whether this HTTP transfer was ok (true) or failed (false )

◆ string()

bool httpNotify::string ( void )
inline

string

Return the flag which says if this was a file transfer (false) or a string transfer (true)

◆ url()

bncs_string httpNotify::url ( void )
inline

url

Return the URL of the item transferred

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

httpNotify Member List

This is the complete list of members for httpNotify, including all inherited members.

data(void) | httpNotify | inline
err(void) | httpNotify | inline
httpNotify(CB_HTTP *in) | httpNotify | inline
ok(void) | httpNotify | inline
string(void) | httpNotify | inline
url(void) | httpNotify | inline
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: parentNotify Class Reference

parentNotify Class Reference

A class that passes on information about parent notifications. More...

#include <bncs_script_helper.h>

Public Member Functions

parentNotify (decodeCaptionString *in)
int | subs ()
bncs_string | sub (int in)
bncs_string command ()
bncs_string value ()
void | dump (const char *header=0)

Detailed Description

A class that passes on information about parent notifications.

Constructor & Destructor Documentation

◆ parentNotify()

parentNotify::parentNotify ( decodeCaptionString * in )
inline

Used internally

Member Function Documentation

◆ command()

bncs_string parentNotify::command ( )
inline

Return the notification command

Example:
// for a notification of "button.colour=red"
void mypanel::parentCallback( parentNotify *p )
{
bncs_string s = p->command(); // s contains "button"
}

◆ dump()

void parentNotify::dump ( const char * header = 0 )
inline

Send the raw notification string to the debugger with optional header

Parameters
[in] header Text that will prepend the debug string for identification purposes

◆ sub()

bncs_string parentNotify::sub ( int in )
inline

Return the sub parameters at given index

Parameters
in zero based index of parameter to return
Example:
// for a notification of "button.colour.top=red"
void mypanel::parentCallback( parentNotify *p )
{
bncs_string s1 = p->sub( 0 ); // s1 contains "colour"
bncs_string s2 = p->sub( 1 ); // s2 contains "top"
}

◆ subs()

int parentNotify::subs ( )
inline

Number of sub command parameters

Return the number of sub parameters this notification had

button.colour=red

has a subs() count of 1

◆ value()

bncs_string parentNotify::value ( )
inline

Return the notification value

Example:
// for a notification of "button.colour=red"
void mypanel::parentCallback( parentNotify *p )
{
bncs_string s = p->value(); // s contains "red"
}
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

parentNotify Member List

This is the complete list of members for parentNotify, including all inherited members.

command() | parentNotify | inline
dump(const char *header=0) | parentNotify | inline
parentNotify(decodeCaptionString *in) | parentNotify | inline
sub(int in) | parentNotify | inline
subs() | parentNotify | inline
value() | parentNotify | inline
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: revertiveNotify Class Reference

revertiveNotify Class Reference

A class that passes on information about BNCS events. More...

#include <bncs_script_helper.h>

Public Member Functions

revertiveNotify (CB_REVERTIVE *in)
int | device (void)
int | database (void)
int | index (void)
int | info (void)
bncs_string | sInfo (void)
int | type (void)
void | dump (const char *header=0)

Detailed Description

A class that passes on information about BNCS events.

Example - Infodriver
// for an infodriver revertive from slot 456 of device 123 containing text "Hello mum"
void mypanel::revertiveCallback( revertiveNotify *r )
{
int device = r->device(); // device is 123
int index = r->index(); // index is 456
bncs_string info = r->sInfo(); // info is "hello mum"
int type = r->type(); // type is 2 (see CB_REVERTIVE documentation)
}
Example - Router
// for a router revertive from destination 456 of device 123 for source 1 of name "0001"
void mypanel::revertiveCallback( revertiveNotify *r )
{
int device = r->device(); // device is 123
int index = r->index(); // index is 456
int iInfo = r->info(); // info is 1
bncs_string sInfo = r->sInfo(); // name is "0001"
int type = r->type(); // type is 1 (see CB_REVERTIVE documentation)
}
Example - Database
// for a database 1 name change for index 456 of device 123
void mypanel::databaseCallback( revertiveNotify *r )
{
int device = r->device(); // device is 123
int index = r->index(); // index is 456
int database = r->database(); // database is 1
int type = r->type(); // type is 4 (see CB_REVERTIVE documentation)
}

Constructor & Destructor Documentation

◆ revertiveNotify()

revertiveNotify::revertiveNotify ( CB_REVERTIVE * in )
inline

Used internally

Member Function Documentation

◆ database()

int revertiveNotify::database ( void )
inline

Database number

Return the number of the database - this is only relevant for database change notification messages. Its value is undefined for other notification messages

◆ device()

int revertiveNotify::device ( void )
inline

Device number

Return the device ID of the device that generated this notification

◆ dump()

void revertiveNotify::dump ( const char * header = 0 )
inline

Send the raw notification string to the debugger with optional header

Parameters
[in] header Text that will prepend the debug string for identification purposes

◆ index()

int revertiveNotify::index ( void )
inline

Index

Return the index for which this notification relates. For an infodriver it is the slot number, for a router it is the destination number.

◆ info()

int revertiveNotify::info ( void )
inline

Integer information

Return the integer information. For a router this is the source number whereas sInfo() returns the source name. For GPIs this is the state. For Infodrivers this value is zero.

◆ sInfo()

bncs_string revertiveNotify::sInfo ( void )
inline

String information

Return the string information. For a router this is the source name whereas info() returns the source number. For an infodriver this value is the slot contents. For GPIs this value is null.

◆ type()

int revertiveNotify::type ( void )
inline

The type of revertive that this is.

This is defined in CB_REVETIVE as:

enum revertiveType
{
ROUTER=1, // 1
INFODRIVER, // 2
GPI, // 3
DATABASE, // 4
};
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

revertiveNotify Member List

This is the complete list of members for revertiveNotify, including all inherited members.

database(void) | revertiveNotify | inline
device(void) | revertiveNotify | inline
dump(const char *header=0) | revertiveNotify | inline
index(void) | revertiveNotify | inline
info(void) | revertiveNotify | inline
revertiveNotify(CB_REVERTIVE *in) | revertiveNotify | inline
sInfo(void) | revertiveNotify | inline
type(void) | revertiveNotify | inline
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: C:/bncs/build_auto/Core_System/Source/include Directory Reference

  • include
include Directory Reference

Files

file | bncs_config.h [code]
file | bncs_dateTime.h [code]
file | bncs_script_helper.h [code]
file | bncs_string.h [code]
file | bncs_stringlist.h [code]
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: BNCS V4.5 UI (Panel) Writing Classes

BNCS V4.5 UI (Panel) Writing Classes

These the classes used to write V4.5 UI Scripts.

All scripts take their base functionality from bncs_script_helper for all the BNCS functions for controlling panels and for getting/setting values on the BNCS network.

Panel Base Class

  • bncs_script_helper

Helper classes

  • bncs_string
  • bncs_stringlist
  • bncs_config
  • bncs_dateTime
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_date Struct Reference

bncs_date Struct Reference

#include <bncs_dateTime.h>

Public Attributes

int | day
int | month
int | year
int | dayOfWeek

Member Data Documentation

◆ day

int bncs_date::day

◆ dayOfWeek

int bncs_date::dayOfWeek

◆ month

int bncs_date::month

◆ year

int bncs_date::year
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_date Member List

This is the complete list of members for bncs_date, including all inherited members.

day | bncs_date
dayOfWeek | bncs_date
month | bncs_date
year | bncs_date
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: bncs_time Struct Reference

bncs_time Struct Reference

#include <bncs_dateTime.h>

Public Attributes

int | hour
int | minute
int | second
int | millisecond

Member Data Documentation

◆ hour

int bncs_time::hour

◆ millisecond

int bncs_time::millisecond

◆ minute

int bncs_time::minute

◆ second

int bncs_time::second
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


V4.5 Panel Classes: Member List

bncs_time Member List

This is the complete list of members for bncs_time, including all inherited members.

hour | bncs_time
millisecond | bncs_time
minute | bncs_time
second | bncs_time
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


grdLibrary

External GRD Interface Class

Overview

This class provides all the required connectivity between your driver application and a BNCS GRD.
The class definition is as follows:

#pragma once
#include <windows.h>
#include <bncsdef.h>

#ifndef GTHUNKS_EXPORTS
#undef GTHUNKS_API
#define GTHUNKS_API
#endif

class GTHUNKS_API cGRD
{
    HWND hWndSpawn;
    PULONG txcount;
    PULONG rxcount;
    ULONG deftx,defrx;
    static LRESULT WINAPI CallbackProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
    LRESULT (*Cxptevent)(cGRD *cG, UINT iDevice, UINT iSrc, UINT iDest, LPCSTR szMask);
    HWND hWndGRD;
protected:
    virtual LRESULT xptevent(cGRD *cG, UINT iDevice, UINT iSrc, UINT iDest, LPCSTR szMask);
public:
    UINT iGRD;
    int iStatus;

    cGRD(void);
    ~cGRD(void);
    int connect(UINT iExtGRD);
    void setcounters(PULONG lpTX,PULONG lpRX);
    int getsrc(int iDest);
    bool setdest(int iSrc, int iDest);
    void incrx();
    void notify( LRESULT(*in)(cGRD *,UINT iDevice, UINT iSrc, UINT iDest, LPCSTR szMask));
};

Required files

The class is contained in the library cGRD.lib and a debug version in cGRDdb.lib

The header files <cGRD.h> and <bncsdef.h> should be referenced by your application.

The following constants are defined in the <bncsdef.h> header file, and are valid values for the iStatus member variable:

#define DISCONNECTED            3
#define INVALID_DRIVERNUM       4
#define CANT_FIND_GRD           5
#define CANT_REGISTER_CLASSWND  9
#define XPT_CHANGE          15
#define XPT_LOCK                16

Usage

There are two methods of getting destination change information:
• C callback
• virtual function

C Callback

Create an instance to a cGRD class (don’t’ forget to delete it when you exit….)

    cGRD *g;        // somewhere in your header files….

    g =  new cGRD;
    g->notify( notify );    // set the notify function
    g->connect( 100 );      // connect to the GRD

    int d = g->getsrc( 1 ); // get source on dest 1
    g->setdest( 1, 1 );     // set dest 1 to source 1

LRESULT notify (cGRD *cG, UINT iDevice, UINT iSrc, UINT iDest, LPCSTR szMask)
{
    switch( cG->iStatus )
    {
        case XPT_CHANGE:
                qDebug( " crosspoint made device %d, %d to %d, mask %s",
                iDevice,
                iSrc,
                iDest,
                szMask );
                break;
    }
    return 0;
}

Virtual function

Derive your class from cGRD and then reimpliment the virtual function

    virtual LRESULT xptevent(cGRD *cG, UINT iDevice, UINT iSrc, UINT iDest, LPCSTR szMask);

e.g.

#include “cGRD.h”

class myclass : public cGRD
{
public:
    myclass();
virtual LRESULT xptevent(cGRD *cG, UINT iDevice, UINT iSrc,UINT iDest, LPCSTR szMask);
}

See the notify function above for an example of how to implement the xptevent function.

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Docs conversion to markdown


extinfo

BNCS Infodriver Interface Class Library: extinfo / cXinfo

Overview

This class provides all the required connectivity between your driver application and a BNCS infodriver. It encapsulates all data transfer to and from slots, and provides the required callback mechanism for asynchronous slot change notifications.

The difference between extinfo and cXinfo is how the callbacks work. extinfo uses a C function, cXinfo uses an overridden C++ member

The extinfo class definition is as follows:

class extinfo
{
    HWND hWndSpawn;
    PULONG txcount;
    PULONG rxcount;
    int requestmode;
    ULONG deftx,defrx;
    HINSTANCE hInstEx;
public:
    void (*func)(extinfo*,UINT,LPCSTR);
    UINT iDevice;
    HWND hWndInfo;
    LPSTR netmsg;
    extinfo();
    ~extinfo();
    int iStatus;
    int connect(UINT iEDev,HINSTANCE hInst=NULL,UINT iMyDev=0,UINT iOffs=0,UINT iMin=0,UINT iMax=0);
    void notify(void(*)(extinfo*,UINT,LPCSTR));
    void setcounters(PULONG lpTX,PULONG lpRX);
    void setslot(int, LPCSTR, ...);
    void updateslot(int, LPCSTR, ...);
    void getslot(int, LPSTR );
    void sendslots(int,int);
    void incrx();
    int getrequestmode(){return requestmode;}
    int setmode(int iMode);
    int getmode();
    UINT iMinRange;
    UINT iMaxRange;
    UINT iOffset;
    BOOL fCalledEx;
    UINT iThisDev;
    HWND hWndCSI_Cl;
    void getdbname(WORD wDevice, WORD wDatabase, WORD wIndex, LPSTR szName, int iMaxSize);
    int getdbindex(WORD wDevice, WORD wDatabase, LPCSTR szName);
    void setdbname(WORD device, WORD database, WORD index, LPCSTR name, BOOL fPoll);
};

Required files

The class is contained in the library extinfo.lib and a debug version in extinfodb.lib

The header files <extinfo.h> and <bncsdef.h> should be referenced by your application.

The following constants are defined in the <bncsdef.h> header file, and are valid values for the iStatus member variable:

#define ERROR_GENERAL           0xFFFF
#define ERROR_WRONG_TYPE        0xFFFE
#define ERROR_BAD_PARAMLIST     0xFFFD

#define COMMAND             0
#define STATUS              1
#define RXONLY              2
#define DISCONNECTED            3
#define INVALID_DRIVERNUM       4
#define CANT_FIND_INFODRIVER    5
#define TO_TXRX             6
#define TO_RXONLY           7
#define QUERY_TXRX          8
#define CANT_REGISTER_CLASSWND  9
#define DRIVERNUM_ALREADY       10
#define CSI_NOT_ENABLED     11
#define DATABASECHANGE      12
#define BAD_WS              13
#define CONNECTED           15

Usage

Declare an instance of the class extinfo:
extinfo ex;

Specify the driver number when connecting to the infodriver

ex.connect(iInfoExt);

or

ex.connect(iInfoExt,NULL,iMyHostNum,iOffset,iMin,iMax);

Using the first example syntax connects a standard infodriver external. The second example syntax above can be used to make the infodriver external “infohost compliant”: connecting to an infohost driver (iInfoExt=1000+) and specifying a unique iMyHostNum value to identify your connection. You also specify the zero-based slot offset iOffset and slot range iMin to iMax. In this way, many externals can share one infodriver by fanning in through the infohost driver. Please refer to the InfoHost instructions for further information.

The status/success of the connection to the infodriver can be ascertained by reading the status member of the function:
example:

if (ex.iStatus==CANT_FIND_INFODRIVER)
Debug(“Infodriver not found”);

Assign the callback function which the class will send slotchange messages to:

ex.notify(InfoNotify);

where the function is of the form:

void SlotChange(extinfo* pex,UINT iSlot,LPCSTR szSlot);

sample function:

void InfoNotify(extinfo* pex,UINT iSlot,LPCSTR szSlot)
{
    switch (pex->;iStatus) {
    case CONNECTED: // this is the "normal" situation
        if (!SlotChange(pex->;iDevice,iSlot,szSlot))
            pex->;setslot(iSlot,szSlot);
        break;

    case DISCONNECTED:
        Debug("Infodriver %d has disconnected", pex->iDevice);
        return;

    case TO_RXONLY:
        Debug("Infodriver %d received request to go RX Only",pex->iDevice);
        break;

    case TO_TXRX:
        Debug("Infodriver %d received request to go TXRX",pex->iDevice);
        break;

    default:
        Debug("iStatus=%d",pex->iStatus);

    }
}

Always check the status member first in case the class is informing you of a termination, or other special event. A valid slot change notification will always have CONNECTED status!

The connection is closed automatically when the program terminates and the class goes out of scope.

Set the contents of a slot as follows:

ex.setslot(iSlotnum,szContents);

or

    ex.setslot(iSlotnum,”Value=%d”,iVal); // e.g. like printf

It is possible to set a slot without issuing a network revertive by setting the iSlotnum parameter to be the negative equivalent of the desired slot number, e.g. gpex->setslot(-iSlotnum,szContents);

Update the contents of a slot as follows:

    ex.updateslot(iSlotNum,szContents);

or

ex.updateslot(iSlotNum,szFmt, …);

Use update to change the slot contents only if they are different to the existing contents. Negative slot numbers work as for setslot().

Retrieve the contents of a slot as follows:

ex.getslot(iSlotnum,szContents);

Issue a network revertive for a range of slots as follows:

ex.sendslots(iMinSlot, iMaxSlot);

Set up automatic counters for incoming and outgoing messages as follows:

ex.setcounters(&txcounter,&rxcounter);

txcounter and rxcounter should be unsigned long integers. The class will automatically increment the value of these variables. The programmer must reset them to zero and display them on the screen as appropriate.

Additional Specialist functions

Only retained for backwards compatibility – do not use as described here.

The following functions are implemented to control the dynamics of the host infodriver’s operation mode:

The mode constants are found in the <bncs.h> header file and are defined as follows:

#define IFMODE_NONE     0
#define IFMODE_RXONLY       1
#define IFMODE_TXRX     2

Set the mode of the infodriver as follows:

ex.setmode(iMode);

The return value is the new mode

Read the current mode of the infodriver as follows:

iMode=ex.getmode();

Control the dynamics of the automatic mode change facility as follows:

gpex->requestmode= OR-combination of request flags

TO_TXRX     // this permits transitions to TX/RX mode
TO_RXONLY       // this permits transitions to RX only mode

example:

        ex.requestmode=TO_TXRX | TO_RXONLY;

The default infodriver behaviour is the default value assigned to requestmode, i.e. TO_TXRX.
This means that the infodriver can auto-transition from a RX Only state to a TX/RX state, but not back again.
It is possible to change the auto-transition behaviour by changing the requestmode parameter. This can be done at any time.

Dynamic mode changes are notified to the callback function, with the iStatus member variable preset to either TO_TXRX or TO_RXONLY. However the behaviour is predetermined by the requestmode parameter.

Setmode(int) – updated November 2005 –not for CXinfo

Calling setmode(int iMode) will send messages to the infodriver (v2.1.1.4 or later) immediately, if appropriate, as well as setting the requestmode, you can set the requestmode directly if you don't want the action immediately.

Setting the modes does the following:-

  • IFMODE_NONE
    • Not recommended!
    • No immediate action
    • Response to BBC_REQDEVGORXONLY is true
    • Response to BBC_INQDEVGOTXRX is false
  • IFMODE_RXONLY
    • To be used when the driver wants to go RxOnly, regardless of if there is another driver available - not normal otherwise can not report comms fail except when it is a slave driver*.
    • Immediate action to go RXOnly
    • Response to BBC_REQDEVGORXONLY is true
    • Response to BBC_INQDEVGOTXRX is false
    • Note that setting both main and reserve to this will have no driver in TxRx
  • IFMODE_RXONLYBROKEN
    • To be used when the driver will go RxOnly if another driver wants to go TxRx
    • No immediate action - Does not send an NB as the infodriver doesn't do this
    • Response to BBC_REQDEVGORXONLY is true
    • Response to BBC_INQDEVGOTXRX is false
    • Note that setting both main and reserve to this will have one driver in TxRx assuming you started with both in TxRx
  • IFMODE_TXRX
    • To be used when the driver wants to go TxRx if another driver will allow it.
    • Immediate action is an NA on the network
    • Response to BBC_REQDEVGORXONLY is false
    • Response to BBC_INQDEVGOTXRX is true
  • IFMODE_TXRXINQ
    • To be used when the driver can go TxRx if another driver will allow it - not normal operation
    • No immediate action
    • Response to BBC_REQDEVGORXONLY is false
    • Response to BBC_INQDEVGOTXRX is true
  • IFMODE_FORCETXRX
    • To be used when the driver must go TXRX, used if a slave driver
    • Send an NO on the network
    • Response to BBC_REQDEVGORXONLY is false
    • Response to BBC_INQDEVGOTXRX is true

Slave driver is where a single device is represented by several infodrivers, on of which is master, the rest are slave, when the master goes TxRx the slaves should do the same, when the master goes Rx Only the slaves should do the same.

All changes of state are passed on to the external.

Setmode(int) – updated December 2005 –CXinfo only

The setmode function in CXinfo passes the value you set straight to the infodriver in the same way as the extinfo class does, but when the infodriver request information about the ability to go TxRx etc. this is passed straight to the notify function of the inherited class to be dealt with by the driver, this has been done to ensure backwards compatability.

Close Modes

From extinfo version 4.1.4
The host Infodriver can be closed immediately by calling closeInfodriver().
Setting the close mode using closeInfodriverOnShutdown( true ) will ensure that the Infodriver is closed when this class is destroyed. This means that you won’t be left with an Infodriver running but no device driver (it’s one of the perils of using Infodrivers as a host application for other things….)

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


netclient

Network Comms Library

Overview

This C++ class encapsulates the Windows Sockets code necessary to provide a network socket connection to a remote server. This class can be incorporated into a BNCS driver and provides an asynchronous comms channel, with receive data notification and other network state messages being prvided to a user-defined callback routine.

The class definition for the communications parameters is as follows:

class netclient {
LPHOSTENT host_info;
LPSERVWNT serv_info;
HWND hWnd;
    SOCKET sock;
    SOCKADDR_IN server;
    long notifyflags;
    LPTSTR szServerName;
public;
    netclient(HINSTANCE);
    ~netclient();
    int open(LPCSTR szServer,int iPort=23);
    close(woid);
    long txdata(PBYTE bData,long lLen);
long txdata(LPCSTR szData);
    long rxdata(PBYTE bData,long lLen);
    BOOL notify(void(*)(netclient*), long lNot);
    void (*func)(netclient*);
    long thisnotify;
    long thiserror;
    SOCKET getsocket() {return sock;}
    SOCKADDR_IN getserver() {return server;}
    LPCTSTR getservername() {return szServerName;}
    int getport();
};

Files:

Required files are <net.lib> <netdb.lib> and <netclient.h>

Usage

Declare a pointer to the class netclient:

netclient *port;

Dynamically allocate an instance of the class, specifying the instance handle of your application:

port=new netclient(hInstance);

Open the connection to the remote server, specifying the server name or IP address and optionally the port number [default 23]:

port->open(servername[,portnum]);

Then immediately specify the callback function for event notification, and the notification mask:

port->notify(NetEvent,FD_READ);

Notes:
FD_CONNECT and FD_CLOSE are automatically included because you always need to know if connections are successful, or if the port has closed.

The function prototpe is void NetEvent(netclient *t); it is passed a pointer to the netclient class instance making the callback.

To read data, e.g. at the callback function:

void NetEvent(netclient* t) // function called with pointer to calling netclieot class
{
    switch (t->thisnotify)
    {
    case FD_CLOSE:
    Debug ("Connection to %s has closed - code %ld",t->getservername(),t->thiserror);
    break;

    // note the functioo getservername() will return whatever resolvable name or IP address was provided at connect time. This identifies the calling netclient class
    // Additionally, the getport() function will return the port number requested during connection

    case FD_CONNECT:
    switch (t->thiserror)
        {
        case 0: //OK
        Debug("Connect OK to server %s port %d",t->getserwername(),t->getport());
        break;

        default: //error
        Debug("Failed to connect to %s",t->getserwername());
        }
        break;

    case FD_READ: // data arrived!
        switch (t->thiserror)
        {
        case 0: // no error
            {
            lRead=t->rxdata((PBYTE)szBuf,32);
            if (!t->uhiserror) // rx data didn’t produce an error
            ParseData(szBuf,lRead);
        else
    Debug("Read Error");
            }
            break;

        default:
    Debug("Read Error");

        }
    }
}

The t->thiserror and t->thisnotify walues are used to find out the status of the notificatin. Note that if an rxdata() fails, it returns 0 bytes and the t->thiserror will be updated to indicate that no data was available from the network, so this should be checked before parsing any data.

To write data:

port->txdata(abOutput,8);   // output 8 bytes from abOutput array

or

port->txdata(szText);   // output zero terminated string from szText

When the program terminates delete the object:

delete port;

This has the effect of closing the network connection, so the port >close() command is only necessary if the connection needs to be explicitmy closed during prowram operation.

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Docs conversion to markdown


V4.5 SNMP Class: Main Page

V4.5 SNMP Class Documentation
Build: Alarms_misc_1610 4466 fdf15265 Atos © 2017


alarm-mainapplication

Alarms and Monitoring

Overview

This document describes the BNCS Alarm System. It is a configurable, scalable and modular application for monitoring diverse types of equipment.
Data is gathered from devices, pre-conditioned, manipulated by a selection of logic processes, and presented to the output modules. This enables current and historical status information to be viewed and logged.

Description

The BNCS Alarm System Main Application, AlarmControl, runs as an executable program on the BNCS network, along with a number of DLLs.

The Alarms System software consists of the host application, AlarmControl.exe, and input (acquisition) and output (presentation) modules, which are dynamic link libraries loaded by the host application.

One or more alarm systems may be run in one BNCS System. More than one alarm system may run on the same machine (subject to available CPU power). There may be one or more input and one or more output modules configured in any individual Alarm system.

The software requires configuration to perform any useful function. The key to using this software is setting up a configuration that fits your system and testing it with your system.

It is configured using configuration components in the BNCS V4.5 configuration client set. It is strongly advised to design the system you require before starting attempting to configure anything.

The installation and configuration of the BNCS Alarms System requires an installation of the V4.5 BNCS System.

A typical system will have one or more input modules and one or more output modules configured.

At present two input modules are available:

  1. The BNCS Acquisition Module, which runs as a BNCS client, gathering information from devices on the BNCS network.
  2. The Driver Status acquisition module, which gets information from CSI regarding running drivers and their Tx/Rx status.

There are two output modules available:

  1. The BNCS Output, which presents the outputs to the BNCS network. This supports both the reporting of alarm states to the BNCS network and also responds to data writes to override the states of the alarm processes.
  2. The Database Interface Output which writes the to an SQL database. This writes the current state of processes to one table and appends to another table to form a historical log. It can also supply change information to a BNCS network and allow BNCS Clients to add information to the historical log.

overview
The diagram above shows an overview of the system components, these are briefly explained below.

Acquisition / Inputs and Preconditioning

The BNCS Acquisition module gathers data from devices that have BNCS drivers e.g. GPI Crates, Satellite receivers, Glue components. It is also possible to gather information from devices that are only being monitored and not being controlled.

It is also possible to pass in alarm information from another alarm system.

The Driver Status acquisition module gathers data from CSI regarding whether drivers are running and their Tx/Rx status. Alarms may indicate whether a driver is running, or whether its resilience is as expected.

The incoming data is normalised to three standard states: OK, Alarm, or Unknown. Other processing e.g. timed hold-off can be applied at this point.

Processing

All configured process values are calculated at runtime and made available to the output module(s) for reporting. Inputs, fixed time functions, holdoff plus logical operators (OR, AND, NOT, TRUTH) may be configured at configuration time. Changes to the configuration cannot be made at runtime.
Note: there is no inherent severity/priority for processes, they are all equal.

Native States

The ‘native’ states supplied by the Alarm System are: OK, Alarm, Latched and Unknown. The Unknown state is returned if the acquisition module has never had a revertive from the particular input.
Use of the latched state is optional and is configured for each process.

Value | Name | Description
0 | Normal/OK | The process is not in a fault/alarm state.
1 | On/Alarm | The process is in a fault/alarm state.
6 | Latched | The process’s input has gone to a fault/alarm state, and then back to Normal. No acknowledgement has been received.
-1 | Unknown | The system has had no input regarding the process’s current state.

Override States

A panel element (button) may be configured to override the native states. The possibilities are the following:

Value | Name | Description
2 | Forced Off | Forces the process to appear OK.
3 | Forced On | Forces the process to appear Alarm
4 | Acknowledge | The operator has acknowledged the process
5 | Ignored | One shot Force Off. Resets the next time the process goes to OK

Note: A process cannot be required to be OK. This will only happen when the input has returned to an OK state.

Override Commands

The following values will manipulate the state of the process (and sometimes others) but don’t get stored with the process.

Value | Name | Description
7 | Acknowledge Only | Ack if failed. Don't clear inhibits or Force on/off.
8 | Clear | Clear inhibit. Clear Force on/off. Don't ack.
9 | Acknowledge ACK_CONTRIBUTORS_IMMEDIATE | Acknowledges all the process’s immediate contributors. i.e. all those listed in the process’s own configuration
10 | Acknowledge BNCS_AL_ACK_CONTRIBUTORS_ALL | Acknowledges all the process’s contributors, and all of theirs, recursively to the first level of input processes (ie those with no contributores).

Timed Overrides

The system is also able to apply an override for a specified period of time, after which it will automatically revert to Normal/Off.

Only the Bncs output module is able to access this functionality.

Alarm States

The diagram below shows the state cycle of a process. It shows the possible states that a process can be in as it goes from OK to Alarm to OK again.
If the process is not configured to latch then acknowledgement is optional.
If it is configured to latch then it may be configured to only require one acknowledgement per alarm-OK transition.
This configuration is done at configuration time.

Output/Presentation

At present there are two output modules available, for BNCS Output and Database output.

BNCS Output

This module will present the states of configured processes as devices on the BNCS network (Infodriver presentation).

Panels interact with these devices to show the status of the processes and to perform any overrides.

Database Output

This module will present process information to a SQL database on the network to store the current states of configured processes and as a historical log.

It logs the date/time, process name, device name, state, group, severity (5 =major alarm to 1= information).

It also broadcasts changes to the BNCS network to enable appropriate clients to display a view of the information.

When an alarm is forced off, this will be logged, but any changes to the actual source will not be logged until the override is cleared.

BNCS Client

This is a normal BNCS client and is not part of the alarms system itself. It could be an alarm panel, or a mixture of a control, navigation and alarms functionality.
If alarms are presented to the client it is possible for the operator to override the state. For example, the operator could acknowledge an alarm in the Alarm state or Force On an intermittent alarm while the fault is being dealt with by an engineer.

A BNCS V2 client can display the current states and action overrides via the BNCS Output module.

In order to display the log control the BNCS V4.5 client is required (or any 2 bit client with SQL support).

Configuration procedure

Each module must be configured for the system to do anything useful.

This is done using the BNCS Configuration editor and server.

The configuration editor allows new alarms and systems to be added, and configuration of the inputs, processes and the outputs.

See configuration documentation for details.

Starting up

The application AlarmControl.exe is run with the argument “/AlarmSystem=name”, where “name” is the alarm system name. AlarmControl.exe will load the process configuration and the appropriate input and output modules on start-up.
See also the command-line options section below.

For the BNCS Acquisition Module to work CSI.exe must be running in client mode. For the BNCS Output module to work CSI.exe must be running in driver mode and the appropriate infodriver (i.e. the one set in the output configuration) must be running prior to AlarmControl.exe.

AlarmControl is typically run from the BNCS Workstation Manager. To do this the required elements must be included in the Launch configuration.

Resilience

AlarmControl is able to be run on two separate workstations as a resilient pair for any particular alarm system. The instances send messages over the network via UDP. The messages enable the two instances to agree which is able to transmit (ie it is considered Tx/Rx) and which is not (ie it is considered RxOnly).

If resilience is not needed, or for development purposes, the generation and use of these messages may be disabled by running with the command-line argument “/UDP=no”.

Diagnostics

The system shown below has one of each type of plug-in:

  • BNCS Acquisition
  • BNCS Driver Status Acquisition
  • BNCS Output
  • Database Output

The path is “C:\BNCS\MyMCR” and the alarm system name is “Main Alarms”.

The display is updated approximately once per second.

The system name is displayed at the top of the dialog along with the Tx/Rx status.

The “Calculation” box contains:

  • The number of processes in this configuration.
  • The progress through the initial polling process, expressed as the percentage of inputs successfully polled.
  • The “Calc Loop Count” which is the number of times the program has run through the calculations in order to calculate all the processes. If this value is 200 there is a serious fault with the configuration that needs to be fixed (it is unable to calculate one or more processes possibly because of a logical tautology or a non-existent input).
  • The “Process Cycles” which is the number of process cycles completed since the program was started.

The list below this displays all the input and output modules and various properties:

  • Type – Acquisition or Output
  • Module type – The name of the module DLL.
  • Instance – The number of the input or output config file.
  • Name – The name configured.
  • configuration file name – The name of the input or output config file.
  • Tx and Rx counts – Counts of BNCS messages sent or received.
  • Status – Whether the module is running properly.
  • Last Event – A brief note indicating the modules current phase of activity.
  • Progress – The progress through the initial polling process, expressed as the percentage of inputs successfully polled.

Any error messages for a module will appear in the bottom display when you select the module in the list.
For the BNCS Acquisition module, the message “All valid inputs received” will be displayed once a revertive has been received from each configured input.

Diagnostics Menu

In the main menu there is a “Diagnostics” entry. This provides options to control various settings and details of the application’s behaviour, and can display a dialog showing all the processes with their current values.

Diagnostics Dialog

Select Diagnostics|Show to activate the diagnostic view of all the processes. This shows the state of all the processes and allows us to override their states. This may be used for testing and to track down errors in configuration.
The screen is shown below.

For each process the name, rule and state (both number and name) are shown, and any mask. Depending on their state the processes have different colours which are the same colour as the default colours for alarm controls on device panels.

Filters – Name and Inputs

There are options to filter the process display by process names, or to display a process’s inputs processes.

Entering text in the “Filter” box will do a simple wildcard match on the process names. Only processes matching the text will be displayed. This is case-sensitive.

Entering the name of a process into the Process input filter will cause only processes contributing to that process to be displayed. This requires an exact match to the process name. The input filter can be filled automatically by double clicking on an item from the process list.

The process name filter will be disabled if there is anything typed into the input filter edit box. It may be activated by clearing the input filter.

The input filter is to assist in detecting the cause of the current process state. E.g. it can be checked quickly from the input list of an “OR” process where an “ON” state is coming from.

The input filter may also be used for detecting configuration errors in the process input list. Any invalid processes (ie non-existant process names) will be shown in the list at the bottom right of the dialog.

Extension for Testing – “Greening”

The “greening” system can be used for setting an entire alarm system to normal state by correcting all the failed devices, ie by writing OK values to the various drivers.

It is only useful for testing purposes. It is very important that it is not used on a live system as it will write values to the drivers which are likely to be different from their “correct” values.

“Redding”

It is also possible to automatically write values to the drivers to put all the processes into an Alarm state. This is known as “Redding”. It operates in a similar way to the Greening system.

The two similar systems – Greening and Redding – are together sometimes termed “Colouring”.

Operation

The Greening system may be configured to start automatically at start-up, or may be activated manually. If it is set to start automatically the process will be started and will run either for the specified time, or will be stopped automatically when all the inputs are reporting OK.
In action when any input process reports a fail state the system selects a value which will cause the process to respond as OK and sends it to the relevant driver. For Discrete processes a value corresponding to OK will be chosen from the list of states available for the control. For Analogue inputs a value is calculated based on the configured settings.
Redding works similarly but values are chosen in the opposite sense – to generate fault values.
If colouring is enabled but not started automatically it may be started using one of the buttons. In that case the scanning process will be restarted repeatedly at the period configured (by AutomaticGreeningTimeout or AutomaticReddingTimeout). Scanning will be repeated until turned off by the button.

Configuration – Greening.ini

The system is controlled by entries in the greening.ini file, which is in the root directory of the alarm system (ie \config\alarms\\greening.ini).

If the file doesn't exist it will be generated automatically during startup.

If any of the properties are not present the defaults will be written.

The following parameters may be set in greening.ini.

[Colouring]

This section contains parameters affecting both parts of the “colouring” system.

Parameter | Default | Details
EnableSetInitialState | false | If colouring is activated by setting this parameter to true, two buttons will appear on the alarm system GUI for manually starting or stopping colouring. If colouring is activated automatically at start-up (see below) the corresponding button will be coloured.
[Greening]

This section contains parameters affecting only “greening” – ie the automatic writing of values selected to cause the alarm processes all to report as “OK”.

Parameter | Default | Details
SetInitialStateOK | false | Selects whether greening is automatically activated at start-up. setting the control and alarm instances automatically to state 'OK' after startup
SetInitialStateOKTimeout | 300 (seconds) | Greening will be stopped after the number of seconds configured here. If it couldn’t be finished the remaining devices keep their states. Updated devices and devices which couldn’t be updated because of the timeout will appear in the log of the input file. This setting relates to "greening" when started automatically on program startup.
AutomaticGreeningTimeout | 30 (seconds) | If greening is running, activated using the button, the colouring process will be restarted every AutomaticGreeningTimeout seconds. This setting relates to "greening" only when started by the Start Greening button.
[Redding]

This section contains parameters affecting only “redding” – ie the automatic writing of values selected to cause the alarm processes all to report as “Alarm”.

Parameter | Default | Details
SetInitialStateFail | false | Selects whether redding is automatically activated at start-up.
SetInitialStateFailTimeout | 300 (seconds) | Redding will be stopped after the number of seconds configured here. If it couldn’t be finished the remaining devices keep their states. Updated devices and devices which couldn’t be updated because of the timeout will appear in the log of the input file. This setting relates to "redding" when started automatically on program startup.
AutomaticReddingTimeout | 30 (seconds) | If redding is running, activated using the button, the colouring process will be restarted every AutomaticReddingTimeout seconds. This setting relates to "redding" only when started by the Start Redding button.

Greening can only be started manually if the alarm control application is in the Tx/Rx state.
If greening is active, use of the "LATCHED" state is disabled from alarm panels or any other client requiring to manipulate process states.
If the system has finished polling all the inputs the greening buttons may be visible but are disabled and may not be clicked.

Dependencies

AlarmControl.exe requires the QT dll (currently qt-mt323.dll), bncsif.dll and the Visual C runtime dll MSVCP60.dll.

It also requires Calarm_process.dll which does all the process calculations.

Command-Line Options

There are a number of command-line options for this program.

/AlarmSystem

This must always be provided.

Syntax is : /AlarmSystem=’name’, where ‘name’ is the name of the alarm system. Ie the folder name within the config folder where the alarm configuration is found.

/Period

(Optional)
Syntax is : /Period=20

This is the time interval for running the alarm process calculations. Unit is milliseconds. Default value is 20(ms).
The alarm system will wait for a short period after startup and then will attempt to perform all the process calculations repeatedly at this interval. This can be a drain on CPU resources and may be reduced by using this parameter.

/Log

(Optional)
This controls logging from certain parts of the program.

Syntax is : /Log=’number’. The number should be in the range 0 to 63 and are interpreted as a six bit number. The six bits control six diagnostic flags as follows.
1: AlarmControl itself.
2: The acquisition and output Plug-ins
4: UDP. Ie the mechanism used to ascertain bus mastership.
8: Mastership. Transitions of bus mastership.
16: Per-Session Logging. Each run of the program will create a folder, named according to the start time, in which any log files are written.
32: Verbose Logging.
In all cases these values are passed into the acquisition/output modules, which are able to interpret them as they wish. The meanings above are the general uses but individual modules may differ.

/ASFU

(Optional)
This stands for “Acquisition Startup Failure Unrecoverable”.

The program usually assumes that any problem in any plug-in can be recovered from and that the plug-in will do so as soon as it can. In some circumstances, with some plug-ins, this is not possible. In particular it is sometimes found that a problem reported by the Acquisition plug-in is an indication of a fundamental problem from which the plug-in (and the main program) is not able to recover. In this case it is necessary that the whole program should be shut down.
To activate this behaviour use this option.

/NetDelay

(Optional)
Syntax is : /NetDelay=’number’.

Some output plug-ins have the facility to start-up with a reduction to the amount of network traffic (ie BNCS traffic) they produce. A certain time after start-up these will be requested to return to the normal amount of traffic. The purpose is to reduce the amount of unnecessary information being sent to the network during the start-up of the alarm system, which always produces a large amount of traffic during its start-up.
This time delay, in milliseconds, is calculated by multiplying the parameter by the number of processes in the system. The default is 60ms per process.
At the moment this parameter is only used by the database output module.

The following qualifiers are not being documented as they are for development/diagnostic use only : udp, localconfig, cc_root, cc_system, eventdriven.

Logging

When Logging is enabled (via AlarmControl’s GUI or arguments), selected messages are logged into a file at a path determined by the BNCS settings.
Log files are written in

%CC_ROOT%\%CC_SYSTEM%\logs\alarms\<name>

where <name> is the alarm system name.

If per-session logging is enabled, the log files are written to

%CC_ROOT%\%CC_SYSTEM%\logs\alarms\<name>\<date-time>

where <date-time> is the date and time at which the application started.

Documents referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Various Acquisition and Output module documents.
Various documents on Acquisition and Output module configuration.
The documentation relating to file formats may also be useful.

Software Version history

Version numbers shown here are unreliable and incomplete.

Version | Date | Author | Comments
2.00.00 | 31/03/2004 | Charlotte Bell | System now one application with plugin dlls
4.5.7.283 | 21/11/2008 | Robert Bagyinszki | After CCM Additions
 | Much history missing… |  |
4.6.0.421 | 02/02/2017 | David Yates | Crash-fix on requesting context menu on blank part of listcontrol
Version | Date | Writer
4.6.5.rc1.1 | 25/05/2018 | Richard Kerry. Except BST-62 by David Yates.

This release contains a number of improvements that have been done over a period of time. There is a further list of improvements that are planned to be done but due to the time these are expected to take a release is being done with items already completed.

  • BST-256 Location of AlarmControl's stored state file.
    AlarmControl maintains a list of all current states to improve the efficiency of starting-up.
    Formerly this was at c:\Users\<user>\AppData\Local\Temp\colledia_alarms\%CC_SYSTEM%\<alarm_system_name>\AlarmControl.dat, which is not clearly part of the BNCS system and this location was not widely known.
    It is now at %CC_ROOT%\%CC_SYSTEM%\data\<alarm_system_name>\AlarmControl.dat.
  • BST-58 (2753) Some improvements in logging. Relating mainly to the BNCS acquisition module and the Database output module.
  • BST-46 (2702) Timed overrides of alarm states, as entered via the BNCS output interface, are now preserved in the AlarmControl stored state file so will be persisted over restarts.
Version | Date | Writer
4.6.5.rc2.1 | 25/06/2018 | Richard Kerry.

This release addresses a number of issues that have arisen with 4.6.5.rc1.1.
Due to the subsequent release of 4.6.5.rc2, this release branch has been changed to be based on that release version.

AlarmControl - Alarm System Main Application

  • BST-308 The internal value used to enable the UDP system is now initialized properly.
    This may not fix the issue as reported, as that has not been seen on a development system, but should ensure that all systems start in a consistent state.

Version Control

Version | Date | Author | Comments
1.0 | 31 March 2004 | Charlotte Bell | Original Release
1.1 |  | Charlotte Bell | Processing configuration details
2.0 | 17/11/2005 | Charlotte Bell | Reworking
2.1 | 30/11/2005 | Charlotte Bell | Reworking to fill out bulleted sections
2.2 | 27/04/2009 | Pete Lasko | Updated formatting to bring in line with other existing docs
 | 02/02/2015 | Richard Kerry | Document revised to current conventions and template. Corrections and amendments. Images reworked from current versions of software.
3.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


autohost

Description

The purpose of this application “autohost.exe” is to host V4.6 panel components when they are used for automatic processes (aka BNCS Automatics) on a BNCS V4.6 system.

There can be multiple instances of this application so that multiple groups of automatic processes can be run on a single machine.

This application is meant to run pre-configured groups of panels (a bit like panelman runs panels from panesets) – if you want to just run a single V4.5 panel use bncs_v45_host.exe

Configuration

Configuration is held in autohost.xml which can be found in the config directory of the current V4.5 system

<?xml version="1.0" ?>
<autohost>
    <host id="Autos_One" >
        <app name="Test Automatic" panel="test" />
        <app name="R2" panel="Alarms\caa\Tx_Chain_panels\tx_chain_view3" instance="R2" />
        <app name="R3" panel="Alarms\caa\Tx_Chain_panels\tx_chain_view3" instance="R3" />
    </host>
    <host id="Autos_Two" >
        <app name="Test Automatic One" panel="test1" />
        <app name="Test Automatic Two" panel="test2" />
    </host>
</autohost>

This configuration shows two different configurations – which entry used is taken from the command line parameter

e.g.

autohost.exe Autos_One

The first tab always shows the configuration information for this autohost – the title bar contains the name of the configuration in use.

Using the example information above 3 panels will be created on 3 different tabs of the application – all three run concurrently and diagnostic information can be viewed by selecting the tab for that app – noting that it’s entirely developer dependent what information is provided.

Note that the “panel” information should be the relative path to the directory containing the panel DLL (not the full path).
From version 4.5.2 autohost will also accept UI-only (.bncs_ui) files – not just DLLs and uses the same priority as panelman for what to load (i.e. if there’s a DLL with the same name as the directory it’ll use that first, otherwise it’ll look for a .bncs_ui file with the same name as the directory).

It is possible to have multiple instances of the same DLL and give them different identities by providing an instance parameter. If this value is NULL or missing then the panel is not targeted.

Version Control

Version | Date | Author | Comments
4.5.0.0 | 170106 | DY | initial release
4.5.1.0 | 300913 | DY | adds shim connection so that it gets told when CSI disappears
4.5.2.0 | 151013 | DY | adds ability to load .bncs_ui files instead of just DLLs (usual prioritisatiom rules apply) - this is a viable option now that panels have connections
4.5.3.0 | 121017 | DY | Uses BNCS_V6 defintions (32k devices, 65k slots)
4.5.4.0 | 240418 | DY | Removes extended range support


bcommand

Introduction

This application has been written to replace the traditional aCommand as used in v2 or v3 systems, with improvements to allow saving of settings, a built-in timer and the ability to show revertives.

Description

There are two sections for entering commands; each of these is a separate entity that behaves in the same way. Only commands for the network can be used, for instance InfoWrite, but not TextPut. Pressing ‘go’ will send the command to the network, pressing ‘Go All’ will send all commands that are ticked in that section to the network.

The timer can be set to run for any period up to 100,000mS (100 seconds!), this will then trigger ‘Go All’ on alternating command sections.

The registration section allows the user to register with devices and see the changes in state for these devices. A record of the current registrations is kept in the list-box; this is useful when re-loading a setting. Adding a registration can be set to over write the current registration by clearing the ‘Add to Registration’ tick-box. It should be noted that the registration section is entirely separate from the command sections, so issuing a registration command from here will not affect the registration section.

Using Variables

Variables can be used, these must be in the format $name$ for strings and %name% for numerical values. String variables can be assigned values, while numerical values can perform simple functions.

Operation | Description | Example
= | Assigns a value to the variable | %count%=10, $Name$ =Fred
+ | Add two values | %count%=%value% + 10
- | Subtracts two values | %count%=%value% - 10
+= | Adds to the variable | %count% += 10
-= | Subtracts from the variable | %count%-=10
++ | Adds 1 to the variable | %count%++
-- | Subtracts 1 from the variable | %count%--
* | Multiplies two values | %count% = %value% * 10
/ | Divides two values, result is integer | %count% = %value% / 10

Any variables used in a network message get replaced as text, for example if we have %Count% as 10 and $Name$ as Fred:

IW 123 '$Name$' 12 becomes IW 123 'Fred' 12
IW 123 %Count% 12 becomes IW 123 10 12
IW 123 '$Name$' %Count% becomes IW 123 'Fred' 10

Note that when you assign a string it will include everything after '=', including any spaces, if there a two spaces together some network commands may fail!

Commands Supported

Where <when> is specified this is a 0 or 1 flag as to whether CSI should send out commands immediately or buffered

InfoWrite

IW <device> <contents> '<slot>' <when>

InfoPoll

IP <device> <start> <end> <when>

InfoQuery

IQ <device> <start> <end> <when>

InfoLock

IL <device> <start> <end> <lockState> <when>

GPI Switch

GS <device> <slot> <state> <when>

GPIPoll

GP <device> <start> <end> <when>

GPIQuery

GQ <device> <start> <end> <when>

GPILock

GL <device> <start> <end> <lockState> <when>

Router Crosspoint

RC <device> <source> <dest> '<mask>' <when>

RouterPoll

RP <device> <start> <end> <when>

RouterQuery

RQ <device> <start> <end> <when>

RouterLock

RL <device> <start> <end> <lockState> <when>

Router Modify

RM <device> <database> <index> <name> <when>

Router Name

RN <device> <database> <index>

Note: output of this command is to the debug window

Device Message

DM <target workstation> <device> <message> <our ref>

This results in a "NS" message on the network and can be used to determine/switch TxRx state on those devices that support it.

Version Control

Version | Date | Author | Comments
1.00.00 | 25/02/2004 | Mark Baldry | Original Release
1.02.00 | 17/05/2004 | ? | Can use up/down arrow to traverse commands Can copy all settings from column A to B
1.03.00 | 19/05/2004 | ? | Added variables
1.04.00 | 01/07/2004 | ? | Added RM ability
4.5.1.0 | 03/09/2006 | ? | Added the N series commands
4.5.1.1 | 18/11/2008 | David Yates | Removes N series commands. Now shuts down with CSI
4.5.1.2 | 15/04/2009 | Pete Lasko | Uses CC_ROOT and CC_SYSTEM when opening a bcommand script Warns of CSI not present
4.5.1.3 | 15/04/2009 | Pete Lasko | Added more command lines and a comment field with (save/load/clear)
4.5.1.5 | 21/04/2009 | Pete Lasko | Prompt user to save modified scripts
 | 27/02/2017 | David Yates | Conversion to markdown minor revisions
4.5.2.0 | 12/10/2017 | David Yates | BNCS_V6 - 32k devices, 65k slots etc.
4.5.3.0 | 12/10/2017 | David Yates | Range checking for spin boxes now set by BNCS_V6 defines rather than otherwise hard-coded
4.5.4.0 | 24/04/2018 | David Yates | Removes extended range support
4.5.5.0 | 23/05/2018 | David Yates | Removes second ccClient connection, uses ccClient directly rather than the shim wrapper for it
4.5.6.0 | 14/06/2018 | David Yates | Names components in the hierachy so that auto-test tools can be directed at the right things


bncs_client

BNCS Single V4.6 Panel Host

Description

bncs_v45_host.exe is a simple V4.6 client host that hosts a single V4.6 UI – either simple “bncs_ui” (XML dialog description) or DLL (compiled C++ script).

It expects the usual V4.6 environment - CC_ROOT/CC_SYSTEM environment vars set as well as supporting DLLs (e.g. custom controls) in the “usual” place.

File/Path | Notes
%PATH% | Binary dependencies Practically this means the contents of the windows\lib directory of a V4.6 system. For example (this may not be a comprehensive list): bncs_config.dll bncs_string.dll dcw.dll bncs_stylesheet.dll
%CC_ROOT%\%CC_SYSTEM%\windows\lib\qt_plugins\designer | Custom Controls. For example (this may not be a comprehensive list): bncs_ssmart.dll
%CC_ROOT%\%CC_SYSTEM%\windows\lib\qt_plugins\styles | Drawing DLLs - bncs_style.dll
%CC_ROOT%\%CC_SYSTEM%\windows\lib\qt_plugins\sqldrivers | SQL drivers (if required). For example (this may not be a comprehensive list): qsqlmysql.dll qsqlodbc.dll

Configuration

Style is taken from g_pnlman.ini (same as panelman) - found here: %CC_ROOT%\%CC_SYSTEM%\config\g_pnlman.ini

[Styles]
Style=bncs_style5

Panel

bncs_v45_host follows the same rules for loading panels as normal V4.6 panel manager "panelman.exe". i.e. give it the directory name of the UI to load. If a DLL is found with the same name as the directory then it's loaded, otherwise it'll search for a bncs_ui file of that name.

e.g.for

c:\bncs\panels\mySimplePanel\mySimplePanel.bncs_ui

use

bncs_v45_host /load=mySimplePanel

the path (c:\bncs\panels) is defined by the CC_ROOT/CC_SYSTEM environment variables and the file to load is assumed to be the same name as the directory.

Application Control from bncs_v45_host

You may close the host application with the command:

/close

From a C++ script like this:

hostNotify( "/close" );

or from a connection this:

close with connections

You can execute applications by using this from a C++ script:

hostNotify( “EA <application name>” );

where <application name> is a full path or relative to the panels directory of the V4.6 system. This is largely equivalent to ApplCore EA command.

Use this for a connections panel:

run app with connections

Command Line

Entry | Mandatory | Notes
/load=panel | yes | The directory of the panel to load
/x=0 |  | x pos of the window (this overrides the value defined by the panel loaded)
/y=0 |  | y pos of the window (this overrides the value defined by the panel loaded)
/w=1280 |  | width of the window (this overrides the value defined by the panel loaded)
/h=924 |  | height of the window (this overrides the value defined by the panel loaded)
/instance=instanceName |  | Can be used to pass an instance to the panel loaded

Running bncs_v45_host without a full V4.6 install

It is possible to run bncs_v45_host without having done a full V4.6 install.

You can use a batch file that looks a bit like this:

set CC_ROOT=c:
set CC_SERVER_ROOT=c:
set CC_SYSTEM=bncs
set CC_WORKSTATION=%1
set path=%cc_root%\%cc_system%\windows\lib;%path%
start bncs_v45_host /load=packaging\package_editor /x=0 /y=0 /w=1280 /h=924

Note: You should provide the workstation number as the command line parameter to this script.

Alternatively there is an application helper bncs_client_helper.exe that does the equivalent of this batch file - but is simpler to use (separately documented).

Version Control

Version | Date | Author | Comments
27/02/2017 | David Yates | Conversion to markdown
1.0.0.1 |  | DY | first versioned release
1.0.0.2 |  | DY | better checking/flagging of config issues, tarts the docs
1.0.0.3 |  | DY | closes after timer (to make async)
1.0.0.4 |  | DY | adds /instance command line parameter and makes well behaved with single instance
1.0.0.5 |  | DY | resets timer id variables when the timer is stopped
1.0.0.6 |  | DY | looks for CSI on startup, and closes when CSI does
1.0.0.7 |  | DY | now interprets EC messages for caption enable
1.0.8.0 | 04/09/2015 | DY | EC now has title field
1.0.9.0 | 23/10/2015 | DY | changes icon to current style
1.0.10.0 | 31/08/2017 | DY | Fix to error dialog where wrong placeholder was used. Moves version history to docs
1.0.11.0 | 13/10/2017 | DY | Compiles with BNCS_V6 (extended ranges)
1.0.12.0 | 24/04/2018 | DY | Removes extended range support


bncs_csi

DDS BNCS Control System Interface: bncs_csi

Description

This is a technology evaluation application.

Features

This application replaces "CSI32" (and its many historic variants: v3csi, v4csi etc. etc.). Whilst it's like CSI32 it's not CSI32 - every last wacky feature and nuance has not been recreated like-for-like.

Fundamental Features:

  • Client and driver support
  • Normal messaging device messaging (i.e. commands and "revertives")
  • BNCS "Database" support
  • both IPC mechanisms (BBC_COPYDATA and WM_COPYDATA)
  • driver redundancy switching with redundancy mastering
  • Configurable external DDS quality of service settings file
  • extended device/index ranges to the maximum extent of the IPC messages

Notable ommissions:

  • Workstation status infodriver
  • Driver status infodriver
  • enhanced IPC for access to 32 bit device/index/database
  • direct driver messaging
  • FABIAN support (want FABIAN functionality? Use slink!)
  • BBC_NETTXRXSTATUS, BBC_NETMSGUPDATE, HWND_BROADCAST_NETSTATUSMSG, HWND_BROADCAST_CSICLOSEWARNING, HWND_BROADCAST_APPREADY messages
  • selective caching
  • multitiude of CS32 configuration options

CSI's in years gone by have been very chilled about sending some values and will accept any string whatsoever. This version however decodes, validates and sends specific messages.

Configuration/Command Line

This application does not have any configurable parameters except the following command line parameters:

Option | Value
/domain=1 | DDS domain number - this should match the domain ID in the OSPL_URI Qos file

Environment

This version requires the following environment variables:

Variable | Value
OSPL_URI | file: //<your system root>\config\dds\ospl.xml Note: This should not have a space after the file: but unfortunately this doesn't format well in these docs.
ADLINK_LICENSE | <your system root>\config\dds\license.lic This value does not seem to require the file: prefix of the previous entry

These are set by workstation manager on the fly if this application is run from within that so you don't need these configured in your environment.

Dependencies

The following files are required in windows\lib

File | Notes
cmsoap.dll | DDS
cmxml.dll | DDS
dcpssacpp.dll | DDS
ddsi2.dll | DDS
ddskernel.dll | DDS
spliced.dll | DDS
ddsrrstorage.dll | DDS
snetworking.dll | DDS
qt5core.dll | Qt
qt5gui.dll | Qt
qt5network.dll | Qt
qt5widgets.dll | Qt
qwindows.dll | Qt (in subfolder platforms\windows)

Maximum indexes using original inter-process communications (IPC)

These are IPC limits - the bit that transfers messages about between applications on a workstation. These are not related to NetBIOS limits or those hard-coded into the CSI application.

32767 devices (1 to 32767)

This is limited by messages such as BBC_TXINFONETMSG which uses the top bit of a 16 bit value as a flag to carry extra information - so only 15 bits of unsigned value are available

65536 databases (0 to 65535)

Values are transferred as 16 bit values and all values are allowed (including database 0 of course)

65535 indexes (1 to 65535)

Values are transferred as 16 bit values throughout

32767 sources (-32767 to +32767)

Source is a signed value which limits the range

Supported Messages: external to CSI

BBC_GETHWNDCSI32, BBC_GETHWNDSHIM_ALT, BBC_GETHWNDCSI32_ALT

All handled the same, but using handleShare DLL is preferred means of getting "CSI" handle without needing to do a HWND_BROADCAST

BBC_NOTWPARAM

A simple means of seeing if this is a current CSI version

BBC_REGDEVICEID, BBC_REGDEVICEID32, BBC_DEVDRVCLOSE, BBC_UNREGDEVICEID

Driver registration

BBC_GETMAXDATABASES

Return the number of BNCS databases supported. Currently hard coded to 65536.

BBC_GETDEVTXRXMODE, BBC_SETDEVTXRXMODE

Redundancy Messages

BBC_DEVDRVREVMSG, BBC_DEVDRVPOLLMSG

Driver poll resonse - only IR, RR and GR types are supported

BBC_CACHEFLUSH, BBC_CACHETEST, BBC_CACHESWITCH, BBC_QUERYCACHEMODE, BBC_GETCACHEDDATA, BBC_GETCACHEDINDEX

Cache functions

BBC_REGCLIENT32, BBC_REGCLIENT

Handled the same to register a client

BBC_REGDEVICE, BBC_UNREGDEVICE, BBC_UNREGDEVICERANGE

"Revertive" registration functions

BBC_GETDEVPROPERTIES

String formulated to indicate databases that are avilable for the given device

BBC_TXRTRNETMSG

Free-form text message but where this implementation only messages starting "RC", "RP", "RL", "RM" are supported.

BBC_TXINFONETMSG

Free-form text message but where this implementation only messages starting "IW", "IP", "IL", "IQ" are supported.

BBC_TXGPINETMSG

Free-form text message but where this implementation only messages starting "GS", "GP", "GL", "GQ" are supported.

Note: Query commands IQ, RQ and GQ are handled no differently from poll commands IP, RP and GP.

BBC_GETDBASENAME, BBC_GETDBASEINDEX, BBC_GETDBASEINDEXEXT

Database functions

BBC_GETCSIVERSION

Hard-coded to return "2"

BBC_GETWORKSTATIONNUM

Returns workstation number

Supported Messages: CSI to external application

BBC_HWNDCSI, BBC_CSICLOSING

CSI application Messages

BBC_RXRTRNETMSG, BBC_RXINFONETMSG, BBC_RXGPINETMSG

"Revertive" messages

BBC_CLIENTMSG

Command messages

BBC_DATABASECHANGE

BBC_REQDEVGORXONLY, BBC_REQDEVGOTXRX, BBC_INQDEVGOTXRX, BBC_DEVICEIDINUSE

Redundancy messages

Logging

bncs_csi itself doesn't generate any logs.

DDS layer creates two logs in the working directory:

  • ospl-error.log
  • ospl-info.log

Upgrading to new bncs_csi releases

Use of DDS means we have to play by certain rules. When a DDS participant tries to join the party it does matching of both data types and quality of service settings. If it can't match these things because of an existing instance of bncs_csi then it will simply refuse to start up. This is just how it works.

Merely upgrading to a new BNCS v4.x release doesn't mean you'll suffer this problem - only if there are significant changes to bncs_csi which will be flagged in the release notes.

The process to upgrade has to be either take the entire system down, update and restart (not always practical of course) or alternatively update "Reserve" drivers first with them running on a new DDS domain, then update the clients, then finally update the "Main" so it's back as one system. The change of DDS domain means you're effectively running a new isolated version.

Common Error

bncs_csi requires a particular environment - specifically OSPL_URI environment variable set. If you run from workstation manager this is set by that. If you see this message:

It's entirely likely that you've tried to run bncs_csi from the command line.

You can run from the command line, but you need to have set OSPL_URI in your machine environment variables as described above. Don't forget the file: // prefix

Quality of service (QoS)/ DDS configuration

The main configuration file for the DDS layer is contained in the OSPL_URI environment variable as described above. This path is not by choice... The quality of service file itself (part of the DDS standard) is the same path but with ".qos" extension appended.

Sound words of advice

Don't fiddle with DDS configuration. In case you missed that first time: Don't fiddle with DDS configuration.

DDS doesn't just pass messages about, it defines how they're passed: how quickly, how hard to try delivering them etc. etc. When a workstation starts up it tries to join the BNCS party by subscribing to the topics that BNCS uses. To do this it ensures that it's not demanding delivery that any sender can't hope to fulfil - it does quality of service matching.

So you might be ok by changing settings to a less rigorous QoS....but on a running system you might find that all you get is an obscure DDS error message and an error log filling with largely indecipherable guff.

Don't say I didn't warn you...

Version Control

Version | Date | Author | Comments
0.0.0.1 | 07/07/2015 | DY | Development started (using RTI DDS)
0.0.0.2 |  | DY | Internal Development version
0.0.0.3 | 11/02/2016 | DY | Internal Development version
0.0.0.4 | 14/03/2016 | DY | Better behaved with aborted startups, Adds clarity to the message about USER_QOS_PROFILES.xml if one of these exists on the system and overrides our custom settings, Adds option to IPC type as to whether it should be BBC_COPYDATA messaging with type 2 messages (binary packed rather than continually pack/unpack strings
0.0.0.5 | 10/01/2017 | DY | adds domain to the command line, removes a number of debug messages
1.0.0.6 | 07/02/2017 | DY | Check of command line domain param before trying to use it. Makes a proper V1!
1.0.0.7 | 09/02/2017 | DY | adds version history file, makes app start minimised
1.0.0.8 | 05/05/2017 | DY | returns a value for BBC_GETMAXDATABASES
1.0.0.9 | 05/05/2017 | DY | DDS unexpectedly getting upset by unset string values in bncs_legacyMessage
1.0.0.10 | 29/06/2017 | DY | Fix to 1.0.0.9 to free memory used by null strings created
2.0.0.1 | 20/07/2017 | DY | First version using different DDS vendor (PrismTech)
2.0.0.2 | 24/07/2017 | DY | Some tidying, now uses handleshare DLL to save IPC lock-ups, minor changes to command line ("/domain=2" rather than just "2")
2.0.0.3 | 25/07/2017 | DY | Adds traffic counters
2.0.0.4 | 17/07/2017 | DY | Makes routerModify work again, sorts some of the mutexes, adds BBC_NOTWPARAM handling
2.0.0.5 | 01/10/2017 | DY | Restores about box and adds DDS version info (hard coded since this isn't available in DDS DLL or any API)
2.0.0.6 | 12/10/2017 | DY | Updates to V6 IPC - i.e. 32767 devices, 65535 slots - max current IPC will allow
2.0.0.7 | 17/10/2017 | DY | The first of very many instances I guess where buffers have been set to 512 bytes "because messages just are that big", except now they're not.
2.0.0.8 | 18/10/2017 | DY | Fix to wrangling of routerCrosspoint mask parameter (sloppy character set conversion)
2.0.0.9 | 19/10/2017 | DY | Parameter ordering error with routerModify. Adds flippin' obvious warning about lack of OSPL_URI instead of obscure message from DDS
2.0.0.10 | 20/10/2017 | DY | Now only distributes change of name notification if....there's a change of name - reasserting a name will not generate the notification. Also adds note in the docs about fiddling with QoS and how you deserve everything if you do.
2.0.0.11 | 24/10/2017 | DY | Router database support (for slink/fabian site linking apps to stop name changes going up own a**e)
2.0.0.12 | 24/10/2017 | DY | Sends database change message to drivers too
2.0.0.13 | 26/10/2017 | DY | anti-howlround RM commands and removes RD
2.0.0.14 | 27/10/2017 | DY | mutex hell...
2.0.0.15 | 31/10/2017 | DY | Redundancy mastering WIP
2.0.0.16 | 06/11/2017 | DY | B W C N O W U
2.0.17.0 | 21/12/2017 | DY | Corrects a long-standing misunderstanding about distribution of database change notifications. This is too all clients, not just clients with a registration for that device. Also changes 4 to 3 digit version numbering.
2.0.18.0 | 05/01/2018 | DY | Redundancy mastering reimplemented from CSI32 to allow slink to work as intended
2.0.19.0 | 09/01/2018 | DY | Net slaVe message now sends the master device as part of the message
2.0.20.0 | 09/01/2018 | DY | Adds same pragmatic fix as CSI32 to close down infodriver fix, grd fix and csi fix applications (otherwise these can get stuck running).
2.0.21.0 | 12/01/2018 | DY | Net slave command was sending the wrong master device number
2.0.22.0 | 16/01/2018 | DY | Getting redundancy state was returning the internal value of the flag, not the interface enum
2.0.23.0 | 16/01/2018 | DY | Implements max dests/sources/databases (BBC_GETMAXDESTS/BBC_GETMAXSOURCES/BBC_GETMAXSOURCENAMES/BBC_GETMAXDESTNAMES). At the point the IPC gets expanded to 4G devices/indexes then these calls are redundant anyway
2.0.24.0 | 26/01/2018 | DY | Now sets sourceWorkstation internally rather than relying on any external app to supply it (which in theory can only be the same information)
2.0.25.0 | 13/04/2018 | DY | typo with infoWrite commands and workstation number. Implements BBC_GETWORKSTATIONNUM - some things still use it
2.0.26.0 | 20/04/2018 | DY | Mutex lock-up fix when trying to remove a device
2.0.27.0 | 24/04/2018 | DY | Removes extended range support
2.0.28.0 | 24/04/2018 | DY | Historic (and unnecessary) use of the top bit of the device number to indicate 32 bit messaging (that infodriver32/grd32 doesn't use) was confusing this app. Now masks appropriately
2.0.29.0 | 15/05/2018 | DY | Implementation of RD command to make FABIAN/slink work
2.0.30.0 | 18/05/2018 | DY | Long-standing inexplicable hole in cache-get function - only returns the database name for the given router or GPI value not the numeric index. Now uses (previously unused) return value to give that value
2.0.31.0 | 18/05/2018 | DY | Device Profile now purely on existence of sizes not existence of database
2.0.32.0 | 18/05/2018 | DY | Knotty thready issue not updating UI for Txrx states (UI interaction from non-UI thread), and thready issues around use of m_cache
2.0.33.0 | 29/05/2018 | DY | Formatting error on debug string - debug message appears about missing parameter for a message that doesn't need one - now corrected.
2.0.34.0 | 31/05/2018 | DY | Messaging window was unnecessarily muting IPC traffic during closedown meaning that any closedown messages sent as drivers closed weren't able to hit the network. Now corrected.


bncs_netviewer

DDS BNCS Net Viewer (CapLog)

Description

This is a technology evaluation application.

Like CapLog...but not...

Is router modify device-database-index or device-index-database? GPI switch commands/revertives has state or index first?

With this application it's ALWAYS device-index (though you may want to think of it as device-destination)

What the display means

Display | Meaning | Notes
RC 123 456 789 ',---' 2 | Router Crosspoint device=123 dest=456 source=789 mask=,--- workstation=2 |
RP 123 456 789 2 | Router Poll device=123 start=456 end=789 workstation=2 |
RL 123 456 789 1 2 | Router Lock device=123 start=456 end=789 state=1 workstation=2 |
IW 123 456 'Stuff' 2 | Info Write device=123 dest=456 value=Stuff workstation=2 |
IP 123 456 789 2 | Info Poll device=123 start=456 end=789 workstation=2 |
IL 123 456 789 1 2 | Info Lock device=123 start=456 end=789 state=1 workstation=2 |
GS 123 456 1 2 | GPI Switch device=123 dest=456 state=1 workstation=2 |
GP 123 456 789 2 | GPI Poll device=123 start=456 end=789 workstation=2 |
GL 123 456 789 1 2 | GPI Lock device=123 start=456 end=789 state=1 workstation=2 |
RM 123 456 789 'Stuff' 1 2 123456 | Router Modify device=123 index=456 database=789 name=Stuff tallyDump=1 workstation=2 applicationHandle=123456 | Application Handle is used internally to prevent howlround on this peer-to-peer message when used on FABIAN/Slink links
RD 123 456 789 'Stuff' 1 | Router Database device=123 index=456 database=789 name=Stuff workstation=2 | Notification of change to a database (usually from FABIAN/slink)
RR 123 456 789 2 | Router Revertive device=123 dest=456 source=789 workstation=2 |
IR 123 456 'Stuff' 2 | Info Revertive device=123 dest=456 info=Stuff workstation=2 |
GR 123 456 1 2 | GPI Revertive device=123 dest=456 state=1 workstation=2 |
NC 123 2 | Net Close device=123 workstation=2 |
NO 123 2 3 | Net Objection device=123 sourceWorkstation=2 destWorkstation=3 |
NI 123 2 | Net Inquiry device=123 workstation=2 |
NV 123 2 121 | Net Slave device=123 sourceWorkstation=2 masterDevice=121 |
NB 123 2 | Net Broken device=123 workstation=2 |

UI Options

Consider the following example:

This shows the toolbar.

Item | Notes
Clear | a button to remove all items from the list
C | toggles display of control messages - these are the core BNCS messages to write values, get responses, set cross points etc. In this example this is shown enabled (show control messages)
R | toggles display of redundancy messages. In this example it's shown disabled (don't show redundancy messages)
W | toggles display of workstation status messages. This example shows it disabled (don't show workstation messages)

The "+" or "-" icon toggles and indicates whether the device numbers given in the following list are to be excluded or only those device numbers displayed.

As indicated in the example, BNCS device numbers 1, 2, 3 and 4 are to be excluded from the display.

Read it as
: exclude the following
: only show the following

For normal, unfiltered operation this list should be empty and indicating the "minus" icon.

The display used is a text edit control - optimised for use with rapidly changing data. Use of this control means you can copy to the clipboard from the display.

When paused, clicking on any line in the display will show a status bar explanation of that command. It's a technical limitation that it does it only when paused. As the item scrolls to the top of the display it gets deleted, the cursor moves to the next item and the status bar flashes continuously.

UI Colours

These are configurable on a machine-by-machine basis (to suit the user) and the values are persisted in the Windows registry: HKEY_CURRENT_USER\Software\BNCS\bncs_netViewer.

Background colour changes are immediate, command/revertive/redundancy changes from next received message

Version Control

Version | Date | Author | Comments
2.0.0.6 | 09/10/2017 | DY | Not sure why this app didn't have independent version information - so here it is. This version adds store of window position and adds "Always on top" option
2.0.0.7 | 17/10/2017 | DY | Adds pause to toolbar so that this is more readily used on a touchscreen. Still not as handy as touching on the log view itself, but marginally easier to use
2.0.0.8 | 19/10/2017 | DY | Adds flippin' obvious warning about lack of OSPL_URI instead of obscure message from DDS
2.0.0.9 | 24/10/2017 | DY | Router database support (for slink/fabian site linking apps to stop name changes going up own a**e)
2.0.0.10 | 26/10/2017 | DY | Removes router database, and allows for loop-free RM
2.0.0.11 | 02/11/2017 | DY | Adds NV (Net slaVe) indication to go with redundancy mastering
2.0.12.0 | 21/11/2017 | DY | Adds millisecond value to disk log (I'm not sure why this didn't always have it). Also changes "significance" of last version digit to normal values (for this seat at least)
2.0.13.0 | 03/01/2018 | DY | Changes ordering of RM commands to "DDS CSI standard" i.e. ALWAYS device->index so RM 123 456 789 is device 123, index 456, database 789
2.0.14.0 | 04/01/2018 | DY | Adds commands with explanations
2.0.15.0 | 12/01/2018 | DY | Makes colours a configurable item and changes redundancy default to pink rather than a low-luminance purple it had been
2.0.16.0 | 16/01/2018 | DY | Fixes "always on top" (suddenly broken in Qt)
2.0.17.0 | 25/01/2018 | DY | Redundancy IDL change because second parameter is not always dest workstation
2.0.18.0 | 09/05/2018 | DY | Vastly improved performance by pre-caching data for display rather than let the UI component itself discard superseded data
2.0.19.0 | 15/05/2018 | DY | RD implementation
2.0.20.0 | 15/05/2018 | DY | Makes log files more like caplog so that caplog tools can be used on them
2.0.21.0 | 20/05/2018 | DY | Corrects display of the LOCK commands. Adds summary of what the commands means in the status bar whenever you click any command (but only when paused)
2.0.22.0 | 20/05/2018 | DY | Adds status bar help for Net Broken. Adds open file and open folder toolbar and menu options. Writes to file when log disabled/enabled and app start/close.
2.0.23.0 | 20/05/2018 | DY | Corrects icons for open log/folder toolbar
2.0.24.0 | 23/05/2018 | DY | Error initialising timer used to generate test data. This meant that it could be confused with the display update timer. Effect was you get a log full of "entry_" lines and the display doesn't update. It's down to chance whether it works or not.
2.0.25.0 | 05/06/2018 | DY | Removes debug message that repeats often, and doesn't aid debugging


bncs_filesync

BNCS File Synchroniser Utility - bncs_filesync

Description

This is a utility for synchronising file and directory structures.

Important note:
This is an aggressive file copying engine it will completely synchronise a slave directory with the master regardless of file dates, and will delete files on the slave that do not exist on the master. Be very careful in setting this program up!

Important note:
This application is meant for a client/driver machine on a BNCS system rather than as a generic file copying mechanism.

Server (or Master) file sharing

File copying is done using a Windows networking and requires shares (with appropriate permissions) to be set up. This application must have read access to the master machine. A completely open share is undesirable; the best solution is for the client machine to have an account on the file server so that credentials do not have to be supplied to access the data.
The usual cause of failure of a file sync operation is permissions to the specified shares.

Command Line Parameters

filesync /source=<directory> /dest=<directory> [/reservesource=<directory> /delete /postsync=<application> /presync=<application> /quiet /static /exclude]
Parameter | Optional | Notes
/source= |  | the master copy of the data None of the files in this path are changed.
/reservesource= |  | Path to the reserve server
/dest= |  | the destination / slave copy After the files are synchronised this path will be an accurate copy of the master_directory.
/delete | Optional | if set to “true” files are deleted from the slave_directory if they do not exist on the server. if “false” (the default) files are updated from the master but redundant files never deleted. This is marginally safer if you manage to get the directories muddled up
/postsync= | Optional | The application to run once the file sync process is complete. Note: filesync does not close down until this application has terminated (unless it failed to run it or wasn’t present on the command line). You don’t need to specify an absolute path if this application resides in the path of the machine. This could be v2launch.exe but ensure that the QuitWhenDone flag is set.
/presync= | Optional |
/quiet | Optional | This disables the CC_DEVELOPER flag checking
/exclude= | Optional | Comma delimited list of top level directories to exclude. Typically for V4.6 installations this is: /exclude=source,temp,docs,data,install,backup,logs
/static | Optional | Forces the use of the filelist.sync instead of dynamically determining the list of files dynamically from the server each time This is only any good if this list of files is maintained and whilst it is maintained by the V4.6 configuration server manual changes to the file system are not captured.

Example: the following command line runs a batch file “rbatch.bat” before starting file synchronisation, then synchronises files on the local machine (c:\my path\v4.6) with a server (\bncs_001\c$\bncs\v4.6) deleting slave files appropriately and running a program called “obatch.bat” when the update is complete.

filesync /source=\\bncs_001\c$\bncs\v4.6 /dest=”c:\my path\v4.6“ /delete /postsync=obatch.bat /presync=rbatch.bat

Note: the optional use of quotes to ensure that paths with spaces in aren’t misinterpretted as additional command line parameters.

Pre Sync App

The idea of the pre-sync batch file is to perhaps do default actions whether or not the sync operation is successful (such as removing temporary files to force a resync with the server).

Post Sync App

The idea of the post-sync application is to run a batch file or whatever to do any post-synchronise actions. An example of this might be to move selected files that have just been copied within the BNCS file structure to the Windows directory for those applications that need it, as the Windows directory itself cannot be synchronised (or at least it could but your machine would never work again!).
e.g. based on the above example this batch file takes the contents of the “windir” subdirectory and copies it to Windows
contents of file postsync.bat:

xcopy %BNCS_ROOT%\windir\*.* %WINDIR% /c/i/f/d/y

(in this example the environment variables for BNCS_ROOT and WINDIR are used rather than explicity specified paths)

File exclusions

The command line accepts a parameter of directories not to sync.
There is a second means of excluding files by pattern from an external configuration.
Configuration is to be found here:

%CC_ROOT%\%CC_SYSTEM%\config\bncs_filesync.xml

and is of the following format:

<?xml version="1.0" ?>
<exclusions>
    <regexp wildcard="true" >*.tlog</regexp>
    <regexp case="true" wildcard="true" >*.sdf</regexp>
</exclusions>

Each entry is a regular expression (as the Qt toolkit it’s based on knows them).
The case and wildcard attributes are entirely optional but if set to “true” enable case sensitive pattern matching and wildcard matching respectively.
If you wanted to exclude all files whose extensions where “.cpp” either of these entries would work:

    <regexp wildcard="true" >*.cpp</regexp>

    <regexp>.cpp$</regexp>

Logs

This applications writes a daily log file of activity in standard log file format which can be found in:

%CC_ROOT%\%CC_SYSTEM%\logs\FileSync\yyyymmdd.log

for example

c:\bncs\v4.6\logs\FileSync\20040816.log

It’s anticipated that an external application is used to delete unwanted log files.

CC_DEVELOPER Checking

If the CC_DEVELOPER environment variable is set to “true” this application throws up a message box to inform the user that they are about to synchronise part of their file system. This is just a sanity check so that you can’t wipe out a file structure that you didn’t mean to. This checking can be disabled by specifying “/quiet” on the command line.

Notes

This application can’t overwrite files that are currently in use such as binaries (DLLs or EXEs) or files locked by applications.
Synch’ing an entire tree assumes that there is no local settings or temporary data in the slave tree.

Bug list

Slave file dates are synchronised with the master. However there are likely to be problems with running this application over a daylight saving change (March/October). This might involve a complete resync of the slave – not disastrous but unnecessarily time consuming.

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


bncs_inst_env

bncs_inst_env V4.6 Environent Change Utility

Introduction

This application is a utility to allow developers to rapidly switch between BNCS systems and workstations without having to manually edit files.

screenshot
Figure 1 Screenshot

Description

Root

The root is the directory where all of the files for all BNCS systems on a given machine are expected to be found. Pressing set will bring up the screen seen in Figure 2, this allows the user to enter the required Root directory, or select one of the recently used options. This actually sets the “CC_ROOT” environment variable.

screenshot
Figure 2 Root Options

System

By combining both the root and system variables the full path to the currently active BNCS system is created. Pressing set will bring up a list of the available systems in the root directory giving you the option to pick the appropriate one. This actually sets the “CC_SYSTEM” environment variable.

System Server

Selecting “work stand-alone” will set the server to be the local machine, this means that workstation manager will not do an update. When not working stand-alone this should be set to the machine that is the nominated system server, this is where the files will be synchronised from when workstation manager is run. This actually sets the “CC_SERVER_ROOT” environment variable.
The reserve server setting is for a server to be used in the event that the main server synchronisation fails. This actually sets the “CC_RESERVE_SERVER_ROOT” environment variable.

Identity

The identity is the workstation number, pressing set allows you to enter a workstation number, or to browse the list of workstations and select the required one. The list of workstations displayed is from the workstations.xml configuration file.
Setting the workstation actually changes the value in the following locations that are used by various applications depending on component age:-

  • “CC_WORKSTATION” environment variable.
  • csi.ini file in the Windows directory.
  • applcore.ini file in the Windows directory.
  • bncs_system.ini file in the selected systems config/system directory.

Developer Mode

Setting the developer mode gives you:-

  • If filesync is not in “quiet” mode gives you the option to skip file synchronisation.
  • Workstation manage will not restart CSI if it crashes.
  • Whatever any application decides a developer might want/not want to do!

This setting is the “CC_DEVELOPER” environment variable.

Applying Changes

When you select “OK” the changes are made to the system, however it should be noted that any applications that are already running will not reflect these changes. If an application that is already running starts another application that new application will run with the existing applications environment, thus may give unexpected results. It is strongly suggested that once changes are made that involve setting environment variables you re-start all BNCS applications, and any applications that can start BNCS applications, including Visual Studio.

Version Control

Version | Date | Author | Comments
0.1 | 07/11/2006 | Mark Baldry | Initial document created.
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


appGuide

Operations

Create, Load Save a Panel

Create a new panel

Select File|New, or Ctrl+N, or the New File tool icon newFileIcon
The New File… dialog appears (Figure 1: New File dialog).

newFile
Figure 1: New File dialog

Select the icon corresponding to the size of dialog appropriate for your system.

Select OK. (Or double-click on the icon for the size of dialog you want).

An empty dialog background of the correct size will appear.

Save a Panel to a File

Select File|Save, or Ctrl+S, or the Save tool icon saveIcon. The panel will be saved to its associated file.

If no file has been selected, you’ll get the standard Windows ‘Save As’ dialog. Navigate to where you want to save the file and enter the name you want to use.

Save As is also available in the File menu to resave a panel into a file with a different name.

Load an Existing Panel File.

Select File|Open, or Ctrl+O, or the Open tool icon openIcon. The standard Windows Open dialog will appear. Navigate to the file you want to load. Single-click it and select OK or press Return or double-click it.

Recent Files

Up to ten of the most recently edited panel files are available from the File|Recent Files menu.

Basic Panel Editing

Add a New Control to your Panel

The available controls appear in the Configuration / Widgets window, which normally appears to the right of the dialog (Figure 2: Configuration / Widgets Window).
This is a dockable window so may be undocked from there and moved elsewhere.

widgets
Figure 2: Configuration / Widgets Window

Select the control you want and drag it onto your panel. When the first one is positioned there is usually a delay before it appears while the library loads. Subsequent controls usually appear immediately.
This window has three separate tabs, Buttons, By Name and By Type. The Buttons tab contains all the available fundamental control types – Button, Range, Enum, Script etc . The By Name and By Type tabs allow access to smart controls for device parameters, listed linearly (By Name) or in a hierarchy of instance within device type (By Type). In these latter two tabs the instance is selected in the upper pane and the parameters then appear in the lower pane, from where they may be dragged onto the dialog, where they will appear as the appropriate control type with all necessary parameters already set appropriately.

Basic Control Editing.

When a control is selected, eight blue spots, called ‘Edit Handles’, will appear on it (Figure 3: Selected Button showing Edit Handles). These may be used to resize the control, or move any of its corners.

edithandles
Figure 3: Selected Button showing Edit Handles

To move the whole control, click anywhere on it apart from on one of the handles and drag it to where you want it. The cursor keys will also move the selected control(s)

Multiple Selection

The mouse may be used to select multiple controls.
Either :
Press the left mouse button somewhere on the dialog background and hold the button down while dragging the selection box over all the controls you want to select.
Or:
Hold down the Shift key while selecting individual controls with the mouse. This is the way to select controls that are not adjacent so can’t be selected using the normal rectangular selection method using the mouse.
Selection is by touch, not containment. Any button that is wholly or partly within the selection box will be selected.

Editing Properties of Controls

To change anything other than the size or position of the control, you need its property editor dialog. To get this, either :
• Double click on the control
• Right-click on the control to get the context menu. Select ‘Properties’.
• ALT+Enter

Each different type of control has its own properties dialog. Each of these has a number of tabbed pages allowing you to edit all the control’s properties.
There are too many to display them all here, but a few are shown (Figure 4: Properties dialog for Generic Control, Figure 5: Properties dialog for Enum control)

props
Figure 4: Properties dialog for Generic Control

enumprops
Figure 5: Properties dialog for Enum control

The Control ID Viewer

The Control ID Viewer shows a list of all the controls on the current dialog.

You can activate it at View|View ID List or using the tool icon controlkd.

This shows the ID of each control on the panel and allows you to see, by selecting them, which is which.. It also allows the IDs to be changed, by double-clicking on them.

It is the only way of selecting individual items that are not visible because they are off-screen.
It is not possible to select multiple items using the ID Viewer.

Widget Count

The Control ID Viewer shows all your controls so you can count the number of controls from there.
Use Tools|Widget Count widgetcount or Ctrl+W to get a count of all objects and widgets on the Panel.

Common Editing Tools

A selection of editing tools is available, similar to those commonly found in Word processors and other applications.

Delete

Delete the selected control(s) using Edit|Delete, or the Delete key or delete tool icon, or the Delete entry in the context menu.

Cut and Paste

Standard Cut, Paste and Copy functionality is available, from the Edit menu, and from the toolbar and the usual keystrokes.

  • Cut - cut Remove selected controls from the dialog and copy to clipboard.
  • Copy - copy Copy selected controls from dialog to clipboard.
  • Paste - paste Paste the contents of the clipboard to the dialog.
    See Appendix A – The Clipboard for more information on the use of the clipboard.

Duplicate

To duplicate a control or a number of controls, select the control(s) you wish to duplicate and then use Layout|Duplicate, the tool icon dup , or the Duplicate entry in the context menu.

Undo

The program maintains a list of recent actions performed. You can undo to the previous state using Edit|Undo, or Ctrl+Z or the undo tool icon.

More Advanced Panel Editing – Alignment and Spacing tools

In order to produce smart looking panels, there are a number of tools to help get controls to line up with one another and to space them evenly on the panel.

The Grid

There is a grid to help with alignment of controls. If it is turned on you will see dots on the dialog background. The grid is spaced at ten pixel intervals. The interval is not changeable.
To turn it on or off, use Tools|Toggle Grid grid or Ctrl+G.
Note that all the spacing tools use the grid so you may find that attempting to stack some buttons leaves them irregularly spaced if the grid is turned on.

Alignment Tools – Left, right, top, bottom.

These tools allow you to align the edges of the controls, and also to adjust controls to have similar sizes.
Select more than one control.

Note that if you use the shift key to select individual controls, the Align tools will align the buttons to the edge of the first one selected, which will not necessarily be the one in the direction being aligned to. In this case you will notice that the first item selected has blue edit handles and all the others have black handles.

Select one of the Alignment tools, either in the Layout menu, the tool icons left right top bottom, or the Align submenu of the context menu.
All the controls will move to align their edges as appropriate for the tool selected. Controls will be moved, their sizes will not be affected.
For example, if you select Align Left, all but the leftmost control (or the first one selected) will move to the left so that their left edges are in line.

If we start with three buttons on a dialog, as in Figure 6: Three buttons, selected.

three
Figure 6: Three buttons, selected

Align Right will result as shown in Figure 7: Aligned Right.

alright
Figure 7: Aligned Right

Align Top will result as shown in Figure 8: Aligned Top

altop
Figure 8: Aligned Top

Align Bottom will result as shown in Figure 9: Aligned Bottom.

albottom
Figure 9: Aligned Bottom

Align Left will result as shown in Figure 10: Aligned Left.

alleft
Figure 10: Aligned Left

Size Matching Tools – H and V, Smallest and Largest

These tools allow you to resize controls so that they have the same size along the selected axis.
Select more than one control.

Select one of the Size tools, either in the Layout menu, the tool icons hsmall hbig vsmall vbig, or the Size submenu of the context menu.

All the controls will be resized as appropriate for the tool selected. Their sizes will be changed but their positions (the position of the top-left corner) will not be changed.
For example, if you select Size H Smallest, all but the narrowest control (measured horizontally) will be resized to be the size of the narrowest.

To show these tools in action we’ll start with some differently-sized buttons, shown in Figure 11: Two Buttons, selected.

twobut
Figure 11: Two Buttons, selected

Size H Smallest will result in the layout shown in Figure 12: Size H Smallest.

hsmall
Figure 12: Size H Smallest

Size H Largest will result in the layout shown in Figure 13: Size H Largest

hlarge
Figure 13: Size H Largest

Size V Smallest will result in the layout shown in Figure 14: Size V Smallest.

vsmall
Figure 14: Size V Smallest

Size V Largest will result in the layout shown in Figure 15: Size V Largest.

vlarge
Figure 15: Size V Largest

Centre controls in dialog – Horizontally or Vertically

These tools will position one or more controls centrally on the dialog.
Select one of the Centre tools from the Layout menu, the tool icons hdist vdist ,or the Align submenu of the context menu.
If several controls are selected for this action, they will be centred as a group, not individually.
Starting with the same three buttons as in Figure 6: Three buttons, selected, Centre Horizontally in Dialog will result in the layout shown in Figure 16: Centred Horizontally. Note the buttons retain their absolute spatial relationships with one-another, but that the whole group has been moved to be centred left to right.

hcemtre
Figure 16: Centred Horizontally

Starting with the same three buttons as in Figure 6: Three buttons, selected, Centre Vertically in Dialog will result in the layout shown in Figure 17: Centred Vertically. This time the buttons have been moved down so they are centred top to bottom.

vcemtre
Figure 17: Centred Vertically

Distribute – Horizontally or Vertically

The distribute tools will take a number of controls and distribute their positions along one axis.
Select one of the distribute tools from the Layout menu, the tool icons hdist vdist ,or the Align submenu of the context menu.

The controls at the ends of the selected axis keep their position and the others will get spaced along the axis. They maintain their order relative to each other but their distances from each other will normally change.
Starting with a slightly different set of three buttons as Figure 18: Three Buttons, unevenly spaced.

uneven
Figure 18: Three Buttons, unevenly spaced.

Distribute Horizontally will result in the layout shown in Figure 19: Distributed Horizontally. Note that only the horizontal position of the middle (on the horizontal axis) button has been changed.

hdist
Figure 19: Distributed Horizontally

Distribute Vertically will result in the layout shown in Figure 20: Distributed Vertically. Note that only the vertical position of the middle (on the vertical axis) button has been changed.

vdist
Figure 20: Distributed Vertically

Note that the order in which the controls are positioned depends on the initial origins of the controls, not their centres or any other property. Starting with three buttons of different widths, as shown in Figure 21: Three Buttons, different widths.

3x3
Figure 21: Three Buttons, different widths.

If we select Distribute Horizontally, the result is as in Figure 22: Three Buttons, different widths, Distributed Horizontally

3x3dist
Figure 22: Three Buttons, different widths, Distributed Horizontally
Note that the lower button is now second along the horizontal axis as, even though its centre was further to the right than that of the middle one, its origin is what counts here and that was to the left.

Stack to an Edge

The stack tools will take a number of controls and distribute their positions along one axis.
The Stack action differs from Distribute in that the controls are all moved so they are evenly spaced based on their sizes and all but the control nearest the relevant edge will be moved. Distribute will leave the controls at both ends of the axis and space all the others evenly in-between. Stack will only leave one at one end of the axis and will move all the others to a specific absolute spacing.

Starting with the set of three buttons as Figure 18: Three Buttons, unevenly spaced.
Stack Left will result in the layout shown in Figure 23: Stacked Left.

stackleft
Figure 23: Stacked Left

Stack Right will result in the layout shown in Figure 24: Stack Right.

stackright
Figure 24: Stack Right

Stack Top will result in the layout shown in Figure 25: Stack Top.

stacktop
Figure 25: Stack Top

Stack Bottom will result in the layout shown in Figure 26: Stack Bottom.

stackbottom
Figure 26: Stack Bottom

Note that as for the Distribute tool, the order in which the controls are positioned depends on the initial origins of the controls, not their centres or any other property.

Testing

To test your panel use Edit|Test or the tool icon test.

This runs your panel in PanelMan.
The panel needs to have been saved in a suitable directory before this can be done; you can’t just create a panel in the Visual Editor and test it without saving it.

Getting at the Other Bits

In order to write a script for your panel you need to run Microsoft Visual Studio 6. This may be done by navigating to the appropriate folder using Windows Explorer but tools are also available within the Visual Editor to do this.

Explorer

Select Tools|Open in Explorer or the tool icon explorer. A new window will open showing the folder containing your panel.
If you haven’t saved the panel, the Save As dialog will appear, inviting you to do so.

Visual Studio

To open your panel’s script in Visual Studio, or to get Visual Studio to create a script project, select Tools|Open/Create Visual Studio Proj, or select the tool icon visstudio.

If there is no project you’ll be prompted whether you want to create one.

Once the project exists, Visual Studio will open it.

Appendix A – The Clipboard

The clipboard used by cut and paste operations within this application is the standard Windows clipboard and is hence shared with other programs.
When the Visual Editor copies information to the clipboard it does so using the XML representation of the data. The structure and contents of this are beyond the scope of this document.
Because of this sharing it is possible to copy controls into another application, for example a text editor in order to diagnose problems (or simply out of curiosity ….). Conversely, with sufficient care and knowledge it is possible to copy into the Visual Editor information prepared outside it.

Appendix B - Configuration

The configuration of available controls will normally be done during the early stages of your project and will rarely be changed. Indeed it is likely that this configuration will not even change between projects.
Configuration of available controls is done in the config/vised/buttons.xml file in your project.
The file contains an XML description of which controls are available and in which libraries they are found. The structure and contents of this are beyond the scope of this document.

Version Control

Version | Date | Author | Comments
0.1 | 06/11/2006 | Richard Kerry | First Version
0.2 | 10/11/2006 | Richard Kerry | First publication.
0.3 | 19/12/2011 | Andrew Prince | New format
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


bncs_vis_ed

BNCS Visual Editor

Overview

The BNCS Visual Editor bncs_vis_ed.exe is proprietary application specifically for development of BNCS user interfaces (UIs).

It's a UI editor so you can create and arrange buttons, labels and other visual elements but it's also configuration aware. You can build an entire BNCS application by dragging pre-configured UI components using configuration information defined about the "shape" of the system.

The BNCS Visual Editor is designed to work with BNCS UI files which have the (unimaginative) file extension ".bncs_ui".

Application Guide
Creating New Dialog Files
Connecting UI Components
Maintaining the toolbox button list
Manual Size/Position Dialog
Manual Settings Dialog
Import Settings Dialog

General Information

File Paths

"bncs_ui" files

Without going into a long-winded explanation - ".bncs_ui" files should always exist within the "usual project structure" for this type of system. They also must always be in a panels sub-folder

For example:

c:\bncs\mySystem\panels\

This consists of:

Element | Notes
root of one or more systems | c:\bncs
current system | mySystem
fixed sub-directory | panels

UI files always sit within their own sub-directory off \panels\ - this is so that you can keep all the things that you need with that UI in one place.

So, our first ".bncs_ui" file might be called:

c:\bncs\mySystem\panels\first\first.bncs_ui

It's significant that the file has the same name as the folder - this is how it's loaded at run-time - by folder name not filename. This is important if we decide later that a simple ".bncs_ui" is not enough for our application and we must create a script (C++ built DLL) perhaps with multiple ".bncs_ui" files.

UI Resources

UI resources such as other UIs, or bitmaps, scripts etc. then usually get loaded relative to the panels directory. This is so that you don't hard-code absolute paths into your application, but also to keep paths short.

For example the path to an image on disk might be:

c:\bncs\mySystem\panels\myPanel\background.png

but from a ".bncs_ui" file in the myPanel UI folder we can simply refer to it as (relative path):

background.png

If it's a shared image we can have a shared images location on disk:

c:\bncs\mySystem\panels\images\logo.png

and we refer to this like this:

\images\logo.png

Note: absolute paths aren't a good thing and won't work!

Button Names

Button names must be unique and the editor will not allow two of the same name.

If you copy/paste buttons, to aid in laying out buttons of similar type where each button has a numeric suffix the editor will take the suffix of the "source" button, increment it and make this the name of the pasted button - subject to it still being unique (it'll keep incrementing until it finds a unique name).

Occasionally of course you may want more than 10 (or even 100) buttons so for ease of use in panel scripts and when connecting buttons please ensure that the button identifiers have leading zeros. For example:

Source Button Name | Pasted/Cloned Button Name
source_1 | source_2
source_001 | source_002

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


buttons

Maintaining Toolbox Button List

The buttons toolbox in the visual editor takes its configuration from

%CC_ROOT%\%CC_SYSTEM%\config\vised\buttons.xml

This is a simple XML (which is actually similar to a normal ".bncs_ui" dialog description file.

Example

Three entries are shown:

<?xml version="1.0" ?>
<buttons>
    <control name="Button" class="bncs_control" w="100" h="40" >
        <setting value="style=button" />
    </control>
    <control name="Script" class="bncs_script_loader" />
    <control class="bncs_script_loader" name="adjust" w="80" h="40">
        <setting value="scriptname=/components/adjust" />
    </control>
</buttons>

Note that there are two entries for the same class. In this case one is an unconfigured script class - the other is the same class but given a particular context to do something useful.

The <control> entries should be fairly familar to anyone who's viewed the ".bncs_ui" file format - these are almost the same. Note however there is no x or y attribute to set the location of the control - this is set by the location of the cursor when the control is dropped. If you really want to drop a control at a specified location (sometimes you want to) then set the x and y values.

Width and height ("w" and "h") can be specified but is not compulsory. A default of 100 x 100 is used.

The name tag is the value used under the icon - it is freeform text.

The class tag must be exactly as the custom controls define it - usually with a "bncs_" prefix.

Each entry can have as many <setting value="....."/> tags as it likes - in the same way as a normal ".bncs_ui" control.

An entry in this list can be given a bitmap if you give it the same name as the displayed name - this should be a PNG file.


connections

UI Component Connections

Overview

The V4.6 toolkit allows for many different UI components to be combined together to produce a solution. Often these components wrap up most if not all of the functionality required and all that's needed is to join together the output of one component to the input of another.

"UI Connections" gives the UI designer the option to make some connections between components without having to write any C++ script.

These connections are stored in the same XML file in which the UI layout is stored - the ".bncs_ui" file.

Parameter Passing

The connections engine makes more sense (excuses more things!) if you understand how parameter passing works in V4.6.

It's a simple text based system of parameter/value pairs - remembering this when dealing with connections is useful.

Sometimes it's not enough to simply pass incoming notification to outgoing command and we need to reformat the values as we go - you can see how this works below.

Parameters are passed as a single string "encoded" as command/value pairs.

<command>=<value>

e.g.

colour=red

Occasionally a single param alone is not enough of a description. It can be further qualified by a sub-command

<command>.<sub command>=<value>

e.g.

colour.background=red

You can have a number of sub commands (up to 32).

So for the previous example:

<command> is "colour"
<sub0> is "background"
<sub1> is "top"
<value> is "red"

Wildcard Matching

The UI connection rules allow for wildcard matching. This is similar to the wildcard matching used in Windows file system.

Character | Description | Example | Matches
* | match one or more characters in a string | dest_* | matches dest_1 dest_2 dest_100 but not destGrid
? | match exactly one character | dest_? | matches dest_1 dest_2 but not dest_10

Parameters that are supplied without wildcards are matched exactly.

Parameter rewriting

The "event" command/value sent from one component may not be in exactly the right format to be received by another. It's necessary therefore to allow for rewriting the notification.

This is done by simple text substitution. The following aliases are allowed:

Param | Description
[id] | The id of the control/component that generated this event
[id.<param>] | Get a value from the id of the control/component that generated the event. e.g. to get the text value from the sending control you'd put: [id.text] Note: not all controls/components support retrieval of each and every named parameter - explicit code is required for this to work and many don't explicitly implement it
["<buttonid>".<param>] | Get a value from a named control/component. e.g. to get the text value from a control called "button" you'd put: ["button".text] Note that the button id must be contained within quotes - this distinguishes it from other keywords or text replacement values Note: not all controls/components support retrieval of each and every named parameter - explicit code is required for this to work and many don't explicitly implement it
[intid] | The (first) integer part of the id - the connections engine tries to convert the id of the control to an integer removing characters from the beginning of the id until it finds a non-zero value. So....an id of "dest_123" will return a value of 123. An id of "dest_group456_123" will return 456.
[command] | The command part of the incoming event. For a notification of "button.1=released" this value is "button"
[subn] | Where n is a value 0-31. This is the sub-command parts of the incoming event For a notification of "button.1=released" the sub0 value is "1".
[value] | The value part of the incoming event For a notification of "button.1=released" this value is "released".

Configuring Connections

There is a edit time configuration dialog which is used to add/edit connections. This is accessed from the Visual Editor menus and toolbar.

There are 5 parameters required for all connections:

Param | Mandatory? | Wildcards? | Rewriting? | Notes
sender | Yes | Yes |  | What button ids to take events from - this may be explicitly specified controls or a pattern matched on a wildcard. This value can be [parent] which can be used when this UI is hosted without a DLL script. This value can be [startup] and this event is fired when the UI is created
receiver | Yes | Yes | Yes | What button ids to send commands to - this may be explicitly specified controls or a pattern matched on a wildcard. The usual rewriting rules apply to this parameter - so you can have a control called: source_1 matched by sender value of source_* and send the command string to a receiver of dest_[intid] which gets rewritten as dest_1 So in this case source_1 is connected to only dest_1, and the same rule connects source_999 to dest_999 This value can be [parent] in which case the notification is sent to the host of this UI. This is only valid for when a UI is hosted directly not when part of a DLL solution (i.e. in bncs_v45_host.exe or in the uiHost custom control)
event | Yes | Yes |  | What the event is that should be forwarded. This should be of the format <command>=<value> and should contain an equals sign. If a single * is specified in the connections dialog it is rewritten to be =
command | Yes | Yes...but...(see note) | Yes | What the command string is sent This can be a single * wildcard if you want to send whatever the incoming notification was verbatim.
name |  |  |  | Not absolutely required to work but useful as aide memoir as well as appearing in the connections debugger to show which connection was used

Other command options

In addition to sending a command to the destination controls the following options are also available:

Command | Description
[show] | Show the control
[hide] | Hide the control
[enable] | Set the control to the enabled state
[disable] | Set the control to the disabled state

This is the only entry that's permitted in the command field and no text is sent to the control

Editing Connections

Additional options are available for context sensitive editing of connections.

Right clicking on a control gives 3 connections options:

Menu Item | Description
Show what connects here | Opens the connections dialog with rows highlighted where the id of the control matches the receiver column
Show what we're connected to | Opens the connections dialog with rows highlighted where the id of the control matches the sender column
Connect to> | Opens a menu item with a list of the controls available on this dialog. Selecting a control opens the connections dialog with sender and receiver filled in but you still need to specify event and command

Examples

For the following connection (as taken from the ".bncs_ui" file):

<connection sender="sourcePage" receiver="sourceGrid" event="*=released" command="page=[sub0]" name="source paging"/>
  • This only connects notifications from a single control "sourcePage" to feed to another single control "sourceGrid" (i.e. there are no wildcards used).
  • The event is any that has a <value> of "released" - note that you need to specify the command part of the string as a wildcard. The value used here is entirely dependent upon the control being connected.
  • The command then is part hard-coded string and part text substitution. For an incoming notification of "button.5=pressed" the value "page=5" is sent. The value used here is entirely dependent upon the controls being used.
<connection sender="dest_*" receiver="dest_*" event="*=*" command="[command]=[value]" name="dest selection"/>
  • This connects controls that match "dest_*" back to themselves (this would be used where a control is part of a group and selecting one control needs to deselect all the others)
  • Any event will be forwarded - note you have to supply this in the format =
  • The command sent is then reconstituted <command>=<value>

Debugging

Connection activity may be debugged at runtime by right clicking on the dialog and selecting menu option. This option is only available where there are some connections configured (for efficiency "signals" of controls of each dialog are not automatically connected to the connections engine)

Right click debugging options at runtime are only available if the CC_DEVELOPER environment variable is set to true (use the bncs_inst_env.exe tool to set this).

Selecting Sender or Receiver cells within the connections dialog will select all those controls that match. Where wildcards are used multiple controls may be selected.

When to stop using connections

UI connections are really useful for joining together high level UI components but aren't the answer to everything.

Daves handy tip is to stop using connections if you start having to create separate connections for each state of an event not just wiring the event up to the command of something else.

A Word Of Caution - Reserved Characters

In using wildcards and text replacement this mechanism isn't very good if the values you need to pass contain things like asterisks or square brackets in the data itself.

Developers note

The connections editor has certain limitations..... This editor is based on the Qt table which is OK but not fantastic...this makes this editor occasionally tedious to use....sorry.


File->New

Templates

The list of dialog templates in the File->New dialog is set by the files contained in the following subfolder:

config\vised\templates

so if your system root is c:\bncs then you'll find 'em here:

c:\bncs\config\vised\templates

These are just entirely normal BNCS UI files - if you need some more templates just copy a file to this folder and give it an appropriate name.

Note: The visual editor won't let you edit them direct from this location....

If there is a png file of the same name as the ".bncs_ui" file then this will be loaded as the icon. If not then a default is displayed.


Import Settings

Description

This is a means of importing settings from an external data source to configure controls on a UI.

This is intended for when you have very many controls that you have to target at different things - whilst you can manually go round opening the properties editor, changing the settings and then opening the next editor this can be tedious and error prone.

For example - take this trivial example:

The first column is the ID of the control we want to set, then there are three separate settings for each control for text, and text/background colour.

You simply copy this to the Windows clipboard - it gets copied from Excel as tab delimited text.

On selecting the Import Settings this dialog appears - it's a preview of the data that's been loaded:

This shows us the controls that we are importing data for and the settings that's going to be applied to each one.

Hitting OK will write the settings displayed to the controls listed and then leave the controls affected selected on the dialog.

If there is no control of a particular name then a message is displayed to that effect.

Note: The values sent are entirely free-form - this means that it's entirely up to the controls whether they understand the commands being sent. No error is shown if a control didn't understand a command - though it's usual to see a message in the debug output (using dbgview.exe for example).

The param=value pairs are all defined separately for each control - go and look in the documentation for that control for help.


Manual Settings

Description

This is a means of manually entering settings to apply to all the selected controls.

Here's an example:

Of the controls selected they'll all receive each of the settings entered into the dialog.

Note: The values sent are entirely free-form - this means that it's entirely up to the controls whether they understand the commands being sent.


manualSizePosition

Manual Size/Position Dialog

Description

This is a means of manually entering size or position for one or more controls.

Here's an example:

Where settings are consistent between all the controls selected then those values are displayed in the size/position dialog. Where settings are different is displayed to indicate this. In the example above the controls are all the same size so the values 100/40 are shown for this. They're also aligned on the left edge - so the X value is the same, so the value is shown. As they're in a column the Y position is different for each control so this dialog can only show .

So in this example if you wanted to set the size of these controls to 30 pixels high then you'd enter 30 in the H value and hit OK - this then resizes just the height of the controls.

The result is:

The height, and X Y position of the controls is not changed.

In this example there are no shared values - size and position is different on each control:

So to line them up neatly at the top, whilst making them a consistent size we would overwrite the entries for Y, W and H:

and this would be the result:


bncs_deferredCopy

Description

bncs_deferredCopy.exe is a simple application to rename a predetermined list of files.

Command Line

The command line of this application is used to determine whether it has been run by hand or invoked by workstation manager. There is nothing you can sensibly do running it by hand so the app will throw up a message and exit.

Configuration

This application uses a configuration file written by another application (bncs_filesync.exe) as a list of the things it needs to copy. This is defined when the file sync step fails.

The configuration is created/destroyed on the fly - you should never see it, or have occasion to examine or create it. The file itself is:

%CC_ROOT%\%CC_CONFIG%\config\deferredUpdate.ini

The format of this file (for what it's worth) is:

DeferredUpdate]
Index_n=<existing file>;<replacement file>;<iso formatted date of replacement file>

where n is an ever incrementing integer in sequence - first break in the sequence stops the reading of the file. The fields are semi-colon delimited.

It might be that a file just needs deleting - in which case only the first parameter is defined - the second two may be omitted.

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown


bncs_ws_man

BNCS Workstation Manager bncs_ws_man

Introduction

This document describes the start-up procedure for a BNCS Runtime machine (i.e. a machine that is either client or driver).

This procedure is based around the Workstation Manager but other external applications are called by it.

Workstation Manager

Usually this application would be run from a Start Menu->Startup shortcut.

Its purpose is to manage the machine – run and shutdown other applications, and update code and configuration on that machine.

Workstation Manager runs for the entire time that BNCSl applications are running.

It also has the opportunity to confirm correct installation such as environment variables etc. and do a daily deletion of old files.

From version 4.5.6.0 the status of the applications run by workstation manager will also be maintained and notified to a central workstation tracker application.

From version 4.5.6.0 Workstation Manager provides a number of “test program” options, allowing come modification of the normal start-up sequence.

Test Program Options

There are a number of “Test Programs” available, which allow changes to the following parts of the launch sequence.

  • Stop all programs
  • Clear the Launcher dialog
  • Synchronize from the server (if one is configured)
  • Load the Launcher
  • Start any programs as configured

Workstation Manager In Use

Figure 1: Workstation Manager Running shows Workstation Manager in use.
The upper part of the display, within the Status frame, is referred to here as the Launcher.
Each line represents one application configured in launch.xml

Figure 1: Workstation Manager Running

Status Column

The Status column indicates the current state of each application.

Running

The application has been started, either automatically or manually.

Not-Starting

The application has been configured not to auto-start, and has not been started manually.

Queued

The application has been configured to auto-start, but has not yet started. Or it has been stopped.

Stopped

The Stopped status appears briefly when an application is stopped manually. It is then replaced with either Queued or Not-Starting, according to its auto-start setting.

Crashed

The application has crashed. There are variations on this message according to whether or not the application is set to restart.

Last Event Column

The Last Event column shows a message indicating the most recent event.

Launcher Buttons

Applications may be selected using this mouse within the Launcher window.
Shift-click may also be used, to select a range of items.
Ctrl-click may also be used, to select multiple individual items.

Start

Start the currently selected applications.
This button will be disabled if none of the currently selected applications are running.
This action takes no notice of the auto-start settings for applications. It will attempt to start them even if auto-start is off.

Stop

Stop the currently selected applications.
This button will be disabled if all of the currently selected applications are already stopped.

Go From Here

Starts any application that is not currently running and has auto-start set, from the currently selected application to the end of the list.
This option is only available if only one application is selected, and there are applications later in the list that are not running but do have auto-start enabled.

Go Selected

Starts any selected application that is not currently running and has auto-start set.
This option is only available if there are applications selected that are not running but do have auto-start enabled.

Main Buttons

The buttons in the lower part of the display are the main overall controls.

Stop all

  • Stops all applications
  • Clears and deletes the Launcher

Restart All

  • Stops all applications
  • Clears and deletes the Launcher
  • Reloads the Launcher
  • Attempts to start all applications that are set to auto-start

Resync & Restart

  • Stops all applications
  • Clears and deletes the Launcher
  • Preforms a file-sync if there is a server configured
  • Reloads the Launcher
  • Attempts to start all applications that are set to auto-start

Context Menu

Right-clicking on any application item will show the context menu.
Most of the entries are the same as the Launcher Buttons, with the following additions.

Set Auto-Start

Sets the auto-start property to true
This is only available if one or more of the selected applications has auto-start set to false.

Set No Auto-Start

Sets the“auto-start property to false.
This is only available if one or more of the selected applications has auto-start set to true.

Difference between Start and Go?

The Start and Go actions have a couple of differences.
The most obvious is that Start will attempt to start on any application, but Go will only do so if the application is set to auto-start.
The less obvious difference is that Start will act on all the applications almost simultaneously, but Go will be much clearer about starting them in order. An application will only be started when the previous selected one has reported to Workstation Manager that it is running. This is the same logic that is used by the program start functionality triggered by the Restart All or Resync & Restart buttons, or what the program does on a normal start-up.

Startup Sequence

The start-up procedure of workstation manager is shown below.

startup
Figure 2: Workstation Startup Sequence

Batch files

None of the batch files noted need to exist in order to run a system – if they don’t exist that step is simply skipped.
These batch files are located in %CC_ROOT%\%CC_SYSTEM%\windows\bin.
None of the batch files listed should contain any entries that might cause them to stop responding e.g. waiting for user input, or use of a “pause” command. If they do workstation manager will be seen to pause indefinitely waiting.

presync.bat

This batch file can be used for any purpose (not that I can think of a sensible one at the moment….).
Note: this file is copied off the server along with everything else but has already been run before any updated version is copied by the filesync. A workstation must be restarted twice for an updated presync.bat to be run.

postsync.bat

Following completion of the file sync process a post-sync step tidies up the copy, moving files to their correct locations (e.g. to the windows directory for those applications that need it). This may be used to move BNCS V2 files that must exist in the Windows directory.
A common entry for this batch file is to copy workstation specific settings from their server location to the workstation location. For example every workstation has a “bncs_system.ini” file – to be stored on the server this must be stored in a directory for each workstation (you can’t have 999 copies of a file of the same filename otherwise). The postsync.bat file moves this file so that it appears where applications expect to find it.
The following example is a generic postsync.bat entry:

xcopy "%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\%CC_WORKSTATION%\bncs_system.ini" "%CC_ROOT%\%CC_SYSTEM%\CONFIG\system" /c/i/f/y

Note the use of not only the system root/path environment variables but also the CC_WORKSTATION environment variable in the path. So for a CC_ROOT of “c:\bncs”, and a CC_SYSTEM of “v4.5” for workstation 100 the copy would be from:

c:\bncs\v4.5\config\ws\100\bncs_system.ini

to

c:\bncs\v4.5\config\system\bncs_system.ini

It may be that there is a workstation specific post-sync step that should be run and this can be achieved with a line like:

“%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\%CC_WORKSTATION%\wspostsync.bat”

for tidiness however this is usually preceded by a check to see that this file exists before running it so the full (if slightly messy entry) would be:

IF EXIST “%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\%CC_WORKSTATION%\wspostsync.bat” CALL “%CC_ROOT%\%CC_SYSTEM%\CONFIG\WS\%CC_WORKSTATION%\wspostsync.bat”

nosync.bat

If this machine is running in stand-alone mode then this generic batch file is run.

File Sync Manager (bncs_filesync.exe)

This attempts to synchronise the file structure on this machine with the file server. This is a proper synchronise, deleting files that do not exist on the server. It’s important to remember that this is a synchronise process not just an update. This is particularly important if you are a developer wanting to run workstation manager - see below.
There is a list of directories that are excluded from the sync process because they contain workstation specific, temporary or redundant data.
The excluded directories are:

  • source
  • temp
  • docs
  • data
  • install
  • backup
  • logs

Move Settings

This is where workstation specific settings that may have been overwritten by files copied off the server are corrected.
Hardware (this PC) settings are stored in %CC_ROOT%\local_settings.ini which is outside of the directory structure that is synchronised with the server.
The settings currently moved are:

Setting | From | To
Adaptor Number | File: local_settings.ini Setting: [Network] DefaultAdaptor=x | File: csi.ini (in windows dir or config location specified in V3 “c:\bncs_config.ini”) Setting: [Network] DefaultAdaptor=x File: BBC_NBIF.ini (in windows dir) Setting: [NetBIOS] Adaptor=x File: BBC2NBIF.ini (in windows dir) Setting: [NetBIOS] Adaptor=x File: bncs_system.ini (in current system config\system dir) Setting: [Network] DefaultAdaptor=x
Workstation Number | Environment Variable: CC_WORKSTATION | File: csi.ini (in Windows dir or config location specified in V3 “c:\bncs_config.ini”) Setting: [Network] Workstation=99 File: bncs_system.ini (in current system config\system dir) Setting: [Network] Workstation=99

Environment

For compatibility reasons, workstation manager also creates the following environment varaibles, but only if they're not already set

Variable | Notes
OSPL_URI | Adlink/PrismTech DDS can only work if this variable is present so this is set to the full path of config\dds\ospl.xml
ADLINK_LICENSE | Adlink/PrismTech DDS can only work if this variable is present so this is set to the full path of config\dds\license.lic

Running Workstation Manager as a Developer

Normally a workstation knows nothing about anything and has to get it’s configuration off the system server. This is fine since the system server always has the current or latest system configuration.
As a developer however you might easily have a different configuration on your machine – with many later files. In this case workstation manager can be set to work in “Stand alone” mode by setting CC_ROOT and CC_SERVER_ROOT to the same value (this can be done with the bncs_inst_env utility)

Updating Workstation Manager and File Synchroniser

The problem with leaving bncs_ws_man in charge of launching everything is that the file synchroniser can’t update the workstation manager or itself (or DLL dependencies).
Version 4.5.19 updates the mechanism used so that workstation manager/file sync/DLLs can be updated without a reboot. This requires the utility bncs_deferredCopy.exe – this logs it’s activity to /logs/bncs_deferredCopy.
The process for bncs_deferredCopy is this:

  • The file copying application will fail to copy in-use files and so makes a log of those it had a problem with.
  • Workstation manager notes the error code from the file copying application and runs the deferred copy application – as it does so ws man exits so freeing up in-use files.
  • The deferred copy application tries up to 20 times to copy the files listed in the log (over a period of about three minutes to allow for slow-to close applications). Usually the files copy in a very few seconds.
  • The deferred copy application, on success or failure re-runs the bncs_ws_man application.
    To save update loops if the deferred copy application is run 5 times consecutively with errors it won’t run again – it does however fall back to the original update mechanism (described immediately below). Subsequent successful file copy operations resets this count.
    Default step is included in bncs_ws_man which it checks the time/date of an installer program CC_WS_Manager_Update. If there is a new version detected of this application then it is run. CC_WS_Manager_Update is an Inno-Setup installer application that is configured to be entirely automatic and will reboot the machine so that the workstation manager and file synchroniser can be replaced.

Launching applications

When the file sync is complete, bncs_ws_man.exe then runs applications directly.
Here’s a sample launch file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE instances SYSTEM "launch.dtd">
<launch>
    <workstation id="1" csi="csi32" >
        <application name="v4infdrv" workingdir="" arguments="123" />
    </workstation>
    <workstation id="2" csi="csi32" rebootoncrash=”true” >
        <application name="v4infdrv" workingdir="" arguments="123" />
    </workstation>
    <workstation id="99" csi="csi32" >
        <application name="v3infdrv" arguments="1" />
        <application name="v3infdrv" arguments="2" delay="2000" waitForIdle=”30000”/>
        <application name="myApp" workingdir="c:\" arguments="4" delay="100" />
        <application name="docrash" arguments="auto" restartoncrash="true" />
    </workstation>
</launch>

Every workstation on a cluster uses the same launch file and the workstation number is used to identify the section. There are three workstations listed in the above launch file, 1, 2 and 99. Workstation number is taken from the CC_WORKSTATION environment variable.
CSI is taken to be such a core component that this is run regardless. No separate entry is required in the following section – nor is it allowed. CSI must be allowed to fully run up before any other apps can start so there is special checking to ensure that this happens.
Each line is then interpreted running each application in turn.
Let’s pick apart a single entry:

<application name="app" workingdir="c:\" arguments="4" delay="100" restartoncrash="true"/>

name: This runs an application called “app” this is assumed to be “in the path” and normally %CC_ROOT%\%CC_SYSTEM%\windows\bin. Explicit paths can be set but that’s kinda missing the point of having all under one tree with relative paths to make the tree portable.
workingdir: (optional parameter) the working directory for each application can be independently set. From version 4.5.26 environment variables are expanded appropriately.
arguments: (optional parameter) the argument(s) is a space delimited set of parameters. Note that spaces are not permitted in individual arguments even if they’re quoted (this is a bug).
From version 4.5.26 environment variables are expanded appropriately.

delay: (optional parameter) You can set a delay of how long to wait (in mS) before trying to launch the next application in the list. Think of this as a “settling delay” for this application.

waitForIdle: (optional parameter - from ws manager 4.5.17) this is a Windows function call that waits for an application to initialise before continuing. The value here is the maximum time in milliseconds to wait before carrying on regardless. Drivers will often start well before the timeout allowing workstation manager to continue - this is therefore preferable to using fixed delays. The waitForIdle delay can be safely set to a large value but (almost certainly) won’t delay the normal launch of the applications.
You’d normally use this value or the delay value but if you want to use both that’s ok too!
restartoncrash: if “true” then workstation manager will catch crashed programs and attempt to restart them up to 10 times. This is only suitable for especially adapted applications that are set to silently crash, logging errors to disk and not putting up dialogs. This option is not suitable at all for 16 bit applications.

Other Attributes, for Testing

There are other attributes that may be used in the workstation and application elements, generally for testing purposes.

Workstation Attributes

Name | Values permitted, or type, and default | Description
autostart_csi | “true” or “false” If absent, a value of true is assumed. | Controls whether csi will be started automatically on this workstation, using settings from the workstation element. Since nearly all BNCS applications need to connect to CSI to run it is assumed that if this attribute is set to true it is because CSI is being run manually, separately from the Workstation Manager.
autostart_ws | “true” or “false” If absent, a value of true is assumed. | Controls whether any of the applications will be automatically started. If set to false, the Launcher will be set-up based on the contents of launch.xml, but no applications will be started automatically. They may then be started manually using the context menu, or the Start button.

Application Attributes

Name|Values permitted, or type, and default|Description
autostart|“true” or “false”
If absent, a value of true is assumed.|Controls whether the application will be started automatically on this workstation, using settings from the application element.
Setting autostart to “false” will cause the application not to be started, but it will ramain present in the list. It may then be started manually using the context menu, or the Start button.
Csi|Csi program name, eg “csi32”, “v4csi”, “v2csi”|This should only be used here if it is required that csi is not started as a result of an attribute in the workstation element.
In that case the workstation element’s csi attribute should be set to “none”, or set blank or deleted.

Since nearly all BNCS applications need to connect to CSI to run they will not start if CSI has not been started. Hence it is assumed that if the autostart_csi attribute is set to true, CSI is being run manually, separately from the Workstation Manager.

Starting CSI from an application element, not from workstation

In some circumstances it may be necessary that CSI is not the first application to be started; perhaps CapLog should be started first. To do this it is necessary to indicate that the workstation element does not imply that CSI should start. This is done by the following changes

  1. Set the workstation’s “csi” attribute to “none”, or remove it. This will stop csi being started using information from the workstation element.
  2. In the application element, set the “name” to “csi”. This will cause the application handling to be set to be csi-specific and slightly different from other applciations.
  3. In the application element, add a “csi” attribute with its value set to the required csi application name – “csi32”, “v4csi” etc.

Configuration Editor

Note that these new features (ie Test Programs and new attributes) are not currently supported by the Configuration Editor plug-ins. These must be edited by hand. They are likely to be lost if launch.xml is edited using the Configuration Editor.

Rebooting the machine on CSI crash

From version 4.5.1.0
On CSI crashing workstation Manager can be configured to restart the workstation. This requires
rebootoncrash=”true”
to be configured in launch.xml for the CSI entry. (Note this is rebootoncrash not restartoncrash)
e.g.

    <workstation id=”2” csi=”v4csi” rebootoncrash=”true” >

Setting CC_DEVELOPER environment variable to true will disable this restart feature and put up a dialog box instead.
The first reboot attempt is “clean” in that workstation manager will wait for applications to close before restarting.
Subsequent reboot attempts are “unclean” in that they forcibly try and restart this workstation. This is so unattended workstations will reboot even if left in an unsuitable state. These attempts occur every 20 seconds following the first attempt.

Command-Line Options

Workstation Manager has a couple of command-line options available to control how the program acts when started.

-test

The –test option causes the program not to do anything at startup. No configuration is loaded, nor programs run.
This leaves it in essentially the same place as at the end of a Stop All sequence.

-load

The –load option causes the program to resync and load the launch configuration but not to start any programs.

resync/restart

Running an instance of bncs_ws_man even if one is already running with this command line will cause it to be signalled to resync and restart

Test Programs

A number of Test Programs are available from the “Programs” menu. These allow changes to the following parts of the launch sequence.

  • Stop all programs
  • Clear the Launcher dialog
  • Synchronize from the server (if one is configured)
  • Load the Launcher
  • Start any programs as configured

Stop All

Stop any currently running programs.
Clear the launcher.
(Finishes with all programs stopped)

Restart All

Stop any currently running programs.
Clear the launcher.
Reload the launcher from launch.xml.
Start any programs configured to auto-start.
(Finishes with all auto-starting programs started)

Resync & Restart

Stop any currently running programs.
Clear the launcher.
Resync from the server (if one is configured).
Reload the launcher from launch.xml.
Start any programs configured to auto-start.
(Finishes with all auto-starting programs started)

Stop without Clearing Launcher

Stop any currently running programs.
(Finishes with all programs stopped)

Stop (if running) and Reload Launcher

Stop any currently running programs.
Clear the launcher.
Reload the launcher from launch.xml.
(Finishes with all programs stopped)

Stop (if running), Resync and Reload Launcher

Stop any currently running programs.
Clear the launcher.
Resync from the server (if one is configured).
Reload the launcher from launch.xml.
(Finishes with all programs stopped)

Restart without Reloading Launcher

Stop any currently running programs.
(Don’t consider synchronizing , clear or reload the launcher)
Start any programs configured to auto-start.
(Finishes with all auto-starting programs started)

Closing down

On closing down bncs_ws_man.exe it will attempt to close down all applications that it has launched.

Logging

This application logs all interesting activity in: %CC_ROOT%\%CC_SYSTEM%\logs\Workstation Manager

Deleting Logs

This application can be configured to delete old files if required, the configuration for this is in logdelete.xml, an example is shown here.

<?xml version=”1.0” ?>
<!DOCTYPE logdelete SYSTEM “logdelete.dtd”>
<logdelete>
    <workstation id=”global” enable=”true” daysback=”24”>
        <dir name=”c:\bncslogs/>
    </workstation>
    <workstation id=”10” enable=”true” default=”false” daysback=”24”>
        <dir name=”c:\bncslogs/>
        <dir name=”blah”/>
    </workstation>
</logdelete>

There is an entry for each workstation, if that entry does not exist for a workstation the global entry is used instead. It is expected that most installations will only require the global entry.

To enable log deletion the “enable” setting needs to be set to true. When enabled all files in the default and configured directories will be deleted if they have not been modified within the number of days back specified in “daysback”.

The default directories are the current system “logs” directory and the directories used by caplog. The caplog directories are determined by looking at the caplog.ini file in the windows directory and the directory indicated in “c:\bncs_config.ini.” If you want to ignore the default directories set the optional parameter”default=false”.
Additional directories can be listed as required. If these directories are not absolute paths they are assumed to be in the current system and will have the values of CC_ROOT and CC_SYSTEM pre-pended to them.

Workstation Monitoring

From version 4.5.6.0 workstation monitoring has been introduced, this has the ability to report to other systems the status of the applications. Note that the status is running or not, it does not include loss of comms. As part of this the workstation can also be remotely stopped and restarted, the restart also includes doing an update.
Within the information sent by workstation manager is a text string, if this is set on the server to a known value once a workstation has successfully updated the string will be sent to the workstation tracker to confirm the update.

Configuration

If there is no configuration for this the system will work without the monitoring.
In instances.xml there needs to be an entry for “workstation_tracker”, the device number set here is what defines which device ini file is used to configure the monitoring as well as the separate workstation tracker application.
In the device ini file there is a section as detailed bellow.

Key | Entry
[WSTracker] | Section header
port=65508 | Tx port used. Rx port is this plus 1.
Updateperiod=15 | Time period between sending updates
main_server=192.168.1.123 | IP address of the main workstation tracker. Note to use broadcast messages use the relevant broadcast IP, i.e. 192.168.1.255.
reserve_server=192.168.1.124 | IP address of the reserve workstation tracker.
WS_Man_Text=build123 | Text string that can be set to confirm update. This should not contain the ‘

Network messages

To allow other applications to interact with this the networking is described, it is however primarily designed to be used with the workstation tracker application.
From the workstation manager the messages are in the format:-

[CSI_channel]|[Workstation]|[Status]|[StartTime]|[WS_Man_Text]|[User]|[OS]
Item | Example | Description
CSI_Channel | 0 | CSI channel number for the current system
Workstation | 123 | Workstation number (environment variable)
Status | 2 | integer as per the infodriver presentation.
StartTime | 123453 | Workstation manager start time in seconds from 1/1/1970 (QT see QdateTime::setTime())
WS_Man_Text | CCM_tag4 | Text set in an ini file to identify the build
User | cc_runtime | User logged on to the machine
OS | v5.1 SP2 | Version of Windows reported by the operating system

This message is sent on the port defined in the device ini file.
To the workstation manager the messages are in the format:-

WS[workstation]-[action]-[delay]
Item | Example | Description
Workstation | 123 | Workstation number (As confirmation message sent to correct WS)
action | stop | Action to be done, options are:- stop start restart
delay | 100 | Delay before re-starting, for a single workstation restart this will be set to 0. For other commands this is not required. This message is sent on the port plus 1 defined in the device ini file.

Document Version Control

Version | Date | Author | Comments
0.0 | ??/??/2004 | DGY | Original bncs_ws_man documentation from which this derives
0.1 | 09/05/2007 | MB | First Draft
0.2 | 21/11/2007 | MB | Added workstation monitoring.
0.3 | 22/11/2007 | MB | Updated to software version 4.5.6.1
0.4 | 27/11/2009 |  | Removes duplicate of version information
0.5 | 07/01/2010 | RK | Added mention of autostart attribute.
0.6 | 01/03/2010 | RK | Added other new attributes. Added “Test Programs” and explanations.
0.7 | 13/10/2015 | DGY | Adds note on resync/restart command line option
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions

Software Version Control

Version | Date | Comments
1.0.0.1 | 23/02/04 | First Versioned release
1.0.0.2 1.0.0.4 |  | dev versions not released..
1.0.0.5 | 22/03/04 | now includes version in titlebar
1.0.0.6 | 25/03/04 | moves adaptor number from %CC_ROOT%\local_settings.ini to 4 other relevant files
1.0.0.7 | 03/08/04 | ADDS ICON changes from QDialog to QMainWindow adds single instance
1.0.0.8 | 16/08/04 | adds workstation number to settings that are moved from V4.5 master location displays launch as QListView adds status to QListView adds ability to stop/start from QListView adds disklog of activity (not all starts/stops)
1.0.0.9 | 17/08/04 | removes case sensitivity of CC_SERVER_ROOT and CC_ROOT checking.
1.0.0.10 | 12/11/04 | changes CSI finder from SendMessage to SendMessageTimeout
4.5.0.0 | 011204 | rebuilt for synergy
4.5.1.0 | 110705 | adds rebootoncrash flag to CSI
4.5.2.0 | 220905 | adds splash on updating ws mgr
4.5.2.1 | 011105 | fixes count down on splash
4.5.3.0 | 031105 | option changes to bncs_filesync for updated version added extra logging change to make CC_WS_Manager_Update work correctly when it hasn't been run before added buttons to start / stop selected applications tidies up processes (so that they get deleted when finished rather than when ws_mgr shuts down) process stack now filled when procs are created rather than when they start (used to add same proc multiple times if started multiple times)
4.5.4.0 | 071105 | make ws mgr pass correct command line parameters to filesync (knock on from a change in that application)
4.5.4.1 | 081105 | logs nosync.bat output uses selection changed signal from launch listview rather than clicked adds logging of "NOT started" application fail messages
4.5.4.2 | 171105 | first run of workstation manager will now always run the workstaion update mechanism it's not possible to guarantee that the installer used on a workstation contains the latest version so an update / reboot is the only way of ensuring that things are up to date
4.5.5.0 | 170806 | Added the logdelete to this application.
4.5.6.0 | 201107 | Added the workstation tracker/restart to the application.
4.5.6.1 | 201107 | Fix to prevent network stop/start doing multiple starts.
4.5.6.3 | 271107 | Change to use seperate sockets for Tx and Rx to make more reliable and restart now stops immediatly then waits to start.
4.5.6.4 | 281107 | When no config is present now reports an error and will restart properly. bncs_config cache cleared.
4.5.7.xx | 170409 | fixes double allocation of txSocket (handle leak) - changes versioning so that auto-build number can be used
4.5.8.xx | 271109 | adds a bit of colour to the launch status dialog (bit of simple QListViewItem overloading.....
4.5.9.xx | 010310 | Adds comprehensive implementation of auto-start and "Programs". Also multiple selection of applications and appropriate extra buttons and context menu entries. *** this version did not make it into the resources for this applcation ***
4.5.10 | 180310 | fixes casting errors to stop crashing and link multiply defined symbol errors
4.5.11 | 180310 | different fix to casting errors
4.5.12 |  | Added disk-log of successful application starts. Fixed naming of Stopped apps in the list.
4.5.13 | 140910 | Fixed crash using Workstation Tracker to Re-Start all. Also - Workstation Tracker normal restart changed back to doing Restart with Resync.
4.5.14 | 270910 | Fixed handling of "delay" attribute.
4.5.15 | 121110 | Fixed inability to start if there's no nosync.bat or postsync.bat.
4.5.16 | 240113 | Adds Windows 7/8 and server variants to workstation tracker text - adds default handling to unknown versions (might cope with future upgrade better )
4.5.17 | 121213 | Now uses an old V3 launch trick (if configured) of "wait for input idle" so that apps that take an age to start up can be monitored and wait for launch (noting though that this stalls workstation manager as well) Slightly nasty fix required to scope of bncs_disklog so that the scope of one logging function doesn't block a second call from opening the file
4.5.18 | 030214 | minor changes to allow VS2013 build
4.5.19 | 250314 | changes mechanism by which in-use files are updated (see bncs_deferredCopy)
4.5.20 | 270314 | adds singleton messaging so that you can "run" workstation manager telling it to restart/resync which'll force a running ws man to do just that
4.5.21 | 280414 | adds Windows 8.1 version info
4.5.22 | 151414 | now creates well-known dirs at startup (some apps really are stupid enough to need someone else to do this for them)
4.5.23 | 190215 | moves workstation number and network adaptor to the csi.ini in windows OR wherever specified by the c:\bncs_system.ini location
4.5.24 | 050515 | Changes icon (no functional changes)
4.5.25 | 110615 | makes start/stop buttons double height for ease of operation on a touchscreen
4.5.26 | 220615 | resolves environment variables used within program arguments as well as working directory
4.5.27 | 191015 | corrects wsman icon (removes original one from the project to stop Windows finding and using it)
4.5.28 | 111116 | minor change to the way applications are stopped, with commented out code that would force the stop (to prevent update failures later on). however I'm not happy that this is desirable since there's no UI activity all all to show what's going on
4.5.29 | 150517 | adds Win 10 to Win 8 definition (see help on OSVERSIONINFOEX structure to understand why) and adds Win10 handler for if and when we sort manifests
4.5.30 | 290917 | adds setting of OSPL_URI (if doesn't exist) to keep PrismTech DDS happy
4.5.31 | 031017 | corrects version number in title bar not product version
4.5.32 | 041017 | Adds arguments to csi launch entry so that DDS CSI can accept command line arguments
4.5.33 | 041017 | Finally fixes issue with argument lists that have spaces in (these may now be quoted with double-quotes)
4.5.34 | 250118 | Adds path to Adlink/PrismTech license file
4.5.35 | 240518 | Captures the code for, and then disables the feature, for a tool bar with "open cmd window" and vised/caplog/netviewer whilst I consider this is a good idea


configuration

CSI Documentation

CSI32 Configuration

Introduction

Configuration is held in a conventional Windows "ini" file. The location and name of this file is different depending on the type of system in which CSI32 is deployed - this is a hang-over from the different versions of CSI from which CSI32 is derived.

The table that follows describes what the configuration file is called and where it is located - this list is in order of priority. i.e. if the V4 environment variables are present then this path will be used in preference to the V3 or V2 path.

System | File | Path
V4 | bncs_system.ini | %CC_ROOT%\%CC_SYSTEM%\config\system
V3 | csi.ini | ConfigPath specified in "c:\bncs_config.ini"
V2 | csi.ini | Windows directory (usually c:\windows for Windows XP or c:\winnt for Windows 2000)

Optimum csi.ini/bncs_system.ini file

The trouble is....with so many settings it's hard to define what's the "best config". Here's the (author's version of the) best settings: bncs_system.ini

Changing Configuration

CSI32 has a menu item (Config->EditConfig) to open the default editor for the "csi.ini" or "bncs_system.ini" file. Which file is opened is dependent upon the system type detected.

Configuration changes almost always require a restart of CSI32, though some parameters are available as menu items which may be changed on the fly without a restart and which also modify the appropriate configuration file.

Configuration Parameters Defined

Section / Entry / Default | Description
[Window] |
Xpos=0 | The last saved X position of the maximised CSI main dialog box. This is saved every time the dialog box is moved.
Ypos=0 | The last saved Y position of the maximised CSI main dialog box. This is saved every time the dialog box is moved.
[Network] |
Workstation=0 | The workstation number for this machine for V2/V3 systems. V4 based system have workstation number as an environment variable
DefaultAdapter=0 | Netbios adapter number
Channel=0 | Sets CSI to use the indicated channel. This can be used to isolate BNCS systems running on the same network. Channel numbers 0 to 99 are valid.
NetworkEnable=1 | 0 = CSI will run but not attach to the network. A loop back adapter is force on. 1 = CSI will attach to the network as usual. This is the default value.
CSIEnable=1 | Prevents CSI from operating. This is a security function manipulated by the Network Manager application
SessionEnable=1 | If set to 1 sessions are enabled. if set to 0 they are disabled. This item can be toggled from the CSI menu bar.
ClientEnable=1 | If set to 1 CSI will allocate network buffers for receiving revertive information and permit clients to connect to it. if set to 0 network control blocks are freed and clients are denied access This item can be toggled from the CSI menu bar.
DriverEnable=0 | If set to 1 CSI will allocate network buffers for receiving command information and permit drivers to connect to it. if set to 0 network control blocks are freed and drivers are denied access This item can be toggled from the CSI menu bar.
ClientBuffers=20 | The number of network control blocks to be assigned for revertive messages.
DriverBuffers=4 | The number of network control blocks to be assigned for command messages to drivers.
SessionBuffers=8 | The number of network control blocks to be set aside for session purposes
 | Note: ClientBuffers + DriverBuffers + SessionBuffers should not exceed 32. The total is checked at startup and will flag an error if more than 32
SecBuffEnable=1 | REDUNDANT - CSI32 hasn't got (and doesn't need) secondary buffering.
TerBuffEnable=1 | REDUNDANT - CSI32 hasn't got (and doesn't need) secondary buffering.
LoopbackEnable=0 | If set to 1 it allows CSI to see revertives form its local machine if that machine has been detached from the network and as a consequence windows has disabled the network adapter.
HWMBufferFlush=1 | REDUNDANT - CSI32 hasn't got (and doesn't need) secondary buffering.
HWMCacheFlush=1 | REDUNDANT - CSI32 hasn't got (and doesn't need) secondary buffering.
HangUpDelay=1500 | Session hang up delay timer (mS)
V1Compatibility=0 | If set to 0 it prevents CSI from sending V1 compatible message packets out by default. This cuts down the loading on the network if V1 messages are not used. V1 messages are not picked up on CapLog so you may not be aware of them being generated and hence loading your network. V1 packets will always be received and decoded if they are present on the network.
TempFilePath=C:\csi_temp | The path to be used for storing temporary files used during sessions
KeyFilePath= | Path to use for the bncs_key.dat licence file. If this path is not specified then the working directory of CSI32 is used
SendPacketSerialNumbers=0 | Whether to send "revertive" packet serial numbers.
SendCommandSerialNumbers=0 | Whether to send command packet serial numbers
ClearCacheOnNetClose=0 | Whether to clear the revertive cache on a driver closing (and sending NC message).
ClearCacheOnPacketError=0 | Whether to clear the cache if we detect that we've missed packets from a particular workstation and cannot rely on cached data for devices that workstation hosts.
DistributeBBC_NETTXRXSTATUS=1 | Whether to distribute the internal message BBC_NETTXRXSTATUS to all clients on reception of a network 'N' message. If you don't use this (ApplCore line 32400 handling) then turn it off. Distributing 'N' message notifications to all clients even if none are interested is inefficient. Even with this distribution disabled by this setting you can still selectively register using BBC_NETTXRXSTATUS_REG
DistributeBBC_NETMSGUPDATE=0 | Whether to distribute the internal message BBC_NETMSGUPDATE to all clients on reception of a network 'N' message. Distributing 'N' message notifications to all clients even if none are interested is inefficient. Since ApplCore doesn't use this the default is zero. Even with this distribution disabled by this setting you can still selectively register using BBC_NETMSGUPDATE_REG
HeartbeatEnable=0 | Whether to send heartbeat messages - heartbeats contain workstation information (uptime) and driver information (txrx state).
HeartbeatTimeout=60 | How often in seconds to send heartbeat messages. Heartbeats are sent both to clients and to drivers and this value is the total period to send to either. Messages sent to clients/drivers are interleaved so for a machine with clients and drivers enabled the effective period is half this value.
StatusChannelEnable=1 | Whether to send status channel messages - these are 6 packets/minute usually picked up by the BNCSSTAT application. If you don't use BNCSSTAT or are using heartbeat monitoring instead then you can disable status channel
DevIniMustExistForV2=0 | This controls whether the existence of a DEV_xxx.INI file controls the sending of commands. There's historical gotcha in that a missing DEV_.xxx.INI file for device xxx controls whether commands are sent in individual packets, or buffered and sent in as few packets as possible. The default for this setting is not backwards compatible but is optimised for best performance.
[Cache] |
CacheEnable=1 | If set to 1 then caching is enabled. If set to 0 it is disabled
CacheSize=8192 | This is the largest amount of RAM in KB that CSI will allow to be allocated for a cache. A value of 8192 permits all devices to be cached. A value of 1024 (the old default for this setting) only allows only 100 of the 999 devices possible to be cached.
CacheLife=10 | This is the life in minutes that the cache for a driver Id within CSI will remain valid without a "revertive" message being received for that Id. A value of zero sets cache life to be infinite (i.e. never expire).
CacheFilePath=C:\ | The InfoDriver cache is stored on the hard disk to conserve RAM. This parameter sets the path to the files
PeerPollRefresh=0 | Whether we decode and interpret poll responses meant for another workstation. The received value is compared against any cached value and if different passed up to our clients as if it were change of state. Turning this feature on also generates logs since differences between received values and cached values can indicate a fault.
UseMemoryCache=1 | Whether infodriver cache is written to disk (UseMemoryCache=0) as it always was or stores infodriver revertives only in memory (UseMemoryCache=1)
[LogFile] | The facility was removed in version 1.16.07 when CapLog was introduced
LogFileEnable=0 | If set to '1' the logging function will be enabled the next time CSI is started
LogFile=C:\CSI_LOG.TXT | The path and filename to the log file
MaxLogFileSize=5 | This the maximum size in MB for the log file. If writing to the log file would cause the file size to be exceeded it will be closed and no further writes will take place
[TimeServer] |
TimeServerEnable=0 | If set to '1' the time server function will be enabled the next time CSI is started.
TimeServerPeriod=60 | This is the period in minutes between messages sent from the server to clients.
[Diagnostics] |
DiagMode=0 | If set to 1 then the CSI didialog boxields are enabled and will update once per second. If set to 0 the fields will be grayed out and will not update. This item can be toggled from the CSI menu bar.
DiagModeExtend=0 | If set to 1 then a lilist boxppears below the normal dialog box showing files waiting to be transferred to remote workstations. This item can be toggled from the CSI menu bar.
DebugMode=0 | If set to 1 then extra debugging information is sent to the console. This item can be toggled from the CSI menu bar.
[Misc] |
ClosedownDelay=0 | This delay (in seconds) will allow CSI time to close down cleanly. The CSI window will disappear immediately but CSI will still be active for the period set.
WatchDogComPort=0 | This tells CSI which port the BNCS WatchDog is attached to. The WatchDog is a piece of hardware made by BNCS that talks to CSI periodically, if CSI doesn't respond the WatchDog restarts the PC.
DisableWatchDogOnExit=0 | If set to 1 it prevents the Watchdog restarting the PC if CSI is closed down properly (Available from CSI version 1.20.09)
TxRxRetryPeriod=60 | This is CSI's background polling delay in seconds for devices on its machine. After the delay period set (default 60) CSI polls a device and if it responds CSI issues a NA message with the device number and the workstation number eg NA 800 041, device 800 is present on Workstation 41. Note that CSI cycles through its devices one per TxRXRetryPeriod. So for 10 devices and a period of '60' it will take 10 minutes to announce all devices. This is designed to keep network traffic down to a minimum. If a driver is shut down properly then it will be announced immediately.
MaxClients=1024 | The maximum number of clients used to restrict the number of ApplCore panels running to protect system resources
CompileHighOrderDBs=0 | Whether to read and create temporary cache files for the "upper" databases db2 to db9. This has no effect if UseMemoryDatabaseOnly is enabled
[SelectiveCache] |
Index_XXX=1 | Allows you to selectively turn the cache on (1) or off (0) for a given device number where XXX is the device number (between 1 and 999).
[PacketRecovery] |
TxRecoveryWindow=100 | How many messages this workstation should remember for possible retransmission
MaxRecoveryMessageHoldoff(ms)=2000 | Timer that runs to send packet recovery requests.
SimulateUnreliability=0 | The trouble with development networks is that they are too reliable for testing - this flag (and the following parameters) set CSI32 to be unreliable to prove packet recovery works (or not)
UnreliabilityTxRate=10 | How many packets to send without error
UnreliabilityTxCount=2 | The number of consecutive errors
UnreliabilityRxRate=11 | The number of packets to receive without error
UnreliabilityRxCount=2 | The number of consecutive receive errors
Enable=0 | Whether the packet recovery feature is enabled
MaxRecoveryRequests=5 | How many times to send packet recovery requests before giving up
RecoveryRequestRepeatRate(ms)=2000 | Minimum time between retrying packet recovery requests the initial request is sent within MaxRecoveryMessageHoldoff(mS)
MaxRecoveryPacketsPerTick=2 | Maximum number of recovery packets to send each timer tick (100mS)
[Status] |
DeviceInfodriverId=124 | Internal infodriver which delivers device status information to CSI clients. See information on Status Infodrivers
WorkstationInfodriverId=123 | Internal Infodriver which delivers workstation status information to CSI clients.
StartupDelay(secs)=61 | How long after CSI startup the internal infodrivers will display "starting". This value must be non-zero and should be the same as the longest HeartbeatTimeout setting (see above) on the system - typically 60 seconds (+1 ensures that there's no chance of coincident startup delay/heartbeat timer showing false status).
[Database] |
UseMemoryDatabaseOnly(no_V1_support)=0 | Whether to use alternative database functions that load database files into memory on the fly and do not require to either create, load, or use CDF files. There is no support for little used V1 database names With memory databases enabled "Router Index" (name to numerical index) is available on all levels With memory databases enabled you can have up to 65536 (0 to 65535) database levels
[WindowsMessaging] |
HWND_BROADCAST_NETSTATUSMSG=1 | Whether to broadcast BBC_NETSTATUSMSG messages when the network fails/returns. Turn this off unless you use it
HWND_BROADCAST_CSICLOSEWARNING=1 | Whether to broadcast BBC_CSICLOSEWARNING messages as CSI is closing. Turn this off unless you use it
HWND_BROADCAST_APPREADY=1 | Whether broadcast BBC_APPREADY messages when CSI has started. V3Launch requires this enabled - V4.6 does not


Credits

Simon Dowson

The original versions of CSI, V2CSI, V2.5CSI, V3CSI and V4CSI.

David Yates

CSI32 - a merged V3CSI and V4CSI with other enhancements (such as this help).

This documentation was taken from the original material on the website by Simon, with additional material and corrections.


csi32

CSI32 Application Documentation

Please note: This is not a complete guide as to what BNCS is or what CSI does - but a reference for the CSI32 application.

Click on the lines below. Help is available for:

Item | Notes
Networking | What CSI does to talk to the network
Dependencies | Application Dependencies
Dialog | A guide to the dialog - what do all those counters mean?
Configuration | Those things you can set, shouldn't fiddle with, or were once able to but not now!
Logging | Those things that are logged...and where it's logged to
Internal Status Infodrivers | Internal status infodrivers (similar to "BNCSStat" or "V3Status") introduced in version 1.1.10
Packet Recovery | Information on the packet recovery features of CSI32 introduced in version 1.1.2
Interfacing | ...or rather no information on Interfacing (but at least the reason why)
Redundancy | Guide to redundancy messages
Credits | Who's who
Version History | Full history of the application and its ancestors


dependencies

CSI Documentation

CSI32 Dependencies

CSI32 has the following direct dependencies:

File | Notes
csi32fix.exe | Microsoft compiler-built applications cannot receive certain ranges of internal messages. csi32fix.exe is a simple Borland application simply passes on the messages it knows CSI32 can’t hear. It doesn’t intercept, pass on or otherwise interfere with application to CSI messaging. This application should exist in the same directory as CSI32.EXE
bbcnb32.dll | Network DLL that CSI32.EXE needs. This is similar (but different!) to the existing BBCNB32B and BBCNB32M DLLs. This should exist somewhere windows can find it (i.e the windows directory, the “windows\lib” directory in a V4 system or elsewhere in “the windows path”.
bwcc32.dll | Part of usual V3 distribution CSI32.EXE needs for its dialog. This needs to be “in the path” or the system directory pointed at by the V3 "bncs_config.ini"
csi32.chm | Integrated help file. This needs to be in the same directory as csi32.exe.

Packet serial numbers are invisible to most existing BNCS modules, but to filter and display properly the following is required:

File | Notes
V3caplog.exe | V3.7.1 or later understands and displays the packet serial numbers.

The following are not direct dependencies of CSI32 but are a consequence of using it.

File | Notes
inf32fix.exe | Required by V4INFDRV.EXE. This application fundamentally does the same as csi32fix.exe but for infodrivers. This functionality was previously part of V4CSI and was not migrated to csi32.
info32fix.dll | Supporting DLL for inf32fix.exe.


dialog

CSI Documentation

CSI32 Dialog

Main Dialog

The main dialog is split into different sections - each one is shown and described below.

Sessions

Item | Notes
Sessions | This is the number of currently active sessions whether for device control or file transfer
Mx | This is the number of messages transmitted from this workstation across a session
Tx | This is the number of packets transmitted from this workstation across a session
Rx | This is the number of packets received by this workstation across a session
Ix | This is the total number of sessions that have ever occurred involving the workstation since CSI was started
NCBs | The number of Network Control Blocks assigned to the Sessions

Drivers

Item | Notes
Drivers | The number of drivers hooked into CSI - this number may not be exactly the same as the number of devices hosted
Mx | The number of "revertive" messages transmitted - messages may be combined into the same packet
Tx | The number of packets transmitted - packets may contain multiple messages
Rx | The number of packets received - packets may contain multiple command messages
Dx | The number of command messages relevant for this workstation i.e. where this workstation is hosting the device
Devices | The number of devices hosted by this CSI. This might not be the same value as Drivers since one driver might host multiple devices
NCBs | The number of Network Control Blocks assigned to Drivers

Clients

Item | Notes
Clients | The number of clients currently connected to CSI
Mx | The number of messages transmitted by this workstation. Messages may be combined into multiple packets
Tx | The number of command packets transmitted by this workstation. Packets may contain more than one message
Rx | The number of "revertive" packets received by this workstation.
Sx | The number of relevant "revertive" messages received by this workstation. i.e. messages received that were passed on to interested clients
Cx | The number of poll requests that have been satisfied out of the cache.
NCBs | The number of Network Control Blocks assigned to Clients

Receive Buffers

Item | Notes
InUse | The number of messages received from the network, and currently buffered and awaiting decoding. This is of infinite size.
HWM | The maximum value (high water mark) the "RxBuffs: In Use" value has ever got to.

Revertive Cache

Item | Notes
Disk | The amount of disk memory (KB) used for caching "infodriver" revertives. Each infodriver uses approximately 1 MB. This field is disabled if UseMemoryCache is enabled.
RAM | The amount of RAM used (kB) - each device uses 8KB.
Eff. | This shows the efficiency of the cache. It is calculated from the number of polls or queries received by client applications that can be satisfied by the cache, divided by the total number of poll or query commands.

Transmit Buffers

Item | Notes
TxBuffers: In Use | The number of transmit buffers that have sent data and now pending deletion
HWM | The maximum count (high water mark) that the TxBuffs:In Use has ever got to
Errors | The number of errors detected when trying to transmit data

Revertive Serial Number Errors

Item | Notes
Serial NumErrs | The number of errors where revertive packets have been received with out of order serial numbers

Packet Recovery Statistics

Item | Notes
Unr. Errs | The number of errors which could not be recovered by the packet recovery process.
RcvdPkts | The number of packets which have been recovered.
Superseded Msg | The number of individual revertives from recovered packets which were found to have been superseded by later data
HeartbeatsRx | The total number of heartbeat messages that have been received.

Client / Driver List Dialog

This dialog shows a complete list of the clients and drivers that CSI is hosting. The number of entries in each list corresponds directly to the Clients and Drivers counts described for the main dialog.

The main purpose of this dialog is to determine the IPC mechanism in use. The example below shows a mix of different clients and drivers, their window class name and the module that owns that window.

These lists are maintained dynamically - when clients/driver connect/disconnect these lists will update automatically.

Occasionally CSI will retain a registration for a client/driver that has crashed. In this case the window class name and module name cannot be determined and the entry will show as "Invalid Window". Such information is NOT updated automatically, but only when the dialog is opened. CSI has it's own mechanism for detecting loss of client/driver. If CSI detects a client/driver has gone then it will automatically be removed from this list.


interfacing

CSI Documentation

CSI32 Interfacing

Driver and client interfacing information and APIs are not defined here for two reasons:

  • This information is usually only available to developers who have done driver training
  • There are considerably better ways of interfacing than using the raw messaging. These "other ways" (ccClient, extclient, ccInfodriver, extinfo in C++, BNCSLib in .Net etc.) are already documented elsewhere


logging

CSI Documentation

CSI32 Logging

CSI32 maintains various logs of its activities.

These can be found in:

System Type | Log Path
V1 / V2 / V3 | c:\bncslogs\csi32
V4 | %CC_ROOT%\%CC_SYSETM%\logs\csi32

Events Logged

Logs are either appended to a single CSI32 log or create dated daily logs.

The filename of the daily log is simply the date in year/month/day order so that logs sort properly. For example:

20090309.log

It's anticipated that the things logged to csi32.log will never get to an unmanageable size - even if you start/stop CSI several times a day the resulting logs are not likely to ever grow to an unacceptable size even during the whole lifetime of the workstation.

The following events are logged by CSI32:

Event | Where Logged | Notes
Startup | csi32.log | Logs that CSI was startup with the version number
Closedown | csi32.log | Logs that CSI was shutdown - also logs the statistics usually visible on the UI
Crash | csi32.log | Logs the crash address and other information so that errors can be traced
Peer Poll Error | Daily log |
Serial number error | Daily log |
Cache cleared | Daily log | Following a packet serial number error may appear this log which indicates which devices may have been affected
Send Error | csi32.log | Rarely seen log that greater than 9999 messages have been sent without the application having an opportunity to delete the network resources


networking

CSI Documentation

BNCS Network

Introduction

BNCS uses NetBIOS - a legacy Microsoft network API (chosen at a time a TCP network was a chargable extra on Windows 3.1).

Note I say "network API" and not "network protocol" since it isn't - NetBIOS is a means of machines communicating and specifies the service that they will support rather than how they should do it.

BNCS currently runs on NetBIOS/IP (aka NBT) as well as the legacy NetBIOS/NetBEUI - it can also run on NetBIOS/IPX though it's not thought that any systems do.

BNCS messaging is pretty simple - most control messages are passed as broadcast (in the network sense) messages so that they are received by every machine on the network. Whilst network professionals frown on such techniques it's actually very efficient at point to multipoint message delivery. BNCS has been used for systems with hundreds of workstations - there are the same overheads delivering messages to 1000 workstations or just 1.

Use of broadcast networking also simplifies the configuration of a system in that the sending node doesn't need to know the configuration of the network or require any broker or directory to use services of the network (e.g. any of the many BNCS drivers).

Whilst broadcast messaging (in the network sense) is an "unreliable" messaging technique (as defined for a network protocol) it's actually proved extremely reliable on the stand-alone networks on which BNCS has been deployed.

Latterly BNCS has added a proprietary packet recovery mechanism to address the issue of network broadcasts as an "unreliable protocol".

NetBIOS services

NetBIOS provides various services -

  • naming (both individual machines and groups)
  • directed messages
  • broadcast messages
  • sessions
  • NetBIOS names

BNCS uses the following NetBIOS names. Some of the names are different depending upon whether there is a channel number used for that system.

Note:

  • V1 has no notion of channel numbers
  • STATUS_CHANNEL does not have a channel number because it works across multiple channels
  • WORKSTATION does not have a channel number either - though it's inconvenient since it restricts what workstations can be run on a network otherwise segmented by BNCS channel number. This is rarely a problem on production systems but is a limitation on development networks.
  • The "name with channel no." version of the name is used for channel numbers > 0
Name / Name with channel no. | Type | Version | Use
CSI CSIn | Group | V1 & V2 | Messages from drivers to clients n is the channel number (no leading zeros)
DEVICE_CONTROL DEVICE_CONTROLn | Group | V2 | Messages from clients to drivers n is the channel number (no leading zeros)
STATUS_CHANNEL | Group | V2 | Messages about workstation status
WORKSTATIONxx | Unique | V1 & V2 | Where xx is the workstation number (1 leading zero). The means by which unique workstation IDs are enforced as well as a named end-point of session (v2)
BNCSRECOVERY BNCSRECOVERYn | Group | Extn. | Messages relating to packet recovery n is the channel number (no leading zeros) Packet recovery is an extension to V2 networking - works between packet-recovery-enabled workstations, and doesn't upset the operation of legacy workstations.
ID_xxx | Unique | V1 | Message from client to Information driver xxx
GPID_xxx | Unique | V1 | Message from client to GPI driver xxx
GRD_xxx | Unique | V1 | Message from client to router driver xxx

For NetBIOS/IP (NBT) you can monitor what names you have registered by using the following command line command:

nbtstat -n

Note this command will also list a few "system" names such as the workstation name and workgroup not just the BNCS names.

Differences between V1 BNCS network messages and V2

We have to be careful here with the version numbers. "V1" BNCS network messages refer to clients/drivers before 1997 - "V2" BNCS network messages refers to pretty much everything since (whether a system is defined as a headline V2, V3, V4, V4.5, V4.6 BNCS system - the underlying network messaging is still "V2").

V1 drivers register individually with the network - if you want to send a message to that driver then you send it to that named resource on the network. In V2 a message for a driver is just sent to "a driver" and it's the receiving end determines whether it's interested in the message.

V1 drivers are strictly one packet per driver - "revertive" messages are packed efficiently (more slots per packet). Command messages are sent point-to-point, "revertives" are broadcast.

V2 allows packing of different drivers into one packet per workstation. Messages are less efficiently packed but in practice being able to pack multiple devices into a single packet outweighs the disadvantages. Messages are broadcast - each driver must receive the message and determine if it contains relevant infomation.

LANA Number

As noted at the beginning NetBIOS is an API not a protocol. That API may be presented as all the different protocols on multiple network adaptors. Which one should BNCS use? NetBIOS/IP on the wired Ethernet or NetBIOS/NetBEUI on the wireless adaptor? NetBIOS enumerates these different combinations and gives them a number - the LANA number.

You can use the Microsoft utility lanacfg.exe to list all the possible combinations of protocol and adaptor or there is a BNCS utility setlana.exe that wraps it up and allows setting the LANA number from the UI in it's "usual" locations.

Client to driver messages

This includes command messages (IW, RC, GS, IP, RP etc. etc.) and revertive messages. These are sent as broadcast datagrams commands sent to NetBIOS name DEVICE_CONTROL. Revertives are sent to NetBIOS name CSI. It's these names that allow the NetBIOS layer to filter incoming messages and only pass to interested parties.


packetFormats

CSI Documentation

Packet Formats

Introduction

This document describes the packet formats used in CSI.

Packets are in network byte order - so (for Windows) a DWORD is stored in memory in the opposite order in which it comes off the network.

These packet formats are not a user API and are here for reference only. They are subject to change without notification.

Heartbeat

Byte Offset | Type | Use
0 - 2 | String | Null terminated string "HB" (for heartbeat!)
3 | Byte | Heartbeat header size - currently 36 (was 32 before version 1.1.11)
4 | Byte | packet number (should be rarely anything other than 0) Top bit indicates if more packets follow - last packet will always have this at zero. e.g. 0x80 - first packet - more follow 0x81 - second packet - more follow 0x02 - third and last packet
5 - 6 | WORD (16 bits) | workstation number
7 | Byte | heartbeat interval in seconds
8 - 11 | DWORD (32 bits) | last revertive serial number
12 - 15 | DWORD | csi up time in seconds
16 - 19 | DWORD | current workstation time of day (in seconds since Jan 1st 1970)
20 - 23 | DWORD | earliest packet that can be recovered
24 - 27 | DWORD | packet checksum
28 - 31 | DWORD | unrecoverable error count
32 - 35 | DWORD | recovered packet count (from version 1.1.11)
36+ | WORD | device number & redundancy flags (see below). bit 15 is set if driver is in TXRX bit 14 is set if a driver is RxOnly but wishes to be TXRX bit 13 is the device close flag bit 12 is not used - reserved for NO function ("Network Objection" redundancy switching) bits 0-11 are the device number (0 - 4095 max) Bits reserved for device number mirror the number of bits reserved in the "Universal Revertive" packet structure

Bits 13/14/15 have the following states

Bit 15 | Bit 14 | Bit 13 | Notes
0 | 0 | 0 | Device RxOnly Broken Equivalent to NB message
0 | 1 | x | Device RxOnly Equivalent to NI message
1 | 0 | x | Device TxRx Equivalent to NA message
1 | 1 | x | Not valid state
0 | 0 | 1 | Device Closing Equivalent to NC message

After the header there is none or more WORDs which is a list of the drivers currently running on this workstation and their status.

From CSI 1.2.35 heartbeats allow for status of all 999 drivers (previously only 238). This requires that multiple heartbeat packets are sent (see flag in byte offset 4). For the full 999 devices 5 packets required (999/238 = 4.19)

Packet Recovery Request / Error Response

There are two packet types on the packet recovery "network channel".

  • One is a standard universal revertive (UR) packet.
  • The other is as defined below
Byte Offset | Type | Use
0 - 2 | String | Null terminated string: "PR" for Packet Recovery "PE" for Packet (recovery) Error
3 | Byte | header size - currently 16
4 - 5 | WORD | originating workstation number
6 - 9 | DWORD | packet checksum
n+0 | WORD | workstation
n+2 | DWORD | start packet ID to be recovered
n+6 | DWORD | end packet ID to be recovered

where n starts at the header size and can continue in 10 byte blocks to the end of the packet (max 49 requests)

The same packet format is used for packet recovery requests and packet recovery error responses.


packetRecovery

CSI Documentation

CSI32 Packet Recovery

Description

This feature is available in CSI32 version 1.1.2.xx or later.

Before CSI32 version 1.2.33 packet recovery used AF_NETBIOS socket type - support for which has been dropped on 64 bit operating systems. This meant that packet recovery did not work on those OSs. From 1.2.33 however packet recovery just uses the same packet recovery mechanism as the reset of CSI and so works the same.

BNCS uses unacknowledged broadcast datagrams for normal in-band message delivery. This is very efficient for point to multi-point data delivery, and usually doesn't suffer significant reliability problems.

For commands that initiate an action there is a return value, however where data is generated spontaneously by devices (e.g. status like "input fail") there has been no means of correcting if any values have been missed.

Tests have proven there is a very very low level of packet loss on a network but any packet loss at all may cause discrepancies between displayed data and reality.

CSI32 introduced packet serial numbers to detect errors and these have now been extended to recover lost packets.

Packet recovery is for "revertive" data only.

General Overview

CSI32 borrows concepts from the PGM (Pragmatic General Multicast) protocol. The gist of which is that whilst packets are being received in order, without anything missing "listeners" sit silently happily consuming the data. On missing data however listeners generate NAK (Not AcKnowledge) messages back to the sender to say "pardon?"

A network storm of "pardon?" messages is prevented by a variable hold-off preventing all listeners asking at once, and by listeners receiving each others messages so one knows it doesn't have to ask if someone else already has. On a large network where a packet is lost at source this may still result in several near simultaneous requests for the same thing.

PGM itself is not used because BNCS continued use of NetBIOS, but there are other factors too such as delays in recovering packets.

BNCS must remain a responsive control system - to recover packets in strict order they were sent introduces delays - perhaps considerable delays (10s of seconds). Such delays are not appropriate for most BNCS systems so a mechanism has been written to allow for immediate delivery of current data but delayed recovered data is checked for relevance.

For example - imagine a parameter regularly toggling states with no other traffic on the network. If a packet is missed the process to recover it begins. Whilst this happens the data continues to change. When the packet is recovered it's no good just passing this direct to the client - what it contains will in this case have been superseded. So a check is made to see if a later packet than the one recovered contained information for the same parameter and this recovered data is discarded.

Heartbeats

As noted above listeners happily consume data silently until they detect a discontinuity in the sequence of packets. This is all very well whilst data is being regularly generated from the driver. It wouldn't be known to a listener if the last 100 packets have been lost until the 101st arrives and that discontinuity is detected.

Heartbeats are a guaranteed regular "pulse" that contains information on the last packet sent.

Heartbeats have the other benefit that they can be used to determine the health of the system from any workstation that has been running for greater than the maximum heartbeat period.

Unrecoverable Errors

Errors are flagged from CSI when there are unrecoverable errors. With the packet recovery feature off every serial number discontinuity is flagged as an error.

With the packet recovery feature on only those errors that truly cannot be recovered after the specified timeouts and retries are flagged as an error.

The notification however is the same in both cases - it's just when it's generated that is different.

Testing

The trouble with modern networks is that actually they are staggeringly reliable - certainly measured values in excess of 99.997%. This makes it difficult to test the packet recovery mechanism very easily so CSI32 has unreliability settings to deliberately lose messages outgoing and incoming.

In development & testing packet loss of 40% was used along with induced unreliability into the recovery path too.

Packet Formats

Packet formats are described here:

Configuration

Configuration options are described in the PacketRecovery section here:


Redundancy

Description

It is desirable to have main and reserve drivers on a BNCS network so that in the event of a PC or driver failure the reserve driver could automatically take over the function of the main driver.

This is achieved by having active drivers in transmit receive (TXRX) and non-active drivers in receive only (RXONLY). The non-active drivers still receive and can process and store messages from the network but are unable to transmit data back to the network.

This document is a description of the inter-application messages used to control the TXRX and RXONLY status of BNCS drivers. This is not complete driver / infodriver interfacing documentation.

This documentation refers to CSI version 1.18.02 or later and Infodriver V2.02.02 or later.

It is the CSIs on the network that handles driver redundancy, passing messages between each other and to the driver applications, to negotiate the TXRX state of each of the drivers. This messaging also ensures that there can be no more than one instance of a particular device number.

Redundancy gained an extra feature "Redundancy Master" from CSI32 version 1.2.59

Normal Driver Operation

Consider a single Infodriver on a network.

Network Inquiry Message

When this driver starts up it sends a network inquiry message. This appears on CapLog and is of the format:

NI <device number> <workstation>

e.g.

NI 123 009

This example is an inquiry for workstation 9 to have device 123 in TXRX mode on the network.

Network Objection Message

If there is another driver of this device number running an objection message of the format:

NO <device no> <w/s requesting new instance> <w/s with existing active instance>

e.g.

NO 123 011 009

This example is an objection from workstation 9's to workstation 11's request to register device 123 as TXRX.

Network Attention Message

For active drivers CSI regularly sends out message to the network informing all other devices on the network that this device is active. This message can be seen on CapLog and is of the format:

NA <device number> <workstation>

e.g.

NA 123 009

This example shows that device 123 is active on workstation 9.

The NA message is identical to an NI message in terms of possible responses. Lets say we have device 123 active on workstation 9, and device 123 active on workstation 11 (this is an unusual situation but can happen if you start these drivers up without the PCs connected to the network). The first to send out a NA message will get an NO message from the other active driver. This will cause the driver that generated the NA message to go RXONLY.

Network Close Message

When a driver in TXRX mode shuts down it sends a closing message to the network. This is to tell other drivers of this device number that there is an opportunity to go TXRX. The closing message is of the format:

NC <device number> <workstation>

e.g.

NC 123 009

This example shows that active device 123 is being closed down on workstation 9. This gives other drivers in RXONLY an opportunity to try and go TXRX.

Network Broken Message

This slightly misnamed message is for indication only - no action results as a result of receiving it. It was meant to indicate a driver in RxOnly that does not want to request to go TxRx. The word "broken" used because it was initially used for a driver in RxOnly that was in no fit state to become TxRx (because of failed device comms for example). It shows the driver as alive but in trouble.

The message is of the format:

NB <device number> <workstation>

e.g.

NB 123 009

This example shows that RxOnly device 123 on workstation 9 is alive but does not wish to go TxRx.

Drivers which use multiple devices may use a single device to control TxRx - the other devices not wishing to control their own TxRx state may send "Net Broken" messages. This doesn't mean they're broken necessarily but that they don't want to independently request to go TxRx.

Redundancy Master

There are significant issues with redundancy messaging described above:

  • cycle time is dependent upon the number of devices running on a workstation. With default 'N' message send time of 60 seconds a driver hosting 100 devices would take over three hours to change then all over.
  • BNCS devices are independent, but some drivers use multiple devices for a single function - this leads to issues ensuring TxRx state tracks across all devices. Some drivers have explicit code to do this - it's an overhead that shouldn't be required.
  • there is a single 'N' message per packet - which leads to many packets on the network - this is particularly significant with drivers that host a very large number of devices (e.g. FABIAN) especially on closedown when individual NetClose "NC" messages are sent.

CSI 1.2.44 introduces the idea of "redundancy master". This is where a single device is nominated to be the master for a group and it alone controls the TxRx state of all its slave devices. The slave devices simply track the master and only the master device need talk to the network. For a FABIAN with 50 drivers this reduces the cycle time from 50 messages to just 1.

Configuration

This may be configured on-the-fly by extension of the existing APIs - and also available as static configuration in the usual CSI configuration file:

Redundancy master can be configured in csi.ini/bncs_system.ini:

[RedundancyMaster]
11=13-15
101=101,102,103,104

The above configuration specifies that:

  • device 11 is the master for itself and devices 13,14,15 (the dash indicates a range).
  • device 101 is the master for itself and devices 102, 103, and 104 (devices explicitly listed)

Notes

  • Redundancy master does not completely disable the normal 'N' message functionality - for the above example of devices 101-104 in a group, you should never see any 'N' messages for devices 102-104. If however a stand-alone device 104 were to be started on the network then the normal Network Objection "NO" message will still be sent by the redundancy master.
  • Slave devices get no choice whether they are TxRx or not - the return value to BBC_REQDEVGOTXRX is ignored.

External Driver Messaging

The following messages are used to control the TXRX status of a device.

These messages are defined in BBC_MXC.H

BBC_REQDEVGORXONLY

CSI to Driver
Request to go RXONLY.
This message is sent to a driver when a NI message is received from another driver PC.
The return value to this message specifies whether a NO message is sent to the network.
wParam not used (from CSI 4.01 Workstation requesting TXRX)
lParam Device Number
Returns FALSE - Refuse to go RXONLY by sending a NO message, TRUE - OK to go RXONLY don't send a response to the network

BBC_DEVICEIDINUSE

CSI to Driver
This device ID already in use on the network
This message is sent to a driver when an NO message is received objecting to the driver on this machine.
This is notification that this driver has been set to RXONLY.
wParam not used
lParam Device Number
Returns not used

BBC_REQDEVGOTXRX

CSI to Driver
Sent to the external just before going TXRX
wParam not used
lParam Device Number
Returns TRUE - OK to go TXRX, FALSE - Refuse to go TXRX

BBC_INQDEVGOTXRX

CSI to Driver
Inquire go TXRX. This message is sent before this workstation issues an NI message to the network. If this driver does not want to go TXRX it can choose not to send the NI message
wParam not used
lParam Device Number
Returns TRUE - Send NI to network, FALSE - Don't' send NI to network

BBC_IDGETTXRXMODE

Driver to CSI
Get the TXRX state of this infodriver.
This message is only used from Infodriver external to infodriver
wParam not used
lParam not used
Returns Value can be one of the following parameters:

  • IFMODE_NONE - Device not registered on this w/s
  • IFMODE_RXONLY - Device in RXONLY
  • IFMODE_TXRX - Device in TXRX

BBC_GETDEVTXRXMODE

Driver to CSI
Get the TXRX state of this driver
As per BBC_IDGETTXRXMODE above except that lParam contains the device number

BBC_SETDEVTXRXMODE

Driver to CSI
Set the TXRX state of this driver
wParam Mode:

  • IFMODE_RXONLY - Set mode to RXONLY by sending a NC message to network
  • IFMODE_TXRX - Try to set mode to TXRX by sending NI message to network
  • IFMODE_FORCETXRX - Force mode to TXRX by sending NO message to network
    Note: This message sets the mode direct (and sends an NA message) and does not issue a BBC_REQDEVGOTXRX

lParam Device Number
Returns Not used

BBC_SETREDUNDANCYMASTER

Driver to CSI
From CSI32 1.2.59. Some drivers present themselves as multiple BNCS devices - this is an API to allow an app to set only one of a group of devices to negotiate and set redundancy state. This reduces cycle time and ensures within CSI that TxRx state is consistent with a group of devices - when the master changes state, all those set with that as the master change state too. You need to supply the handle of the driver you wish to set the redundancy state for.

Note For correct operation do not forget to set the master device to itself

HIWORD( lParam ) - masterDevice
LOWORD( lParam ) - slaveDevice
wParam HWND hDriver
Returns master device if successful or -1 on failure

Using these interface messages

It depends upon how the device is connected to the driver as to how to use the redundancy switching.

One common feature that is important, no matter how an external device is connected into the system, is whether the driver has communications with that device.

If a driver has good comms with the device then this driver is available as a reserve - if the device does not have comms there is no point in offering this driver as a reserve.

Therefore most of the TXRX / RXONLY switching decisions are made on a comms. fail flag.

Sample code

This assumes that there is a comms fail flag called fCommsFailSystem. This is TRUE in the comms fail state. The Comms. fail state is determined by each implimentation but is assumed to be something like a number of consecutive missed messages.

This is the code required in the Windows procedure:

case BBC_REQDEVGORXONLY:
    // don't go RXONLY if we have active comms (dual ported solutions may wish to just concede TxRx state)
    return fCommsFailSystem;

case BBC_REQDEVGOTXRX:
    // this is our notification of going TXRX (if we approve it) show it on the dlg
    if( !fCommsFailSystem )
        SetDlgItemText( hDlg, ID_TXRXMODE, "TXRX");

    // only go TXRX if we have active comms
    return !fCommsFailSystem;

case BBC_INQDEVGOTXRX:
    // don't ask to go TXRX if we can't offer a reserve
    return !fCommsFailSystem;

case BBC_DEVICEIDINUSE:
    // this device is in use - we're read only - show on dlg
    SetDlgItemText( hDlg, ID_TXRXMODE, "RXONLY");
    return 0;

The following fragment shows how to get the initial state of the redundancy (this is for Infodriver external - GRD the same, direct CSI messaging similar):

switch( SendMessage( m_hInfo, BBC_IDGETTXRXMODE, 0, 0 ))
{
    case IFMODE_TXRX:
        SetDlgItemText( hDlg, ID_TXRXMODE, "TXRX");
        break;

    case IFMODE_RXONLY:
        SetDlgItemText( hDlg, ID_TXRXMODE, "RXONLY");
        break;

    default:
        SetDlgItemText( hDlg, ID_TXRXMODE, "Unknown");
        break;
}


statusInfodrivers

CSI Documentation

CSI32 Status Infodrivers

Introduction

CSI32 introduced the idea of "heartbeat" messages with packet recovery. Their primary purpose is to generate regular updates of current serial packet serial numbers so that packet loss may be detected. A regular message sent to the network may of course also be used to hold other status information.

Heartbeats contain information about the workstation status - such as up-time, as well as information about drivers hosted on that workstation including the redundancy status not available directly via any other single means.

Each heartbeat is received by every machine on the network - this means that every machine can quickly get an accurate idea of the status of all other workstations and drivers on the network.

BNCSStat (V3Status) uses a similar idea for network status, but then has the curiosity of representing this data back onto the network. Segmented networks, or VPNs make this approach undesirable.

Status Infodrivers

There are two "virtual" infodrivers that CSI uses to pass workstation and driver information back up to clients. These do not exist as true devices on the network, but are locally generated in each CSI32. This mechanism ensures that any version of BNCS client can readily use this new status information without having to implement a new API.

There are two settings in the CSI configuration file (csi.ini or bncs_system.ini):

[Status]
DeviceInfodriverId=124
WorkstationInfodriverId=123

These are the two device numbers of the virtual Infodrivers. These are read-only devices, may be polled and spontaneously generates change of state revertives if devices/workstations appear or disappear.

The data in these internal Infodrivers is only valid after a short period - usually a minute:

If you poll the workstation status during the startup period you'll get valid data (if it's arrived) or else the value "starting".

  • If you poll the device status device during the startup period you'll get the string "starting" followed by the available data. e.g. "starting,123T,456R"
  • To ensure that a client doesn't have to worry about repolling data after the startup period it is automatically repolled once the startup period is over.

A cache test for these two Infodrivers always returns valid except during the startup period.

Workstation Status Infodriver

There is one slot per workstation - where slot 1 is workstation 1, and slot 999 is workstation 999.

For an active workstation each slot contains a comma delimited list of:

  • up-time
  • current time
  • unrecoverable error count

Slots for inactive workstations are empty

For example:

0,02,05,51,2010,01,19,20,13,46,0,2,2010,01,01,17,20,44

Each entry is of the format:

<uptime days>,<hours>,<minutes>,<seconds>,<current year>,<month>,<day>,<hour>,<minute>,<second>,<unrecoverable error count>,<recovered packet count>,<csi start year>,<month>,<day>,<hour>,<minute>,<second>

So you can determine that this sample entry this workstation has been up for 2 hours 5 minutes and 51 seconds. It's current time is 20:13:46 on 19/1/2010 and hasn't got any unrecoverable errors and two recovered packets, CSI has been up since 17:20:44 on 01/01/2010

Unrecoverable error count mirrors that as shown on the CSI dialog - and is cleared when the CSI counters are cleared.

That same information in more easily digested form (maybe!):

Field offset | Info
0 | Days |
1 | Hours | Uptime
2 | minutes
3 | seconds
4 | year | Current workstation clock
5 | month
6 | day
7 | Hour
8 | Minute
9 | Second
10 | Unrecoverable Error Count |
11 | Recovered Packet Count |
12 | year | CSI start time
13 | month
14 | day
15 | hour
16 | minute
17 | second

Device Status Infodriver

There is one slot per device - so slot 1 is device 1 and slot 999 is device 999.

For each driver each slot contains a comma delimited list of the workstations hosting that driver with an indication of the driver state.

For example:

011T,022R,033B

Entries are zero padded to three characters for ease of decoding.

This indicates that this driver is TXRX on workstation 11, RxOnly on workstation 22 and RxOnly and broken on workstation 33 (not all drivers support this state). This would perhaps be an unusual entry on a real system since most drivers would only have 1 "main" in TXRX and 1 reserve RxOnly - this example just shows all three states.

The perhaps misnamed "RxOnly Broken" state was originally designed to indicate a running driver but one that did not want to go TxRx - perhaps because it lost comms with its device and was in no fit state. The "RxOnly Broken" state can also be used by multi-device drivers when TxRx state is controlled by a single master device and the slave devices should not attempt to negotiate their own TxRx state.


version

CSI Documentation

CSI32 History

Version | Date | Comments
1.00 | 16/12/93 | Development commenced. Added GPI driver commands
1.01 | 29/01/94 | Added InfoDriver commands. Now uses ApplCore INI file
1.02 | 31/01/94 | Added Booking System support
1.03 | 21/02/94 | Increased message queue size. Now closes down gracefully
1.04 10/03/94 Added database functions
Added 'Licence' and 'About' menu
Database bug fix
Added 'Network Attention' mechanism
1.05 | 11/04/94 | Added CSHost support
1.06 22/06/94 First speed optimisation
Clear added to menu bar
1.07 | 29/06/94 | Router revertives now take names from local database
1.08 01/07/94 Cache for router status
Timer for status updates
Net Restart command added
Database change notification facility added
Cache defaults to OFF
Message queue increased to maximum
Hooks for CSLink added to replace CSHost
1.09 | 03/01/95 | Minor bug fixes to Network Manager functions and router control device range
1.10 14/04/95 Speed enhancements to router datagrams
Reduced max clients to 32
Diagnostic switch added
1.11 25/06/95 Generic 'Device Control' datagrams replace
CSLink specific messaging.
1.12 25/08/95 Bug fix to cache mechanism
Reduced maximum clients to 24
1.13 | 22/01/96 | Recompiled to test BBC_NBIF.DLL instead of NETBIOS.DLL for Windows 95 compatibility
1.14 | 31/03/96 | Added more protection to cache routines. Tidied network messaging
1.15 11/01/97 Bug fix to router cache routines
Added CSRemote messaging
1.15.01 | 28/04/97 | Destination 0 no longer causes cache to GPF
1.15.02 | 06/05/97 | Bug to cache validity routines
1.15.03 | 20/05/97 | BBC_GETCSIHWND now send WS Id in lParam
1.15.04 | 16/10/97 | Bug fix to database routines
1.15.05 | 02/12/97 | Increased max registrations to 128
1.16.00 19/12/97 Added command buffering
Added Message counters to diagnostic window
Extended diags box now appears on startup
Session dir routines now use temp filepath
Client cmds ignored if client mode disabled
Drivers cmds ignored if driver mode disabled
'DEV_xxx.INI' generic type add
Auxilliary database handler added
Changed database rouines to work direct to CSI
Added information resource
CreateProfile() makes 'Name' entry in [Device]
Added 'Queue Clear' Session menu
Added 'Session Clear' options to Session menu
WS Id now sent in lParam of BBC_HWNDCSI msg
Added client cache enable/disable functions
Added Device_GetData() function
Added Device_Index() function
Added Cache_Flush() function
Cache files now deleted on closedown
Added system messaging
Added selective registration
Added packet mode revertive support
Added database change notify for V2 drivers
Rev. F For V1 drivers now sends commands singularly
Rev. G Added BBC_QUERYCACHEMODE handler
Rev. H Bug fixes to client registration routines
Rev. I Bug fixes to client unregistration routines
Rev. J Bug fix to GPI Revmessage
Changed default Client buffers to 20
Changed default Driver buffers to 4
Rev. K Bug fix to allow Tx to increment
Rev. L Bug fix to tertiary message decode
Rev. M Bug fix to prevent mem leak on client dereg
1.16.01 11/02/98 Bug fix to allow 16 character database names
Mex secondary buffers reduced to 256
Max clients raised to 48
Auto off added for tertiary buffering
Auto off added for secondary buffering
1.16.02 | 02/03/98 | Bug fix to check slotsize from V1 InfoDrivers
1.16.03 11/03/98 Bug fix to client Tx message box
Added CSMain_GetDeviceProperties()
1.16.04 | 17/03/98 | Added BBC_CSICLOSEWARNING handlers
1.16.05 | 27/03/98 | Bug fix to give default type 0 to V2 drivers
1.16.06 | 30/03/98 | Bug fix to prevent TerBuf_Decode() stalling
1.16.06A | 21/05/98 | CSNDI_SendToDriver() tmp string size now 513
1.16.06B | 21/05/98 | CSNDI_Revertive() acStr size now 513
1.16.06C 22/05/98 Packet size checking added to all functions
Stacksize increased to 4096
Log functions removed since CapLog does it
1.16.06D | 01/06/98 | D'base funcs enabled if client mode is off
1.16.06E | 01/07/98 | Bug fix to tertiary buffering protection
1.16.06F | 15/07/98 | Bug fix to CSReg_GetClientDevIdx()
1.16.07 12/08/98 consolidates bug fixes to 1.16.06
28/08/98 Now sends BBC_DATABASEPOLL message to drivers
1.16.07 | A19/10/98 | Sends system messages on client msg errors
1.16.07 | B28/10/98 | Bug fix to RI command with 16 character names
1.16.08 10/12/98 consolidates bug fixes to 1.16.07
12/12/98 Bug fix to protect CSDbase_SaveGRDEntry()
1.16.09 19/01/99 Bug fix to CSNDI_Revertive()
21/01/99 Added CSNDI_SendVerbatimMsg()
1.16.10 | 17/02/99 | Bug fix to CSDbase_GetDbaseName()
1.16.11 01/06/99 Now only objects if hosted driver is in TX/RX
03/06/99 Now handles RD commands for v2 drivers
1.17.00 22/10/99 32 bit message packers and crackers added
BBC_REGCLIENT substituted for BBC_REGAPPLCORE
Added 32 bit flag to device driver flags
1.17.01 | 18/11/99 | Router Modify now works after DP command
1.17.02 09/01/00 Added the 'network channel' options
14/01/00 Now allows source
1.17.03 | 08/02/00 | Now creates own temp dir for cache files
1.17.04 11/02/00 Now transmits CSI status messages
21/02/00 Added BBC_TXREVPACKET for raw packet Tx
22/02/00 Added CSNDI_RegAllDeviceIds()
25/02/00 Main message window result code now long
Reponse to BBC_GETCSIchanged
Commas now allowed in V2 databases 0 and 1
Implemented up-time counters
Max secondary buffers reduced to 200
Clients not sent hWnd if ClientMode disabled
06/03/00 Bug fix to CSCmd_NetObject()
Added boot time to status message
1.17.05 04/04/00 Modified 32bit message routines to V4
Max clients reduced to 44
1.17.06 09/05/00 Bug fix to 16 bit version of V4 msg cracker
15/05/00 Now transmits Tx packet counts in status msg
1.17.07 08/08/00 Began adding serial port watchdog functions
Bug fix to CSNetSes_Send()
14/08/00 Now updates RAM dbase with mapped DEV files
1.17.08 | 22/08/00 | Completed watchdog functions
1.17.09 | 30/08/00 | Added BBC_GETMAPPEDDEVID function
1.17.10 | 15/09/00 | Added BBC_REQDEVGORXONLY to CSCmd_NetInquire()
1.17.11 | 20/09/00 | D'grams with no header can be sent by clients
1.17.12 | 11/10/00 | Network objections sent and handled by acNDI
1.18.00 | 08/11/00 | Implements automatic driver Tx\Rx assertions
1.18.01 | 05/01/01 | Active drivers no longer sent GOTXRX message
1.18.02 | 09/01/01 | Modified TXRX to enable force changeovers
1.18.03 | 22/01/01 | Default Tx/Rx retry period now 60 seconds
1.18.04 | 25/01/01 | Bug fix to void CSCmd_RtrModify()
1.18.05 | 26/01/01 | Max Clients reduced to 32
1.18.06 | 04/05/01 | Small fix to CSNDI_RegDeviceId()
1.18.07 | 10/05/01 | BBC_GETDEVPROPERTIES now returns database list
1.18.08 | 13/08/01 | Libraries now freed after message loop quits
1.18.09 | 21/08/01 | Now broadcasts BBC_APPREADY message when ready
1.19.00 | 05/12/01 | Added local loop back for locally hosted Id's
1.19.01 | 11/12/01 | Five secondary buffers processed per 55ms
1.20.00 | 21/02/02 | Added standalone, no network option to INI
1.20.01 13/06/02 Reinstated BBC_CSICLOSEWARNING handlers
Removed debug data to reduce program size
1.20.02 13/08/02 CSMain_TxPostDirectMessage now uses PostMsg
BBC_DATABASEPOLL in CSCmd_RtrModify now posted
MIN_USERS added so the WS range can be used
1.20.03 | 04/09/02 | Added EnableLoopback to INI file. Default = 0
1.20.04 23/10/02 Bug fix to CSCache_GetData() for GPI srce 0
Bug fix to CSReg_UnregClient() flags now moved
1.20.05 | 23/10/02 | BBC_CLNETMSG now sent sent in loopback too
1.20.06 | 29/10/02 | Mod to CSNDI_SendRevPacket() for loopback mode
2.00.00 01/02/03 Supports both 32 bit messaging schemes
Requires bncs_license.key file
Uses bncs2nbif.dll for networking
2.00.00B01 | 26/02/03 | Added Cmd_NetModify for updating any INI files
2.00.00B02 | 29/02/03 | Removed redundant debug messages
2.00.00B03 | 01/03/03 | Created common source for V2 & V3 CSIs
2.00.00B04 | 05/03/03 | Reduced compiler warnign messages by casting
2.00.00B05 | 10/03/03 | Bug fix to CSNDI_SendToDriver()
2.00.00B06 | 11/03/03 | CBDATA_SIZE_POINTER now 513b on WM_COPYDATA
2.00.00B07 12/03/03 Bug fix device array to allow device 999
Key data decode returs error codes
2.00.00B08 | 18/03/03 | Bug fix to error reported by key decoder
2.00.00B09 | 20/03/03 | V3 responds via WM_COPYDATA to BBC_GETHWNDCSI
2.00.00B10 | 21/03/03 | Supports 32bit messaging for FBCSlink/CSServer
2.00.00B11 25/03/03 Added max drivers and devices from license
No longer tries to delete NCBs twice on close
Lock file implemented in 32 bit
Now adds status channel name to name table
2.00.00B12 | 27/03/03 | Bug fix to name number of the status channel
2.00.00B13 | 02/04/03 | Bug fix to driver number checking in license
2.00.00B14 | 14/04/03 | Now supports 32 messaging for CSClient
2.00.00B15 | 22/04/03 | Bug fix to driver range checking
2.00.00B16 | 30/04/03 | Minor bug fix to BBC_FBMSGSCHEME handler
x.00.01 | 09/05/03 | Fix to internally loopback buffered commands
x.00.02 | 14/05/03 | Added KeyFilepath to CSI.INI
x.00.03 16/05/03 Added DisableWatchdogOnExit to CSI.INI
APP_READY message now PostMessage()
NULL removed from CSCmd_TimeService()
x.00.04 | 22/05/03 | Bug fix to numeric parser BNCS32ReceiveMessage
x.00.05 | 28/05/03 | TxRx/RxOnly timer re-enabled
x.00.06 02/07/03 V2CSI no longer resets network layer
No longer sends ODM if already in Rx Only
x.00.07 | 24/07/03 | Now creates csi_temp dir before decoding key
x.00.08 | 17/09/03 | Fix to loopback string length in CSMain_TxCmd
x.00.09 07/20/03 Converted to .cpp files, V4 directives added
Added resgistration for name of client app
Max clients now 999
x.00.09 04/02/04 Removed some redundant debug information
Now set to minimise on start up
x.00.10 20/02/04 CSI Closing messages now work in V4
01/03/04 Added Tools->Reset Network option to menu
Now update clients with N series messages
02/03/04 Recompiled with Qt3.2.3
x.00.11 25/03/04 BBC_APPREADY now SendMessage()
V2V3 Window positioning restored
x.00.12 01/04/04 Re-enabled the time service for V4CSI
05/04/04 BBC_CC.DLL no longer loaded in V2CSI
x.00.13 | 06/06/04 | Replaced strtok() with bncs_strtok()
x.00.14 | 09/06/04 | Added b_strtok as part of project
x.00.15 | 16/06/04 | Now detects network failure and resets
x.01.00 20/01/05 CacheSize parameter in CSI.INI has min of 8192
Selective caching added
Cache menu toggle now flushes cache files
16/01/05 INI file allows buffer flush on exceeding HWM
17/01/05 INI file allows cache flush on exceeding HWM
23/01/05 static chars in CSDbase for returned strings
24/01/05 Bug fix to SecBuf_In() Terbuff toggling on HWM
TERBUFF_AUTO_OFF reduced to 150
25/01/05 V1 compatibility switch added to CSI.INI
3.01.01 28/02/05 Bug fix top improved NDI filtering
29/03/05 Bug fix to CSNetSup_NetSendDG()
3.01.02 30/03/05 Removed compiler warnings
01/04/05 Raised MAX_CLIENTS& MAX_REGISTRATIONS to 999
Rasied REGMEMORYALLOC to 524288
3.01.03 | 18/07/05 | Reinstated BBC_FBMSGSCHEME & BBC_CLMSGSCHEME
3.02.00 15/11/05 Added Device Status messaging
BBC_NETTXRXSTATUS added to CSCmd_NetInquire()
Fix to CSCmd_NetInquire() & CSCmd_NetObject()
After NO the 'reverting to Rx Only' is only
written to the network once
NetBroken message added to reflect device fail

CSCmd_NetClose() generates BBC_NETTXRXSTATUS
Bug fix to CSCache_GetFileHandle()
Supports BBC_DEVCOMMANDMSG & BBC_DEVSTATUSMSG
Added Net Status handler
Added MaxClient limit to CSI.INI
3.02.01 | 07/12/05 | MaxClient entry in CSI.INI forced to be 1024
3.02.02 | 14/12/05 | Destination zero now allowed in UR revertives
3.02.03 | 27/01/06 | CSMain_(S)GetDevTxRxMode() allows device 999
3.02.04 | 30/01/06 | Boot time vars set before first status call
3.03.00 03/03/06 Now uses GetConfigDirectory in bncs_gcd.cpp/h
NetReset functions added
Session timeout now 60 seconds
Bug fix to CSCache_GetFileHandle()
CSCache_DeleteOldFiles() now uses constants
06/03/06 CSCmd_NetModify() now uses 32 bit messaging
06/03/06 CSCmd_NetStatus() now uses 32 bit messaging
3.03.00 09/03/06 All BNCS_V4 #ifdefs removed
14/03/06 GetConfigDirectory() GetBNCSConfigDirectory()
22/03/06 Added GetBNCSSystemDirectory()
NULL term fix to Cbncs_strtok::Tokenise()
3.03.01 20/04/06 Device check added to CSDbase_GetDatabaseName
Device check added to CSDbase_GetDbaseName
3.03.02 24/04/06 Cache file path now in bncs_config.ini
25/04/06 Bug fix to point all profile entries on path
3.03.03 | 09/05/06 | Fix to out of range in CSDbase_GetDatabaseName
3.03.04 | 16/05/06 | Turned of debug from CSDbase_GetDatabaseName
3.03.05 30/05/06 strlen+1 fix to CSMain_RxPostDirectMessage()
Modification to CSMain_RxPostDirectMessage and
CSMain_TxPostDirectMessage to pack size and
switch in wParam for when network enable off
3.03.06 | 15/06/06 | If NetworkEnable=0 then LoopBack is enabled
3.03.07 14/07/06 Fix to V1 revertives in CSCmd_RtrRevertive()
and in TerBuf_DecRtr()
3.03.08 | 29/08/06 | All database names now come from cached files
3.03.09 | 29/09/06 | NA messages now handled if client mode is off
3.04.00 | 07/02/07 | Build from CVS after Simon's handover
3.04.01 | 07/02/07 | Fix to prevent re-entrant sendmessages to cause a crash
3.04.02 13/02/07 Fix to stop crashing on no name in v1 device database
Removed case sensativity over v1 device file names
3.04.03 | 07/08/07 | Steve Jensen
3.04.04 17/03/08 Correction for Sessions issues. Changed
MAX_SESSIONS set to 8, was set to 4.
Changes to CSNetSes_SessionClosed().
3.05.00 27/05/08 Rationalised session management down to one queued pipeline
Added session layer checks to remove aborted sessions to CSNetSes_TimeoutChk()
3.05.01 | 25/06/08 | HANGUP_DELAY 100
3.05.02 | 25/06/08 | HANGUP delay now INI file parameter
3.05.03 | 09/07/08 | BBC_DATABASEPOLL messages now sent with the value of the revertive switch flag in lParam
3.05.04 | 12/09/08 | Corrected InfoGet bug by rationalising sessions
3.05.05 | 25/11/08 | Corrected for a memory leak bug in sessions
3.05.06 02/12/08 Enhancements to data bases loading function
CSDbase_GetDBList()supporting Fabian ADP.
Notes from Simon: The function checks for the presence of the high order database sections dynamically, ie it does not require a restart if CSI to enable a change to be visible to theFabian Server. It works by searching the files pointed to by CSI and checking for the presences of a [Database_x] section. The mere presence of the section header is sufficient for CSI to report that the database exists.
3.05.07 | 13/02/09 | Adds peer poll refresh feature
Copy taken at this point and merged with V4
1.0.0.2 | 02/03/09 | first recorded csi32 version
1.0.0.3 | 03/03/09 | corrects V3 file paths, loads correct DLLs (doesn't need bncs_cc.dll)
1.0.0.4 | 05/03/09 | uses sizedBuffer which by default has additional null character (doesn't add to the returned buffer size but ensures that buffer is null terminated if used directly as a string)
1.0.0.6 | 06/03/09 | adds csi config file (csi.ini or bncs_system.ini)
1.0.0.7 | 08/03/09 | adds serial numbers to packets (set by SendSerialNumbers in ini file)
1.0.0.8 | 10/03/09 | hex version number now returns 0x03000000 or 0x04000000 depending upon the environment type
1.0.0.9 | 10/03/09 | Nasty one this....a bit of sign extension going on with the serial number checking meaning that every 256th packet was being interpretted as an error
1.0.0.10 12/03/09 Fixes minor problem in reception of serial numbers so that startup of either this ws or another won't flag as an error
Introduces array of "device hosted on ws...." This is set by reception of any revertive.
Can now flushe cache for all the devices hosted by the errored ws when a packet error is detected
1.0.0.11 | 12/03/09 | Puts menu items for "send packet serial numbers" and "clear cache on network error".
1.0.0.12 | 12/03/09 | Adds routine to close down inf32fix.exe
1.0.0.13 | 13/03/09 | Changes default for sendserialnumber and clearcacheonpacketerror to off
1.0.0.14 | 17/03/09 | Puts a send buf high water mark and current (number of undeleted buffers) if this hits 10,000 then I don't think they'll get deleted any more
1.0.0.15 | 17/03/09 | Against my better judgement.....added ClearCacheOnNetClose flag
1.0.0.16 19/03/09 Adds simple check of the number of network buffers that is configured (max of 32)
Adds NN (network number) commands to the output command string- this is command packet serial numbers fixes network reset
1.0.0.17 | 23/03/09 | implements last missing function from V3
1.0.18.xx 26/03/09 changes version numbering so last digit is the build number
fixes small bug in cache code (no real impact
1.0.19.xx | 30/03/09 | Remove static array for async processing of poll commands (when satisifed from the cache) and now uses a queue. In testing I could get this up to 200-odd (previous limit was 32)
1.0.20.xx | 31/03/09 | Adds checking of existing driver window handle before rejecting a new request
1.0.21.xx 31/03/09 adds dump of stats on exit to log file
adds running total of serial number errors (for logging purposes only)
1.0.22.xx | 31/03/09 | disables all the relevant controls on the dialog when dianostics are disabled
1.0.23.xx | 09/04/09 | adds registration for notification of packet serial number events
1.0.24.xx | 17/04/09 | adds ability to query CSI for the extent of an individual device registration
1.0.25.xx | 21/04/09 | Great twonk Yates.... Now logs serial number errors using HEX rather than decimal so that CapLog and CSI32 at least report the same numbers...
1.0.26.xx 23/06/09 corrects adds config->edit option
adds config->view option
1.0.28.xx | 16/07/09 | Adds help
1.0.29.xx | 20/07/09 | adds ability to generate packet errors from menu item
1.0.30.xx | 07/09/09 | correction to V1 infodriver revertive handling code to ensure it doesn't read past end-of-buffer
1.1.0.xx 29/09/09 changes non-time critical, numeric, returnless SendMessages to
PostMessage
adds heartbeats
adds packet recovery tx buffer
adds packet recovery network channel
adds packet recovery request messages
recovers lost packets
1.1.1.xx | 27/10/09 | adds packet revertive memories to deal with out of order packet recovery responses
1.1.2.xx | 30/10/09 | Version for release with packet recovery, packet ordering correction
1.1.3.xx | 30/10/09 | status infodrivers off heartbeat messages
1.1.4.xx 02/11/09 more tidying up, removal of historic code and rationalising header files some more.
Now should packet recovery properly with router and gpi types too (oops).
1.1.5 19/12/09 Release candidate for W1
corrects mS to ms for those that are troubled about these things
changes shellexecute from "edit" to "open" for the Edit Config.
changes to docs to include Heart beat enable and timeout
1.1.6 | 21/12/09 | does logging of unrecoverable errors in the right place
1.1.7 | 18/01/10 | adds workstation status monitoring
1.1.8 | 01/02/10 | adds device status monitoring
1.1.9 | 02/02/10 | changes workstation and device monitoring code to do cleanup in thread to ease burden on main thread and timer callback
1.1.10 | 05/02/10 | adds status channel enable flag (for when using heartbeats
1.1.11 22/02/10 silly fix to supseded memories not remembing values in the packet that triggered serial number err
adds relevant recovered packets to the heartbeat and status infodrivers
1.1.12 25/02/10 changes workstation number in internal device status infodriver slot tobe 3 digit zero padded (for ease of decoding in functionally challenged clients)
adds explicit logging of network fail/ok messages
now does not reset memory of incoming serial numbers on network fail
1.1.13 05/03/10 Adds separate distributeTxRxStatus flag instead of inferring this setting from the heartbeat enable
Adds protection around the pollQueue
1.1.14 16/03/10 Another CM triumph.....1.1.13 did not have consistent version numbering (still said 1.1.12 on the titlebar) so this version rebuilt
Sets heartbeat to timeout in 2 seconds when a new driver is registered
(sends both heartbeats so as to not upset the timeouts of usually
out-of-phase driver/client heartbeats)
1.1.15 22/03/10 Adds databaseMgr/database classes to use as optional alternative to
pre-loading/compiling database files
1.1.16 | 22/03/10 | Small fix to not compile to disk high order databases if the memory option is set
1.1.17 | 30/03/10 | Moves the point that database load ducks out when using memory databases this ensures the database size is set
1.1.18 | 24/05/10 | Removes spaces from the end of loaded (bncs)database entries
1.1.19 | 03/09/10 | Fix to reuse of variable in net inquire code
1.1.20 | 10/09/10 | Fix to fix to reuse of variable in net inquire code
1.1.21 15/09/10 Support for new "capability" questions: BBC_GETMAXDESTS, BBC_GETMAXSOURCES, BBC_GETMAXSOURCENAMES, BBC_GETMAXDESTNAMES
Little has changed except that memory databases allows for BBC_GETMAXSOURCENAMES and BBC_GETMAXDESTNAMES to be 4096 (memory names off) or 65535 (memory names on)
1.1.22 | 21/09/10 | Fix to CSNDI_UniPollRevertive where filename in automatic variable was reused between calls
1.1.23 | 14/10/10 | Adds unload button to overview screen to clear loaded databases (next database call will start load-on-demand again)
1.1.24 | 04/11/10 | Fix to CSMain_TxCmd to range check device number (crash)
1.1.25 | 09/11/10 | Change to database/databaseMgr classes (not relevant to csi32)
1.1.26 | 18/11/10 | Fix to 1.1.24
1.1.27 | 07/12/10 | range checking in cacheclear function of device number (and logging of out of range values)
1.1.28 | 20/01/11 | error in when to check for serial number errors
1.1.29 19/05/11 fix to last version so that packet recovery doesn't try to correct errors from "out or order" recovered packets upsetting the "current" serial number
also adds some more meaningful debug to the superseded memories
1.1.30 | 16/05/11 | fix so that dialog enables appropriately when packet recovery is enabled
1.1.31 20/05/11 small typo fix to log message so it says "recovered packet after n attempts" where n is the retry count + 1
network close message added to heartbeats
1.1.32 | 23/05/11 | fix to 1.1.31 for posted poll on internal workstation infodriver
1.1.33 11/07/11 fix for device profile so database size/type is set correctly for memoryOnlyDatabases
now allows DG on internal status infodrivers
has new "send queued commands/revertives now" interface constants
BBC_SENDQUEUEDCOMMANDS and BBC_SENDQUEUEDREVERTIVES
fix to CSCmd_RtrModify to not crop db0 and db1 when using memory databases
debug string output when trying to send messages > 256
1.2.0 | 19/07/11 | Multi-standard build
1.2.1 | 20/09/11 | Arse. NC equivalent in heartbeats was simply deleting the whole device hosts class rather than just removing the current host
1.2.2 | 22/09/11 | Fix to 1.2.1 to delete the information for the incoming ws number not our ws number
1.2.3 | 11/11 | Range check to registration function fix (not independently released)
1.2.4 | 03/11/11 | CSCache_Test now traps internal infodrivers
1.2.5 08/11/11 BBC_NETMSGUPDATE now optionally sent (ini file flag) rather than just batted out regardless to all clients
NOTE: default for this value is OFF (because ApplCore doesn't use it)
Adds case BBC_NETMSGUPDATE_REG / BBC_NETMSGUPDATE_UNREG / BBC_NETTXRXSTATUS_REG / BBC_NETTXRXSTATUS_UNREG to allow for
selective registration of these message rather than just blast-all
1.2.6 10/11/11 Tidies registration functions for above new constants and cleans registrations down properly when client closes or is otherwise lost
Adds "starting" response to internal infodrivers
1.2.7 | 03/01/12 | Pragmatic if not ideal fix to not delete driver registration automatically if SendMessage return value is zero. This can happen when IPC breaks down (as well as when a driver disappears). Instead this state is also trapped by IsWindow call to see if that handle is valid.
1.2.8 | 09/01/12 | Same as 1.2.7 but for CLIENTS
1.2.9 | 19/01/12 | Flush revertive buffer before sending NC to the network
1.2.10 | 03/02/12 | Now uses absolute reference for up time rather than counting (rather inaccurate) "1 second" ticks
1.2.11 | 16/02/12 | Ooops.....hours have 3600 seconds in them not 3660
1.2.12 27/02/12 Changes HWND_BROADCAST messages to SendMessageTimeout
Adds configuration options to send/not send HWND_BROADCAST messages at all
1.2.13 | 27/02/67 | Small slip with section name of new config options
1.2.14 | 28/02/12 | Ineffective tinkering (tidying original code) to try and fix slightly odd startup behaviour on Windows 7 where selecting icon during startup results in small runtime dialog.
1.2.15 | There is no version 1.2.15
1.2.16 | 20/03/12 | adds client/driver list diagnostic dialog
1.2.17 | 21/03/12 | Small fix to application name in the client/driver listing diagnostics window
1.2.18 | 21/03/12 | Changes orientation of client/driver listing window
1.2.19 | 25/03/12 | Simple hooks to allow early POC testing for external alarms module
1.2.20 | 04/05/12 | makes memory databases consistent with "old fashioned" databases
1.2.21 22/06/12 Memory database code couldn't cope with single digit names (fault introduced in 1.2.20 in whitespace-cleaning code)
Range checks the value returned by cache for router
1.2.22 | 22/06/12 | Memory database was incorrectly rejecting zero-length names and returning --- instead
1.2.23 26/06/12 When sending out heart beat to notify of driver closing the packet was malformed sending out the wrong packet serial number
Handles heartbeats driver-side
1.2.24 | 29/06/12 | Tiny fix to ensure buffer is big enough to return router revertives when the db0 name is >16 characters
1.2.25 | 09/07/12 | Fix to registration function that with all 999 registrations would overwrite over the end of memory
1.2.26 | 17/09/12 | Doh....silly cut and paste error with the value sent for NB by BBC_NETTXRXSTATUS
1.2.27 | 03/12/12 | Now updates the network with heartbeats to both client and driver side
1.2.28 | 04/12/12 | ...fixes to 1.2.27
1.2.29 | 21/02/13 | rebuilds for consistent version number 1.2.28 was also labelled 1.2.27
1.2.30 | 25/02/13 | Now closes grd fix as well as infofix on CSI closedown
1.2.31 | 26/02/13 | Recursively creates temp directory actively sets the infodriver cache value to null so that cache get can't return duff values
1.2.32 | 04/03/13 | checks return value of file functions in reading cache values
1.2.33 | 15/10/13 | reworks packet recovery to use NetBIOS not AF_NETBIOS socket so that it works on 64 bit OSs (this was eroneously built but not released with title bar version of 1.2.32)
1.2.34 | 12/11/13 | now has memory cache functions using same code as memory databases
1.2.35 | 12/11/13 | hard won change to ensure that heartbeats are sent out for all registered devices even when there are 999 of them. For a driver that registers all 999 devices this means the internal infodrivers for status show all 999 devices running on that workstation
1.2.36 14/11/13 Tiny tweak to not parse all of the heartbeat messages when there are multiple sent
Now only sends "Request to register device xxx from driver hWnd 0xHHHH" messages to the network when CSI has debug mode enabled
1.2.37 | 26/11/13 | Makes buffer for NetDisable big enough to hold the caption data
1.2.38 06/12/13 Updates database functions to be the same as those just optimised for bncslink
cache function now returns the correct value on not reading a cache entry (though it absolutely should manage to read it
1.2.39 | 07/01/13 | tiny fix to disable packet recovery NCBs when diagnostics are disabled
1.2.40 | 10/01/13 | fix to packet recovery code to trap out-of-range workstation numbers (this should not be a problem...but....)
1.2.41 | 14/03/14 | adds generic config change message for CSI clients
1.2.42 | 17/03/14 | fix to iterator for config change notification
1.2.43 | 24/04/14 | minor changes to existing source to allow for VS2010 build (new messaging mechanism!)
1.2.44 | 02/05/14 | Adds redundancy master feature
1.2.45 | 15/05/14 | fix to redundancy master feature to only flop devices in the same group to rxonly not every device
1.2.46 23/05/14 minor change so that BBC_DEVICEIDINUSE is not sent on reception of NO message if the device is already RxOnly
this only goes to reassert the current state
1.2.47 20/10/14 now writes CSI handle to shared-memory DLL so that you don't have to broadcast for it
adds BBC_NOTWPARAM (WM_BNCS+400) as sanity check that this window handle is CSI without relying on class name
1.2.48 | 30/10/14 | allows for BBC_CONFIGCHANGE clients that are not normal (revertive) clients by defaulting to BBC_COPYDATA IPC
1.2.49 | 09/03/15 | adds support for 65536 databases
1.2.50 | 09/03/15 | changes default filename for databases (not previously used before 1.2.49) to DEV_nnn.DByyyy (i.e. zero padded four character database name)
1.2.51 | 31/03/15 | No functional changes
1.2.52 | 01/05/15 | changes icon to new style
1.2.53 | 26/06/15 | adds new feature to client/driver diagnostics to measure time taken for IPC
1.2.54 | 02/07/15 | no code changes
1.2.55 04/07/15 adds BBC_NETTXRXSTATUS_BROADCAST_ENABLED to programatically get the state of DistributeBBC_NETTXRXSTATUS ini file setting
adds BBC_NETMSGUPDATE_BROADCAST_ENABLED to programatically get the state of distributeNetMsg ini file setting
1.2.56 | 06/07/15 | all standard profile/file functions should now resolve environment variables
1.2.57 | 17/12/15 | adds "deaf to self" setting so that CSI32 can be used as a gateway interface
1.2.58 | 04/02/16 | adds BBC_SETREDUNDANCYMASTER new API feature so that redundancy mastering can be set on the fly by drivers that understand it
1.2.59 05/02/16 fix to redundancy mastering when receiving a NC (net close)
scope fix to BBC_DATABASECHANGE notification in case someone comes along and changes something synchronously
removes message to network about master device change since this info can be picked up in heartbeats and kinda misses the point of generating lots of traffic when such status changes
1.2.60 | 06/02/16 | revertive messages now set target workstation in wParam (previously hard-coded tozero) so that you can tell if this was a poll response or change of state
1.2.61 12/04/16 When setting the TxRx state of a device don't bother the network with a change of state when the state hasn't actually changed.
This is important for requesting rxonly when already in rxonly state
1.2.62 | 14/04/16 | fix to 1.2.60
1.2.63 | 21/04/16 | Fix to 1.2.61 to re-assert txrx states when it's needed
1.2.64 21/07/16 if no V1/V2 flag database flag for any device is set then just do a quick check on incoming database change message to see if
the dev file exists so that you can add files to a running server without having then to restart it
1.2.65 15/12/16 Flag to force devices to V2 even without presence of a DEV_xxx.INI file so that commands are always sent buffered. There's a long-standing gotcha where commands are all sent in individual packets without the DEV_xxx.INI file.
Default for this value is the new "default=v2" rather than wholly backwards compatible
1.2.66 | 20/02/17 | Fix to CSNetSup_NetSendDG so that you can't send messages bigger than 512 bytes
27/02/2017 | Docs conversion to markdown
1.2.67 | 17/07/17 | Various small but important changes (buffer len, memory leak) following analysis using cppcheck (thank you Mr. Simon Armstrong)
1.2.68 | 21/01/18 | Adds BBC_GETMAXDEVICES call so that you can programatically work out how many devices this CSI supports (I suggest you default a null-return from this call to 999)
1.2.69 | 26/02/18 | Corrects version number anomaly (trouble with this vintage of app having it set in two places). Corrects build settings to use 32 time value for time-conversion calls rather than Windows new default of a 64 bit value for VS2013 builds.
1.2.70 | 18/04/18 | Now distributes BBC_NETTXRXSTATUS messages on incoming "NO" message if the dest workstation is you or zero. If it's you that generates the NO then you won't receive your own message as you won't be changing state
1.2.71 | 04/05/18 | Reworking of BBC_NETTXRXSTATUS messages on incoming "NO" message - if there is a dest workstation you'll get 2 notifications - one for the TxRx workstation, and one for the one being forced RxOnly.
1.2.72 | 11/05/18 | Anti-howlround measures for RM commands - used when sites are linked using FABIAN/slink
1.2.73 | 18/05/18 | Long-standing inexplicable hole in cache-get function - only returns the database name for the given router or GPI value not the numeric index. Now uses (previously unused) return value to give that value
1.2.74 | 07/06/18 | Temporarily (I hope) removes structured exception handling so that the likes of WinCrashReport can be used to grab a call-stack.


gr32fix

grd32fix.exe

Description

grd32fix.exe is required so that GRD32 can receive some broadcast messages (HWND_BROADCAST) that otherwise it would be unable to hear.

There is a difference between Borland compiler built applications and Microsoft in that Microsoft applications are totally deaf to certain ranges of messages sent from other applications with HWND_BROADCAST. Typically this is thought (not confirmed to be so…) any thing below WM_APP (0xc000).

Unfortunately some of these messages are the hook-in messages required to connect external drivers with GRD_CONNECT.

The work around is to use a simple Borland-built application to receive these on behalf of the Microsoft application. All the Borland-built application does is forward them direct to the Microsoft application.

grd32fix.exe receives the messages, looks up the handle of the messaging window for the appropriate GRD and passes the hook-in message on.

To know which numbered GRD has which window handle they share this data with the grd32fix.dll. This allows for cross-process sharing of simple data such as an array of window handles.


panelman

panelman - BNCS Panel Manager

Introduction

The Integrated Panel Manager is the single user interface application that hosts all user interface panels. It provides both Title bar and menu bar areas with a client area for application panels.
It manages navigation between control panels and will bring up the appropriate application to provide a context sensitive panel to adjust any device in the system.
High level system alarms are indicated to the user by a permanently visible alarm status indicator button. This button opens the alarm overview panel for this user.

overview
Figure 1. Panelman Overview

Brief Summary

Each UI workstation in the system will be assigned a user. The same user can be assigned to many different workstations.

Every user has a panelset assigned to them. Again, the same panelset can be assigned to many users.

The panelset itself consists of a sequence of applications that the user can recall by pressing the buttons on the application menu bar along the lower edge of the screen.

An application appears on the Menu bar with an icon and short descriptive caption. When the application is opened it appears in the main panel area of the screen. The full title of the application is displayed above in the Title bar. If the application is adjusting a system device, this name will also appear in the Title bar as a suffix to the main title, this can be an alternate title if specified in instances.xml.

Panelman Details

Command Line Switches

The behaviour and appearance of Panelman can be modified by using command line switches. These switches may be combined if required.
Panelman supports the following Command Line Switches:

Size

The default screen size for Panelman is 1024x768
To set the screen size to 1280x1024 add the following switch:

Panelman.exe /size=1280

Versions of panelman before 4.6 supported only the following panel sizes (see section "The Panelman Folder and Assets" for the enhanced way this now works):

Command Line Option | Panel Size
1024 | 1024 x 768
1280 | 1280 x 1024
1366 | 1366 x 768
1600 | 1600 x 1200
1920 | 1920 x 1080
2048 | 2048 x 768
3840 | 3840 x 2160

Load

Panelman loads the pm_blank page on startup
For ease of Panel testing during development any panel can be displayed immediately when Panelman starts by using the following switch:

Panelman.exe /load=examples\rtr

Instance

When using the /load switch this can be used to set the instance (targeting) of the panel. This switch can only be used in conjunction with the /load command line parameter.

Panelman.exe /load=examples\rtr /instance=myInstance

Silent

Panelman loads many Panel Applications that are written in C++. It is possible that a coding error may cause a crash. As this DLL has been loaded by Panelman.exe it will crash when this occurs. The Panelman code includes a C++ exception handler. This means that it will return can error code to the calling application, Workstation Manager.
By default when this occurs Panelman will display a message box.

error
Figure 2. Panelman Fatal Error

This message box displays the name of the last Panel Application that Panelman loaded. It is likely that this application was the one that crashed. However as there may be many other script DLLs running in the stack it is also possible that the crash happened elsewhere.
If required this message box can be suppressed by using the following switch:

Panelman.exe /silent

The Panelman Folder and Assets

IMPORTANT NOTE:
Panelman resources before version 4.6 had the size of the dialogs fixed and the resources required to support that size had the size embedded in the filename – e.g. pm_title_1024.bncs_ui
From version 4.6 “size” is merely a name of the folder to look in for the multiple resources that panelman needs and the numeric suffix is no longer required.
To migrate from pre-version 4.6:

  • Create a folder of the same name as the command line /size parameter e.g. “1024”
  • Copy all the panelman resources with that numeric suffix into the new folder (e.g. pm_title_1024.bncs_ui)
  • Remove the numeric suffix from the “.bncs_ui” files (note that you don’t need to do this for the image resources) – so “pm_title_1024.bncs_ui” becomes simply “pm_title.bncs_ui”.

From this version the /size command line parameter does not have to refer to an actual size or numeric value but can be a name – this then just becomes the name of the folder to find the panelman resources. E.g. this is valid:

panelman.exe /size=myPanelSize

and panelman will look for it’s resources in the folder:

%CC_ROOT%\%CC_SYSTEM%\panels\panelman\myPanelSize

The Panelman application has a number of bars and areas (see Figure 1. Panelman Overview). Each of these dialogs is external to the Panelman application. The system/panels/panelman directory contains sets of these dialogs – those specific to a particular panelman size are split-out into individual folders.

Panelman resource | Notes
panels\panelman\<folder>\pm_title.bncs_ui | Title bar
panels\panelman\<folder>\pm_app.bncs_ui | Application buttons
panels\panelman\<folder>\pm_status.bncs_ui | Status area
panels\panelman\<folder>\pm_blank.bncs_ui | Blank panel –also sets the size/position of the main panel widget stack
panels\panelman\pm_start.bncs_ui | The Windows-style start menu
panels\panelman\pm_popup_pin.bncs_ui | Popup dialog for entering engineering menu PIN
panels\panelman\pm_wait.bncs_ui | Optional dialog that’s shown whilst a UI is loading
panels\panelman\pm_confirm_exit.bncs_ui | Option dialog that’s shown when panelman is about to exit

The dialogs contain named controls that Panelman expects to receive notifications from. Panelman sets their properties for example to indicate a highlight or to change a caption.

It is possible to change the appearance of Panelman by making modifications to these dialogs in the Visual Editor.

The set of files within the release support the following screen sizes:

  • 1280x1024

Using panels of different sizes

To use a different size, copy the 1280 folder, open the ".bncs_ui" files and resize & reposition the elements as you require.

Note The UI editor always roots dialogs top left, but the position parameters for the dialog are important when used by panelman. Right click on the background and edit "dialog properties".

The screen size that Panelman uses is determined by a command line switch – see section
As Panelman needs to set control properties or receive event notifications it expects to find certain controls with pre-defined names. These defined controls appear in this section as [control_name] and should not be renamed or removed from the dialog.

pm_app

app
The Menu bar contains the following controls:

[start] - The “start” menu button takes you to the start menu – see section 5
[1001]- button loads panel 1 in the panelset
[1002]- button loads panel 2 in the panelset
…
[1010]- button loads panel 10 in the panelset (last button on a 1024x768 screen)
[alarm] or [Back] – The alarm indicator button or the go back to previous panel

The alarm button is a DLL script that loads /panels/panelman/pm_alarm.dll. This script is responsible for the appearance and behaviour of the alarm button – see section 4 (Alarm button).
Note: Larger screen sizes will have more buttons than shown above eg. 1280x1024 has 13 buttons. Panelman obtains the number automatically from the design of the bncs_ui file.

Popup Application Selection

From Panelman version 4.5.13 can have a different app bar mode – where paging is replaced by popup versions. This is configured per panelset:

<?xml version="1.0" ?>
<panelsets>
<set id="Demo21" level="user" popup="true" >

This requires additional resources either:

  • Generic app buttons row(s)
  • Panelset specific app button row(s)

The generic buttons are (up to) 9 extension (ext) files
e.g.

pm_app_ext1.bncs_ui

This is the first extension for the 1024 sized panelman (which has 10 app buttons). This dialog should have a single row of buttons numerically following on in sequence from the buttons on pm_app.1024.bncs_ui. i.e. buttons 1011+
This theme continues up to pm_app_ext9.bncs_ui which has 9 rows of buttons.
From version 4.5.20 if you include the first row of buttons – duplicating what’s already displayed on the app bar then the right-hand “paging” button turns into a “Less” button and can be used to dismiss the popup dialog.
Popup panelsets can also have different versions depending upon the panelset in use.
The panelsets-specific versions are of the format:
pm_app_popup_.bncs_ui
e.g.

pm_app_popup_frontDesk.bncs_ui

There are not multiple versions of this file since it’s directly related to an individual panelset and the number of buttons displayed does not change dynamically. If the panelset grows and requires more buttons then just add them to the .bncs_ui for that popup panelset.

pm_title

The Title bar contains the following controls:
[title_caption] – The title display for the current panel eg “ARC Control – ARC1”
[title_time_local] [title_date_local] [title_time_utc] [title_date_utc] – A display of the current time and date of the workstation. UTC or local time as indicated.

pm_status

There are no controls on this dialog. It is expected that individual delivery projects might use this as a permanently visible area to display status information. This dialog can be edited as required, above is a typical example. It should only be resized/repositioned as part of a complete set of changes to all the dialogs within Panelman.

pm_start

The “start” menu contains the following controls:
[start] – A button with the BNCS logo that when pressed will open a popup showing the “start” menu. This shows information about the workstation - see section 5 for details

pm_confirm_exit

The “confirm exit” menu allows the user to confirm that they want to exit before the application actually closes. If this panel does not exist the application will automatically exit. The controls that need to be on the bncs_ui are:
[confirm_yes] – A button that when pressed confirms that the user wants to exit panenman.
[confirm_cancel] – A button that when pressed does not exit.

pm_blank

The blank dialog usually is...err...blank. It is simply a backdrop that is loaded before any panels are started. This could be modified to suit any project delivery requirements - it's just another standard UI, but one that's loaded at start-up and shown when you hit clear. The size and position of this dialog should be the same as all the individual panels that are in use within this system.

Image Assets

Image | Filename | Usage
 | BNCSlogo.png | Logo for start menu button
close | close.png | Icon for the quit button on the start menu
restart | restart.png | Icon for the restart button on the start menu
more | more.png | Icon for the more panels button on the Menu bar
grid | Icon_grid.png | Icon for the popup menu bar
less | icon_less.png | Icon to dismiss the popup menu bar (from 4.5.20)
default | default.png | Default icon for panels on the Menu bar to be shown when no custom icon is specified
app | pm_appbar_1024.png pm_appbar_1280.png pm_status_1024.png pm_status_1280.png pm_title_1024.png pm_title_1280.png | Background images for each dialog

pm_wait

Simple dialog to show whilst loading V4.6 dialogs – this dialog just confirms that the user is navigating to another panel and should wait. A typical implementation should simply say “Loading…”.

Panel Applications

Location of Panel Applications

All panels are located in %CC_ROOT%/%CC_SYSTEM%/panels/
Sub-folders below this path are used to store specific types of panel as shown in the tree below.
app
Figure 3. Location of Panel Applications

Each panel has its own folder eg. /panels/router/ or /panels/v1647p/
This folder contains the main panel file for the application:

  • For a non-scripted panel the main panel file might be v1647p.bncs_ui
  • For a scripted panel the main panel file might be router.dll

The rule is that if a file foldername.dll is found then this will be loaded otherwise a foldername.bncs_ui file will be loaded instead. The dll will then load other bncs_ui files from the folder.

The folder can also contain all of the assets associated with the application:

  • The icon to be shown on the app bar in Panelman eg. icon_router.png or indeed in /images
  • Any png image files that are specific to the this panel – common image files such as arcmode1.png should be stored in the shared location /panels/images/

Panels can be located in sub folders to allow more logical grouping. From the example above the /panels/engineering/ folder contains the alarm_report and router_name applications

How to add a panel

Having created the panel using the Visual Editor and Script Wizard the following steps are required to make the panel appear.

Copy the files to the Server

Create a new panel folder on the server under %CC_ROOT%/%CC_SYSTEM%/panels/ or in a sub folder if appropriate. Copy the bncs_ui, dll and png files to the new folder.

Add an item to Applications in the Config Editor

Set the following properties for the application:

Property | Details | Example
Name | The unique identifier of the application router or for an application in a sub-folder examples/rtr
Title | The name that will appear in the Title Bar above the panel | Main Router
Caption | The name that will appear on the button in the Menu Bar - keep it short | Main Router
Icon | The name of the icon to display on the button in the Menu Bar – this must be the name of the png file in the panel folder but without the extension or the icon can be in the images folder with the appropriate path ie/images/icon_router | icon_router or if no icon has been created you can set this to use the default icon default
kill | Sets the period in milliseconds that the application is in the background for before being terminated. Only valid for v4 and external applications. | 60000 for 1 minute

The application then can be added to the necessary panelsets

The "Alarm" Button

The Alarm button is external script pm_alarm.dll that is loaded (if necessary) as part of the Menu Bar. The button should normally show the summary of alarm status that is relevant to the particular User or Workstation. This is normally indicated by a button that displays:

  • “Alarms OK” in the stylesheet state alarm_ok
  • or “Alarm !!!” in the stylesheet state alarm_alarm

When pressed the button will Navigate to the specific Alarm Panel Application that is again relevant to the particular User or Workstation.
At this stage it is not defined how to determine the Alarm status or Alarm Panel that is relevant to any particular combination of User or Workstation. This business logic is wholly within the domain of each delivery project. For this reason any specific coding is outside the scope of Panelman.
An example pm_alarm.dll project is included in the BNCS v4.6 distribution.

The “Start” Menu

The “Start” Menu appears when the BNCS logo button is pressed on the Menu bar
start

Workstation Information

The popup shows the following information about the Workstation:

  • The Workstation IP address
  • The Workstation number
  • The name of the Workstation
  • The current User on the Workstation
  • The Panelset that is currently loaded
  • The Release number (obtained via Workstation tracker from its device ini)

Switch to Eng Menu

Each User within the System has two Panelsets defined for their use. The main Panelset is loaded automatically by Panelman as the Workstation starts. It is possible to switch to the engineering menu by pressing the “Switch to Eng Menu” button.

A dialog requesting the engineering PIN number will appear. If entered correctly the main Menu bar will switch to show the engineering Applications.
To return to the main Menu press the same button - it now shows “Switch to Main Menu”. No PIN number entry is required to switch back to the main Menu. However the PIN will need to be entered again for each time that the menu is switched to engineering.

From version 4.5.13 the PIN is stored in a file (g_pnlman.ini) and must be generated using the PIN generator utility pinGenerator.exe

Clean screen

This will display a screen where the touch element is disabled that includes a grill for the setting of touch screen frequency and phase

Calibrate Screen

This will call the touch screen manufacturers calibration software as defined in workstation_settings.xml see Section 8

Quit

This button may popup a confirmation box before closing Panelman and will take you back to Workstation Manager.

Clear

This will cause Panelmanager to unload all its dlls

The Adjust Mechanism

PA – navigateAdjust()

Panelman can “Adjust” an Instance within the system.
Eg.

 navigateAdjust(“ARC1”)

On receiving a navigateAdjust() message Panelman does the following:

  • Get the Devicetype of the supplied Instance – ARC1 is of type V1647
  • Get the Typehandler of this Devicetype – V1647 is handled by Application V1647P
  • Check if Application V1647P is already loaded and load if required
  • Switch V1647P to the top of the Panel stack
  • Target the panel to ARC1 by sending the Instance name – see section 6.4
  • Set the title bar to as specified for the application, appending the instance name, or the alternate ID if one is available.

PX – navigateExecute()

Panelman can “Execute” an Application within the system.
Eg.

navigateExecute(“router”)
  • On receiving a navigateExecute() message Panelman does the following:
  • Get the title of the supplied Application – router has a title of Router Control
  • Check if Application router is already loaded and load if required
  • Switch router to the top of the Panel stack

If the Application is not found in applications.xml then the name supplied will be used as a title
Any parameters that are required to be passed to either external or v4 applications must be separated from the application name by a comma. navigateExecute(“v4_panel,arc1,123”) will start v4_panel passing arc1 and 123 to the application.

PP – panelman Panelset

This command can be used to set an arbitrary panelset on panelmanager.
The command is of the format:

PP <panelset>

If the <panelset> command is omitted then panelmanager reverts to the normal (as at startup) panelset.

Application Paths when using navigateExecute

Specify the path relative to %CC_ROOT%/%CC_SYSTEM%/panels/
Example:

  • To run %CC_ROOT%/%CC_SYSTEM%/panels/examples/router
  • Send navigateExecute(“examples/router”)

Targeting panels

Panelman calls the setCaption method of the panel to send the details of which instance it is being targeted to.

setCaption(“instance=ARC1”)

The panel container receives this target and passes the information on to all controls and scripts within the panel.

Usage of UDP Multicast Messages

Panelman also listens for Multicast UDP messages. Panelman messages are sent on port 18xxx on multicast address 225.x.y.z
The messages within <cc_packet> that Panelman handles are:

<cc_navAdjust instance="ARC1" workstation="11"/>

This means adjust the Instance ARC1 on Workstation 11

<cc_navExecute application="ARC20P" param="ARC1" workstation="11"/>

This means execute the application ARC20P with an Instance target of ARC1 on Workstation 11.

Usage of InfoDriver 998

Panelman registers with the slot corresponding to this workstation on InfoDriver 998.
If it receives a message from this slot it checks the first two characters to see if it is a PA or PX message.
Eg.

IW 998 ‘PA ARC1’ 33

This message is interpreted as navigateAdjust(“ARC1”)

V4 & External applications

Panelman can run v4 or external application as well as hosting v4.6 panels, how these are treated is set in applications.xml.
When a non v4.6 panel is called the main client area of the panelman is hidden to allow the new application to appear on top and still allow the menu bar to appear on top. Panelman will attempt to bring any existing instance of an application to the front, this will only work if the main window caption has not been changed, if the application is not already running it will be started.
Once panelman has determined that an application is no longer visible, because another application has been brought to the front, if the kill time has been set it will start a timer, once this time has elapsed if the application is not currently the active window panelman will attempt to close it.

Touch screen calibration

If there is an entry in “workstation_settings.xml” for this workstation as shown below, then that application will be run.

<setting id="touchscreen" value="control monmouse.cpl"/>

The entry can be an application or a standard windows control panel application run using “control somename.cpl”
If you have an application named “control” this may get run instead, so in that case replace control with “rundll32.exe shell32.dll,Control_RunDLL”.
The application can also be a normal external application as shown below.

<setting id="touchscreen" value="C:\Program Files\Tsharc\hwincal.exe"/>

The working directory for the application will default to the directory the application is in, this can be overridden with the following entry.

<setting id="touchscreen_work_dir" value="c:\temp"/>

If nothing is set in “workstation_settings.xml” to maintain backwards compatibility workstation mangaer will try and launch monmouse.cpl and mtstouch.cpl.

Configuration Files

The appearance and behaviour of Panelman is configured by the following system configuration tables:

  • Workstations.xml
  • Users.xml
  • Panelsets.xml
  • Applications.xml
  • Instances.xml
  • Typehandlers.xml

The configuration of Applications.xml and Panelsets.xml are described in section 3.2
For the configuration of the remaining tables see the configuration tools documentation.

Configuration Files

The appearance and behaviour of Panelman is configured by the following system configuration tables:

  • Workstations.xml
  • Users.xml
  • Panelsets.xml
  • Applications.xml
  • Instances.xml
  • Typehandlers.xml

The configuration of Applications.xml and Panelsets.xml are described in section 3.2
For the configuration of the remaining tables see the configuration tools documentation.

Custom Title Bar / Button Text

Version 4.5.18 of panelman passes various parameters to the panelman element in order that it might make decisions about what text to display and indeed what colour to make itself.
Backwards compatibility is retained by continuing to send the text parameter but also sending many other values too.
The panelman titlebar dialog requires pre-defined resources to be present in the dialog. The only one of importance is a button/label/component called “title_caption”

The values sent are defined below:

Value | Description
text=title | bar text This is the original message sent by panelman. This is required for backwards compatibility
_PANELSET_START=_PANELSET_START | Sent at the start of a panelset configuration change – or at startup
panelset=<panelset name> |
level=<user level> | Value taken directly out of the panelset.xml file
panelsetLocation=<location> | NEW VALUE taken directly out of the panelsets.xml file
_PANELSET_END=_PANELSET_END | Sent at the end of a panelset configuration change (and at startup) This signifies that there are no more parameters following in this block.
_TARGET_START=_TARGET_START | Sent at the start of a block of parameters assembled when a new panel is shown
instance | Targeting information for this panel. Top level panels may not have an instance value so this parameter is null
panelType | Only type “V4.5” is likely to work
altId | Value taken for the given instance taken from instances.xml
instanceLocation | Value taken for the given instance taken from instances.xml
type | Value taken for the given instance taken from instances.xml
application | Application name for the application being started
caption | Value of caption field from applications.xml
title | Value of title field from applications.xml
icon | Value of icon field from applications.xml
applicationLocation | NEW ATTRIBUTE VALUE taken from applications.xml
_TARGET_END=_TARGET_END | This signifies that this is the end of the block of targeting data
__CLEAR=_CLEAR | Sent when the panelset is cleared (note two underscores)

The reason for the _TARGET_END and _PANELSET_END (etc.) tags is so that you don’t have to guess if there’s more parameters to come – you get a definite “that’s it – get on with it!” trigger.
So…on receiving _TARGET_START you should clear your internal variables and wait…you’ll get a number of other notifications which if you’re interested you can store the values. When you get the _TARGET_END value you can formulate a result and display it.
Note: not all values are sent in all circumstances. If instance is null then you won’t get the instance defining parameters (e.g. altId).

11.1 Summary of enhancements used in settings files:
applications.xml (location):

<app id="mcr/router_xy_sdi" caption="SDI|MCR" title="SDI XY Router" icon="/images/icon_xy" location="SkyStudios" />

panelsets.xml (new caption attribute):

<item id="studio_1/video_ipd_converters" caption="IPD|Converters" title="IPD Format Converters" icon="/images/icon_cross_converter"/>

workstation_settings.xml:

<workstation id="14">
    <setting id="location" value="SkyStudios"/>

Version Control

Version | Date | Author | Comments
4.0.1.0 |  |  | Looks in applications.xml to see what type of application it is, also shuts all applications it started.
4.5.0.0 |  |  | Confirm before exit & close other applications
4.5.1.0 |  |  | Gets application type by looking at application not configuration
4.5.1.1 |  |  | Check v4.5 dll before bncs_ui
4.5.1.2 |  |  | Fixes memory leak in: main.cpp (on creating but not deleting CPanelman) Fixes memory leak in: main.cpp (on creating but not deleting CConfirm_Exit) Fixes memory leak with new QPoint() in showPinPopup() Fixes memory leak with QProcess's for calibrate function
4.5.2.0 |  |  | looks in workstation_settings for touch screen software
4.5.2.1 |  |  | ?????
4.5.2.2 |  |  | adds optional "loading" dialog for 4.5 dialogs
4.5.2.3 |  |  | adds more useful debugging and log to disk
4.5.3.0 |  |  | deletes old v4.5 panels do reduce widget count and prevent hanging!
4.5.3.1 |  |  | Max User object count now got from registry.
4.5.4.0 |  |  | Alternate instance name added for title.
4.5.5.0 | 261005 |  | Makes back (initiated with /CLOSE...don't ask why) function work with up to 32 levels
4.5.6.0 |  |  | Clear panel now clears CSI cache
4.5.6.1 | 280606 |  | Corrected bug so that the there is not a button left highlighted when a panel that doesn't exist is called
4.5.6.? |  |  | dunno.....
4.5.6.4 | 181108 |  | adds cccDisconnected handling to shut the app down
4.5.7.0 |  |  | ??????????????????????????????????
4.5.8.0 | 240113 |  | makes the default title text configurable in g_pnlman.ini, removes references to colledia in this app
4.5.9.0 | 250113 |  | restores the "blank.bncs_ui" whenever the panel stack is cleared
4.5.10.0 | 140213 |  | accepts /instance= as a command line parameter
4.5.11.0 | 180213 |  | clear now also clears the history so you can't simply go "BACK" to the last open panel (that you weren't supposed to have had access to).
4.5.12.0 | ?????? |  | unversioned changes to memory handling
4.5.13.0 | 290813 |  | adds configurable engineering PIN (via ini file) adds PP command to dynamically change the panelset adds popup app bar option
4.5.14.0 | 020913 |  | now clears adjust stack when switching panelsets (not just on clearing) optimisations of panelset switching functions - now highlights button on the popup panel
4.5.15.0 | 100913 |  | fix to 1 of n paging where last page didn't appear
4.5.16.0 | 110913 |  | (another) fix to app paging
4.5.17.0 | 190913 |  | removes muliple iterations of bncs_config("instances." etc. etc. in favour of the already cached bncs_instance_info
4.5.18.0 | 230913 |  | Adds titlebar targeting information for custom titlebar adds abiltiy to override the panelman button text (caption) from the default taken from applications.xml with a value in panelsets
4.5.19.0 | 300913 |  | mod so that you don't get an unnecessary blank page when using multiples of the number of buttons
4.5.20.0 | 111013 |  | now allows bottom row (the original buttons) to appear on the extension app bar dialogs - if this is present (not compulsory) the "more" button becomes a "less" button so that the UI can be dismissed
4.5.21.0 | 041213 |  | Clearing of panels to preserve resources now once again looks at Qt objects. Still also looks at Windows User Objects.
4.5.22.0 | 061014 |  | now clears navigation stack when coming out of engineering menu
4.5.23.0 | 150115 |  | adds 1920 "profile"
4.5.24.0 | 240315 |  | adds 3840x2160 profile
4.6.0.0 | 210415 |  | reworking of resources to use sub-folders and where /size command line param refers to the name of that folder. can be numeric like they always could e.g. 1280, 1024 etc. but can now be named too
4.6.1.0 | 210415 |  | fix to 4.6.0.0 that broke relative paths now that the resources are shifted down one level
4.6.2.0 | 270415 |  | now only updates clock date/time on value change rather than every tick
4.6.3.0 | 300415 |  | fix to 4.6.1.0 to include shared resources in /images/
4.6.4.0 | 130715 |  | scope fix for filename variable which was being overridden when device tracker instance was set (screwed up the engineering PIN)
4.6.5.0 | 161015 |  | changes app icon
4.6.6.0 | 031115 |  | removes the surprise-o-matic - this was found by accident, out of the context for which it was coded. Something odd going on but it's not worth finding again via any route
4.6.7.0 | 030316 |  | adds "PA /CLEAR" navigation command which does the same as hitting the clear button on the UI
4.6.8.0 | 190816 |  | dcw callback for resource warning allows us to clean up mid-creation of another panel if needed simplifies resource checking
4.6.9.0 | 050916 |  | adds lua to UI load hierarchy
 | 27/02/2017 | David Yates | Docs Conversion to markdown
4.6.10.0 | 08/05/2017 | David Yates | Makes ApplCore switching based on 8.3 window title work properly
4.6.11.0 | 08/05/2017 | David Yates | When switching back to a V4.5 panel, ensure that this app comes forward rather than rely on the calling app to hide itself
4.6.12.0 | 10/05/2017 | David Yates | Now uses the bncs_popup style for the "start" menu to match other things and launches it at the cursor position rather than trying to work out a fixed location. This ensures that it will work with compact/vertical/wacky app bars
4.6.13.0 | 05/06/2017 | David Yates | Now examines the params passed via a PX command to see if it's an instance (so display alt-id) or equals (in which case it's likely to be one or more params) or just a word to stick on the title bar. I don't believe that this is ideal but in the name of backwards compatibility....
4.6.14.0 | 05/06/2017 | David Yates | Fix to 4.6.10 to ensure that UI switching happens correctly when switching panels externally to PM (e.g. from bcommand) - may require HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundFlashCount and ForegroundLockTimeout setting to zero
4.6.15.0 | 29/08/2017 | David Yates | Popup engineering PIN panel now appears every time not just the first time
4.6.16.0 | 13/10/2017 | David Yates | BNCS_V6 - extended ranges support
4.6.17.0 | 15/01/2018 | David Yates | Now restores the blank panel if calling from an external?
4.6.18.0 | 24/04/2018 | David Yates | Removes extended range support


paramTester

Introduction

Paramtester is a tool to aid the testing of a v4.6 BNCS system that controls and monitors instances of devices. For full details about devices, device descriptions and instances refer to the relevant documentation. Paramtester allows the user to select a named instance, view the parameters, and from the parameter list select one parameter to view or modify the current value.

Configuration

There are no specific configuration files for this application, all details about instances and parameters are read from the normal system configuration files.

Application Layout

Overview
Figure 1 Overview

Figure 1 shows that the application has 3 main columns.
The first column shows the available instances of devices – this is loaded from instances.xml of your particular project/installation.
The second, shows the parameters available on the currently selected device instance. Version 4.5.9 and later allows you to show only those where the slot number is set in the device type.
The third column gives details of the currently selected instance/parameter pair including the ability to change the current value.

Operation

In the basic mode of operation the user selects the instance and parameter to be modified or view, details of this are shown in the third column. If the device is a complex one (where some parameters are presented via a 2nd device) the device and type may not be what you expect.
Once a valid parameter is selected the device is polled to get the current value, this is displayed as the raw value in the third column.
The user can manually enter a value by typing in to the manual entry field and pressing the “go” button, this will right to the device and should be reflected back to the current value display.
Depending on the type of control the rest of the third column will display relevant options.

Enum Types

enum
Figure 2 Enum display
From the device description all values will be extracted, and a button will be displayed for each option. The buttons show the caption for each value, not the value returned from the device, this is available as previously described. When the value from the device is decoded the relevant button will appear depressed. Pressing any of the buttons will cause the application to attempt to set the relevant value on the device.
Figure 2 shows the 3 possible values for the current parameter, currently the “Ok” state is active.

Range Types

range
Figure 3 Range display

For a range there will be buttons to alter the current value up or down by the values specified in the device description, along with a button to set the default value. The current value is displayed as previously described.
Figure 3 shows a typical view for a range parameter.

Using Test mode

When testing a full system it is convenient to use the keyboard rather than having to keep moving the mouse across the screen, to allow this to happen the user can enable “test mode”. Without “test mode” being enabled the user can use the up/down keys to select either instances of parameters, and use the mouse to set a value.
In “test mode” when the user presses the space bar, if the parameter is an enum, the tool will attempt to set the next value. Pressing return will cause the next parameter to be selected on the same instance. Once the last parameter has been reached pressing return will select the first parameter on the next instance. Note that the order of instance selection is determined by the sort order of the listview.

Version Control

Version | Date | Author | Comments
4.5.5.0 | 08/01/2008 | Mark Baldry | Added Alt ID column
4.5.9.0 | 24/05/2010 | David Yates | Added information wrt “show slots > 0” option
&nbsp | 27/02/2017 | David Yates | Docs conversion to markdown
4.5.10 | 19/10/2015 | David Yates | adds "standard" icon, tidies VS2013 project settings, adds this version file (nothing much exists before this)
4.5.11 | 19/04/2018 | David Yates | Converts app to use ccClient rather than cPanel so that this app understands interim extended ranges
4.5.12 | 19/04/2018 | David Yates | Correction to 4.5.11 for correct GRD callback type


pmTarget

Description

pmTarget is a tiny utility to send commands to panelman to be able to clear/run panels.

Command Line

This is simply the raw string to send to Infodriver 998 (the navigation infodriver) for the slot read by this app which defines your workstation number (i.e. CC_WORKSTATION).

Clearing Panels

From panelman 4.6.7.0 supports the PA /CLEAR command (note: PA not PX) which does the same as the clear button on the panelman user interface.

Running Panels

Either run panels by trying to "adjust" an instance with PA <instance_name>. Or execute panel with PX <panel> where the path is relative to the system's panel directory.

E.g. for a panel:

W:\core_system\panels\examples\tutorial_7

call:

pmTarget.exe examples\tutorial_7

Compiler Settings

For ease of satisfying dependencies pmTarget is unusually placed in the windows\lib folder of your system.

You should refer to the environment variables in the path to the app rather than rely on Visual Studio propagating the environment variables (this is because it doesn't!).

Visual Studio 6

The following step is a custom-build step placed on the header of the project. This doesn't need a custom build step but ensures that this gets called early on in the build:

Note: PA /CLEAR

The full line (not visible in the screnshot) is:

$(CC_ROOT)\$(CC_SYSTEM)\windows\lib\pmTarget PA /CLEAR

The following step is a post-link step to re-launch the panel in panelman:

Note: PX <appPath>

The full line not visible in the screenshot is:

$(CC_ROOT)\$(CC_SYSTEM)\windows\lib\pmTarget PX examples/tutorial_7

Visual Studio 2013

This is slightly more straightforward than VC6 as VS2013 has pre-build and post-build steps - these require the same values noted above.

Application Path

Visual Studio strips all environment settings before launching the app. so it is unable to pick up "normal" BNCS application dependency. To make this easy to handle the app resides in windows\lib to ensure that dependencies are all local.

Do not be tempted to add the path to Visual Studio's executable paths options - this makes your code not portable between machines.

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown


bncs_buildTool

BNCS Build Utility

Description

bncs_buildTool is an evolution of the original utility "buildAllPanels".

This tool searches the given path for files of the given extension and then runs the specified command line against each entry from the resulting list.

So if you want to build all the panel projects in your system, search for all the project files and then run the compiler on each.

Configuration

It's extremely likely that you'll want to run this tool with standard tools/command lines so it has presets. These can be found in the config file:

%CC_ROOT%\bncs_buildTool.xml

Note: this is deliberately NOT contained within any particular system since the path to your compiler may be different from someone else's.

If you do not have CC_ROOT environment variable defined then the config is found in the same directory as the executable.

A default file is created if it doesn't exist, but this has paths to the tools on my system not necessarily yours so you might need to go in and adjust paths appropriately.

bncs_buildTool Command Line

The application accepts the following command line options

Argument | Notes
/preset=<value> | The preset to pre-load. This relates directly to the id in the XML configuration below
/stdout | Write the debug window to STDOUT Note that this includes a certain amount of HTML
/fireAndClose | Run the selected preset on startup and close when finished
/configFile=<path> | Path to configuration file. At time of writing this cannot contain spaces.
/value:<name>=<value> | Adds a named string value. Any instance of %<name>% in the config file will be replaced by <value>.

Logging

The application writes the last debug output to

bncs_buildTool.log.html

which is located in the working directory of the application. This has a few simple HTML formatting tags to match the run-time view.

Formulating the Command Line to run

The command line used almost certainly wants to contain some element(s) of the search results. The following placeholders may be resolved dynamically:

Placeholder | Use
%CC_ROOT% | The contents of the environment variable CC_ROOT
%CC_SYSTEM% | The contents of the environment variable CC_SYSTEM
%TARGET% | The entire path to the current file
%TARGET_BASE% | The "base name" of the current file. i.e. if the path is: c:\myRoot\myProject\panels\myPanel\myPanel.vcxproj then the base name is myPanel (as shown above)
%TARGET_EXT% | The extension of the current file
%TARGET_PATH% | Just the path to the current file, not the filename

The tool is deemed to have succeeded if the return value from the command line is zero. If it's non-zero then it's deemed to have failed. This seems to work with most things

Other placeholders may be entered from the command-line using the /value parameter.

Sample Configuration

The following configuration was used during development of this utility:

<build>
    <preset id="Visual Studio 2013 Rebuild Release">
        <commandline>"c:\program files (x86)\microsoft visual studio 12.0\common7\ide\devenv.com" "%TARGET%" /rebuild Release|Win32</commandline>
        <extension>*.vcxproj</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 6->2013 Project Upgrade">
        <commandline>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vcupgrade.exe" "%TARGET%"</commandline>
        <extension>*.dsp</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 6 Rebuild Release">
        <commandline>"C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe" "%TARGET%" /make /rebuild "%TARGET_BASE% - Win32"</commandline>
        <extension>*.dsw</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 2013 EXPRESS">
        <commandline>"C:\Program Files\MSBuild\12.0\Bin\msbuild.exe" /p:configuration=Release /p:platform=Win32 "%TARGET%"</commandline>
        <extension>*.vcxproj</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 2015 EXPRESS">
        <commandline>"C:\Program Files\MSBuild\14.0\Bin\msbuild.exe" /p:configuration=Release /p:platform=Win32 "%TARGET%"</commandline>
        <extension>*.vcxproj</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
</build>

Points to note

  • command line is quoted if there are spaces (or likely to be spaces within the replaced text e.g. %TARGET%)
  • you can have as many entries as you like

User Interface

The user interface is pretty stupid.....there is a scrolling list of the output from the command line (both STDOUT and STDERR).

On the second tab there is a list of the paths that caused the tool to detect failure (non-zero return value). Single clicking these shows the build output from that step in the lower pane. Double clicking tries to open that path using whatever tool Windows has configured for that extension.

V3

I was going to include the settings for V3, but there are too many hard coded paths to make this useful.

This is what it looks like for me - to use it you need to modify the paths:

  • to the directory where your panels exist (in command line and root)
  • to the batch file to build the panels (build_32bit.bat)
  • to the location of the fresh copy of applcore.exe to bind the UIs
  • to the location of the resource compiler brc32
<preset id="ApplCore Rebind">
    <commandline>"c:\build_32bit.bat" "c:\panels\%TARGET_BASE%"</commandline>
    <extension>*.rc</extension>
    <root>c:\panels\TestPanels</root>
</preset>

...and the batch file referred to (build_32bit.bat) is:

del %1.exe
copy C:\applcore.exe %1.exe
c:\bc45\bin\brc32 -fe"%1.exe" "%1.RC"
exit %errorlevel%

Version Control

Version | Date | Author | Comments
 |  | David Yates | initial release not versioned
1.0.1.0 | 28/01/14 | David Yates | adds failure list minor fix to build step (& removes commented code)
1.0.2.0 | 03/02/14 | David Yates | makes configurable based on presets, adds help
1.0.3.0 | 04/02/13 | David Yates | disables the path/ext controls when the go button is hit
1.0.4.0 | 16/02/15 | David Yates | fix to file browser destination
1.0.5.0 | 19/02/15 | David Yates | writes default config if the file doesn't already exist
1.0.6.0 | 23/10/15 | David Yates | icon to modern standard
1.0.7.0 | 03/02/17 | David Yates | adds TARGET_EXT and TARGET_PATH to text substitutions adds ability to set working directory for tool fixes long-standing issue with reading stderr
 | 27/02/17 | David Yates | Docs conversion to markdown
1.0.8.0 | 03/03/17 | David Yates | Gives command line parameters and log of last run
1.0.9.0 | 06/03/17 | David Yates | Adds configurable "return value for success" value Tiny bugfix to enable state of the working directory edit box
1.0.10.0 | 06/03/17 | David Yates | Adds /configFile command line option
1.0.11.0 | 22/5/2018 | Richard Kerry. | Adds the ability to set named values from the command-line that will be inserted in place of place-holders within the XML config file. Sets F7 key as accelerator for the Go button. Adds a check-box to allow selection of whether or not to recurse into subfolders when searching for the list of files to process.


CC_Sys_Check

Introduction

This document describes the actions of the application called CC-Sys_Check.exe.

CC_Sys_Check is usually run after the installer has completed, it does various tasks including removing old files, updating files etc. depending upon what has changed between versions. This tool only needs to be run when upgrading a system, if done on the server the normal update process for a workstation means that it does not need doing on individual machines.

Configuration

There are no configuration files for this application.

Execution

Upon start-up the application shows a list of tasks that will be performed, the user has the option to manually de-select any tasks that are not required, this is not recommended. Pressing “Go” will cause the tasks to be completed. Each task will report various items of information in the lower half of the screen indicating success or failure.
At the time of writing the tasks undertaken are:-

  • Add the string control to buttons.xml.
  • Delete old binaries that are no longer used or shipped.
  • Remove Colledia Control™ from the QT directory if it exists, this prevent “DLL hell” with DLLs being loaded from random locations.
  • Update the alarm configuration files to reflect the changes to the configuration tool structure.

This application will auto-run if the command line parameter of /GO is supplied.

e.g.

cc_sys_check /GO

Event Logging

All events that are displayed on the screen are also logged for future reference to the logs folder of the current system in a file called CC-Sys_Check.txt

Version Control

Version | Date | Author | Comments
4.5.1.0 |  | Mark Baldry | initial version
4.5.2.0 | 21/04/2015 | David Yates | adds panelman move resource file functions
4.5.3.0 | 21/04/2015 | David Yates | more refined creation of resources - particularly some of the more wacky sizes
4.5.4.0 | 21/04/2015 | David Yates | now moves icon_default too
4.5.5.0 | 23/03/2017 | David Yates | new function to remove all the old docs
4.5.6.0 | 13/04/2017 | David Yates | Adds ability to start automatically on a command line parameter
4.5.7.0 | 03/05/2017 | David Yates | Change to title bar to be more descriptive
4.5.8.0 | 04/05/2017 | David Yates | Command line parameter for path where CC_ROOT/CC_SYSTEM may have not been set or be wrong
4.5.9.0 | 10/10/2017 | David Yates | All very well checking, setting, displaying the path if then the tasks themselves choose to completely ignore it. Corrected
4.5.10.0 | 21/12/2017 | David Yates | Doesn't delete the debug versions of the binaries needed for panel development
4.5.11.0 | 22/06/2018 | David Yates | Rogue versions of .debug.dll files that will erroneously get loaded as they have the right extension - so delete them!


db_loc_blast

Database Location Blaster - db_loc_blast

Introduction

This application is designed to take the instances.xml file, extract the location information and put this in to a database, this allows a 3rd party applications to query the tables associated with the alarm system, then look-up the location, or any other information in this database. The application assumes a standard v4.6 installation, expecting the config directory.

Configuration

The configuration for this module is held in object_settings.xml

<object id="db_loc_blast">
    <setting id="dbDriver" value="QMYSQL3"/>            << QT SQL Driver to use
    <setting id="dbDatabase" value="colledia_alarms"/>  << Database on the server to use
    <setting id="dbTable" value="device_data"/>         << Database table to use
    <setting id="dbHost" value="10.160.9.36"/>          << Name/address of the database server
    <setting id="dbUser" value="colledia"/>             << User name for the database
    <setting id="dbPassword" value="colledia"/>         << Password for the database
</object>

Operation

The specified database must exist, other wise the application will report the error and exit. If the database table does not exist it will be created, note that this may need extra user rights to allow this to happen.
Once connected to the database each non-composite instance that has a valid location is added to the database, if it already exists the entry is amended to match the new location. Any pre-existing instances that no longer appear in instances.xml will be left as they were, this allows the user to store any other data they want in this table, the user can also add further fields to the database for their own use, for instance they may wish to add manufacturer, model etc.

When the application has completed it will automatically exit after a short period.

Version Control

Version | Date | Author | Comments
1.00.00 | 25/08/2004 | MB | Original Release
1.0.0.2 | 11/10/2004 | MB | Looks in the current system directory for the QT sql plugins
1.3 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


DesktopBmp

Introduction

This document describes an application originally written by Chris Gil and David Yates

The application desktopBmp.exe creates an image with useful workstation information on it and sets this to be the Windows desktop display.

Bitmap

The bitmap used is called desktop.png and must be located in the working directory of the application. This is loaded and saved as desktop.bmp in the data directory of the current BNCS system.

Configuration

This application takes workstation number from the CC_WORKSTATION environment variable, workstation name from workstations.xml and IP configuration information from machine itself.

The following configuration is used to set the position of the box that gets drawn, the font and position of the workstation number, name and IP address. This is pretty self-explanatory:

<?xml version="1.0"?>
<DesktopBmp>
    <setting id="Box" X="690" Y="560" W="320" H="190"/>
    <setting id="WSNumber" bold="true" font="Arial" size="28" x="34" y="130"/>
    <setting id="WSName" bold="true" font="Arial" size="12" x="102" y="118"/>
    <setting id="WSIP" bold="true" font="Arial" size="10" x="290" y ="148"/>
</DesktopBmp>

Operation

Upon start-up the application will create a copy of desktop.png called desktop.bmp, on to this it will paint the workstation number, workstation name and the IP address(es) of the local workstation. The generated file is then set as the wallpaper.
This application is normally automatically called during workstation start-up, but could be manually run if required.

Version Control

Version | Date | Author | Comments
 | 06/11/2006 | Mark Baldry | Initial document created.
 | 27/02/2017 | David Yates | Conversion to markdown
1.0.0.1 | xxxxxx |  | first release (no version resources)
1.0.2.0 | 07/02/2017 | David Yates | adds version resources, changes location of desktopbmp file to the system data directory so that it doesn't upset modern windows versions by sticking in the root
 | 22/11/2017 | David Yates | Updates docs to include the configuration information missed somewhere down the line. Also mentions location of desktop.bmp and desktop.png file. Also incorporates what litle version information there is in this file


doSnapshot

System Snapshot Utility

Description

doSnapShot.exe was written to take a zip-file snapshot of the current V4.6 system. It has subsequently been enhanced to allow for use on V2/V3 systems.

The snapshot is every file in the specified path, which are zipped up into a single file.

Command Line

There is a command line option which can be used to run the tool in “non-interactive” mode. This enables it to run as a scheduled job.
To run the tool so that it does not wait for any button pushes use a command line parameter of “/go”. e.g.

doSnapshot /go

This feature was added in version 4.5.0.1.
Version 4.5.1.0 added the following additional command line parameters

Param | Notes
/root=c:\mySystem | Sets the root directory to zip
/outputDir=c:\snapshots | Where to stick the corresponding zip file
/name=mySystemName | The prefix on the filename – if this isn’t supplied the default is the last bit of the output directory

These parameters override the values determined from the V4.6 environment settings.

Input

The current V4.6 system is determined from the CC_ROOT and CC_SYSTEM environment settings or as overridden with the /root command line parameter.
For

CC_ROOT=c:\bncs

and

CC_SYSTEM=v4.6

all files in

c:\bncs\v4.6

will be used.

Output

The output is always put in

%CC_ROOT%\snapshots

so for our example above this is

c:\bncs\snapshots

This value may be overwritten with the /outputDir command line option.
and the filename of the archive contains the system name, the date and the time in the format:

<name>-<date><time>.zip

e.g.

v4.6-2004-12-13_17-04-40.zip

This filename isn’t guaranteed absolutely unique but almost always will be. The part of this filename may be overridden with the /name command line parameter.

Taking the snapshot

When the application starts up it finds the current system from the environment variables and displays this on its dialog.

Some systems are BIG and it can take some time just for the list of files to be generated. Then when it’s running the files being compressed will be displayed.

When the application has finished producing the snapshot, an explorer window is opened with the snapshot directory pre-selected.

Use on a V2/V3 system
V4.6 is handy in that every file required exists in a single directory. This is not the case with a V2 system and probably not so with V3 either.
Do you’d use doSnapShot in a batch file something like this:

xcopy %windir%\dev_???.ini c:\bncs\windir /d
xcopy %windir%\dev_???.db? c:\bncs\windir /d
doSnapShot /name=mySystem /root=c:\bncs /outputDir=c:\snapshots

This puts all the files the BNCS system needs under the one directory ready for zipping. You can then call this batch file as a scheduled job within Windows own task scheduler.

Developers Notes

The external application used for doing the zip can’t be interrupted (not even when killed) so this is why the cancel button is disabled at the same time as the Go button when the snapshot is being produced.

Logging

Version 4.5.3 adds (by default) logging of the debug window output to “the usual place” (typically %CC_ROOT%\%CC_SYSTEM%\logs\doSnapShot or c:\bncslogs depending on your BNCS variant).
These logs are “daily” (i.e. one per day) and can be usually managed using the normal log management features (log delete in V4.6 workstation manager).

Excluded Files

Files/paths can be excluded when running this tool – this value appears in the dialog and may be edited by hand.
It is persisted in %CC_ROOT%\local_settings.ini

[doSnapshot]
Exclude=**/.svn**;*.pch;*.pdb;*.sbr

Version Control

Version | Date | Author | Comments
4.5.1 |  | David Yates | Initial Release
4.5.2 |  | David Yates | Adds list of file filters to exclude
4.5.3 |  | David Yates | Adds logging
4.5.4 |  | David Yates | Changes icon to modern style adds map file to the build
 | 27/02/2017 | David Yates | Conversion to markdown


setCCEnvSetting

SetEnvSetting

Overview

This is a very simple utility for setting a single environment variable. It was designed to that workstations could be automatically configured in a script to have new functionality without having to go round and run installers.

Limitations

There is a deliberate limitation on this application that only environment variables that begin with the characters “CC_” are permitted. This is to stop misuse of this utility to set other random values that could stop a workstation operating correctly (e.g. by mis-setting PATH for example).

Command Line

The command line options are simply:

setCCEnvSettings <key> <value>

where key must begin “CC_” for example:

setCCEnvSetting CC_RESERVE_SERVER_ROOT \\reserve-server\bncs$

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown


setlana

setlana - Set NetBIOS adaptor number

Introduction

SetLana is a utility to allow the user to select which network adapter/protocol binding the BNCS traffic uses.

Operation

When the application is run it will display a list of available protocols and associated network adapters. Select the correct network for the BNCS system you wish to use. Selecting OK will save the selected option to all of the possible places that it may be read from. Later versions (4.5.2.0) support the “V3 path” specified in “bncs_config.ini”.
Note that any application that uses this setting will only read it on start-up so applications will need to be re-started before the changes have any effect.

setlana
Figure 1 SetLana Application

Figure 1 shows a typical laptop, in this case there are 3 network adapters, each with NetBIOS over IP as the only available protocol.

Dependencies

Earlier versions of this application relied on LanaCfg.exe, which was previously supplied by Microsoft, to actually get the information. The latest version will read the registry to get all the information required.
It is still possible to use lanacfg, by supplying the ‘/uselanacfg’ qualifier when the application is run.

Parameters

The following parameters may be used.

/uselanacfg

This will cause the program to be run in the original way, ie by using a call to lanacfg.exe to get the list of Lan adaptors.
It is occasionally necessary to use this if there is a problem with accessing the registry directly.
It needs lanacfg.exe to be available, either in the same folder as setlana, or under C:\Windows.

/debug

This prints extra debugging information to the debug output, which can be seen using SysInternals’ DebugView or similar.

/root=xxx, /system=xxx

These will override the root and system values normally read from environment variables CC_ROOT and CC_SYSTEM.

Version Control

Version | Date | Author | Comments
0.1 | 7/11/2006 | Mark Baldry | Documentation of David Yates' original app
0.2 | 20/11/2006 | Richard Kerry | Version not dependent upon lanacfg.
0.3 | 21/11/2006 | Richard Kerry |
0.4 | 23/04/2008 | Richard Kerry | Added parameter descriptions.
0.5 | 11/06/2009 | David Yates | Made V3 aware
1.0 | 27/02/2017 | David Yates | Conversion to markdown


sql_script

SQL Script Tool

Overview

This tool provides the ability to write and action SQL scripts to be used on SQL databases, it is designed to be used as a maintenance tool for use with the Colledia Control alarm system. The built in Windows scheduled task is a sutiable way of automatically starting this tool to perform regular database maintenance tasks.

Description

The application screen is divided into 4 areas, working from the top these are server details, you will need to get these from the server administrator, SQL statement, query results and status view.
The SQL statements need to be laced on separate lines if more than one is to be executed in a go, if using MySql each statement will also need to be terminated with a semi-colon.

Command line parameters

Sql_Script.exe AutoRun=select.dbs

If the application is started with the AutoRun=file option the specified file will be opened and the script executed.

Example scripts

The examples provided have not been thoroughly tested, and some command syntax may vary on different server types.

Selecting data and saving it to file

SELECT *
INTO OUTFILE '/tmp/result.text'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM historical_log
WHERE date_time > DATE_SUB(CURDATE(),INTERVAL 8 DAY)  && date_time < DATE_SUB(CURDATE(),INTERVAL 6 DAY)
order by date_time desc
limit 2500;

Counting number of entries in historical log

select count(*) from historical_log

Deleting old entries and reporting the new count

SET @daysback := 18;
delete FROM historical_log
WHERE DATE_SUB(CURDATE(),INTERVAL @daysback DAY) >= date_time ;
select count(*) from historical_log;

Repair a database

REPAIR table historical_log quick

Create table indexes

drop index devIndex;
drop index stateIndex;
drop index levelIndex;
drop index ugIndex;
drop index p_idIndex;
drop index dateIndex;

create index devIndex on historical_log(device_name);
create index stateIndex on historical_log(state);
create index levelIndex on historical_log(level);
create index ugIndex on historical_log(usergroup);
create index dateIndex;on historical_log(date_time
create index p_idIndex on historical_log(process_id);

Version Control

Version | Date | Author | Comments
4.5.0.0 |  | Mark Baldry | Initial release
4.5.0.2 |  | Mark Baldry | Tab order fixed
4.5.1.0 | 27/02/2017 | David Yates | Conversion to markdown


WritePrivateProfile

Description

A command-line utility for patching .ini files, or other files written using Windows’ WritePrivateProfileString() function.

Introduction

This utility is to automate patching of ini files and db files, or any other file in that format which is in the configuration directory of a project. For example it might be used to set all the ‘Simulation’ flags for a system under development. This might be done from the ‘nosync’ batch file run by Workstation Manager.

It is controlled by an xml file which specifies for any workstation which entries are to be written.

From Version 1.0.1 it is able to write to any file.
From version 1.0.2 it is no longer v4 specific (ie only using %CC_ROOT%/%CC_SYSTEM%/config/system’). Ie it will work using the v3 or v1/v2 file locations.
From version 1.0.3 it is able to do patching on any workstation not just the one matching a single <workstation> element. Also a variable “workstation” is automatically created with the current workstation number.

Parameters

The program takes one parameter, which is the name of an xml file that controls the edits. If the program is run with ‘–?’ or ‘/?’ as parameter, a brief help message is displayed to this effect. If the program is run with no parameters, or more than one, an even briefer message is displayed.

The extension ‘.xml’ will be added if it is not supplied.

The name is first searched for in the configuration directory. If a matching file is not found there the given name will be searched for as a normal absolute or relative file-name.

Configuration Locations.

The program is able to work using all three conventional locations for the files, both its own configuration file and the dev.ini files being patched.

The V4 location

If the environment variables CC_ROOT and CC_SYSTEM are present, the “V4” location is used.
The configuration file is in a folder specified using environment variables CC_ROOT and CC_SYSTEM.
The config file is first searched for in %CC_ROOT%\%CC_SYSTEM%\config.
The files being patched are assumed to be in %CC_ROOT%\%CC_SYSTEM%\config\system.

The V3 location

If the environment variables CC_ROOT and CC_SYSTEM are not both present, the “V3” location is used.
The configuration file is in a folder specified in C:\bncs_config.ini. The location of the config files is given by the ConfigPath key.
The files being patched are in a folder given by the SystemPath key.

The v1/v2 location

If neither of the above locations are specified, the “V2” location is used.
The configuration file, and the files to be patched, is in C:\Windows or C:\Winnt, according to the value of the WINDIR environment variable, as also seen using the GetWindowsDirectory function.

Qualifiers

-var

The program may take any number of ‘-var’ qualifiers. These create variables that may be referred to by the parameter file.

The syntax is ‘-var:name=value’. This creates a variable called ‘name’, containing ‘value’.

The variables may be used in any attribute in the profile.xml file. They should be referenced in the form ‘%name%’.

For example:
If ‘-var:Enable=1 –var:Key=Simulation’ were given as the parameter.

<setting file="dev_101.ini" section="Grd" key="%Key%" value="%Enable%"/>

Would be equivalent to :

<setting file="dev_101.ini" section="Grd" key="Simulation" value="1"/>

The “workstation” variable

A variable called “workstation” is always available, containing the workstation number of the workstation it’s running on.

Parameter file

The file that controls the program is an xml file. There is a dtd file available to specify its structure (profile.dtd).

The outermost element is <workstations> of which there should be one.

Within this is a <workstation> element for each workstation to be edited. Each <workstation> element has an ‘id’ attribute holding the workstation number.
If the ‘id’ attribute has the value “*” the element will be used when run on any workstation, whereas a numeric ‘id’ will only be used when run on the workstation with that number. (From version 1.0.3)

Within each <workstation> element are a number of <setting> elements. Each of these has attributes as follows:

Attribute | Notes
file | The name of the file to be edited.
section | The name of the section within the file.
key | The name of the key to be written, within the given section.
value | The value to be written to the key.

Filenames are assumed to be relative to the location as described in Section 1.3 Configuration Locations.
From version 1.0.1 it is also possible to put a full path name here. Eg C:\Windows\caplog.ini.

Main Program Function

The parameter file is read. If a <workstation> element is found whose ‘id’ attribute value matches the number of the workstation where it is being run, or whose ‘id’ attribute is ‘*’, the associated <setting> elements are used.

Each <setting> element’s attributes give the name of a file to be edited and the section and key to be edited or added, and the value it is to be given.

Example

Using profile.xml with contents as follows.

<?xml version="1.0" encoding="utf-8" ?>
<workstations>
  <workstation id="901">
    <setting file="dev_100.ini" section="Grd" key="Simulation" value="1"/>
  </workstation>
  <workstation id="903">
    <setting file="dev_251.ini" section="Configuration" key="Com" value="2"/>
    <setting file="dev_252.ini" section="Configuration" key="Com" value="3"/>
  </workstation>
  <workstation id="*">
    <setting file=" ../ws/%ws_in%/bncs_system.ini" section="Network" key="Workstation" value="%ws_in%"/>
  </workstation>
</workstations>

The effect of running the command with this parameter file would be as follows:
When run on workstation 901, dev_100.ini would have :

[Grd]
Simulation=1

Added if this key was not present, and the value rewritten as shown if it was already present.

When run on workstation 903, dev_251.ini would have :

[Configuration]
Com=2

Added if this key was not present, and the value rewritten as shown if it was already present.

And dev_251.ini would have :

[Configuration]
Com=3

Added if this key was not present, and the value rewritten as shown if it was already present.

When run on any workstation, the file bncs_system.ini, in a folder under “ws” whose number corresponds to the “ws_in” variable, would include :

[Network]
Workstation=x

Where ‘x’ matched the ‘ws_in’ variable set on the command line.

Bulk generation of bncs_system.ini files

The wildcard option may be used to build sets of ini files for a project, a requirement that particularly arises when many files are required under the ‘ws’ folder.
The following Windows batch file may be used as a template for this activity.
It should be placed in config\ws and the “first” and “last” variables be set to the limits of the set of files required.

rem  Generate loads of bncs_system.ini

set first=991
set last=995

set count=%first%

:again

mkdir %count%

rem  Use copy to copy in the template batch file.
copy/y bncs_system_ref.ini %count%\bncs_system.ini

rem  WritePrivateProfile to stamp the workstation number.
WritePrivateProfile Profile -var:ws_in=%count%

set /a count=%count%+1

if %count% leq %last% goto again

Version Control

Version | Date | Author | Comments
0.1 | 27/10/2006 | Richard Kerry | First version using new template.
0.2 | 08/01/2009 | Richard Kerry | Able to write to any path.
0.3 | 23/11/2009 | Richard Kerry | Able to work with v1/v2/v3 configurations.
0.4 | 02/09/2010 | Richard Kerry | Added wildcard workstation number. Added automatic workstation number variable.
1.0 | 27/02/2017 | David Yates | Conversion to markdown


v3caplog

V3CapLog - BNCS Network Capture Log

Description

V3CAPLOG.EXE is a 'Capture Log' utility, but also known as 'Captains Log'. It logs to screen and disk all BNCS commands and revertive traffic across the network.

Disk files are date/time stamped so that all the traffic for a single hour is in an individual file. The entries within the files are then time stamped.

CapLog will capture BNCS traffic from "version 2" or later drivers - this means from CSI 1.16 onwards including all current V2, V3, V4, V4.5, V4.6 modules.

CapLog will run from any directory.

V3Caplog Basics

BNCS network traffic

V3Caplog listens to the BNCS network traffic and logs all the commands and revertives to screen and disk.

Caplog can generate very large files containing every message sent on a busy network. Modern disk drives can hold a lot of data but use of automatic utilities to archive or delete old files after a reasonable period of time. There is a BNCS Utility called LogDelet.exe that can be used but read the instructions to ensure only the unwanted files are deleted. In a V4.5 system this deleting is achieved by Workstation Manager and the configuration in logdelete.xml.

Filter settings

Specific BNCS device numbers can be monitored or excluded using the Configuration tab. Filter settings can be saved and recalled.

By default all messages are logged and displayed, the Configuration menu tab allows filtering by device number. Noisy devices such a chattering GPIs, fluctuating levels etc can be excluded from the log if they generate a lot of network traffic making specific events difficult to see. Changes made using the configuration tab are not saved by default and the filter settings from the ini file can be recalled.

Pausing the screen

The screen can be paused by clicking the mouse within the window, or pressing the spacebar.

Log files continue to be saved to disk when the screen is paused. Click again in the screen area to resume display updating.

Screen clear

If the feature is enabled (menu item Window->Double Click Clear) a double touch will clear the screen and continue in un-pause mode, whether or not the screen was previously paused. This feature was introduced particularly for when CapLog is running on a touchscreen.

Always On Top

If this feature is enabled (menu item Window->Always On Top) CapLog will remain on top of other windows.

Log files

Log files are created in the C:\BNCSlogs directory, they can be opened with a standard text editor i.e. Notepad.

A new file is started each hour. Caplog file naming convention is ‘YYYYMMDD.HH’ where YYYY is the Year, MM is the Month, DD is the Date and HH is the hour of the day 0-23. The current log file name is shown in the application title. The default directory for the log files is ‘C:\BNCSlogs’, this is set in the caplog.ini file

The information contained in the log files can be searched with text utilities i.e. Windows GREP (shareware) for lines containing a specified Command or Revertive pattern and can display a number of lines either side of the match to convey the context of the event. This is a very useful technique for hunting down specific events in a folder full of large text files (set filetype to . or to the exact hour if known)

To import information into a spreadsheet – the log is a text file, the Delimiter is a ‘Space’ and the Text Qualifier is {none}. Refer to spreadsheet help file for import and filtering techniques. There are a number of other utilities written by the developer community for analysing the log files.

Command Line

From version 3.14.11 V3CapLog has the following command line options usually taken from csi.ini or bncs_system.ini:

Optional Command Line Parameter | Notes
/CHANNEL=0 | Override of channel number
/ADAPTOR=0 | Override of adaptor number

These were added so that more than one V3CapLog could be run on a single machine monitoring more than one network adaptor.

V3CapLog Advanced Features

Caplog.ini File

A CAPLOG.INI file contained in the appropriate location for your BNCS system will be created that allows commands and revertives for each driver to selectively filtered out. There are separate sections for both of these. CapLog should be restarted after any changes have been made to the INI file. A '0' against an entry will mean that the device will be ignored, a '1' means it will be logged. From version 1.00.11 there is a [WatchDog] in the CAPLOG.INI file. An InfoDriver Id and slot number can be specified. Every minute the date and time will be written to the InfoDriver indicating that CapLog is still functioning. If either of the parameters is set to zero then the feature is disabled.

Caplog.ini file can be viewed and edited using a simple text editor such as Notepad. An application restart is required after making changes.

Section/Entry/Default | Notes
[Network] |
Channel=0 | Use same channel setting as CSI
ShowURheader=1 | Hide/Show Universal Revertive header & message count
ShowNxMessages=1 | Hide/Show background network messages
ShowPacketSerial=1 | Hide/show packet serial numbers
ShowHeartbeats=1 | Hide/show heartbeat packets
ShowPacketRecovery=1 | Hide/show packet recovery traffic
SavePackets=0 | Save message packet to file
CommandReplayEnabled=0 | Enable Command checkbox for replay selection from packet file
RevertiveReplayEnabled=0 | Enable Revertive checkbox for replay selection from packet file
MillisecondDisplay=0 | Enable display of time in milliseconds.
[Watchdog] | An Infodriver slot can be updated every minute with Date and Time, used to indicate Caplog still functioning.
InfoDriver=0 |
InfoSlot=0 |
[Paths] |
LogFilePath=c:\bncslogs | Default path to log file directory
[Commands] |
Device_nnn=1 | Hide/Show device commands (also set by Menu Configure tab) - where nnn is device number 1 - 999
[Revertives] |
Device_nnn=1 | Hide/Show device revertives (also set by Menu Configure tab) - where nnn is device number 1 - 999
[Time] |
SetSystemTime=1 | Whether to set the system time from incoming TS messages (generated from CSI where time server is enabled). It was found that if you run CapLog on a machine that is also the time server, Windows can get confused and would apply the DST autumn offset (an hour back) at the end of every hour meaning it would repeat the 0100-0159 hour ad infinitum

Note - the Command and Revertive filter settings can be modified using the Configure panel without requiring Caplog restart. Changes are not saved by default.

Temporary Information

Temporary information about the windows position is (from version 3.11) located in the file Caplog.tmp in the "temp" folder.

Section/Entry | Notes
[Coordinate] |
XCoord=xxx | coordinate of the caplog window.
YCoord=yyy | Y coordinate of the caplog window
Width=www | width of the caplog window
Height=hhh | height of the caplog window

Analyse log and packet files

Analysing a selected log file shows the timestamps when caplog and the packet data files where opened and closed etc during the logging period but not the actual message data.

Packet Analysis

Entire message packets can be saved for detailed examination offline

Caplog will save packet data files in the specified logs directory if the ini file setting for ‘SavePackets’ is changed from default ‘0’ to ‘1’ and Caplog restarted. The packet data files can get extremely large.

A selected packet data file can be opened from the Packet menu tab and viewed for detailed system analysis.

Command and Revertive packets can be replayed from a predetermined point either in Single Steps or as a continuous sequential Replay at a preset Rate (set time in ms)

The ini file settings for Command and Revertive Replay Enable/Disable the ‘Cmds’ and ‘Revs’ replay option checkboxes. The default is for them to be disabled.

Warning - On a live system the packet replay feature of Caplog should be left in the disabled mode and files taken for examination offline, the replay of commands out of time and context could have unexpected side effects!

Watchdog

There is an option to send Date and Time stamp to a specified infodriver slot every minute.

Enter valid Infodriver and Slot numbers into Watchdog section of caplog.ini file and Caplog will update the slot every minute with a Date and semi colon delimited time stamp eg:

IW 100 '29-10-2007 - 14;38;31' 1

This can be used by an alarm system to determine that Caplog is still active and functioning.

Copy screen to clipboard

Version 3.14.03 introduces a "copy to clipboard" function where hitting the 'C' key will copy the currently displayed text to the clipboard.

CapLog Dependencies

CapLog looks for BNCS_CC.dll (custom control buttons) in the usual system directory for the BNCS version you are using.

From V3CapLog 3.15 the external DLL packetRecoveryListener.dll is no longer required. Packet recovery traffic monitoring is also supported on 64 bit OSs with this version.

Known Issues

CapLog has issues displaying/recording "version1 " device messages - this refers to devices that were written before introduction of CSI 1.16 (which curiously supports version 2 messaging).

There are no currently supported "version 1" network devices.

Caplog External Message Rewriting/Filtering

CapLog filtering/analysis can be extended with external module.

CapLog has a couple of simple hooks to allow data to be manipulated before it hits the screen and disk log.

Mechanism

At startup CapLog looks to see if it can load an external DLL called "caplogMessageRewriter.dll" - if it can it enables the appropriate menu item: Show->Interpret Messages.

When this menu item is selected it loads the DLL and resolves the function with the name "MessageRewrite". This has the signature:

int MessageRewrite( const char* in, char ** out )

Where the parameters are:

Param | in/out | Notes
in | input | pointer to the single line to be written to the log
out | input / output | pointer to array of 32 pointers of values to write to the log

Return value of this function is the number of values set in the out array - corresponding to the number of lines to write to the log. This can be zero so nothing is written.

Before writing any line to the log CapLog calls this function.

The following is a very simple example of its use:

int MessageRewrite( const char* in, char ** out )
{
    // this is the number of things we're returning - this might remain zero if we want to filter a message out
    int count = 0;

    // retain the original message
    out[ count++ ] = (char*) in;

    // append an additional line - NOTE: pointers must remain in scope when this function exits
    out[ count++ ] = "blibble";
    return count;
}

Runtime Edit

There is a second exported function which enables run-time editing of the settings for this extension DLL:

This has the following signature:

void MessageRewriteEdit( HWND hWndParent )

Where the parameters are:

Param | in/out | Notes
hWndParent | input | Handle of the parent application

Typically this would have an implementation something like this:

// this is our exported function that V3caplog will call to initiate the editor
void MessageRewriteEdit( HWND hWndParent )
{
    DialogBox( ghInstance, MAKEINTRESOURCE( IDD_DIALOG1 ), hWndParent, (DLGPROC) DialogProc );
}

Note that it's important to use a DialogBox with parent set so that the dialog retains focus - otherwise the user can deselect the Show->Interpret Messages menu item and unload the DLL causing a crash.

DLL File Location

"caplogMessageRewriter.dll" is loaded from "the usual" DLL path for your system:

Version | Path
V2 | c:\windows
V3 | Value set by: [Config] SystemPath=w:\v3 entry in c:\bncs_config.ini
V4.5 | %CC_ROOT%\%CC_SYSTEM%\windows\lib

Version Control

Version | Date | Comments
1.00.00 | 22/05/97 | First release
1.00.01 | 06/10/97 | Bug fix to length of text scrolled
1.00.02 | 05/11/97 | Catches Universal Revertives Flying file handle implemented Improved revertive handler
1.00.03 | 17/02/98 | Added primitive filtering
1.00.04 | 03/03/98 | Bug fix to prevent long commands crashing
1.00.05 | 22/03/98 | Commands now split onto seperate lines Message index now printed out
1.00.06 | 25/03/98 | Pressing the space bar toggle printing to the screen
1.00.07 | 06/04/98 | Now reliably changes filename at date rollover
1.00.08 | 19/05/98 | Clicking on client area toggles screen writes Added packet header info
1.00.09 | 03/06/98 | Now locks time to CSI's time service messages
1.00.10 | 19/06/98 | Now opens new log file every hour
1.00.11 | 28/06/99 | Now sends the time and date to an InfoDriver slot as a watchdog every minute
1.00.12 | 21/02/00 | Added access to the 100 network channels feature in CSI 1.17.03
1.00.13 | 19/06/00 | Network Attention message now used by CSI 1.18.xx and later. Removed ambiguous message. Added CSCmd_NetInquire() and CSCmd_NetObject()
1.00.15 | 11/01/01 | Tidied up presentation of 'Network' (Nx) messages
1.00.16 | 16/08/01 | Added log file path to INI file.
1.00.17 | 03/10/01 | Added log analysis function
1.00.18 | 20/03/02 | Added option in INI file to toggle display of N series messages
1.00.19 | 07/05/02 | Mod to filtering of N series messages
1.00.20 | 03/09/02 | Now logs Network Loopback (NL) messages
1.00.21 | 02/05/03 | Now correctly logs commands to device 999
x.00.22 | 04/08/03 | Compiled to be 32 bit
x.00.23 | 10/11/03 | Added configure system
3.01.00 | 29/04/04 | Added packet saveing and replaying mechanisms
3.01.01 | 11/01/05 | Bug fix to CSCmd_UniRevertive() in filtered mode to not discard messages in a packet that follow a disabled Id messsage
3.02.00 | 25/05/05 | Added Net Status handler
3.02.01 | 24/06/05 | No longer crashes when pressing 'Cancel' in Packet Open File dialog Can now only open one instance of the Config & Packet dialogs Only displays that it cannot open log files once, then exits Attempts to create log file directory on start up On packet dialog pressing 'Previous' stops at packet 1
3.02.02 | 27/06/05 | Bug fix to repeat selection of Config & Packet dialogs
3.02.03 | 04/07/05 | Brings up a message box if BNCS_CC.DLL is missing and exits
3.03.00 | 19/09/05 | Reinitialises after network disconnection Now displays originating workstation in universal header message Now displays target workstation for each message in packet.
3.03.01 | 24/11/05 | WndProc definition changed to be LRESULT CALLBACK to correct painting corruption
3.03.02 | 07/12/05 | Now correctly decodes workstation Ids greater than 256
3.03.03 | 22/12/05 | Added NetBroken handler
3.04.00 | 15/02/06 | Now uses GetConfigDirectory in bncs_gcd.cpp/h wParam masked in Dialog procedures to correct list box selection problem
3.04.01 | 14/03/06 | GetConfigDirectory() now GetBNCSConfigDirectory()
3.04.02 | 29/03/06 | Now uses GetBNCSSystemDirectory for LoadLibrary() calls
3.04.03 | 06/06/04 | Bug fix to V1 revertive handlers
3.04.04 | 20/04/06 | Bug fix to correctly store packet length in PKT files
3.05.00 | 06/04/07 | Build from CVS
3.05.01 | 11/10/07 | Now uses v4/3 directories for config and libraries
3.06.00 | 21/08/08 | Bug fix to V1 GPI revertive handler to correct for maximum header size not having null terminator Uses import library from new BBCNB32B.DLL containing session status calls (not yet used in V3CapLog)
3.06.01 | 26/09/08 | Increased maximum length of dispayed line in scrolling window from 127 to 300 Now filters Router Modify messages as well as commands and revertives based upon device id filter
3.06.02 | 02/10/08 | Fixed memory leak caused by _fstrcpy copying excessive spaces without null terminator
3.07.01 | 16/03/09 | Shows serial number indication to revertive packets that support them
3.07.02 | 19/03/09 | Shows serial number indication to command packets that support them
3.08.00 | 08/06/09 | Menu items for UR, N and serial number display toggle
3.08.01 | 08/06/09 | Sets background brush for the class type to the same colour as the draw text - doesn't really reduce the flashing but makes it less objectionable
3.08.02 | 11/06/09 | Minor fix to explicitly set the state of the show packets flag properly on first run
3.08.03 | 27/08/09 | Writes log file configuration path AFTER setting the path variable as to where to write it
3.09.00 | 01/10/09 | Replaces newline chars in logged messages with spaces Has simple understanding of heartbeat messages for CSI32 enhancements
3.09.01 | 21/12/09 | Fixed the flickering of screen on resizing. The information in the generated log files goes as per the needs stated in bugs 1535, and, there is no resetting of network settings on closing the caplog (bug 1536).
3.10.01 | 19/01/10 | Has better understanding of heartbeat messages and reports heartbeat workstation number correctly (network byte ordering)
3.10.02 | 22/02/10 | adds workstation number to each individual serial number entry corrects handling of heartbeat header size
3.10.03 | 04/01/11 | removes copies of data that were of insufficient size (causing crash) massages a few buffer sizes to be things like MAXPATH rather than random values
3.10.04 | 11/02/11 | 1. csi.ini path issue is resolved [Bug id 1871] 2. Horizontal wrapping of text is implemented as per the requirement [Bug id 1710] 3. [Bug 331] window last size is remembered for next session. 4. [Bug 331] caplog.ini path is written below the title bar.
3.10.05 | 14/03/11 | [Bug 331] caplog.ini path is visible using the menu item help -> path.
3.10.06 | 29/03/11 | [Bug 2006] Double click screen clear for touchscreen use
3.10.07 | 30/03/11 | [Bug 2006] Improved Double Click to clear then continue in non pause mode
3.10.08 | 31/03/11 | Optimisation and performance improvements DGY
3.10.09 | 01/04.11 | Merged versions 3.10.07 and 3.10.08
3.10.10 | 02/05/11 | Resolved the path issues for the default adaptor for v3 and v4 system and add new msg box to display the default adaptor path using the menu item HELP->Default Adaptor Path.
3.11.00 | 19/05/11 | uses external DLL to add packet recovery messaging also has simple colouring for packet recovery and N messages
3.11.01 | 20/05/11 | adds understanding of close message in heartbeats
3.11.02 | 23/05/11 | fix to packet recovery listener so if the feature is enabled but the DLL not present it fails gracefully rather than popping up a msgbox
3.11.03 | 23/05/11 | Closedown heartbeat now marked as such rather than a "0 secs" update rate
3.11.04 | 01/09/11 | Bug2099 - Fixed - V3Caplog colours not consistent on multi-line entries (for network messages)
3.11.05 | 29/11/11 | Bug2161 - Fixed - V3Caplog text wrap colour (for heartbeat messages)
3.11.06 | 02/12/11 | Bug2171 - Fixed - Resize limit for V3Caplog window to prevent crash
3.11.07 | 05/01/12 | Now recalls window position on startup (path not set) and adds long overdue "always on top" menu option
3.11.08 | 25/03/12 | Validation of incoming heartbeat messages
3.12.00 | 11/03/12 | Hooks for external rewriter application (allows filtering, text replacement)
3.13 | ?????? | ?
3.14.00 | 14/06/12 | Changes compiler to MS (resource conversion Richard Kerry). Integrates Help. Reading/creating device filter optimised (virus checker issues with 2000 individual file operations)
3.14.01 | 15/06/12 | Clarifies version history for resources. Writing device filter now done with optimised code (when you hit the save button on the device filter dialog)
3.14.02 | 15/06/12 | Turns screen red when paused (a Tim Hall feature request). Also updates the title bar properly when you press the keyboard to pause the display
3.14.03 | 18/06/12 | Adds mouse wheel support. Adds support for keyboard up/down/pageup/pagedown. Adds copy-to-clipboard of whatever is currently displayed (hit c) Makes V scrollbar.....scroll....and tidies up how it's used
3.14.04 | 18/06/12 | makes device filter dialog a popup create dialog rather than a child dialog
3.14.05 | 19/06/12 | fix to ensure we don't randomly overwrite the end of message rewriter strings
3.14.06 | 26/06/12 | Now shows client and driver heartbeats and inserts serial numbers (if show serial numbers is enabled) First "proper" VS release
3.14.07 | 03/07/12 | Very silly mistake crossing day/month values in Borland/Microsoft date/time compatibility classes
3.14.08 | 03/07/12 | Speculative fix to trap divide by zero error (where values shouldn't be zero)
3.14.09 | 06/07/12 | Corrects inaccuracy in version history for 3.14.07 Timestamps are sent with hundredth values from Borland-based CSIs, and thousandths from Microsoft-based CSIs....CapLog always expecting hundredths so a conversion applied
3.14.10 | 14/12/12 | Makes max line display length 2048 to cope with expanded heartbeat strings
3.14.11 | 22/07/13 | allows command line override of channel and adaptor number
3.15.00 | 15/10/13 | now doesn't use external DLL for packet recovery messages but uses normal NetBIOS "buffers" - this means it'll work on Win7/64
3.15.01 | 11/11/13 | now filters RD messages according to the revertive filter
3.15.02 | 11/09/14 | Window position/size configuration file (caplog.tmp) now in "temp" folder. Option now available for times to be displayed in milliseconds - use [Network]MillisecondDisplay.
3.15.03 | 02/07/15 | Removes definition of max devices (twice) in CapLog's own header file in favour of the shared one in bncs.h
3.15.04 | 21/07/15 | Sticks a label across the top of the screen if the device filter has any devices filtered out
3.15.05 | 19/10/15 | Minor changes to keep the VS2013 build of this app happy. Adds map file
3.15.06 | 29/10/15 | New config setting (with legacy default) to allow turning off of setting local clock from incoming TS message
 | 27/02/2017 | Conversion to markdown
3.15.07 | 29/10/15 | Erroneous display of V1 GPI messages when paused now fixed


inf32fix

inf32fix.exe

Description

inf32fix.exe is required so that infodriver (infodriver32/v4infdriv) can receive some broadcast messages (HWND_BROADCAST) that otherwise it would be unable to hear.

There is a difference between Borland compiler built applications and Microsoft in that Microsoft applications are totally deaf to certain ranges of messages sent from other applications with HWND_BROADCAST. Typically this is thought (not confirmed to be so…) any thing below WM_APP (0xc000).

Unfortunately some of these messages are the hook-in messages required to connect external drivers with ID_CONNECT.

The work around is to use a simple Borland-built application to receive these on behalf of the Microsoft application. All the Borland-built application does is then pass them direct onto the Microsoft application.

inf32fix.exe receives the messages, looks up the handle of the messaging window for the appropriate infodriver and passes the hook-in message on.

To know which numbered infodriver has which window handle they share this data with the info32fix.dll. This allows for cross-process sharing of simple data such as an array of window handles.


wiz

Application Wizard

Description

This is a piece of software that can be used to write other pieces of software! It can provide template code to make the whole development process that much less painful.

This wizard is similar to the Application Wizard found within Visual Studio but it is an external application that could be used to build Linux projects, or ApplCore projects.

What the Wizard does

What the wizard does is takes a number of template files and wraps them up into a single wizard DLL, which can be easily distributed. When the user enters a project name and a file path in the wizard and hits “Go” then the wizard extracts some or all of these files, optionally replaces text in the files (to name them the same as the project name or to include other options). The wizard can then be used to build project files allowing C++ projects to be imported into Visual Studio.
Example Wizard Uses:

  • Building plugins for the Wizard (!!)
  • Building Qt custom widget applications
  • Building C++ BNCS Driver / Panel applications
  • Building ApplCore panels

Architecture

The Wizard uses a system of DLL “plugins”. This means that there is the basic shell of the wizard and other modules can be added (hopefully by a number of authors) as and when required.
Wizards are authored in Qt, but don’t necessarily have to build Qt applications.
The Wizard shell itself does very little – you select the project type you want to build, and then the location of where you want to put the template code. The shell then just calls the plugin.
The plugins do all the actual work. Typically the plugins will have all the template code embedded into the DLL.
Simple plugins will do no more than just extract the template code and then perhaps build a Visual Studio project file.
Complex plugins may offer a number of different options and then produce a project with only the relevant files / sections included.
Building makefiles or Visual Studio Project Files (.dsp) for C/C++ projects
There are two methods of doing this – the easy way or the hard way!
The easy way:

  • take a working example of your finished application (of the sort that your Wizard is to produce). Then simply replace the relevant bits within the make/dsp file.

The hard way:

  • build a .pro file and use qmake.exe to translate this into the relevant project files.

I would strongly recommend the first approach (thankfully the easy way).
The “hard way” also requires that the end user of your wizard has to have Qt installed on their machine.

Building make/dsp files by text replacement

Take your working make/dsp file and look for all instances of the files that you need to change the name of – generally this will be files the same name as the project name that the user enters into the Wizard.
Replace the filenames with the text replacement strings %%NAME%%.
Treat the make/dsp file in the same way that you would a normal wizard project file – doing the normal text replacements as the file is extracted.

Building make/dsp files using QMake

I’m not going to explain this here – this requires more intimate knowledge of QMake than I’m prepared to document!

Embedding and Extracting Template Source Files

The Qt utility qembed.exe enables embedding any file into a normal header file suitable for inclusion into a Qt project. It is a command line tool.
e.g.

qembed main.cpp main.h > embedded.h

this embeds the files main.cpp and main.h into the file embedded.h.
qembed.exe is not normally built as part of the normal Qt install and you have to do this by hand – just open “C:\Qt\tools\qembed” (assuming you installed Qt in “c:\qt”) and build qembed.exe from the project file (qembed.dsp). Move the resulting executable into “c:\qt\bin”.
Part of the embedding process also includes the code to extract the data. If you open your header file you’ll find:
static const QByteArray& qembed_findData( const char* name )

Using the embedded files

There are some BNCS helper functions to extract this file and save it:
e.g.

void wiz::savefile( QString in, QString path, QString replace = "" );

This function takes an input file (contained in the string “in”) and saves it to the path “path” and optionally replaces %%NAME%% placeholders with the “replace” string given.
e.g. the following extracts the file “main.cpp” from the data embedded in the header file, saves it as “main.cpp” in the destination path handed to the plugin by the wizard and replaces any instances of %%NAME%% with the string “stuff”.

    wiz::savefile( qembed_findData( "main.cpp" ), path + "main.cpp",  “stuff” );

The second of these functions can do multiple replacements within the input string by passing it a list of tag/text pairs:

void wiz::savefile( QString in, QString path, QStringList replacelist );

e.g. Consider the following source file:

void main( void )
{
    %%PLACEHOLDER1%%
    %%PLACEHOLDER2%%
}

we want to replace the place holders with data. In the following example we’ll replace PLACEHOLDER1 with a simple function call and PLACEHOLDER2 with the entire contents of another embedded file.

    QStringList sl;

      sl    << "%%PLACEHOLDER1%%" << "printf( \"hello world\" );";
      sl    << "%%PLACEHOLDER2%%" << qembed_findData( "bit.cpp" );

    wiz::savefile( qembed_findData( "in.cpp" ), fullpath +"in.cpp", sl );

In this example the “%%PLACEHOLDER1%%” is replaced with a simple hello world function. “%%PLACEHOLDER2%%” is replaced with the whole of another embedded file called “bit.cpp” (note the compiler takes care of the cast required to convert the QByteArray returned by the de-embed function to a QString).
You may want to optionally replace the placeholder depending upon the options that the user selected for this build in which case you’d see something like:

if( sayhello_option_selected )
    sl      << "%%PLACEHOLDER1%%" << "printf( \"hello world\" );";
else
    sl      << "%%PLACEHOLDER1%%" << "";

the important things to note are that the strings are in pairs, and that you should replace all placeholders with something even if it’s nothing.
There’s one more save function for binary files (executables, data, image etc.)

void wiz::savefilebinary( QByteArray in, QString path );

e.g.

wiz::savefilebinary( qembed_findData( "applcore.exe" ),  path + “name” + ".exe" ));

A step by step guide to creating a new Wizard

This wizard will build a new project that builds a very simple Windows console application that prints “Hello” and the application name. This means you have to do all the steps required to build any C/C++ Visual Studio Wizard.

Run the Wizard and select the “Create new Wizard” option, and enter a name and path. Lets assume to help in this explanation you’ve called the new Wizard “mywiz”.

Hit OK to create the new template Wizard.

A dialog should then confirm correct creation of the makefile and Visual Studio project file.

Navigate to wherever you created the new Wizard files and open the “mywiz.dsp” file with Visual Studio.

You should then have a project with all the necessary files to build a new Wizard.

Lets run through the files:

File | Notes
mywiz.cpp / mywiz.h | are the files you will have to do most work with to create your wizard project. The files are created with a large block of comments that gives some sample function calls.
wiz_util.cpp / wiz_util.h | contain useful utility functions (like file saving functions) that should make writing your wizard as easy as possible. You shouldn’t have to modify these but they are there if you want them.
_readme.txt | a short readme file to explain some of what you have to do to embed files.
bncs_wizard_plugin.h | This contains the base class of your wizard function and the code necessary to make it a plugin – you don’t need to do anything with this – it just needs to be included in mywiz.cpp
embedded.h | This is where all your embedded code/files need to go. See above about using qembed.exe to embed your files into this header

We need to create the file that will be used as the template for the application we’re going to build.
We’ll call this main.cpp and it should look something like this:
main.cpp:

#include <stdio.h>

void main( void )
{
    printf( “Hello %%NAME%%” );
}

Notice the fact that we’re included a placeholder %%NAME%% for the application name in the code.
We need to do the following steps for this or any other file we’re going to include in a Wizard.

  • Embed the file into the source code – do this by right clicking “embedded.h” in your project view and hit settings. In “Custom Build”/“commands” type something like:

    c:\qt\bin\qembed.exe main.cpp > embeded.h

  • Put a line to extract this file in the “go” function in “mywiz.cpp”. This is going to look like:

    wiz::savefile( qembed_findData( "main.cpp" ), fullpath + "main.cpp", name );

What this does is extract the file main.cpp, save it to the path provided to us (which is what the user typed in). In this case whilst saving it, replace any instances of %%NAME%% with the application name.
That gets the source code saved into the right directory.

The tricky bit

It’s not anything to do with this wizard as such:

Work out how you’re going to structure your project, what files you’re going to need and what options it requires. Are you just going to extract a few files and rename them to be your project title? Are you going to extract lots of files, optionally inserting components and files depending upon what the user selects as a configuration option, then having done all of this build a Visual Studio project file (.dsp)?

I recon working out how to structure your components is far harder than trying to work out how to include any of this in the wizard.

Command Line

Version 4.5.1.0 added the ability to use command line parameters so that this tool may be run to automatically generate code (for example from the Visual Editor).

Param | Example | Use
/path | /path=c:\blah | The path to use for this new project
/project | /project=proj | The directory to create in that path
/key | /key=Create C++ Scripted UI / Panel | The plugin to use to create this new project. Note: this has to be exactly the same as it appears in the listbox of the

There can be as many other command line options as the plugins themselves define. For example the “Create C++ Scripted UI / Panel” wizard (bncs_script_wizard.dll) defines the following additional parameters

Param | Example | Use
/panel | /panel=p1 | The name of the panel to create. This parameter is optional and if not supplied with use (and create) “p1”
/title | /title=This is the title | The title to use for this dialog. This parameter is optional, and a dialog is shown to enter this information if this is not provided

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


wsTracker

Workstation Tracker

Introduction

Workstation Tracker (or WSTracker) allows a workstation on a BNCS system to monitor and control all the others running Workstation Manager.
The status of each Workstation Manager client is shown on the screen, and WSTracker also allows you to remotely stop or start any instance. This provides the ability to remotely resynchronise BNCS control workstations – individually or all in the system.
Workstation Tracker may also hook in to an Infodriver to reflect workstation settings to the network. This allows the possibility of monitoring the status in an alarm system. It also allows some external control of workstations using this infodriver.
The status information may also be configured to be written to the BNCS network using an IW command. This allows the Alarm System Database output module to write the information into its database.

Note: This application has been written for BNCS test systems, virtualised and widely dispersed systems. This is important to note as it is powerful and potentially quite harmful in its effect due to the ability to restart individual and all the workstations on the system.
WSTracker.exe should be run on the file server, and reserve server if running, within your system. Each of the workstations runs Workstation Manager which communicates with the tracker application.

Configuration Settings

Workstation Tracker gets its configurations settings from the instances file and from a .ini file. If an infodriver is to be used to make the status data available to the BNCS network, then a workstation tracker instance needs to be set up, for id ="workstation_tracker". This must include the device number in the “ref” attribute. For example:

<instance composite="no" id="workstation_tracker" type="workstation_tracker" location="none" ref="device=997,offset=0" alt_id="Workstation Tracker" />

This configures WSTracker to use InfoDriver 997, and further configuration information will be found in dev_997.ini, in the config/system folder.
If this instance is not provided then no infodriver will be configured and the default values will be used for all the parameters.

[WSTracker] Section

The following settings should be entered in the [WSTracker] section in the ini file.

Item | Default Value | Comment
port | 65508 | UDP port number to be used for communication with the Workstation Managers.
databaseDriver | 0 | If this is non-zero WSTracker will use an IW command to write any state changes to the BNCS network. This value will be the driver number used for this write. The slot number used for this will be one. See section 4 Client Reporting for full details.
updateperiod | 15 (seconds) | This gives the time after which a workstation Manager or InfoDriver will be updated.
TimeoutLimitSecs | 60 (seconds) | Time after which any disconnected workstation will be considered as Unknown status.
EnableRestartAllButton | 0 | If this is set to 1 the “Restart All Workstations” button will be enabled. Restart All Workstations is a somewhat drastic action which can take many minutes to complete. It is therefore very important not to use it by accident. This setting is required to enable the button. See section 6.1 Restart All.
WS_Man_Text | Blank. No value written to the ini file by default. | This string will be displayed in the “Server WS Text” field in the program GUI.

Example

The following is an example of the contents of this file.
Note that the same file is also used by Workstation Manager, which references some different parameters (eg main_server, reserve_server). These parameters are ignored by Workstation Tracker.

[WSTracker]
port=65508
databaseDriver=996
updateperiod=15
TimeoutLimitSecs=60
EnableRestartAllButton=0
main_server=nn.nnn.80.1
reserve_server=nn.nnn.80.2
WS_Man_Text=Tracker Release 2015-08-24

Workstation tracker also reads in a list of all workstations from workstations.xml. This is used to set the workstation names in the list-view which shows all the workstations.

Infodriver Reporting

Workstation Tracker can connect to an external infodriver in which it will write the status for each workstation. This can also be used to remotely request that a workstation be restarted.

Infodriver Slot Usage

The usage of the infodriver slots is as follows:

Slot | Use | Notes
1-999 | Workstation Status / Command | The values are: 0=Unknown 1=Updating 2=Starting 3=Running 4=Errors 5=Stopping 6=Stopped 7=Rebooting The workstation may be restarted by writing the following two commands to the slot in this order within the timeout period (500ms) restart workstation See section 6 Remote Restarts.
1001-1999 (1000 + workstation number) | Time when the workstation reports that it was last restarted. | In ISO date format: YYYY-MM-DDTHH:MM:SS
4001 | Status | Whether any data has been received from any workstation manager within the timeout period. The timeout is 2.1 times the value of the updateperiod parameter, being 31 seconds for the default updateperiod of 15 seconds. This interval is set so that two complete cycles of messages may be missed, but missing more will be reported as a fault. The values are: 0=data valid 1=data not valid

Client Reporting

Workstation Tracker may be configured to register as a BNCS client and write out logs of state changes using Infodriver Write (IW) commands.
This mechanism may be used to allow an external logging application to note the changes and store them as required, and to request the Alarm System Database Output Module to store them in the database.
This is enabled by setting the databaseDriver parameter to a non-zero positive integer value. The format of the string written is as follows:
IW ‘workstation ,workstations,1,, - ’ 1

<driver> is the driver number as configured by databaseDriver.
<ws> is the workstation whose state is changing.
<state> is 0 for Running, 1 for all other states.
<text> is the WS_man_text setting.
<state name> is the common name of the state.

These correspond to the string expected by the “slot one” mechanism implemented by the BNCS Alarm System Database Output Module, where a string in the following format will cause a log message to be written to the historical log table:

Device-name, group, level, state, text

So in this case we will have:
Device-name = workstation
Group = workstations
Level = 1 (Information)
State = 0 (OK) if the workstation is running, 1 (Alarm) for all other states.
Text = combination of WS_man_text for the workstation with the common name of the actual state.

Timeouts

“updatePeriod” Timeouts

The “updateperiod “ setting is used to set various timeouts within the program. They are typically set to 2.1 times the given UpdatePeriod. This will be approximately 31 seconds if the setting is 15 (the default).
One timeout is a time after which, if no updates have been received from any of the expected workstations, WS Tracker is marked as unknown/offline.
Another timeout applies to each workstation. It is a time after which if no input has been received from that workstation its status is considered unknown/offline.

“TimeoutLimitSecs” Timeout

The “TimeoutLimitSecs” setting is used to set the time after which any workstation is set to Unknown status if no message has been received from it.

Remote Restarts

Workstation Tracker is capable of requesting the Workstation Managers to stop or start.
This may be done from the GUI or using the Infodriver.
To restart any workstation using the infodriver, set the corresponding slot’s text to "restart" and then to "workstation" within half a second.

Restart All

Workstation Tracker is capable of requesting all the Workstation Managers in the system to re-start. This may only be done from the GUI (it is not available using the infodriver)
A time interval may be set between the restarts. Note that all the Workstations will be stopped immediately and the restart scheduled to happen after the specified delay.
There is an option to select whether the local Workstation Manager will also be restarted.
Note that if this is run on a large system the total time for all the restarts to be completed may be quite long, and as all the stops are done immediately part of the system may be down for an appreciable (or inconvenient) period of time.

In order to reduce the possibility of this being done accidentally there are two confirmation button presses required. To reduce the possibility of this being done accidentally the Re-Start All button is not enabled by default. In order to enable it the EnableRestartAllButton parameter should be set to ‘1’.

Firewalls and Routing

It may be necessary to configure firewall ports to be open to ensure the UDP messages can travel successfully between the Workstation Manager and Tracker.
It may be necessary to change Windows’ IP routing to ensure the UDP messages can travel successfully between the Workstation Manager and Tracker.
In particular, if WS Manager is configured with the Tracker/server at 255.255.255.255 (ie broadcast to all) it may be necessary to ensure that 255.255.255.255 is routed via the correct interfacce so that messages reach the Tracker.
The following has been used successfully, although parameters may need changing depending on a specific instance.

>route CHANGE 255.255.255.255 MASK 255.255.255.255 192.168.1.80 METRIC 200 IF 10

Utility GUI

GUI

Column headings

Column | Description
WS | Workstation Number
WS Name | Name associated with this Workstation ID in workstations.xml If a status message is received from a workstation that is not listed in workstations.xml this column will show ‘?’.
Status | The current status reported to the server by the client workstations Status:- OK (Running), Errors, Unknown, Stopping, Stopped, Starting, Updating, Rebooting
Start time | The last time that the workstation reported having been restarted
Last Rx | The time of the last message received by workstation tracker from the client
IP Address | IP address of the workstation
WS Man Text | An unofficial “release” note that is entered into the appropriate section of the workstation device. There is a facility to enter this form the workstation tracker GUI see below.
OS | The OS of the client workstation
User Name | The name of the currently logged on user. Normally bncs_runtime or in the case of the server bncs_admin

GUI controls

Control | Action
Stop | Stop the selected (highlighted) workstation
Start | Start the selected (highlighted) workstation (without resynchronizing) This will be enabled if the workstation is stopped
Re-Start | Stop and resynchronise the selected client with its server, and then restart it.
Remote | Start a remote desktop session with the client. You will be prompted for the user name and password
Set | Will set the workstation tracker text
Re-Start All | Restart all workstations on the system. You will be asked for a delay between each workstation starting up and an “are you sure” prompt. All workstations will be stopped before any attempt is made to restart one. See section on Restart All

Software Version Control

For quite a long period of time this application didn’t have its changes recorded.

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.0 | 12/2/2014 | Richard Kerry | Added configuration of enable of Restart All button.
4.5.2.0 | 06/01/15 | David Yates | Little version history exists here... This version adds ability to sort on date/time columns sorting by datetime rather than the representation of datetime

Document Version Control

Version | Date | Author | Comments
0.1 | May 2007 |  |
0.2 | 20/12/2011 | Andrew Prince | Updated template and configuration information
0.3 | 17/08/2015 | David Yates | Adds infodriver usage info
0.4 | 01/09/2015 | Richard Kerry | Updated template to current convention. Various corrections and clarifications throughout the document. Includes full details of InfoDriver interface (Bug 2706)
1.0 | 27/02/2017 | David Yates | Conversion to markdown, minor revisions


alarm-BncsDriverStatusAcquisition

Alarm System – BNCS Driver Status Acquisition Module: alm_acq_bncs_drv_stat

Overview

This module (alm_acq_bncs_drv_stat.dll) is part of the suite of modules that form the BNCS Alarm System.

The module gathers input information for the alarm system from CSI regarding the status of BNCS device drivers.

Description

The module registers with CSI. It reads CSI’s configuration to find the driver status infodriver number, and then polls the slots as required to monitor the Tx/Rx status of the various BNCS devices’ drivers. The status values are presented to the logic module, which is part of the host application.

Configuration procedure

Use the configuration editor. See the configuration document for details.

Starting up

The module is started from the host application AlarmControl.exe. It loads its configuration, registers with CSI for the source device it is interested in and polls the appropriate ranges of slots. Once it has polled all the inputs it re-polls any from which it hasn’t received a response from, this is repeated at increasing time intervals until the maximum time between polls is about 20 minutes. There can be more than one instance of the BNCS Driver Status Acquisition module in an Alarm System.

Dependencies

The module requires the QT dll (currently qt-mt323.dll), bncsif.dll and the Visual C runtime dll MSVCP60.dll.

Features

When revertives arrive from the source device they are analysed based on the configuration. The results are stored in memory. When the host application requests data the acquisition block sends a pointer to the data. The data sent is one of three states:
0 OK
1 Alarm
-1 Unknown

Unknown means that the acquisition module has never received a revertive from this input.
Note: All the BNCS Driver Status Acquisition modules in the same application use the same polling object. This object sorts all the devices to be polled numerically by device and index. It polls for a range of inputs where this is more efficient than a single poll. This is to maximise efficiency and minimise the number of messages that CSI has to process.

Diagnostics

As for AlarmControl.exe.

There are counters for messages to and from CSI, and various other information about the module. The Status field will be ‘FAIL’ if CSI is not present. . ‘Progress’ shows how much of the polling process has completed.
Error and diagnostic messages are shown in the lower display.
If the acquisition module has received revertives from all its inputs the message “All Valid Inputs received” will be shown in the lower display – as seen here.

Test Procedures

When polling BNCS devices the BNCS Comms Tx count increases and when receiving revertives the Rx count increases. Figures are written to the screen approximately once per second.

Polling

On start-up if there are devices that don’t respond to the first poll they are re-polled until they respond. The time interval between polls increases to a maximum of about 20 minutes.
At present after the first revertive has been received there is no automatic re-polling. Repolling may be started manually either for all modules using the Diagnostics|Restart All Polls, or for a single module using the context (right-click) menu item Restart Poll.
The context (right-click) menu item Next Poll Now will trigger the next poll immediately if selected during a pause between polls.
(*** not yet available)

Operation

CSI uses heartbeat messages to share driver status information. It maintains an internal infodriver which clients can read data from so any client can establish the Tx/Rx status for any driver number. Each slot in the infodriver corresponds to the driver of the same number.
The revertive data comprises one or more comma-separated strings in the format “nc”, where “n” is a workstation number, and “c” is a character representing the Tx/Rx state of that driver on that workstation.
The Tx/Rx state code will be one of the following:

Code | State
R | Tx/Rx
T | Rx Only
B | Rx Broken

From the revertive string the system counts how many instances of the driver are running, and how many are in each state. Based on these counts and the alarm configuration the system works out the appropriate alarm state and passes it to AlarmControl.

Presence Alarm

A presence fault is generated if there are no workstations reporting that the driver is in the Tx/Rx state.

Resilience Alarm

A resilience fault is generated if the number of workstations with the driver in the RxOnly state is not one less than the resilience level configured.
For example, if normal resilience is selected (ie the level is two) then this fault will be signalled if there is not precisely one workstation reporting that the driver is in the RxOnly state.
This alarm is not relevant if resilience is not selected (ie the level is one).

Configuration Alarm

A configuration fault is generated if the list of workstations on which the driver is reported as running doesn’t match the list of workstations the driver is configured to be running on (ie from the configuration in launch.xml).

Breakage Alarm

A breakage fault is generated if the driver is in the RxBroken state on any workstation.

Treat RxBroken As RxOnly

If this property is set then any instances of the driver reported as RxBroken will be treated as if they were RxOnly.

Logging

When Logging is enabled (via AlarmControl’s GUI or arguments), selected messages are logged into a file at a path determined by the BNCS settings.
Log files are written in %CC_ROOT%\%CC_SYSTEM%\logs\alarms.

Documents referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm - configuration-Bncs driver status acquisition
alarm – mainapplication
The documentation relating to file formats may also be useful.

Software Version history

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.00.00 | 03/2012 | Richard Kerry | Original Release

Version Control

Version | Date | Author | Comments
1.0 | 26/01/2015 | Richard Kerry | First version of documentation for this module
1.1 | 27/02/2017 | David Yates | Conversion to markdown


alarm-CollediaControlAcquisition

Alarm System – BNCS Acquisition Module: alm_bncs_acq

Overview

This module (alm_bncs_acq.dll) is part of the suite of modules that form the BNCS Alarm System. The module gathers input information for the alarm system from any BNCS device.

Description

The module registers with and then polls the required parameters on the required BNCS devices and presents their states to the logic module, which is part of the host application. In addition some pre-processing can be achieved, this version includes timed holdoffs, frequency detection and pulse stretching.

Configuration procedure

Use the configuration editor. See the configuration document for details.

Starting up

The module is started from the host application AlarmControl.exe. It loads its configuration, registers with CSI for the source devices it is interested in and polls the appropriate ranges. Once it has polled all the inputs it re-polls any from which it hasn’t received a response from, this is repeated at increasing time intervals until the maximum time between polls is about 20 minutes. There can be more than one instance of the BNCS Acquisition module in an Alarm System.

Dependencies

The module requires the QT dll (currently qt-mt323.dll), bncsif.dll and the Visual C runtime dll MSVCP60.dll.

Features

When revertives arrive from the source devices they are pre-processed if required (e.g. a Holdoff of 3 seconds may be set) and then stored in memory. When the host application requests data the acquisition block sends a pointer to the data. The data sent is one of three states:

Value | Meaning
0 | OK
1 | Alarm
-1 | Unknown

Unknown means that the acquisition module has never received a revertive from this input.

Note: All the BNCS Acquisition modules in the same application use the same polling object. This object sorts all the devices to be polled numerically by device and index. It polls for a range of inputs where this is more efficient than a single poll. This is to maximise efficiency and minimise the number of messages that CSI has to process.

Diagnostics

As for AlarmControl.exe.

There are counters for messages to and from CSI, and various other information about the module. The Status field will be ‘FAIL’ if CSI is not present. ‘Progress’ shows how much of the polling process has completed.
Error and diagnostic messages are shown in the lower display.

If the acquisition module has received revertives from all its inputs the message “All Valid Inputs received” will be shown in the lower display – as seen here.

Test Procedures

When polling BNCS devices the BNCS Comms Tx count increases and when receiving revertives the Rx count increases. Figures are written to the screen approximately once per second.

Polling

On start-up if there are devices that don’t respond to the first poll they are re-polled until they respond. The time interval between polls increases to a maximum of about 20 minutes.
At present after the first revertive has been received there is no automatic re-polling. Repolling may be started manually either for all modules using the Diagnostics|Restart All Polls, or for a single module using the context (right-click) menu item Restart Poll.
The context (right-click) menu item Next Poll Now will trigger the next poll immediately if selected during a pause between polls.

Greening

While developing a system it is... (this section missing when the doc was converted)

Logging

When Logging is enabled (via AlarmControl’s GUI or arguments), selected messages are logged into a file at a path determined by the BNCS settings.
Log files are written in %CC_ROOT%\%CC_SYSTEM%\logs\alarms\.

Documents referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm - Configuration-Colledia Control acquisition
alarm – mainapplication
The documentation relating to file formats may also be useful.

Version history

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.00.00 | 19/11/2003 | Charlotte Bell | Original Release
1.00.1 | 10/12/2003 | Charlotte Bell | Remove excessive debugging + tidy diagnostics + minimise
1.1.0 | 06/01/2004 | Charlotte Bell | Add Pulse Stretcher Code
1.1.1 | 12/01/2004 | Charlotte Bell | Add negative trigger for pulse stretcher
1.1.2 | 13/01/2004 | Charlotte Bell | Add 0.1 second resolution for Holdoff and Pulse
1.1.3 | 27/01/2004 | Charlotte Bell | Add 0.1 second resolution for Chatter < 60 seconds
1.2.0 | 28/01/2004 | Charlotte Bell | Added analogue inputs
2.0.1 | 31/03/2004 | Charlotte Bell | Now a plugin dll with proper range polling for each device
2.0.4 | 01/06/2004 | Charlotte Bell | Now able to take inputs from instance data
Version | Date | Writer
4.6.5.1001 | 18/05/2018 | Richard Kerry.

This release contains a number of improvements that have been done over a period of time. There is a further list of improvements that are planned to be done but due to the time these are expected to take a release is being done with items already completed.

  • BST-58 (2753) Some improvements in logging. Relating mainly to the BNCS acquisition module and the Database output module.

Version Control

Version | Date | Author | Comments
1.00.00 | 19/11/2003 | Charlotte Bell | Original Release
1.00.1 | 10/12/2003 | Charlotte Bell | Remove excessive debugging + tidy diagnostics + minimise
1.1.0 | 06/01/2004 | Charlotte Bell | Add Pulse Stretcher Code
1.1.1 | 12/01/2004 | Charlotte Bell | Add negative trigger for pulse stretcher
1.1.2 | 27/01/2004 | Charlotte Bell | Add notes about time resolutions
1.2.0 | 28/01/2004 | Charlotte Bell | Added analogue inputs section
2.0.0 | 31/03/2004 | Charlotte Bell | Now a plugin dll updates
2.0.1 | 01/06/2004 | Charlotte Bell | Instance information added
2.1 | 27/11/2005 | Charlotte Bell | Configuration data moved to a separate document
2.2 | 27/04/2009 | Pete Lasko | Updated formatting to bring in line with other existing docs
 | 27/10/2014 | Richard Kerry | Document revised to current conventions and template.
 | 08/01/2015 | Richard Kerry | Corrections and amendments. Images reworked from current versions of software.
3.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


alarm-CollediaControlOutput

Alarm System – BNCS Output Module

Overview

This module (alm_bncs_op.dll) is part of the suite of modules that form the BNCS Alarm System. It is used to provide a method of getting the current state of the Alarms System on to the BNCS system via an infodriver. It also provides a way by which BNCS clients can override one or more process(s).

Description

This module tries to connect to the infodriver detailed in the configuration file on start up. If it fails to connect it will remain in a fail state and not do anything useful. Whenever there is a change to the state of a process this change, if configured, will be passed on to the infodriver.

Output States

The slots will have the current state of the relevant process in them, these states are:

Value | Meaning
-1 | Unknown
0 | Off (OK)
1 | On (Alarm)
2 | Forced Off
3 | Forced On
4 | Acknowledged
5 | Ignored
6 | Latched

As shown in the main application document.

Native States

The ‘native’ states supplied by the Alarm System are: OK, Alarm, Latched and Unknown. The Unknown state is supplied if the acquisition module has never had a revertive from the said input. The latched state is optional and is configured for each process.
These native states are maintained automatically within the alarm system based on the alarm conditions reported by the acquisition modules.

Override States

A panel element (button) may be configured to override the native states. The possibilities are any of the following:

  1. Acknowledged. This is when the operator acknowledges the process.
  2. Forced Off. This is forcing the process to appear OK.
  3. Forced On. This is forcing the process to appear Alarm.
  4. Ignored. One shot Force Off. It resets the next time the process goes to OK.
  5. Normal. This removes any override. The process reverts to its native state.

It is possible to override a state for a fixed period if desired by writing the override code and the time period in seconds to the appropriate slot, separated by a comma. For example “3,30” will Force On for 30 seconds. After the time period it will revert to its native state.

Device Types

Using the configuration tools it is also possible to configure the outputs to appear as “Alarm devices” on the BNCS v4.6 system. This is useful if there are many instances of the same type on your system. It makes the panels easier to create than using one long list of infodriver slots.

Configuration Procedure

Use the configuration editor. See the configuration document for details.

Starting up

This module is started from the host application AlarmControl.exe. It expects CSI and the appropriate external infodriver to be running beforehand. There may be more than one BNCS Output module in an Alarm System. Each one must connect to a separate infodriver.

Dependencies

The module requires the QT dll (currently qt-mt323.dll), bncsif.dll and the Visual C runtime dll MSVCP60.dll.
The module connects to the infodriver as an external driver using BNCS_COPYDATA messaging, therefore needs either a v2.5.xx, v3.5.xx or v4.xx infodriver. The Alarm System would normally be shipped with a v4.6 installation and consequently a v4.xx infodriver.

Features

Diagnostics

As for AlarmControl.exe.

Tx Count and Rx Count show the number of messages to and from CSI.
The Status field will be ‘FAIL’ if CSI or the infodriver is not present.
Error messages are written in the lower display.

Test Procedures

A simple test is to look at an infodriver slot and change it to a “Force On” by writing a 3 to the slot, this should cause the Rx counter to increment by 1, and if the operation is valid the Tx counter should increment and the contents of the slot should have need updated.

Logging

When Logging is enabled (via AlarmControl’s GUI or arguments), selected messages are logged into a file at a path determined by the BNCS settings.
Log files are written in %CC_ROOT%\%CC_SYSTEM%\logs\alarms\.

Documents Referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm - Configuration-Colledia Control output
alarm – mainapplication
The documentation relating to file formats may also be useful.

Software Version History

Version numbers shown here may not be seen within the software itself. The implementation date is a more reliable way of determining whether a particular issue is present in any particular instance of the software.

Version | Date | Author | Comments
1.00.00 | 19/11/2003 | Mark Baldry | Original Release
1.00.1 | 31/03/2004 |  | Now a plugin dll to AlarmControl.exe

Document Version

Version | Date | Author | Comments
1.00.00 19 | 11/2003 | Mark Baldry Charlotte Bell | Original Release
1.00.1 | 31/03/2004 |  | Now a plugin dll to AlarmControl.exe
1.1.2 | 30/11/2005 |  | Re-wording of document
 | 15/01/2015 | Richard Kerry | Document revised to current conventions and template. Images reworked from current versions of software.
2.0 | 27/02/2017 | David Yates | Conversion to markdown


alarm-databaseoutput

Alarm System - Database Output Module alm_db_output

Overview

This module (alm_db_output.dll) is part of the suite of modules that form the BNCS Alarm System.
It can write the current state of the alarm system to a database, and also add to a log of historical data.
In addition this module can also supply historical log change information to a BNCS network, and allow BNCS panels to add information to the historical log.

Description

Whenever there is a change to a process the database may be updated.

The process_data table records data for each process, indexed by process-id. Records are amended when the process changes. The records holds the device name, date and time (including milliseconds), state, text, level and group.

The historical_log table has a new entry added to it for every process change. It is time stamped with the date and time, including the millisecond time. It also holds the device name, state, text, level and group.

The millisecond times are not frame accurate, but there so the user can see the order in which messages arrived.

BNCS clients can add to the historical log by writing to any slot on the info driver a string with the following format: -

Device-name, group, level, state, text

The timestamp added will be the time that the message arrived at the driver.

When an entry has been added it will generate a revertive message from slot 1. Revertives will be in the format: -

Date-time, milliseconds, process-ID, Device-name, group, level, state, text

Historical or process log information may be read from the database directly using SQL.

Configuration Procedure

Use the BNCS Configuration Editor to configure what to log to the database for the different processes. See the configuration document for full details.

Starting Up

The module is started from the host application AlarmControl.exe. It loads its configuration and proceeds to update the database accordingly.
There be more than one instance of the Database Output module in an Alarm System.

Dependencies

The module requires the QT dll (currently qt-mt323.dll), bncsif.dll and the Visual C runtime dll MSVCP60.dll. The QT dll will require to be either compiled with the correct database support, or have the correct plugins available.
This application acts as a driver using BBC_COPYDATA, so requires a version of CSI (2.0 or 2.5 or 3.5 or 4.x) that supports this.
A supported database will be required, with a valid user account and tables for historical_log and process_data. The tables should be created using the controls provided by the Config Editor.
The configuration document’s Appendix has full details about the tables.

MySQL Password Version

The MySQL database driver which is now in use expects the server to support the current format of passwords (also known as “new” or “long”). Earlier versions of the library support the old format (“old”, “short”, “16 character” or “pre 4.1”). See the version history to ascertain which version applies. See the MySQL documentation if it is necessary to set a recent server to accept the old format.
This is controlled by the DLL windows/lib/libmySQL.dll.
If it is version 5.6.20 then the new format is in use.
It is not clear what the version should be for the old version.

Features

Diagnostics

As for AlarmControl.exe.

The Tx Count column shows the number of records written to the database
The Rx Count column shows the number of messages received by the InfoDriver.

Start Extra Network Activity.

When the module starts it does not immediately start issuing revertives corresponding to database updates. This is because due to the polling that normally takes place on start-up the traffic would be extremely high. The revertives start being sent after a time delay dependant on the number of processes in the system (default 60ms per process – selectable using the /netdelay qualifier). If it is required to start issuing revertives before this time the Diagnostics|Start Extra Network Activity control should be selected.

Test Procedures

A simple test of database communications it to see the Database Writes counter increments when the application is started, if it does this means that the application can talk to the database. Also there are messages in the logging window showing whether the connection is successful.
Alternatively the Config Editor will also show whether the parameters are correct.
The Rx Count shows the number of InfoDriver revertives received.
If the InfoDriver is not configured, the Status will be Fail. Also if the database connections are not successful.

Logging

When Logging is enabled (via AlarmControl’s GUI or arguments), selected messages are logged into a file at a path determined by the BNCS settings.
Log files are written in

%CC_ROOT%\%CC_SYSTEM%\logs\alarms\<alarm system name>.

Documents Referenced

This document should be read in conjunction with other documents in the tree.
In particular:
Alarm – overview
alarm - Configuration-Colledia Control acquisition
alarm – mainapplication
The documentation relating to file formats may also be useful.

Software Version History

Version | Date | Author | Comments
1.00.00 | 20/11/2003 | Mark Baldry | Original Release
1.00.01 | 06/01/2004 | Mark Baldry | SQL statements, quotes removed, added SQL Server support
1.01.00 | 14/01/2004 | Mark Baldry | Added Latched state Previous states remembered by name
1.02 | 31 March 2004 | Mark Baldry | Now a dll loaded by Alarm Control
Version | Date | Writer
4.6.5.rc1.1 | 25/05/2018 | Richard Kerry. Except BST-62 by David Yates.

This release contains a number of improvements that have been done over a period of time. There is a further list of improvements that are planned to be done but due to the time these are expected to take a release is being done with items already completed.

  • BST-58 (2753) Some improvements in logging. Relating mainly to the BNCS acquisition module and the Database output module.
  • BST-34 (2510) Location of database output buffer files.
    These were previously stored as %CC_ROOT%\%CC_SYSTEM%\data\logioNode<various numbers and extensions>.
    They are now in %CC_ROOT%\%CC_SYSTEM%\data\<alarm system name>\<module number>logioNode<various numbers and extensions>.
    Where <alarm system name> is the name of the alarm system, as seen in the /AlarmSystem parameter, and <module number> is the number from the corresponding al_out_nnnn.cfg configuration file.
  • BST-62 (2772) An issue has been fixed whereby an exception would cause a thread in part of the system to stop running, but the remainder of the system would continue to run. The effect of this would be likely to be similar to what is described here, ie the system would not stop completely (crash or hang) but appear to continue to run, but with some functionality broken.
  • There is now an extra control to allow the port number to be set for a mySql server. This is present in the alarm output configuration and in all controls that are able to access the alarm logging database.
Version | Date | Writer
4.6.5.rc2.1 | 25/06/2018 | Richard Kerry.

This release addresses a number of issues that have arisen with 4.6.5.rc1.1.
Due to the subsequent release of 4.6.5.rc2, this release branch has been changed to be based on that release version.

Alarms Database Output Module

  • BST-301 The crash has been fixed.
    A crash was found to occur at the end of the process of transferring the file buffer to the database in certain circumstances. This has been fixed.
  • BST-67 (possibly also BST-245) Failure to transfer data from file buffer to database no longer causes the record to be reinserted in the file buffer.
    It was noticed that while doing the transfer of data from the file buffer into the database, if the write to the database was deemed to have failed, the record that it was trying to write would be written back into the file buffer. The effect of this was to cause duplication of the record, unncecessarily increasing the size of the buffer file. This is no longer being done.
    It was noted that this can easily be caused by not having one of the two tables available in the database. Therefore both the tables should be present, even if one (typically process_data) is not going to be read.

Although BST-67 mentions CPU usage this would not appear to be obviously affeced by this fix, so it isn't certain that it is a full fix for the issue.

There have also been fixes to the multi-threading aspects of this system to improve its reliability.

Document Version History

Version | Date | Author | Comments
1.00.00 | 19/11/2003 | Mark Baldry | Original Release
1.00.1 | 31/03/2004 | Mark Baldry | Now a plugin dll to AlarmControl.exe
1.1.0 | 1/12/2005 | Mark Baldry | Re-wording of document
2.0 | 28/04/2009 | Pete Lasko | Updated formatting to bring in line with other existing docs
2.1 | 12/01/2015 | Richard Kerry | Document revised to current conventions and template. Images reworked from current versions of software.
3.0 | 27/02/2017 | David Yates | Conversion to markdown minor revisions


grd32fix

grd32fix.dll

Description

grd32fix.dll is a very simple DLL that is used to share data between GRD32.exe and grd_32fix.exe.

grd_32fix.exe is required to listen for broadcast messages (HWND_BROADCAST) that Microsoft applications can’t hear. When it receives a GRD_CONNECT message that it knows that GRD32 will not be able to receive it simply passes it on.

grd32fix.dll shares the window handles of running GRD32 applications. It has a 1000 slot array of window handles and two functions to get and set data within that array.

GRD32 explicitly sets its own window handle in the array (via the calls in grd32fix.dll) when it’s run.

grd_32fix.exe pulls the data from the array when it needs it and validates the handles placed there with an IsWindow() API call.

Data Sharing

The DLL uses a data_seg to share the data between processes. Use of this requires the slightly strange “#pragma” syntax as well as the explicit initialisation of the data.


info32fix

info32fix.dll

Description

info32fix.dll is a very simple DLL that is used to share data between infodriver (infodriver32/V4infdrv.exe) and inf32fix.exe.

inf32fix.exe is required to listen for broadcast messages (HWND_BROADCAST) that Microsoft applications can’t hear. When it receives a ID_CONNECT message that it knows that v4infdrv will not be able to receive it simply passes it on.

info32fix.dll shares the window handle of running infodriver applications. It has a 1000 slot array of window handles and two functions to get and set data within that array.

V4infdrv explicitly sets its own window handle in the array (via the calls in info32fix.dll) when it’s run.

inf32fix.exe pulls the data from the array when it needs it and validates the handles placed there with an IsWindow() API call.

Data Sharing

The DLL uses a data_seg to share the data between processes. Use of this requires the slightly strange “#pragma” syntax as well as the explicit initialisation of the data.


index

Custom Controls

Core Controls
Listview Extended
Bargraph
LUA Script Control
VT Clock
Alarm System Log

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


bncs_bargraph

Description

This is a simple bargraph control. It can be used to display analogue values e.g. signal levels, or to select a value in a range. It's not particularly accurate for this on a touchscreen because of the "roll off" effect of removing your finger from the display.

bargraph
or with warning/peak level indicators:
bargraph

Orientation is automatic - depending upon longest side.

Internally values are always type double.

Commands

Default values are shown bold

Name | Use
colour.bar=#ff0000 | colour of the bar - this can be any Qt colour or a colour code no bar shown if progress is 0%, nothing but the bar shown if progress is 100%
colour.barPercentage2=50 | The percentage at which the second colour should be shown, if set to 0 only the first colour will be shown
color.bar2=#ffff00 | 2nd colour bar can to turned on by setting the barPercentage2 field. This shows a different colour to the first bar from the point specified
colour.barPercentage3=75 | Same as barPercentage2 but shown a 3rd colour when the percentage is reached
color.bar3=#ff0000 | 3rd colour bar can to turned on by setting the barPercentage3 field. This shows a different colour to the first bar from the point specified
colour.background=#c0c0c0 | colour of the control that isn't the bar
colour.border=#ffffff | colour of the 1 pixel line around the control
gradient=true | Turns the gradient on the control On or Off, the control uses more CPU with it on but looks nicer.
left=0* top=0 | These parameter names are entirely equivalent - only left is persisted
right=100 bottom=100 | These parameter names are entirely equivalent - only right is persisted left can be greater or less than right (and indeed top less or greater than bottom)
value= | Set the current value - this should be a value between left / right. The "progress" between left/right values is calculated and shown appropriately
progress= | Set the current position. This is a percentage value 0-100
notify.progresss=true notify.value=false | Whether notifications (detailed below) are sent out
local=false | Whether this control updates itself when you press it (true) or only when you explicitly set the value i.e. just echo the current value locally or only update it when the value on the device says it's changed

Notifications

Name | Use
progress=<value> | value between 0 and 100 of the current position. Left is always 0 for horizontal bargraphs Bottom is always 0 for vertical bargraphs
value=<value> | current value as determined by the selected position

Stylesheets

Not currently used

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown


bncs_cc02

bncs_cc02 - VT Clock

Description

This is a V4.6 import of the old V2/V3 VT Clock control:

Commands

Name | Use
time | Time value from 0 to 45
text.<block> | Text value to write to the control

Block number follows the numbering in the image above

Notifications

None

Stylesheets

None

Developers Notes

Design time cannot readily be dynamic and uses a fixed pixmap

Version Control

Version | Date | Author | Comments
1.0 | 27/02/2017 | David Yates | Conversion to markdown


bncs_clock

UIControls

BNCS Clock

Description

This is a control to allow you to include a clock in your panels.

You may configure the appearance of the clock (analog, digital or 7 segment), its style and colour and choose a time zone.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

The Type column refers to the parameters sent to particular configurations of this control.

Parameter | Value | Type | Notes
reset |  | Base | Used to reset all the parameters of this control back to their default state
return | any of the other settings | Base | Return a named parameter from this control e.g. send this to the control return=text will return a value of the text setting in the format text=This is the text
id | id of the button | Base | numeric or alphanumeric identifier for this button
clocktype | analog digital lcd | Base | How to draw the clock (lcd is a 7 segment display)
colour.text | Any QT colour | Base | Text colour / analog hour and minute hand colour
colour.background | Any QT colour | Base | Clock face colour / digital clock background colour
colour.seconds | Any QT colour | Analog | Colour of the analog clock seconds hand.
colour.ticks | Any QT colour | Analog | Colour of the tick marks on the analog clock face
font.face | Any installed font name | Digital | Font for the clock
font.size | Numeric | Digital | Font size
seconds | 0 or 1 ( 1: a second hand is shown, 0: it isn't ) | Analog | Include a second hand.
timezone | local or gmt | Base |
offset | numeric | Base | If timezone is GMT this adds (or subtracts) an offset in hours.
stylesheet | A stylesheet name | Base | Configure appearance


bncs_control

 alt text

UIControls

BNCS Control

Description

This is an all-round control that can be used for most of the hard work of panel building. This control draws together a number of the features that are available in a number of other controls that have evolved over time.

This control can be used in Qt Designer directly but only the default presentation will appear. The full editing capabilities of this control are only available in the BNCS Visual Designer.

This control is "reskinable" in that the code required to draw it is separate from the button itself or it's settings.

Wherever possible don't explicitly set parameters - use the default or a stylesheet.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new button is created or when a reset command issued) are shown in bold.

Writing the same colour will not force a repaint to reduce flicker
Parameter | Value | Notes
reset | Used to reset all the parameters of this control back to their default state
return any of the button settings Return a named parameter from this control
e.g. send this to the control

return=text

will return a value of the text setting in the format

text=This is the text
colour.text
colour.background
colour.led 		Any valid Qt colour or nothing (zero length string). Set colour of the specified parameter.
e.g. the following two examples are equivalent:

colour.led=red
colour.led=#ff0000

Setting the value to zero length string (see example) sets the colour back to the default colour specified in the skin. This is the default for these settings.
e.g.

colour.background=
colour.text=

style label
button 		The fundamental style of this control - the major differences are the width of the border and whether the control "depresses" when clicked
labelstyle none
plain
lowered
raised
blackbox
whitebox 		The border for this control when the style is label.
e.g.

labelstyle=raised
notify.pressed
notify.released 		false / true
true / false 		Determines whether this control notifies on mouse press/release or on mouse enter/leave events.
notify.lostfocus true
false 		Determines whether the release event is used or discarded when it occurs outside the area of the button pressed. i.e. if you press a button, slide your finger off it then release do you get the notification?
doublepush false
true 		Whether this control requires two presses before emitting notification.
With this feature enabled a small box appears above the control telling the user that they should press the button again
pixmap <filename> Path to the background pixmap to display. This can be any valid Qt pixmap
e.g.

pixmap=a.png
pixmap.topLeft <filename> Fixed alignment pixmap with no scaling. This pixmap is shown on top of the background pixmap.

Path follows same rules as the background pixmap.

These 9 pixmaps and the background pixmaps are wholly independent

pixmap.top
pixmap.topRight
pixmap.left
pixmap.centre
pixmap.right
pixmap.bottomLeft
pixmap.bottom
pixmap.bottomRight
svg.data <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
</svg> 		Valid SVG image data (which is basically an XML document). NOTE: support for SVGs in Qt3 is imperfect.
Cannot be used at the same time as svg.file.

Note: images (such as the example left) that do not specify a size in the top level <svg/> tag are assumed to be 1024 x 1024. Specify attributes:
width="200" height="200"
to set explicit dimensions if default is not appropriate

SVG is shown on top of all other pixmaps

svg.file <filename> A path to an SVG file.
Cannot be used at the same time as svg.data.

SVG is shown on top of all other pixmaps

text The text to write on this button. This text will always overlay a pixmap on this button if there is one.
Writing the same text will not force a repaint to reduce flicker
font.face The current font face.
If no font face is specified (the default) then the standard font face as defined in the skin is used.
font.size 10
-2 (see notes) 		The current font size to use.
If a font face is specified then this is the absolute point size used.
If no font face is specified then this value is the offset from the default skin font size.
e.g. this provides an absolute font/size

font.face=arial
font.size=12

e.g. this uses the standard font in a slightly smaller size (note the negative font size)

font.face=
font.size=-2
font.style bold
italic
underline
overline
strikeout 		The style of the font - this can be a combination of any of the settings (delimited)
e.g

font.style=bold,italic
textalign topleft
top
topright
right
bottomright
bottom
bottomleft
left
centre 		How to align the text on this button
pixmapalign (values as for textalign)
Default: top 		How to align the pixmap on this button
led.align (values as for textalign)
Default: topright 		How to align the led on this button
pixmapstretch true / false Whether the displayed bitmap should be scaled to fit the button.
Stretching bitmaps is usually a bad idea - it's slow and the bitmaps usually end up looking rough.
led | true / false | Whether an "LED" should be displayed.
led.size small
medium
large
background | true / false | Whether this control is a background button and should always appear behind other controls that sit on top of it
width | 0 | Sets the minimum width for this control (may be resized larger than this value)
height | 0 | Sets the maximum width for this control (may be resized larger than this value)
sizepolicy setminimum
asdesigned
shrinktofit 		This is what to do if the text/pixmap on this button exceeds the amount of available space to display it.

setminimum changes the size of the button to make it big enough for the text/pixmap to fit
asdesigned (or null entry) does nothing
shrinktofit reduces the size of the text and/or inserts new line characters to make the text fit.

Note: shrinktofit (or "smart" as it appears on the editor) only works with text that is not rotated.
stylesheet Stylesheet entry to use for this button
(the stylesheet entry is an external list of any combination of the above settings)
statesheet Statesheet entry to use for this button
(the statesheet entry is an external list of any combination of the above settings)

Notifications

Notifications are also in the format:

<parameter> = <value>
Parameter | Value | Notes
button | pressed released | The notifications are only made if they are enabled in the settings above. Pressed has to be specifically enabled. Released has to be specifically disabled.


bncs_edittext

UIControls

BNCS Line Edit Control (bncs_lineedit)

Description

This is a simple line edit control.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new button is created or when a reset command issued) are shown in bold.

Note: at time of writing it is not possible to set font/size. Only colour entries from style/statesheets will be used.

Parameter | Value | Notes
reset |  | Used to reset all the parameters of this control back to their default state
return | all text | Return a named parameter from this control e.g. send this to the control return=text will return a value of the text setting in the format text=This is the text
stylesheet statesheet | stylesheet entry | Style/state entry
colour.background colour.text | any valid Qt colour |
notify.return_pressed notify.text_changed | true false | Whether to notify on the specified events value are: true false
initial_focus | false |
echomode | normal password | How to display text - either as normal characters or **** in password mode
insert | text | Insert the given text at the cursor position
backspace |  | backspace from the current cursor position
cursor.forward cursor.backward cursor.home cursor.end |  | Move the cursor
del |  | Delete the character at the current position

Notifications

There's a slight anomaly with notifications - both "text" and "value" command types are used - on is used for when the return button is pressed and the other when the text is changed.

text=<value> | notification when a character is pressed (if enabled)
value=released | notification when the return button is pressed (if enabled)


bncs_enum

UIControls

BNCS Enum Control

Description

This is a Qt custom control to deal with enumerated parameters i.e. where a parameter can have only a fixed number of values. Examples of this are test pattern select or even just on/off values.

This is a smart button in that it connects direct to the network.

Internally control splits into two types – the enumerated list function (the basic operation of the control) and the “presentation” which may be a single button, multiple buttons, a listbox etc.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new button is created or when a reset command issued) are shown in bold.

The Type column refers to the parameters sent to particular configurations of this control.

Parameter | Value | Type | Notes
reset |  | Base | Used to reset all the parameters of this control back to their default state
return | any of the other settings | Base | Return a named parameter from this control e.g. send this to the control return=text will return a value of the text setting in the format text=This is the text
id | id of the button | Base | numeric or alphanumeric identifier for this button
name |  | Base | Optionally used to name the button
group |  | Base | Used as a means of grouping together buttons so that they may be directed to a new device
child.<id> | any appropriate setting | Base | Means of passing any message to a child parameter of this control. Use of this is not recommended - whilst you can poke values direct at the buttons (standard bncs_control) this might contradict the values passed around within the enum control.
style | (none) button label list popup_list | Base | What presentation to use for this button.
device | 0 | Base | BNCS device number
slot | 0 | Base | BNCS slot number index registered for=slot+offset
offset | 0 | Base | BNCS offset index registered for=slot+offset
instance |  | Base | BNCS instance Tells the button to use a specific instance, this overrides slot and offset, if a named parameter is used this will also look up the slot.
parameter |  | Base | BNCS parameter Targets the button at a parameter on the current instance, this can overrides slot, offset and slot.
state.<no>.caption state.<no>.value state.<no>.pixmap state.<no>.enabled state.<no>.style state.<no>.default |  | Base | This is the list of states that this control will work with. The <no> parameter is an arbitrary value which is simply a means of grouping and identifying individual states. Caption is the text to display for this state. Value is the thing returned from the network device in this state Pixmap is the name/path of the pixmap to display in for this state (this can be any valid Qt bitmap) Enabled is whether this is a state that we can write to – otherwise this state will be displayed but cannot be selected Default
notify.valuechanged | false or true | Base |
notify |  | Line |
defaultstyle | enum_deselected | Base |
width |  | Base |
height |  | Base |
doublepush | false or true | Button |
doublepush.list doublepush.button | false or true false or true | List | Whether the buttons are double push. Note: “button” refers to the button used to initiate a popup, whereas “list” refers to the buttons used for the individual elements. (version 4.5.12.0 onwards)
settodefault |  | Button Label |
nextstate |  | Button Label |
bistate | false or true | Button Label | true to enable bi-state functionality When button is pressed a value is set, when it is released, even if release is off the button, another value is set. (version 4.5.19.0 onwards)
bistate.press |  | Button Label | Value set for press when set to bistate. (replaces bistate_press)
bistate.release |  | Button Label | Value set for release when set to bistate. (replaces bistate_release)
navigate |  | Button |
navigatedest |  | Button |
stylesheet.button |  | Button |
buttontext | name none list | Button List |
stylesheet.list stylesheet.button |  | List |
deviceDescription |  | Base | Takes device description file and interprets it for this control.
value |  | Base | The current value in the infodriver slot.
penwidth |  | Line | The line width.
points |  | Line | An array of points that the line passes through e.g. 0,0,100,100 is a diagonal line from top left to bottom right.
colour |  | Line | The line colour.

Notifications

notify.valuechanged=<value> | Base
button=released | button line

Device Description

The format of the device description file entry is:

       <param name="FEC" slot="22" class="enum" style="popup_list" access="readonly">
              <state value="0" caption="1/2" style="enum_selected" msg=""/>
              <state value="1" caption="2/3" style="enum_selected" msg=""/>
       </param>

If the slot is 0 this indicates it is a complex type and the actual parameter is got at run time from instances and the complex instance data.

Custom Popup Editors

See here for notes on how this works

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


bncs_ie

UIControls

BNCS IE Wrapper

Description

This is a very simple wrapper for a "legacy" version of Internet Explorer. Sadly this is not the same version as the Internet Explorer installed on that machine - indeed it works on machines that appear to not have Internet Explorer installed at all.

You can change the emulation version by changing registry entries. See here: http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation (apologies if this is an old link by the time you get to use it...such is the nature of embedding hard links like this).

Otherwise....for example....in my case - Internet Explorer 32bit running on Win64 you need to use the Wow6432Node part of the tree rather than the path that appears in the documentation:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"bncs_vis_ed.exe"=dword:00002af9
"panelman.exe"=dword:00002af9

Commands

Command | Notes
homepage=<url> | Set the page is of the standard format you'd type into the address bar of a browser e.g.: homepage=http://bbc.co.uk/
notify.titleChange=false | Whether ths control should notify when the title of the displayed page has changed. For this component this is not normally visible since it does not have a title bar

Notifications

Notification | Notes
title=<page title> | This is the value as would appear on the caption of a browser for a windowed application


bncs_instance

UIControls

BNCS Instance Viewer

Description

This is a simple control primarily designed for design time debugging.

This control shows the fields used in the "instances.xml" configuration file. This is a file key to the targeting of a UI at runtime.

Parameters

Parameter | Notes
reset | Resets the control to the default state
group | What UI group this control is part of
stylesheet | The stylesheet for this control
attribute | Which attribute in the instances.xml file to show on the button. Values can be: id alt_id location type ref composite Version 4.6.54 of this control fixed the above list rather than free-form attribute values to allow use of the cached instances information
instance | The instance

Example

Consider the following XML fragment:

<instance composite="no" id="Memory_RX1290" type="" ref="device=805,offset=0" alt_id="RX1290" />
<instance composite="no" location="" type="hydra" id="hydra_router" ref="device=100,offset=0" alt_id="Calrec Hydra" />

If this control is targeted at "hydra_router" then we can configure the control to show the alt_id field by specifying it in the "attribute" parameter.


bncs_keyboard

UIControls

BNCS Keyboard

Description

This widget is a resizable keyboard for use in client control panels.

The keyboard can display the text as it is types either as plain text, password text or no display. The control can notify it's parent when a key is pressed and/or when return is pressed. The text field will get the hardware keyboard focus, but does not notify the user when this is used.

The control can be configured entirely at panel design time, if you want to change the settings at run time, for instance change the display option, this can be done by sending the relevant command from a script.

Settings

Any commands that are not recognised are passed on to all the individual buttons, as these are BNCS controls these will act accordingly, to set this at design time these entries need to be made via a style sheet. See the BNCS control documentation for further details on the commands that these buttons accept.

Parameter | Value | Notes
reset |  | Resets the control to the default settings
Stylesheet= |  | Sets the style sheet for the client buttons
showText | true false | Show or hide the text input
showPassword | false true | The text is displayed in password mode
notify.released | true false | Notify the parent when a character is released, the default is false. Note that this does not notify when keys are pressed on the hardware keyboard
notify.return | false true | Notify the parent when return is released
spacing | 5 | Set the spacing between the buttons in pixels
default |  | Sets the default text on the keyboard
text |  | Set the current text
exceptions |  | String of characters that will not be allowed (shown on the keyboard)
setFocus |  | The control will take the keyboard focus.
Enable | 1 0 | Enables the control, 0 will disable the control. - note that this is here for v4 compatibility, use the setEnabled() function in a v4.6 script.
Transparent | true false | Sets the background to transparent, the default is not transparent
keyboardType | Keypad Numpad HexNumpad | Selects the keyboard type
numpadLayout | Computer Phone |
allowNegativeValues | true false |
numpadValidation | IP Decimal Length None |
min | 0 |
max | 0 |
minLength | 0 |
maxLength | 0 |

Notifications

Parameter | Notes
Button.<char>=pressed | The character <char> has been pressed, 'a' may be replaced with space, back or tab as well as the other characters.
Button.return=pressed | Return has been pressed, this normally indicates that the user has finished inputting text.


bncs_line

UIControls

BNCS Line

Description

BNCS Line can be used to draw lines on the dialog. The line control is most commonly used to link switches or showing the active signal paths.

Unlike other button types bncs_line has a mask which it "cuts" into the dialog and so many lines can overlap on the dialog without the usual rectangular

As the lines are created using XY coordinates delimited by comma’s‘”,”. With 0,0 being the Top Left corner of a line and 100,100 being the bottom right corner.

Settings

This is the list of commands which can be used on bncs_line.

Commands are in the format:

<parameter> = <value>

Default values are shown in bold

Parameter | Value | Notes
reset |  | Reset back to default values
return |  | Returns a newline delimited string of all the settings. Parameters at their default state are not returned
colour | #FF000 red dark green | Sets the colour of the line, can be colour HEX or colour name.
penwidth | 20 | Sets the width of the line in pixels
points | X1,Y1,X2,Y2...XnYn 0,0,0,100,100,0,100,100,50,100,50,0 | To dynamically set the line. X and Y coordinates passed in a string, with comma separation. Example: 0,0,0,100,100,100 – This would create and ‘L’ shape. 0,100,100,0 – This would create forward slash ‘/’.
stylesheet |  | Sets the style sheet of the bncs_line. e.g bncs_alarm
name |  | Sets the name of the bncs_line.
notify.pressed | false or true | Whether this control should notify the these events.
notify.released | false or true | Whether this control should notify the these events. Released event is sent depending up on the "lostfocus" setting below.
notify.lostfocus | false or true | If notify.lostfocus is true then released events are still generated when the mouse/finger is released outside of the area of the line. Sometimes this is desirable (when you don't want to do a particular action - so you drag your finger off) and others where you must have a "release" event for every "pressed" event.

Notifications

Notifications are of the format:

<parameter>=<value>

e.g.

button=pressed
Parameter | Value | Notes
button | pressed released | Whether the any part of this line control has been pressed or released - notification must be enabled to receive these notifications


bncs_listbox

UIControls

BNCS Listbox Control

Description

This is a simple, single-selection listbox control with suitable wrapper for using with the BNCS Visual Designer.

This control is contained within bncs_ssmart.dll.

Wherever possible don’t explicitly set parameters – use the default or a stylesheet.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new button is created or when a reset command issued) are shown in bold.

Parameter | Value | Notes
reset | Used to reset all the parameters of this control back to their default state
return Return a named parameter from this control.
Possible values are:

return=selected

returns the text of the currently selected item or null string if nothing is currently selected

return=selectedindex

will return the value of the currently selected item or –1 if there is no item selected e.g.

selectedindex=12

To return a list of the items in a listbox use:

return=items

This returns a pipe delimited list of the items in the listbox e.g.

items=one|two|three
colour.text
colour.background 		Any valid Qt colour or nothing. Set colour of the specified parameter.
e.g. the following two examples are equivalent:

colour.led=red
colour.led=#ff0000

Setting the value to zero length string (see example) sets the colour back to the default colour specified in the skin. This is the default for these settings.
e.g.

colour.background=
colour.text=
notify.selection | true | Enables notification on the specified events
add
add.<id> 		The text to add to this list e.g.

add=hello

adds the text “hello” to the listbox – sorting according to the sort parameter.

add.2=hello

adds the text “hello” to the listbox as the third entry. The <id> parameter is irrelevant if sorting is set to “true”

selected.id
selected.text.<options>
selected=next
selected=previous
selected=none 		See below for text options Set the selected item. E.g.

selected.id=4

selects item 5 in the list

selected.text.exact=abc

selects the first instance of text “abc” in the listbox

remove.id
remove.text.<options>
remove 		See below for text options Remove item(s) from the list.
If an id is specified only that item is removed (indexed from 0)
if “text” is specified all items matching that text are removed – the <options> parameter specify the search criteria – see below.
If no sub parameter is specified the currently selected item is removed
e.g. “remove.id=0” removes the first item in the list
e.g. “remove.text=hello” removes the first instance of the text “hello” in the list
e.g. “remove.text.all=hello” removes all instances of the text “hello” in the list
e.g. “remove” just removes the currently selected item – if there is one.
replace.id
replace.text.<options>.<old text>=<new text> 		See below for text options Replace items in the list with the new value
e.g. "replace.id.0=blibble" changes the first item to be text "blibble"
e.g. "replace.text.exact.hello=goodbye" replaces the first instance of exactly the text "hello" with "goodbye"
clear | clear the contents of the listbox
sort true
false 		Whether to sort items alphabetically. Note this suffers the usual problem of this ordering defect:

ARC1
ARC10
ARC2
font.face The current font face.
If no font face is specified (the default) then the standard font face as defined in the skin is used.
font.size 10
–2
(see notes) 		The current font size to use.
If a font face is specified then this is the absolute point size used.
If no font face is specified then this value is the offset from the default skin font size.
e.g. this provides an absolute font/size

font.face=arial
font.size=12

e.g. this uses the standard font in a slightly smaller size (note the negative font size)

font.face=
font.size=-2
stylesheet Stylesheet entry to use for this button
(the stylesheet entry is an external list of any combination of the above settings)
columnMode single
singlev
multih
multiv
 Column Mode - whether single column, single row (singlev) or multiple scrolling horizontally (multih) or vertically (multiv)

Text search options

The default options are: case in-sensitive, substring search. These options can be combined.

Option | Notes
exact | The string must match exactly (not case sensitive however)
casesensitive | The search is case sensitive (i.e. don’t match “ABC” with “abc”)
contains | We may match only part of the string
begins | A string that begins with the search string
ends | A string that ends with the search string
all | This option is only valid for the remove command. This removes all instances of the found string rather than the default which is to remove the first instance

Notifications

Notifications are also in the format:

<parameter> = <value>
Parameter | Value | Notes
selection.<item id> | text value of current selection | The notifications are only made if they are enabled in the settings above.


bncs_listview

Description

This is a simple, single-selection listview control with suitable wrapper for using with the BNCS Visual Designer.

This control is contained within bncs_listview.dll.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Text Gets

Parameter | Return | Notes
selected | Row Text | Returns the text of the currently selected item or empty string if nothing is currently selected
selectedindex | Row Index, Starting at 0 | will return the value of the currently selected item or –1 if there is no item selected
count | Count of rows | Will return the number of the items in the listview
row.<value> | coloumn1;column2;column3; | Will return the text of the specified item (semicolon separated values of the cells) or empty string if the row doesn’t exist; e.g. row.3
column.<value> | row1;row2;row3;row4; | Will return the text of the specified column (semicolon separated values of the cells excluding the column header) or empty string if the column doesn’t exist; e.g. column.2
columns | header1;header2;header3; | Will return the semicolon separated list of the column header texts
columnWidth.<value> | Column Width as number | Will return the width of the specified column or -1 if it is not specified(means set automatically based on the cell contents); e.g. columnWidth.0
columnAlign.<value> | Qt::Top|Qt::Left | will return the align of the specified column (the alignment values are defined in the class Qt so Qt::Top|Qt::Left means that the cell texts are in the top left position); e.g. return=columnAlign.0 This may not work due to other extensions added
cell.<row>.<column> | Cell Text | Will return the text of the specified cell or empty string if the column or row doesn’t exist; e.g. return=cell.0.3
colour.text | Default Foreground Colour | Will return the text colour or empty string if the default colour is used, any cell that has an overridden colour can be gotten separately
colour.background | Default Background Colour | Will return the text colour or empty string if the default colour is used, any cell that has an overridden colour can be gotten separately
notify.selection | selected,changed,none | Will return the state of the selection change notification
notify.cell_selection | selected,changed,none | Will return the state of the cell selection change notification
font.face | font | Will return the current font face set or empty string if the default is used
font.size | font size | Will return the current font size or empty string if the default is used
stylesheet | stylesheet | Will return the style sheet of the control or empty string if it is not specified

Commands

Parameter Value Notes

Reset

Used to reset all the parameters of this control back to their default state

hideHeader

true, false

Hides/shows the listview header

enableSorting

true , false

Enables sorting so the user can sort columns by clicking on the column headers

enableColumnResize

true , false

Enables column resize so the user can modify the column width manually

enableColumnMoving

true , false

Sets whether the header sections can be moved

colour.text
colour.background

Any valid Qt colour or nothing.

Set colour of the specified parameter.

e.g. the following two examples are equivalent:

colour.led=red
colour.led=#ff0000

Setting the value to zero length string (see example) sets the colour back to the default colour specified in the skin. This is the default for these settings.

e.g.

colour.background=

colour.text=

notify.selection

true

Enables notification on the specified events

font.face

any valid font face

The current font face.

If no font face is specified (the default) then the standard font face as defined in the skin is used.

Font.size

e.g.:

10
–2
+3

The current font size to use.

If the value is signed than it is an offset from the default skin font size. Otherwise it is the absolute font size.

Font.style

Any combination of

bold, italic, underline, overline, strikeout

The current font style.

Stylesheet

Stylesheet entry to use for this listview

(the stylesheet entry is an external list of any combination of the above settings)

columnsWidth

Semicolon separated values

Semicolon separated list of column widths. -1 means automatic value based on the cell texts.

e.g.: “columnsWidth=25;-1;-1;50”

columnWidth.<column>

Sets the width of a specified column. -1 means automatic value based on the cell texts.

e.g.: “columnWidth.4=50”

columnsAlign

Semicolon separated values

Semicolon separated list of column alignments. If this parameter is not specified than then the alignment of the stylesheet will be used or ‘left’ if no alignment is defined in the stylesheet.

The alignment values are defined in the class Qt so Qt::Top|Qt::Left means that the cell texts are in the top left position).

e.g.: “columnsAlign=17;34” sets the first column alignment to top left, and the second column alignment to bottom right.

columnAlign.<column>

Sets the alignment for a specified column. – The alignment values are defined in the class Qt so Qt::Top|Qt::Left means that the cell texts are in the top left position).

e.g.: “columnAlign.2=17”

addColumn

Adds new column to the listview with the specified header text.

e.g.: “addColumn=New column”

renameColumn.<column>

Renames header text for a specified column.

e.g.: “renameColumn.0=Modified header”

removeColumn

Removes the specified column.

e.g.: “removeColumn=2”

Add

Semicolon separated values

Adds new item to the end of the listview. Sorting is switched off before adding.

The texts are separated by semicolon.

e.g. “add=ListView;control;is;nice!”

removeRow

Removes the specified row.

e.g.: “removeRow=2”

cell.<row>.<column>

Sets text for a specified cell.

e.g.: “cell.0.0=Top left cell”

row.<column>

Set text for a row

e.g: “row.0=Top Row C1;Top Row C2”

It will only change the row if it exists

selectRow

Selects a specified row.

e.g.: “selectRow=2”

clearSelection

Clears listview selection.

moveColumn

<from>;<to>

Moves a specified column to a new position.

e.g.: “moveColumn=0;3”

moveRow

<from>;<to>

Moves a specified row to a new position.

e.g.: “moveRow=2;1”

Sort

<column>

Or

<column>;<ascending>

Sorts the specified column. The default sorting is ascending.

e.g.:

“sort=2”

“sort=2;false”

Clear

Clears the contents of the listview.

Reset

Resets the default state:

Notifications

Parameter | Value | Notes
selection.<item id> | text value of current selection; the text of the cells are separated by ‘;’ | The notification can be set to notify on Selection, on Selection Changed.

Default values (those when a new listview is created or when a reset command issued) are shown in bold.

Note that the row and column indexes are from 0.


bncs_range

UIControls

BNCS Range

Description

This is a control to deal with range parameters such as gain.

A "range" is defined as any number that can be accommodated in a variable type "double". Its range is "range is +/-1.7E308 with at least 15 digits of precision". This is slightly inefficient as everything is handled as a double even if it's only controlling a byte value, but handles just about all eventualities - even when numbers are expressed as exponentials such as Bit Error Rate e.g. 1e-4.

There are multiple presentations for this control - either up/down buttons, sliders, button, label or keypad. This makes it suitable for most range applications e.g. Video Gain, Receiver frequency.

This control can be used in Qt Designer directly but only the default presentation will appear. The full editing capabilities of this control are only available in the BNCS Visual Designer.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Settings

Parameter | Value | Type | Notes
reset | Base | Used to reset the control back to its default state
id | Base | numeric or alphanumeric identifier for this button
style bigupdown
updown
popup_bigupdown
popup_updown
button
label 		Base
return any of the other settings Base Return a named parameter from this control
e.g. send this to the control

return=text

will return a value of the text setting in the format

text=This is the text
device Base BNCS device number

This value is only returned if the instance parameter is not set

slot Base BNCS slot number

ndex registered for=slot+offset

This value is only returned if the instance parameter is not set

offset Base BNCS offset

index registered for=slot+offset

This value is only returned if the instance parameter is not set

instance Base BNCS instance

Tells the button to use a specific instance, this overrides slot and offset, if a named parameter is used this will also look up the slot.

parameter Base BNCS parameter

Targets the button at a parameter on the current instance, this can overrides slot, offset and slot.

min | 0 | Base | The minimum value of the range value on this control
Max | 100 | Base | The maximum value of the range value on this control
defaultvalue | 0 | Base | The default value of the range value on this control
step | 1 | Base | The small step size
bigstep | 10 | Base | The big step size
units Base The units

e.g 123.456MHz

inoffset | 0 | Base | What numeric offset is applied to get a display value before other calculations are applied.
outoffset | 0 | Base | What numeric offset is applied to get a display value after other calculations are applied.
multiplier | 1 | Base | What multiplier to use to get a display value
dp 0 Base The number of decimal places to display.

Note: setting this resets dp_sent to the same value (this is a backwards compatibility issue for when dp_sent did not exist as a separate parameter)

dp_sent
(version 4.5.11.0 onwards) 		0 Base The number of decimal places to send to the device

See note for "dp" parameter.

notify.valuechanged | false | Base | Whether to notify our parent that the value on this control has changed
width | 0 | Base | Minimum width of this control
height | 0 | Base | Maximum width of this control
colour.text
colour.background 		Button Colours used on this control

use any valid Qt colour

doublepush | false | Button | Whether the button should only activate on a double press
settodefault | false | Button | Whether activating this button should set the range to its default value
notify | false | Button | Whether the button should notify it has been released
notifyvaluechangerequested | false | Base | Whether this button should notify when it tries to set the value on a device
navigate | false | Button | Whether this button should navigate to the navigatedest when pressed
navigatedest | Button | The adjustable device to navigate to
showdefaultbutton | false | Up/Down | Whether to display the "set to default" button
autorepeat | true | Up/Down | Whether pressing and holding the button should increment the value
deviceDescription | Base | Takes device description file and interprets it for this control.
value | Base | The current value for the device
stylesheet.button
stylesheet.label 		Button/
Label

Set the stylesheet of the button or label
dismiss | base | closes ANY popup current (even if it wasn't one for this control)

Notifications

Notifications are also in the format:

<parameter> = <value>
Parameter | Value | Notes
value | <value> | current value of the range parameter
button | pressed |
valuechangerequested | <value> | This control has tried to write a new value to the device

Stylesheets

Version 4.6.13 and later requires the following stylesheet entries for default button state:

range_default | For when the incoming value is the same as the default value
range_notdefault | For when the incoming value is different from the default value

Device Description

The format of the device description file entry is:

<param name="BER" slot="26" class="range" style="label" access="readonly">
    <values min="0" max="0" step="0" bigstep="1" defaultvalue="0"/>
    <display inoffset="0" multiplier="0" outoffset="0" units="E-1" dp="1"/>
</param>

If the slot is 0 this indicates it is a complex type and the actual parameter is got at run time from instances and the complex instance data.

Custom Popup Editors

See here for notes on how this works

Developers Notes

This control has a number of different presentations - i.e. up/down button, keypad, single button etc.

There is a base control that deals with the fundamentals of the data type and maintains things like the min max, default, step etc. etc. It also has the connection to the network. This control has no screen presentation at all.

To make us of the control you require a "skin". This is one or many buttons that sit on the base control and provide the user interface. There can be many different types of "skin". The skins can have their own logic (eg. colouring the Default button when the value of the parameter is in the default state). The control could shed it's skin and use a completely different presentation if required.


bncs_rtrDestGrid

UIControls

BNCS Destination Name Grid

Description

This control is similar to the bncs_sourcegrid component. This control solely includes the destination grid functionality.

Shown below is an example. Destinations are mapped onto buttons and their tallies displayed above (or optionally below).

The grid can be used supply parameters to other things or to make routes directly.

There are three route modes:

Mode | Notes
take | The source is written to the control on a take command and the crosspoint is made.
autotake.dest | When a source value is written to the control it is stored but nothing else happens. When the user selects a destination on this dest grid the route is made and the source value remains valid and may be routed again when the next destination is selected

Button Mapping

Buttons are mapped to router subscribers using an "upper" BNCS database (DB 2-9) or can be mapped manually.

An example database file section is shown here:

[Database_8]
1001=4,0,11,12,13,14,15,16,17,18,19,20,
1002=3,2,1,5,6,7,8,9,10,0,0,12,

This defines two pages of 12 buttons each. The first page has a full set of destinations for the indexes given except the second button which will be shown as disabled.

Typically you'd configure this control to pick these values up by setting mapping database to 8, having a mapping offset of 1000, set the page number at design time (or leave for runtime).

It is possible to set the destinations for this control manually without having to reference an external BNCS database by just providing them directly in the editor UI or at runtime with a "destmap" command

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new button is created or when a reset command issued) are shown in bold.

Parameter | Value | Notes
reset |  | Used to reset all the parameters of this control back to their default state
columns | 5 | The number of columns of buttons for this grid control
rows | 8 | The number of rows of buttons for this grid control
page | 1 | The page to select (added to the pageoffset value to determine the index within the database to use for this entry)
pageoffset | 0 | The page to select (added to the page value to determine the index within the database to use for this entry)
mapdb | 8 | The BNCS database number (2-9) to use for the button mapping information. In theory you could use database 0/1 but these are limited to 16 characters.
mapoffset | 1000 | The offset to apply to the index numbers in the map database
namesdb | 1 | Which database to use to get the names from (0-9). The default is "0" - sources.
namesoffset |  | The offset to apply to the index numbers in the names database
device | 0 | The BNCS device number of the router to control. This device number is used for both the names displayed and the button mapping information. This value is not used if the "instance" parameter is defined.
device.lock | 0 | The BNCS Device number for the lock infodriver. This value is not used if the "instance.lock" parameter is defined.
notify.pressed notify.released notify.name notify.tally notify.alltally notify.dest notify.lock | false true true false false false false | Whether to send notification messages for the relevant events.
stylesheet.selected stylesheet.deselected stylesheet.tally stylesheet.background | dest_selected dest_deselected | The stylesheets used for the various components of this button - there is no option to directly set the stylesheet of individual labels. It is suggested that you try and use the default entries.
sizepolicy | setminimum asdesigned shrinktofit | How to deal with text that doesn't fit on a button. You can either grow the size of the button until the text fits, leave it as designed (and might not fit), or shrink the text until it fits.
button.<buttonId>=released |  | A script may emulate the pressing of a button. The button is of the format: button_xxx where the xxx is the button number starting from 1 at top left and continuing in horizontal rows to bottom right.
instance |  | Instance name for the router
instance.lock |  | Instance name for the lock infodriver
buttonspacing.h | 10 | Horizontal button spacing
buttonspacing.v | 10 | Vertical button spacing
buttonspacing | 10 | Sets horizontal and vertical button spacing simultaneously
pixmap.database | 0 | The database to pick up pixmaps for the buttons. Valid entries are 2-9. A pixmap is a path as bncs_control would understand it. Extension is optional - if omitted default is ".png".This value writes the default (background) pixmap
pixmap.lock | /images/icon_lock.png | Path to pixmap to use when dest is locked. This value writes to the upper right pixmap and is independent of the background pixmap
tally_height | 20 | How high to make the label part of each destination
tally_single_line | false true | Whether to correct | characters in source names (used in BNCS to mean "new line") to spaces so that they don't overflow a single height tally.
tally_under | false true | Whether the tally label should appear above or below the button
source.<instance>=<index> |  | Source Value. What happens when this is written is dependent upon the "auto take mode". Instance value is optional and compared against the instance on this control. If they don't match then the source value is not accepted
autotake.dest | false | In autotake.dest the source value is stored and the crosspoint made when the destination is selected
mask |  | The text "mask" used when making crosspoints - exactly as supplied to the router crosspoint (RC) command
take.<dest_index>.<mask>=<source_index> |  | Initiates a router crosspoint for the currently selected destination and given source (unless autotake is enabled in which case it's ignored) mask is optional dest_index is ignored - it's provided so that this control can be used with others that pass index/mask in the same way
undo |  | Initiates a router cross point to undo the last take command
selected=<index> |  | If index is mapped on the page that is showing then it is highlighted and the current destination set appropriately. If the index is not mapped then the selection is removed and the current destination cleared.
destmap=<dest>,<dest>,<dest> |  | comma delimited list of destinations for this control to configure this control directly rather than point it at mapping database

Notifications

Notifications are also in the format:

<parameter> = <value>
Parameter | Value | Notes
button.<id> | pressed released | The notifications are only made if they are enabled in the settings above. Pressed has to be specifically enabled. Released has to be specifically disabled.
name | <router name> | router name is the value that appears on the depress-able button
dest | <router index> | index of the name that appears on the depress-able button
tally.<dest index> | <source index> |
lock.<dest index> | 0 1 |


bncs_rtrNameGrid

UIControls

BNCS Router Name Grid

Description

This control is similar to the bncs_sourcegrid component. It's simpler and is only a router name grid (aka source grid) and does not include the destination grid functionality.

Button Mapping

Buttons are mapped to router subscribers using an "upper" BNCS database (DB 2-9).
An example ini file section is shown here:

[Database_8]
0001=4,0,11,12,13,14,15,16,17,18,19,20,
0002=3,2,1,5,6,7,8,9,10,0,0,12,11,

It is definable within the control which database of which is used and what index is used to select a comma delimited list of numbers. The list of numbers is then split and used to populate the array of buttons.
If a grid control is configured to have 16 buttons and set to look at entry 0001 above and set to show destination names then the top left button will show the destination 4 name, the top right button destination 12. The second row will start on the left with the destination 13 name etc. etc. There is only 12 numbers in this list so buttons 13-16 will be disabled (along with button 2 which is zero).

Edit Mode

Edit mode changes the operation of this control from "runtime" mode to "configure" mode.

Edit mode allows changes to the button mapping and naming - in edit mode additional commands become available and the action taken when a button is pressed changes.

Edit mode can be changed on the fly to allow in-panel editing.

There are two edit modes - they cannot be active at the same time as their operation is not compatible.

Map Edit Mode

In this mode buttons sending command "index=" presets the value in the control so that the next time a button is pressed this value is assigned to that button. The control continues to emit the notifications (if enabled) but does not show the button as selected.

Unlike runtime (where buttons disable if not mapped) no buttons are ever disabled in map edit mode.

Name Edit Mode

In this mode buttons select in the normal way. However if a "rename=" command is received the currently selected button changes name and all the other buttons disable (this is to indicate that "save" is required).

Buttons are enabled/disabled in the normal way (if there is nothing mapped then you cannot change the name anyway so the button must stay disabled).

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>
Parameter | Value | Notes
reset |  | Used to reset all the parameters of this control back to their default state
columns | 5 | The number of columns of buttons for this grid control
rows | 3 | The number of rows of buttons for this grid control
page | 1 | The page to select (added to the pageoffset value to determine the index within the database to use for this entry)
pageoffset | 0 | The page to select (added to the page value to determine the index within the database to use for this entry)
mapdb | 8 | The BNCS database number (2-9) to use for the button mapping information. In theory you could use database 0/1 but these are limited to 16 characters.
mapoffset |  | The offset to apply to the index numbers in the map database
namesdb | 0 | Which database to use to get the names from (0-9). The default is "0" - sources.
namesoffset |  | The offset to apply to the index numbers in the names database
instance.map |  | The instance to use for button mapping
instance |  | The instance to use for names
device.map | 0 | This device number is used for the mapping database. This value is not used if an "instance.map" name is specified
device | 0 | This device number is used for both the names displayed. This value is not used if an "instance" name is specified
notify.pressed | false | Whether to send notification messages for the relevant events.
notify.released | true | Whether to send notification messages for the relevant events.
notify.name | true | Whether to send notification messages for the relevant events.
notify.index | false | Whether to send notification messages for the relevant events.
stylesheet.selected | source_selected | The stylesheets used for the various components of this button - there is no option to directly set the stylesheet of individual labels.
stylesheet.deselected | source_deselected |
stylesheet.background |  |
sizepolicy | setminimum asdesigned shrinktofit | How to deal with text that doesn't fit on a button. See the bncs_control documentation for more information.
button.=released |  | A script may emulate the pressing of a button. The button is of the format: button_xxx where the xxx is the button number starting from 1 at top left and continuing in horizontal rows to bottom right.
pixmap.database | 0 | The database to pick up pixmaps for the buttons. Valid entries are 2-9.
buttonspacing.h | 10 | Horizontal button spacing
buttonspacing.v | 10 | Vertical button spacing
buttonspacing | 10 | Sets horizontal and vertical button spacing simultaneously
index | 0 | This command has two modes of operation: Runtime: If the supplied index is mapped on this control then it is selected, otherwise the selection is removed. Map edit mode: This sets the source to map next time a control is pressed
map_mode | false true | Whether this control is in map edit mode
rename_mode | false true | Whether this control is in rename edit mode
save |  | Edit mode only. Save the current changes to mapping and/or name change
cancel |  | Edit mode only. Revert any changes back to the configured state.
rename |  | Rename edit mode only. Change the name on the currently selected

Notifications

Notifications are also in the format:

<parameter> = <value>
Parameter | Value | Notes
button. | pressed released | The notifications are only made if they are enabled in the settings above. Pressed has to be specifically enabled. Released has to be specifically disabled.
name | <router name> | router name is the value that appears on the depress-able button
index | <router index> | index of the name that appears on the depress-able button


bncs_smart_string

UIControls

BNCS Smart String

Description

This is a smart control to show the value of a string on a BNCS device

Commands

Command | Notes
style base Possible values
  • button
  • label
  • keyboard (not fully implemented)
  • lineedit (not fully implemented)
validation base
  • alphanumeric
  • numeric
  • alpha
  • regexp
defaultstring | base | not used...
name | base | not used....
id | base | unique identifier for this control
group | base | used for targeting
reset base reset the values back to the default state
(usually called by the editor rather than manually)
child.<id> | base | send the following value verbatim to the control <id>
value | base | set the value - either directly or make it the "preset" value
takepreset | base | when the control is in preset mode - take the current preset value
revertpreset | base | when the control is in preset mode - set back to null
presetmode base Values are
  • true
  • false
smartstringlength | base | for length validation - string length
regexp | base | for regexp validation
smartstringrestricted base Whether to validate string length. Values are:
  • true
  • false
lowercaseonly base Alpha validation only. Values are
  • true
  • false
uppercaseonly base Alpha validation only. Values are
  • true
  • false
numericfrom | base | Numeric validation only. Start of range
numericto | base | Numeric validation only. End of range
numericdecimals | base | Numeric validation only. Number of decimal places
device | base | BNCS device number
slot | base | BNCS slot number (resulting index is slot+offset)
offset | base | BNCS slot offset (resulting index is slot+offset)
instance | base | Instance parameter (BNCS device/offset looked up in instances configuration)
parameter | base | Parameter value - BNCS slot number looked up in specified instance type
notify | base | whether to notify on button pressed
defaultstyle | base
width | base | Set minimum width for this control
height | base | Set minimum height for this control
doublepush button/label Whether the button should be double push. Values are:
  • true
  • false
navigate.adjust
navigate.execute
navigate.popupscript 		button/label Whether to navigate when the button is pressed
navigatedest | button/label | This is the context for the operation specified in the navigate command
popupScriptParam | button/label | A free-form newline delimited list of parameter=value pairs to send to the popup script
colour.text
colour.background 		button/label The basic colours of this control
notify button/label Values
  • true
  • false
presetvalue | button/label | set the preset value - this is then written to the device when you send a takepreset command
dismiss | base | closes ANY popup current (even if it wasn't one for this control)

Notifications

Command | Notes
button=released |
notify.valuechanged=<value> |
valuechangerequested=<value> |

Custom Popup Editors

See here for notes on how this works

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


bncs_sourceGrid

UIControls

BNCS Source Grid

This control is deprecated

Use destgrid or name grid instead

Description

This is an interim solution to router control smart button - it is not truly a super-smart as it hasn't got (and can't easily have) the full range of display options e.g. grid, popup grid from button/label etc.

The way sources and destinations are mapped onto buttons is the model devised for some of the earliest "mappable" BNCS routing systems and is not necessarily ideal for BNCSi.

This control can be used as a grid of source buttons, or as a grid of destination buttons with the router tallies displayed.

There are other options which allow a few additional labels to be displayed. The source for these labels is configurable to be either router databases or simple infodriver slots.

Button Mapping

Buttons are mapped to router subscribers using an "upper" BNCS database (DB 2-9).
An example ini file section is shown here:

[Database_8]
0001=4,0,11,12,13,14,15,16,17,18,19,20,
0002=3,2,1,5,6,7,8,9,10,0,0,12,11,

It is definable within the control which database of which is used and what index is used to select a comma delimited list of numbers. The list of numbers is then split and used to populate the array of buttons.
If a grid control is configured to have 16 buttons and set to look at entry 0001 above and set to show destination names then the top left button will show the destination 4 name, the top right button destination 12. The second row will start on the left with the destination 13 name etc. etc. There is only 12 numbers in this list so buttons 13-16 will be disabled (along with button 2 which is zero).

Lock Destinations

THIS FEATURE IS STILL INCLUDED FOR BACKWARDS COMPATIBILITY BUT SHOULD NOT BE USED. LOCKING USING ROUTER DATABASES IS PRONE TO DATA LOSS SINCE DEV_xxx.INI FILES ARE SYNCHRONISED WITH, BUT NOT UPDATED ON, THE SYSTEM SERVER

Enable this behaviour with setting the Enable tick box in the Lock Destinations section of the Appearance tab of the settings dialog, which results a entry in the corresponding bncs_ui file.
When enabled, the control looks for the [Controller] section of the router ini file, which contains the controller id-s of the router; thereafter looks the [Controller] section of the controller ini file. This file contains which destination ports are locked. The buttons belonging to the locked destination slots are displayed as disabled on the GUI, so they are grey, and the user of the Panel Manager couldn't have the possibility to change them.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new button is created or when a reset command issued) are shown in bold.

Parameter | Value | Notes
reset |  | Used to reset all the parameters of this control back to their default state
columns | 3 | The number of columns of buttons for this grid control
rows | 3 | The number of rows of buttons for this grid control
page | 1 | The page to select (added to the pageoffset value to determine the index within the database to use for this entry)
pageoffset | 0 | The page to select (added to the page value to determine the index within the database to use for this entry)
mapdb | 8 | The BNCS database number (2-9) to use for the button mapping information. In theory you could use database 0/1 but these are limited to 16 characters.
namesdb | 0 | Which database to use to get the names from (0-9). The default is "0" - sources.
device | 0 | The BNCS device number of the router to control. This device number is used for both the names displayed and the button mapping information
notify.pressed notify.released notify.name notify.tally notify.index | false true true true false | Whether to send notification messages for the relevant events. Note: a tally notification is only sent if the tally label is selected as one of the multibuttons
stylesheet.selected stylesheet.deselected stylesheet.tally stylesheet.label | sourcegrid_selected sourcegrid_deselected sourcegrid_tally sourcegrid_label | The stylesheets used for the various components of this button - there is no option to directly set the stylesheet of individual labels. It is suggested that you try and use the default entries.
show.tally show.label.1 show.label.2 show.label.3 show.label.4 | false false false false false | Which of the additional buttons above and below the main button are displayed. This requires the multibutton option to be set to true
lockingenabled | false true | Whether the slots are checked in ini file for locking (SEE NOTE ABOVE)
multibutton | false true | Whether the additional buttons above and below the main button are displayed
tally_source | tally tally_db2 infodriver button_db2 | Where to get the information from to display on the "tally" label (this requires this option to have been enabled). The options are: tally - the source tally db0 name that is routed to this destination tally_db2 - the source tally db2 name that is routed to this destination infodriver - the contents of an infodriver slot the index of which is the same as the router index mapped to this button button_db2 - the database 2 entry of the button name
label_source | infodriver tally_db3456 button_db3456 | Where to get the information from to display in the label(s) beneath the button. The options are: infodriver - the contents of an infodriver slot the index of which is the same as the router index mapped to this button. There is a single infodriver slot for all the labels and the information is comma delimited. tally_db3456 - the database 3-6 entries for the tally source button_db3456 - the database 3-6 for the same index that's mapped to this button
tally_infodriver | 0 | The infodriver device number to use for the tally label display if infodriver is selected as the tally source
label_infodriver | 0 | The infodriver device number to use for the tally label display if infodriver is selected as the label source
sizepolicy | setminimum asdesigned shrinktofit | How to deal with text that doesn't fit on a button. See the bncs_control documentation for more information.
button.<buttonId>=released |  | A script may emulate the pressing of a button. The button is of the format: button_xxx where the xxx is the button number starting from 1 at top left and continuing in horizontal rows to bottom right.

Notifications

Notifications are also in the format:

<parameter> = <value>
Parameter | Value | Notes
button.<id> | pressed released | The notifications are only made if they are enabled in the settings above. Pressed has to be specifically enabled. Released has to be specifically disabled.
name | <router name> | router name is the value that appears on the depress-able button
index | <router index> | index of the name that appears on the depress-able button
tally | <tally name> | The value that appears on the tally of the button. This notification can occur when the currently selected button is changed or when the tally to the currently selected button changes


index

BNCS Custom Control Library

Simple Controls

These are controls that don't do anything clever.

Control | Notes
bncs_control | Generic BNCS button/label
bncs_line | Line control
bncs_keyboard_ctrl | Keyboard Control
bncs_clock | A clock widget
bncs_lineedit | A line edit widget
bncs_listbox | A Listbox (single colum) widget
bncs_listview | A Listview (multi-column) widget

Smart Controls

These are controls that are data aware

Control | Notes
bncs_enum | Enumerated parameters smart button
bncs_range | Range parameters smart button
bncs_smart_string | String parameter smart button
bncs_instance | A control to display where this UI is targeted
uiHost | A control to load an external bncs_ui file as if it were a single control

Additional Information - smart button polling

Router Controls

Controls that understand BNCS routing

Control | Notes
bncs_sourcegrid | Rather confusingly called router source and destination control DEPRECATED
bncs_rtrNameGrid | Router name grid (source grid, paging grid).
bncs_rtrDestGrid | Router destination grid

Misc Controls

Control | Notes
bncs_ie | Simple wrapper for Internet Explorer

Rich Text

Rich text is available on bncs_control and those controls that wrap it up (range, enum etc.). The Rich Text Reference is here

Version Control

Version information here

Build: Alarms_misc_1610 4466 fdf15265 Atos © 2018


popupEditorGuide

UIControls

Popup Editor Authoring Guide

Introduction

These are some notes on popup editors for the smart button types.

The idea was that the smart buttons wrap up commonly used functionality to make life easy...this means there are various configurable features that can be used to make UIs. Sometimes however these controls can't allow for every last edit-time option that may be required and it would be useful to create a custom editor.

The custom editor can be a DLL script or may simply be a bncs_ui dialog description with connections.

Writing The Script

Here's a typical design time editor (for the enum smart button). In the top right section I've selected the navigate option with "Popup Script" - below I've told it where to find the custom editor.

The path to the custom editor follows the same convention as panel loading. i.e. give it the name of the directory and it'll either load the DLL in that directory or if there isn't one the "bncs_ui" file. You can explicity set the path to a DLL or BNCS_UI file otherwise..... Paths starting with a slash are rooted in the system panels directory, otherwise they're relative to the directory of the panel the smart button is sitting on.

Path | Valid?
/myPanel | Yes
mySubPanel | Yes - a subdirectory off the current panel
../somethingHigherUp | Yes
c:\mySystem\panels\stuff | NO - contains an absolute path

Below the path is a number of parameter=value pairs. You can have as few or as many of these as you like - they're passed to the script/UI when it's created.

Things to note

Here's some handy things to know when you're writing DLL scripts for custom edtiors:

  • all the non-default values from the smart button get passed to the script - this may include instance, group ranges BUT NOT values which are at their default values. You have to have some knowledge of the default state of a smart button to set your default states the same (smart button docs define what the defaults are)
  • you may enter as many additional parameter=value pairs at design time as you like - these just get passed to the script as parent callbacks or to a bncs_ui as [parent] events
  • when all the parameters have been passed (from host and manually entered strings) then the control receives a parent callback of "__GO=__GO". This signifies that the control should create it's UI
  • for a DLL script YOU MUST set the size of it using the setSize() function - otherwise all you get is a small popup zit instead of the panel you expected

Using a bncs_ui file only without a script file

Sometimes all you want to do is give a custom layout to an editor. You can use just a plain ".bncs_ui" file as your custom editor.

For this to work you need to use connections to listen out for incoming configuration information (if that's necessary) and to send values back to the control to set the value.

Here's a simple set of connections:

The first line takes messages from our parent and simply passes them to a list control so that we can see what values we're being sent. You don't have to use these messages at all - but they're there if you want

Button1 and Button2 connection events send a value back to this UI's parent - they send a value= command which sets the value of whatever the host smart button is looking at.

Button3 can be used as a close/cancel button to close the popup.

Typically smart buttons accept "value" commands to set the new value, and "dismiss" to close the editor popup.

Notes

At the time of writing there is a fault that you cannot use the connections debugging when a popup UI is active.


Rich Text Reference

Rich text in BNCS controls is a bit like simple HTML. Rich text is always enclosed in <qt></qt> tags (this is the convention used by the underlying toolkit BNCS uses to draw rich text).

A simple example might be:

<qt><h1>Hello World!</h1></qt>

which would display as

Hello World!

Rich text should always attempt to be valid "XML" - i.e. tags should be closed (e.g. use <br/> not just <br>). Whilst the display of text is quite forgiving and doesn't have to be "valid XML" having properly formatted XML enables "pretty print" capability.

Structuring tags | Notes
<qt>...</qt> A Qt rich text document. It understands the following attributes:
  • bgcolor -- The background color, for example bgcolor="yellow" or bgcolor="#0000FF".
  • background -- The background pixmap, for example background="granite.xpm".
  • text -- The default text color, for example text="red".
<h1>...</h1> | A top-level heading.
<h2>...</h2> | A sublevel heading.
<h3>...</h3> | A sub-sublevel heading.
<p>...</p> | A left-aligned paragraph. Adjust the alignment with the align attribute. Possible values are left, right and center.
<center>...
</center> 		A centered paragraph.
<blockquote>...
</blockquote> 		An indented paragraph that is useful for quotes.
<ul>...</ul> | An unordered list. You can also pass a type argument to define the bullet style. The default is type=disc; other types are circle and square.
<ol>...</ol> | An ordered list. You can also pass a type argument to define the enumeration label style. The default is type="1"; other types are "a" and "A".
<li>...</li> | A list item. This tag can be used only within the context of <ol> or <ul>.
<pre>...</pre> | For larger chunks of code. Whitespaces in the contents are preserved. For small bits of code use the inline-style code.

The default character style bindings are:

Style tags | Notes
<em>...</em> | Emphasized. By default this is the same as <i>...</i> (italic).
<strong>...</strong> | Strong. By default this is the same as <b>...</b> (bold).
<i>...</i> | Italic font style.
<b>...</b> | Bold font style.
<u>...</u> | Underlined font style.
<s>...</s> | Strike out font style.
<big>...</big> | A larger font size.
<small>...</small> | A smaller font size.
<sub>...</sub> | Subscripted text
<sup>...</sup> | Superscripted text
<code>...</code> | Indicates code. By default this is the same as <tt>...</tt> (typewriter). For larger chunks of code use the block-tag <pre>.
<tt>...</tt> | Typewriter font style.
<font>...</font> Customizes the font size, family and text color. The tag understands the following attributes:
  • color -- The text color, for example color="red" or color="#FF0000".
  • size -- The logical size of the font. Logical sizes 1 to 7 are supported. The value may either be absolute (for example, size=3) or relative (size=-2). In the latter case the sizes are simply added.
  • face -- The family of the font, for example face=times.

Special elements are:

Special tags | Notes
<img src="myImage.png"/> | An image. The image tag also understands the attributes width and height that determine the size of the image. If the pixmap does not fit the specified size it will be scaled automatically.
<hr/> | A horizontal line.
<br/> | A line break.
<nobr>...</nobr> | No break. Prevents word wrap.

In addition, rich text supports simple HTML tables. A table consists of one or more rows each of which contains one or more cells. Cells are either data cells or header cells, depending on their content. Cells which span rows and columns are supported.

Table tags | Notes
<table>...</table> A table. Tables support the following attributes:
  • bgcolor -- The background color.
  • width -- The table width. This is either an absolute pixel width or a relative percentage of the table's width, for example width=80%.
  • border -- The width of the table border. The default is 0 (= no border).
  • cellspacing -- Additional space around the table cells. The default is 2.
  • cellpadding -- Additional space around the contents of table cells. The default is 1.
<tr>...</tr> A table row. This is only valid within a table. Rows support the following attribute:
  • bgcolor -- The background color.
<th>...</th> | A table header cell. Similar to td, but defaults to center alignment and a bold font.
<td>...</td> A table data cell. This is only valid within a tr. Cells support the following attributes:
  • bgcolor -- The background color.
  • width -- The cell width. This is either an absolute pixel width or a relative percentage of table's width, for example width=50%.
  • colspan -- Specifies how many columns this cell spans. The default is 1.
  • rowspan -- Specifies how many rows this cell spans. The default is 1.
  • align -- Alignment; possible values are left, right, and center. The default is left.
  • valign -- Vertical alignment; possible values are top, middle, and bottom. The default is middle.

Limitations

At time of writing richtext supports "smart size" but not rotation.

Copyright Atos 2012


smartButtonPolling

UIControls

Smart Button Polling

Introduction

BNCS is a funny old Hector in that you have to be sympathetic to the network - i.e don't poll for "too much" at one time (noting that "too much" has and can never be strictly defined)

Top level panels are usually easy - they just poll for the things that they want to talk to...and occasionally you might just have to defer polling if you find you're polling lots of things simultaneously so that you don't hit the network "too hard".

Smart buttons have an issue....they are independent entities and don't know what anything else might be polling for. This is good when developing panels -smart buttons just work by themselves, but they aren't very "sympathetic" to the network. If you create 100 smart controls they'll each ask 100 questions - "gimme slot 1, gimmie slot 2, gimmie slot 3" etc. etc. rather than being able to go gang up and go "gimmie slots 1-100".

Sitting between the smart controls and CSI is a "shim" - this takes the work-load off CSI for multiple registrations. Some systems can have literally thousands of controls - each with their own registrations. The shim just remembers in an efficient way all these registrations (CSI has a maximum of 1000). The shim is in the ideal spot therefore to look at the poll requests and do two things:

  • aggregate multiple requests into one
  • check that the things that are requested actually arrives
Individual smart button requests | What hits the network
IP 101 1 1 IP 101 2 2 IP 101 3 3 | IP 101 1 3

Aggregation strategy

This is great we've just saved ourselves from clogging the network with two unnecessary commands (noting that some panels uses hundreds), and saved the driver from having to decode those individual commands. It's often the case that this is exactly what happens - panels do use range of slots in that way...but also common that you "miss a few out":

Individual smart button requests | What hits the network | Notes
IP 101 1 1 IP 101 2 2 IP 101 3 3 IP 101 6 6 IP 101 7 7 IP 101 8 8 | IP 101 1 3 IP 101 6 8 | slots 4 and 5 are missing...so don't bother asking
IP 101 1 1 IP 101 2 2 IP 101 3 3 IP 101 5 5 IP 101 6 6 IP 101 7 7 IP 101 8 8 | IP 101 1 8 | only slot 4 is missing...so just ask for the lot - the fact that we'll get slot 4 in our responses is offset by the fact that we saved a command outgoing

Key Points

  • poll aggregation/retry is a mechanism SOLELY for single-slot polls
  • there is no longer a direct relationship between sending an IP (or GP or RP) and that poll hitting the network
  • polls may continue to appear and be repeated automatically independently

Gotchas

Aggregation works on device and slot number - the type is taken to be the type of the first command. Consider the following example:

Individual smart button requests | What hits the network | Notes
RP 101 1 1 IP 101 2 2 IP 101 3 3 IP 101 6 6 IP 101 7 7 IP 101 8 8 | RP 101 1 3 IP 101 6 8 | The first block is started with a router poll - so this is what's used as the command on the network. The second block is started with a info poll

This is somewhat nonsensical thing to do - but has been seen!


uiHost

UIControls

BNCS UI Host

This is a simple control to just load the specified ".bncs_ui" file as if it were a single control on the UI.

Targeting

This control can be targeted with it's own instance.

Parameters

If the UI specified has connections then the UI host will read these and search for [parent] in the sender/receiver fields - it will then use the values in these connections to populate the parameters field in the editor:

So...if the specified UI has these connections configured:

will result in these commands being visible in the editor of the panel on which this control is placed (the command "c" and "t" being taken from lines 1 and 2 in the example above)

and the following events (taken from line three above):


version

UIControls

bncs_control Version History

Version | Date | Notes
1.00.01 |  | first version with resources/history 22/01/04
1.00.02 |  | adds instance passing to bncs_script_loader
1.00.03 |  | changes dcw to dll version rather than static lib
1.00.04 |  | changes to instance/group for bncs_script_loader
1.00.05 |  | adds instance browser functions to range/enum tidies polling to single go after 1mS delay (to allow to settle)
1.00.06 |  | fix to bncs_script_loader setcaption instance handling
1.00.07 |  | adds dobuild function to more incoming parameters
1.00.08 |  | adds info/router/gpi query functions to script class
1.00.09 |  | global settings class changed to cc_sys
1.00.10 | 100304 | adds text command to lineedit
1.00.11 | 220304 | adds autodelete( false ) around panels in script PD call
1.00.12 | 310304 | adds return values to the PS/PD/PP/PR calls in script helper
1.00.13 | 060404 | adds canNavigateAdjust call
1.00.14 | 130404 | rebuild to correct project options (no changes otherwise)
1.00.15 | 070504 | changes bncs_range instancing code in setCaption
1.00.16 | 230704 | corrects "id=" name setting function in bncs_range control which fixes could not set button id bug
1.00.17 | 260705 | corrects return value in bncs_control for colours.xxx navigateAdjust, NavigateExecute, navigateCanAdjust now cope with instances that have spaces corrects BNCS_WORKSTATION references to CC_WORKSTATION
1.00.18 | 020804 | corrects sourcegrid pixmap paths
1.00.19 | 250804 | corrects script helper return command (to allow for individual param return)
1.00.20 | 260804 | correct to script class to use return=all for edit dialog
4.5.0.0 | 011204 | build for Synergy
4.5.0.1 | 190105 | adds count call to listbox and also makes sure that the current item is visible in this list when it's selected.
4.5.1.0 | 020305 | Add setting and getting of value from range and enum controls - Done by Mark
4.5.2.0 | 150305 | Can now use GPIs and Routers with Smart buttons - Done by Mark
4.5.2.0 | 220305 | Parameter sotred by name, also accepts complex types - Done by Mark
4.5.4.0 | 060405 | Enum can now be a background button - Done by Mark
4.5.5.0 | 130405 | Scripts can now retarget a child panel - Done by Mark
4.5.5.0 | 140405 | Panels can now be targeted at instances with spaces - Done by Mark
4.5.6.1 | 100505 | Corrected PS targeting problem - Done by Mark
4.5.7.0 | 080605 | Setting values from script noe via CSI buffer - Done by Mark
4.5.8.0 | 270605 | Control now gets the type from the device description file.
4.5.8.1 | 210905 | minor fix to listbox so that sort timers are stopped and not run every time an entry is created
4.5.8.2 | 260905 | SPeeded up drawing of buttons, and some debug messages removed.
4.5.8.3 | 290905 | "Press again" popup minimum size related to text, and always appears, even if button at top of screen.
4.5.9.0 | 290905 | Enum_line can now notify, navigate and change slots
4.5.10.0 | 061005 | corrects parameters passed killTimer calls so that other (random) timers are not stopped removes also some redundant line mask drawing calls adds button.xxx=relased functionality to sourcegrid
4.5.10.1 | 101005 | Stopped problem with invalid bitpas caused by invalid size, still problems with >10,000 widgets though!
4.5.10.2 | 121005 | Found another timer that is killed.
4.5.10.3 | 131005 | Add an else to the kill other timers in the timer event.
4.5.11.0 | 191005 | uses up_big.bmp and down_big.bmp for the images on the big updown button, ensures these are present by copying existing up/down bitmaps if required
4.5.12.0 | 191005 | adds double push option to the enum list/buttons (both)
4.5.13.0 | 201005 | bncs_enum_line now draws lines direct rather than creating child bncs_line removes a number of layout managers that are not really needed on the smart buttons
4.5.14.0 | 201005 | removes decimal point formatting of range control paramters (so that they don't get cropped by the decimal point value used to display them...)
4.5.15.0 | 201005 | uses static function to get shim rather than creating a class
4.5.16.0 | 251005 | major reworking of the way that bncs_control works to save the number of widgets that get created adds also name parameter to range buttons and label for name in the popup (doesn't show this on the popup if no name is set)
4.5.16.1 | 311005 | Default button action is not to signal lost focus
4.5.16.2 | 311005 | Line now emits pressed, released and lostfocus if set. Masks used for mouserelease events in lines.
4.5.17.0 | 021105 | uses cached version of instance information (and device type) so speed up dev/offset/slot finding
4.5.18.0 | 091105 | Audio functions added here!
4.5.18.1 | 091105 | adds button edit functions to range button (doublepush/stylesheet) makes disable work on smart buttons
4.5.18.2 | 271105 | fixes I
4.5.18.3 | 010206 | Added a clock control
4.5.18.4 | 130206 | Added Smart String control
4.5.18.5 | 290306 | Restructured so that all enum, range and smartskin edit components derive from skin_base
4.5.18.6 | 170506 | If the text is only a '
4.5.18.7 | 220506 | Fix various problems introduced with the re-structuring
4.5.18.8 | 260606 | Audio function do not cause crash when on a machine with no audio now.
4.5.19.0 | 270606 | BiState functions added.
4.5.20.0 | 270606 | String added, but only for the label and button options
4.5.20.1 | 280606 | Fix added to stop holes appearing in panels
4.5.21.0 | 030706 | Keyboard can now have a transparent background
4.5.21.2 | 160806 | Fix range button released notifications
4.5.21.3 | 160806 | Fixed bug where enquiry for navigate returned true even if there was no typehandler for the device.
4.5.21.4 | 220806 | Re-instated enum state browser when double-clicking an entry - why was it removed???
4.5.21.5 | 240806 | Smart string group made to work, there wher 2 seperate strings for group, there is now only 1!
4.5.21.6 | 290806 | Fix so that the range control does nmot have holes in it.
4.5.21.7 | 050906 | Fix so that setting the name programatically on an enum button updates the text.
4.4.21.8 | 060906 | Fixed enum button so that when a new style is applied first the button stylesheet is applied to override other settings.
4.4.21.9 | 200906 | Fix so that the textGet navigatedest works on a simpleNavigate button, also fixed many other return values that were missing......
4.4.21.10 | 250906 | Enum button & label now remember to display no text.
4.4.21.11 | 260906 | Range was trying to access a non-existent child helper, checking now implemented.
4.4.21.12 | 021006 | Range mask cleared if there are no children, means that buttons and labels appear correctly.
4.4.21.13 | 021006 | Range popups now appear correctly....... As there were child controls the mask hid them.
4.4.21.14 | 041006 | Mask added to enum so that the space between the list controls is painted by the background.
4.4.21.15 | 051006 | Fix so that at design times changes between enum styles draw correctly.
4.4.21.16 | 101006 | Mask is now part of the bncs_skin_base, and handled by each class as appropriate.
4.4.21.17 | 021106 | Fixed tab order on the range settings edit page.
4.4.21.18 | 131106 | Added the ability to send "NOW" on infowrite commands.
4.4.21.19 | 131106 | Added the ability to send "NOW" on GS and RC commands
4.4.21.20 | 150106 | Got rid of all of the compiler warnings etc....
4.4.21.21 | 220106 | Fix to allow loading of multiple instances of component that are in the route of the panels directory.
4.4.21.22 | 060307 | Rebuilt with new decodeBncsString lib to allow null strings to be written i.e. IW 123 '' 1.
4.4.21.23 | 270307 | Enum values are now set to disabled if the device description says slot is readonly
4.4.21.24 | 290307 | There is a short delay before a range will repeat to allow the user to cnange the value easier.
4.4.21.25 | 260407 | Bistate now uses the bistate.press/release notation, was a bad day when done before obviously.
4.5.22.0 | 300407 | adds getIdList functionality and also curious version numbering scheme
4.5.23.0 | 191107 | fundamental button style now stored irrespective of style/statesheet entry
4.5.?.? | ??????? | multiple changes not recored here
4.6.0.0 | 281008 | reworked shim, removes bncs_config objects (speed enhancements)
4.6.0.1 | 071108 | sourcegrid now unregisters from shim before being destroyed
4.6.0.2 | 111108 | registration with zero device number fixed for script loader
4.6.0.3 | 141108 | adds handle to Tooltip
4.6.0.4 | 030309 | corrects gpi param order
4.6.0.5 | 060309 | adds description to the debug tooltips, also corrects sending of GPI values (bool cast of QString( "0" ) is 1).
4.6.1.x | 060409 | fix for historic memory leak (oops) and changes version numbering so last digit can be auto-incrememting build number
4.6.2.0 | 030809 | Added the ability to modify enum values via right button if it is allowed in g_pnlman.ini
4.6.2.1 | 030809 | controlMove(moves control to specfic co-ordinates) and controlPosition (gets controls position) added to BNCS script helper, and bncs script loader.
4.6.2.2-71 | 050809-250809 | More changes Help buttons added to different control types bncs_control settings changed to point at correct location for htmlhelp.h bncs_range_edit_style changed so the GUI displays correctly Do validation when setting value for the numpad control from outside (with textPut). This will bring the buttons to default state when clearing the entered value after pressing 'Ret'. Crash fixed. bncs_control modified to copy bncs_ssmart.chm to windows/lib location
4.6.2.72 | 280809 | Added the show browse dialog signal handlers to the controls
4.6.2.73 | 030909 | Fader control now shows its handle button in the overall style
4.6.2.74 | 110909 | Horizontal fader control added
4.6.2.75 | 241109 | Text Orientation feature added to control and range_fader
4.6.2.76 | 011209 | DB button control added
4.6.3.xx | 031209 | Now passes all parent params to navigate->popup script component
4.6.4.0 | 031209 | adds param list to popup script navigate event
4.6.5.0 | 071209 | any return from a script run by "Navigate->popup script" will cause the popup to close
4.6.6.0 | 101209 | allows return of slot parameter
4.6.7.0 | 141209 | changes to the way popup->script works - now scripts should send value=XXXX as hostNotify for the smart button to set the parameter NOT set it directly
4.6.8.0 |  | WHY NO VERSION HISTORY
4.6.9.0 |  | WHY NO VERSION HISTORY
4.6.10.0 |  | WHY NO VERSION HISTORY
4.6.11.0 | 250510 | corrections to restore direct device/offset/slot working when no instance/parameter is set (B'ism)
4.6.12.0 | 250510 | makes smart button dialog layouts consistent - fixes enabling/disabling of device/offset/slot
4.6.13.0 | 210610 | makes range button default a stylesheet not a hard coded value (range_default, range_notdefault)
4.6.14.0 | 240610 | hmm...not sure I like this but there is bizarre set of circumstances when you create a popup script on range/enum/string buttonswhen you may wish to defer creation of dialog until after all parameters have been set. This is OK except parameter list is freeform and optional. I have added an "end of parameters - go for it" command as the last thing that the incoming script receives This is of the form __GO=__GO. This just says "you've got all your params go for it! This only applies to scripts that are created as popup script items.
4.6.15.0 | 250610 | clarification of notification code - this previously would notify of a change but an immediate get of the value would return the last value not the current one
4.6.16.0 | 250610 | oops...change to correct error in last change
4.6.17.0 | 020710 | less stringent checking of popup param values ("value" is allowed to be null)
4.6.18.0 | 090710 | fix to smart string stuffed up from 4.6.15
4.6.19 | 240910 | script component only returns scaling parameters if not at default value adds rtrDestGrid and rtrNameGrid reorganises project (largely) into control type
4.6.20 | 280910 | fixes to rtrDestGrid to make routes, have take and undo etc adds global design time flag so that controls aren't disabled at design time (makes them hard to edit)
4.6.21 | 300910 | adds device type flag (can't get from device type 'cause default is infodriver and there is no need for device type otherwise for a router) fixes button push on label to select the button not the label moves the button layout back to the first tab
4.6.22 | 041010 | changes default for index on rtrNameGrid and rtrDestGrid from 0 to -1 (zero being an occasionally used "off" source).
4.6.23 | 081010 | fixes folder/vc project buttons in script loader and adds open help button
4.6.24 | 111010 | support for _events and _commands command passing to script_loader
4.6.25 | 191010 | adds option to set the index of a name grid (if there's that index mapped it's selected otherwise it'll deselect) also adds _events and _commands handlling
4.6.26 | 211010 | fix to tally_under default value (rtrdestgrid) and fix to rtrnamegrid deselection
4.6.27 | 211010 | adds host id for script loader
4.6.28 | 221010 | sets minimum height of enum popup buttons to 50 (this needs to be more sophisticated (bug 628) makes width and height commands for bncs_control actually do something useful (they didn't work properly before)
4.6.29 | 221010 | adds simple _events and _commands handling to enum and range
4.6.30 | 291010 | splits mapping and naming instances for rtrNameGrid
4.6.31 | 291010 | removes autotakesource mode from rtrDestGrid and changes "source" command to "take" and adds different "source" command fixes rtrNameGrid database change notification (now it has split instances)
4.6.32 | 081110 | adds "proper" editor to line edit (only allows setting of text and initial focus)
4.6.33 | 111110 | enhances line edit control to accept colours/stylesheets and switchable notifications
4.6.34 | 191110 | adds edit mode to the router name grid component
4.6.35 | 191110 | adds dirty command to rtrNameGrid, also further honing of dirty/disable functions
4.6.36 | 291110 | adds replace command to listbox
4.6.37 | 021210 | adds _commands and _events handling to the basic control
4.6.38 | 091210 | quick and dirty mods to allow non-VC scripts to load (shouldn't be a problem for existing code)
4.6.39 | 101210 | evolution of 4.6.38
4.6.40 | 010311 | blind fix of design time/background setting for windows 7
4.6.41 | 030311 | eyes open fix for design time/background setting for windows 7
4.6.42 | 120511 | fix to crop incoming index at 0 rather than -1 on router name grid
4.6.43 | 190511 | GREAT TWONK YATES - fix to script helper param ordering to get around issue with decodeBNCSString not liking quoted string at the start. Effect was getDev not working properly
4.6.44 | 170111 | crash fix for null string when doing textGet
4.6.45 | 060812 | removes background settings from bncs_control, bncs_enum and bncs_smart_string
4.6.46 | 251012 | removes double button=released notification for enum button
4.6.47 | 301012 | adds httpGet/httpPut support for scripts
4.6.48 | 131112 | allows setting of button name on enum popup (hor or ver) type. This also changes the title of the popup (it always did)
4.6.49 | 151112 | support for controlCreate in script helper
4.6.50 | 191112 | connects output of newly created widget using controlCreate command
4.6.51 | 201112 | allows null-string for panelpopup ui - it'll create a blank dialog and allow you to size it. This is useful when using createControl to dynamically create buttons
4.6.52 | 201112 | rich text option for all button types that use bncs_contro_funcs (most of 'em)
4.6.53 | 221112 | optimisation of rich text - now adheres to smart/fixed size options, copes with text values that contains CR/LF adds long overdue pixmap browser adds text editor field with pretty print
4.6.54 | 261112 | rich text docs & integration changes line edit design time representation to be a bncs_control/label so that it doesn't grab the keyboard shortcuts no longer forces penwidth to be a stylesheet item (I've never understood why it should have been forced to be) listbox reset now resets the colours back (previously undo didn't work 'cause reset only reset the internal states not the listbox control) bncs_instance now uses cached version of instances rather than loading instances each time uiHost now integrated with this control not separately - this allows use of instance browser etc.
4.6.55 | 141212 | fixes to lineedit/keyboard control following design-time changes of 4.6.54
4.6.56 | 141212 | small fix to start with null timer in smart string - fixes issue with non-registration of some controls
4.6.57 | 240113 | oops....sets the path to controls when they're created using the recent controlCreate script function
4.6.58 | 010213 | adds disabled startup option adds svg support to basic button....except svg support in Qt3 isn't very good - some work required in the editor but working
4.6.59 | 010213 | dynamic allocation of timer (not every button needs to allocate one)
4.6.60 | 040213 | tarts editors for svg path/data
4.6.61 | 040213 | bum bum bum bum bum....now forces screen update when svg data is changed on the fly (as runtime parameter)
4.6.62 | 040213 | SVG's don't fill the entire paint area when drawn 1:1 even when all the dimensions are correct and it should fit. Scale by 1.099 and it all just about fits nicely. This is horrid....but it appears to be a limitation of the SVG engine
4.6.63 | 070213 | UI host now passes parent events to the dialog so that incoming [parent] connections can work
4.6.64 | 120213 | UI host crash fix (passing values to non-existent child ui)
4.6.65 | 120213 | Removes some debug messages from paint (not carrying much of interest)
4.6.66 | 120213 | UI host now has scale feature. Fixes too for notify signal (duplicate signals in script_loader and bncs_runtime
4.6.67 | 150213 | fix to keyboard control and bncs_lineedit to allow text align to work tiny tiny fix to function signatures in scriptloader for void param lists
4.6.68 | 150213 | keyboard control better behaved when it comes to enabling/disabling excluded characters
4.6.69 | 080313 | adds panel initialise command
4.6.70 | 080313 | changes hierachy of layout managers so that the layout appears correctly when a panelInit is done - for some reason doing this gives bum information to the QVBoxLayout and it appears the wrong size when a later panelShow is done
4.6.71 | 110313 | QString handling of null string compared with zero length string didn't actually equal each other (bizarre, given that bncs_string had a similar issue)
4.6.72 | 110313 | Crashfix to writing null enum values
4.6.73 | 140313 | Allows bncs_ui files as well as dll for popup smart button editors
4.6.74 | 150313 | fix to allow dynamic setting of the enable state for enum controls so that it still displays the current state
4.6.75 | 180613 | removes duplicate notify(QString&) signals from ss_base and individual smart buttons (not that it seemed to be upsetting much) connects bncs_script_loader "panels" signal so that connections on panels may still use the [parent] so there is no difference in the way a .bncs_ui panel or scripted panel works fix to 4.6.70 relating to layout managers in enum buttons - the layout was being set before having items in it
4.6.76 | 210613 | fix to smart string - wasn't persisting the instance properly
4.6.77 | 240613 | adds 9 additional pixmaps per button topLeft, top, topRight, left, right, bottomLeft, bottom, bottomRight, centre. These are additional pixmaps to the exising single but are not scaled, and fixed position. changes lock pixmap on dest control to be (new) pixmap.topRight - it may be worth making this configurable
4.6.78 | 270613 | minor fix to bncs_listview editor and converts docs to html
4.6.79 | 090713 | change to bncs_rtrDestGrid so that lock is false on null string or start of value==0 but anything else (such as when there is a long lock-reason) is true
4.6.80 | 060913 | bncs_range_updown repeat time may (or may not) have fired - uninitialised timer identifier range will now accept comma "clarified" values e.g. 1,234,567.89 is translated to 1234567.89 range now uses the decimal places sent dp_sent to use as the format for the value changed/return value from a range control
4.6.81 | 090913 | listbox now uses ensureCurrentVisible() with next/previous selections
4.6.82 | 130913 | uninitialised timer in bncs_enum_list - causing occasional non-appearance of control
4.6.83 | 300913 | splits info/gpi/router poll/query commands into separate things - previously IP and IQ (etc) would both have just polled...I'm not sure why....
4.6.84 | 041013 | clears smart string value when retargeting bncs_instance control now has full bncs_control editor to set style, states, notifications etc fixes "next" in bncs_enum button mode when one of the states is null
4.6.85 | 071013 | now allows return of "name" parameter from smart button types
4.6.86 | 241013 | Fix to popup navigate destination so that popup controls the lifetime of the child widget properly and that the signals off it don't get connected multiple times
4.6.87 | 041113 | Now doesn't display the "extra" 9 fixed position pixmaps when the button is disabled Clears the pixmap values on the dest button when changing pages.
4.6.88 | 1113 | Added internal diagnostics for timers, timer allocation, caption setting. All left disabled. No features available to the user.
4.6.89 | 141113 | enum now clears current state if not targeted and won't target when only instance is valid but parameter not.
4.6.90 | 211113 | Changes to diagnostics for timers, timer allocation, caption setting. All left disabled. No features available to the user.
4.6.91 | 021213 | Deferred startup system modified so acts through common class. Currently still done based on timers. Could put actions in-line.
4.6.92 | 041213 | Deferred startup now does the actual start-up call in-line at the end of dcw's block of captions, rather than off a timer. Outside dcw it'll still use the timer.
4.6.93 | 091213 | small fix to ensure that the router name grid updates correctly when targeted with device rather than instance
4.6.94 | 091213 | fix to fader control to update the range on the fader when incoming min/max changes
4.6.95 | 091213 | fix to fader control to not use the multiplier internally
4.6.96 | 161213 | Changes to ensure that upsidedown faders (min>max) work properly for faders
4.6.97 | 140114 | ...my head hurts...schoolboy trig and now shrink to fit works with angled text - both vertical and arbitrary angles (vertical more efficient than arbitrary)
4.6.98 | 230114 | font scaling now tidied up...what a mucking fuddle - there are now two different mechanisms to scale fonts dependent on whether it's shrink to fit or the scripty dialog scaling
4.6.99 | 230114 | tiddly tiny fix to ensure that the multipler can't be zero (possibility of divide by zero error)
4.6.100 | 270114 | bncs_ie will now optionally send title change events
4.6.101 | 270114 | adds textGet handling for bncs_ie title param and fixes multiple notification (as incoming from the control itself) so that only changes are sent out
4.6.102 | 070214 | careless problem introduced reworking DLL-controls comms to allow for spaces - upshot was that PR didn't work
4.6.103 | 100214 | makes navigateCanExecute do something sensible (based entirely on the filename rather than applications.xml config)
4.6.104 | 140314 | Fixes a bug in ListView where using the Reset command adds an extra connection each time. So mulitple connections are send out on each click, Also added some new documentation for ListView
4.6.105 | 070414 | Removes deferredstartup debug messages removes unnecessary stop and restart of timer
4.6.106 | 110414 | slip of the fingers adding in conditional debug messages
4.6.107 | 130514 | fix to update the state of the default button if the default value changes
4.6.108 | 080714 | Changes caption enable to send a message to the host rather than try and force it ourselves
4.6.109 | 050914 | changes script loader path to use explicit path with DLL extention - it was found that Win2008r2 didn't work with inferred paths
4.6.110 | 201014 | More robust version of CM command handling
4.6.111 | 171114 | removes "browse" option on the base button as this feature was never implemented and was just obscuring the rest of the code fixes very long-standing (and rather obscure) crash when changing to enum-Line presentation when no previous style had been set doublepush had an odd interaction with the press notification - i.e. it didn't work if press was enabled. In fixing this I also incorporated a feature request so that press/release/focus settings can be used in all combinations alongside double push I do not know when you'd want double push with press AND release notifications (which only occur on the second operation within the timeout) but it now works as you might expect from the settings
4.6.112 | 181114 | cascades the edge masking code to the right place for different button presentations
4.6.113 | 271114 | Fixes long-standing bug with the enum control where the mask sometimes isn't calculated on change of style
4.6.114 | 281114 | The quest to lose 28 pixels
4.6.115 | 220115 | adds a one pixel downwards offset to centre aligned text to look subjectively better
4.6.116 | 220115 | adds multi-column mode to the listbox (H or V) also single column row mode (bit specialised that one...but whilst I was there....)
4.6.117 | 230115 | minor enhancements to make the listbox less frisky in moving about when updating items
4.6.118 | 270115 | the name grid control was not marking the state as dirty when assigning new sources - this was preventing it from saving
4.6.119 | 270115 | careless handling of = when setting params on a component meant you couldn't have = within the value itself
4.6.120 | 290115 | ui host now reads connection information of its configured UI so that you can populate a script like table with those senders/receivers that contain the [parent] keyword
4.6.121 | 160215 | bncs_listbox: force a recalculation of the layout when changing sort mode (otherwise you end upwith cropped names)
4.6.122 | 050315 | fix to loading of docs for deprecated bncs_sourceGrid
4.6.123 | 130315 | rtr dest grid & rtr name grid now supports databases 10-65535
4.6.124 | 240315 | clock now has leading zero (helps indicated it's a 24 hour clock)
4.6.125 | 270415 | clock widget now only writes to the display on change of value not every tick
4.6.126 | 180515 | navigateCanAdjust marginally more discerning in that it'll check that the typehandler entry exists AND has length - still undecided whether this should emulate the full functionality of panelman in checking what it'll load not just that it'll attempt to load
4.6.127 | 190515 | fix to notify function where undefined sub0 values would set the notify flag
4.6.128 | 190515 | light optimisation to 4.6.127
4.6.129 | 110615 | fix to long standing (end 2013) bug where enum controls did not de-register with previous targeting so if you changed slot only you were ok, but a change of device meant double revertives
4.6.130 | 180615 | Reinstates calculation of size for shrinking text when a control is resized (I'm not sure why it had been commented out...)
4.6.131 | 230615 | enum buttons now will dynamically update their display if state list is dynamically adjusted
4.6.132 | 250815 | Silly typo on database selector drop-downs (Soure instead of Source)
4.6.133 | 270815 | Correction for typo keyboard label: Keyborad --> Keyboard. Correction for "theitems" --> "the items". Correction of " is is " --> " is " in rtr Dest, Name & source grid doc.
4.6.134 | 040915 | Allows enableCaption (in script helper) to set a title
4.6.135 | 100915 | ui host now will not allow the picking up of the instance parameter within the param list of the control - only its own instance param
4.6.136 | 191015 | changes home-brew function for file-management for toolkit one to chase-down eroneous file-copying feature (range control "big" bitmaps)
4.6.137 | 021115 | allows editing of instance attribute in the instance viewer control
4.6.138 | 121115 | bncs_range control now uses the same tooltip code as enum
4.6.139 | 280616 | fixes manual mapping of dest grid (strangely nearly working, but only partially implemented)
4.6.140 | 140716 | won't try and label buttons when there is no router number set even if there is manual configuration
4.6.141 | 060916 | will use lua_loader for smart button popups
4.6.142 | 151216 | removes stylesheet editor from the stylesheet browser. This is faulty, incomplete, illconcieved and unlikely to be fixed/finished.
4.6.143 | 310117 | not a fix at all - but adds exception handling to deleting the Internet Explorer activeX control as it was found it's really quite flaky with anything that runs Javascript
4.6.144 | 020217 | adds control destroy to the script control
4.6.145 | 070217 | dynamic creation and destruction of controls now keeps the id list up to date
4.6.146 | 010317 | Adds textgets for the rtrNameGrid so scripted panels can use the information, rows and columns were the most needed additions.
4.6.147 | 180417 | now uses border size for popups from the stylesheet (if it supports that pixelmetric)
4.6.148 | 210417 | adjusts columns to fit on the script loader dialog
4.6.149 | 250417 | Doesn't redraw on updating text and colours when there is no change in the value
4.6.150 | 270417 | Change along similar lines to 4.6.149 but for font settings so that no change of font doesn't delete the old one or force an unnecessary update
4.6.151 | 170517 | "Can't load script" message now uses text colour from style so that it should always be different from the background
4.6.152 | 290817 | Small fix so that selecting item by index in a listbox is allowed if that item has focus (bz. bug 2882)
4.6.153 | 110917 | Dev. version (superseded)
4.6.154 | 190917 | fix to "disabled initially" and whilst I'm in there in the same bit of code, adds "hidden initially" feature to base control
4.6.155 | 200917 | Restores the way popups used to work when used with smart buttons to position at top-left of parent rather than at cursor position. This allows external triggers to do the popup regardless of where the cursor is
4.6.156 | 210917 | Enum, range and smart-string button now accept "button=pressed" to externally action the configured button event (e.g. popping up a custom script)
4.6.157 | 220917 | Fix to 4.6.155 because script components need to pop up at cursor position as otherwise it pops top left of the script not top left of the button that initiated the popup
4.6.158 | 121017 | BNCS_V6 IPC for 32k devices, 65k slots etc.
4.6.159 | 271017 | adds notify.lostfocus=true so that auto-repeat buttons don't end up spewing data
4.6.160 | 030118 | bugfix to 4.6.159
4.6.161 | 250118 | Fix to browse scripts to ignore all folders that start with a period
4.6.162 | 190218 | Sense of return value for a panel show when the targeting param was used was inexplicably inverted. This version corrects
4.6.163 | 010318 | bncs_listview "ensureItemVisible" call was technically correct, but by preference the item should be centred
4.6.164 | 060318 | Trivial fix to bncs_destgrid to ensure that button notifications are only connected once (previously would give double notifications)
4.6.165 | 230418 | Wow, one of those "how long has it been like that" moments. range control now able to use GPI and ROUTER devices from the device type to match string and enum types
4.6.166 | 240418 | Removes extended range support


bncs_listview_extended

Description

This is a single-selection listview control with suitable wrapper for using with the BNCS Visual Designer.

This control is contained within bncs_listview_extended.dll.

Cells

The extended BNCS listview allows PNGs to be displayed along with allowing the setting of foreground and background colours per cell.

This can be set at design-time with the following embedded formatting, or else use the "methods" described in the commands table below.

The Syntax used for doing this is as follows.

@pixmap=pictureName~text=textToDisplay~fg=foreColour~bg=backgroundColour@

It is a tilde(~) separated key value pair list, which must start and end with a @.

e.g.

@pixmap=myImage~text=myText~fg=#008000~bg=#ffffff@

The values that can be set this way are (any may be ommitted)

Value | Notes
pixmap= | The image to display, this will be a png stored in "panels/images/" Path and ".png" extension are implicit and should not be included
text= | The text to display this will be displayed to the right of any image displayed
fg= | The foreground colour of the text
bg= | The background colour of the text

Tags

Tags are runtime parameters that can be added to a row.

It can contain any information you want, it will not be shown in the row.

Settings

You can pass any of the following settings to this control in the format:

<parameter>=<value>

Default values (those when a new listview is created or when a reset command issued) are shown in bold.

Note that the row and column indexes are from 0.

Text Gets

Parameter | Return | Notes
selected | Row Text | Returns the text of the currently selected item or empty string if nothing is currently selected
selectedindex | Row Index, Starting at 0 | will return the value of the currently selected item or –1 if there is no item selected
count | Count of rows | Will return the number of the items in the listview
row.<row> | coloumn1;column2;column3; | Will return the text of the specified row (semicolon separated values of the cells) or empty string if the row doesn’t exist; e.g. row.3
tag.<row> | Row Tag or empty | Will return the tag of the specified row or empty string if the row doesn’t exist; e.g. tag.3
column.<value> | row1;row2;row3;row4; | Will return the text of the specified column (semicolon separated values of the cells excluding the column header) or empty string if the column doesn’t exist; e.g. column.2
columns | header1;header2;header3; | Will return the semicolon separated list of the column header texts
columnWidth.<value> | Column Width as number | Will return the width of the specified column or -1 if it is not specified(means set automatically based on the cell contents); e.g. columnWidth.0
columnAlign.<value> | Qt::Top | Qt::Left
cell.<row>.<column> | Cell Text | Will return the text of the specified cell or empty string if the column or row doesn’t exist; e.g. return=cell.0.3
cellPixmapTag.<tag>.<column> | icon_test | Will return the pixmap name of the specified cell or empty string if the column or row doesn’t exist; e.g. return=cellPixmapTag.tagName.3
cellPixmap.<row>.<column> | icon_test | Will return the pixmap name of the specified cell or empty string if the column or row doesn’t exist; e.g. return=cellPixmap.0.3
cellFGTag.<tag>.<column> | #000000 | Will return the Foreground colour of the specified cell or empty string if the column or tag doesn’t exist; e.g. return=cellFG.0.3
cellFG.<row>.<column> | #000000 | Will return the Foreground colour of the specified cell or empty string if the column or row doesn’t exist; e.g. return=cellFG.0.3
cellBGTag.<tag>.<column> | #ffffff | Will return the Background of the specified cell or empty string if the column or tag doesn’t exist; e.g. return=cellBG.0.3
cellBG.<row>.<column> | #ffffff | Will return the Background of the specified cell or empty string if the column or row doesn’t exist; e.g. return=cellBG.0.3
cellTextTag.<tag>.<column> | Only Displayed cell text | Will return the text of the specified cell or empty string if the column or tag doesn’t exist; e.g. return= cellTEXT.0.3
cellText.<row>.<column> | Only Displayed cell text | Will return the text of the specified cell or empty string if the column or row doesn’t exist; e.g. return= cellTEXT.0.3
colour.text | Default Foreground Colour | Will return the text colour or empty string if the default colour is used, any cell that has an overridden colour can be gotten separately
colour.background | Default Background Colour | Will return the text colour or empty string if the default colour is used, any cell that has an overridden colour can be gotten separately
notify.selection | selected,changed,none | Will return the state of the selection change notification
notify.cell_selection | selected,changed,none | Will return the state of the cell selection change notification
notify.tag_selection | selected,changed,none | Will return the state of the tag selection change notification
font.face | font | Will return the current font face set or empty string if the default is used
font.size | font size | Will return the current font size or empty string if the default is used
stylesheet | stylesheet | Will return the style sheet of the control or empty string if it is not specified
tags.<delimiter> | tags | Will return a complete list of (non-null) tags for this control delimited by commas or the optional delimiter specified

Commands

Parameter | Value | Notes
reset |  | Used to reset all the parameters of this control back to their default state
hideHeader | true, false | Hides/shows the listview header
enableSorting | true , false | Enables sorting so the user can sort columns by clicking on the column headers
enableColumnResize | true , false | Enables column resize so the user can modify the column width manually
enableColumnMoving | true , false | Sets whether the header sections can be moved
colour.text colour.background | Any valid Qt colour or nothing. | Set colour of the specified parameter. e.g. the following two examples are equivalent: colour.led=red colour.led=#ff0000 Setting the value to zero length string (see example) sets the colour back to the default colour specified in the skin. This is the default for these settings. e.g. colour.background= colour.text=
notify.selection | true | Enables notification on the specified events
font.face | any valid font face | The current font face. If no font face is specified (the default) then the standard font face as defined in the skin is used.
font.size | e.g.: 10 –2 +3 | The current font size to use. If the value is signed than it is an offset from the default skin font size. Otherwise it is the absolute font size.
font.style | Any combination of bold, italic, underline, overline, strikeout | The current font style.
stylesheet |  | Stylesheet entry to use for this listview (the stylesheet entry is an external list of any combination of the above settings)
columnsWidth | Semicolon separated values | Semicolon separated list of column widths. -1 means automatic value based on the cell texts. e.g.: “columnsWidth=25;-1;-1;50”
columnWidth.<column> |  | Sets the width of a specified column. -1 means automatic value based on the cell texts. e.g.: “columnWidth.4=50”
columnsAlign | Semicolon separated values | Semicolon separated list of column alignments. If this parameter is not specified than then the alignment of the stylesheet will be used or ‘left’ if no alignment is defined in the stylesheet. The alignment values are defined below e.g.: “columnsAlign=17;34” sets the first column alignment to top left, and the second column alignment to bottom right.
columnAlign.<column> |  | Sets the alignment for a specified column. e.g.: “columnAlign.2=17”
addColumn |  | Adds new column to the listview with the specified header text. e.g.: “addColumn=New column”
renameColumn.<column> |  | Renames header text for a specified column. e.g.: “renameColumn.0=Modified header”
removeColumn |  | Removes the specified column. e.g.: “removeColumn=2”
add | Semicolon separated values Col1;Col2;Col3;#TAG= | Adds new item to the end of the listview. Sorting is switched off before adding. This function also allow you to add the tag. This should be a value after the last column starting with #TAG= The texts are separated by semicolon. e.g. “add=ListView;control;is;nice!”
removeRow |  | Removes the specified row. e.g.: “removeRow=2”
removeTag |  | Removes the row with the specified tag. e.g.: “removeTag=2”
cell.<row>.<column> |  | Sets text for a specified cell. e.g.: “cell.0.0=Top left cell”
cellPixmapTag.<tag>.<column> | icon_help | Sets Pixmap for a specified cell. Looks for images in the panel/images folder. Ending in png. e.g.: “cellPixmap.tag.0=icon_help”
cellPixmap.<row>.<column> | icon_help | Sets Pixmap for a specified cell. Looks for images in the panel/images folder. Ending in png. e.g.: “cellPixmap.0.0=icon_help”
cellFGTag.<tag>.<column> | #000000 | Sets Foreground colour for a specified cell. e.g.: “cellFG.tag.0=#000000”
cellFG.<row>.<column> | #000000 | Sets Foreground colour for a specified cell. e.g.: “cellFG.0.0=Top left cell”
rowFG.<row> | #000000 | Set the foreground colour (text) for the whole of the specified row e.g. "rowFG.1=red"
columnFG.<row> |  | Set the foreground colour (text) for the whole of the specified column e.g. "columnFG.1=red"
cellBGTag.<tag>.<column> | #ffffff | Sets Background colour for a specified cell. e.g.: “cellBG.tag.0=#ffffff”
cellBG.<row>.<column> | #ffffff | Sets Background colour for a specified cell. e.g.: “cellBG.0.0=#ffffff”
columnBG.<column> | Set the background colour for the whole of the specified column e.g. "columnBG.1=red"
rowBG.<row> |  | Set the background colour for the whole of the specified row e.g. "rowBG.1=red"
cellTextTag.<tag>.<column> | Text | Sets text for a specified cell. This option should be used if the over overrides (Pixmap, FG, BG) are being used. e.g.: “cellText.tag.0=Top left cell”
cellText.<tag>.<column> | Text | Sets text for a specified cell. This option should be used if the over overrides (Pixmap, FG, BG) are being used. e.g.: “cellText.tag.0=Cell and Column with Tag name”
tagRow.<tagName> tagRow.<tagName>.add | tagRow.tagName=Top Row C1;Top Row C2;#TAG=Hello | Sets text for a row with this tag It will only change the row if it exists unless "add" is appended to the command as shown This function also allow you to modify the tag. This should be a value after the last column starting with #TAG=
row.<row> | row.0=Top Row C1;Top Row C2;#TAG=Hello | Set text for a row It will only change the row if it exists This function also allow you to add the tag. This should be a value after the last column starting with #TAG=
rowTag.<row> |  | Set tag for a row e.g: “tag.0=Top Row C1;Top Row C2” It will only change the row if it exists
selectRow |  | Selects a specified row. e.g.: “selectRow=2”
selectTag |  | Selects a specified tag e.g “selectTag=id12”
clearSelection |  | Clears listview selection.
moveColumn | <from>;<to> | Moves a specified column to a new position. e.g.: “moveColumn=0;3”
moveRow | <from>;<to> | Moves a specified row to a new position. e.g.: “moveRow=2;1”
sort | <column> Or <column>;<ascending> | Sorts the specified column. The default sorting is ascending. e.g.: “sort=2” “sort=2;false”
clear |  | Clears the contents of the listview.

Alignment Values

Horizontal Alignment:

Left = 1
Right = 2,
HCenter = 4

Vertical Alignment:

Top = 16
Bottom = 32,
VCenter = 64

You can add together values for vertical and horizontal - e.g. bottom right would be 34 (32+2))

Notifications

Notifications are also in the format:

<parameter>=<value>
Parameter | Value | Notes
selection. | text value of current selection; the text of the cells are separated by ‘;’ | The notification can be set to notify on Selection, on Selection Changed.
cell_selection..=value | Text value of the currently selected cell. | The notification can be set to notify on Selection, on Selection Changed.
tag_selection.=tag | The Tag held by the row | The notification can be set to notify on Selection, on Selection Changed.

Version Control

Version | Date | Author | Comments
1.0.0.1 |  |  | ?
1.0.0.2 |  |  | ?
1.0.3.0 |  |  | crash fix on selecting no item in the edit-time listview
1.0.4.0 |  |  | enableSorting now set on design-time dialog from the value used
1.0.5.0 |  |  | column alignment now actually sets the alignment on the control
1.0.6.0 |  |  | now supports return value for tags or tags.
1.0.7.0 |  |  | merely setting the sort column isn't enough to force a sort if it's already set to that column - so force a sort if the column turns out to be the same one as we already had
1.0.8.0 |  |  | overrides the text() call that's used to set the width of the cell so that it uses the text not the text plus formatting chars
1.0.9.0 |  |  | now has rowFG and rowBG to set entire row colours, also column equivalent with columnFG and columnBG
1.0.10.0 |  |  | tagRow now has option to force add of non-existent entry if we didn't find it
1.0.11.0 |  |  | new "removeTag" command now will remove a row by tag name
1.0.12.0 |  |  | fix to default value for notify selection
 | 27/02/2017 | David Yates | Conversion to markdown minor revisions
1.0.13.0 | 09/04/2018 | David Yates | Fix to tagRow..add so that it adds to the end of the list not the beginning
1.0.14.0 | 23/04/2018 | David Yates | Fix to tagRow..add so that it sets the tag as it adds


bncs_log

Log Controls

Overview

This document describes 3 controls for use on BNCS user interfaces, these are:

Log Control

A relatively complex component specifically designed to display log information written to a database by the Alarms Databse output module.
This is not a general purpose database display component.

Database Table Viewer

A general purpose component to display and edit an SQL database table.

Database Form Control

A general purpose component to get data from an SQL database and display it in other controls.

Description

All of these controls obtain data from an SQL database via the Qt SQL database components. At the time of writing the following drivers have been confirmed to work (there is some driver-specific handling present, so other drivers may not work): -

  • QODBC3 – ODBC driver, including Microsoft SQL Server
  • QMYSQL3 – MySQL driver

Log Client

Description

This control provides a display of items logged to an alarms log database, along with dynamic updates communicated using the alarms database module’s infodriver interface.
The control may be configured to only show a single message for each process, thus showing only the current state rather than the history.
Various filters can also be applied to the data to restrict what is shown.

Configuring the Control

The control can be configured entirely at panel design time using the BNCS Visual Editor, or at run-time, by setting parameters from a BNCS client.
Changing the settings at run time, for instance changing the filtering, may be done by sending the relevant command from a script.
The following table lists the commands that may be sent to the control using the textPut function in a script.

Database settings

Name | Values | Description
dbDriver | QMYSQL3 QODBC3 Default is blank | Database Driver type QMYSQL3 – for MySql QODBC3 – for ODBC main
Host | 192.168.0.1 (example) Default is blank | Name or address of the computer running the database server (mySql only)
Port | 3307 (example) Default is blank or -1 or the key is absent, any of which cause the plug-in to use its default value. | Port number to use for the database server. (mySql only)
Database | bncs_alm (example) Default is blank | Database name
User | Bncs (example) Default is blank | User name to access the database
Password | Bncs (example) Default is blank | Password used to access the database
dbEnable | true (default) false | Whether to use the main database.
dbDriver_reserve | QMYSQL3 QODBC3 Default is blank | Database Driver type QMYSQL3 – for MySql QODBC3 – for ODBC reserve
Host_reserve | 192.168.0.1 (example) Default is blank | Name or address of the computer running the database. (mySql only)
Port_reserve | 3307 (example) Default is blank or -1 or the key is absent, any of which cause the plug-in to use its default value. | Port number to use for the reserve database server. (mySql only)
Database_reserve | bncs_alm (example) Default is blank | Reserve Database name
User_reserve | Bncs (example) Default is blank | User name to access the reserve database
Password_reserve | Bncs (example) Default is blank | Password used to access the reserve database
dbEnable_reserve | true (default) false | Whether to use the reserve database.

MySql database servers require a host and optionall port number.
ODBC database servers don't require a host to be configured here; it is incorporated in the ODBC configuration accessed via the database name.

Display Settings

Name | Values | Description
ShowDateTime | true (default) false | Display the date & time column
ShowMsec | true (default) false | Display milliseconds with time
ShowGroup | true (default) false | Display the group column
ShowDevice | true (default) false | Display the device column
ShowLocation | true false (default) | Display the location column Data for this is retrieved from instances.xml using the device field value as the instance name.
ShowProcess | true (default) false | Display the process column
ShowState | true (default) false | Display the state column
ShowLevel | true (default) false | Display the level column
ShowText | true (default) false | Display the text column
ShowSingleInstance | true (default) false | Selects which table is displayed. True for process_data. False for historical_log.
MaxShow | 500 | Maximum number of lines to be shown
scrollMode | Auto (default) Never Always | Sets the scroll mode, options are Auto - when a user selects an entry, stops scrolling for 30 seconds. Never - doesn’t scroll. Always - always scrolls so that new log items are visible.
SortAscending | true (default) false | Sets the display order True – ascending False - descedning
OrderBy | Date & Time (default) Group Device Process State Level Text | Sets the column to order by.
notify.pressed | true (default) false | Enables notify messages to be sent when the control is pressed.
notify.changed | true (default) false | Enables notify messages when the current selected item changes. This may be because of user action, or an item added to the log.
width.dateTime | Integer (default is 200) | The width of the Date & Time column Widths are in pixels
width.group | Integer (default is 100) | The width of the group column
width.device | Integer (default is 100) | The width of the device column
width.location | Integer (default is 100) | The width of the device column
width.process | Integer (default is 100) | The width of the process column
width.state | Integer (default is 50) | The width of the state column
width.level | Integer (default is 100) | The width of the level column

Filter commands

All filter commands should start with Filter, which is not shown here.
Examples:

Filter.Level.Info=true
Filter=Clear
Filter.Devices.set=a;b;c
Name | Values | Description
=Clear |  | Clear the filter
.Devices .Groups .Processes .Text |  | The following three commands apply to these four fields
set | set=a;b;c (example) | Clears the current filter and sets the filter string list to only display a or b or c
add | add=d (example) | Adds d to the current filter list
subtract | subtract=c (example) | Removes c from the current filter list
.Level.All | true (default) false | Show entries with this level. All means show all levels. All other values means show the stated value. These may be mixed in any combination. Setting All to true will set all the individual level filter values to true. Setting All to false will not change the individual level filter values.
.Level.Info | true (default) false |
.Level.Minor.Warning | true (default) false |
.Level.Major.Warning | true (default) false |
.Level.Minor.Alarm | true (default) false |
.Level.Major.Alarm | true (default) false |
.State.All | true (default) false | Show entries with this state. All means show all states. All other values means show the stated value. These may be mixed in any combination. Setting All to true will set all the individual state filter values to true. Setting All to false will not change the individual state filter values.
.State.On | true (default) false |
.State.ForceOn | true (default) false |
.State.Off | true (default) false |
.State.ForceOff | true (default) false |
.State.Ack | true (default) false |
.State.Ignore | true (default) false |
.State.Latched | true (default) false |
.State.Unknowntrue (default) false |
.Date=Clear |  | Clear the date filter
.Date.Before=yyyy-MM-dd | A date | Show items before this date
.Date.After=yyyy-MM-dd | A date | Show items after this date
.Date.Between=yyyy-MM-dd + yyyy-MM-dd | Two dates | Show items between the two given dates. ‘+’ should be used to separate the two dates.
.Date.DaysBack=n | Integer | Show items up-to n days back
.Date.CompareMode | Inclusive Exclusive (default) | Selects whether date comparisons (before, after, between, days-back) are inclusive or exclusive. Inclusive means use <= and >=. In this case “After” a date means “on or after” the date, etc. Exclusive means use < and >. In this case “after” a date means strictly after it, ie a time on the specified date will be rejected by the filter.
.DateTime=Clear |  | Clear the date/time filter
.DateTime.Before=yyyy-MM-dd hh:mm:ss | A date and time | Show items before this date/time
.DateTime.After=yyyy-MM-dd hh:mm:ss | A date and time | Show items after this date/time
.DateTime.Between=yyyy-MM-dd hh:mm:ss + yyyy-MM-dd hh:mm:ss | Two dates and times | Show items between the two given date/times. ‘+’ should be used to separate the two date/times.
.DateTime.CompareMode | Inclusive Exclusive (default) | Selects whether date/time comparisons (before, after, between) are inclusive or exclusive. Inclusive means use <= and >=. In this case “After” a date/time means “on or after” the date/time, etc. Exclusive means use < and >. In this case “after” a date/time means strictly after it, ie a date/time the same as the specified date/time will be rejected by the filter.

Miscellaneous

Name | Values | Description
reset |  | Resets all settings to the default
BncsDriver | Integer, or comma-separated list of integers. | BNCS Driver, or drivers, from which dynamic updates will be received.
stylesheet.style | A style name. Default is blank – no style specified. | Sets the style sheet for fonts etc., these need setting in stylesheet.xml, if not found the default will be used.
stylesheet.states | A style name. Default is blank – no style specified. | Sets the style sheet for colours, these need setting in stylesheet.xml, if not found the default will be used.
Slave.Navigate | A button name. Default is blank – no button specified. | Slave button for navigation. When a line this control is selected, if slave.navigate is set to the name of another control that other control will have its “navigatedest” parameter set to the device name field of the newly selected line.
Slave.Form.Device=form1 | A button name. Default is blank – no button specified. | Database form to show device details. When a line this control is selected, if slave.form.device is set to the name of another control that other control will have its “Filter.Set=device_name” parameter set to the device name field of the newly selected line.
PrintAll |  | Prints all of the log table
Print=+-10 |  | The currently selected item +- 10, options are +-n, +n or –n.

Returns

Name | Description
return=<setting> | Returns the setting, i.e. return=BncsDriver will return the BNCS driver number. This may be used with any of the settings listed above.
Return=all | Returns all non-default settings in a single string with the settings each terminated by a new-line character.
return=Log.Device | Returns the device field of the currently selected line.
return=Log.Process | Returns the process field of the currently selected line.
return=Log.Group | Returns the group field of the currently selected line.
return=Log.All | Returns the entire currently selected line item in the form : Date/time,millisecond time,process ID, Device name,group,level,state,text

Style Settings

The following settings may also be used to set colours and fonts, but their intended use is by the stylesheet. The colours may be expressed as RGB levels (#RRGGBB) or colour names recognised by Qt.

colour.info.background=#00ffff
colour.info.text=#cccccc
colour.ok.minor.warning.background=#cccccc
colour.ok.minor.warning.text=#448844
colour.ok.major.warning.background=#ddccdd
colour.ok.major.warning.text=#44ff44
colour.ok.minor.alarm.background=darkGreen
colour.ok.minor.alarm.text=blue
colour.ok.major.alarm.background=#ff88dd
colour.ok.major.alarm.text=#yellow
colour.fail.minor.warning.background=#ffff8
colour.fail.minor.warning.text=#880080
colour.fail.major.warning.background=#80fff
colour.fail.major.warning.text=#ff0080
colour.fail.minor.alarm.background=darkBlue
colour.fail.minor.alarm.text=dddddd
colour.fail.major.alarm.background=#ff0f00
colour.fail.major.alarm.text=#ff80ff
colour.latched.alarm.text=#ffffff
colour.latched.alarm.background=#808000
colour.latched.warning.text=#808000
colour.latched.warning.background=#ffffff
colour.ack.alarm.text=#ffffff
colour.ack.alarm.background=#ff8000
colour.ack.warning.text=#ff8000
colour.ack.warning.background=#ffffff
colour.other.background=#cccccc
colour.other.text=#000000
font=arial
fontsize=12 (or relative e.g. –2)

Defaults and Returning All

Where a setting is set to its default value a subsequent call to read all values (ie “return=all”) will not return any data for that setting.
The following will always be returned, even if not set: dbEnable, dbDriver, Database, Host, User, Password, dbEnable_reserve, dbDriver_reserve, Database_reserve, Host_reserve, User_reserve, Password_reserve.

Examples

The following examples show setting the control to show a limited set of information.
Show all items from the database.

textPut("Filter","Clear",1,5);

Show only active alarms, i.e. those with state equal to On.

textPut("Filter","Clear",1,5);
textPut("Filter.State.On","true",1,5);

Show only alarms in the ‘Network’ group.

textPut("Filter","Clear",1,5);
textPut("Filter.Groups.set",”Network”,1,5);

Show alarms from any ARC device. '%' is the wildcard character for SQL.

textPut("Filter","Clear",1,5);
textPut("Filter.Device.set",”ARC%”,1,5);

Using a regular expression to select specific ARCs, in tnis case 1-5

textPut("Filter.Device.set",”ARC[1-5]”,1,5);

Notifications

The following notification messages are emitted if the control is configured to do so.

Parameter | Notes
button.<name>=pressed | The control has been pressed. <name> is the name of the log control.
button.<name>=logItemChanged | The current log item has changed, this may be because the user has changed the selection, or an item has been added to the log. <name> is the name of the log control.

Enabling use of the Log control in the BNCS Visual Editor

In order that controls of this type may be created in the Visual Editor, an element must be present in config/vised/buttons.xml with the “class” attribute set to “bncs_log”.
The “name” attribute selects the name that will appear in the Buttons tab.
For example:

<control class="bncs_log" name="Log" />

Data Form (db Form)

Description

This control allows a user to traverse a database table showing only the required fields in a single entry. This is done by using other standard buttons to display/edit the data.

Configuring the Control

The control can be configured entirely at panel design time using the BNCS Visual Editor.
Changing the settings at run time, for instance changing the filtering, may be done by sending the relevant command from a script.
The following table lists the commands that may be sent to the control using the textPut function in a script.

Database Settings

Name | Values | Description
dbDriver | QMYSQL3 QODBC3 Default is blank | Database Driver type QMYSQL3 – for MySql QODBC3 – for ODBC
Host | 192.168.0.1 (example) Default is blank | Name or address of the computer running the database server
Port | 3307 (example) Default is blank or -1 or the key is absent, any of which cause the plug-in to use its default value. | Port number to use for the database server.
Database | bncs_alm (example) Default is blank | Database name
User | Bncs (example) Default is blank | User name to access the database
Password | Bncs (example) Default is blank | Password used to access the database
Table | Names (example) Default is blank | Database table to display
reset |  | Resets all settings to the default

Slave Settings

Name | Values | Description
Slave.Field.Add | <field>,<button> | Display database field <field> in button <button>.
Slave.Field.Clear | true | Clear all fields.

Filter commands

Name | Description
Filter=Clear | Clear the filter
Filter.Set=”device_name=’SAT1’” | Sets the filter only to show what is entered. This accepts standard SQL query conditions that may be entered in a WHERE clause, i.e device_name LIKE ‘SAT%’. Note that % is used as the multiple character wild card (zero or more characters) and ‘_’ is the single character wildcard.

Enabling use of the Data Form control in the BNCS Visual Editor

In order that controls of this type may be created in the Visual Editor, an element must be present in config/vised/buttons.xml with the “class” attribute set to “bncs_data_form”.
The “name” attribute selects the name that will appear in the Buttons tab.
For example:

<control class="bncs_data_form" name="db Form" />

Data Table (db Table)

Description

This control shows the entire contents of a database table in a table view, and can allow the user to edit the table.
This control displays a column for every field defined in the table.

Configuring the Control

The control can be configured entirely at panel design time using using the BNCS Visual Editor.
Changing the settings at run time, for instance changing the filtering, may be done by sending the relevant command from a script.
The following table lists the commands that may be sent to the control using the textPut function in a script.

Name | Values | Description
dbDriver | QMYSQL3 QODBC3 Default is blank | Database Driver type QMYSQL3 – for MySql QODBC3 – for ODBC
Host | 192.168.0.1 (example) Default is blank | Name or address of the computer running the database server
Port | 3307 (example) Default is blank or -1 or the key is absent, any of which cause the plug-in to use its default value. | Port number to use for the database server.
Database | bncs_alm (example) Default is blank | Database name
User | Bncs (example) Default is blank User name to access the database
Password | Bncs (example) Default is blank | Password used to access the database
Table | Names (example) Default is blank | Database table to display
reset |  | Resets all settings to the default
ReadOnly | true (default) false | Sets the table to read only.

Enabling use of the Data Table control in the BNCS Visual Editor

In order that controls of this type may be created in the Visual Editor, an element must be present in config/vised/buttons.xml with the “class” attribute set to “bncs_data_Table”. The “name” attribute selects the name that will appear in the Buttons tab.
For example:

<control class="bncs_data_Table" name="db Table" />

Developer Notes

There are now a number of test applications associated with this control, existing in subprojects.
TestApp and TestApp4 are focussed on testing the filtering aspect of the library.
TestApp performs tests entirely within the software.
Tests include:

  • caption setting and getting
  • “update” filter logic
  • Sql query statement generation (confirms operation of decodecaptionstring – not of continued usefulness)

TestApp4 performs actual SQL queries on a real database. This uses the same test data as TestApp so will confirm that the two achieve the same results.

These two should be used to confirm that existing behaviour is not affected by any further development of filtering. They should be updated to cover any new functionality in any further development of filtering.

TestApp2 does the minimum requirements to create a Log Control and display it.
TestApp3 confirms we can programatically access the Sql database. It runs using several different sized sets of test data - 10, 100 and 1000. And using three different port numbers in order to test functionality using three different versions of MySql server - 5.5, 5.6 and 5.7.

Version Control

Version | Date | Author | Comments
1.0.0.8 | 22/9/2004 |  | Set not to get blank entries from the database, these would are not displayed anyway!
4.5.0.1 | 04/10/2004 |  | Temporary version to stop crashing when there are slow database connections, this does not allow the database to be changed once set!!!!! Use only in W12
4.5.0.2 | 12/10/2004 |  | Fixed fault known in 4.5.0.1. Displays detail about the host while attempting connection.
4.5.2.0 | 23/10/2007 |  | Fixed SQL statement error for MS SQL server.
4.5.3.0 | 24/10/2007 |  | Removes old database connection when changing types.
4.5.4.0 | 08/11/2007 |  | Fixes sorting issues.
4.5.5.0 | 19/02/2008 |  | Horizontal scroll bar inhibited in the log. Regular expression filtering added to the log.
 | ??? |  | Dunno No record
4.5.11.0 | 27/10/2008 |  | Rebuilt using new shim (based on ccClient)
 | 02/07/2013 |  | Corrections to document.
4.5.18 | 10/06/2015 | Richard Kerry | Log Control will now show data from the Database Output module that arrives from the InfoDriver without the database itself needing to be connected. This may arise when there are problems with connectivity, or a fault in the configuration meaning the database can’t be opened.
4.5.19 | 01/09/2015 | Richard Kerry | Date/Time filtering added. Between added for dates or date/times. Mode added for dates or date/times – search may be inclusiove or exculsive. (Tests added to confirm expected behaviour)
4.5.20 | 27/02/2017 | David Yates | Conversion to markdown minor revisions
Version | Date | Writer
4.6.5.rc1.1 | 25/05/2018 | Richard Kerry
  • There is now an extra control to allow the port number to be set for a mySql server. This is present in the alarm output configuration and in all controls that are able to access the alarm logging database.
  • Configuring the reserve database Driver to ODBC would disable the main database's host entry control (ODBC doesn't need a host).
    This has been fixed, so now configuring the reserve database Driver to ODBC will disable the reserve database's host and port number controls, and configuring the main database Driver to ODBC will disable the main database's host and port number controls. This applies to the alarm output module and to all controls that reference the alarm logging database.


lua_loader

This is a lua version of the bncs_script_helper, this allows bncs components and panels to
be written in lua.

The advantages of this is, no IDE, no compiling and dll hell.

The disadvantage no IDE help/auto complete, there are lua IDEs available, zeroBrane studio
is one such example. There is an intellisense configuration created for zeroBrane.

Below maybe incorrect, possible using normal lua currently
The lua version used is LuaJit 2.0.4, this is a jit (just in time complied)
version of lua that implements lua 5.1 plus some features of 5.2

How to

Place a .lua file within a folder, the lua file name has to be the same as the folder.

To use as a component there is a bncs control called lua_loader.

Callbacks

Unlike in the C++ code, only the callbacks that are used need to be in the file.

  • Main(path,pointer) - Called when the code is first loaded, like a constructor
  • ButtonCallback(buttonInfo) - Called when a button on our panel is clicked, or a component does a hostNotify
  • RevertiveCallback(revertiveInfo) - Called when a index/slot we have registered for arrives
  • DatabaseCallback(databaseInfo) - Called when a database changes on a device we have registered for
  • ParentCallback(parentInfo) - Called when our parameters change, or our parents passes info to us
  • TimerCallback(id) - Called when a timer we have started elapses

Main

Main(path,pointer)

This is like a constructor in a C++ project.
It can be used to do thing such as set the default panel.

ButtonCallback

ButtonCallback(buttonInfo)

ButtonCallback is called when children buttons or components on our panel notifies us.

buttonInfo holds:

  • command - Button command
  • value - Button Value
  • sub{} - Table of sub commands
  • subs - How Many sub commands there are
  • id - Button Id
  • panel - Panel Id

RevertiveCallback

RevertiveCallback(revertiveInfo)

RevertiveCallback is called when a revertive you have registered for is recieved

revertiveInfo holds:

  • device - Device
  • index - Index
  • info - if routerRevertive Source Index else 0
  • sinfo - if routerRevertive Source Name else Slot value
  • database - 0
  • type - string of revertive type see Revertive type

DatabaseCallback

DatabaseCallback(databaseInfo)

DatabaseCallback is called a database changes for any device we are registered for

databaseInfo holds:

  • device - Device
  • index - Index
  • info - 0
  • sinfo - Database value
  • database - Databse number
  • type - string DATABASE

Revertive types

  • UNKNOWN
  • ROUTER
  • INFODRIVER
  • GPI
  • DATABASE

ParentCallback

ParentCallback(parentInfo)

ParentCallback is called when our parent send us information, or a parameter is set or
when a connection sends us data.

parentInfo holds:

  • command - Parent command
  • value - Parent Value
  • sub{} - Table of sub commands
  • subs - How Many sub commands there are

TimerCallback

TimerCallback is called when a timer elapses, the id of the elapsed timer is passed to us.

### id

The name of the timer that has elapsed

# Commands

## ```panelShow(name, panel, (instance))```

description = "Creates/shows panel from .bncs_ui file"
args = "(name: string, file: string, instance string (optional))"
returns = "(boolean)"

## ```panelInit(name, panel, instance)```

description = "Creates but does not show a panel from .bncs_ui file",
args = "(name: string, file: string)",
returns = "(boolean)"

## ```panelTarget(name, instance)```

description = "Targets a previously created panel with a new instance",
args = "(name: string, instance: string)",
returns = "(boolean)"

## ```panelPopup(name, panel)```

description = "Creates/shows panel from .bncs_ui file as a popup window (like a context menu)",
args = "(name: string, file: string)",
returns = "(boolean)"

## ```panelRemove(name)```

description = "Hides panel, but doesn't destroy it",
args = "(name: string)",
returns = "(boolean)"

## ```panelDestroy(name)```

description = "Destroys the panel",
args = "(name: string)",
returns = "(boolean)"

## ```hostNotify(message)```

description = "Tell our parent that something interesting's happened",
args = "(message: string)",
returns = "(void)"

## ```textPut(command, value, panel, id)```

description = "Send message to a control",
args = "(command: string, value: string, panel: string, id: string)",
returns = "(boolean)"

## ```textGet(command, panel, id)```

description = "Puts text on label",
args = "(command: string, panel: string, id: string)",
returns = "(string)"

## ```routerName(device, database, index)```

description = "Gets a router database name",
args = "(device: int, database: int, index: int)",
returns = "(string)"

## ```routerIndex(device, database, name)```

description = "Gets the index for the given router database name",
args = "(device: int, database: int, name: string)",
returns = "(int)"

## ```routerCrosspoint(device, source, dest, (mask, now))```

description = "Make a crosspoint",
args = "(device: int, source: int, dest: int, mask: string (optional), bool now (optional))",
returns = "(void)"

## ```routerRegister(device, start, end, (add))```

description = "Register for 'revertives'",
args = "(device: int, start: int, end: int, bool add (optional))",
returns = "(void)"

## ```routerUnregister(device)```

description = "Deregister for this device",
args = "(device: int)",
returns = "(void)"

## ```routerPoll(device, start, end)```

description = "Poll for a range of router destinations",
args = "(device: int, start: int, end: int)",
returns = "(void)"

## ```routerModify(device, database, index, name, reload)```

description = "Change a database name",
args = "(device: int, database: int, index: int, name: string, reload: bool)",
returns = "(void)"

## ```infoUnregister(device)```

description = "Deregister for this device",
args = "(device: int)",
returns = "(void)"

## ```infoPoll(device, start, end)```

description = "Poll for a range of infodriver slots",
args = "(device: int, start: int, end: int)",
returns = "(void)"

## ```infoWrite(device, info, index, now)```

description = "Write an infodriver slot",
args = "(device: int, info: string, index: int, now: bool)",
returns = "(void)"

## ```infoRegister(device, start, end, (add))```

description = "Register for 'revertives'",
args = "(device: int, start: int, end: int, bool add (optional))",
returns = "(void)"

## ```gpiRegister(device, start, end, (add))```

description = "Register for 'revertives'",
args = "(device: int, start: int, end: int, bool add (optional))",
returns = "(void)"

## ```gpiSwitch(device, state, index, now)```

description = "Switch a GPI",
args = "(device: int, state: bool, index: int, now: bool)",
returns = "(void)"

## ```gpiPoll(device, start, end)```

description = "Poll for a range of gpi slots",
args = "(device: int, start: int, end: int)",
returns = "(void)"

## ```gpiUnregister(device)```

description = "Deregister for this device",
args = "(device: int)",
returns = "(void)"

## ```register(device, start, end, (add))```

description = "Register for 'revertives'",
args = "(device: int, start: int, end: int, now: add (optional))",
returns = "(void)"

## ```unregister(device)```

description = "Deregister for this device",
args = "(device: int)",
returns = "(void)"

## ```getIDList(name, filter)```

description = "Get a list of controls or the given panel",
args = "(name: string, filter: string (optional))",
returns = "(kvislist)",
valuetype="kvislist"

## ```getDev(instance)```

description = "Gets a Table describing the Device",
args = "(instance: string)",
returns = "(deviceTable)",

## ```getDevSlot(instance, param)```

description = "Gets a Table describing the Device and param",
args = "(instance: string, param: string)",
returns = "(deviceTable)",

## ```navigateAdjust(instance)```

description = "Navigate to given instance",
args = "(instance: string)",
returns = "(boolean)"

## ```navigateExecute(path)```

description = "Navigate to given UI",
args = "(path: string)",
returns = "(boolean)"

## ```navigateCanAdjust(instance)```

description = "True if the given instance can be adjusted (i.e, navigate to appropriate UI)",
args = "(instance: string)",
returns = "(boolean)"

## ```navigateCanExecute(path)```

description = "True if the given UI can be navigated to",
args = "(path: string)",
returns = "(boolean)"

## ```getWorkstationSetting()```

description = "Get a list of all the workstation settings for this workstation",
args = "(void)",
returns = "(kvsslist)",

## ```getWorkstationSettings(key)```

description = "Gets the named workstation setting",
args = "(key: string)",
returns = "(string)"

## ```workstation()```

description = "Gets the workstation number",
args = "(void)",
returns = "(integer)"

## ```getRouterSize(device, database)```

description = "Gets the BNCS database size",
args = "(device: integer, database: integer)",
returns = "(integer)"

## ```getObjectSetting(object, key)```

description = "Gets the setting for the given keys",
args = "(object: string, key: string)",
returns = "(string)"

## ```getUser()```

description = "Gets the current user name",
args = "(void)",
returns = "(string)"

## ```getUserLevel()```

description = "Gets the current user level",
args = "(void)",
returns = "(string)"

## ```getUserLevelInt()```

description = "Gets the current user level as integer (1=user, 2=Supervisor, 3=Administrator, 4=Developer, 0=Unknown)",
args = "(void)",
returns = "(integer)"

## ```controlEnable(panel, control)```

description = "Enable the given control",
args = "(panel: string, control: string)",
returns = "(void)"

## ```controlDisable(panel, control)```

description = "Disable the given control",
args = "(panel: string, control: string)",
returns = "(void)"

## ```controlShow(panel, control)```

description = "Show the given control",
args = "(panel: string, control: string)",
returns = "(void)"

## ```controlHide(panel, control)```

description = "Hide the given control",
args = "(panel: string, control: string)",
returns = "(void)"

## ```controlMove(panel, control, x, y)```

description = "Move the given control",
args = "(panel: string, control: string, x: integer, y: integer)",
returns = "(boolean)"

## ```controlPosition(panel, control)```

description = "Get position of the given control - return is table containing x and y values",
args = "(panel: string, control: string)",
returns = "(xyposition)"

## ```controlCreate(panel, requestedButtonName, buttonClass, x, y, w, h, settings)```

description = "Create a new control - return is actual button name (may not be the same as actual name)",
args = "(panel: string, requestedButtonName: string, buttonClass: string, x: integer, y: integer, w: integer, h: integer, settings: string)",
returns = "(string)"

## ```timerStart(timerId, duration_ms)```

type = "method",
description = "Start a new timer (stopping any previous timer with the same timerid)",
args = "(timerId: integer, duration_ms: integer)",
returns = "(void)"

## ```timerStop(timerId)```

description = "Stops given timer",
args = "(timerId: integer)",
returns = "(void)"

## ```debug(string)```

description = "Write the given string with optional parameters",
args = "(debugString: string)",
returns = "(void)"

## ```setGeometry(x, y, w, h)```

description = "Set overall size/position of the UI",
args = "(x: integer, y: integer, w: integer, h: integer)",
returns = "(void)"

## ```setSize(w, h)```

description = "Set overall size of the UI",
args = "(w: integer, h: integer)",
returns = "(void)"
```

Objects

kvislist

Integer Key, String Value list

Example

myValue = kvislist[1]

kvsslist

String Key, String Value list

Example

myValue = kvislist["key"]

xypostion

X = xypostion.x
Y = xypostion.y

deviceTable

Table of device parameters

device = deviceTable.device
offset = deviceTable.offset
slot = deviceTable.slot
typeChar = deviceTable.type
altid = deviceTable.altid
Version | Date | Author | Notes
1 |  | Simon Armstrong |
1.0.4 | 201216 |  | Sets path to help file to be correct
1.0.5 | 131017 | David Yates | BNCS_V6 (extended ranges)
1.0.6 | 240418 | David Yates | Removes extended ranges


bncs_style2

bncs_style2 - button drawing functions

Description

This is fundamentally the same as the original drawing DLL - bncs_style.dll but this version is configurable.

Configuration

Configuration is to be found in:

<CC_ROOT>\<CC_SYSTEM>\config\stylesheet\bncs_style2.ini

This file can have as many sections as you like - each section name is the name of the style that you tell panelman/visual editor to use. It cannot be the same as any other existing style e.g.

  • Windows
  • Motif
  • Platinum
  • CDE
  • MotifPlus
  • SGI
  • bncs_style
  • bncs_style2
  • bncs_style3
  • bncs_style4
  • bncs_style5

The colour palette entries below are used for various purposes by various controls and I've tried to indicate here where I know that they are used...but I might not have managed to list absolutely everything but it's entirely up to the controls which palette entries they use.

Entry | Notes
[basic] | Section name - this can be any value and is the same name as the style name selected for panelman/visual editor to display. It cannot be the same as an existing style name
font=SYSTEM | Font face
fontSize=10 | Font Size
fontWeight=88 | Font weight range 0 - 99 Values nominally map to: Light - 25 Normal - 50 DemiBold - 63 Bold - 75 Black - 87
fontItalic=false |
backgroundImage=bordlg.xpm | Background image for this style (see note below on types/path etc.)
popupTop=top.png | Popup dialog top border
popupBottom=bottom.png | Popup dialog bottom border
popupLeft=left.png | Popup dialog left-side border
popupRight=right.png | Popup dialog right-side border
popupTopLeft=topLeft.png | Popup dialog top level corner border
popupTopRight=topRight.png | Popup dialog top right corner border
popupBottomLeft=bottomLeft.png | Popup dialog bottom left corner border
popupBottomRight=bottomRight.png | Popup dialog bottom right corner border
roundedCorners=0 | Whether button corners should be rounded - this cuts a rounded hole for the button as well as drawing a few extra pixels in the corner of the control
sliderControlThickness=40 |
scrollBarExtent=40 | How big the slider is on a scroll bar
scrollBarSliderMin=40 | How small the slider on a scroll bar can become - usually it will shrink to a size proportional to the size of the thing it's scrolling.
buttonShading=NONE | Whether buttons (not labels) are drawn with shading. Values are: none - buttons are painted flat in - buttons have shading which shades from dark at the top to light at the bottom (looks like a concave surface) out - buttons have shading which shades from light at the top to dark at the bottom (looks like convex surface)
colouredButtonBorders=0 | borders can be drawn with the default colours (usually white/grey) or coloured according to the dynamic colour of the buttom
buttonBorderWidth=1 |
<role>.Background=#4d4d4d | Dialog background colour - may be completely obscured by backgroundImage
<role>.Foreground=#ffffff |
<role>.Base=#ffffff | Base colour of things like listboxes
<role>.Text=#000000 | Default button text colour
<role>.Button=#bfbfbf | Default button background colour
<role>.ButtonText=#ffffff | Listview uses this for row/column header text colour
<role>.Light=#ffffff | Button edge (when colouredButtonBorders=0)
<role>.Midlight=#f0f0f0 | Button edge (when colouredButtonBorders=0)<br/>Label edge (always - for raised/lowered label style)
<role>.Dark=#5f5f5f | Button edge (when colouredButtonBorders=0)
<role>.Mid=cyan | &nbsp
<role>.Shadow=#8f8f8f | Button edge (when colouredButtonBorders=0)<br/>Label edge (always - for raised/lowered label style)
<role>.Highlight=#000080 | Used by list controls
<role>.HighlightedText=#ffffff | Used by list controls
<role>.BrightText=#ffffff |
<role>.Link=#0000ff |
<role>.LinkVisited=#ff00ff |

Bitmaps

Qt supports many types e.g. jpg, png, bmp, xpm). Bitmap values are all optional - leave out for none/default

Style bitmaps are located in the following path:

%CC_ROOT%\%CC_SYSTEM%\config\stylesheet\<styleName>

Colour role

Colours have different roles - whether a button is active, inactive or disabled.

BNCS only uses active and disabled roles - inactive is available internally but the way that BNCS glues UIs together inactive has no meaningful use so active and inactive are the same thing.

Sample INI file

[basic]
font=SYSTEM
fontSize=10
fontWeight=88
fontItalic=false
backgroundImage=bordlg.xpm
roundedCorners=0
sliderControlThickness=40
scrollBarExtent=40
scrollBarSliderMin=40
buttonShading=NONE
colouredButtonBorders=0
buttonBorderWidth=1
active.Background=#4d4d4d
active.Foreground=#ffffff
active.Base=#ffffff
active.Text=#000000
active.Button=#bfbfbf
active.ButtonText=#ffffff
active.Light=#ffffff
active.Midlight=#f0f0f0
active.Dark=#5f5f5f
active.Mid=cyan
active.Shadow=#8f8f8f
active.Highlight=#000080
active.HighlightedText=#ffffff
active.BrightText=#ffffff
active.Link=#0000ff
active.LinkVisited=#ff00ff
disabled.Background=#4d4d4d
disabled.Foreground=#808080
disabled.Base=#000000
disabled.Text=#808080
disabled.Button=#4d4d4d
disabled.ButtonText=#808080
disabled.Light=red
disabled.Midlight=green
disabled.Dark=blue
disabled.Mid=yellow
disabled.Shadow=cyan
disabled.Highlight=#000080
disabled.HighlightedText=#ffffff
disabled.BrightText=#ffffff
disabled.Link=#0000ff
disabled.LinkVisited=#ff00ff

Version Control

Version | Date | Author | Comments
1.0.0.1 |  | David Yates | first versioned release
1.0.0.2 |  |  | puts font change back in app polish instead of widget polish
4.5.0.0 |  | David Yates | rebuild for Synergy
4.5.1.0 |  | Richard Kerry | Style 4 default font changed
4.5.1.1 |  | Richard Kerry | Style 5 added
4.5.2.? |  |  |
4.5.3.0 |  | David Yates | makes fully configurable - forks from bncs_style original
4.5.3.1 |  | David Yates | version committed to CVS
4.5.3.2 |  | David Yates | label style of background:none now doesn't try and paint the label
 | 27/02/2017 | David Yates | Docs Conversion to markdown minor revisions
4.5.4.0 | 18/04/2017 | David Yates | Makes border bitmaps a configurable item. Changes background image to be in style subdirectory.
4.5.5.0 | 18/04/2017 | David Yates | Adds popup margin pixelmetric