Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/AverageFrequencyCalculator.cpp (1 of 27 files). Show all
Unified · Split
| @@ -5,10 +5,10 @@ · 4 unmodified lines | |||
| 5 | // | 5 | // |
| 6 | // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See | 6 | // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See |
| 7 | // the NOTICE file distributed with this work for additional information regarding copyright ownership. | 7 | // the NOTICE file distributed with this work for additional information regarding copyright ownership. |
| 8 | // The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may | 8 | // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this |
| 9 | // not use this file except in compliance with the License. You may obtain a copy of the License at: | 9 | // file except in compliance with the License. You may obtain a copy of the License at: |
| 10 | // | 10 | // |
| 11 | // http://www.opensource.org/licenses/eclipse-1.0.php | 11 | // http://opensource.org/licenses/MIT |
| 12 | // | 12 | // |
| 13 | // Unless agreed to in writing, the subject software distributed under the License is distributed on an | 13 | // Unless agreed to in writing, the subject software distributed under the License is distributed on an |
| 14 | // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the | 14 | // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the |
| @@ -40,6 +40,7 @@ SubscriptionInfo CreateSubscriptionInfo(); · 25 unmodified lines | |||
| 40 | // Handlers for subscriber callbacks. | 40 | // Handlers for subscriber callbacks. |
| 41 | void Resubscribe(DataSubscriber* source); | 41 | void Resubscribe(DataSubscriber* source); |
| 42 | void ProcessMeasurements(DataSubscriber* source, const vector<MeasurementPtr>& measurements); | 42 | void ProcessMeasurements(DataSubscriber* source, const vector<MeasurementPtr>& measurements); |
| 43 | void ConfigurationChanged(DataSubscriber* source); | ||
| 43 | void DisplayStatusMessage(DataSubscriber* source, const string& message); | 44 | void DisplayStatusMessage(DataSubscriber* source, const string& message); |
| 44 | void DisplayErrorMessage(DataSubscriber* source, const string& message); | 45 | void DisplayErrorMessage(DataSubscriber* source, const string& message); |
| 45 | 46 | ||
| @@ -101,6 +102,7 @@ void RunSubscriber(const string& hostname, uint16_t port) · 55 unmodified lines | |||
| 101 | Subscriber->RegisterStatusMessageCallback(&DisplayStatusMessage); | 102 | Subscriber->RegisterStatusMessageCallback(&DisplayStatusMessage); |
| 102 | Subscriber->RegisterErrorMessageCallback(&DisplayErrorMessage); | 103 | Subscriber->RegisterErrorMessageCallback(&DisplayErrorMessage); |
| 103 | Subscriber->RegisterNewMeasurementsCallback(&ProcessMeasurements); | 104 | Subscriber->RegisterNewMeasurementsCallback(&ProcessMeasurements); |
| 105 | Subscriber->RegisterConfigurationChangedCallback(&ConfigurationChanged); | ||
| 104 | 106 | ||
| 105 | cout << endl << "Connecting to " << hostname << ":" << port << "..." << endl << endl; | 107 | cout << endl << "Connecting to " << hostname << ":" << port << "..." << endl << endl; |
| 106 | 108 | ||
| @@ -247,6 +249,12 @@ void Resubscribe(DataSubscriber* source) · 140 unmodified lines | |||
| 247 | } | 249 | } |
| 248 | } | 250 | } |
| 249 | 251 | ||
| 252 | void ConfigurationChanged(DataSubscriber* source) | ||
| 253 | { | ||
| 254 | // Resubscribe since new metadata is available - filter expression will be reapplied... | ||
| 255 | Subscriber->Subscribe(); | ||
| 256 | } | ||
| 257 | |||
| 250 | // Callback which is called to display status messages from the subscriber. | 258 | // Callback which is called to display status messages from the subscriber. |
| 251 | void DisplayStatusMessage(DataSubscriber* source, const string& message) | 259 | void DisplayStatusMessage(DataSubscriber* source, const string& message) |
| 252 | { | 260 | { |