Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/SimpleSubscribe.cpp (1 of 5 files). Show all
Unified · Split
| @@ -21,13 +21,10 @@ · 20 unmodified lines | ||
| 21 | 21 | // |
| 22 | 22 | //****************************************************************************************************** |
| 23 | 23 | |
| 24 | −#include <iostream> | |
| 25 | −#include <string> | |
| 26 | −#include <vector> | |
| 27 | − | |
| 28 | 24 | #include "../Common/CommonTypes.h" |
| 29 | 25 | #include "../Common/Convert.h" |
| 30 | 26 | #include "../Transport/DataSubscriber.h" |
| 27 | +#include <iostream> | |
| 31 | 28 | |
| 32 | 29 | using namespace std; |
| 33 | 30 | using namespace GSF; |
| @@ -145,11 +142,7 @@ bool RunSubscriber(const string& hostname, uint16_t port) · 111 unmodified lines | ||
| 145 | 142 | // received a new packet of measurements from the publisher. |
| 146 | 143 | void ProcessMeasurements(DataSubscriber* source, const vector<MeasurementPtr>& measurements) |
| 147 | 144 | { |
| 148 | − const string TimestampFormat = "%Y-%m-%d %H:%M:%S.%f"; | |
| 149 | − const uint32_t MaxTimestampSize = 80; | |
| 150 | − | |
| 151 | 145 | static long processCount = 0; |
| 152 | − static char timestamp[MaxTimestampSize]; | |
| 153 | 146 | static const long interval = 5 * 60; |
| 154 | 147 | const long measurementCount = measurements.size(); |
| 155 | 148 | const bool showMessage = (processCount + measurementCount >= (processCount / interval + 1) * interval); |
| @@ -162,10 +155,7 @@ void ProcessMeasurements(DataSubscriber* source, const vector<MeasurementPtr>& m · 6 unmodified lines | ||
| 162 | 155 | stringstream message; |
| 163 | 156 | |
| 164 | 157 | message << source->GetTotalMeasurementsReceived() << " measurements received so far..." << endl; |
| 165 | − | |
| 166 | − if (TicksToString(timestamp, MaxTimestampSize, TimestampFormat, measurements[0]->Timestamp)) | |
| 167 | − message << "Timestamp: " << string(timestamp) << endl; | |
| 168 | − | |
| 158 | + message << "Timestamp: " << ToString(measurements[0]->GetDateTime()) << endl; | |
| 169 | 159 | message << "Point\tValue" << endl; |
| 170 | 160 | |
| 171 | 161 | for (const auto& measurement : measurements) |