private void button2_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Title = "AVL Postscript File"; fd.Multiselect = false; fd.Filter = "Postscript (*.ps)|*.ps"; fd.InitialDirectory = Properties.Settings.Default.AVL_Location; if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!fd.CheckFileExists) { return; } PostScript_Interp psi = new PostScript_Interp(); this.pictureBox1.Image = psi.Load(fd.FileName); psi = null; } }
private void button2_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Title = "AVL Postscript File"; fd.Multiselect = false; fd.Filter = "Postscript (*.ps)|*.ps"; fd.InitialDirectory = Properties.Settings.Default.AVL_Location; if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!fd.CheckFileExists) return; PostScript_Interp psi = new PostScript_Interp(); this.pictureBox1.Image = psi.Load(fd.FileName); psi = null; } }
private void SortMessage(string msg) { if (msg == null) { return; } msg = msg.Trim(); //this is a wierd one for now. When there is a ton of results being pushed //into the window by the stripforce or whatever output, //it starts and ends with a bunch of ------. So when we see this, fill a buffer //then we can parse that buffer once the ----- shows up to signify the end if (m_outputBuffer == null && (msg.StartsWith("Enter filename, or <return> for screen output") || msg.StartsWith("Stability-axis derivatives..."))) { if (m_outputBuffer == null) { m_outputBuffer = new StringBuilder(); } } //looking for when to stop collecting lines into the buffer. All outputs EXCEPT //the stability ones end with the -----, but Consistancy is clearly to much to ask, //so that last part there is a specific check for the end of the stability output if (m_outputBuffer != null && (msg == "---------------------------------------------------------------" || msg.StartsWith("Clb Cnr / Clr Cnb ="))) { string fullMsg = m_outputBuffer.ToString(); m_outputBuffer = null; ParseOutputSections(fullMsg);//signifies end of buffer, call parsing method return; } //if we are not collecting and just looking at one-off messages if (m_outputBuffer == null) { if (msg.StartsWith("AVL")) { current_Menu = Menu.AVL; } else if (msg.StartsWith(".OPER (case")) { current_Menu = Menu.OPER; } else if (msg.StartsWith("Geometry plot command:")) { current_Menu = Menu.GEOM; if (msg.Contains("PostScript to file")) { string[] words = msg.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); string Geometry_Image_File = words[7]; //System.Threading.Thread.Sleep(200); PostScript_Interp psi = new PostScript_Interp(); Geometry_Image = (System.Drawing.Bitmap)psi.Load(Path.Combine(AVL_Process.StartInfo.WorkingDirectory, Geometry_Image_File)); psi = null; AVLUpdateMessage(this, new AVL_PictureEventArgs(AVLEventArgs.AVLData_Source.Geometry_Pict, Geometry_Image)); } } if (msg.EndsWith("c>")) { m_running = false; } } else//otherwise keep compiling { m_outputBuffer.AppendLine(msg); } }