mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-24 16:04:16 +02:00
Add options to leave junctions and contact blocks out of the parts list (#1178)
Since #849 the parts list has a row for every contact block (slave) and terminal-type element. Users who draw the dots and bends where wires branch as terminal-type symbols (114_connections) get one empty row per junction: 109 of 151 rows on one reported cabinet. Two options, both off by default so existing exports are unchanged: - leave out the contact blocks: --no-slaves, "no_slaves" in qet_export, or uncheck the new "Contacts esclaves" element type in the dialog; - leave out the junctions: terminal-type elements with no label, designation, manufacturer or manufacturer reference. --no-junctions, "no_junctions", or "Laisser de côté les jonctions" in the dialog. A terminal block with a label or a part number stays. The element type filter had no box for slaves, so every query it built left them out: the export dialog never listed contact blocks, although the command line has since #849. The dialog now checks the new box by default and gives the same rows as --export-bom. The box is unchecked by default elsewhere, so nomenclature tables keep their rows. docs/smart-device-bom.md still said slaves and terminals were excluded; corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,9 @@ BOMExportDialog::BOMExportDialog(QETProject *project, QWidget *parent) :
|
||||
m_query_widget = new ElementQueryWidget(this);
|
||||
ui->m_main_layout->insertWidget(0, m_query_widget);
|
||||
m_query_widget->setQuery(BomExport::defaultQuery());
|
||||
//The contact blocks are parts of their own, as in the command line
|
||||
//export; unchecking "Contacts esclaves" leaves them out.
|
||||
m_query_widget->setSlavesIncluded(true);
|
||||
on_m_format_as_bom_clicked(false);
|
||||
|
||||
m_preview_model = new QSqlQueryModel(this);
|
||||
@@ -145,6 +148,15 @@ void BOMExportDialog::on_m_format_as_bom_clicked(bool checked) {
|
||||
m_query_widget->setCount("COUNT(*) AS designation_qty", checked);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief BOMExportDialog::on_m_no_junctions_clicked
|
||||
@param checked : true leaves out the junctions, see
|
||||
BomExport::junctionFilter()
|
||||
*/
|
||||
void BOMExportDialog::on_m_no_junctions_clicked(bool checked) {
|
||||
m_query_widget->setExtraFilter(BomExport::junctionFilter(), checked);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief BOMExportDialog::on_m_preview_pb_clicked
|
||||
Run the current query and show its result live, without going through
|
||||
|
||||
@@ -45,6 +45,7 @@ class BOMExportDialog : public QDialog
|
||||
|
||||
private slots:
|
||||
void on_m_format_as_bom_clicked(bool checked);
|
||||
void on_m_no_junctions_clicked(bool checked);
|
||||
void on_m_preview_pb_clicked();
|
||||
|
||||
private:
|
||||
|
||||
@@ -40,6 +40,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_no_junctions">
|
||||
<property name="toolTip">
|
||||
<string>Bornes sans repère, désignation, fabricant ni référence fabricant</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Laisser de côté les jonctions</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user