public static int GetNumberOfHistoricalPointsAvailable(string urlPrefix, string locationIdentifier, int httpRepeatCallLimit, int httpCallTimeoutInSeconds)
        {
            string path   = urlPrefix;
            string answer = "";

            try
            {
                path += System.Net.WebUtility.UrlEncode(locationIdentifier);
                path += "&startindex=0&limit=1";

                answer = CallHttpClient(path, httpRepeatCallLimit, httpCallTimeoutInSeconds);

                if (!string.IsNullOrEmpty(answer))
                {
                    dynamic dynData        = JsonConvert.DeserializeObject(answer);
                    int     numberOfPoints = dynData.numberMatched;
                    Log.InfoFormat("GetNumberOfHistoricalPointsAvailable: Found '{0}' historical points for location '{1}' from Url '{2}'", numberOfPoints, locationIdentifier, path);
                    return(numberOfPoints);
                }
            }
            catch (Exception ex)
            {
                Log.Error("Exception in call to GetNumberOfHistoricalPointsAvailable " + Environment.NewLine, ex);
            }

            Log.InfoFormat("Fail to retrieve number of Historical points from Url '{0}', http call returned '{1}', so return number of Historical = -1", path, answer);
            return(-1);
        }
예제 #2
0
        public virtual DataSet GenerateDataSet(RunFileReportRequest request)
        {
            Assembly.Load("PerpetuumSoft.Reporting.MSChart");

            string          location        = System.IO.Path.GetDirectoryName(_Assembly.Location);
            string          name            = System.IO.Path.GetFileNameWithoutExtension(_Assembly.Location);
            FileVersionInfo fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);

            Log.InfoFormat("Report plugin folder = {0}, plugin name = {1}, plugin version = {2}", location, name, fileVersionInfo.ProductVersion);

            System.Data.DataSet reportTables = (new Common(request)).GetCommonDataSet(name, location);

            AddReportSpecificTables(reportTables);
            return(reportTables);
        }