Example #1
0
        private async Task <ArrayAnalysisResult> GetListAnalysis(Guid jobId, string analyserId,
                                                                 string[] analysisProperties, int resultSize, int page)
        {
            if (analysisProperties.Length < 2)
            {
                throw new GetAnalysisException(analyserId, "", "List analysis request requires at least two analysis properties");
            }

            var xAxisProperty = new AnalysisRequestProperty
            {
                AnalysisPropertyName = analysisProperties[0],
                AnalysisPropertyType = await GetAnalyserPropertyResultValue(analyserId, analysisProperties[0])
            };

            var analyses = new List <ArrayAnalysisResult>();

            for (var i = 1; i < analysisProperties.Length; ++i)
            {
                var currentAnalysisProperties = new List <AnalysisRequestProperty>
                {
                    xAxisProperty,
                    new AnalysisRequestProperty
                    {
                        AnalysisPropertyName = analysisProperties[i],
                        AnalysisPropertyType = await GetAnalyserPropertyResultValue(analyserId, analysisProperties[i])
                    }
                };

                var request = new GetArrayAnalysisStorageRequest
                {
                    JobId              = jobId,
                    Type               = AnalysisType.List,
                    ResultType         = AnalysisResultType.List,
                    ComponentId        = analyserId,
                    AnalysisProperties = currentAnalysisProperties,
                    ResultSize         = resultSize,
                    ResultPage         = page
                };

                var analysis = await _storageService.GetAnalysisArray(request);

                analyses.Add(analysis);
            }

            return(MergeAnalyses(analyses));
        }
Example #2
0
        private async Task <ArrayAnalysisResult> GetListWithTimeAnalysis(Guid jobId, string analyserId,
                                                                         string[] analysisProperties, int resultSize, int page)
        {
            if (analysisProperties.Length < 1)
            {
                throw new GetAnalysisException(analyserId, "", "List with time analysis request requires at least one analysis property");
            }

            var analyses = new List <TimeArrayAnalysisResult>();

            foreach (var analysisProperty in analysisProperties)
            {
                var analysisPropertyRequest = new AnalysisRequestProperty
                {
                    AnalysisPropertyName = analysisProperty,
                    AnalysisPropertyType = await GetAnalyserPropertyResultValue(analyserId, analysisProperty)
                };

                var arrayAnalysisStorageRequest = new GetArrayAnalysisStorageRequest
                {
                    JobId              = jobId,
                    Type               = AnalysisType.List,
                    ResultType         = AnalysisResultType.ListWithTime,
                    ComponentId        = analyserId,
                    AnalysisProperties = new List <AnalysisRequestProperty> {
                        analysisPropertyRequest
                    },
                    ResultSize = resultSize,
                    ResultPage = page
                };

                var analysis = await _storageService.GetAnalysisTimeArray(arrayAnalysisStorageRequest);

                analyses.Add(analysis);
            }

            return(MergeTimeAnalyses(analyses));
        }
Example #3
0
 public async Task <TimeArrayAnalysisResult> GetAnalysisTimeArray(GetArrayAnalysisStorageRequest getAnalysisRequest)
 {
     return(await _httpService.Post <TimeArrayAnalysisResult>($"results", getAnalysisRequest));
 }