Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/TemporalSubscriber.cpp (1 of 4 files). Show all
Unified · Split
| @@ -28,8 +28,7 @@ using namespace GSF; · 27 unmodified lines | ||
| 28 | 28 | using namespace GSF::Data; |
| 29 | 29 | using namespace GSF::TimeSeries; |
| 30 | 30 | |
| 31 | −GSF::Data::DataSetPtr TemporalSubscriber::s_historyDataSet = nullptr; | |
| 32 | −GSF::Data::DataTablePtr TemporalSubscriber::s_history = nullptr; | |
| 31 | +GSF::Data::DataSetPtr TemporalSubscriber::s_history = nullptr; | |
| 33 | 32 | |
| 34 | 33 | TemporalSubscriber::TemporalSubscriber(SubscriberConnectionPtr connection) : |
| 35 | 34 | m_connection(std::move(connection)), |
| @@ -39,13 +38,10 @@ TemporalSubscriber::TemporalSubscriber(SubscriberConnectionPtr connection) : · 3 unmodified lines | ||
| 39 | 38 | m_currentRow(0), |
| 40 | 39 | m_stopped(false) |
| 41 | 40 | { |
| 42 | − if (s_historyDataSet == nullptr) | |
| 43 | − { | |
| 44 | − s_historyDataSet = DataSet::FromXml("History.xml"); | |
| 45 | − s_history = DataSet::FromXml("History.xml")->Table("History"); | |
| 46 | − } | |
| 41 | + if (s_history == nullptr) | |
| 42 | + s_history = DataSet::FromXml("History.xml"); | |
| 47 | 43 | |
| 48 | − m_lastRow = s_history->RowCount() - 1; | |
| 44 | + m_lastRow = s_history->Table("History")->RowCount() - 1; | |
| 49 | 45 | |
| 50 | 46 | if (m_lastRow < 0) |
| 51 | 47 | throw runtime_error("No history available - run with \"GenHistory\" argument."); |
| @@ -73,8 +69,8 @@ void TemporalSubscriber::SendTemporalData() · 21 unmodified lines | ||
| 73 | 69 | { |
| 74 | 70 | if (m_stopped) |
| 75 | 71 | return; |
| 76 | − | |
| 77 | − static DataTable& history = *s_history; | |
| 72 | + | |
| 73 | + static DataTable& history = *s_history->Table("History"); | |
| 78 | 74 | static const int32_t signalIDColumn = history["SignalID"]->Index(); |
| 79 | 75 | static const int32_t timestampColumn = history["Timestamp"]->Index(); |
| 80 | 76 | static const int32_t valueColumn = history["Value"]->Index(); |