Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/SubscriberHandler.cpp (1 of 13 files). Show all
Unified · Split
| @@ -22,7 +22,11 @@ · 21 unmodified lines | |||
| 22 | //****************************************************************************************************** | 22 | //****************************************************************************************************** |
| 23 | 23 | ||
| 24 | #include "SubscriberHandler.h" | 24 | #include "SubscriberHandler.h" |
| 25 | |||
| 26 | // TODO: These includes are just for temporary testing code | ||
| 25 | #include "../Common/Convert.h" | 27 | #include "../Common/Convert.h" |
| 28 | #include <boost/lexical_cast.hpp> | ||
| 29 | #include <boost/uuid/uuid_io.hpp> | ||
| 26 | 30 | ||
| 27 | using namespace std; | 31 | using namespace std; |
| 28 | using namespace GSF::TimeSeries; | 32 | using namespace GSF::TimeSeries; |
| @@ -117,12 +121,11 @@ void SubscriberHandler::ReceivedNewMeasurements(const vector<MeasurementPtr>& me · 88 unmodified lines | |||
| 117 | int32_t qualityFlags = measurement->Flags; | 121 | int32_t qualityFlags = measurement->Flags; |
| 118 | 122 | ||
| 119 | ConfigurationFramePtr configurationFrame; | 123 | ConfigurationFramePtr configurationFrame; |
| 124 | MeasurementMetadataPtr measurementMetadata; | ||
| 120 | 125 | ||
| 121 | // Find associated configuration for measurement | 126 | // Find associated configuration for measurement |
| 122 | if (TryFindTargetConfigurationFrame(measurement->SignalID, configurationFrame)) | 127 | if (TryFindTargetConfigurationFrame(measurement->SignalID, configurationFrame)) |
| 123 | { | 128 | { |
| 124 | MeasurementMetadataPtr measurementMetadata; | ||
| 125 | |||
| 126 | // Lookup measurement metadata - it's faster to find metadata from within configuration frame | 129 | // Lookup measurement metadata - it's faster to find metadata from within configuration frame |
| 127 | if (TryGetMeasurementMetdataFromConfigurationFrame(measurement->SignalID, configurationFrame, measurementMetadata)) | 130 | if (TryGetMeasurementMetdataFromConfigurationFrame(measurement->SignalID, configurationFrame, measurementMetadata)) |
| 128 | { | 131 | { |
| @@ -135,6 +138,11 @@ void SubscriberHandler::ReceivedNewMeasurements(const vector<MeasurementPtr>& me · 6 unmodified lines | |||
| 135 | // TODO: Handle measurement processing here... | 138 | // TODO: Handle measurement processing here... |
| 136 | } | 139 | } |
| 137 | } | 140 | } |
| 141 | else if (TryGetMeasurementMetdata(measurement->SignalID, measurementMetadata)) | ||
| 142 | { | ||
| 143 | // Received measurement is not part of a defined configuration frame, e.g., a statistic | ||
| 144 | const SignalReference& reference = measurementMetadata->Reference; | ||
| 145 | } | ||
| 138 | } | 146 | } |
| 139 | 147 | ||
| 140 | // TODO: *** Temporary Testing Code Below *** -- REMOVE BEFORE USE | 148 | // TODO: *** Temporary Testing Code Below *** -- REMOVE BEFORE USE |
| @@ -158,6 +166,8 @@ void SubscriberHandler::ReceivedNewMeasurements(const vector<MeasurementPtr>& me · 17 unmodified lines | |||
| 158 | 166 | ||
| 159 | if (TicksToString(timestamp, MaxTimestampSize, TimestampFormat, measurements[0]->Timestamp)) | 167 | if (TicksToString(timestamp, MaxTimestampSize, TimestampFormat, measurements[0]->Timestamp)) |
| 160 | message << "Timestamp: " << string(timestamp) << endl; | 168 | message << "Timestamp: " << string(timestamp) << endl; |
| 169 | |||
| 170 | message << "Signal ID: " << boost::lexical_cast<string>(measurements[0]->SignalID) << endl; | ||
| 161 | 171 | ||
| 162 | message << "Point\tValue" << endl; | 172 | message << "Point\tValue" << endl; |
| 163 | 173 | ||