mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 04:54:13 +02:00
5b8d05fc1e
Slice 4 of discussion #503, on top of slice 3 (#629): the smallest surface that makes wiring_list_view visible, plus the diagnostic the view needs to be honest about what it is missing. Projet > "Liste de câblage (base de données)" opens a read-only table of wiring_list_view, headed by a line stating how many conductors are listed and, when non-zero, how many were excluded and why. Deliberately not another exporter. QET already ships a wiring-list CSV export (Projet > Exporter le plan de câblage, and --export-cables) which walks the project XML; measured on the same projects it produces a row per conductor and resolves labels correctly when the project has them. Adding a second, competing CSV would be worse, not better -- the database path's value is what it unlocks (terminal plans, BOM joins), not replacing that export. projectDataBase::excludedConductorCount() counts, from the live scene, the conductors deliberately absent from the conductor table because a terminal has no uuid. Counted from the scene precisely because the database is where those conductors are not. Verified: 671 on examples/industrial.qet (which has 1794 terminals and no terminal uuids at all, so its list is empty and now says so), 0 on a project whose elements do carry terminal uuids. KNOWN GAP, not fixed here and the reason this is opened for discussion rather than merge: after a save/reload the component columns are blank for slave elements. populateElementTable()/populateElementInfoTable() only insert Simple|Terminal|Master|Thumbnail, so slave elements -- relay contacts, i.e. a large share of real wire endpoints -- have no row in element_info for the view to read a label from. Measured on a two-slave- contact project after reload: element rows 0, element_info rows 0, terminal rows 2, conductor rows 1; the wire is listed (slice 3's LEFT JOIN keeps it) but both component names are empty, where the existing CSV export shows K1 -> K2 for the same file. Closing that gap means widening a filter shared with the nomenclature and summary views, which would change what those existing, shipped features contain. That is a maintainer decision, not one to take unilaterally inside an additive slice.
49 lines
1.5 KiB
C++
49 lines
1.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 WIRINGLISTDIALOG_H
|
|
#define WIRINGLISTDIALOG_H
|
|
|
|
#include <QDialog>
|
|
|
|
class QETProject;
|
|
|
|
/**
|
|
@brief The WiringListDialog class
|
|
Read-only view of the project's from-to wiring list, read from the
|
|
wiring_list_view of projectDataBase.
|
|
|
|
Deliberately not an exporter: QET already ships a wiring-list CSV export
|
|
(Projet > Exporter le plan de câblage, and --export-cables), which walks
|
|
the project XML and covers that need. This dialog exists to make the
|
|
database view inspectable, and above all to state how many conductors
|
|
are missing from it and why -- a count the CSV export cannot give,
|
|
because it never excludes anything in the first place.
|
|
*/
|
|
class WiringListDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit WiringListDialog(QETProject *project, QWidget *parent = nullptr);
|
|
|
|
private:
|
|
QETProject *m_project = nullptr;
|
|
};
|
|
|
|
#endif // WIRINGLISTDIALOG_H
|