public static string BuildTimeSeriesUrl(ProjectViewRow row, RecordableItem key, int runNumber) #endif { string networkElementSuffix = ""; if (row.NetworkElementTypeInstance == ProjectViewRow.NetworkElementType.Catchment) { networkElementSuffix = UriTemplates.NETWORK_ELEMENT_FU_DELIMITER + row.WaterFeatureType; } return(string.Format(UriTemplates.TimeSeries.Replace("{runId}", "{0}").Replace("{networkElement}", "{1}").Replace("{recordingElement}", "{2}").Replace("{variable}", "{3}"), runNumber, SourceService.URLSafeString(row.NetworkElementName + networkElementSuffix), SourceService.URLSafeString(row.ElementName), SourceService.URLSafeString(SelectRecordingVariable(key, row)))); }
private static bool MatchesElements(ProjectViewRow row, string networkElement, string recordingElement) { string functionalUnit; bool haveFU = UriTemplates.TryExtractFunctionalUnit(networkElement, out networkElement, out functionalUnit); bool matchesNetworkElement = (networkElement == UriTemplates.MatchAll) || (URLSafeString(row.NetworkElementName) == URLSafeString(networkElement)); bool satisfiesFU = !haveFU || (URLSafeString(row.WaterFeatureType) == URLSafeString(functionalUnit)); bool matchesRecordingElement = (recordingElement == UriTemplates.MatchAll) || (URLSafeString(row.ElementName) == URLSafeString(recordingElement)); return(matchesNetworkElement && matchesRecordingElement && satisfiesFU); }
public static TimeSeriesLink BuildLink(TimeSeries ts, ProjectViewRow row, AttributeRecordingState key, int runNumber) { return new TimeSeriesLink { TimeSeriesName = ts.name, RunNumber = runNumber, TimeSeriesUrl = BuildTimeSeriesUrl(row,key, runNumber), NetworkElement = row.NetworkElementName, RecordingElement = row.ElementName, RecordingVariable = SelectRecordingVariable(key, row) }; }
private TimeSeriesLink[] BuildResultsArray(ProjectViewRow[] rows) { List<TimeSeriesLink> result = new List<TimeSeriesLink>(); foreach (ProjectViewRow row in rows) { Dictionary<AttributeRecordingState, TimeSeries> rowResults = row.ElementRecorder.GetResultList(); foreach (var key in rowResults.Keys) { TimeSeries ts = rowResults[key]; if(ts != null) result.Add(BuildLink(ts, row, key, Number)); } } return result.ToArray(); }
private bool MatchesVariable(ProjectViewRow row, KeyValuePair <RecordableItem, TimeSeries> er, string variable) #endif { if (variable == UriTemplates.MatchAll) { return(true); } #if BEFORE_RECORDING_ATTRIBUTES_REFACTOR return((URLSafeString(er.Key.KeyString) == URLSafeString(variable)) || ((er.Key.KeyString == "") && (row.ElementName == variable))); #else var recordableItemDisplayName = RecordableItemTransitionUtil.GetLegacyKeyString(er.Key); return((URLSafeString(recordableItemDisplayName) == URLSafeString(variable)) || ((recordableItemDisplayName == "") && (row.ElementName == variable))); #endif }
public static TimeSeriesLink BuildLink(TimeSeries ts, ProjectViewRow row, RecordableItem key, int runNumber) #endif { var result = new TimeSeriesLink { TimeSeriesName = ts.name, RunNumber = runNumber, TimeSeriesUrl = BuildTimeSeriesUrl(row, key, runNumber), NetworkElement = row.NetworkElementName, RecordingElement = row.ElementName, RecordingVariable = SelectRecordingVariable(key, row) }; if (row.NetworkElementTypeInstance == ProjectViewRow.NetworkElementType.Catchment) { result.FunctionalUnit = row.WaterFeatureType; } return(result); }
private bool MatchesVariable(ProjectViewRow row, KeyValuePair <AttributeRecordingState, TimeSeries> er, string variable)
private static bool MatchesElements(ProjectViewRow row, string networkElement, string recordingElement) { bool matchesNetworkElement = (networkElement == UriTemplates.MatchAll) || (URLSafeString(row.NetworkElementName) == URLSafeString(networkElement)); bool matchesRecordingElement = (recordingElement == UriTemplates.MatchAll) || (URLSafeString(row.ElementName) == URLSafeString(recordingElement)); return matchesNetworkElement && matchesRecordingElement; }
private bool MatchesVariable(ProjectViewRow row, KeyValuePair<AttributeRecordingState, TimeSeries> er, string variable) { if(variable == UriTemplates.MatchAll) return true; return (URLSafeString(er.Key.KeyString) == URLSafeString(variable)) || ((er.Key.KeyString == "") && (row.ElementName == variable)); }
public static string BuildTimeSeriesUrl(ProjectViewRow row, AttributeRecordingState key, int runNumber) { return string.Format(UriTemplates.TimeSeries.Replace("{runId}", "{0}").Replace("{networkElement}", "{1}").Replace("{recordingElement}","{2}").Replace("{variable}", "{3}"), runNumber, SourceService.URLSafeString(row.NetworkElementName), SourceService.URLSafeString(row.ElementName), SourceService.URLSafeString(SelectRecordingVariable(key,row))); }
private static string SelectRecordingVariable(AttributeRecordingState key, ProjectViewRow row) { return (key.KeyString == "") ? row.ElementName : key.KeyString; }
public static string BuildTimeSeriesUrl(ProjectViewRow row, AttributeRecordingState key, int runNumber)
public static TimeSeriesLink BuildLink(TimeSeries ts, ProjectViewRow row, AttributeRecordingState key, int runNumber)
private static string SelectRecordingVariable(RecordableItem key, ProjectViewRow row) { var recordableItemDisplayString = RecordableItemTransitionUtil.GetLegacyKeyString(key); return((recordableItemDisplayString == "") ? row.ElementName : recordableItemDisplayString); }
private static string SelectRecordingVariable(AttributeRecordingState key, ProjectViewRow row) { return((key.KeyString == "") ? row.ElementName : key.KeyString); }