Beispiel #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);
        }
        private void cmdReset_Click(object sender, EventArgs e)
        {
            GCDUnits.SelectUnit(cboLinear, ProjectManager.Project.Units.HorizUnit);
            GCDUnits.SelectUnit(cboArea, ProjectManager.Project.Units.ArUnit);
            GCDUnits.SelectUnit(cboVolume, ProjectManager.Project.Units.VolUnit);

            valPrecision.Value         = Options.m_nPrecision;
            rdoRowsAll.Checked         = true;
            chkColsRaw.Checked         = true;
            chkColsThresholded.Checked = true;
            chkColsError.Checked       = true;
            chkColsPercentage.Checked  = true;
        }
        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);
        }
        private void frmDoDSummaryProperties_Load(object sender, System.EventArgs e)
        {
            InitializeToolTips();

            frmFont.Font          = Options.Font;
            frmFont.FontMustExist = true;
            frmFont.ShowHelp      = false;
            frmFont.ShowColor     = false;
            txtFont.Text          = UserInterface.Options.frmOptions.FontString(Options.Font);

            frmColourPicker.SolidColorOnly = true;
            frmColourPicker.ShowHelp       = false;

            cboLinear.DataSource = GCDUnits.GCDLinearUnits();
            cboArea.DataSource   = GCDUnits.GCDAreaUnits();
            cboVolume.DataSource = GCDUnits.GCDVolumeUnits();

            GCDUnits.SelectUnit(cboLinear, Options.LinearUnits);
            GCDUnits.SelectUnit(cboArea, Options.AreaUnits);
            GCDUnits.SelectUnit(cboVolume, Options.VolumeUnits);

            picErosion.BackColor    = ProjectManager.ColorErosion;
            picDeposition.BackColor = ProjectManager.ColorDeposition;

            valPrecision.Value = Options.m_nPrecision;

            // Do the row check boxes first with the specifc box checked so that they are enabled.
            rdoRowsSpecific.Checked = true;
            chkRowsAreal.Checked    = Options.m_bRowsAreal;
            chkVolumetric.Checked   = Options.m_bRowsVolumetric;
            chkVertical.Checked     = Options.m_bRowsVerticalAverages;
            chkPercentages.Checked  = Options.m_bRowsPercentages;

            rdoRowsAll.Checked        = Options.m_eRowGroups == DoDSummaryDisplayOptions.RowGroups.ShowAll;
            rdoRowsNormalized.Checked = Options.m_eRowGroups == DoDSummaryDisplayOptions.RowGroups.Normalized;
            rdoRowsSpecific.Checked   = Options.m_eRowGroups == DoDSummaryDisplayOptions.RowGroups.SpecificGroups;

            UpdateControls();

            chkColsRaw.Checked         = Options.m_bColsRaw;
            chkColsThresholded.Checked = Options.m_bColsThresholded;
            chkColsError.Checked       = Options.m_bColsPMError;
            chkColsPercentage.Checked  = Options.m_bColsPCError;
        }
Beispiel #5
0
        private void frmProjectProperties_Load(System.Object sender, System.EventArgs e)
        {
            grdMetaData.AllowUserToResizeRows   = false;
            grdMetaData.AllowUserToOrderColumns = false;

            SetToolTips();

            cboHorizontalUnits.DataSource = GCDUnits.GCDLinearUnits();
            cboVerticalUnits.DataSource   = GCDUnits.GCDLinearUnits();
            cboAreaUnits.DataSource       = GCDUnits.GCDAreaUnits();
            cboVolumeUnits.DataSource     = GCDUnits.GCDVolumeUnits();

            if (CreateMode)
            {
                this.Text  = "Create New GCD Project";
                btnOK.Text = "   Create";
                btnOK.Text = Properties.Resources.CreateButtonText;

                // Default the directory to the parent folder of the last project used.
                if (!string.IsNullOrEmpty(GCDCore.Properties.Settings.Default.LastUsedProjectFolder))
                {
                    string sDir = Path.GetDirectoryName(GCDCore.Properties.Settings.Default.LastUsedProjectFolder);
                    if (Directory.Exists(sDir))
                    {
                        txtDirectory.Text = sDir;
                    }
                }

                GCDUnits.SelectUnit(cboHorizontalUnits, UnitsNet.Units.LengthUnit.Meter);
                GCDUnits.SelectUnit(cboVerticalUnits, UnitsNet.Units.LengthUnit.Meter);
                GCDUnits.SelectUnit(cboAreaUnits, UnitsNet.Units.AreaUnit.SquareMeter);
                GCDUnits.SelectUnit(cboVolumeUnits, UnitsNet.Units.VolumeUnit.CubicMeter);
            }
            else
            {
                this.Text  = "GCD Project Properties";
                btnOK.Text = Properties.Resources.UpdateButtonText;

                txtName.Text        = ProjectManager.Project.Name;
                txtDirectory.Text   = ProjectManager.Project.ProjectFile.DirectoryName;
                txtGCDPath.Text     = ProjectManager.Project.ProjectFile.FullName;
                txtDescription.Text = ProjectManager.Project.Description;

                GCDUnits.SelectUnit(cboHorizontalUnits, ProjectManager.Project.Units.HorizUnit);
                GCDUnits.SelectUnit(cboVerticalUnits, ProjectManager.Project.Units.VertUnit);
                GCDUnits.SelectUnit(cboAreaUnits, ProjectManager.Project.Units.ArUnit);
                GCDUnits.SelectUnit(cboVolumeUnits, ProjectManager.Project.Units.VolUnit);

                // Only allow the units to be changed if no DEMs have been defined
                int demCount = ProjectManager.Project.DEMSurveys.Count;
                cboHorizontalUnits.Enabled = demCount == 0;
                cboVerticalUnits.Enabled   = demCount == 0;
                cboAreaUnits.Enabled       = demCount == 0;
                cboVolumeUnits.Enabled     = demCount == 0;

                // Copy the project meta into the binding list
                foreach (KeyValuePair <string, string> kvp in ProjectManager.Project.MetaData)
                {
                    MetaData.Add(new ProjectMetaData(kvp.Key, kvp.Value));
                }

                // Adjust the controls to be read/write only for editing
                txtName.ReadOnly      = true;
                txtDirectory.ReadOnly = true;

                // Default focus to the OK button in edit mode
                btnOK.Select();
            }

            // Bind the data grid to the binding list
            grdMetaData.DataSource = MetaData;
        }