/// <summary>
        /// This will be called from the plot forms. thus the reason to be public
        /// </summary>
        /// <param name="mclsPCA"></param>
        public void PlotPCA(clsPCAplotPar pcaPlottingOptions)
        {
            if (mDataTab.Controls.Count == 0)
            {
                return;
            }

            #region Hook Threading Events

            m_BackgroundWorker.DoWork             += m_BackgroundWorker_GeneratePlots;
            m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_PCAPlotCompleted;

            #endregion

            var frmPCA = new frmPCAplotPar(pcaPlottingOptions);
            if (mhtDatasets.ContainsKey("Factors"))
            {
                var factorTable = mhtDatasets["Factors"];
                if (factorTable.mDTable.Columns.Count - 1 == pcaPlottingOptions.Datasets.Count)
                {
                    frmPCA.PopulateFactorComboBox = clsDataTable.DataTableRows(factorTable.mDTable);
                }
                else
                {
                    frmPCA.PopulateFactorComboBox = null;
                }
            }
            else
            {
                frmPCA.PopulateFactorComboBox = null;
            }

            if (frmPCA.ShowDialog() == DialogResult.OK)
            {
                mPCAOptions = frmPCA.PCAOptions;
                var pcaPlots = new clsRplotData(mPCAOptions.RCommand, "PCA");

                m_BackgroundWorker.RunWorkerAsync(pcaPlots);
                mProgressForm.Reset("Generating PCA Plots ...");
                mProgressForm.ShowDialog();
            }

            #region Unhook Threading Events

            m_BackgroundWorker.DoWork             -= m_BackgroundWorker_GeneratePlots;
            m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_PCAPlotCompleted;

            #endregion
        }
        /// <summary>
        /// This will be called from the plot forms. thus the reason to be public
        /// </summary>
        /// <param name="mclsPCA"></param>
        public void PlotPCA(clsPCAplotPar mclsPCA)
        {
            if (mtabControlData.Controls.Count == 0)
            {
                return;
            }

            #region Hook Threading Events
            m_BackgroundWorker.DoWork             += m_BackgroundWorker_GeneratePlots;
            m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_PCAPlotCompleted;
            #endregion

            var mfrmPCA = new frmPCAplotPar(mclsPCA);
            if (mhtDatasets.ContainsKey("Factors"))
            {
                var mclsFactors = mhtDatasets["Factors"];
                if ((mclsFactors.mDTable.Columns.Count - 1) == mclsPCA.Datasets.Count)
                {
                    mfrmPCA.PopulateFactorComboBox = clsDataTable.DataTableRows(mclsFactors.mDTable);
                }
                else
                {
                    mfrmPCA.PopulateFactorComboBox = null;
                }
            }
            else
            {
                mfrmPCA.PopulateFactorComboBox = null;
            }

            if (mfrmPCA.ShowDialog() == DialogResult.OK)
            {
                mclsPCApar = mfrmPCA.clsPCApar;
                var mclsRplots = new clsRplotData(mclsPCApar.Rcmd, "PCA");

                m_BackgroundWorker.RunWorkerAsync(mclsRplots);
                mfrmShowProgress.Message = "Generating PCA Plots ...";
                mfrmShowProgress.ShowDialog();
            }

            #region Unhook Threading Events
            m_BackgroundWorker.DoWork             -= m_BackgroundWorker_GeneratePlots;
            m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_PCAPlotCompleted;
            #endregion
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This will be called from the plot forms. thus the reason to be public
        /// </summary>
        /// <param name="mclsPCA"></param>
        public void PlotPCA(clsPCAplotPar mclsPCA)
        {
            if (mtabControlData.Controls.Count == 0)
            {
                return;
            }

            #region Hook Threading Events
            m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots;
            m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_PCAPlotCompleted;
            #endregion

            var mfrmPCA = new frmPCAplotPar(mclsPCA);
            if (mhtDatasets.ContainsKey("Factors"))
            {
                var mclsFactors = mhtDatasets["Factors"];
                if ((mclsFactors.mDTable.Columns.Count - 1) == mclsPCA.Datasets.Count)
                    mfrmPCA.PopulateFactorComboBox = clsDataTable.DataTableRows(mclsFactors.mDTable);
                else
                    mfrmPCA.PopulateFactorComboBox = null;
            }
            else
                mfrmPCA.PopulateFactorComboBox = null;

            if (mfrmPCA.ShowDialog() == DialogResult.OK)
            {
                mclsPCApar = mfrmPCA.clsPCApar;
                var mclsRplots = new clsRplotData(mclsPCApar.Rcmd, "PCA");

                m_BackgroundWorker.RunWorkerAsync(mclsRplots);
                mfrmShowProgress.Message = "Generating PCA Plots ...";
                mfrmShowProgress.ShowDialog();
            }

            #region Unhook Threading Events
            m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots;
            m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_PCAPlotCompleted;
            #endregion
        }