Ejemplo n.º 1
0
        private void frmMorphResults_Load(object sender, EventArgs e)
        {
            InitializeToolTips();

            cmdOK.Text = Properties.Resources.UpdateButtonText;

            ucDoDPropertiesGrid1.Initialize(Analysis.BS.DoD);
            ucDoDPropertiesGrid1.AddDoDProperty("Budget Segregation", Analysis.BS.Name);
            ucDoDPropertiesGrid1.AddDoDProperty("Directional Mask", Analysis.BS.Mask.Name);
            ucDoDPropertiesGrid1.AddDoDProperty("Directional Mask Field", Analysis.BS.Mask._Field);
            ucDoDPropertiesGrid1.AddDoDProperty("Mask Type", Analysis.BS.Mask.Noun);

            cboBoundaryType.Items.Add(GCDCore.Project.Morphological.MorphologicalAnalysis.FluxDirection.Input);
            cboBoundaryType.Items.Add(GCDCore.Project.Morphological.MorphologicalAnalysis.FluxDirection.Output);
            cboBoundaryType.SelectedIndex = 1;

            cboDuration.DataSource = GCDUnits.GCDDurationUnits();
            GCDUnits.SelectUnit(cboDuration, Analysis.DisplayUnits_Duration);
            valDuration.Value     = (decimal)Analysis.Duration.As(Analysis.DisplayUnits_Duration);
            valPorosity.Value     = Analysis.Porosity;
            valDensity.Value      = Analysis.Density;
            valBoundaryFlux.Value = (decimal)Analysis.BoundaryFlux.As(ProjectManager.Project.Units.VolUnit);

            txtName.Text = Analysis.Name;
            txtPath.Text = ProjectManager.Project.GetRelativePath(Analysis.OutputFolder.FullName);

            grdData.AutoGenerateColumns = false;
            grdData.DataSource          = Analysis.Units;

            cboBoundaryUnits.SelectedIndexChanged += BoundaryUnitsChanged;
            foreach (UnitsNet.Units.VolumeUnit val in Enum.GetValues(typeof(UnitsNet.Units.VolumeUnit)))
            {
                int i = cboBoundaryUnits.Items.Add(new GCDUnits.FormattedUnit <UnitsNet.Units.VolumeUnit>(val));
                if (val == ProjectManager.Project.Units.VolUnit)
                {
                    cboBoundaryUnits.SelectedIndex = i;
                }
            }

            cboDuration.SelectedIndexChanged += cboDuration_SelectedIndexChanged;
            valDuration.ValueChanged         += valDuration_ValueChanged;
            UpdateCriticalDuration();

            cboBoundaryUnit.DataSource   = new BindingList <GCDCore.Project.Morphological.MorphologicalUnit>(Analysis.Units.Where(x => !x.IsTotal).ToList());
            cboBoundaryUnit.SelectedItem = Analysis.BoundaryFluxUnit;

            valPorosity.ValueChanged += PorosityChanged;

            // Make the grid the default control
            grdData.Select();

            valBoundaryFlux.ValueChanged         += MinFlux_Changed;
            cboBoundaryUnit.SelectedIndexChanged += MinFlux_Changed;
            cboBoundaryType.SelectedIndexChanged += MinFlux_Changed;
            //UpdateFormulae();

            UnitsChanged(null, null);
            cmdReset_Click(null, null);
        }
Ejemplo n.º 2
0
        private void frmMorphologicalUnits_Load(object sender, EventArgs e)
        {
            tTip.SetToolTip(cboVolume, "Display volume units used for tables and charts. Does not affect the underlying units of the data stored in the project.");
            tTip.SetToolTip(cboMass, "Display units of mass used for tables and charts. Does not affect the underlying units of the data stored in the project.");
            tTip.SetToolTip(cboDuration, "Display duration units used for tables and charts. Does not affect the underlying units of the data stored in the project.");

            cboVolume.DataSource   = GCDUnits.GCDVolumeUnits();
            cboMass.DataSource     = GCDUnits.GCDMassUnits();
            cboDuration.DataSource = GCDUnits.GCDDurationUnits();

            GCDUnits.SelectUnit(cboVolume, VolumeUnit);
            GCDUnits.SelectUnit(cboMass, MassUnit);
            GCDUnits.SelectUnit(cboDuration, DurationUnit);
        }