Main Page | Modules

UKL1 Exception Library Documentation

This library is designed to extend the capablilty of the framework exception handling to make the submission and display more relevant to the UKL1 project. In order to provide an analogy with the framework exception handling functions all functions that are intended for use by the User to create an exception chain are prefixed fwUkl1Exception_ and those functions that are for the display of exception chains are prefixed fwUkl1ExcpetionHandling_. Finally the exception log is provided as an extension over the framework capabilities and functions for utilising the exception log are prefixed fwUkl1ExceptionLog_. Functions used for internal library use have a leading _.

The UKL1 exceptions utilise the same structure as that defined by the framework, for obvious compatibility reasons and use the fwException_raise() function as a base for constructing the exception chains. As a consequence of this compatibility the library provides a fwUkl1Exception_raise function that takes the exact same arguments as the framework equivalent. It provided as a wrapper for fwException_raise() which ensures that the structure of the exception message is in a format that is required by the display functions (`Function(): Message', defined in the framework guidelines) and will coerce it into this form if necessary. This is simply to reduce the number of cases that the display functions cannot deal with. It is not require that this function be used and fwException_raise() can be used to create exception chains that this libraries display functions can handle.

The library also provides a replacement for fwExceptionHandling_display() called fwUkl1ExceptionHandling_display(). This function is not however a wrapper for fwExceptionHandling_display() and instead is provided as a replacement. It displays the exception chain in a tree structure with the last exception being displayed as the first branch of the tree each time a new function fails it will be placed under the exception generated by its calling function. In order to ensure the tree is displayed in a logical way each function call that may generate an execption should have an exception raise()d by the calling function if one occurs. If this is not the case the it is unlikely the exception will be able to identify its parent in the tree correct and unexpected tree structure may occur. The base node in the tree is the exception code that is given for the last exception entered in the tree. Each subsequent node will have the exception code to identify it.

The panel opened by fwUkl1ExceptionHandling_display() is User configurable and it can be set to a User created panel but it must take the exception chain as a string via the parameter $sExceptionInfo. No requirements are set on how the panel displays the element and the string can be converted back to a framework compatible dyn_string via fwGeneral_stringToDynString() with a `|' as a delimiter. A panel is provided by the library and is set by default.

fwUkl1ExceptionHandling_display() generates a pop up panel and is intended to show exception information immediately after a function chain has completed. The generated information will be lost as soon as the panel has been closed. The function fwUkl1ExceptionLog_submit() is provided as a means of saving exception chains to a log for later display. This also allows more complex exception tree displays to be created. fwUkl1ExceptionLog_submit() takes not only the exception chain to be displayed but the name of a base node that the exception chain should be displayed under. This allows the grouping of exception chains for example a base node name may be the name of a UKL1 board for example, all failures of functions relating to this board could be tagged and would be displayed under the hardware name regardless of when they occured. A function is also provided to display the exception log, fwUkl1ExceptionLog_displayCB(), and it is intended for use as a call back function. A PVSS tree shape can be connected to the log using the function fwUkl1ExceptionLog_connect() and then all exception chains that are submitted to the log are automatically displayed once they occur. fwUkl1ExceptionLog_displayCB() does not need be used as a call back function, but the User must create their own panels for use in this case.

The library provides all the functionality to create the exception log, including the data point type. The name of the exception log data point is User configurable and should be set before the first exception is submitted, if it is to be changed from the default. It is possible to change the log data point at any time, but the call back function must be recreated by the User if the new exception log data point is to be monitored for submissions.

It should also be noted that the exception log converts the dyn_string exception chain into a string and the log stores each exception chain as an element in a dyn_string. The conversion is done using fwGeneral_stringToDynString() and fwGeneral_dynStringToString() with `|' separators and white space left in will reconstruct the exception chain in a form fully compatible with fwUkl1ExceptionHandling_display() and fwExceptionHandling_display().

Two panels are also included with this library in objects/fwUkl1Exception/fwUkl1ExceptionHandlingDisplay.pnl and fwUkl1ExceptionLog_display.pnl. fwUkl1ExceptionHandling_display.pnl is opened by calls to fwUkl1ExceptionHandlingDisplay() and is intended to display single exceptions chains immediately after they occur. Exceptions chains are passed as a string reference parameter $sExceptionInfo and the panel displays the given exception chain in a PVSS tree shape as described. fwUkl1/fwUkl1ExceptionLogDisplay.pnl is a panel that is a standalone panel that can be entered as a manager in the PVSS console if desired or launched from an existing panel. It provides an interface to the exception log and will display any exceptions it finds in the log that have not already been displayed. It is connected to the exception log and will thus automatically update with new exceptions as they are generated.


Generated on Fri Jun 8 14:46:30 2007 by  doxygen 1.3.9.1