Esempio n. 1
0
void mirrors() {
  
  setStyle();

  init_parameters();
  write_parameters();

  simulateResponse();

  TControlBar* bar =
      new TControlBar("vertical", "LTCC Segments  by Maurizio Ungaro");
  bar->AddButton("", "");
  bar->AddButton("Show Photon Yield", "draw_W()");
  bar->AddButton("", "");
  bar->AddButton("Show refractive index of C4F10", "draw_c4f10n()");
  bar->AddButton("Show quantum efficiencies", "draw_qes()");
  bar->AddButton("Show reflectivities", "draw_reflectivities()");
  bar->AddButton("Show wc reflectivities", "draw_wcreflectivities()");
  bar->AddButton("Show Window Gains", "draw_window_gain()");
  bar->AddButton("", "");
  bar->AddButton("Integrate Yield", "integrate_yield()");
  bar->AddButton("Plot Yields", "plot_yields()");
  bar->AddButton("Plot Ratios", "normalized_yields_mirrors()");
  bar->AddButton("", "");
  bar->AddButton("Change particle", "change_particle()");
  bar->AddButton("Change mirror", "change_mirror()");
  bar->AddButton("Change gas", "change_gas()");
  bar->AddButton("Change pmt", "change_pmt()");
  bar->AddButton("Change WC", "change_WC()");
  bar->AddButton("", "");
  bar->AddButton("Simulate Response", "simulateResponse()");
  bar->AddButton("", "");
  bar->AddButton("Write Parameters", "write_parameters()");
  bar->AddButton("", "");
  bar->Show();

  // that's all!
}
Esempio n. 2
0
static void *logwriter_thread(void *arg)
{
	/* set name */
	prctl(PR_SET_NAME, "sdlog2_writer", 0);

	int log_fd = open_log_file();

	if (log_fd < 0) {
		return NULL;
	}

	struct logbuffer_s *logbuf = (struct logbuffer_s *)arg;

	/* write log messages formats, version and parameters */
	log_bytes_written += write_formats(log_fd);

	log_bytes_written += write_version(log_fd);

	log_bytes_written += write_parameters(log_fd);

	fsync(log_fd);

	int poll_count = 0;

	void *read_ptr;

	int n = 0;

	bool should_wait = false;

	bool is_part = false;

	while (true) {
		/* make sure threads are synchronized */
		pthread_mutex_lock(&logbuffer_mutex);

		/* update read pointer if needed */
		if (n > 0) {
			logbuffer_mark_read(&lb, n);
		}

		/* only wait if no data is available to process */
		if (should_wait && !logwriter_should_exit) {
			/* blocking wait for new data at this line */
			pthread_cond_wait(&logbuffer_cond, &logbuffer_mutex);
		}

		/* only get pointer to thread-safe data, do heavy I/O a few lines down */
		int available = logbuffer_get_ptr(logbuf, &read_ptr, &is_part);

		/* continue */
		pthread_mutex_unlock(&logbuffer_mutex);

		if (available > 0) {
			/* do heavy IO here */
			if (available > MAX_WRITE_CHUNK) {
				n = MAX_WRITE_CHUNK;

			} else {
				n = available;
			}

			n = write(log_fd, read_ptr, n);

			should_wait = (n == available) && !is_part;

			if (n < 0) {
				main_thread_should_exit = true;
				err(1, "error writing log file");
			}

			if (n > 0) {
				log_bytes_written += n;
			}

		} else {
			n = 0;

			/* exit only with empty buffer */
			if (main_thread_should_exit || logwriter_should_exit) {
				break;
			}

			should_wait = true;
		}

		if (++poll_count == 10) {
			fsync(log_fd);
			poll_count = 0;
		}
	}

	fsync(log_fd);
	close(log_fd);

	return NULL;
}
Esempio n. 3
0
static void 
checkargs (int argc, char **argv, char const ***image_template,
           char **wfa_name, float *quality, fiasco_c_options_t **options)
