// this will be called from the plot forms.
        // thus the reason to be public
        public void PlotCorrelation(clsCorrelationPar clsCorrPar)
        {
            if (mtabControlData.Controls.Count != 0)
            {
                #region Hook Threading Events
                m_BackgroundWorker.DoWork += m_BackgroundWorker_GeneratePlots;
                m_BackgroundWorker.RunWorkerCompleted += m_BackgroundWorker_CorrPlotCompleted;
                #endregion

                frmCorrelationPar mfrmCorrPar;
                mfrmCorrPar = new frmCorrelationPar(clsCorrPar);

                DialogResult res = mfrmCorrPar.ShowDialog();
                if (res == DialogResult.OK)
                {
                    mclsCorrPar = mfrmCorrPar.clsCorrPar;
                    var mclsRplots = new clsRplotData(mclsCorrPar.Rcmd, "Corr");

                    m_BackgroundWorker.RunWorkerAsync(mclsRplots);
                    mfrmShowProgress.Message = "Generating Correlation Plot ...";
                    mfrmShowProgress.ShowDialog();
                }

                #region Unhook Threading Events
                m_BackgroundWorker.DoWork -= m_BackgroundWorker_GeneratePlots;
                m_BackgroundWorker.RunWorkerCompleted -= m_BackgroundWorker_CorrPlotCompleted;
                #endregion
            }
        }
Example #2
0
 public frmCorrDisplay(clsCorrelationPar clsCorrPar)
 {
     InitializeComponent();
     mclsCorrPar = clsCorrPar;
     this.mnuItemPara.Click += new System.EventHandler(this.mnuItemPara_Click);
     this.parametersToolStripMenuItem.Click += new System.EventHandler(this.mnuItemPara_Click);
     this.mtBtnParam.Click += new System.EventHandler(this.mnuItemPara_Click);
 }
        private void menuItemCorr_Click(object sender, EventArgs e)
        {
            var mclsSelected = (clsDatasetTreeNode)ctltreeView.SelectedNode.Tag;

            if (!ValidateNodeIsSelected(mclsSelected))
            {
                return;
            }

            if (!ValidateIsPlottable(mclsSelected, 2))
            {
                return;
            }

            mclsCorrPar = new clsCorrelationPar();
            var datasetNameInR = mclsSelected.mstrRdatasetName;

            mclsCorrPar.tempFile = mRTempFilePath;
            mclsCorrPar.Rdataset = datasetNameInR;
            mclsCorrPar.Datasets = clsDataTable.DataTableColumns(mclsSelected.mDTable, datasetNameInR);
            mclsCorrPar.mstrDatasetName = mclsSelected.mstrDataText;

            PlotCorrelation(mclsCorrPar);
        }