void m_BackgroundWorker_GenerateHeatmap(object sender, DoWorkEventArgs e)
        {
            var arg      = (clsRplotData)e.Argument;
            var rcmd     = arg.mstrRcmd;
            var plotName = arg.mstrPlotName;

            try
            {
                mRConnector.EvaluateNoReturn(rcmd);
                if (mDoClustering)
                {
                    if (mRConnector.GetTableFromRvector("clusterResults"))
                    {
                        var clusterResultTable = mRConnector.DataTable.Copy();
                        clusterResultTable.TableName = "clusterResults";
                        AddDataset2HashTable(clusterResultTable);
                    }
                }
                mRConnector.EvaluateNoReturn("cat(\"Heatmap done.\n\")");
                var heatmapResult = new clsPlotResult(LoadImage(mRTempFilePath), plotName);
                e.Result = heatmapResult;
            }
            catch (Exception ex)
            {
                MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
                e.Result = null;
                e.Cancel = true;
                DeleteTempFile(mRTempFilePath);
            }
        }
        void m_BackgroundWorker_GenerateHeatmap(object sender, DoWorkEventArgs e)
        {
            var arg = (clsRplotData)e.Argument;
            var rcmd = arg.mstrRcmd;
            var plotname = arg.mstrPlotName;

            try
            {

                mRConnector.EvaluateNoReturn(rcmd);
                if (doClust)
                    if (mRConnector.GetTableFromRvector("clusterResults"))
                    {
                        var mDTclusters = mRConnector.DataTable.Copy();
                        mDTclusters.TableName = "clusterResults";
                        AddDataset2HashTable(mDTclusters);
                    }
                mRConnector.EvaluateNoReturn("cat(\"Heatmap done.\n\")");
                var mclsPlotResult = new clsPlotResult(LoadImage(mRTempFilePath), plotname);
                e.Result = mclsPlotResult;
            }
            catch (Exception ex)
            {
                MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
                e.Result = null;
                e.Cancel = true;
                DeleteTempFile(mRTempFilePath);
            }
        }
        void m_BackgroundWorker_GenerateHeatmap(object sender, DoWorkEventArgs e)
        {
            DataTable     mDTclusters = new DataTable();
            clsRplotData  arg         = (clsRplotData)e.Argument;
            string        rcmd        = arg.mstrRcmd;
            string        plotname    = arg.mstrPlotName;
            clsPlotResult mclsPlotResult;

            try
            {
                rConnector.rdcom.EvaluateNoReturn(rcmd);
                if (doClust)
                {
                    if (rConnector.GetTableFromRvector("clusterResults"))
                    {
                        mDTclusters           = rConnector.mDataTable.Copy();
                        mDTclusters.TableName = "clusterResults";
                        AddDataset2HashTable(mDTclusters);
                    }
                }
                rConnector.rdcom.EvaluateNoReturn("cat(\"Heatmap done.\n\")");
                mclsPlotResult = new clsPlotResult(LoadImage(tempFile), plotname);
                e.Result       = mclsPlotResult;
            }
            catch (Exception ex)
            {
                MessageBox.Show("RDCOM failed: " + ex.Message, "Error!");
                e.Result = null;
                e.Cancel = true;
                DeleteTempFile(tempFile);
            }
        }
Beispiel #4
0
        void m_BackgroundWorker_GeneratePlots(object sender, DoWorkEventArgs e)
        {
            var           arg      = (clsRplotData)e.Argument;
            var           rcmd     = arg.mstrRcmd;
            var           plotname = arg.mstrPlotName;
            clsPlotResult mclsPlotResult;

            try {
                mRConnector.EvaluateNoReturn(rcmd);
                mclsPlotResult = new clsPlotResult(LoadImage(mRTempFilePath), plotname);
                e.Result       = mclsPlotResult;
            }
            catch (Exception ex) {
                MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
                e.Result = null;
                e.Cancel = true;
                DeleteTempFile(mRTempFilePath);
            }
        }
        void m_BackgroundWorker_GeneratePlots(object sender, DoWorkEventArgs e)
        {
            var arg = (clsRplotData)e.Argument;
              var rcmd = arg.mstrRcmd;
              var plotname = arg.mstrPlotName;
              clsPlotResult mclsPlotResult;

              try {

            mRConnector.EvaluateNoReturn(rcmd);
            mclsPlotResult = new clsPlotResult(LoadImage(mRTempFilePath), plotname);
            e.Result = mclsPlotResult;
              }
              catch (Exception ex) {
            MessageBox.Show("R.Net failed: " + ex.Message, "Error!");
            e.Result = null;
            e.Cancel = true;
            DeleteTempFile(mRTempFilePath);
              }
        }
        void m_BackgroundWorker_GenerateHeatmap(object sender, DoWorkEventArgs e)
        {
            DataTable mDTclusters = new DataTable();
            clsRplotData arg = (clsRplotData)e.Argument;
            string rcmd = arg.mstrRcmd;
            string plotname = arg.mstrPlotName;
            clsPlotResult mclsPlotResult;

            try
            {

                rConnector.rdcom.EvaluateNoReturn(rcmd);
                if (doClust)
                    if (rConnector.GetTableFromRvector("clusterResults"))
                    {
                        mDTclusters = rConnector.mDataTable.Copy();
                        mDTclusters.TableName = "clusterResults";
                        AddDataset2HashTable(mDTclusters);
                    }
                rConnector.rdcom.EvaluateNoReturn("cat(\"Heatmap done.\n\")");
                mclsPlotResult = new clsPlotResult(LoadImage(tempFile), plotname);
                e.Result = mclsPlotResult;
            }
            catch (Exception ex)
            {
                MessageBox.Show("RDCOM failed: " + ex.Message, "Error!");
                e.Result = null;
                e.Cancel = true;
                DeleteTempFile(tempFile);
            }
        }