Skip to content

Commit

Permalink
Code for connecting DTC widgets to algorithm properties.
Browse files Browse the repository at this point in the history
Refs #7229
  • Loading branch information
arturbekasov committed Oct 14, 2013
1 parent f017052 commit ea460e2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ private slots:
void openFileDialog(const QString& filePropName);
void fillLogBox(const QString&);

private:
/// Show or hide Dead Time file widget depending on which Dead Time type is selected.
void showHideDeadTimeFileWidget(int deadTimeTypeIndex);

private:

// The form generated with Qt Designer
Ui::PlotAsymmetryByLogValueDialog m_uiForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,29 @@ void PlotAsymmetryByLogValueDialog::initLayout()
tie(m_uiForm.backwardBox, "BackwardSpectra");
tie(m_uiForm.timeMinBox, "TimeMin");
tie(m_uiForm.timeMaxBox, "TimeMax");
tie(m_uiForm.dtcType, "DeadTimeCorrType");
tie(m_uiForm.dtcFile, "DeadTimeCorrFile");

// Set-up browse button mapping
browseButtonMapper->setMapping(m_uiForm.browseFirstButton, "FirstRun");
browseButtonMapper->setMapping(m_uiForm.browseLastButton, "LastRun");
browseButtonMapper->setMapping(m_uiForm.dtcFileBrowseButton, "DeadTimeCorrFile");

// Connect Browse buttons to the mapper
connect(m_uiForm.browseFirstButton, SIGNAL(clicked()), browseButtonMapper, SLOT(map()));
connect(m_uiForm.browseLastButton, SIGNAL(clicked()), browseButtonMapper, SLOT(map()));

connect(m_uiForm.dtcFileBrowseButton, SIGNAL(clicked()), browseButtonMapper, SLOT(map()));

connect( m_uiForm.firstRunBox, SIGNAL(textChanged(const QString&)), this, SLOT(fillLogBox(const QString&)) );
connect( m_uiForm.btnOK,SIGNAL(clicked()),this,SLOT(accept()));
connect( m_uiForm.btnCancel,SIGNAL(clicked()),this,SLOT(reject()));
connect( m_uiForm.btnHelp,SIGNAL(clicked()),this,SLOT(helpClicked()));

// Fill Type ComboBox with allowed values
fillAndSetComboBox("Type",m_uiForm.typeBox);
connect( m_uiForm.dtcType, SIGNAL(currentIndexChanged(int)), this, SLOT(showHideDeadTimeFileWidget(int)));

// Fill ComboBoxes with allowed values
fillAndSetComboBox("Type", m_uiForm.typeBox);
fillAndSetComboBox("DeadTimeCorrType", m_uiForm.dtcType);

// Fill log values from the file
if ( !m_uiForm.firstRunBox->text().isEmpty() )
Expand Down Expand Up @@ -199,3 +206,13 @@ void PlotAsymmetryByLogValueDialog::fillLogBox(const QString&)
{
}
}

/**
* Show or hide Dead Time file widget depending on which Dead Time type is selected.
* @param deadTimeTypeIndex Selected Dead Time Correction type index
*/
void PlotAsymmetryByLogValueDialog::showHideDeadTimeFileWidget(int deadTimeTypeIndex)
{
// Show only if "Using specified file" selected
m_uiForm.dtcFileContainer->setVisible(deadTimeTypeIndex == 1);
}

0 comments on commit ea460e2

Please sign in to comment.