Palantir.conf - configuration file for Palantir
The file palantir.conf provides configuration parameters and device definitions for the palantir server. The default location of this file (usually '/usr/local/share/palantir/palantir.conf') is determined at compile time; an alternate file can be specified via the -C command-line option to palantir.
It is perfectly legal to run palantir without a config file. If, however, one is (explicitly or implicitly) supplied which is not properly written, palantir will refuse to start and complain loudly.
Most parameters can be set both via a command-line option and in the config file. When there is a conflict between the two definitions, the command-line option takes precedence.
Some parameters (e.g. device definitions) can only be set in the config file. Conversely, not all command-line options have their config file counterpart (yet).
Each line in the palantir.conf file starts with a keyword followed by one or more parameters. No line breaks are allowed between a keyword and its parameters, or between parameters. Use spaces or tabs to separate them.
Keywords are case-insensitive.
String parameters which include spaces must be delimited by double quotes (``).
If the first non-whitespace character in a line is #, that line is considered to be a comment, and all subsequent characters until end-of-line are discarded.
A device definition is introduced by the keyword Device. The actual definition must be included in curly braces.
A configuration file consists of zero or more global options, defining video and audio parameters and general setup, and zero or more device definitions, describing the server-side devices which clients can interact with. The next two sections give a comprehensive overview of the keywords available in each context.
This parameter has no equivalent command-line option.
This parameter has no equivalent command-line option.
This parameter has no equivalent command-line option.
This parameter has no equivalent command-line option.
This parameter has no equivalent command-line option.
This parameter has no equivalent command-line option.
In the following, by device we mean a communication endpoint, exposed by some piece of hardware or by a software process, which the palantir server can exchange data with.
Read and ReadWrite devices (see the Direction directive) can supply data to the palantir server, which will in turn broadcast them to all connected clients. ReadWrite devices can, in addition, be operated through the server by the client currently in control.
Each device is uniquely identified by specifying in a Carrier directive the link it uses to communicate with the server and the address (an integer index) relative to that link. palantir currently supports three families of communication links:
The list of directives available in a device definition follows.
On the Internal link, address 0 is associated to video brightness (in the range 0...65535), address 1 to video contrast (same range), and address 3 to the video tuner channel (the presets are hardcoded in the executable and represent a selection of TV stations available in Italy).
This directive is mandatory in every device definition.
For devices on the Pipe link, only the Read value is allowed.
The special names ``Pan'', ``Tilt'' and ``Zoom'' are reserved for devices controlling the coordinates of a movable camera. Assigning a device one of these names automatically causes clients to display an appropriate scrollbar in some predefined position (a horizontal bar below the video frame for ``Pan'', a vertical bar on the left of the frame for ``Tilt'', and a shorter bar somewhere else for ``Zoom''). Note that in this case the setting of Visual is disregarded.
See also Hint below.
The choice of available controls is likely to expand in the future.
This directive is mandatory unless the device Name is one of ``Pan'', ``Tilt'' or ``Zoom''.
Range declares that device data of interest to the user lie in the range min...max instead of the default 0...65535. min and max must be integer numbers, with max strictly greater than min.
Remap linearly rescales the min...max range to n1...n2. Here n1 and n2 can be floating point numbers and n2 can be less than n1.
Clients will associate the left (or bottom) end of the graphical control for this device (as specified in the Visual directive) with n1, and the right (or top) end with n2. Device data received by the client will be level-shifted and scaled according to the transformation specified by Range and Remap before being presented to the user (in graphical or numerical form).
The actual transformation is described by the formula
displayed value = (device value - min) * (n2 - n1) / (max - min)
If Remap is not specified, it is assumed that n1=min and n2=max.
If Range is not specified, it is assumed that min=0 and max=65535.
Default value is Client for devices on the Internal link, and Device in all other cases.
The following definitions describe two devices for controlling camera pan and tilt, respectively. The hardware is supposed to be connected to the server via the serial link; an on-board microcontroller is required to dispatch data to the appropriate device according to its address (0 for the pan and 1 for the tilt stepper motors):
Device { Carrier Serial 0 Direction ReadWrite Name "Pan" Range 20 230 }
Device { Carrier Serial 1 Direction ReadWrite Name "Tilt" Range 20 230 }
Direction is set to ReadWrite to enable clients to control the devices.
The Visual directive is not required; since the devices carry the special names ``Pan'' and ``Tilt'', clients will display two ad-hoc sliders below and on the right of the video frame.
The Range directive restricts the control range to 20...230 from the default 0...65535. As a consequence, when the pan scrollbar is dragged full left on the controlling client, the microcontroller will be commanded to set the pan stepper motor to position 20 (or to position 230 if the scrollbar is dragged full right). The same holds for the tilt control (which will be displayed as a vertical scrollbar instead).
The implicit Notifier Device directive states that notification of a device status change is expected to come from the device itself. In this case, after a position change the microcontroller should provide feedback to the server about the motor's new position. The server would in turn broadcast the information to all connected clients, which would adjust the position of their sliders to reflect the change. If the device were unable to provide feedback and still you wanted changes committed by the user in control to be propagated to all other clients, Notifier Client should be explicitely used instead.
The following definition describes a thermal probe located at address 3 on the serial link. Let's assume that temperature data supplied to the server are in Celsius degrees (in the range 0...100), but clients are required to display them in the Farhenheit scale.
Device { Carrier Serial 3 Direction read Name "Temp" Hint "Room temperature in Farhenheit degrees" Visual gauge Range 0 100 Remap 32 212 }
The Remap directive does the range conversion trick from 0...100 (Celsius) to 32...212 (Fahrenheit).
David Santinoli <david at santinoli.com>.