Пример #1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     this.app.AppDocument.MatPropertyInfo.MassFactor   = CAstraUnits.GetFact(cmbMassUnit.Text);
     this.app.AppDocument.MatPropertyInfo.LengthFactor = CAstraUnits.GetFact(cmbLengthUnit.Text);
     MatInfo.Clear();
     ElData.Clear();
     ElMult.Clear();
     this.Close();
 }
Пример #2
0
        private void btnFinish_Click(object sender, EventArgs e)
        {
            //EMassUnits EME = EMassUnits.KN;
            //EMassUnits EME = (EMassUnits)cmbMassUnit.SelectedIndex;
            //MessageBox.Show((int)EME + EME.ToString());

            //ELengthUnits EMES = (ELengthUnits)cmbLengthUnits.SelectedIndex;
            //MessageBox.Show((int)EMES + EMES.ToString());
            iApp.AppDocument.MemberBeamLoad.MassUnit   = (EMassUnits)cmbMassUnit.SelectedIndex;
            iApp.AppDocument.MemberBeamLoad.LengthUnit = (eLengthUnits)cmbLengthUnits.SelectedIndex;



            iApp.AppDocument.MemberBeamLoad.LengthFactor = CAstraUnits.GetFact(cmbLengthUnits.Text);
            iApp.AppDocument.MemberBeamLoad.MassFactor   = CAstraUnits.GetFact(cmbMassUnit.Text);
            this.Close();
        }
Пример #3
0
        private void SetUnit()
        {
            if ((this.app.AppDocument.wunit_flag == 0 && this.app.AppDocument.lunit_flag == 0) ||
                ((this.app.AppDocument.MUnit == cmbMassUnit.Text && this.app.AppDocument.LUnit == cmbLengthUnit.Text)))
            {
                this.app.AppDocument.MUnit = cmbMassUnit.Text;
                this.app.AppDocument.LUnit = cmbLengthUnit.Text;

                short fl = this.app.AppDocument.wunit_flag;
                this.app.AppDocument.WFact      = CAstraUnits.GetMassFact(cmbMassUnit.Text, ref fl);
                this.app.AppDocument.wunit_flag = fl;
                fl = this.app.AppDocument.lunit_flag;
                this.app.AppDocument.LFact      = CAstraUnits.GetLengthFact(cmbLengthUnit.Text, ref fl);
                this.app.AppDocument.lunit_flag = fl;

                this.app.AppDocument.NodeData.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.NodeData.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.MatPropertyInfo.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.MatPropertyInfo.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.AreaLoad.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.AreaLoad.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.JointNodalLoad.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.JointNodalLoad.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.MemberBeamLoad.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.MemberBeamLoad.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.MaterialProperty.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.MaterialProperty.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.SectionProperty.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.SectionProperty.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);

                this.app.AppDocument.BeamConnectivity.LengthFactor = CAstraUnits.GetFact(this.app.AppDocument.LUnit);
                this.app.AppDocument.BeamConnectivity.MassFactor   = CAstraUnits.GetFact(this.app.AppDocument.MUnit);
            }
            else if (!(this.app.AppDocument.MUnit == cmbMassUnit.Text && this.app.AppDocument.LUnit == cmbLengthUnit.Text))
            {
                MessageBox.Show(this, "You can't change the unit, unit has already taken.\n" +
                                "\n       Length Unit = " + this.app.AppDocument.LUnit + ", Mass Unit = " + this.app.AppDocument.MUnit, "ASTRA pro", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }