Beispiel #1
0
        public frmContainer()
        {
            //Main Form
            InitializeComponent();

            //Error View List on Form
            InitializeErrorView();

            //Instatiate the Runfile Object Value here and connect to an 'on change property"
            //1.) So a runfile Object is always around.
            RunfileObject = new EarlabRunfile();
        }
Beispiel #2
0
        private void ProductionListView(EarlabRunfile RunfileObject)
        {
            try
            {
                ListViewItem lvi;
                ListViewItem.ListViewSubItem lvsi;

                //Adds the label above the error list
                //this.lblCurrentPath.Text = root + "    (Double click to display the path name)";

                //this.lblCurrentPath.Text = " Errors Present in the Runfile Document";

                if (RunfileObject != null)
                {
                    //this.listViewErrors.Items.Clear();
                    //this.listViewErrors.BeginUpdate();
                    this.listViewErrors.Clear();
                    InitializeErrorView();

                    foreach (VerificationError error1 in RunfileObject.VErrorCollection)
                    {
                        lvi      = new ListViewItem();
                        lvi.Text = error1.FullErrorPath;
                        //lvi.ImageIndex = 0;

                        lvsi      = new ListViewItem.ListViewSubItem();
                        lvsi.Text = error1.Severity;
                        lvi.SubItems.Add(lvsi);

                        lvsi      = new ListViewItem.ListViewSubItem();
                        lvsi.Text = error1.Message;
                        lvi.SubItems.Add(lvsi);

                        this.listViewErrors.Items.Add(lvi);
                    }
                }

                this.listViewErrors.EndUpdate();
            }//[ErrorLog]
            catch (System.Exception err)
            {
                MessageBox.Show("Error: " + err.Message);
            }

            this.listViewErrors.View = View.Details;
        }
Beispiel #3
0
 public void AbstractModuleTab(EarlabRunfile RunfileObject)
 {
 }
        public AbstractTabPageClass(EarlabRunfile RunfileObject, string FileNameTemp)
        {
            label1.Text       = RunfileObject.RunfileInformation.RunfileInformationAuthor;
            label2.Text       = RunfileObject.RunfileInformation.RunfileInformationEditDate;
            richTextBox1.Text = RunfileObject.RunfileInformation.RunfileInformationAbstract;

            string tempPath = Path.GetFullPath(FileNameTemp);

            tempPath = Regex.Replace(tempPath, Path.GetFileName(FileNameTemp), "");
            this.pictureBox1.ImageLocation = Path.Combine(tempPath, RunfileObject.RunfileInformation.RunfileInformationImageLocation);



            //this.tabControl1 = new System.Windows.Forms.TabControl();
            this.tabPageA     = new System.Windows.Forms.TabPage();
            this.label1       = new System.Windows.Forms.Label();
            this.pictureBox1  = new System.Windows.Forms.PictureBox();
            this.label2       = new System.Windows.Forms.Label();
            this.label3       = new System.Windows.Forms.Label();
            this.richTextBox1 = new System.Windows.Forms.RichTextBox();
            //this.tabControl1.SuspendLayout();
            this.tabPageA.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            //
            // tabControl1
            //
            //this.tabControl1.Controls.Add(this.tabPageA);
            //this.tabControl1.Location = new System.Drawing.Point(13, 13);
            //this.tabControl1.Name = "tabControl1";
            //this.tabControl1.SelectedIndex = 0;
            //this.tabControl1.Size = new System.Drawing.Size(845, 622);
            //this.tabControl1.TabIndex = 0;
            //
            // tabPageA
            //
            this.tabPageA.Controls.Add(this.richTextBox1);
            this.tabPageA.Controls.Add(this.label3);
            this.tabPageA.Controls.Add(this.label2);
            this.tabPageA.Controls.Add(this.pictureBox1);
            this.tabPageA.Controls.Add(this.label1);
            this.tabPageA.Location = new System.Drawing.Point(4, 22);
            this.tabPageA.Name     = "tabPageA";
            this.tabPageA.Text     = "Model Abstract";
            this.tabPageA.Padding  = new System.Windows.Forms.Padding(3);
            this.tabPageA.Size     = new System.Drawing.Size(837, 596);
            this.tabPageA.TabIndex = 1;
            this.tabPageA.UseVisualStyleBackColor = true;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(7, 7);
            this.label1.Name     = "label1";
            this.label1.Size     = new System.Drawing.Size(35, 13);
            this.label1.TabIndex = 0;
            //this.label1.Text = "label1";
            //
            // pictureBox1
            //
            this.pictureBox1.Location = new System.Drawing.Point(7, 24);
            this.pictureBox1.Name     = "pictureBox1";
            this.pictureBox1.Size     = new System.Drawing.Size(502, 566);
            this.pictureBox1.TabIndex = 1;
            this.pictureBox1.TabStop  = false;
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(515, 24);
            this.label2.Name     = "label2";
            this.label2.Size     = new System.Drawing.Size(35, 13);
            this.label2.TabIndex = 2;
            //this.label2.Text = "label2";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(515, 41);
            this.label3.Name     = "label3";
            this.label3.Size     = new System.Drawing.Size(35, 13);
            this.label3.TabIndex = 3;
            //this.label3.Text = "label3";
            //
            // richTextBox1
            //
            this.richTextBox1.Location = new System.Drawing.Point(515, 58);
            this.richTextBox1.Name     = "richTextBox1";
            this.richTextBox1.Size     = new System.Drawing.Size(316, 532);
            this.richTextBox1.TabIndex = 4;
            this.richTextBox1.Text     = "";
            //
            // AbstractTabPageClass
            //
            this.ClientSize = new System.Drawing.Size(1053, 672);
            //this.Controls.Add(this.tabControl1);
            this.Name = "AbstractTabPageClass";
            //this.tabControl1.ResumeLayout(false);
            this.tabPageA.ResumeLayout(false);
            this.tabPageA.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
        }
