예제 #1
0
 public void RegisterTestCollection(TestExecutionCollection collection)
 {
     mTestCollections.Add(collection);
     foreach (TreeNode seqNode in treeNodes)
     {
         seqNode.Nodes.Add(collection.GetNewTreeNode());
         seqNode.Expand();
     }
 }
예제 #2
0
        public OperationForm(TestExecutionCollection collection)
        {
            InitializeComponent();
            m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);

            Top    = collection.OperatorFormTop;
            Left   = collection.OperatorFormLeft;
            Width  = collection.OperatorFormWidth;
            Height = collection.OperatorFormHeight;

            mTestSequence = collection.TestSequence;
            mProject      = mTestSequence.project();

            dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
            bigImageForm            = new ImageBigViewForm(this);

            //            propForm = new OperationPropertiesForm();
            favSettingsForm = new FavoriteSettingsForm(this);
            favValuesForm   = new FavoriteValuesForm(this);
            logForm         = new OperationLogForm(this);
            //studyChartForm = new AnalysisForm(this);
            activeLogForm = new ActiveTestLogForm(this);
            reportForm    = new OperationReportForm(this);
            //treeForm = new OperationSequenceTreeForm(this);

            if (File.Exists(mTestSequence.OperatorViewLayoutFile))
            {
                dockPanel.LoadFromXml(mTestSequence.OperatorViewLayoutFile, m_deserializeDockContent);
            }

            /*
             * else if (File.Exists(mTestSequence.Project().DefaultOperatorViewLayoutFile))
             * {
             *  dockPanel.LoadFromXml(mTestSequence.Project().DefaultOperatorViewLayoutFile, m_deserializeDockContent);
             * }
             * else if (File.Exists("UnnamedView.config"))
             * {
             *  dockPanel.LoadFromXml("UnnamedView.config", m_deserializeDockContent);
             * }*/
            else
            {
                /*
                 * propForm.Show(dockPanel);
                 * propForm.ShowHint = DockState.DockRightAutoHide;
                 */
                bigImageForm.Dock = DockStyle.Fill;
                bigImageForm.Show(dockPanel, DockState.Document);

                favSettingsForm.Show(bigImageForm.Pane, DockAlignment.Top, 0.25);

                logForm.Show(favSettingsForm.Pane, DockAlignment.Right, 0.5);

                favValuesForm.Show(favSettingsForm.Pane, DockAlignment.Right, 0.5);

                reportForm.Show(logForm.Pane, logForm);

                //treeForm.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft);
            }

            CurrentTestCollection = collection;

            favSettingsForm.propertyGrid.SelectedObject = mTestSequence.mFavoriteSettings;
            favValuesForm.propertyGrid.SelectedObject   = mTestSequence.mFavoriteValues;

            int formNdx = 0;
            ImageHistoryForm imageForm;

            foreach (string imageTabDef in mTestSequence.mImageForms)
            {
                if (formNdx >= mImageForms.Count)
                {
                    AddNewImageForm();
                }
                imageForm = mImageForms[formNdx];
                imageForm.DeserializeDef(imageTabDef);
                formNdx++;
            }

            /*
             * if (formNdx < mImageForms.Count - 1)
             * {
             *  mImageForms.RemoveRange(formNdx, (mImageForms.Count - 1) - formNdx);
             * }
             */
            FormClosing += new FormClosingEventHandler(OperationForm_FormClosing);

            // find all of the control definer definitions in the test sequence
            foreach (OperatorControlDefinition operatorControlDefiner in mTestSequence.mOperatorControlDefiners)
            {
                // get and add all of the controls within each definer to the toolstrip
                int numControls = operatorControlDefiner.numberOfControls();
                for (int x = 0; x < numControls; x++)
                {
                    ToolStripItem newControl = operatorControlDefiner.createControlInstance(x);
                    toolStrip_Operator.Items.Add(newControl);

                    // let the definer know that there is a new operator form...so the active test execution (running in a separate thread) can register as a listener
                    operatorControlDefiner.RegisterNewOperatorForm(this);
                }
            }
        }