musrStep 1.0.0
Loading...
Searching...
No Matches
PModSelect Class Reference

Dialog for selecting modification options for parameter step sizes. More...

#include <PMusrStep.h>

Inheritance diagram for PModSelect:

Signals

void scale (bool automatic, double factor, bool absVal)
 Signal emitted when user selects a scaling operation.
 

Public Member Functions

 PModSelect (QWidget *parent=Q_NULLPTR)
 Constructor for PModSelect dialog.
 

Private Slots

void absoluteValueStateChanged (int ival)
 Slot called when the absolute value checkbox state changes.
 
void scaleAuto ()
 Slot that triggers automatic scaling of selected parameters.
 
void getFactor ()
 Slot that applies the user-specified factor to selected parameters.
 

Private Attributes

std::unique_ptr< QCheckBox > fAbsVal
 Checkbox for absolute value mode.
 
std::unique_ptr< QLabel > fFactorLabel
 Label for the factor input field.
 
std::unique_ptr< QLineEdit > fFactorLineEdit
 Input field for the scaling factor.
 
std::unique_ptr< QPushButton > fScaleByFactor
 Button to apply factor scaling.
 
std::unique_ptr< QPushButton > fScaleAutomatic
 Button to apply automatic scaling.
 
std::unique_ptr< QPushButton > fCancel
 Button to cancel the dialog.
 

Detailed Description

Dialog for selecting modification options for parameter step sizes.

This dialog provides the user interface for choosing how to modify selected parameter step sizes. It offers two main options:

  • Scale by a user-specified factor (multiplicative or absolute value)
  • Automatic scaling based on parameter naming conventions

The dialog emits a scale() signal when the user makes a selection, which is then processed by the parent PMusrStep dialog.

Constructor & Destructor Documentation

◆ PModSelect()

PModSelect::PModSelect ( QWidget * parent = Q_NULLPTR)

Constructor for PModSelect dialog.

Constructor for the PModSelect dialog.

Parameters
parentPointer to the parent widget (default: Q_NULLPTR)

Creates and initializes the dialog UI with the following controls:

  • "Scale by Factor" button with associated factor input field
  • "Absolute Value" checkbox to toggle between multiplicative and absolute scaling
  • "Scale Automatically" button for automatic scaling based on parameter names
  • "Cancel" button to close the dialog without applying changes
Parameters
parentPointer to the parent widget (default: Q_NULLPTR)

Member Function Documentation

◆ absoluteValueStateChanged

void PModSelect::absoluteValueStateChanged ( int ival)
privateslot

Slot called when the absolute value checkbox state changes.

Handles state changes of the absolute value checkbox.

Updates the UI labels to reflect whether the factor will be used as a multiplier or as an absolute value.

Parameters
ivalThe new checkbox state (Qt::Checked or Qt::Unchecked)

Updates the UI labels to reflect the current mode:

  • When unchecked: Shows "Factor" label and "Scale by Factor" button text
  • When checked: Shows "Value" label and "Set Abs. Value" button text
Parameters
ivalThe new checkbox state (Qt::Checked or Qt::Unchecked)

◆ getFactor

void PModSelect::getFactor ( )
privateslot

Slot that applies the user-specified factor to selected parameters.

Reads the user-specified factor and emits the scale signal.

Reads the factor value from the input field and the absolute value checkbox state, then emits the scale() signal with these values.

Retrieves the factor value from the input field and the absolute value checkbox state, then emits the scale() signal with automatic=false to indicate manual scaling mode.

◆ scale

void PModSelect::scale ( bool automatic,
double factor,
bool absVal )
signal

Signal emitted when user selects a scaling operation.

Parameters
automaticIf true, use automatic scaling based on parameter names; if false, use the provided factor value
factorThe scaling factor to apply (used when automatic is false)
absValIf true, factor is used as an absolute value; if false, factor is used as a multiplier

◆ scaleAuto

void PModSelect::scaleAuto ( )
privateslot

Slot that triggers automatic scaling of selected parameters.

Triggers automatic scaling of selected parameters.

Emits the scale() signal with automatic=true, causing the parent dialog to apply scaling factors based on parameter naming conventions.

Emits the scale() signal with automatic=true and a default factor of 0.01. The parent dialog will then apply scaling factors based on parameter naming conventions using its lookupTable() method.

Member Data Documentation

◆ fAbsVal

std::unique_ptr<QCheckBox> PModSelect::fAbsVal
private

Checkbox for absolute value mode.

◆ fCancel

std::unique_ptr<QPushButton> PModSelect::fCancel
private

Button to cancel the dialog.

◆ fFactorLabel

std::unique_ptr<QLabel> PModSelect::fFactorLabel
private

Label for the factor input field.

◆ fFactorLineEdit

std::unique_ptr<QLineEdit> PModSelect::fFactorLineEdit
private

Input field for the scaling factor.

◆ fScaleAutomatic

std::unique_ptr<QPushButton> PModSelect::fScaleAutomatic
private

Button to apply automatic scaling.

◆ fScaleByFactor

std::unique_ptr<QPushButton> PModSelect::fScaleByFactor
private

Button to apply factor scaling.


The documentation for this class was generated from the following files: