Skip to content

Commit

Permalink
CalculatedMeasurements
Browse files Browse the repository at this point in the history
  • Loading branch information
collins-self committed Dec 17, 2024
1 parent 44d6753 commit fd42477
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public static IList<int> LoadKeys(AdoDataConnection database, string sortMember
if (!string.IsNullOrEmpty(sortMember))
sortClause = $"ORDER BY {sortMember} {sortDirection}";

DataTable calculatedMeasurementTable = database.Connection.RetrieveData(database.AdapterType, $"SELECT ID From CalculatedMeasurementDetail {sortClause}");
DataTable calculatedMeasurementTable = database.Connection.RetrieveData(database.AdapterType, "SELECT ID From CalculatedMeasurementDetail {0}", sortClause);

foreach (DataRow row in calculatedMeasurementTable.Rows)
{
Expand Down Expand Up @@ -531,12 +531,11 @@ public static ObservableCollection<CalculatedMeasurement> Load(AdoDataConnection
{
commaSeparatedKeys = keys.Select(key => key.ToString()).Aggregate((str1, str2) => $"{str1},{str2}");

query = string.Format("SELECT NodeID, ID, Acronym, Name, AssemblyName, " +
query = database.ParameterizedQueryString("SELECT NodeID, ID, Acronym, Name, AssemblyName, " +
"TypeName, ConnectionString, ConfigSection, InputMeasurements, OutputMeasurements, MinimumMeasurementsToUse, FramesPerSecond, LagTime, " +
"LeadTime, UseLocalClockAsRealTime, AllowSortsByArrival, LoadOrder, Enabled, IgnoreBadTimeStamps, TimeResolution, AllowPreemptivePublishing, " +
"DownSamplingMethod, NodeName, PerformTimeReasonabilityCheck From CalculatedMeasurementDetail WHERE ID IN ({0}) AND NodeID = '{1}'", commaSeparatedKeys, database.CurrentNodeID());

calculatedMeasurementTable = database.Connection.RetrieveData(database.AdapterType, query);
"DownSamplingMethod, NodeName, PerformTimeReasonabilityCheck From CalculatedMeasurementDetail WHERE ID IN ({0}) AND NodeID = '{1}'", "commaSeparatedKeys", "database.CurrentNodeID()");
calculatedMeasurementTable = database.Connection.RetrieveData(database.AdapterType, query, commaSeparatedKeys, database.CurrentNodeID());
calculatedMeasurementList = new CalculatedMeasurement[calculatedMeasurementTable.Rows.Count];

foreach (DataRow row in calculatedMeasurementTable.Rows)
Expand Down

0 comments on commit fd42477

Please sign in to comment.