Exemplo n.º 1
0
        private bool EnsurePrm()
        {
            if (isexist == false)
            {
                MessageBox.Show("数据错误!", "警告");
                return(false);
            }
            else
            {
                //Empty boxes are set zero
                GeneralFuc.SetEmptyTextBox(this);
                //UI convert to class
                try
                {
                    wedge.date              = mstxtDate.Text;
                    wedge.name              = cmbName.Text;
                    wedge.type              = txtType.Text;
                    wedge.drawingPartNum    = txtDrawNum.Text;
                    wedge.sn                = txtSequenceNum.Text;
                    wedge.manu              = txtManufacturer.Text;
                    wedge.length            = double.Parse(txtLXH.Text);
                    wedge.width             = double.Parse(txtLXW.Text);
                    wedge.height            = double.Parse(txtLXH.Text);
                    wedge.headLen           = double.Parse(txtLDW.Text);
                    wedge.incidentAngle     = double.Parse(txtAngle.Text);
                    wedge.longVeloc         = double.Parse(txtLongVeloc.Text);
                    wedge.transVeloc        = double.Parse(txtTransVeloc.Text);
                    wedge.operTempMin       = double.Parse(txtOperTempMin.Text);
                    wedge.operTempMax       = double.Parse(txtOperTempMax.Text);
                    wedge.storeTemprMin     = double.Parse(txtStoreTemperMin.Text);
                    wedge.storeTemprMax     = double.Parse(txtStoreTemperMax.Text);
                    positions.probePosition = double.Parse(txtProbePos.Text);
                    positions.wedgePosition = double.Parse(txtWedgePos.Text);

                    //if (e != null)
                    //{
                    //    MessageBox.Show("data conversion success");
                    //}
                }
                catch (Exception ex)
                {
                    MessageBox.Show("数据转化失败!", "警告");
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        private bool EnsurePara()
        {
            if (isexist == false)
            {
                MessageBox.Show("数据错误!", "警告");
                return(false);
            }
            else if (cobGrooveKind.SelectedItem == null)
            {
                MessageBox.Show("未设置坡口参数");
                return(false);
            }
            else
            {
                //Empty boxes are set zero
                GeneralFuc.SetEmptyTextBox(this);
                //UI convert to class
                try
                {
                    //tab1
                    product.name = cmbProductName.Text;

                    product.length    = double.Parse(txtLength.Text);
                    product.outsize   = double.Parse(txtOutsize.Text);
                    product.thickness = double.Parse(txtThickness.Text);

                    product.weldingMaterial = txtMaterial.Text;


                    //groove
                    product.groove.ClearList();
                    product.groove.sn         = txtGrooveSn.Text;
                    product.groove.longVeloc  = double.Parse(txtLongitudinal.Text);
                    product.groove.transVeloc = double.Parse(txtTransverse.Text);

                    //
                    if (tabGrooveKindPrm.SelectedTab == PageVgroove)
                    {
                        product.groove.type     = GrooveType.V;
                        product.groove.distance = double.Parse(txtVGroove_d.Text);
                        product.groove.height.Add(double.Parse(txtVGroove_h0.Text));
                        product.groove.height.Add(double.Parse(txtVGroove_h1.Text));
                        product.groove.angle.Add(double.Parse(txtVGroove_a0.Text));
                    }
                    else if (tabGrooveKindPrm.SelectedTab == PageXgroove)
                    {
                        product.groove.type = GrooveType.X;
                        //product.groove.distance = double.Parse(txtXGroove_d.Text);
                        product.groove.height.Add(double.Parse(txtXGroove_h0.Text));
                        product.groove.height.Add(double.Parse(txtXGroove_h1.Text));
                        product.groove.angle.Add(double.Parse(txtXGroove_a0.Text));
                    }
                    else if (tabGrooveKindPrm.SelectedTab == PageCRCgroove)
                    {
                        product.groove.type = GrooveType.CRC;
                        //product.groove.distance = double.Parse(txtCRCGroove_d.Text);
                        product.groove.height.Add(double.Parse(txtCRCGroove_h0.Text));
                        product.groove.height.Add(double.Parse(txtCRCGroove_h1.Text));
                        product.groove.height.Add(double.Parse(txtCRCGroove_h2.Text));
                        product.groove.height.Add(double.Parse(txtCRCGroove_h3.Text));
                        product.groove.angle.Add(double.Parse(txtCRCGroove_a0.Text));
                        product.groove.angle.Add(double.Parse(txtCRCGroove_a1.Text));
                        product.groove.angle.Add(double.Parse(txtCRCGroove_a2.Text));
                    }
                    else
                    {
                        MessageBox.Show("坡口参数转化失败 ", "错误");
                    }

                    //tab3
                    product.sample.name     = txtSampleName.Text;
                    product.sample.factory  = txtFactory.Text;
                    product.sample.date     = maskedtxtDate.Text;
                    product.sample.drawing  = txtDrawing.Text;
                    product.sample.sn       = txtSampleSn.Text;
                    product.sample.material = txtSampleMat.Text;
                    product.sample.standard = txtSampleStad.Text;
                    product.sample.groType  = (GrooveType)cmbSampleGroType.SelectedIndex;

                    product.sample.defects = new List <Defect>();
                    int row = defectGrid.Rows.Count;
                    for (int i = 0; i < row; i++)
                    {
                        Defect def = new Defect();

                        def.name          = defectGrid.Rows[i].Cells["name"].Value.ToString();
                        def.subregionName = defectGrid.Rows[i].Cells["subregion"].Value.ToString();
                        def.type          = defectGrid.Rows[i].Cells["type"].Value.ToString();
                        double.TryParse(defectGrid.Rows[i].Cells["beginaxil"].Value.ToString(), out def.beginAxial);
                        double.TryParse(defectGrid.Rows[i].Cells["endaxial"].Value.ToString(), out def.endAxial);
                        double.TryParse(defectGrid.Rows[i].Cells["beginradio"].Value.ToString(), out def.beginRadio);
                        double.TryParse(defectGrid.Rows[i].Cells["endradio"].Value.ToString(), out def.endRadio);

                        product.sample.defects.Add(def);
                    }

                    //if (e != null)
                    //{
                    //    MessageBox.Show("data conversion success");
                    //}
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 3
0
        private bool EnsurePrm()
        {
            if (isexist == false)
            {
                MessageBox.Show("数据错误!", "警告");
                return(false);
            }
            else
            {
                //Empty boxes are set zero
                GeneralFuc.SetEmptyTextBox(this);
                //UI convert to class
                try
                {
                    probe.name             = cmbName.Text;
                    probe.type             = combType.SelectedIndex;
                    probe.date             = mstxtDate.Text;
                    probe.sn               = txtSequenceNum.Text;
                    probe.manu             = txtManufacturer.Text;
                    probe.drawingPartNum   = txtDrawingPartNum.Text;
                    probe.color            = txtColor.Text;
                    probe.length           = double.Parse(txtLength.Text);
                    probe.height           = double.Parse(txtHight.Text);
                    probe.width            = double.Parse(txtWidth.Text);
                    probe.connModel        = txtConnModel.Text;
                    probe.cableType        = txtCableType.Text;
                    probe.cableLen         = double.Parse(txtCableLen.Text);
                    probe.cableOuterDia    = double.Parse(txtCableOuterDia.Text);
                    probe.centerFreq       = double.Parse(txtCenterFreq.Text);
                    probe.minBand          = double.Parse(txtMinBand.Text);
                    probe.maxPluseDuration = double.Parse(txtMaxPluDur.Text);
                    probe.eleEdge          = double.Parse(txtEleEdge.Text);
                    probe.eleNum           = uint.Parse(txtEleNum.Text);
                    probe.eleSpace         = double.Parse(txtEleSpace.Text);
                    probe.storeTemprMin    = double.Parse(txtStoreTemprMin.Text);
                    probe.operTempMin      = double.Parse(txtOperTempMin.Text);
                    probe.storeTemprMax    = double.Parse(txtStoreTemperMax.Text);
                    probe.operTempMax      = double.Parse(txtOperTempMax.Text);
                    probe.maxVolt          = double.Parse(txtMaxVolt.Text);
                    probe.maxPrf           = double.Parse(txtMaxPrf.Text);
                    probe.maxContinuePrf   = double.Parse(txtMaxContinuePrf.Text);
                    probe.maxInterCouple   = double.Parse(txtMaxInterCouple.Text);
                    probe.maxHomoSenDiff   = double.Parse(txtMaxHomSenDiff.Text);

                    probe.Zi          = cache_Zi;
                    probe.Zr          = cache_Zr;
                    probe.interCouple = cache_interCouple;

                    //if (e != null)
                    //{
                    //    MessageBox.Show("data conversion success");
                    //}
                }
                catch (Exception ex)
                {
                    MessageBox.Show("数据转化失败!", "警告");
                    return(false);
                }
            }
            return(true);
        }