Esempio n. 1
0
        /// <summary>
        /// Check if the current state of project is different from the persisted version
        /// Also Update ActualData Vie with values from GUI
        /// </summary>
        /// <param name="exp"></param>
        /// <param name="funPanel1"></param>
        /// <param name="parPanel1"></param>
        /// <param name="runPanel1"></param>
        /// <param name="resPanel1"></param>
        /// <param name="testPanel1"></param>
        /// <returns></returns>
        public bool IsModified(ProjectController exp, FunctionPanel funPanel1, ParametersPanel parPanel1, RunPanel runPanel1, ResultPanel resPanel1, TestPanel testPanel1)
        {
            var models = exp.Models;

            if (exp.Project.IsDirty)
            {
                return(true);
            }
            //
            foreach (var m in models)
            {
                //active model can contains unsaved data
                if (ActiveView is ModelController)
                {
                    var mm = (ModelController)ActiveView;
                    if (mm.Model.Guid == m.Model.Guid)
                    {
                        m.getCurrentValues(funPanel1, parPanel1, runPanel1, resPanel1, testPanel1);
                    }
                }
                //check for modification
                if (m.IsModified())
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
        public MainWindow()
        {
            Controller = new AppController();
            Controller.ReportException = this.ReportException;
            InitializeComponent();
            this.Icon = Extensions.LoadIconFromName("GPdotNet.Wnd.Dll.Images.gpdotnet.ico");

            #region additional initialization
            this.expPanel1  = new ExperimentPanel();
            this.funPanel1  = new FunctionPanel();
            this.parPanel1  = new ParametersPanel();
            this.runPanel1  = new RunPanel();
            this.resPanel1  = new ResultPanel();
            this.testPanel1 = new TestPanel();
            this.infoPanel1 = new InfoPanel();
            //
            // expPanel1
            //
            this.expPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.expPanel1.Location = new System.Drawing.Point(3, 3);
            this.expPanel1.Name     = "expPanel1";
            this.expPanel1.Size     = new System.Drawing.Size(463, 222);
            this.expPanel1.TabIndex = 0;
            //
            // runPanel1
            //
            this.infoPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.infoPanel1.Location = new System.Drawing.Point(3, 3);
            this.infoPanel1.Name     = "runPanel1";
            this.infoPanel1.Size     = new System.Drawing.Size(463, 222);
            this.infoPanel1.TabIndex = 1;
            //
            // funPanel1
            //
            this.funPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.funPanel1.Location = new System.Drawing.Point(3, 3);
            this.funPanel1.Name     = "funPanel1";
            this.funPanel1.Size     = new System.Drawing.Size(463, 222);
            this.funPanel1.TabIndex = 0;
            //
            // parPanel1
            //
            this.parPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.parPanel1.Location = new System.Drawing.Point(3, 3);
            this.parPanel1.Name     = "parPanel1";
            this.parPanel1.Size     = new System.Drawing.Size(463, 222);
            this.parPanel1.TabIndex = 0;
            //
            // runPanel1
            //
            this.runPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.runPanel1.Location = new System.Drawing.Point(3, 3);
            this.runPanel1.Name     = "runPanel1";
            this.runPanel1.Size     = new System.Drawing.Size(463, 222);
            this.runPanel1.TabIndex = 0;
            //
            // resPanel1
            //
            this.resPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.resPanel1.Location = new System.Drawing.Point(3, 3);
            this.resPanel1.Name     = "resPanel1";
            this.resPanel1.Size     = new System.Drawing.Size(463, 222);
            this.resPanel1.TabIndex = 0;
            //
            // testPanel1
            //
            this.testPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.testPanel1.Location = new System.Drawing.Point(3, 3);
            this.testPanel1.Name     = "testPanel1";
            this.testPanel1.Size     = new System.Drawing.Size(463, 222);
            this.testPanel1.TabIndex = 0;

            //
            this.tabPage3.Controls.Add(funPanel1);
            this.tabPage4.Controls.Add(parPanel1);
            this.tabPage5.Controls.Add(runPanel1);
            this.tabPage6.Controls.Add(resPanel1);
            this.tabPage7.Controls.Add(testPanel1);
            this.tabPage1.Controls.Add(expPanel1);
            this.tabPage2.Controls.Add(infoPanel1);
            #endregion
            treeView1.LabelEdit  = true;
            this.Load           += MainWindow_Load;
            this.FormClosing    += MainWindow_FormClosing;
            this.ribbonTab1.Text = AboutGPdotNET.AssemblyTitle;

            SetStopMode("");
        }