Esempio n. 1
0
        public FitForm(MainModel model)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.model = model;
            covarForm  = new CovarianceForm();

            fit               = new Fit();
            fit.Step         += Step;
            fit.EnableUndo    = true;
            fit.UseThreadPool = false;
            fit.Algorithm     = Fit.FitAlgorithm.Marquardt;
            fit.StepInterval  = 250;
            interval          = ModerateStepInterval / fit.StepInterval;
            Fitp              = new bool[0];
            //grid.Validating += new CancelEventHandler(gridValidating);

            ResetAlgorithm();
            ResetProgress();

            invoke = new InvokeHandler(StepInvoke);
            if (this.GetType().IsSerializable)
            {
                throw new Exception("FitForm must not be serializable");
            }
            model.Items.Handlers += this;

            Reset();

            function.SelectedIndexChanged += parChanged;
            data.SelectedIndexChanged     += parChanged;
        }
Esempio n. 2
0
 private void covarClick(object sender, System.EventArgs e)
 {
     if (covarForm.IsDisposed)
     {
         covarForm = new CovarianceForm();
     }
     this.Cursor = Cursors.WaitCursor;
     fit.EvalCovarianceMatrix();
     ResetErr();
     if (CovarianceMatrix != null)
     {
         covarForm.Reset(CovarianceMatrix);
         if (covarForm.WindowState == FormWindowState.Minimized)
         {
             covarForm.WindowState = FormWindowState.Normal;
         }
         covarForm.Show();
         covarForm.BringToFront();
     }
     this.Cursor = Cursors.Arrow;
 }