summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-21 21:38:03 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-21 21:38:03 -0500
commit3ecb5d9be7d2099cb75f4644bcf87441fd820fd2 (patch)
tree3ee96c4446bf79240d5017f293a56c69627d98bc /lib
parent25abfd3c581c1098532d464ae303fd7e43fce46e (diff)
downloadulab-3ecb5d9be7d2099cb75f4644bcf87441fd820fd2.tar.gz
ulab-3ecb5d9be7d2099cb75f4644bcf87441fd820fd2.zip
Initial sensor monitor server client
Diffstat (limited to 'lib')
-rw-r--r--lib/libtqtrla/src/tqtrla.cpp42
-rw-r--r--lib/libtqtrla/src/tqtrla.h22
2 files changed, 64 insertions, 0 deletions
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<StationType> 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<SensorType> SensorList;
+
+// =============================================================================
+
#endif // TQTRLA_H \ No newline at end of file