QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
AutoNumberingDockWidget Class Reference

#include <autonumberingdockwidget.h>

Inherits QDockWidget.

Collaboration diagram for AutoNumberingDockWidget:
Collaboration graph

Classes

struct  Row

Public Slots

void setActive ()
 AutoNumberingDockWidget::setActive Set current used autonumberings.
void setConductorActive (DiagramView *)
 AutoNumberingDockWidget::setConductorActive.

Public Member Functions

 AutoNumberingDockWidget (QWidget *parent=nullptr)
 AutoNumberingDockWidget::AutoNumberingDockWidget Constructor.
 ~AutoNumberingDockWidget () override
 AutoNumberingDockWidget::~AutoNumberingDockWidget Destructor.
void setContext ()
 AutoNumberingDockWidget::setContext Add all itens to comboboxes.
void setProject (QETProject *, ProjectView *)
 AutoNumberingDockWidget::setProject.

Private Types

enum class  AutoNumCategory { Conductor , Element , Folio }

Private Slots

void on_m_conductor_cb_activated (int)
 AutoNumberingDockWidget::on_m_conductor_cb_activated Set new conductor AutoNum.
void on_m_element_cb_activated (int)
 AutoNumberingDockWidget::on_m_element_cb_activated Set new element AutoNum.
void on_m_folio_cb_activated (int)
 AutoNumberingDockWidget::on_m_folio_cb_activated Set new folio AutoNum.
void conductorAutoNumChanged ()
 AutoNumberingDockWidget::conductorAutoNumChanged Add new or remove conductor auto num from combobox.
void elementAutoNumChanged ()
 AutoNumberingDockWidget::elementAutoNumChanged Add new or remove element auto num from combobox.
void folioAutoNumChanged ()
 AutoNumberingDockWidget::folioAutoNumChanged Add new or remove folio auto num from combobox.
void clear ()
 AutoNumberingDockWidget::clear Remove all combo box values.
void projectClosed ()
void refreshValueFields ()
 AutoNumberingDockWidget::refreshValueFields Re-read all three value fields from the project. Called whenever a numerotation context's values change, which includes every element or conductor that consumes the next number – without this the field only caught up when the user re-picked a rule from the combo box, because the combo's activated() signal fires on user interaction alone.
void on_m_configure_pb_clicked ()
void on_m_conductor_reset_start_pb_clicked ()
void on_m_element_reset_start_pb_clicked ()
void on_m_folio_reset_start_pb_clicked ()
void on_m_conductor_value_le_editingFinished ()
void on_m_element_value_le_editingFinished ()
void on_m_folio_value_le_editingFinished ()
void on_m_conductor_increase_sb_valueChanged (int)
void on_m_element_increase_sb_valueChanged (int)
void on_m_folio_increase_sb_valueChanged (int)

Private Member Functions

Row rowFor (AutoNumCategory category) const
 AutoNumberingDockWidget::rowFor.
void resetAutoNum (QComboBox *combo_box, AutoNumCategory category)
 resetAutoNum Reset the numerotation context currently selected in combo_box (for the given category) to a per-type starting value. Does nothing if no context is selected.
NumerotationContext contextFor (QComboBox *combo_box, AutoNumCategory category) const
 Read/write the numerotation context named in combo_box.
void storeContext (QComboBox *combo_box, AutoNumCategory category, const NumerotationContext &context)
 AutoNumberingDockWidget::storeContext Write context back under the name selected in combo_box and flag the project as modified – without that last step the change is not saved and the user is never asked to save it on close.
void refreshValueField (QComboBox *combo_box, QLineEdit *line_edit, AutoNumCategory category)
 Refresh a value field from its context, and apply a typed value.
void applyValueField (QComboBox *combo_box, QLineEdit *line_edit, AutoNumCategory category)
 AutoNumberingDockWidget::applyValueField Write the value typed in line_edit to the counter it displays. An empty field is treated as "no change" rather than as an empty value, so clearing the box by accident cannot wipe the counter.
