History

TimeSeriesPlatformLibrary: Cleaned up temporal replay functions of AdvancedSubscribe sample.

J. Ritchie Carroll committed 7 years ago

Commit 7b4ba661 parent a980d724 files · +10 −15Browse files

Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/TemporalSubscriber.cpp (1 of 4 files). Show all

Unified · Split

Source/Libraries/TimeSeriesPlatformLibrary/Samples/TemporalSubscriber.cpp+6−10
@@ -28,8 +28,7 @@ using namespace GSF; · 27 unmodified lines
2828 using namespace GSF::Data;
2929 using namespace GSF::TimeSeries;
3030
31−GSF::Data::DataSetPtr TemporalSubscriber::s_historyDataSet = nullptr;
32−GSF::Data::DataTablePtr TemporalSubscriber::s_history = nullptr;
31+GSF::Data::DataSetPtr TemporalSubscriber::s_history = nullptr;
3332
3433 TemporalSubscriber::TemporalSubscriber(SubscriberConnectionPtr connection) :
3534 m_connection(std::move(connection)),
@@ -39,13 +38,10 @@ TemporalSubscriber::TemporalSubscriber(SubscriberConnectionPtr connection) : · 3 unmodified lines
3938 m_currentRow(0),
4039 m_stopped(false)
4140 {
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");
4743
48− m_lastRow = s_history->RowCount() - 1;
44+ m_lastRow = s_history->Table("History")->RowCount() - 1;
4945
5046 if (m_lastRow < 0)
5147 throw runtime_error("No history available - run with \"GenHistory\" argument.");
@@ -73,8 +69,8 @@ void TemporalSubscriber::SendTemporalData() · 21 unmodified lines
7369 {
7470 if (m_stopped)
7571 return;
76−
77− static DataTable& history = *s_history;
72+
73+ static DataTable& history = *s_history->Table("History");
7874 static const int32_t signalIDColumn = history["SignalID"]->Index();
7975 static const int32_t timestampColumn = history["Timestamp"]->Index();
8076 static const int32_t valueColumn = history["Value"]->Index();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t