Esempio n. 1
0
        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))));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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)
     };
 }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 private bool MatchesVariable(ProjectViewRow row, KeyValuePair <AttributeRecordingState, TimeSeries> er, string variable)
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
        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));
        }
Esempio n. 10
0
 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)));
 }
Esempio n. 11
0
 private static string SelectRecordingVariable(AttributeRecordingState key, ProjectViewRow row)
 {
     return (key.KeyString == "") ? row.ElementName : key.KeyString;
 }
Esempio n. 12
0
 public static string BuildTimeSeriesUrl(ProjectViewRow row, AttributeRecordingState key, int runNumber)
Esempio n. 13
0
 public static TimeSeriesLink BuildLink(TimeSeries ts, ProjectViewRow row, AttributeRecordingState key, int runNumber)
Esempio n. 14
0
        private static string SelectRecordingVariable(RecordableItem key, ProjectViewRow row)
        {
            var recordableItemDisplayString = RecordableItemTransitionUtil.GetLegacyKeyString(key);

            return((recordableItemDisplayString == "") ? row.ElementName : recordableItemDisplayString);
        }
Esempio n. 15
0
 private static string SelectRecordingVariable(AttributeRecordingState key, ProjectViewRow row)
 {
     return((key.KeyString == "") ? row.ElementName : key.KeyString);
 }