man3mngr/setupINTpar

Table of Contents

Name

setupINTparameter - process a setup parameter

Description

setupINTparameter examines to see if the CONFLIST.Label and CONFLIST.RefName fields are non null.

If they are null the value of CONFLIST.Preset is checked to see if it is greater than or equal to min and less than or equal to max. If the value is in range it is returned else the value of default_value is returned.

If they are non null the CONFLIST.Label and CONLIST.DescPnt fields are checked to make sure they are non null. If this is the case the current value of the parameter is obtained from dbman and the parameter is subscribed to.

If the record is not found in the CONFLIST the value of default_value is returned.

This function communicates with dbman in local mode.

This function is part of libmngr.

Syntax

double setupINTparameter(
   int DBchan, int DBchan2,

   CONFLIST *CF, int CFsize,

   int Group,

   int Function,

   int Index,

   double min,

   double max,

   double default_value,

   void *user_data,

   int subscribe_mode

   );

Arguments

DBchan

the main database channel

Subscriptions etc. are posted here.

DBchan2

the aux database channel

This channel is opened during the setup phase of the program and possibly closed later.

It is used by this function to obtain the current value of the parameter from the AccelNET database.

There should be no subscriptions or write locks posted to it.

Cf

A pointer to the beginning of the CONFLIST record array.

CFsize

The size (in records) of the CONFLIST record array.

Group

The group name of the CONFLIST parameter to process.

Function

The function name of the CONFLIST parameter to process.

Index

The index value of the CONFLIST parameter to process.

min

The minimum legal value to be used from CONFLIST.Preset

max

The maximum legal value to be used from CONFLIST.Preset

default_value

The value to use if the CONFLIST record is not found, if the value supplied by by CONFLIST.Preset is out of range, or in the case of any configuration error.

user_data

A pointer to any kind of data needed by the application.

CONFLIST.UserData is assigned this pointer value.

subscribe_mode

If the value is zero the parameter is subscribed to normally.
If the value is nonzero an indirect subscription is posted.

Notes

Check the log to make sure parameters listed in the config table are valid. GetCtlReadValues(3mngr) is used by this function and will complain.

See Also

libmngr(3mngr)

Manual page revision

$Id: setupINTpar.3,v 1.3 2005/01/13 13:34:36 kitchen Exp $


Table of Contents