using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; using System.Threading; using System.Runtime.InteropServices; using System.Diagnostics; using System.Windows.Forms.DataVisualization.Charting; using System.Drawing; using System.Collections; namespace mainProgram { public partial class main : Form { public main() { InitializeComponent(); } private ProjectManager mProjectManager = null;//保存打开的/新建的工程对象 public void RecieveProjectManager(ProjectManager value) { mProjectManager = value; Console.WriteLine("工程文件目录为:" + mProjectManager.ProjectPath + "---------------------"); } private void newToolStripMenuItem_Click(object sender, EventArgs e) { NewProjectWindow w = new NewProjectWindow(); w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) { treeViewTc21.Initialize(mProjectManager.ProjectPath); SetProjectNameAndProjectPath(); } } private void OpenProjectToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager != null) { MessageBox.Show(this, "不能重复打开工程!", "提示"); return; } OpenProjectWindow w = new OpenProjectWindow(); w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult dialogResult = w.ShowDialog();//阻塞 if (dialogResult == DialogResult.OK) { SetProjectNameAndProjectPath(); treeViewTc21.Initialize(mProjectManager.ProjectPath); } } private string getProjectName() { string[] tmp2 = mProjectManager.ProjectPath.Split('\\'); string projectName = tmp2[tmp2.Length - 1]; return projectName; } private void SetProjectNameAndProjectPath() { this.Text = this.Text + "-" + getProjectName(); this.projectPath_toolStripStatusLabel.Text = this.projectPath_toolStripStatusLabel.Text + mProjectManager.ProjectPath; } private void ClearProjectNameAndProjectPath() { this.Text = this.Text + "-" + getProjectName(); this.projectPath_toolStripStatusLabel.Text = this.projectPath_toolStripStatusLabel.Text + mProjectManager.ProjectPath; int index = this.Text.IndexOf(getProjectName()); this.Text = this.Text.Substring(0, index - 1);//index - 1:还要加上一个字符“-” int index2 = this.projectPath_toolStripStatusLabel.Text.IndexOf(mProjectManager.ProjectPath); this.projectPath_toolStripStatusLabel.Text = this.projectPath_toolStripStatusLabel.Text.Substring(0, index2); } private void RadToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } RadCorrectionWindow w = new RadCorrectionWindow(mProjectManager); //w.TransferEvent += RecieveProjectManager; var addr2 = getMemory(mProjectManager); Console.WriteLine("父窗口变量的地址 = " + addr2); //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } public string getMemory(object o) // 获取引用类型的内存地址方法 { GCHandle h = GCHandle.Alloc(o, GCHandleType.WeakTrackResurrection); IntPtr addr = GCHandle.ToIntPtr(h); return "0x" + addr.ToString("X"); } private void ExitToolStripMenuItem_Click(object sender, EventArgs e) { this.Close(); } private void main_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("确认退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { e.Cancel = false; } else { e.Cancel = true; } } private void SvdToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } if (mProjectManager.GetDateFolderCount() == 0)//当没有做福亮度校正时,2rad文件夹为空,就不能打开算法窗口 { MessageBox.Show(this, "请先进行预处理-福亮度校正!", "提示"); return; } SVDWindows w = new SVDWindows(mProjectManager, "svd"); //w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } private void DoasToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } if (mProjectManager.GetDateFolderCount() == 0)//当没有做福亮度校正时,2rad文件夹为空,就不能打开算法窗口 { MessageBox.Show(this, "请先进行预处理-福亮度校正!", "提示"); return; } SVDWindows w = new SVDWindows(mProjectManager, "doas"); //w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } private void SfmToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } if (mProjectManager.GetDateFolderCount() == 0)//当没有做福亮度校正时,2rad文件夹为空,就不能打开算法窗口 { MessageBox.Show(this, "请先进行预处理-福亮度校正!", "提示"); return; } SVDWindows w = new SVDWindows(mProjectManager, "sfm"); //w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } private void SfmGaussinToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } if (mProjectManager.GetDateFolderCount() == 0)//当没有做福亮度校正时,2rad文件夹为空,就不能打开算法窗口 { MessageBox.Show(this, "请先进行预处理-福亮度校正!", "提示"); return; } SVDWindows w = new SVDWindows(mProjectManager, "sfm_gaussian"); //w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } private void SfldToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } if (mProjectManager.GetDateFolderCount() == 0)//当没有做福亮度校正时,2rad文件夹为空,就不能打开算法窗口 { MessageBox.Show(this, "请先进行预处理-福亮度校正!", "提示"); return; } SVDWindows w = new SVDWindows(mProjectManager, "sfld"); //w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } private void Fld3ToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager is null) { MessageBox.Show(this, "请先打开工程!", "提示"); return; } if (mProjectManager.GetDateFolderCount() == 0)//当没有做福亮度校正时,2rad文件夹为空,就不能打开算法窗口 { MessageBox.Show(this, "请先进行预处理-福亮度校正!", "提示"); return; } SVDWindows w = new SVDWindows(mProjectManager, "3fld"); //w.TransferEvent += RecieveProjectManager; //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) treeViewTc21.reInitialize(); } #region 绘制曲线函数 public static void DrawSpline(List listX, List listY, Chart chart) { try { //X、Y值成员 chart.Series[0].Points.DataBindXY(listX, listY); chart.Series[0].Points.DataBindY(listY); //点颜色 chart.Series[0].MarkerColor = Color.Green; //图表类型 设置为样条图曲线 chart.Series[0].ChartType = SeriesChartType.Spline; //设置点的大小 chart.Series[0].MarkerSize = 5; //设置曲线的颜色 chart.Series[0].Color = Color.Orange; //设置曲线宽度 chart.Series[0].BorderWidth = 2; //chart.Series[0].CustomProperties = "PointWidth=4"; //设置是否显示坐标标注 chart.Series[0].IsValueShownAsLabel = false; //设置游标 chart.ChartAreas[0].CursorX.IsUserEnabled = true; chart.ChartAreas[0].CursorX.AutoScroll = true; chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; //设置X轴是否可以缩放 chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; //将滚动条放到图表外 chart.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false; // 设置滚动条的大小 chart.ChartAreas[0].AxisX.ScrollBar.Size = 15; // 设置滚动条的按钮的风格,下面代码是将所有滚动条上的按钮都显示出来 chart.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All; chart.ChartAreas[0].AxisX.ScrollBar.ButtonColor = Color.SkyBlue; // 设置自动放大与缩小的最小量 chart.ChartAreas[0].AxisX.ScaleView.SmallScrollSize = double.NaN; chart.ChartAreas[0].AxisX.ScaleView.SmallScrollMinSize = 1; //设置刻度间隔 chart.ChartAreas[0].AxisX.Interval = 10; //将X轴上格网取消 chart.ChartAreas[0].AxisX.MajorGrid.Enabled = false; //X轴、Y轴标题 chart.ChartAreas[0].AxisX.Title = "环号"; chart.ChartAreas[0].AxisY.Title = "直径"; //设置Y轴范围 可以根据实际情况重新修改 double max = listY[0]; double min = listY[0]; foreach (var yValue in listY) { if (max < yValue) { max = yValue; } if (min > yValue) { min = yValue; } } chart.ChartAreas[0].AxisY.Maximum = max; chart.ChartAreas[0].AxisY.Minimum = min; chart.ChartAreas[0].AxisY.Interval = (max - min) / 10; //绑定数据源 chart.DataBind(); } catch (Exception exc) { MessageBox.Show(exc.ToString()); } } #endregion #region 鼠标点击,通过环号显示游标,并缩放到响应位置 /// /// 鼠标点击,通过环号显示游标,并缩放到响应位置函数 /// /// 环号 /// Chart控件 public static void ShowCurByClick(int ringNum, Chart chart) { //设置游标位置 chart.ChartAreas[0].CursorX.Position = ringNum; //设置视图缩放 chart.ChartAreas[0].AxisX.ScaleView.Zoom(ringNum - 1, ringNum + 2); //改变曲线线宽 chart.Series[0].BorderWidth = 3; //改变X轴刻度间隔 chart.ChartAreas[0].AxisX.Interval = 1; } #endregion private void DeleteFiles(string name) { //MessageBox.Show(this, "删除:" + name, "提示"); if (File.Exists(name))//是文件 { mProjectManager.DeleteFile(name); } else if (Directory.Exists(name))//是文件夹 { mProjectManager.DelectDirIncludeItself(name); } } private void SaveAs(string name) { SaveAsWindow w = new SaveAsWindow(name); //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 if (tmp == DialogResult.OK) { //treeViewTc21.Initialize(mProjectManager.ProjectPath); } } private void PlotSif(string name) { if (File.Exists(name))//是文件 { //MessageBox.Show(this, "绘制:" + name, "提示"); if (name.Contains(mProjectManager.MetadataPath) | name.Contains(mProjectManager.RawPath) | name.Contains(mProjectManager.RadPath)) return; chartTC1.clearAll(); PlotSifSpectral(name); } else if (Directory.Exists(name))//是文件夹 { } } private void ShowPointInfo(Stack name, Stack x, Stack y) { PointInfoTextBox.Clear(); string pointInfo = ""; int count = name.Count; for (int i = 0; i < count; i++) { pointInfo += name.Pop().ToString() + "\r\nx: " + x.Pop().ToString() + "\r\ny: " + y.Pop().ToString() + "\r\n";//System.Environment.NewLine } PointInfoTextBox.Text = pointInfo; } private void main_Load(object sender, EventArgs e) { treeViewTc21.DeleteEvent += DeleteFiles; treeViewTc21.PlotSifEvent += PlotSif; treeViewTc21.SaveAsEvent += SaveAs; chartTC1.clickPointEvent += ShowPointInfo; } //protected override void OnPaint(PaintEventArgs e) //{ // //System.Drawing.Color.FromArgb(0, 106, 181) // ControlPaint.DrawBorder(e.Graphics, ClientRectangle, System.Drawing.Color.FromArgb(0, 106, 181), ButtonBorderStyle.Solid); //} public void PlotSifSpectral(string path) { //SpectralDataReaderWriter spectralDataReaderWriter = new SpectralDataReaderWriter(@"D:\Desktop\0sifRawData\rawdata\2021_12_21\beijing_10_53_45.csv"); //SpectralData spectralData = spectralDataReaderWriter.GetSpectral(1); //List x1 = new List(); //List y1 = new List(); //for (int i = 0; i < spectralData.spectral.Length; i++) //{ // x1.Add((double)i); // y1.Add(spectralData.spectral[i]); //} //RefreshChart(x1, y1, "chart1"); SifDataReaderWriter sifDataReaderWriter = new SifDataReaderWriter(path); SifData sifData = sifDataReaderWriter.GetSifData(); double[] y = new double[sifData.sif.GetLength(0)]; for (int i = 0; i < sifData.sif.GetLength(1); i++) { for (int j = 0; j < sifData.sif.GetLength(0); j++) { y[j] = sifData.sif[j, i]; } //string[] tmp = path.Split('\\'); //string[] fileName = tmp[tmp.Length - 1].Split('_'); //RefreshChart(sifData.time, y, fileName[0]); RefreshChart(sifData.time, y, sifData.position[i]); } } public delegate void RefreshChartDelegate(string[] x, double[] y, string type); public void RefreshChart(string[] x, double[] y, string name) { if (chartTC1.chart1.InvokeRequired) { RefreshChartDelegate stcb = new RefreshChartDelegate(RefreshChart); this.Invoke(stcb, new object[] { x, y, name }); } else { //chartTC1.chart1.Series[0].Points.DataBindXY(x, y); chartTC1.addSeries(x, y, name); } } private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(main)); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.NewProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OpenProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CloseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ExitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.preprocessToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sifComputeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SvdToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DoasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SfmToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SfmGaussinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SfldToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.Fld3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sifAlgorithmAbstractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.projectPath_toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.panel1 = new System.Windows.Forms.Panel(); this.treeViewTc21 = new TreeViewTc.TreeViewTc2(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.PointInfoTextBox = new System.Windows.Forms.TextBox(); this.chartTC1 = new chartTC.chartTC(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 // this.menuStrip1.BackColor = System.Drawing.Color.White; this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.preprocessToolStripMenuItem, this.sifComputeToolStripMenuItem, this.帮助ToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(1176, 25); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.NewProjectToolStripMenuItem, this.OpenProjectToolStripMenuItem, this.CloseToolStripMenuItem, this.ExitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 21); this.fileToolStripMenuItem.Text = "文件"; // // NewProjectToolStripMenuItem // this.NewProjectToolStripMenuItem.Name = "NewProjectToolStripMenuItem"; this.NewProjectToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.NewProjectToolStripMenuItem.Text = "新建工程"; this.NewProjectToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // OpenProjectToolStripMenuItem // this.OpenProjectToolStripMenuItem.Name = "OpenProjectToolStripMenuItem"; this.OpenProjectToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.OpenProjectToolStripMenuItem.Text = "打开工程"; this.OpenProjectToolStripMenuItem.Click += new System.EventHandler(this.OpenProjectToolStripMenuItem_Click); // // CloseToolStripMenuItem // this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem"; this.CloseToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.CloseToolStripMenuItem.Text = "关闭工程"; this.CloseToolStripMenuItem.Click += new System.EventHandler(this.CloseToolStripMenuItem_Click); // // ExitToolStripMenuItem // this.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"; this.ExitToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.ExitToolStripMenuItem.Text = "退出"; this.ExitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolStripMenuItem_Click); // // preprocessToolStripMenuItem // this.preprocessToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.RadToolStripMenuItem}); this.preprocessToolStripMenuItem.Name = "preprocessToolStripMenuItem"; this.preprocessToolStripMenuItem.Size = new System.Drawing.Size(56, 21); this.preprocessToolStripMenuItem.Text = "预处理"; // // RadToolStripMenuItem // this.RadToolStripMenuItem.Name = "RadToolStripMenuItem"; this.RadToolStripMenuItem.Size = new System.Drawing.Size(136, 22); this.RadToolStripMenuItem.Text = "辐亮度校正"; this.RadToolStripMenuItem.Click += new System.EventHandler(this.RadToolStripMenuItem_Click); // // sifComputeToolStripMenuItem // this.sifComputeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SvdToolStripMenuItem, this.DoasToolStripMenuItem, this.SfmToolStripMenuItem, this.SfmGaussinToolStripMenuItem, this.SfldToolStripMenuItem, this.Fld3ToolStripMenuItem}); this.sifComputeToolStripMenuItem.Name = "sifComputeToolStripMenuItem"; this.sifComputeToolStripMenuItem.Size = new System.Drawing.Size(58, 21); this.sifComputeToolStripMenuItem.Text = "Sif算法"; // // SvdToolStripMenuItem // this.SvdToolStripMenuItem.Name = "SvdToolStripMenuItem"; this.SvdToolStripMenuItem.Size = new System.Drawing.Size(153, 22); this.SvdToolStripMenuItem.Text = "Svd"; this.SvdToolStripMenuItem.Click += new System.EventHandler(this.SvdToolStripMenuItem_Click); // // DoasToolStripMenuItem // this.DoasToolStripMenuItem.Name = "DoasToolStripMenuItem"; this.DoasToolStripMenuItem.Size = new System.Drawing.Size(153, 22); this.DoasToolStripMenuItem.Text = "Doas"; this.DoasToolStripMenuItem.Click += new System.EventHandler(this.DoasToolStripMenuItem_Click); // // SfmToolStripMenuItem // this.SfmToolStripMenuItem.Name = "SfmToolStripMenuItem"; this.SfmToolStripMenuItem.Size = new System.Drawing.Size(153, 22); this.SfmToolStripMenuItem.Text = "Sfm"; this.SfmToolStripMenuItem.Click += new System.EventHandler(this.SfmToolStripMenuItem_Click); // // SfmGaussinToolStripMenuItem // this.SfmGaussinToolStripMenuItem.Name = "SfmGaussinToolStripMenuItem"; this.SfmGaussinToolStripMenuItem.Size = new System.Drawing.Size(153, 22); this.SfmGaussinToolStripMenuItem.Text = "Sfm gaussian"; this.SfmGaussinToolStripMenuItem.Click += new System.EventHandler(this.SfmGaussinToolStripMenuItem_Click); // // SfldToolStripMenuItem // this.SfldToolStripMenuItem.Name = "SfldToolStripMenuItem"; this.SfldToolStripMenuItem.Size = new System.Drawing.Size(153, 22); this.SfldToolStripMenuItem.Text = "Sfld"; this.SfldToolStripMenuItem.Click += new System.EventHandler(this.SfldToolStripMenuItem_Click); // // Fld3ToolStripMenuItem // this.Fld3ToolStripMenuItem.Name = "Fld3ToolStripMenuItem"; this.Fld3ToolStripMenuItem.Size = new System.Drawing.Size(153, 22); this.Fld3ToolStripMenuItem.Text = "3Fld"; this.Fld3ToolStripMenuItem.Click += new System.EventHandler(this.Fld3ToolStripMenuItem_Click); // // 帮助ToolStripMenuItem // this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.sifAlgorithmAbstractToolStripMenuItem, this.AboutToolStripMenuItem}); this.帮助ToolStripMenuItem.Name = "帮助ToolStripMenuItem"; this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(44, 21); this.帮助ToolStripMenuItem.Text = "帮助"; // // sifAlgorithmAbstractToolStripMenuItem // this.sifAlgorithmAbstractToolStripMenuItem.Name = "sifAlgorithmAbstractToolStripMenuItem"; this.sifAlgorithmAbstractToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.sifAlgorithmAbstractToolStripMenuItem.Text = "Sif算法简介"; this.sifAlgorithmAbstractToolStripMenuItem.Click += new System.EventHandler(this.sifAlgorithmAbstractToolStripMenuItem_Click); // // AboutToolStripMenuItem // this.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem"; this.AboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.AboutToolStripMenuItem.Text = "关于"; this.AboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItem_Click); // // statusStrip1 // this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.projectPath_toolStripStatusLabel}); this.statusStrip1.Location = new System.Drawing.Point(0, 778); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(1176, 22); this.statusStrip1.TabIndex = 1; this.statusStrip1.Text = "statusStrip1"; // // projectPath_toolStripStatusLabel // this.projectPath_toolStripStatusLabel.Name = "projectPath_toolStripStatusLabel"; this.projectPath_toolStripStatusLabel.Size = new System.Drawing.Size(68, 17); this.projectPath_toolStripStatusLabel.Text = "工程路径:"; // // splitContainer1 // this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Location = new System.Drawing.Point(0, 50); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.panel1); this.splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.No; // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.chartTC1); this.splitContainer1.Panel2.RightToLeft = System.Windows.Forms.RightToLeft.No; this.splitContainer1.Size = new System.Drawing.Size(1176, 728); this.splitContainer1.SplitterDistance = 231; this.splitContainer1.TabIndex = 6; // // panel1 // this.panel1.Controls.Add(this.treeViewTc21); this.panel1.Controls.Add(this.button1); this.panel1.Controls.Add(this.button2); this.panel1.Controls.Add(this.PointInfoTextBox); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(227, 724); this.panel1.TabIndex = 6; // // treeViewTc21 // this.treeViewTc21.Dock = System.Windows.Forms.DockStyle.Fill; this.treeViewTc21.Location = new System.Drawing.Point(0, 23); this.treeViewTc21.Margin = new System.Windows.Forms.Padding(4); this.treeViewTc21.Name = "treeViewTc21"; this.treeViewTc21.Size = new System.Drawing.Size(227, 421); this.treeViewTc21.TabIndex = 6; this.treeViewTc21.Load += new System.EventHandler(this.treeViewTc21_Load); // // button1 // this.button1.BackColor = System.Drawing.Color.WhiteSmoke; this.button1.Cursor = System.Windows.Forms.Cursors.Default; this.button1.Dock = System.Windows.Forms.DockStyle.Top; this.button1.Enabled = false; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button1.Location = new System.Drawing.Point(0, 0); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(227, 23); this.button1.TabIndex = 7; this.button1.Text = "工程"; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.BackColor = System.Drawing.Color.WhiteSmoke; this.button2.Dock = System.Windows.Forms.DockStyle.Bottom; this.button2.Enabled = false; this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.button2.Location = new System.Drawing.Point(0, 444); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(227, 23); this.button2.TabIndex = 8; this.button2.Text = "信息"; this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button2.UseVisualStyleBackColor = false; // // PointInfoTextBox // this.PointInfoTextBox.BackColor = System.Drawing.Color.White; this.PointInfoTextBox.Dock = System.Windows.Forms.DockStyle.Bottom; this.PointInfoTextBox.Location = new System.Drawing.Point(0, 467); this.PointInfoTextBox.Multiline = true; this.PointInfoTextBox.Name = "PointInfoTextBox"; this.PointInfoTextBox.ReadOnly = true; this.PointInfoTextBox.Size = new System.Drawing.Size(227, 257); this.PointInfoTextBox.TabIndex = 5; // // chartTC1 // this.chartTC1.Dock = System.Windows.Forms.DockStyle.Fill; this.chartTC1.Location = new System.Drawing.Point(0, 0); this.chartTC1.Name = "chartTC1"; this.chartTC1.Size = new System.Drawing.Size(937, 724); this.chartTC1.TabIndex = 3; this.chartTC1.Load += new System.EventHandler(this.chartTC1_Load); // // toolStrip1 // this.toolStrip1.BackColor = System.Drawing.Color.WhiteSmoke; this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); this.toolStrip1.Location = new System.Drawing.Point(0, 25); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(1176, 25); this.toolStrip1.TabIndex = 7; this.toolStrip1.Text = "toolStrip1"; // // main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(1176, 800); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.menuStrip1); this.ForeColor = System.Drawing.SystemColors.ControlText; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; this.Name = "main"; this.RightToLeft = System.Windows.Forms.RightToLeft.No; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "EasySif"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.main_FormClosing); this.Load += new System.EventHandler(this.main_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } private void chart1_Click(object sender, EventArgs e) { } private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e) { } private void treeViewTc21_Load(object sender, EventArgs e) { } private void CloseToolStripMenuItem_Click(object sender, EventArgs e) { if (mProjectManager == null) return; ClearProjectNameAndProjectPath(); mProjectManager = null; GC.Collect(); treeViewTc21.clearAll(); chartTC1.chart1.Series.Clear(); PointInfoTextBox.Clear(); } private void chartTC1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } //C#调用默认浏览器打开网页的几种方法:https://blog.csdn.net/testcs_dn/article/details/42246969 private void sifAlgorithmAbstractToolStripMenuItem_Click(object sender, EventArgs e) { System.Diagnostics.Process.Start("https://mp.weixin.qq.com/s/L89CdJcSs2dADxQMztv2nw"); } private void AboutToolStripMenuItem_Click(object sender, EventArgs e) { AboutWindows w = new AboutWindows(); //Form2 w = new Form2(); //w.Show();//不阻塞 DialogResult tmp = w.ShowDialog();//阻塞 } } }