Ejemplo n.º 1
0
  /**
   * Sets control button to be start/stop depending on new dialog state.
   * @param newState :: New state of the dialog 
   */
  void MuonSequentialFitDialog::updateControlButtonType(DialogState newState)
  {
    // Disconnect everything connected to pressed() signal of the button 
    disconnect( m_ui.controlButton, SIGNAL( pressed() ), 0, 0);
 
    // Connect to appropriate slot
    auto buttonSlot = (newState == Running) ? SLOT( stopFit() ) : SLOT( startFit() );
    connect( m_ui.controlButton, SIGNAL( pressed() ), this, buttonSlot );

    // Set appropriate text
    QString buttonText = (newState == Running) ? "Stop" : "Start";
    m_ui.controlButton->setText(buttonText);
  }
Ejemplo n.º 2
0
int ipc_fitupdate(void)
{
  int ret;

  debug_message("ipc_fitupdate with %s\n", fit_callback);
  ret = Tcl_Eval(fit_interp, fit_callback);
  if (ret == TCL_OK) {
    Tcl_ResetResult(fit_interp);
    /* XXX FIXME XXX if fit speed improves, we may not want to evaluate
     * this every time --- leave it to the fit_callback code to decide?
     */
    flushqueue();
  } else {
    failure = 1;
    stopFit(0);
  }
  return TCL_OK;
}
Ejemplo n.º 3
0
static void tclconstraints(int del, double a[], int nt, int nm, int nr, int nb)
{
  int ret;

  if (abortFit) return;

  clipdepth(del,a,nt,nm,nr,nb);
  if (fit_constraints) {
    genshift(a,FALSE);
    ret = Tcl_Eval(fit_interp, fit_constraints);
    if (ret == TCL_OK) {
      /* XXX FIXME XXX we can remove both this genshift and the
       * genshift in fgen/fsgen */
      genshift(a,TRUE);
      Tcl_ResetResult(fit_interp);
    } else {
      if (ret == TCL_ERROR) failure = 1;
      stopFit(0);
    }
  }
  /* XXX FIXME XXX why did I want to run the event loop during constraints? */
  /* flushqueue(); */
}