public mainform() { Curr_dir = AppDefaultSetting.getDefaultPath(); InitializeComponent(); ////testing //cui_data_inject x = new cui_data_inject(); // x.Show(); this.Icon = new Icon(Directory.GetCurrentDirectory() + @"\Resources\bhge_icon.ico"); this.pictureBox1.Image = Image.FromFile(Directory.GetCurrentDirectory() + @"\Resources\bhge.png"); this.defaultpath.Image = Image.FromFile(Directory.GetCurrentDirectory() + @"\Resources\path_select.jpg"); AppDefaultSetting.setDefaultPath(""); Configure.Visible = false; DAQ.Visible = false; Home_page.Visible = true; graphTrendData.Visible = false; txtBoxtxt = new TextBox(); vnaconf = new VNAConfiguration(); // dateTimePicker1 = new DateTimePicker(); // graphTrendData.Controls.Add(dateTimePicker1); picture = new PictureBox { Name = "pictureBox", Size = new Size(1177, 692), //Location = new Point(14, 17), // Image = Image.FromFile(@"C:\Users\212612447\Documents\CUI\CUI_Display_updated1\CUI_Display_updated\CUI_Display\ge_cover_img4.jpg"), Image = Image.FromFile(Directory.GetCurrentDirectory() + @"\Resources\ge_cover_img4.jpg"), SizeMode = PictureBoxSizeMode.CenterImage }; tableLayoutPanel1.Controls.Add(picture); picture.SizeMode = PictureBoxSizeMode.StretchImage; panel3.Visible = false; picture.Visible = true; }
/****************************************************************/ private void saveconf_Click(object sender, EventArgs e) { //code to save local configuration to instance.... if (vnaconf == null) { vnaconf = new VNAConfiguration(); } if ( (MessageBox.Show(Messages.CONF_SAVE_CONFIRM , "Confirmation" , MessageBoxButtons.YesNo , MessageBoxIcon.Question ) == DialogResult.Yes) ) { vnaconf.setconfig(this.tagname, this.deltat, this.window, this.readytime, this.wavevelocity, this.configfilename, default_path); vnaconf.getconfig(); MessageBox.Show(Messages.CONF_SAVE_SUCC , "Message", MessageBoxButtons.OK , MessageBoxIcon.Information); saveconf.Enabled = false; Configure.Visible = false; Home_page.Visible = true; } graphTrendData.Visible = false; picture.Visible = false; panel3.Visible = true; //code added to check COM sever functionality /* ComClassExample.ComClassExample x=new ComClassExample.ComClassExample(); * String p=x.show(); * MessageBox.Show(p); */ //code will be used after doing daq /* * if (!isvalidconf()) * * { * return; * } * OpenFileDialog openFileDialog1 = new OpenFileDialog(); * //openFileDialog1.InitialDirectory = "c:\\"; * openFileDialog1.Filter = "csv files (*.csv)|*.csv|All files (*.*)|*.*"; * openFileDialog1.FilterIndex = 2; * openFileDialog1.RestoreDirectory = true; * if (openFileDialog1.ShowDialog() == DialogResult.OK) * { * try * { * using (var streamReader = new StreamReader(openFileDialog1.FileName)) * using (var csvReader = new CsvReader(streamReader)) * { * HeaderRecord header = csvReader.ReadHeaderRecord(); * * PointPairList obDataPoints = new PointPairList(); * uint uiRowIndex = 0U; * * while (csvReader.HasMoreRecords) * { * DataRecord record = csvReader.ReadDataRecord(); * var data = record[1]; * * obDataPoints.Add(Convert.ToDouble(uiRowIndex), Convert.ToDouble(data)); * } * * FillGraphData(obDataPoints); * } * } * catch (Exception ex) * { * MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); * } * }*/ }