Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/SubscriberHandler.cpp (1 of 5 files). Show all
Unified · Split
| @@ -25,11 +25,11 @@ · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | // TODO: These includes are just for temporary testing code |
| 27 | 27 | #include "../Common/Convert.h" |
| 28 | −#include <boost/lexical_cast.hpp> | |
| 29 | 28 | #include <boost/uuid/uuid_io.hpp> |
| 30 | 29 | #include <iostream> |
| 31 | 30 | |
| 32 | 31 | using namespace std; |
| 32 | +using namespace GSF; | |
| 33 | 33 | using namespace GSF::TimeSeries; |
| 34 | 34 | |
| 35 | 35 | SubscriberHandler::SubscriberHandler(const string& name) |
| @@ -151,27 +151,27 @@ void SubscriberHandler::ReceivedNewMeasurements(const vector<MeasurementPtr>& me · 115 unmodified lines | ||
| 151 | 151 | const string TimestampFormat = "%Y-%m-%d %H:%M:%S.%f"; |
| 152 | 152 | const uint32_t MaxTimestampSize = 80; |
| 153 | 153 | |
| 154 | − //static long processCount = 0; | |
| 154 | + static long processCount = 0; | |
| 155 | 155 | static char timestamp[MaxTimestampSize]; |
| 156 | − //static const long interval = 5 * 60; | |
| 157 | − //const long measurementCount = measurements.size(); | |
| 156 | + static const long interval = 5 * 60; | |
| 157 | + const long measurementCount = measurements.size(); | |
| 158 | 158 | const bool showMessage = true; // (processCount + measurementCount >= (processCount / interval + 1) * interval); |
| 159 | 159 | |
| 160 | − //processCount += measurementCount; | |
| 160 | + processCount += measurementCount; | |
| 161 | 161 | |
| 162 | 162 | // Only display messages every few seconds |
| 163 | 163 | if (showMessage) |
| 164 | 164 | { |
| 165 | 165 | stringstream message; |
| 166 | 166 | |
| 167 | − //message << GetTotalMeasurementsReceived() << " measurements received so far..." << endl; | |
| 167 | + message << GetTotalMeasurementsReceived() << " measurements received so far..." << endl; | |
| 168 | 168 | |
| 169 | 169 | if (TicksToString(timestamp, MaxTimestampSize, TimestampFormat, measurements[0]->Timestamp)) |
| 170 | 170 | message << string(timestamp); |
| 171 | 171 | |
| 172 | − //message << "Signal ID: " << boost::lexical_cast<string>(measurements[0]->SignalID) << endl; | |
| 172 | + message << "Signal ID: " << boost::lexical_cast<string>(measurements[0]->SignalID) << endl; | |
| 173 | 173 | |
| 174 | − //message << "Point\tValue" << endl; | |
| 174 | + message << "Point\tValue" << endl; | |
| 175 | 175 | |
| 176 | 176 | for (const auto& measurement : measurements) |
| 177 | 177 | message << '\t' << measurement->ID << '\t' << measurement->Value; |