| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassGui
- MassPeakShaperConfigWidget

# MsXpS::libXpertMassGui::MassPeakShaperConfigWidget Class

class MsXpS::libXpertMassGui::MassPeakShaperConfigWidget

The MassPeakShaperConfigWidget class provides a widget for the configuration of the mass peak shaping process. More...

Header: | `#include <MsXpS/libXpertMassGui/MassPeakShaperConfigWidget.hpp>`
Inherits: | QWidget

- List of all members, including inherited members
- MassPeakShaperConfigWidget is part of libXpertMassGui Mass calculations.

## Public Functions

| MassPeakShaperConfigWidget(const MsXpS::libXpertMassCore::MassPeakShaperConfig &config, QWidget *parent_p)
virtual | ~MassPeakShaperConfigWidget()
bool | checkParameters()
bool | checkParameters(MsXpS::libXpertMassCore::ErrorList *error_list_p)
MsXpS::libXpertMassCore::MassPeakShaperConfig * | getConfig()
const MsXpS::libXpertMassCore::MassPeakShaperConfig * | getConfig() const
QSpinBox * | getFmwhToBinSizeDivisorSpinBox()
QDoubleSpinBox * | getFwhmDoubleSpinBox()
QRadioButton * | getGaussianRadioButton()
QRadioButton * | getLorentzianRadioButton()
QSpinBox * | getPointCountSpinBox()
double | getReferencePeakMz()
QSpinBox * | getResolutionSpinBox()
bool | processBinSizeConfig()
void | readSettings(const QString &config_settings_file_path)
void | setReferencePeakMz(double mz)
void | writeSettings(const QString &config_settings_file_path)

## Public Slots

void | fwhmBinSizeDivisorValueChanged(int value)
void | fwhmEditingFinished()
void | gaussianRadioButtonToggled(bool checked)
void | lorentzianRadioButtonToggled(bool checked)
void | pointCountEditingFinished()
void | referencePeakMzValueChanged(double value)
void | resolutionEditingFinished()

## Protected Functions

void | message(const QString &message, int timeout = 3000)
void | setupWidget()

## Protected Variables

double | m_normalizingIntensity
double | m_referencePeakMz
MsXpS::libXpertMassCore::MassPeakShaperConfig * | mp_config
QWidget * | mp_parent
Ui::MassPeakShaperConfigWidget * | mp_ui
std::shared_ptr<QTimer> | msp_msgTimer

## Detailed Description

This composite widget contains all the widgets and all the logic required to fully configure the mass peak shaping process.

## Member Function Documentation

### `[explicit]` MassPeakShaperConfigWidget::MassPeakShaperConfigWidget(const MsXpS::libXpertMassCore::MassPeakShaperConfig &config, QWidget *parent_p)

Constructs a MassPeakShaperConfigWidget instance.

- parent_p: the parent widget.
- config: the configuration of the mass peak shaping process

### `[virtual noexcept]` MassPeakShaperConfigWidget::~MassPeakShaperConfigWidget()

Destructs this MassPeakShaperConfigWidget instance.

### `[invokable]` bool MassPeakShaperConfigWidget::checkParameters()

Checks that all the parameters are consistent and correct. Returns true is the check succeeded, false otherwise.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

See also checkParameters().

### `[invokable]` bool MassPeakShaperConfigWidget::checkParameters(MsXpS::libXpertMassCore::ErrorList *error_list_p)

Checks that all the parameters are consistent and correct.

If errors occurs, they are added to error_list_p.

Returns true is the check succeeded, false otherwise.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This is an overloaded function.

See also checkParameters().

### `[slot]` void MassPeakShaperConfigWidget::fwhmBinSizeDivisorValueChanged(int value)

Signals that the value by which the FWHM value should be divided is now value.

The value is the number by which FWHM should be divided to yield the actual bin size.

### `[slot]` void MassPeakShaperConfigWidget::fwhmEditingFinished()

Signals that the user has finished entering the FWHM value.

