Skip to content

Commit

Permalink
OutputStreamMeasurements
Browse files Browse the repository at this point in the history
  • Loading branch information
collins-self committed Dec 17, 2024
1 parent 79828de commit 8f53593
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ public static IList<int> LoadKeys(AdoDataConnection database, int outputStreamID

string sortClause = string.Empty;

DataTable outputStreamMeasurementTable;
if (!string.IsNullOrEmpty(sortMember))
sortClause = $"ORDER BY {sortMember} {sortDirection}";

DataTable outputStreamMeasurementTable = database.Connection.RetrieveData(database.AdapterType, $"SELECT ID From OutputStreamMeasurementDetail where AdapterID = {outputStreamID} {sortClause}");
outputStreamMeasurementTable = database.Connection.RetrieveData(database.AdapterType, "SELECT ID From OutputStreamMeasurementDetail where AdapterID = {0} ORDER BY {1} {2}", outputStreamID, sortMember, sortDirection);
else outputStreamMeasurementTable = database.Connection.RetrieveData(database.AdapterType, "SELECT ID From OutputStreamMeasurementDetail where AdapterID = {0}", outputStreamID);

foreach (DataRow row in outputStreamMeasurementTable.Rows)
{
Expand Down Expand Up @@ -261,9 +261,10 @@ public static ObservableCollection<OutputStreamMeasurement> Load(AdoDataConnecti
if (keys is not null && keys.Count > 0)
{
commaSeparatedKeys = keys.Select(key => $"{key}").Aggregate((str1, str2) => $"{str1},{str2}");
query = $"SELECT NodeID, AdapterID, ID, HistorianID, PointID, SignalReference, SourcePointTag, HistorianAcronym FROM OutputStreamMeasurementDetail WHERE ID IN ({commaSeparatedKeys})";

outputStreamMeasurementTable = database.Connection.RetrieveData(database.AdapterType, query, DefaultTimeout);
outputStreamMeasurementTable = database.Connection.RetrieveData(database.AdapterType,
"SELECT NodeID, AdapterID, ID, HistorianID, PointID, SignalReference, SourcePointTag, HistorianAcronym " +
"FROM OutputStreamMeasurementDetail WHERE ID IN ({0})", DefaultTimeout, commaSeparatedKeys);
outputStreamMeasurementList = new OutputStreamMeasurement[outputStreamMeasurementTable.Rows.Count];

foreach (DataRow row in outputStreamMeasurementTable.Rows)
Expand Down

0 comments on commit 8f53593

Please sign in to comment.