Exemplo n.º 1
0
 /**
  * Event to handle "Generate .perf File" button click.
  * Gets the folder path given by the user and calls iterateOverTrials()
  * method to iterate over the subfolders and files under that path to
  * create .perf files for each session in the selected set.
  */
 private void generatePerformancefile_Click(Object sender, System.EventArgs e)
 {
     if (this.selectSessionBox.Text == "")
     {
         MessageBox.Show("To create a performance file for each " +
                         "session under an experiment: select an experiment folder. \n\n" +
                         "To create a performance file for a specific session:" +
                         " select a session folder under an experiment.",
                         "Experiment/Session Folder Selection Warning", MessageBoxButtons.OK,
                         MessageBoxIcon.Warning);
     }
     else
     {
         DirectoryInfo dir = new DirectoryInfo(this.selectSessionBox.Text);
         ATUtil.IsSessionDirectory(dir);
         PerformanceFileCreation.iterateOverTrials(dir, null);
         if (PerformanceFileCreation.isNewPerfFileOpen())
         {
             MessageBox.Show("Performance File : " + PerformanceFileCreation.PerformanceFilename + " created.");
         }
         PerformanceFileCreation.setPerfFileStatus(false);
         this.selectSessionBox.Clear();
         sessionFile = null;
     }
 }
Exemplo n.º 2
0
        // Routine to handle Generation of XLS  file Creation
        private void GenerateXLS_Click_Click(object sender, EventArgs e)
        {
            try
            {
                ReplayTrial.cleanUp();
                DisplayFileCreation.cleanUp();

                // validate the input File name chosen by the User
                String geLogFileName = this.selectTrialBox.Text;
                if (this.selectTrialBox == null || this.selectTrialBox.Text == null || geLogFileName == null || geLogFileName == "")
                {
                    MessageBox.Show("Select a valid Trial file to replay");
                    this.selectTrialBox.Clear();
                    return;
                }

                String xlsFileName = ATUtil.retrieveXLSFileName(geLogFileName, "GELOG");
                if (ATUtil.checkIfXLSFileExists(xlsFileName))
                {
                    MessageBox.Show("XLS File Exists");
                    this.selectTrialBox.Clear();
                    return;
                }
                String displayFileName = setUp(geLogFileName);
                // Create Human Readable File
                WaitMessageForm waitMessageFrm = new WaitMessageForm();

                //waitMessageFrm.Location = new System.Drawing.Point(0, 0);
                waitMessageFrm.TopMost = true;
                waitMessageFrm.BringToFront();
                waitMessageFrm.Show();
                waitMessageFrm.Refresh();

                XML2XLS converter = new XML2XLS(displayFileName);
                try
                {
                    converter.convert();

                    waitMessageFrm.Hide();
                    waitMessageFrm.Close();

                    MessageBox.Show(" XML to XLS file converted Successfully");
                }
                catch (SystemException e3)
                {
                    // do nothing
                    MessageBox.Show(e3.Message);
                }
                catch (Exception e2)
                {
                    // do nothing
                    MessageBox.Show(e2.Message);
                }
                finally
                {
                    converter = null;
                }
            }
            catch (ATLogicException e3)
            {
                MessageBox.Show("Analysis Tool Exception : Error Creating XLS file : " + e3.getATLogicErrorMessage());
                MessageBox.Show("Analysis Tool Exception : Error Creating XLS file : " + e3.StackTrace);
                this.selectTrialBox.Clear();
                return;
            }
            catch (SystemException e4)
            {
                MessageBox.Show(" AT Exception :Error Creating XLS file : " + e4.Message);
                MessageBox.Show(" AT Exception : Error Creating XLS file : " + e4.StackTrace);
                this.selectTrialBox.Clear();
                return;
            }
            catch (Exception e5)
            {
                MessageBox.Show(" Generic Exception : Error Creating XLS file  : " + e5.Message);
                MessageBox.Show(" Generic Exception : Error Creating XLS file  : " + e5.StackTrace);
                this.selectTrialBox.Clear();
                return;
            }
        }