Example #1
0
    private void PlotAreaData()
    {
        currAreaInspectionIndex = inspectorTool.areaInspectorPanel.areaInspector.CurrAreaInspection;

        if (currAreaInspectionIndex == -1)
        {
            return;
        }

        AreaPS currPS = areaPS[currAreaInspectionIndex];

        foreach (var inspectorOutputItem in areaDO.itemslist)
        {
            InspectorOutputItemLabel inspectorOutputItemLabel = null;
            string itemName = inspectorOutputItem.name;

            if (areaDO.inspectorOutputItemLabels.ContainsKey(itemName))
            {
                inspectorOutputItemLabel = areaDO.inspectorOutputItemLabels[itemName];
            }
            else
            {
                inspectorOutputItemLabel = Instantiate(itemPrefab, areaPSUIRef.container, false);

                inspectorOutputItemLabel.name = itemName;
                inspectorOutputItemLabel.SetName(itemName);
                inspectorOutputItemLabel.SetUnitsValue(inspectorOutputItem.units);
                inspectorOutputItemLabel.SetDotColor(inspectorOutputItem.dotColor);

                areaDO.inspectorOutputItemLabels.Add(itemName, inspectorOutputItemLabel);
            }

            float max    = inspectorOutputItem.maxVal,
                  min    = inspectorOutputItem.minVal,
                  median = inspectorOutputItem.medianVal,
                  mean   = inspectorOutputItem.meanVal,
                  sum    = inspectorOutputItem.sumVal;

            inspectorOutputItemLabel.SetMaxValue(max.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMedianValue(median.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMinValue(min.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMeanValue(mean.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetSumValue(sum.ToString("#,##0.##"));

            PS.AddOrUpdateMetric(currPS.maxVal, itemName, max);
            PS.AddOrUpdateMetric(currPS.minVal, itemName, min);
            PS.AddOrUpdateMetric(currPS.medianVal, itemName, median);
            PS.AddOrUpdateMetric(currPS.meanVal, itemName, mean);
            PS.AddOrUpdateMetric(currPS.sumVal, itemName, sum);
        }
    }
Example #2
0
    public void AllCombinedMetrics(PropertiesAndSummaries[] ps)
    {
        foreach (var inspectorOutputItem in itemslist)
        {
            string itemName = inspectorOutputItem.name;
            InspectorOutputItemLabel inspectorOutputItemLabel = inspectorOutputItemLabels[itemName];

            List <float> allMaxVals    = new List <float>();
            List <float> allMinVals    = new List <float>();
            List <float> allMedianVals = new List <float>();
            List <float> allMeanVals   = new List <float>();
            List <float> allSumVals    = new List <float>();

            foreach (var propertyAndSummary in ps)
            {
                if (propertyAndSummary.maxVal.TryGetValue(itemName, out float maxVal))
                {
                    allMaxVals.Add(maxVal);
                }
                if (propertyAndSummary.minVal.TryGetValue(itemName, out float minVal))
                {
                    allMinVals.Add(minVal);
                }
                if (propertyAndSummary.medianVal.TryGetValue(itemName, out float medianVal))
                {
                    allMedianVals.Add(medianVal);
                }
                if (propertyAndSummary.meanVal.TryGetValue(itemName, out float meanVal))
                {
                    allMeanVals.Add(meanVal);
                }
                if (propertyAndSummary.sumVal.TryGetValue(itemName, out float sumVal))
                {
                    allSumVals.Add(sumVal);
                }
            }

            float max    = allMaxVals.Max();
            float min    = allMinVals.Min();
            float median = ComputeMedian(allMedianVals);
            float mean   = ComputeMean(allMeanVals);
            float sum    = ComputeSum(allSumVals);

            inspectorOutputItemLabel.SetMaxValue(max.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMedianValue(median.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMinValue(min.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMeanValue(mean.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetSumValue(sum.ToString("#,##0.##"));
        }
    }
Example #3
0
    public void SelectedMetrics(PropertiesAndSummaries currPS)
    {
        if (itemslist == null)
        {
            return;
        }

        foreach (var inspectorOutputItem in itemslist)
        {
            string itemName = inspectorOutputItem.name;
            InspectorOutputItemLabel inspectorOutputItemLabel = inspectorOutputItemLabels[itemName];

            inspectorOutputItemLabel.SetMaxValue(currPS.maxVal[itemName].ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMedianValue(currPS.medianVal[itemName].ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMinValue(currPS.minVal[itemName].ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMeanValue(currPS.meanVal[itemName].ToString("#,##0.##"));
            inspectorOutputItemLabel.SetSumValue(currPS.sumVal[itemName].ToString("#,##0.##"));
        }
    }
Example #4
0
    private void PlotContourData()
    {
        foreach (var inspectorOutputItem in contourDO.itemslist)
        {
            InspectorOutputItemLabel inspectorOutputItemLabel = null;
            string itemName = inspectorOutputItem.name;

            if (contourDO.inspectorOutputItemLabels.ContainsKey(itemName))
            {
                inspectorOutputItemLabel = contourDO.inspectorOutputItemLabels[itemName];
            }
            else
            {
                inspectorOutputItemLabel = Instantiate(itemPrefab, contourPSUIRef.container, false);

                inspectorOutputItemLabel.name = itemName;
                inspectorOutputItemLabel.SetName(itemName);
                inspectorOutputItemLabel.SetUnitsValue(inspectorOutputItem.units);
                inspectorOutputItemLabel.SetDotColor(inspectorOutputItem.dotColor);

                contourDO.inspectorOutputItemLabels.Add(itemName, inspectorOutputItemLabel);
            }

            float max    = inspectorOutputItem.maxVal,
                  min    = inspectorOutputItem.minVal,
                  mean   = inspectorOutputItem.meanVal,
                  median = inspectorOutputItem.medianVal,
                  sum    = inspectorOutputItem.sumVal;

            inspectorOutputItemLabel.SetMaxValue(max.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMeanValue(mean.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMedianValue(median.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetMinValue(min.ToString("#,##0.##"));
            inspectorOutputItemLabel.SetSumValue(sum.ToString("#,##0.##"));

            PS.AddOrUpdateMetric(contourPS.maxVal, itemName, max);
            PS.AddOrUpdateMetric(contourPS.minVal, itemName, min);
            PS.AddOrUpdateMetric(contourPS.meanVal, itemName, mean);
            PS.AddOrUpdateMetric(contourPS.medianVal, itemName, median);
            PS.AddOrUpdateMetric(contourPS.sumVal, itemName, sum);
        }
    }