Example #1
0
        private void SaveView(string guid)
        {
            try
            {
                var p = Controller.GetView(guid);

                if (p == null)
                {
                    return;
                }

                else if (p is ProjectController)
                {
                    Cursor.Current = Cursors.WaitCursor;


                    var pController = p as ProjectController;

                    //after the data is retrieved panel should be reset
                    if (pController.Project.DataSet != null)
                    {
                        pController.Project.DataSet = expPanel1.GetDataSet();
                    }

                    expPanel1.ResetExperimentalPanel();
                }
                else if (p is ANNModel)
                {
                    var model = p as ANNModel;

                    //save only termination criteria from run panel
                    model.ModelData = runPanel1.GetParameters();
                    runPanel1.ResetChart();
                    //test panel
                    testPanel1.ResetChart();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                //back normal cursor
                Cursor.Current = Cursors.Default;
            }
        }
Example #2
0
        private void SaveView(string guid)
        {
            try
            {
                var p = Controller.GetView(guid);

                if (p == null)
                {
                    return;
                }
                else if (p is ProjectController)
                {
                    Cursor.Current = Cursors.WaitCursor;


                    var pController = p as ProjectController;

                    //get latest data from gui  panel
                    pController.Project.DataSet = expPanel1.GetDataSet();

                    //get rich text project info
                    pController.Project.ProjectInfo = infoPanel1.InfoText;

                    //after the data is retrieved panel should be reset
                    expPanel1.ResetExperimentalPanel();
                }
                else if (p is ModelController)
                {
                    var mController = p as ModelController;

                    //get functionSet
                    var funStr = funPanel1.FunctionSetToString();
                    mController.SetFunction(funStr);
                    //get parameters
                    var par = parPanel1.ParametersToString();
                    mController.SetParameters(par);

                    //save only termination criteria from run panel
                    runPanel1.ResetChart();
                    var tc = runPanel1.GetTerminationCriteria();
                    mController.SetTerminationCriteria(tc);

                    mController.IsActive = false;
                    //reset result panel
                    resPanel1.Reset();

                    //test panel
                    testPanel1.ResetChart();
                }
            }
            catch (Exception ex)
            {
                ReportException(ex);
                //throw;
            }
            finally
            {
                //back normal cursor
                Cursor.Current = Cursors.Default;
            }
        }