Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
KM3NETDAQ::JDAQUTCExtended Class Reference

Data structure for UTC time. More...

#include <JDAQUTCExtended.hh>

Inheritance diagram for KM3NETDAQ::JDAQUTCExtended:
JDETECTOR::JModuleGeometry

Public Types

typedef unsigned int JUINT32_t
 

Public Member Functions

 JDAQUTCExtended ()
 Default constructor. More...
 
 JDAQUTCExtended (const JUINT32_t seconds, const JUINT32_t cycles)
 Constructor. More...
 
 JDAQUTCExtended (const double nanoseconds)
 Constructor. More...
 
virtual ~JDAQUTCExtended ()
 Virtual destructor. More...
 
bool getWRStatus () const
 Get White Rabbit status. More...
 
JUINT32_t getUTCseconds () const
 Get major time. More...
 
JUINT32_t getUTC16nanosecondcycles () const
 Get minor time. More...
 
double getTimeNanoSecond () const
 Get time (limited to 16 ns cycles). More...
 
void setTimeNanoSecond (const double utc_ns)
 Set time. More...
 
 ClassDef (JDAQUTCExtended, 1)
 

Static Public Member Functions

static JDAQUTCExtended min ()
 Get minimum possible value. More...
 
static JDAQUTCExtended max ()
 Get maximum possible value. More...
 
static JUINT32_t getMask ()
 Get mask for seconds data. More...
 
static double getTick ()
 Get number of nano-seconds per tick. More...
 

Protected Attributes

JUINT32_t UTC_seconds
 
JUINT32_t UTC_16nanosecondcycles
 

Friends

size_t getSizeof ()
 Definition of method to get size of data type. More...
 
JReaderoperator>> (JReader &, JDAQUTCExtended &)
 Read UTC from input. More...
 
JWriteroperator<< (JWriter &, const JDAQUTCExtended &)
 Write UTC to output. More...
 
std::istream & operator>> (std::istream &in, JDAQUTCExtended &utc)
 Read UTC time. More...
 
std::ostream & operator<< (std::ostream &out, const JDAQUTCExtended &utc)
 Write UTC time. More...
 

Detailed Description

Data structure for UTC time.

Definition at line 22 of file JDAQUTCExtended.hh.

Member Typedef Documentation

Definition at line 26 of file JDAQUTCExtended.hh.

Constructor & Destructor Documentation

KM3NETDAQ::JDAQUTCExtended::JDAQUTCExtended ( )
inline

Default constructor.

Definition at line 36 of file JDAQUTCExtended.hh.

36  :
37  UTC_seconds(0),
39  {}
KM3NETDAQ::JDAQUTCExtended::JDAQUTCExtended ( const JUINT32_t  seconds,
const JUINT32_t  cycles 
)
inline

Constructor.

Parameters
secondsseconds [s]
cyclescycles [16 ns]

Definition at line 48 of file JDAQUTCExtended.hh.

49  :
50  UTC_seconds(seconds),
52  {}
KM3NETDAQ::JDAQUTCExtended::JDAQUTCExtended ( const double  nanoseconds)
inline

Constructor.

Parameters
nanosecondstime [ns]

Definition at line 60 of file JDAQUTCExtended.hh.

61  {
62  setTimeNanoSecond(nanoseconds);
63  }
void setTimeNanoSecond(const double utc_ns)
Set time.
virtual KM3NETDAQ::JDAQUTCExtended::~JDAQUTCExtended ( )
inlinevirtual

Virtual destructor.

Definition at line 69 of file JDAQUTCExtended.hh.

70  {}

Member Function Documentation

bool KM3NETDAQ::JDAQUTCExtended::getWRStatus ( ) const
inline

Get White Rabbit status.

Returns
true if okay; else false

Definition at line 78 of file JDAQUTCExtended.hh.

79  {
80  return (UTC_seconds & ~getMask()) != 0;
81  }
static JUINT32_t getMask()
Get mask for seconds data.
JUINT32_t KM3NETDAQ::JDAQUTCExtended::getUTCseconds ( ) const
inline

Get major time.

Returns
time [s]

Definition at line 89 of file JDAQUTCExtended.hh.

90  {
91  return (UTC_seconds & getMask());
92  }
static JUINT32_t getMask()
Get mask for seconds data.
JUINT32_t KM3NETDAQ::JDAQUTCExtended::getUTC16nanosecondcycles ( ) const
inline

Get minor time.

Returns
time [16 ns]

Definition at line 100 of file JDAQUTCExtended.hh.

101  {
102  return UTC_16nanosecondcycles;
103  }
double KM3NETDAQ::JDAQUTCExtended::getTimeNanoSecond ( ) const
inline

Get time (limited to 16 ns cycles).

