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