fdhwlib
2.0.25
|
#include <gpsunit.h>
The class defines the interface to the hardware gps unit for the FD detector.
enum GpsUnit::Status |
Status of the gps unit and gps unit commands.
GpsUnit::GpsUnit | ( | const char * | inifile = "FE.ini" | ) |
Create instance and read parameters form the given inifile.
Format:
[GpsUnit] hostname = localhost port = 5198
GpsUnit::GpsUnit | ( | const char * | inifile, |
const char * | host, | ||
int | port = 0 |
||
) |
GpsUnit::~GpsUnit | ( | ) |
Status GpsUnit::checkActalTime | ( | ) |
Status GpsUnit::checkTime | ( | int * | tOncoreDiff = 0 , |
int * | tAugerDiff = 0 |
||
) |
Check second counters of the gps clock.
Compare with PC time. The offset of the gps messages from about 300ms is taken into account. If the functions is during the message window between 250 and 350ms the check will wait for the message window to pass by. before the message window the second counters will be compared with the last second of the PC.
Status GpsUnit::connect | ( | char * | host = 0 , |
int | port = 0 |
||
) |
Connect to the gps server.
The arguments overwrite the standard parameter read from the inifile.
Status GpsUnit::disconnect | ( | ) |
Disconnect from the gps server.
void GpsUnit::displayRawData | ( | FILE * | fout | ) |
Display raw gpsclock messages.
void GpsUnit::getCapturedInputs | ( | FILE * | fout, |
int | n = 1 , |
||
int | ch = 0 |
||
) |
Get time stamps of signal changes.
int GpsUnit::getInputMode | ( | int | ch, |
int * | mode = 0 , |
||
int * | state = 0 |
||
) |
Get the mode for the input signals (external trigger, veto).
If the the parameters are not required it is possible to set the pointers to zero.
ch | number of the input channel (0..3) |
mode | meaning of the input signal (0 veto, 1 external trigger) |
state | the input channels can be deactivate if required. (-1 no change, 0 off, 1 on) |
int GpsUnit::getLeapSeconds | ( | ) |
Get number of leap seconds.
int GpsUnit::getLidarTriggerFrequency | ( | ) |
Get the frequency of the lidar trigger output of the GPS unit.
void GpsUnit::getPosition | ( | std::string * | name, |
int * | latitude = 0 , |
||
int * | longitude = 0 , |
||
int * | height = 0 |
||
) |
Get the postion of the gps clock.
void GpsUnit::getPosition | ( | int * | id, |
std::string * | name, | ||
int * | latitude = 0 , |
||
int * | longitude = 0 , |
||
int * | height = 0 |
||
) |
Get the position and id of the gps clock Id and name of the position are determined from the gpsserver ini file.
Arguments that are set to zero will be not considered in the request.
id | Id of the position (0=Unknown) For the FD eye station in Argentina the numbers 1 to 4 are reserved. |
name | Name of the position returned from the database |
latitude | latitude |
longitude | longitude |
height | height |
void GpsUnit::getPulseGeneratorParameter | ( | int | ch, |
struct pulseGen * | parameter | ||
) |
Set the parameters for a pulse generator channel.
ch | number of the input channel (0..3) |
parameter | Array with the pulse generator parameters |
const char* GpsUnit::getServerHostname | ( | ) |
Get the hostname of the server machine.
int GpsUnit::getServerPort | ( | ) |
Get gpsserver port number.
Status GpsUnit::getStatus | ( | ) |
Get the status of the gps unit.
The following list is checked to determine the status of the gps unit.
unsigned int GpsUnit::getTime | ( | unsigned int * | augerSec = 0 | ) |
Read the (oncore) gps second counter.
augerSec | Value of the auger second counter. The values of both counters can be different, if the adjustment of the counters is turned off. |
Status GpsUnit::getTimeCorrection | ( | unsigned int | gpsSec, |
unsigned int * | count, | ||
int * | phase, | ||
int * | lastSawtooth, | ||
int * | nextSawtooth | ||
) |
Get the parameters for the correction of the time base from the FD camera electronic.
gpsSec | Requested second according to the gps convention (Seconds since beginning of 1980) |
count | Number of 80MHz ticks for this second |
phase | measured delay between 1pps pulse of the oncore module and second strobe generated for the camera electronic in nanoseconds |
lastSawtooth | negative sawtooth time error of the last 1pps pulse of the oncore module in nanoseconds. |
nextSawtooth | negative sawtooth time error of the next 1pps pulse of the oncore module in nanoseconds |
Status GpsUnit::getTimeCorrection | ( | unsigned int | gpsSec, |
double * | T10, | ||
double * | offset | ||
) |
Get the correction parameter.
gpsSec | Name of the gps second |
T10 | Length of the a 10MHz pulse from the gps unit [ns]. |
offset | Offset between 1pps signal and 10MHz signal [ns]. |
std::string GpsUnit::getVerboseStatus | ( | GpsUnit::Status | status | ) |
Get the verbose meaning of the passed status value.
int GpsUnit::getVersion | ( | enum deviceId | dev, |
int | len = 0 , |
||
char * | buildnote = 0 |
||
) |
Get the version number of a subdevice.
The version number is mulitplied by 100
void GpsUnit::init | ( | ) |
(Re-)Initialize the oncore module.
The command will also cause a new measurement of the gps coordinates.
bool GpsUnit::isAdjustActive | ( | ) |
Adjustment of auger second counter active?
bool GpsUnit::isInhibit | ( | ) |
Request the state of the GPS timing unit.
void GpsUnit::releaseInhibit | ( | ) |
Release inhibit signal for the FD electronic.
void GpsUnit::sendMsg | ( | unsigned char * | msg, |
int | n | ||
) |
Send raw message to server.
void GpsUnit::setAdjustMode | ( | int | mode | ) |
Set the adjustment mode (0 disabled, 1 once, 2 active)
void GpsUnit::setCommunicationWindow | ( | int | begin, |
int | end | ||
) |
Define the communication window for the time control module of the GPS unit.
begin | Begin of the interval [ms] |
end | End of the interval [ms] |
void GpsUnit::setInhibit | ( | ) |
Set the inhibit signal for the FD electronic.
void GpsUnit::setInputMode | ( | int | ch, |
int | mode, | ||
int | state = -1 |
||
) |
Set the mode for the input signals (external trigger, veto).
ch | number of the input channel (0..3) |
mode | meaning of the input signal (0 veto, 1 external trigger) |
state | the input channels can be deactivate if required. (-1 no change, 0 off, 1 on) |
void GpsUnit::setLidarTriggerFrequency | ( | int | freq | ) |
Set the frequency of the lidar trigger output of the GPS unit.
freq | Frequency of the trigger (0, 20, 1000Hz). |
void GpsUnit::setPulseGeneratorParameter | ( | int | ch, |
struct pulseGen | parameter | ||
) |
Set the parameters for a pulse generator channel.
ch | number of the input channel (0..3) |
parameter | Array with the pulse generator parameters |
Note: If you set a start time in the past, there will be nothing done. A start time of 0 will use 'now' as starting time.
Status GpsUnit::shutdown | ( | ) |
Shutdown the gps server.
bool GpsUnit::connected [private] |
std::string GpsUnit::host [private] |
int GpsUnit::port [private] |
SimpleSocket* GpsUnit::sock [private] |
unsigned int GpsUnit::status [private] |