Files
qelectrotech-source-mirror/sources/autoNum/ui/numparteditorw.h
T
Kellermorph bf9b34398d Add cable management: drawing, cores, numbering, cross-references and cable list
Cables are drawn line objects (toolbar button next to the auto
break/reconnect button, click-move-click, right click cancels), not
components. The type comes from a CSV catalog following the material
list pattern (designation, cores, core colours, editable through the
entry dialog with "Nouvelle entrée" / "Modifier l'entrée").

Each core is bound to the wire its colour label stands on, and the
cable reference is generated per core and written into the Conductor
entry via Conductor::setCableReference(label, cable uuid, slot). The
conductor entry is where it has to live because the terminal strip
plan (Klemmenplan) consumes it in the next step.

Numbering: "Cables" rule under Programmeinstellungen/Neues
Projekt/Nummerierung auto (mirrored in project properties), literal
"W" fallback without a rule, French gate dialog when no rule exists,
Nummerierung menu with the renumber dialog (preferred axis, per-folio
counter, rule and counter state written back, hand-typed names ask,
whole-project scope).

Also included: label block and under-line texts with per-text font and
alignment plus the material-list cell margins, free-core placement and
right-click removal, claim questions for wires of other cables,
multi-selection drag as one undo step, type change with confirmation,
cross-references for type "Cable" (%f-%l%c, own font, clickable links
in exported PDFs), report propagation of the cable definition,
Listes menu (table of contents, material list, terminal strip manager,
terminal generator plugin, cable list), cable list with freely
selectable columns (installation/localisation of cable, start and end,
Blatt start/end, length, used cores...), CSV export dialog with column
pick and preview in the Projekt menu, script API (addTable kind
"cable_list", exportCableList) and a unit test for the type catalog.
2026-10-08 15:56:00 +02:00

94 lines
2.5 KiB
C++

/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NUMPARTEDITORW_H
#define NUMPARTEDITORW_H
#include "../numerotationcontext.h"
#include <QValidator>
#include <QWidget>
namespace Ui {
class NumPartEditorW;
}
/**
@brief The NumPartEditorW class
This class represent a single part num widget.
By this widget, we can define and edit how the num auto must work.
This widget is called by selectautonumw.
*/
class NumPartEditorW : public QWidget
{
Q_OBJECT
//METHODS
public:
explicit NumPartEditorW(int type, QWidget *parent = nullptr);
NumPartEditorW (NumerotationContext &,
int,
int type,
QWidget *parent=nullptr);
~NumPartEditorW() override;
enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio,
alpha,
string,idfolio,folio,plant,locmach,
elementline,elementcolumn,elementprefix,
wrap,
};
NumerotationContext toNumContext();
bool isValid ();
type type_;
private:
void setVisibleItems();
void disableItem(int index);
void setCurrentIndex(NumPartEditorW::type);
private slots:
void on_type_cb_activated(int);
void on_value_field_textEdited();
void on_increase_spinBox_valueChanged(int);
void on_modulus_spinBox_valueChanged(int);
void on_format_le_textEdited(const QString &);
void setType (NumPartEditorW::type t, bool=false);
signals:
void changed ();
private:
Ui::NumPartEditorW *ui;
QValidator *intValidator;
QValidator *alphaValidator;
int m_edited_type = -1; ///<0 == element : 1 == conductor : 2 == folio
/**
The value a counter bound to the folio counts each folio
from (-1 while the row carries none): value_field shows
the live counter, which numbering a project over leaves
at the last number given out, so the start has to be
kept apart from what is on show.
*/
int m_initial_value = -1;
};
#endif // NUMPARTEDITORW_H