/*
 *  Check validness of command line parameters and of the parameter files.
 *
 *  Return value:
 *  1 on success
 *  0 otherwise
 *  
 *
 *  Side effects:
 *  'image_template', 'wfa_name', 'quality' and 'options' are set.
 */
{
    int   optind;            /* last processed commandline param */
    char *image_name;            /* filename given by option '--input_name' */
    int   i;             /* counter */
   
    optind = parseargs (params, argc, argv,
                        "Compress raw PPM/PGM image FILEs to a FIASCO file.",
                        "With no image FILE, or if FILE is -, "
                        "read standard input.\n"
                        "FILE must be either a filename"
                        " or an image template of the form:\n"
                        "`prefix[start-end{+,-}step]suffix'\n"
                        "e.g., img0[12-01-1].pgm is substituted by"
                        " img012.pgm ... img001.pgm\n\n"
                        "Environment:\n"
                        "FIASCO_DATA   Search and save path for FIASCO files. "
                        "Default: ./\n"
                        "FIASCO_IMAGES Search path for image files. "
                        "Default: ./", " [FILE]...",
                        FIASCO_SHARE, "system.fiascorc", ".fiascorc");

    /*
     *  Default options ...
     */
    image_name = (char *) parameter_value (params, "image-name"); 
    *wfa_name  = (char *) parameter_value (params, "output-name");
    for (;;)
    {
        *quality = * (float *) parameter_value (params, "quality");
        if (*quality > 100)
            fprintf (stderr, "Typical range of quality: (0,100].\n"
                     "Expect some trouble on slow machines.\n");
        if (*quality > 0)
            break;
        ask_and_set (params, "quality",
                     "Please enter coding quality 'q' ('q' > 0): ");
    }
   
    if (optind < argc)           /* Additional command line param */
    {
        if (image_name)
            error ("Multiple image_template arguments."
                   "\nOption --input-name %s already specified!", image_name);

        *image_template = calloc (argc - optind + 1, sizeof (char *));
        if (!*image_template)
            error ("Out of memory.");
        for (i = 0; optind < argc; i++, optind++)
            (*image_template) [i] = argv [optind];
        (*image_template) [i] = NULL;
    }
    else                 /* option -i image_name */
    {
        *image_template = calloc (2, sizeof (char *));
        if (!*image_template)
            error ("Out of memory.");
        (*image_template) [0] = image_name;
        (*image_template) [1] = NULL;
    }
    /*
     *  Additional options ... (have to be set with the fiasco_set_... methods)
     */
    {
        *options = fiasco_c_options_new ();
      
        {
            char *pattern = (char *) parameter_value (params, "pattern");

            if (!fiasco_c_options_set_frame_pattern (*options, pattern))
                error (fiasco_get_error_message ());
        }

        {
            char *basis = (char *) parameter_value (params, "basis-name");
     
            if (!fiasco_c_options_set_basisfile (*options, basis))
                error (fiasco_get_error_message ());
        }

        {
            int   n = * (int *) parameter_value (params, "chroma-dictionary");
            float q = * (float *) parameter_value (params, "chroma-qfactor");
      
            if (!fiasco_c_options_set_chroma_quality (*options, q, MAX(0, n)))
                error (fiasco_get_error_message ());
        }
      
        {
            int n = *((int *) parameter_value (params, "smooth"));
     
            if (!fiasco_c_options_set_smoothing (*options, MAX(0, n)))
                error (fiasco_get_error_message ());
        }
      
        {
            int n = * (int *) parameter_value (params, "progress-meter");
            fiasco_progress_e type = (n < 0) ? 
                FIASCO_PROGRESS_NONE : (fiasco_progress_e) n;
      
            if (!fiasco_c_options_set_progress_meter (*options, type))
                error (fiasco_get_error_message ());
        }
      
        {
            char *t = (char *) parameter_value (params, "title");
     
            if (strlen (t) > 0 && !fiasco_c_options_set_title (*options, t))
                error (fiasco_get_error_message ());
        }
      
        {
            char *c = (char *) parameter_value (params, "comment");

            if (strlen (c) > 0 && !fiasco_c_options_set_comment (*options, c))
                error (fiasco_get_error_message ());
        }
      
        {
            fiasco_tiling_e method = FIASCO_TILING_VARIANCE_DSC;
            int   e  = * (int *) parameter_value (params, "tiling-exponent");
            char *m  = (char *) parameter_value (params, "tiling-method");

            if (strcaseeq (m, "desc-variance"))
                method = FIASCO_TILING_VARIANCE_DSC;
            else if (strcaseeq (m, "asc-variance"))
                method = FIASCO_TILING_VARIANCE_ASC;
            else if (strcaseeq (m, "asc-spiral"))
                method = FIASCO_TILING_SPIRAL_ASC;
            else if (strcaseeq (m, "dsc-spiral"))
                method = FIASCO_TILING_SPIRAL_DSC;
            else
                error (_("Invalid tiling method `%s' specified."), m);

            if (!fiasco_c_options_set_tiling (*options, method, MAX(0, e)))
                error (fiasco_get_error_message ());
        }
      
        {
            int M/*  = * (int *) parameter_value (params, "max-level") */;
            int m/*  = * (int *) parameter_value (params, "min-level") */;
            int N/*  = * (int *) parameter_value (params, "max-elements") */;
            int D = * (int *) parameter_value (params, "dictionary-size");
            int o = * (int *) parameter_value (params, "optimize");

            if (o <= 0)
            {
                o = 0;
                M = 10;
                m = 6;
                N = 3;
            }
            else
            {
                o -= 1;
                M = 12;
                m = 4;
                N = 5;
            }
     
            if (!fiasco_c_options_set_optimizations (*options, m, M, N,
                                                     MAX(0, D), o))
                error (fiasco_get_error_message ());
        }
        {
            int M = * (int *) parameter_value (params, "max-level");
            int m = * (int *) parameter_value (params, "min-level");
            int p = * (int *) parameter_value (params, "prediction");
     
            if (!fiasco_c_options_set_prediction (*options,
                                                  p, MAX(0, m), MAX(0, M)))
                error (fiasco_get_error_message ());
        }
        {
            float r    = * (float *)parameter_value(params, "rpf-range");
            float dc_r = * (float *)parameter_value(params, "dc-rpf-range");
            int   m    = * (int *)  parameter_value(params, "rpf-mantissa");
            int   dc_m = * (int *)  parameter_value(params, "dc-rpf-mantissa");
            fiasco_rpf_range_e range, dc_range;
     
            if (r < 1)
                range = FIASCO_RPF_RANGE_0_75;
            else if (r < 1.5)
                range = FIASCO_RPF_RANGE_1_00;
            else if (r < 2.0)
                range = FIASCO_RPF_RANGE_1_50;
            else
                range = FIASCO_RPF_RANGE_2_00;
        
            if (dc_r < 1)
                dc_range = FIASCO_RPF_RANGE_0_75;
            else if (dc_r < 1.5)
                dc_range = FIASCO_RPF_RANGE_1_00;
            else if (dc_r < 2.0)
                dc_range = FIASCO_RPF_RANGE_1_50;
            else
                dc_range = FIASCO_RPF_RANGE_2_00;
        
            if (!fiasco_c_options_set_quantization (*options,
                                                    MAX(0, m), range,
                                                    MAX(0, dc_m), dc_range))
                error (fiasco_get_error_message ());
        }

        if (fiasco_get_verbosity () == FIASCO_ULTIMATE_VERBOSITY)
            write_parameters (params, stderr);
    }
}   
Esempio n. 4
0
DockWidget::DockWidget(PARSER *Input, QTextEdit* Ed)
{

	this->Inp = Input;
	this->Editor = Ed;

    mainLayout = new QVBoxLayout(this);
	editLayout = new QGridLayout;
	buttonLayout = new QHBoxLayout;
	messageLayout = new QHBoxLayout;
	progress_layout = new QVBoxLayout;

	mainLayout->addLayout(editLayout);
	mainLayout->addStretch();
	mainLayout->addLayout(buttonLayout);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);

	rec_mol2 = new QPushButton(tr("Receptor MOL2 file:"));
	choose_rec_mol2 = new QLineEdit(tr("Choose file..."));

	lig_mol2 = new QPushButton(tr("Ligand MOL2 file:"));
	choose_lig_mol2 = new QLineEdit(tr("Choose file..."));

	reflig_mol2 = new QPushButton(tr("Reference MOl2 file:"));
	choose_reflig_mol2 = new QLineEdit(tr("Choose file..."));

	docking_mol2 = new QPushButton(tr("Docking Molecules (MOL2 File): "));
	choose_docking_mol2 = new QLineEdit(tr("Choose files..."));

	mol2_aa = new QComboBox;
	mol2_aa->addItem("False"); // 0
	mol2_aa->addItem("True");  // 1
	mol2_aa->setCurrentIndex(0);
	mol2_aa_lab = new QLabel(tr("MOL2 File has Amber Atom Types? "));

	scoring_function = new QComboBox;
    scoring_function->addItem("Amber Softcore + Desolvation");        //0
    scoring_function->addItem("Amber Softcore");                      //1
    scoring_function->addItem("Amber FF + Desolvation");              //2
    scoring_function->addItem("Amber FF");                            //3
    scoring_function->setCurrentIndex(2);
	scoring_function_lab = new QLabel(tr("Scoring function: "));

	diel = new QDoubleSpinBox;
	diel->setMaximum(80.0);
	diel->setMinimum(1.0);
	diel->setDecimals(1);
	diel->setSingleStep(1.0);
    diel->setValue(Inp->diel);
	diel_lab = new QLabel(tr("Dieletric constant: "));

    dielectric_model = new QComboBox;
    dielectric_model->addItem("constant");          //0
    dielectric_model->addItem("r");                 //1
    dielectric_model->setCurrentIndex(1);
    dielectric_model_lab = new QLabel(tr("Dielectric Model: "));

	sigma = new QDoubleSpinBox;
	sigma->setDecimals(1);
	sigma->setSingleStep(0.1);
    sigma->setValue(Inp->sigma);
	sigma->setMinimum(1.0);
    sigma_lab = new QLabel(tr("Solvation sigma: "));

    alpha = new QDoubleSpinBox;
    alpha->setDecimals(2);
    alpha->setSingleStep(0.01);
    alpha->setValue(Inp->solvation_alpha);
    alpha->setMinimum(0.01);
    alpha_lab = new QLabel(tr("Alpha Solvation Parameter: "));

    beta = new QDoubleSpinBox;
    beta->setDecimals(3);
    beta->setMinimum(-10.000);
    beta->setSingleStep(0.001);
    beta->setValue(Inp->solvation_beta);
    beta_lab = new QLabel(tr("Beta Solvation Parameter: "));

	deltaij_vdw = new QDoubleSpinBox;
	deltaij_vdw->setMaximum(10.0);
	deltaij_vdw->setMinimum(0.0);
    deltaij_vdw->setValue(2.75);
	deltaij_vdw->setSingleStep(0.25);
	deltaij_vdw->setDecimals(2);
	deltaij_vdw_lab = new QLabel(tr("Softcore delta for VDW term: "));

	deltaij_elec = new QDoubleSpinBox;
	deltaij_elec->setMaximum(10.0);
	deltaij_elec->setMinimum(0.0);
	deltaij_elec->setValue(1.75);
	deltaij_elec->setSingleStep(0.25);
	deltaij_elec->setDecimals(2);
	deltaij_elec_lab = new QLabel(tr("Softcore delta for electrostatic term: "));

	vdw_scale = new QDoubleSpinBox;
	vdw_scale->setMaximum(100.0);
	vdw_scale->setMinimum(0.0);
	vdw_scale->setDecimals(1);
	vdw_scale->setSingleStep(1.0);
    vdw_scale->setValue(Inp->vdw_scale);
	vdw_scale_lab = new QLabel(tr("Scale for VDW term in overlay optimization: "));

	elec_scale = new QDoubleSpinBox;
	elec_scale->setMaximum(100.0);
	elec_scale->setMinimum(0.0);
	elec_scale->setDecimals(1);
	elec_scale->setSingleStep(1.0);
    elec_scale->setValue(Inp->elec_scale);
	elec_scale_lab = new QLabel(tr("Scale for electrostatic term in overlay optimization: "));

	box_size = new QDoubleSpinBox;
    box_size->setMinimum(0.1);
	box_size->setMaximum(50.0);
    box_size->setSingleStep(0.1);
	box_size->setDecimals(1);
    box_size->setValue(Inp->search_box_x);
    box_size_lab = new QLabel(tr("Search Box : "));

	min_delta = new QDoubleSpinBox;
	min_delta->setMinimum(1E-10);
	min_delta->setMaximum(1.0);
	min_delta->setDecimals(10);
	min_delta->setSingleStep(0.0000000001);
    min_delta->setValue(Inp->min_delta);
	min_delta_lab = new QLabel(tr("Minimization step: "));

	min_tol = new QDoubleSpinBox;
    min_tol->setMinimum(1e-10);
	min_tol->setMaximum(1.0);
    min_tol->setDecimals(10);
    min_tol->setSingleStep(0.0000000001);
    min_tol->setValue(Inp->min_tol);
	min_tol_lab = new QLabel(tr("Minimization tolerance: "));

	min_timeout = new QSpinBox;
	min_timeout->setMinimum(1);
	min_timeout->setMaximum(120);
	min_timeout->setSingleStep(1);
    min_timeout->setValue(Inp->min_timeout);
	min_timeout_lab = new QLabel(tr("Minimization timeout: "));

	overlay_optimizer = new QComboBox;
	overlay_optimizer->addItem("COBYLA");					//0
	overlay_optimizer->addItem("AUGLAG (Gradient-free)");	//1
    overlay_optimizer->addItem("AUGLAG");                   //2
    overlay_optimizer->addItem("LBFGS");					//3
    overlay_optimizer->addItem("MMA");						//4
    overlay_optimizer->addItem("SUBPLEX");                  //5
    overlay_optimizer->addItem("DIRECT");                   //6
	overlay_optimizer->setCurrentIndex(1);
	overlay_optimizer_lab = new QLabel(tr("Overlay optimizer: "));

	energy_optimizer = new QComboBox;
    energy_optimizer->addItem("COBYLA");                    //0
    energy_optimizer->addItem("AUGLAG (Gradient-free)");    //1
    energy_optimizer->addItem("AUGLAG");                    //2
    energy_optimizer->addItem("LBFGS");                     //3
    energy_optimizer->addItem("MMA");                       //4
    energy_optimizer->addItem("SUBPLEX");                   //5
    energy_optimizer->addItem("SIMPLEX");                   //6
    energy_optimizer->addItem("DIRECT");                    //7
    energy_optimizer->addItem("CRS");                       //8
	energy_optimizer->addItem("NONE");
    energy_optimizer->setCurrentIndex(7);
	energy_optimizer_lab = new QLabel(tr("Binding energy optimizer: "));

	output_prefix = new QLineEdit(tr("iMcLiBELa"));
	output_prefix_lab = new QLabel(tr("Output prefix: "));

    write_mol2 = new QCheckBox (tr("Write Mol2 file? "), this);
    write_mol2->setChecked(Inp->write_mol2);

    use_grids = new QCheckBox(tr("Use grids?"), this);
    use_grids->setChecked(Inp->use_grids);

    grid_spacing = new QDoubleSpinBox;
    grid_spacing->setValue(Inp->grid_spacing);
    grid_spacing->setDecimals(3);
    grid_spacing->setMinimum(0.01);
    grid_spacing->setMaximum(0.5);
    grid_spacing_lab = new QLabel(tr("Grid spacing: "));

    load_write_file = new QComboBox;
    load_write_file->addItem("Choose an option: ");
    load_write_file->addItem("Load File");
    load_write_file->addItem("Write File");

    grid_file = new QLineEdit;
    grid_file->setText("McGrid.grid");

    grid_box = new QDoubleSpinBox;
    grid_box->setValue(30.0);
    grid_box->setDecimals(1);
    grid_box->setMinimum(15.0);
    grid_box->setSingleStep(1.0);
    grid_box_lab = new QLabel(tr("Grid box: "));

	progressbar = new QProgressBar;
	progressbar->setRange(0, 100);
	progressbar->setValue(0);
	progress_label = new QLabel(tr("<h2>Progress</h2>"));
	progress_label->setAlignment(Qt::AlignHCenter);

    advanced_settings = new QCheckBox(tr("&Advanced settings"), this);

    dock_no_h = new QCheckBox(tr("Ignore hydrogens"), this);
	dock_no_h->setChecked(false);

    generate_conformers = new QCheckBox (tr("Generate conformers? "), this);
    generate_conformers->setChecked(Inp->generate_conformers);

    conformers_lab = new QLabel(tr("Number of conformers: "));
    conformers = new QSpinBox;
    conformers->setValue(Inp->lig_conformers);
    conformers->setSingleStep(1);
    conformers->setMinimum(1);

    conformers_to_evaluate_lab = new QLabel(tr("Conformers to optimize: "));
    conformers_to_evaluate = new QSpinBox;
    conformers_to_evaluate->setValue(Inp->conformers_to_evaluate);
    conformers_to_evaluate->setMinimum(1);

    conformer_generator_lab = new QLabel(tr("Conformer Generator: "));
    conformer_generator = new QComboBox;
    conformer_generator->addItem("GA");
    conformer_generator->addItem("WRS");
    conformer_generator->setCurrentIndex(0);

    dock_min_tol_lab = new QLabel(tr("Docking tolerance: "));
    dock_min_tol = new QDoubleSpinBox;
    dock_min_tol->setDecimals(10);
    dock_min_tol->setValue(Inp->dock_min_tol);


    dock_timeout_lab = new QLabel(tr("Docking timeout: "));
    dock_timeout = new QSpinBox;
    dock_timeout->setValue(Inp->min_timeout);

    parallel = new QCheckBox (tr("Parallel execution? "), this);

    parallel_jobs_lab = new QLabel(tr("Parallel jobs: "));
    parallel_jobs = new QSpinBox;
    parallel_jobs->setValue(1);
    parallel_jobs->setMinimum(1);

    files_label = new QLabel(tr("<h2>Input Files</h2>"));
    editLayout->addWidget(files_label, 0, 0);

    editLayout->addWidget(rec_mol2, 1, 0);
    editLayout->addWidget(choose_rec_mol2, 1, 1);

    editLayout->addWidget(reflig_mol2, 2, 0);
    editLayout->addWidget(choose_reflig_mol2, 2, 1);

    editLayout->addWidget(docking_mol2, 3, 0);
    editLayout->addWidget(choose_docking_mol2, 3, 1);

    editLayout->addWidget(mol2_aa_lab, 4, 0);
    editLayout->addWidget(mol2_aa, 4, 1);

    output_label = new QLabel(tr("<h2>Output Files</h2>"));
    editLayout->addWidget(output_label, 5, 0);

    editLayout->addWidget(output_prefix_lab, 6, 0);
    editLayout->addWidget(output_prefix, 6, 1);

    editLayout->addWidget(write_mol2, 7,0);

    sf_input = new QLabel(tr("<h2>Scoring options</h2>"));
    editLayout->addWidget(sf_input, 8, 0);

    editLayout->addWidget(scoring_function_lab, 9, 0);
    editLayout->addWidget(scoring_function, 9, 1);

    editLayout->addWidget(box_size_lab, 10, 0);
    editLayout->addWidget(box_size, 10, 1);

    editLayout->addWidget(diel_lab, 11, 0);
    editLayout->addWidget(diel, 11, 1);

    editLayout->addWidget(dielectric_model_lab, 12, 0);
    editLayout->addWidget(dielectric_model, 12, 1);

    editLayout->addWidget(sigma_lab, 13, 0);
    editLayout->addWidget(sigma, 13, 1);

    editLayout->addWidget(alpha_lab, 14, 0);
    editLayout->addWidget(alpha, 14, 1);

    editLayout->addWidget(beta_lab, 15, 0);
    editLayout->addWidget(beta, 15, 1);

    editLayout->addWidget(deltaij_vdw_lab, 16, 0);
    editLayout->addWidget(deltaij_vdw, 16, 1);

    editLayout->addWidget(deltaij_elec_lab, 17, 0);
    editLayout->addWidget(deltaij_elec, 17, 1);

    editLayout->addWidget(vdw_scale_lab, 18, 0);
    editLayout->addWidget(vdw_scale, 18, 1);

    editLayout->addWidget(elec_scale_lab, 19, 0);
    editLayout->addWidget(elec_scale, 19, 1);

    opt_input = new QLabel(tr("<h2>Optimization options</h2>"));
    editLayout->addWidget(opt_input, 20, 0);

    editLayout->addWidget(min_delta_lab, 21, 0);
    editLayout->addWidget(min_delta, 21, 1);

    editLayout->addWidget(min_tol_lab, 22, 0);
    editLayout->addWidget(min_tol, 22, 1);

    editLayout->addWidget(dock_min_tol_lab, 23, 0);
    editLayout->addWidget(dock_min_tol, 23, 1);

    editLayout->addWidget(min_timeout_lab, 24, 0);
    editLayout->addWidget(min_timeout, 24, 1);

    editLayout->addWidget(dock_timeout_lab, 25, 0);
    editLayout->addWidget(dock_timeout, 25, 1);

    editLayout->addWidget(overlay_optimizer_lab, 26, 0);
    editLayout->addWidget(overlay_optimizer, 26, 1);

    editLayout->addWidget(energy_optimizer_lab, 27, 0);
    editLayout->addWidget(energy_optimizer, 27, 1);

    editLayout->addWidget(box_size_lab, 28, 0);
    editLayout->addWidget(box_size, 28, 1);

    editLayout->addWidget(dock_no_h, 29, 0);

    conf_input = new QLabel(tr("<h2>Conformer options</h2>"));
    editLayout->addWidget(conf_input, 30, 0);

    editLayout->addWidget(generate_conformers, 31, 0);

    editLayout->addWidget(conformers_lab, 32, 0);
    editLayout->addWidget(conformers, 32, 1);

    editLayout->addWidget(conformers_to_evaluate_lab, 33, 0);
    editLayout->addWidget(conformers_to_evaluate, 33, 1);

    editLayout->addWidget(conformer_generator_lab, 34, 0);
    editLayout->addWidget(conformer_generator, 34, 1);

    parallel_label = new QLabel(tr("<h2>Parallel execution</h2>"));
    editLayout->addWidget(parallel_label, 35, 0);

    editLayout->addWidget(parallel, 36, 0);

    editLayout->addWidget(parallel_jobs_lab, 37, 0);
    editLayout->addWidget(parallel_jobs, 37, 1);

    grid_label = new QLabel(tr("<h2>Grid Potentials</h2>"));
    editLayout->addWidget(grid_label, 38, 0);

    editLayout->addWidget(use_grids, 39,0);

    editLayout->addWidget(grid_spacing_lab, 40,0);
    editLayout->addWidget(grid_spacing, 40,1);

    editLayout->addWidget(load_write_file, 41, 0);
    editLayout->addWidget(grid_file, 41, 1);

    editLayout->addWidget(grid_box_lab, 42, 0);
    editLayout->addWidget(grid_box, 42, 1);

	progress_layout->addWidget(advanced_settings);
	progress_layout->addWidget(progress_label, Qt::AlignCenter);
	progress_layout->addWidget(progressbar);

	mainLayout->addStretch();
	mainLayout->addLayout(progress_layout);
	mainLayout->addStretch();

	Run = new QPushButton(tr("Run!"));
	WriteButton = new QPushButton(tr("Write parameter file"));

	buttonLayout->addStretch();
	buttonLayout->addWidget(WriteButton, Qt::AlignHCenter);
	buttonLayout->addWidget(Run, Qt::AlignHCenter);

	Run->setDefault(true);
	setWindowTitle(tr("iMcLiBEla by Alessandro Nascimento"));

	connect(rec_mol2, SIGNAL(clicked()), this, SLOT(choose_rec_file()));
	connect(reflig_mol2, SIGNAL(clicked()), this, SLOT(choose_reflig_file()));
	connect(docking_mol2, SIGNAL(clicked()), this, SLOT(choose_docking_mol2_files()));
	connect(advanced_settings, SIGNAL(toggled(bool)), this, SLOT(show_advanced_setttings(bool)));
	connect(Run, SIGNAL(clicked()), this, SLOT(Start()));
	connect(WriteButton, SIGNAL(clicked()), this, SLOT(write_parameters()));
    connect(scoring_function, SIGNAL(currentIndexChanged(int)), this, SLOT(show_scoring_function_options(int)));

    connect(write_mol2, SIGNAL(stateChanged(int)), this, SLOT(slot_write_mol2(int)));
    connect(dock_no_h, SIGNAL(stateChanged(int)), this, SLOT(slot_ignore_h(int)));
    connect(generate_conformers, SIGNAL(stateChanged(int)), this, SLOT(slot_generate_conformers(int)));
//    connect(parallel, SIGNAL(stateChanged(int)), this, SLOT(slot_parallel(int)));
    connect(parallel_jobs, SIGNAL(valueChanged(int)), this, SLOT(slot_parallel(int)));

    connect(load_write_file, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_grid_file(int)));
    connect(use_grids, SIGNAL(stateChanged(int)), this, SLOT(slot_use_grids(int)));

    this->set_initial_parameters();
    this->hide_advanced_options();
}