Esempio n. 1
0
 private void init()
 {
     tabControl1.Visible  = true;
     cmbName.SelectedItem = null;
     GeneralFuc.ClearTextBox(this);
     mstxtDate.Text = "00000000";
     wedge          = new UltraWedge();
     positions      = new UTPosition();
     openPath       = "";
     savePath       = "";
 }
Esempio n. 2
0
 //initialize interface
 private void InitInterface()
 {
     //clear TextBox
     GeneralFuc.ClearTextBox(this);
     //other
     cmbProductName.SelectedItem = null;
     maskedtxtDate.Text          = "00000000";
     defectGrid.Rows.Clear();
     cmbSampleGroType.SelectedItem = null;
     cobGrooveKind.SelectedItem    = null;
 }
Esempio n. 3
0
        private void init()
        {
            tabControl1.Visible = true;
            GeneralFuc.ClearTextBox(this);
            mstxtDate.Text = "00000000";

            //cmbType.SelectedItem = null;
            cmbName.SelectedItem = null;
            probe = new UltraProbe();
            dataGridView1.Rows.Clear();
            openPath          = "";
            savePath          = "";
            cache_Zr          = new List <double>();
            cache_Zi          = new List <double>();
            cache_interCouple = new List <double>();
            cacheNum          = -1;
        }
Esempio n. 4
0
        private void cmbProductName_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbProductName.SelectedItem != null && isclick)
            {
                if (MessageBox.Show("是否载入参数", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    string path = Application.StartupPath + "\\resources\\product\\" + cmbProductName.SelectedItem.ToString() + ".xml";

                    //clear TextBox
                    GeneralFuc.ClearTextBox(this);
                    maskedtxtDate.Text = "00000000";
                    defectGrid.Rows.Clear();
                    //deserialize
                    product = SystemConfig.DeserializeFromXml(path, product);
                    ClassToUI();
                    openPath = path;

                    isclick = false;
                    int a = cmbProductName.SelectedIndex;
                    if (a < 0)
                    {
                        a = 0;
                    }
                    else
                    {
                        cmbProductName.Items[a] = product.name;
                    }
                }
                else
                {
                    isclick = false;
                    int a = cmbProductName.SelectedIndex;
                    if (a < 0)
                    {
                        a = 0;
                    }
                    else
                    {
                        cmbProductName.Items[a] = product.name;
                    }
                }
            }
        }
Esempio n. 5
0
        private void btnOpenXml_Click(object sender, EventArgs e)
        {
            OpenFileDialog openDialog = new OpenFileDialog();

            openDialog.Title            = "";
            openDialog.InitialDirectory = Application.StartupPath + "\\resources\\probe";
            openDialog.RestoreDirectory = false;
            if (openDialog.ShowDialog() == DialogResult.OK)
            {
                openPath = openDialog.FileName;

                //InitInterface();
                GeneralFuc.ClearTextBox(this);
                dataGridView1.Rows.Clear();
                mstxtDate.Text = "00000000";
                //deserialize
                probe = SystemConfig.DeserializeFromXml(openPath, probe);
                ClassToUI();
            }
        }
Esempio n. 6
0
        public void FormLoad()
        {
            string filename = "probe";
            string filepath = "";

            filepath = SystemConfig.GlobalLoad(filename);

            if (filepath == "")
            {
                MessageBox.Show("探头信息配置失败", "警告");
                return;
            }

            //InitInterface();
            GeneralFuc.ClearTextBox(this);
            mstxtDate.Text = "00000000";

            //deserialize
            probe = SystemConfig.DeserializeFromXml(filepath, probe);
            ClassToUI();

            mainform.Getprobe(probe);
        }
Esempio n. 7
0
 private void ClassToUI()
 {
     //InitInterface();
     GeneralFuc.ClearTextBox(this);
     mstxtDate.Text = "00000000";
     //Print to UI
     try
     {
         mstxtDate.Text         = wedge.date;
         cmbName.Text           = wedge.name;
         txtType.Text           = wedge.type;
         txtDrawNum.Text        = wedge.drawingPartNum;
         txtManufacturer.Text   = wedge.manu;
         txtSequenceNum.Text    = wedge.sn;
         txtLXL.Text            = wedge.length.ToString();
         txtLXW.Text            = wedge.width.ToString();
         txtLXH.Text            = wedge.height.ToString();
         txtLDW.Text            = wedge.headLen.ToString();
         txtAngle.Text          = wedge.incidentAngle.ToString();
         txtLongVeloc.Text      = wedge.longVeloc.ToString();
         txtTransVeloc.Text     = wedge.transVeloc.ToString();
         txtOperTempMin.Text    = wedge.operTempMin.ToString();
         txtStoreTemperMin.Text = wedge.storeTemprMin.ToString();
         txtOperTempMax.Text    = wedge.operTempMax.ToString();
         txtStoreTemperMax.Text = wedge.storeTemprMax.ToString();
         txtWedgePos.Text       = positions.wedgePosition.ToString();
         txtProbePos.Text       = positions.probePosition.ToString();
     }
     catch (Exception ex)
     {
         MessageBox.Show("数据导入失败!请检查文件是否正确!", "警告");
         init();
         return;
     }
     isexist             = true;
     tabControl1.Visible = true;
 }