Ejemplo n.º 1
0
        public frmDoDResults(DoDBase dodItem)
        {
            InitializeComponent();

            DoD       = dodItem;
            m_Options = new DoDSummaryDisplayOptions(ProjectManager.Project.Units);
            ucProperties.Initialize(DoD);

            cmsChart = new UtilityForms.ChartContextMenu(DoD.Folder, "change_detection");

            // Select the tab control to make it easy for user to quickly pan results
            tabProperties.Select();
        }
Ejemplo n.º 2
0
        public frmBudgetSegResults(GCDCore.Project.BudgetSegregation BS)
        {
            // This call is required by the designer.
            InitializeComponent();

            BudgetSeg = BS;

            System.Drawing.Bitmap formImage = BudgetSeg.IsMaskDirectional ? Properties.Resources.DirectionalBudgetSeg : Properties.Resources.BudgetSeg;
            Icon = System.Drawing.Icon.FromHandle(formImage.GetHicon());

            ucProperties.Initialize(BudgetSeg.DoD);
            m_Options = new DoDSummaryDisplayOptions(ProjectManager.Project.Units);

            PieChartViewer = new Visualization.BudgetSegPieChartViewer(BudgetSeg.FilteredClasses.ToList(), chtPieCharts);
            cmsChart       = new UtilityForms.ChartContextMenu(BudgetSeg.Folder, "budget_seg");
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="units"></param>
        /// <param name="volUnit"></param>
        /// <remarks>remember to filter out morphological totals</remarks>
        public void UpdateChart(System.IO.DirectoryInfo outputDir, IEnumerable <GCDCore.Project.Morphological.IBudgetGraphicalResults> units, UnitsNet.Units.VolumeUnit volUnit, bool bBudgetSeg, bool directional)
        {
            cmsChart = new UtilityForms.ChartContextMenu(outputDir, "morphological");
            chtData.ContextMenuStrip = cmsChart.CMS;

            // Update the Y axis volume units
            chtData.ChartAreas.ToList <ChartArea>().ForEach(x => x.AxisY.Title = string.Format("Volume ({0})", Volume.GetAbbreviation(volUnit)));

            // Clear all series data points
            chtData.Series.ToList <Series>().ForEach(x => x.Points.Clear());

            // Hide the second chart area if this is a non-directional budget seg
            chtData.ChartAreas[1].Visible = !bBudgetSeg || (bBudgetSeg && directional);

            CustomLabelsCollection xAxisLabels = chtData.ChartAreas[0].AxisX.CustomLabels;
            double maxY      = 0;
            double cumVolume = 0;

            foreach (GCDCore.Project.Morphological.IBudgetGraphicalResults unit in units)
            {
                double labelStart = chtData.Series[EROSION_CHART_SERIES].Points.Count;
                double labelEnd   = labelStart + 3;
                xAxisLabels.Add(new CustomLabel(labelStart, labelEnd, unit.Name, 0, LabelMarkStyle.Box));

                chtData.Series[EROSION_CHART_SERIES].Points.AddY(unit.VolErosion.As(volUnit));
                chtData.Series[EROSION_CHART_SERIES].Points.AddY(0);
                chtData.Series[EROSION_CHART_SERIES].Points.AddY(0);

                chtData.Series[DEPOSIT_CHART_SERIES].Points.AddY(0);
                chtData.Series[DEPOSIT_CHART_SERIES].Points.AddY(unit.VolDeposition.As(volUnit));
                chtData.Series[DEPOSIT_CHART_SERIES].Points.AddY(0);

                chtData.Series[ERROR___CHART_SERIES].Points.AddY(new object[] { unit.VolErosion.As(volUnit), (unit.VolErosion - unit.VolErosionErr).As(volUnit), (unit.VolErosion + unit.VolErosionErr).As(volUnit) });
                chtData.Series[ERROR___CHART_SERIES].Points.AddY(new object[] { unit.VolDeposition.As(volUnit), (unit.VolDeposition - unit.VolDepositionErr).As(volUnit), (unit.VolDeposition + unit.VolDepositionErr).As(volUnit) });
                chtData.Series[ERROR___CHART_SERIES].Points.AddY(new object[] { 0, 0, 0 });

                maxY = Math.Max(maxY, (unit.VolErosion + unit.VolErosionErr).As(volUnit));
                maxY = Math.Max(maxY, (unit.VolDeposition + unit.VolDepositionErr).As(volUnit));

                cumVolume += unit.VolDeposition.As(volUnit) - unit.VolErosion.As(volUnit);

                if (!bBudgetSeg)
                {
                    chtData.Series[VOLOUT__CHART_SERIES].Points.AddXY(unit.Name, unit.SecondGraphValue.As(volUnit));
                }
                else
                {
                    cumVolume += unit.VolDeposition.As(volUnit) - unit.VolErosion.As(volUnit);
                    chtData.Series[VOLOUT__CHART_SERIES].Points.AddXY(unit.Name, cumVolume);
                }
            }

            chtData.ChartAreas[0].AxisY.Maximum = Math.Ceiling(maxY);
            chtData.ChartAreas[0].AxisY.RoundAxisValues();

            foreach (int i in new List <int> {
                0, 1
            })
            {
                chtData.ChartAreas[i].AxisX.TitleFont       = Properties.Settings.Default.ChartFont;
                chtData.ChartAreas[i].AxisX.LabelStyle.Font = Properties.Settings.Default.ChartFont;
                chtData.ChartAreas[i].AxisY.TitleFont       = Properties.Settings.Default.ChartFont;
                chtData.ChartAreas[i].AxisY.LabelStyle.Font = Properties.Settings.Default.ChartFont;
            }
            chtData.Legends[0].Font = Properties.Settings.Default.ChartFont;

            // The data displayed on the second chart depends if this is being used for Morphological or Bs
            chtData.Series[VOLOUT__CHART_SERIES].LegendText        = !bBudgetSeg ? "Volume Out" : "Cumulative Volume Change";
            chtData.Series[VOLOUT__CHART_SERIES].IsVisibleInLegend = !bBudgetSeg || directional;
        }