The FWHM is the full width at half maximum, that is the width of the peak at its half-height. This value is a direct reflection of the resolving power of the mass spectrometer.

### `[slot]` void MassPeakShaperConfigWidget::gaussianRadioButtonToggled(bool checked)

Signals that the peak shape type has changed.

If checked is true, then the type is libXpertMassCore::Enums::MassPeakShapeType::GAUSSIAN, else it is libXpertMassCore::Enums::MassPeakShapeType::LORENTZIAN.

### QSpinBox *MassPeakShaperConfigWidget::getFmwhToBinSizeDivisorSpinBox()

Returns the FWHM to bin size divisor spin box widget.

### QDoubleSpinBox *MassPeakShaperConfigWidget::getFwhmDoubleSpinBox()

Returns the FWHM spin box widget.

### QRadioButton *MassPeakShaperConfigWidget::getGaussianRadioButton()

Returns the Gaussian shape type radio button widget.

### QRadioButton *MassPeakShaperConfigWidget::getLorentzianRadioButton()

Returns the Lorentzian shape type radio button widget.

### QSpinBox *MassPeakShaperConfigWidget::getPointCountSpinBox()

Returns the shape point count spin box widget.

### double MassPeakShaperConfigWidget::getReferencePeakMz()

Returns the reference m/z value.

### QSpinBox *MassPeakShaperConfigWidget::getResolutionSpinBox()

Returns the resolving power spin box widget.

### `[slot]` void MassPeakShaperConfigWidget::lorentzianRadioButtonToggled(bool checked)

Signals that the peak shape type has changed.

If checked is true, then the type is libXpertMassCore::Enums::MassPeakShapeType::LORENTZIAN, else it is libXpertMassCore::Enums::MassPeakShapeType::GAUSSIAN.

### `[protected]` void MassPeakShaperConfigWidget::message(const QString &message, int timeout = 3000)

Writes message to the message line edit widget.

The message is erase after timeout in milliseconds.

### `[slot]` void MassPeakShaperConfigWidget::pointCountEditingFinished()

Signals that the user has finished editing the count of points needed to shape the peak.

### `[invokable]` bool MassPeakShaperConfigWidget::processBinSizeConfig()

Determines the bin configuration from the data entered by the user.

Returns true if the calculations succeeded, false otherwise.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### void MassPeakShaperConfigWidget::readSettings(const QString &config_settings_file_path)

Reads the settings of this widget from config_settings_file_path.

### `[slot]` void MassPeakShaperConfigWidget::referencePeakMzValueChanged(double value)

Signals that the user edited the reference m/z value.

value is the new value.

### `[slot]` void MassPeakShaperConfigWidget::resolutionEditingFinished()

Signals that the user has finished entering the resolving power value.

### void MassPeakShaperConfigWidget::setReferencePeakMz(double mz)

Sets the reference m/z value to mz.

### `[protected]` void MassPeakShaperConfigWidget::setupWidget()

Sets up this widget.

### void MassPeakShaperConfigWidget::writeSettings(const QString &config_settings_file_path)

Writes the settings of this widget to config_settings_file_path for later restoration.

## Member Variable Documentation

### double MassPeakShaperConfigWidget::m_normalizingIntensity

This variable holds the intensity value that is used to normalize the peak height..

### double MassPeakShaperConfigWidget::m_referencePeakMz

This variable holds the reference m/z value used for peak width calculations.

This reference m/z value is used to compute the full width at half maximum of the shaped peak on the basis of the resolution and backwards.

### MsXpS::libXpertMassCore::MassPeakShaperConfig *MassPeakShaperConfigWidget::mp_config

This variable holds the configuration of the pass peak shaping process.

### QWidget *MassPeakShaperConfigWidget::mp_parent

This variable holds the parent widget.

### Ui::MassPeakShaperConfigWidget *MassPeakShaperConfigWidget::mp_ui

This variable holds the graphical user interface definition.

### std::shared_ptr<QTimer> MassPeakShaperConfigWidget::msp_msgTimer

This variable holds the timer object used to clear messages to the messages line edit box.