void refreshIncreaseField (QComboBox *combo_box, QSpinBox *increase_sb, AutoNumCategory category)
 Refresh/apply the increment spin box the same way.
void applyIncreaseField (QComboBox *combo_box, QSpinBox *increase_sb, AutoNumCategory category)
 AutoNumberingDockWidget::applyIncreaseField Write the spin box's step size to the counter it displays (bug #331).
void refreshNextField (QComboBox *combo_box, QLineEdit *next_edit, AutoNumCategory category)
 AutoNumberingDockWidget::refreshNextField Show what this counter will read after one more step (bug #331: "visualiser la prochaine numérotation qui sera appliquée"). Advances a copy of the whole context through NumerotationContextCommands – the same engine the Suivant button in the full configuration dialog uses to step a context – so wrap-and-carry into this part from a following part, or out of it into a preceding one, comes out identical to what will actually happen when the number is next consumed.
void refreshRow (AutoNumCategory category)
 AutoNumberingDockWidget::refreshRow Refresh a category's value, increment and next-value preview together – every call site that used to refresh just the value field needs the other two kept in step with it as well.

Static Private Member Functions

static int counterIndex (const NumerotationContext &context)
 AutoNumberingDockWidget::counterIndex.

Private Attributes

Ui::AutoNumberingDockWidget * ui
QETProjectm_project = nullptr
ProjectViewm_project_view = nullptr

Member Enumeration Documentation

◆ AutoNumCategory

enum class AutoNumberingDockWidget::AutoNumCategory
strongprivate
Enumerator
Conductor 
Element 
Folio 

Constructor & Destructor Documentation

◆ AutoNumberingDockWidget()

AutoNumberingDockWidget::AutoNumberingDockWidget ( QWidget * parent = nullptr)
explicit

AutoNumberingDockWidget::AutoNumberingDockWidget Constructor.

Parameters
parent: parent widget
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~AutoNumberingDockWidget()

AutoNumberingDockWidget::~AutoNumberingDockWidget ( )
override

Member Function Documentation

◆ applyIncreaseField()

void AutoNumberingDockWidget::applyIncreaseField ( QComboBox * combo_box,
QSpinBox * increase_sb,
AutoNumCategory category )
private

AutoNumberingDockWidget::applyIncreaseField Write the spin box's step size to the counter it displays (bug #331).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyValueField()

void AutoNumberingDockWidget::applyValueField ( QComboBox * combo_box,
QLineEdit * line_edit,
AutoNumCategory category )
private

AutoNumberingDockWidget::applyValueField Write the value typed in line_edit to the counter it displays. An empty field is treated as "no change" rather than as an empty value, so clearing the box by accident cannot wipe the counter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear

void AutoNumberingDockWidget::clear ( )
privateslot

AutoNumberingDockWidget::clear Remove all combo box values.

Here is the caller graph for this function:

◆ conductorAutoNumChanged

void AutoNumberingDockWidget::conductorAutoNumChanged ( )
privateslot

AutoNumberingDockWidget::conductorAutoNumChanged Add new or remove conductor auto num from combobox.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contextFor()

NumerotationContext AutoNumberingDockWidget::contextFor ( QComboBox * combo_box,
AutoNumCategory category ) const
private

Read/write the numerotation context named in combo_box.

AutoNumberingDockWidget::contextFor.

Returns
the numerotation context named by combo_box, for category
Here is the caller graph for this function:

◆ counterIndex()

int AutoNumberingDockWidget::counterIndex ( const NumerotationContext & context)
staticprivate

AutoNumberingDockWidget::counterIndex.

Index of the counter the value field shows and edits: the last part that actually progresses. Returns -1 when the context has no such part (e.g. it is only fixed text).

Returns
the index of the part the value field shows: the last one that actually progresses, i.e. the least significant digit of the number. -1 when the context has no progressing part at all.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ elementAutoNumChanged

void AutoNumberingDockWidget::elementAutoNumChanged ( )
privateslot

AutoNumberingDockWidget::elementAutoNumChanged Add new or remove element auto num from combobox.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ folioAutoNumChanged

void AutoNumberingDockWidget::folioAutoNumChanged ( )
privateslot

AutoNumberingDockWidget::folioAutoNumChanged Add new or remove folio auto num from combobox.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_conductor_cb_activated

void AutoNumberingDockWidget::on_m_conductor_cb_activated ( int )
privateslot

AutoNumberingDockWidget::on_m_conductor_cb_activated Set new conductor AutoNum.

Here is the call graph for this function:

◆ on_m_conductor_increase_sb_valueChanged

void AutoNumberingDockWidget::on_m_conductor_increase_sb_valueChanged ( int )
privateslot
Here is the call graph for this function:

◆ on_m_conductor_reset_start_pb_clicked

void AutoNumberingDockWidget::on_m_conductor_reset_start_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_conductor_value_le_editingFinished

void AutoNumberingDockWidget::on_m_conductor_value_le_editingFinished ( )
privateslot
Here is the call graph for this function:

◆ on_m_configure_pb_clicked

void AutoNumberingDockWidget::on_m_configure_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_element_cb_activated

void AutoNumberingDockWidget::on_m_element_cb_activated ( int )
privateslot

AutoNumberingDockWidget::on_m_element_cb_activated Set new element AutoNum.

Here is the call graph for this function:

◆ on_m_element_increase_sb_valueChanged

void AutoNumberingDockWidget::on_m_element_increase_sb_valueChanged ( int )
privateslot
Here is the call graph for this function:

◆ on_m_element_reset_start_pb_clicked

void AutoNumberingDockWidget::on_m_element_reset_start_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_element_value_le_editingFinished

void AutoNumberingDockWidget::on_m_element_value_le_editingFinished ( )
privateslot
Here is the call graph for this function:

◆ on_m_folio_cb_activated

void AutoNumberingDockWidget::on_m_folio_cb_activated ( int )
privateslot

AutoNumberingDockWidget::on_m_folio_cb_activated Set new folio AutoNum.

Here is the call graph for this function:

◆ on_m_folio_increase_sb_valueChanged

void AutoNumberingDockWidget::on_m_folio_increase_sb_valueChanged ( int )
privateslot
Here is the call graph for this function:

◆ on_m_folio_reset_start_pb_clicked

void AutoNumberingDockWidget::on_m_folio_reset_start_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_folio_value_le_editingFinished

void AutoNumberingDockWidget::on_m_folio_value_le_editingFinished ( )
privateslot
Here is the call graph for this function:

◆ projectClosed

void AutoNumberingDockWidget::projectClosed ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshIncreaseField()

void AutoNumberingDockWidget::refreshIncreaseField ( QComboBox * combo_box,
QSpinBox * increase_sb,
AutoNumCategory category )
private

Refresh/apply the increment spin box the same way.

AutoNumberingDockWidget::refreshIncreaseField Show the counter's current step size (bug #331: previously only reachable from the full configuration dialog, via "Configurer").

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshNextField()

void AutoNumberingDockWidget::refreshNextField ( QComboBox * combo_box,
QLineEdit * next_edit,
AutoNumCategory category )
private

AutoNumberingDockWidget::refreshNextField Show what this counter will read after one more step (bug #331: "visualiser la prochaine numérotation qui sera appliquée"). Advances a copy of the whole context through NumerotationContextCommands – the same engine the Suivant button in the full configuration dialog uses to step a context – so wrap-and-carry into this part from a following part, or out of it into a preceding one, comes out identical to what will actually happen when the number is next consumed.

Show what the counter will read after one more step, using the same NumerotationContextCommands engine the Suivant button in the full configuration dialog already advances the whole context with – so the preview can never disagree with what actually happens when the number is next consumed.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshRow()

void AutoNumberingDockWidget::refreshRow ( AutoNumCategory category)
private

AutoNumberingDockWidget::refreshRow Refresh a category's value, increment and next-value preview together – every call site that used to refresh just the value field needs the other two kept in step with it as well.

Refresh a whole row – value, increment and next-value preview – in one call. Every refresh call site needs the increment and preview kept in step with the value now, so this replaces refreshValueField() at each of them.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshValueField()

void AutoNumberingDockWidget::refreshValueField ( QComboBox * combo_box,
QLineEdit * line_edit,
AutoNumCategory category )
private

Refresh a value field from its context, and apply a typed value.

AutoNumberingDockWidget::refreshValueField Show the current value of the selected context's counter, so the field always reflects where the numbering has actually got to.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshValueFields

void AutoNumberingDockWidget::refreshValueFields ( )
privateslot

AutoNumberingDockWidget::refreshValueFields Re-read all three value fields from the project. Called whenever a numerotation context's values change, which includes every element or conductor that consumes the next number – without this the field only caught up when the user re-picked a rule from the combo box, because the combo's activated() signal fires on user interaction alone.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetAutoNum()

void AutoNumberingDockWidget::resetAutoNum ( QComboBox * combo_box,
AutoNumCategory category )
private

resetAutoNum Reset the numerotation context currently selected in combo_box (for the given category) to a per-type starting value. Does nothing if no context is selected.

AutoNumberingDockWidget::resetAutoNum Reset the numerotation context currently selected in combo_box back to a per-type starting value, then write it back. Does nothing if no context is selected.

Only parts that actually progress are touched: folio-anchored numeric types go back to their own stored initialvalue, plain numeric types go back to "1", a wrap part goes back to "0" because a modulo counter cycles over [0, modulus) – a PLC card addressed IX0.0..IX0.31 starts at 0, not 1 – and alpha goes back to "a". Non-incrementing types (string, plant, locmach, idfolio, folio, elementline, elementcolumn, elementprefix) are left alone: there is no "start" for them distinct from the fixed or contextual value the user configured.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rowFor()

AutoNumberingDockWidget::Row AutoNumberingDockWidget::rowFor ( AutoNumCategory category) const
private

AutoNumberingDockWidget::rowFor.

Returns
the combo/value/increase/next widgets that make up category's row.
Here is the caller graph for this function:

◆ setActive

void AutoNumberingDockWidget::setActive ( )
slot

AutoNumberingDockWidget::setActive Set current used autonumberings.

Here is the caller graph for this function:

◆ setConductorActive

void AutoNumberingDockWidget::setConductorActive ( DiagramView * dv)
slot

AutoNumberingDockWidget::setConductorActive.

Parameters
dvactivated diagramview
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContext()

void AutoNumberingDockWidget::setContext ( )

AutoNumberingDockWidget::setContext Add all itens to comboboxes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProject()

void AutoNumberingDockWidget::setProject ( QETProject * project,
ProjectView * projectview )

AutoNumberingDockWidget::setProject.

Parameters
projectproject to be setted
projectviewprojectview to be setted assign Project and ProjectView, connect all signals and setContext
Here is the call graph for this function:

◆ storeContext()

void AutoNumberingDockWidget::storeContext ( QComboBox * combo_box,
AutoNumCategory category,
const NumerotationContext & context )
private

AutoNumberingDockWidget::storeContext Write context back under the name selected in combo_box and flag the project as modified – without that last step the change is not saved and the user is never asked to save it on close.

Here is the caller graph for this function:

Member Data Documentation

◆ m_project

QETProject* AutoNumberingDockWidget::m_project = nullptr
private

◆ m_project_view

ProjectView* AutoNumberingDockWidget::m_project_view = nullptr
private

◆ ui

Ui::AutoNumberingDockWidget* AutoNumberingDockWidget::ui
private

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