Return to ING home page4.2 Implementation of parameters

This page is part of the ING document INS-DAS-31 Design notes for UltraDAS

Basic parameter storage

DRAMA parameters in udas_camera are all created and set by the Camera-facade. They are stored and exported to the DRAMA message-net by the SDP parameter-system that is standard for DITS. The parameters are all scalars (where a string is considered to be a scalar) except for two parameters RUN_0 and RUN_1 which are structured. Monitoring of parameters is enabled.
 

Parameter table

The parameter details - name, type, initial value - are set in the table param_details, of type SdpParDefType, which is a private class variable in Camera-facade. This handling of parameters is a DRAMA standard.
 

Parameter updates

Most parameters change in response to telemetry updates from objects outside the Camera-facade. These objects signal to the Facade by calling notify_facade, saying that they have new telemetry. Notify_facade writes notification tokens, which are pairs of integers, to a pipe that is a private attribute of the Camera-facade. The facade receives the notifications asychronously by reading the pipe while waiting for DRAMA messages.

The trick of reading the notification pipe while waiting for DRAMA messages is done by declaring the pipe as one of DRAMA's "alternative input" sources, then using DitsAltInLoop as the message-reception loop in place of DitsMainLoop. In this usage, the programme blocks in the DRAMA library-call until either a DRAMA message queue or the pipe is readable; the effect is like that of the select system-call. When the pipe becomes readable, DRAMA runs the update_facade callback.

Figure 4.2.1 illustrates the notification mechanism.


Figure 4.2.1: updating parameters.

Update_facade determines which object has signalled from the notifcation token.  The first number in the token is a code for the type of object, and the second is an instance number identifying a member of the class of objects. The mechanism only works for objects using the planned-family pattern, whereby the Camera-facade can retrieve a pointer to the object from the instance number.
 

Structured parameters

The parameters RUN_0 and RUN_1 are structured. Their SDS structures map directly to the C structure of type progress_st defined in the Camera-facade. The SDS structures for initializing the parameters are generated by code made with the SDS compiler (in the SDS package of DRAMA), but this code is now included in the Camera-facade class; the SDS compiler is not used in the udas_camera makefile.

The structured parameters are set by copying an equivalent C structure into their SDS structures. The C structure is constructed inside the Camera-facade from scalar itemes of telemetry.