From 3ecb5d9be7d2099cb75f4644bcf87441fd820fd2 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 21 Jul 2012 21:38:03 -0500 Subject: Initial sensor monitor server client --- lib/libtqtrla/src/tqtrla.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ lib/libtqtrla/src/tqtrla.h | 22 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) (limited to 'lib') diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp index 711804e..75bae5e 100644 --- a/lib/libtqtrla/src/tqtrla.cpp +++ b/lib/libtqtrla/src/tqtrla.cpp @@ -454,5 +454,47 @@ TQDataStream &operator>>( TQDataStream &s, StationType &st ) s >> st.description; return s; } + +/*! + \relates SensorType + + Writes the SensorType \a str to the stream \a s. + + See also \link datastreamformat.html Format of the TQDataStream operators \endlink +*/ + +TQDataStream &operator<<( TQDataStream &s, const SensorType &st ) +{ + s << st.index; + s << st.name; + s << st.description; + s << st.units; + s << st.min; + s << st.max; + s << st.mininterval; + s << st.nominalinterval; + return s; +} + +/*! + \relates SensorType + + Reads a SensorType from the stream \a s into SensorType \a str. + + See also \link datastreamformat.html Format of the TQDataStream operators \endlink +*/ + +TQDataStream &operator>>( TQDataStream &s, SensorType &st ) +{ + s >> st.index; + s >> st.name; + s >> st.description; + s >> st.units; + s >> st.min; + s >> st.max; + s >> st.mininterval; + s >> st.nominalinterval; + return s; +} #endif // QT_NO_DATASTREAM diff --git a/lib/libtqtrla/src/tqtrla.h b/lib/libtqtrla/src/tqtrla.h index be105b8..e46e2fc 100644 --- a/lib/libtqtrla/src/tqtrla.h +++ b/lib/libtqtrla/src/tqtrla.h @@ -163,4 +163,26 @@ typedef TQValueList StationList; // ============================================================================= +class SensorType +{ + public: + TQ_UINT32 index; + TQString name; + TQString description; + TQString units; + double min; + double max; + double mininterval; + double nominalinterval; +}; + +#ifndef QT_NO_DATASTREAM +Q_EXPORT TQDataStream &operator<<(TQDataStream &, const SensorType &); +Q_EXPORT TQDataStream &operator>>(TQDataStream &, SensorType &); +#endif + +typedef TQValueList SensorList; + +// ============================================================================= + #endif // TQTRLA_H \ No newline at end of file -- cgit v1.2.3