BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The FitParametersWidget class contains a tree view to set fit parameters (fix/release, starting value, min/max bounds). It occupies bottom right corner of JobView.
Definition at line 37 of file FitParameterWidget.h.
Public Slots | |
void | onFitParametersSelectionChanged (const QItemSelection &selection) |
Propagates selection form the tree with fit parameters to the tuning widget. More... | |
void | onFitParameterTreeContextMenu (const QPoint &point) |
Creates context menu for the tree with fit parameters. More... | |
void | onTuningWidgetContextMenu (const QPoint &point) |
Creates context menu for ParameterTuningWidget. More... | |
Public Member Functions | |
FitParameterWidget (QWidget *parent=nullptr) | |
virtual QList< QAction * > | actionList () |
SessionItem * | currentItem () |
const SessionItem * | currentItem () const |
virtual void | setItem (SessionItem *item) |
void | setParameterTuningWidget (ParameterTuningWidget *tuningWidget) |
Sets ParameterTuningWidget to be able to provide it with context menu and steer its behaviour in the course of fit settings or fit running. More... | |
Protected Member Functions | |
void | hideEvent (QHideEvent *) override |
void | showEvent (QShowEvent *) override |
void | subscribeToItem () override |
virtual void | unsubscribeFromItem () |
Private Slots | |
void | onAddToFitParAction (int ipar) |
Add all selected parameters to fitParameter with given index. More... | |
void | onCreateFitParAction () |
Creates fit parameters for all selected ParameterItem's in tuning widget. More... | |
void | onFitParameterModelChange () |
void | onRemoveFitParAction () |
All selected FitParameterItem's of FitParameterItemLink's will be removed. More... | |
void | onRemoveFromFitParAction () |
All ParameterItem's selected in tuning widget will be removed from link section of corresponding fitParameterItem. More... | |
Private Member Functions | |
bool | canCreateFitParameter () |
Returns true if tuning widget contains selected ParameterItem's which can be used to create a fit parameter (i.e. it is not linked with some fit parameter already). More... | |
bool | canRemoveFromFitParameters () |
Returns true if tuning widget contains selected ParameterItem's which can be removed from fit parameters. More... | |
void | connectFitParametersSelection (bool active) |
QVector< FitParameterItem * > | emptyFitParameters () |
Returns list of FitParameterItem's which doesn't have any links attached. More... | |
void | init_actions () |
void | init_fit_model () |
Initializes FitParameterModel and its tree. More... | |
JobItem * | jobItem () |
QStringList | selectedFitParameterLinks () |
Returns links of FitParameterLink's item selected in FitParameterItem tree. More... | |
QVector< FitParameterItem * > | selectedFitParameters () |
Returns list of FitParameterItem's currently selected in FitParameterItem tree. More... | |
void | setActionsEnabled (bool value) |
Enables/disables all context menu actions. More... | |
void | spanParameters () |
Makes first column in FitParameterItem's tree related to ParameterItem link occupy whole space. More... | |
void | updateInfoLabel () |
Places overlay label on top of tree view, if there is no fit parameters. More... | |
Private Attributes | |
QAction * | m_createFitParAction |
FitParameterModel * | m_fitParameterModel |
OverlayLabelController * | m_infoLabel |
SessionItemController * | m_itemController |
DeleteEventFilter * | m_keyboardFilter |
QAction * | m_removeFitParAction |
QAction * | m_removeFromFitParAction |
QTreeView * | m_treeView |
ParameterTuningWidget * | m_tuningWidget |
FitParameterWidget::FitParameterWidget | ( | QWidget * | parent = nullptr | ) |
Definition at line 39 of file FitParameterWidget.cpp.
References init_actions(), m_infoLabel, m_keyboardFilter, m_treeView, onFitParameterTreeContextMenu(), OverlayLabelController::setArea(), and OverlayLabelController::setText().
|
virtualinherited |
Reimplemented in IntensityDataProjectionsWidget, SpecularDataWidget, SpecularDataCanvas, FitComparisonWidget1D, FitComparisonWidget, IntensityDataWidget, IntensityDataCanvas, SpecularDataImportWidget, RealDataPresenter, and RealDataMaskWidget.
Definition at line 36 of file SessionItemWidget.cpp.
Referenced by ItemComboWidget::setPresentation().
|
private |
Returns true if tuning widget contains selected ParameterItem's which can be used to create a fit parameter (i.e. it is not linked with some fit parameter already).
Definition at line 266 of file FitParameterWidget.cpp.
References ParameterTuningWidget::getSelectedParameters(), jobItem(), and m_tuningWidget.
Referenced by onTuningWidgetContextMenu().
|
private |
Returns true if tuning widget contains selected ParameterItem's which can be removed from fit parameters.
Definition at line 279 of file FitParameterWidget.cpp.
References ParameterTuningWidget::getSelectedParameters(), jobItem(), and m_tuningWidget.
Referenced by onTuningWidgetContextMenu().
|
private |
Definition at line 372 of file FitParameterWidget.cpp.
References m_treeView, and onFitParametersSelectionChanged().
Referenced by init_fit_model().
|
inherited |
Definition at line 41 of file SessionItemWidget.cpp.
Referenced by FitFlowWidget::fitSuiteItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), IntensityDataWidget::intensityDataItem(), IntensityDataProjectionsWidget::intensityDataItem(), ProjectionsPlot::intensityItem(), ColorMap::intensityItem(), JobResultsPresenter::itemPresentation(), jobItem(), ParameterTuningWidget::jobItem(), RunFitControlWidget::jobItem(), FitComparisonWidget::jobItem(), FitComparisonWidget1D::jobItem(), IntensityDataPropertyWidget::jobItem(), SpecularDataPropertyWidget::jobItem(), SpecularDataImportWidget::realDataItem(), ItemComboWidget::setPresentation(), JobResultsPresenter::setPresentation(), SpecularDataImportWidget::specularDataItem(), SpecularDataCanvas::specularDataItem(), SpecularDataWidget::specularDataItem(), SpecularPlot::specularItem(), ItemComboWidget::subscribeToItem(), ProjectionsPlot::unsubscribeFromChildren(), and Plot1D::viewItem().
|
inherited |
Definition at line 46 of file SessionItemWidget.cpp.
References SessionItemController::currentItem(), and SessionItemWidget::m_itemController.
|
private |
Returns list of FitParameterItem's which doesn't have any links attached.
Definition at line 318 of file FitParameterWidget.cpp.
References jobItem().
|
overrideprotectedinherited |
Definition at line 56 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().
|
private |
Definition at line 225 of file FitParameterWidget.cpp.
References m_createFitParAction, m_keyboardFilter, m_removeFitParAction, m_removeFromFitParAction, onCreateFitParAction(), onRemoveFitParAction(), onRemoveFromFitParAction(), and DeleteEventFilter::removeItem().
Referenced by FitParameterWidget().
|
private |
Initializes FitParameterModel and its tree.
Definition at line 245 of file FitParameterWidget.cpp.
References connectFitParametersSelection(), jobItem(), m_fitParameterModel, m_treeView, and onFitParameterModelChange().
Referenced by subscribeToItem().
|
private |
Definition at line 383 of file FitParameterWidget.cpp.
References SessionItemWidget::currentItem().
Referenced by canCreateFitParameter(), canRemoveFromFitParameters(), emptyFitParameters(), init_fit_model(), onAddToFitParAction(), onCreateFitParAction(), onFitParametersSelectionChanged(), onFitParameterTreeContextMenu(), onRemoveFitParAction(), onRemoveFromFitParAction(), onTuningWidgetContextMenu(), and updateInfoLabel().
|
privateslot |
Add all selected parameters to fitParameter with given index.
Definition at line 207 of file FitParameterWidget.cpp.
References FitParameterContainerItem::addToFitParameter(), JobItem::fitParameterContainerItem(), FitParameterContainerItem::fitParameterNames(), ParameterTuningWidget::getSelectedParameters(), jobItem(), and m_tuningWidget.
Referenced by onTuningWidgetContextMenu().
|
privateslot |
Creates fit parameters for all selected ParameterItem's in tuning widget.
Definition at line 167 of file FitParameterWidget.cpp.
References FitParameterContainerItem::createFitParameter(), JobItem::fitParameterContainerItem(), ParameterTuningWidget::getSelectedParameters(), jobItem(), and m_tuningWidget.
Referenced by init_actions().
|
privateslot |
Definition at line 214 of file FitParameterWidget.cpp.
References spanParameters(), and updateInfoLabel().
Referenced by init_fit_model().
|
slot |
Propagates selection form the tree with fit parameters to the tuning widget.
Definition at line 149 of file FitParameterWidget.cpp.
References SessionItem::hasModelType(), FitParameterModel::itemForIndex(), jobItem(), m_fitParameterModel, m_tuningWidget, ParameterTuningWidget::makeSelected(), SessionItem::parentItem(), and ParameterTuningWidget::selectionModel().
Referenced by connectFitParametersSelection().
|
slot |
Creates context menu for the tree with fit parameters.
Definition at line 132 of file FitParameterWidget.cpp.
References Fitting, jobItem(), m_removeFitParAction, m_treeView, and setActionsEnabled().
Referenced by FitParameterWidget().
|
privateslot |
All selected FitParameterItem's of FitParameterItemLink's will be removed.
Definition at line 185 of file FitParameterWidget.cpp.
References JobItem::fitParameterContainerItem(), FitParameterContainerItem::fitParameterItems(), jobItem(), SessionItem::model(), selectedFitParameterLinks(), and selectedFitParameters().
Referenced by init_actions().
|
privateslot |
All ParameterItem's selected in tuning widget will be removed from link section of corresponding fitParameterItem.
Definition at line 177 of file FitParameterWidget.cpp.
References JobItem::fitParameterContainerItem(), ParameterTuningWidget::getSelectedParameters(), jobItem(), m_tuningWidget, and FitParameterContainerItem::removeLink().
Referenced by init_actions().
|
slot |
Creates context menu for ParameterTuningWidget.
Definition at line 96 of file FitParameterWidget.cpp.
References canCreateFitParameter(), canRemoveFromFitParameters(), JobItem::fitParameterContainerItem(), FitParameterContainerItem::fitParameterNames(), Fitting, jobItem(), m_createFitParAction, m_removeFromFitParAction, onAddToFitParAction(), and setActionsEnabled().
Referenced by setParameterTuningWidget().
|
private |
Returns links of FitParameterLink's item selected in FitParameterItem tree.
Definition at line 330 of file FitParameterWidget.cpp.
References FitParameterModel::itemForIndex(), m_fitParameterModel, and m_treeView.
Referenced by onRemoveFitParAction().
|
private |
Returns list of FitParameterItem's currently selected in FitParameterItem tree.
Definition at line 300 of file FitParameterWidget.cpp.
References FitParameterModel::itemForIndex(), m_fitParameterModel, and m_treeView.
Referenced by onRemoveFitParAction().
|
private |
Enables/disables all context menu actions.
Definition at line 291 of file FitParameterWidget.cpp.
References m_createFitParAction, m_removeFitParAction, and m_removeFromFitParAction.
Referenced by onFitParameterTreeContextMenu(), and onTuningWidgetContextMenu().
|
virtualinherited |
Reimplemented in SpecularPlotCanvas, SpecularDataImportWidget, SpecularDataWidget, IntensityDataWidget, JobResultsPresenter, ItemComboWidget, ProjectionsWidget, SpecularDataCanvas, IntensityDataCanvas, ColorMapCanvas, and Plot1DCanvas.
Definition at line 28 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, SessionItemController::setItem(), and SessionItemController::subscribe().
Referenced by MaskGraphicsProxy::setIntensityItem(), FitSessionWidget::setItem(), Plot1DCanvas::setItem(), ColorMapCanvas::setItem(), IntensityDataCanvas::setItem(), SpecularDataCanvas::setItem(), ProjectionsWidget::setItem(), ItemComboWidget::setItem(), IntensityDataWidget::setItem(), SpecularDataWidget::setItem(), SpecularDataImportWidget::setItem(), SpecularPlotCanvas::setItem(), ItemComboWidget::setPresentation(), FitComparisonWidget::subscribeToItem(), and FitComparisonWidget1D::subscribeToItem().
void FitParameterWidget::setParameterTuningWidget | ( | ParameterTuningWidget * | tuningWidget | ) |
Sets ParameterTuningWidget to be able to provide it with context menu and steer its behaviour in the course of fit settings or fit running.
Definition at line 76 of file FitParameterWidget.cpp.
References ParameterTuningWidget::itemContextMenuRequest(), m_tuningWidget, and onTuningWidgetContextMenu().
Referenced by FitSessionWidget::setModelTuningWidget().
|
overrideprotectedinherited |
Definition at line 51 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, and SessionItemController::subscribe().
|
private |
Makes first column in FitParameterItem's tree related to ParameterItem link occupy whole space.
Definition at line 348 of file FitParameterWidget.cpp.
References FitParameterModel::index(), m_fitParameterModel, m_treeView, and FitParameterModel::rowCount().
Referenced by onFitParameterModelChange().
|
overrideprotectedvirtual |
Reimplemented from SessionItemWidget.
Definition at line 220 of file FitParameterWidget.cpp.
References init_fit_model().
|
inlineprotectedvirtualinherited |
Reimplemented in ProjectionsPlot, IntensityDataProjectionsWidget, ColorMap, SpecularPlot, Plot1D, FitFlowWidget, FitComparisonWidget1D, FitComparisonWidget, RealDataMaskWidget, and RunFitControlWidget.
Definition at line 44 of file SessionItemWidget.h.
Referenced by SessionItemWidget::SessionItemWidget().
|
private |
Places overlay label on top of tree view, if there is no fit parameters.
Definition at line 364 of file FitParameterWidget.cpp.
References jobItem(), m_infoLabel, and OverlayLabelController::setShown().
Referenced by onFitParameterModelChange().
|
private |
Definition at line 79 of file FitParameterWidget.h.
Referenced by init_actions(), onTuningWidgetContextMenu(), and setActionsEnabled().
|
private |
Definition at line 82 of file FitParameterWidget.h.
Referenced by init_fit_model(), onFitParametersSelectionChanged(), selectedFitParameterLinks(), selectedFitParameters(), and spanParameters().
|
private |
Definition at line 84 of file FitParameterWidget.h.
Referenced by FitParameterWidget(), and updateInfoLabel().
|
privateinherited |
Definition at line 49 of file SessionItemWidget.h.
Referenced by SessionItemWidget::SessionItemWidget(), SessionItemWidget::currentItem(), SessionItemWidget::hideEvent(), SessionItemWidget::setItem(), and SessionItemWidget::showEvent().
|
private |
Definition at line 83 of file FitParameterWidget.h.
Referenced by FitParameterWidget(), and init_actions().
|
private |
Definition at line 81 of file FitParameterWidget.h.
Referenced by init_actions(), onFitParameterTreeContextMenu(), and setActionsEnabled().
|
private |
Definition at line 80 of file FitParameterWidget.h.
Referenced by init_actions(), onTuningWidgetContextMenu(), and setActionsEnabled().
|
private |
Definition at line 77 of file FitParameterWidget.h.
Referenced by FitParameterWidget(), connectFitParametersSelection(), init_fit_model(), onFitParameterTreeContextMenu(), selectedFitParameterLinks(), selectedFitParameters(), and spanParameters().
|
private |
Definition at line 78 of file FitParameterWidget.h.
Referenced by canCreateFitParameter(), canRemoveFromFitParameters(), onAddToFitParAction(), onCreateFitParAction(), onFitParametersSelectionChanged(), onRemoveFromFitParAction(), and setParameterTuningWidget().