Beispiel #5
0
        private void OpenXMLFile()
        {
            try
            {
                string FileNameTemp;
                RunfileDocument = new XmlDocument();



                //1.) Open File
                //a.) Open file
                //b.) Check file against xsd schema
                //c.) check to ensure it isn't null

                //1.) Open File -- Dialog Box
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Title = "Please open a saved Run File";

                //Set items
                //openFileDialog1.InitialDirectory =
                //System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);


                //.xml ToDo: own "file format" XX requires admin priviliges.
                openFileDialog1.Filter = "XML|*.xml|Earlab|*.Earlab";


                //Open Dialogue box to get a Runfile
                //Some error handling here
                if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
                {
                    MessageBox.Show("cancel button clicked");
                    FileNameTemp = null;
                }
                else
                {
                    FileNameTemp = openFileDialog1.FileName;
                }

                if (FileNameTemp != null)
                {
                    theRunfile = FileNameTemp;
                    //2.) Initize and Load XML Document


                    //ValidateXml(string xmlFilename, string schemaFilename)



                    //RunfileDocument = new XmlDocument();
                    RunfileDocument.Load(theRunfile);


                    //2.9) [Schema Validation] Is this a valid runfile document?



                    //3.) Create a RunfileObject
                    //This should have entire Runfile in testRunfile
                    RunfileObject = new EarlabRunfile(RunfileDocument);

                    //attach efi call to any change
                    foreach (EarlabModule eM in RunfileObject.EarlabModules)
                    {
                        foreach (EarlabParameter eP in eM.EarlabParameters)
                        {
                            eP.DataChanged += SomethingChanged;
                        }
                    }

                    //3.5) Clear tabs -- probably want an error check here
                    //Do you really want to load a new Runfile?
                    ModuleClearTabs();
                    remove_button();

                    //3.75) Clear List View
                    this.listViewErrors.Clear();

                    //4.) Create the Grids on the Form
                    //Now For Each Module in Runfile build a sample grid
                    //Using the tabcreation class

                    //[abstract info]
                    //Abstract_ModuleTab();

                    //AbstractTabPageClass AModuleTab = new AbstractTabPageClass(RunfileObject, FileNameTemp);
                    //tabControl1.TabPages.Add(new AbstractTabPageClass(RunfileObject, FileNameTemp));

                    //Load the Picture //RunfileObject.RunfileInformation.RunfileInformationImageLocation;
                    string tempPath = Path.GetFullPath(FileNameTemp);
                    tempPath = Regex.Replace(tempPath, Path.GetFileName(FileNameTemp), "");
                    this.pictureBox1.ImageLocation = Path.Combine(tempPath, RunfileObject.RunfileInformation.RunfileInformationImageLocation);

                    //this part works, module works, ModuleTab doesnt'
                    foreach (EarlabModule elModule in RunfileObject.EarlabModules)
                    {
                        //create a new tab on the form
                        ModuleTab(elModule);
                    }


                    //Some Feedback
                    MessageBox.Show("Runfile Document Opened Successfully!");

                    //[Problem]
                    //(EarlabParameterInteger)RunfileObject.EarlabModules[1].EarlabParameters[3]. += Intparameter_ValueChanged;
                }
            }
            //[Change]
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                err = ex.StackTrace;

                //lastly make the recording to the errorlog
                //Going to have to make a "catch flag" to log errors
                {
                    //!!/write to error pop-up
                    errorLog currentLog = new errorLog(err);
                    currentLog.PathName = Application.StartupPath;
                    currentLog.WriteErrorLog();

                    RunfileEditor.frmChild child = new RunfileEditor.frmChild(this);
                    //Show the form
                    child.Show();         //--> pops it from start.
                    child.BringToFront(); //brings it to front

                    //[error]
                    //child.txtErrorMsgs.Text = currentLog.ReadErrorLog();
                    //Error Logging works --- need to work on windows type display.
                    //textBox1.Text = currentLog.ReadErrorLog();

                    //errorBox errorForm = new errorBox();
                    //errorForm.ShowDialog();
                    //!!/write to error pop-up
                }
            }
        }