Feature #18085
Support for running multiple DAQInterfaces at the same time
100%
Description
A useful feature for DAQInterface to have is support for running multiple DAQInterface instances at the same time. The following commits realize this goal:
0289e192662873675dbf261f3be6e87f95556219
fd4ca5a49c3ebee951f497fe0ac606f4b0b201d6
5f36cea551b2adb03b9e9d0ee2d7f457c4f70a29
These changes are backward-compatible in the sense that if only one instance of DAQInterface is used on a system, a user won't notice the new functionality beyond the fact that the output is now logged to a logfile which contains the DAQInterface's listening port (e.g., /tmp/daqinterface_jcfree/DAQInterface_port5570.log rather than /tmp/daqinterface_jcfree/DAQInterface.log).
In a given shell, the DAQInterface instance to which commands are sent is defined by the DAQINTERFACE_PORT environment variable, which refers to the port the DAQInterface instance is listening on. The source_me script will set DAQINTERFACE_PORT to the numerically highest port of those which the existing instances of DAQInterface are listening on. If a new DAQInterface is launched in a shell via "DAQInterface &", then DAQINTERFACE_PORT is automatically updated to refer to the new DAQInterface's port. At any time, a user can change the DAQInterface to which commands are sent by setting DAQINTERFACE_PORT accordingly.
The following scripts have been added to help work with multiple DAQInterface instances:
listdaqinterfaces.sh
: will produce a listing of existing DAQInterface instances which looks like the followingDAQInterface instance was launched at 15:06 by jcfree listening on port 5590 DAQInterface instance was launched at 14:29 by jcfree listening on port 5570
kill_daqinterface_on_port.sh
: will kill the DAQInterfaces listening on the port numbers passed to this script as arguments (more than one is permitted).