Returns
time [ns]

Definition at line 111 of file JDAQUTCExtended.hh.

112  {
113  return getUTCseconds() * 1.0e9 + getUTC16nanosecondcycles() * getTick();
114  }
static double getTick()
Get number of nano-seconds per tick.
JUINT32_t getUTC16nanosecondcycles() const
Get minor time.
JUINT32_t getUTCseconds() const
Get major time.
void KM3NETDAQ::JDAQUTCExtended::setTimeNanoSecond ( const double  utc_ns)
inline

Set time.

Parameters
utc_nstime [ns]

Definition at line 122 of file JDAQUTCExtended.hh.

123  {
124  UTC_seconds = (unsigned int) ( utc_ns / 1.0e9);
125  UTC_16nanosecondcycles = (unsigned int) ((utc_ns - UTC_seconds*1.0e9) / getTick());
126  }
static double getTick()
Get number of nano-seconds per tick.
static JDAQUTCExtended KM3NETDAQ::JDAQUTCExtended::min ( )
inlinestatic

Get minimum possible value.

Returns
minimum possible value

Definition at line 134 of file JDAQUTCExtended.hh.

135  {
136  return JDAQUTCExtended(0,0);
137  }
JDAQUTCExtended()
Default constructor.
static JDAQUTCExtended KM3NETDAQ::JDAQUTCExtended::max ( )
inlinestatic

Get maximum possible value.

Returns
maximum possible value

Definition at line 145 of file JDAQUTCExtended.hh.

146  {
147  return JDAQUTCExtended(std::numeric_limits<JUINT32_t>::max(),
148  std::numeric_limits<JUINT32_t>::max());
149  }
JDAQUTCExtended()
Default constructor.
static JUINT32_t KM3NETDAQ::JDAQUTCExtended::getMask ( )
inlinestatic

Get mask for seconds data.

Returns
mask

Definition at line 157 of file JDAQUTCExtended.hh.

158  {
159  return 0x7FFFFFFF;
160  }
static double KM3NETDAQ::JDAQUTCExtended::getTick ( )
inlinestatic

Get number of nano-seconds per tick.

Returns
time [ns]

Definition at line 168 of file JDAQUTCExtended.hh.

169  {
170  return 16.0;
171  }
KM3NETDAQ::JDAQUTCExtended::ClassDef ( JDAQUTCExtended  ,
 
)

Friends And Related Function Documentation

size_t getSizeof ( )
friend

Definition of method to get size of data type.

This method should be specialised for each desired data type with fixed length.

Returns
number of bytes
JReader& operator>> ( JReader in,
JDAQUTCExtended utc 
)
friend

Read UTC from input.

Parameters
inreader
utcUTC
Returns
reader

Definition at line 33 of file JDAQUTCExtendedIO.hh.

34  {
35  in >> utc.UTC_seconds;
36  in >> utc.UTC_16nanosecondcycles;
37 
38  return in;
39  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
JWriter& operator<< ( JWriter out,
const JDAQUTCExtended utc 
)
friend

Write UTC to output.

Parameters
outwriter
utcUTC
Returns
writer

Definition at line 49 of file JDAQUTCExtendedIO.hh.

50  {
51  out << utc.UTC_seconds;
52  out << utc.UTC_16nanosecondcycles;
53 
54  return out;
55  }
std::istream& operator>> ( std::istream &  in,
JDAQUTCExtended utc 
)
friend

Read UTC time.

Parameters
inintput stream
utcUTC extended time
Returns
intput stream

Definition at line 181 of file JDAQUTCExtended.hh.

182  {
183  in >> utc.UTC_seconds;
184  in.get();
185  in >> utc.UTC_16nanosecondcycles;
186 
187  return in;
188  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const JDAQUTCExtended utc 
)
friend

Write UTC time.

Parameters
outoutput stream
utcUTC extended time
Returns
output stream

Definition at line 198 of file JDAQUTCExtended.hh.

199  {
200  using namespace std;
201 
202  const char c = out.fill();
203 
204  out << setw(10) << utc.getUTCseconds();
205  out << ':';
206  out << setw(10) << setfill('0') << utc.getUTC16nanosecondcycles() << setfill(c);
207 
208  return out;
209  }
JUINT32_t getUTC16nanosecondcycles() const
Get minor time.
JUINT32_t getUTCseconds() const
Get major time.
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'

Member Data Documentation

JUINT32_t KM3NETDAQ::JDAQUTCExtended::UTC_seconds
protected

Definition at line 216 of file JDAQUTCExtended.hh.

JUINT32_t KM3NETDAQ::JDAQUTCExtended::UTC_16nanosecondcycles
protected

Definition at line 217 of file JDAQUTCExtended.hh.


The documentation for this class was generated from the following file: