mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-11 02:39:59 +01:00
Merge branch 'master' into terminal_strip
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include <QScrollArea>
|
||||
#include "configdialog.h"
|
||||
#include "configpages.h"
|
||||
#include "ui/configpage/configpages.h"
|
||||
#include "qetapp.h"
|
||||
|
||||
#include "machine_info.h"
|
||||
|
||||
@@ -115,7 +115,7 @@ void ElementPropertiesEditorWidget::upDateInterface()
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::setUpInterface()
|
||||
{
|
||||
// Type combo box
|
||||
// Type combo box
|
||||
ui->m_base_type_cb->addItem (tr("Simple"), ElementData::Simple);
|
||||
ui->m_base_type_cb->addItem (tr("Maître"), ElementData::Master);
|
||||
ui->m_base_type_cb->addItem (tr("Esclave"), ElementData::Slave);
|
||||
@@ -123,7 +123,7 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
||||
ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"), ElementData::PreviousReport);
|
||||
ui->m_base_type_cb->addItem (tr("Bornier"), ElementData::Terminale);
|
||||
|
||||
// Slave option
|
||||
// Slave option
|
||||
ui->m_state_cb->addItem(tr("Normalement ouvert"), ElementData::NO);
|
||||
ui->m_state_cb->addItem(tr("Normalement fermé"), ElementData::NC);
|
||||
ui->m_state_cb->addItem(tr("Inverseur"), ElementData::SW);
|
||||
@@ -133,24 +133,24 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
||||
ui->m_type_cb->addItem(tr("Temporisé repos"), ElementData::DelayOff);
|
||||
ui->m_type_cb->addItem(tr("Temporisé travail & repos"), ElementData::delayOnOff);
|
||||
|
||||
//Master option
|
||||
//Master option
|
||||
ui->m_master_type_cb->addItem(tr("Bobine"), ElementData::Coil);
|
||||
ui->m_master_type_cb->addItem(tr("Organe de protection"), ElementData::Protection);
|
||||
ui->m_master_type_cb->addItem(tr("Commutateur / bouton"), ElementData::Commutator);
|
||||
|
||||
//Terminal option
|
||||
//Terminal option
|
||||
ui->m_terminal_type_cb->addItem(tr("Générique"), ElementData::TTGeneric);
|
||||
ui->m_terminal_type_cb->addItem(tr("Fusible"), ElementData::Fuse);
|
||||
ui->m_terminal_type_cb->addItem(tr("Séctionnable"), ElementData::Sectional);
|
||||
ui->m_terminal_type_cb->addItem(tr("Diode"), ElementData::Diode);
|
||||
ui->m_terminal_type_cb->addItem(tr("Fusible"), ElementData::TTFuse);
|
||||
ui->m_terminal_type_cb->addItem(tr("Séctionnable"), ElementData::TTSectional);
|
||||
ui->m_terminal_type_cb->addItem(tr("Diode"), ElementData::TTDiode);
|
||||
ui->m_terminal_type_cb->addItem(tr("Terre"), ElementData::TTGround);
|
||||
|
||||
ui->m_terminal_func_cb->addItem(tr("Générique"), ElementData::TFGeneric);
|
||||
ui->m_terminal_func_cb->addItem(tr("Phase"), ElementData::Phase);
|
||||
ui->m_terminal_func_cb->addItem(tr("Neutre"), ElementData::Neutral);
|
||||
ui->m_terminal_func_cb->addItem(tr("Terre"), ElementData::PE);
|
||||
ui->m_terminal_func_cb->addItem(tr("Phase"), ElementData::TFPhase);
|
||||
ui->m_terminal_func_cb->addItem(tr("Neutre"), ElementData::TFNeutral);
|
||||
|
||||
//Disable the edition of the first column of the information tree
|
||||
//by this little workaround
|
||||
//Disable the edition of the first column of the information tree
|
||||
//by this little workaround
|
||||
ui->m_tree->setItemDelegate(new EditorDelegate(this));
|
||||
ui->m_tree->header()->resizeSection(0, 150);
|
||||
populateTree();
|
||||
|
||||
@@ -237,14 +237,16 @@ bool ElementPictureFactory::build(const ElementsLocation &location,
|
||||
painter.end();
|
||||
low_painter.end();
|
||||
|
||||
const auto uuid_ = location.uuid();
|
||||
if (!picture) {
|
||||
m_pictures_H.insert(location.uuid(), pic);
|
||||
m_primitives_H.insert(location.uuid(), primitives_);
|
||||
m_pictures_H.insert(uuid_, pic);
|
||||
m_primitives_H.insert(uuid_, primitives_);
|
||||
}
|
||||
if (!low_picture) {
|
||||
m_low_pictures_H.insert(location.uuid(), low_pic);
|
||||
m_primitives_H.insert(location.uuid(), primitives_);
|
||||
m_low_pictures_H.insert(uuid_, low_pic);
|
||||
m_primitives_H.insert(uuid_, primitives_);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -810,30 +810,39 @@ void ProjectView::loadDiagrams()
|
||||
|
||||
setDisplayFallbackWidget(m_project -> diagrams().isEmpty());
|
||||
|
||||
DialogWaiting *dialog = nullptr;
|
||||
if(DialogWaiting::hasInstance())
|
||||
auto dialog = DialogWaiting::instance();
|
||||
if(dialog)
|
||||
{
|
||||
dialog = DialogWaiting::instance();
|
||||
dialog->setTitle( tr("<p align=\"center\">"
|
||||
"<b>Ouverture du projet en cours...</b><br/>"
|
||||
"Création des onglets de folio :"
|
||||
"</p>"));
|
||||
}
|
||||
for(Diagram *diagram : m_project->diagrams())
|
||||
|
||||
for(auto diagram : m_project->diagrams())
|
||||
{
|
||||
if(dialog)
|
||||
{
|
||||
dialog->setDetail(diagram->title());
|
||||
dialog->setProgressBar(dialog->progressBarValue()+1);
|
||||
}
|
||||
diagramAdded(diagram);
|
||||
|
||||
auto dv = new DiagramView(diagram);
|
||||
dv->setFrameStyle(QFrame::Plain | QFrame::NoFrame);
|
||||
|
||||
auto index = m_project->folioIndex(diagram);
|
||||
m_tab->insertTab(index, dv, QET::Icons::Diagram, dv->title());
|
||||
m_diagram_view_list.insert(index, dv);
|
||||
|
||||
connect(dv, &DiagramView::showDiagram, this, QOverload<Diagram*>::of(&ProjectView::showDiagram));
|
||||
connect(dv, &DiagramView::titleChanged, this, &ProjectView::updateTabTitle);
|
||||
connect(dv, &DiagramView::findElementRequired, this, &ProjectView::findElementRequired);
|
||||
connect(&dv->diagram()->border_and_titleblock , &BorderTitleBlock::titleBlockFolioChanged, [this, dv]() {this->updateTabTitle(dv);});
|
||||
}
|
||||
|
||||
if (DiagramView *dv = currentDiagram())
|
||||
{
|
||||
dv->diagram()->loadElmtFolioSeq();
|
||||
dv->diagram()->loadCndFolioSeq();
|
||||
}
|
||||
rebuildDiagramsMap();
|
||||
updateAllTabsTitle();
|
||||
|
||||
m_tab->setCurrentWidget(firstDiagram());
|
||||
}
|
||||
|
||||
|
||||
@@ -87,10 +87,14 @@ class ProjectView : public QWidget
|
||||
private:
|
||||
ProjectView(const ProjectView &);
|
||||
|
||||
//Method related to construction of this class
|
||||
void setProject(QETProject *project);
|
||||
|
||||
|
||||
|
||||
// methods
|
||||
public:
|
||||
QETProject *project();
|
||||
void setProject(QETProject *);
|
||||
QList<DiagramView *> diagram_views() const;
|
||||
DiagramView *currentDiagram() const;
|
||||
void closeEvent(QCloseEvent *) override;
|
||||
|
||||
@@ -307,26 +307,30 @@ QString ElementData::terminalTypeToString(ElementData::TerminalType type)
|
||||
{
|
||||
switch (type) {
|
||||
case ElementData::TTGeneric :
|
||||
return QString("generic");
|
||||
case ElementData::Fuse :
|
||||
return QString("fuse");
|
||||
case ElementData::Sectional:
|
||||
return QString("sectional");
|
||||
case ElementData::Diode:
|
||||
return QString("diode");
|
||||
return QStringLiteral("generic");
|
||||
case ElementData::TTFuse :
|
||||
return QStringLiteral("fuse");
|
||||
case ElementData::TTSectional:
|
||||
return QStringLiteral("sectional");
|
||||
case ElementData::TTDiode:
|
||||
return QStringLiteral("diode");
|
||||
case ElementData::TTGround:
|
||||
return QStringLiteral("ground");
|
||||
}
|
||||
}
|
||||
|
||||
ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string)
|
||||
{
|
||||
if (string == "generic") {
|
||||
if (string == QLatin1String("generic")) {
|
||||
return ElementData::TTGeneric;
|
||||
} else if (string == "fuse") {
|
||||
return ElementData::Fuse;
|
||||
} else if (string == "sectional") {
|
||||
return ElementData::Sectional;
|
||||
} else if (string == "diode") {
|
||||
return ElementData::Diode;
|
||||
} else if (string == QLatin1String("fuse")) {
|
||||
return ElementData::TTFuse;
|
||||
} else if (string == QLatin1String("sectional")) {
|
||||
return ElementData::TTSectional;
|
||||
} else if (string == QLatin1String("diode")) {
|
||||
return ElementData::TTDiode;
|
||||
} else if (string == QLatin1String("ground")) {
|
||||
return ElementData::TTGround;
|
||||
}
|
||||
|
||||
qDebug() << "ElementData::terminalTypeFromString : string : "
|
||||
@@ -340,12 +344,10 @@ QString ElementData::terminalFunctionToString(ElementData::TerminalFunction func
|
||||
switch (function) {
|
||||
case ElementData::TFGeneric:
|
||||
return QString("generic");
|
||||
case ElementData::Phase:
|
||||
case ElementData::TFPhase:
|
||||
return QString ("phase");
|
||||
case ElementData::Neutral:
|
||||
case ElementData::TFNeutral:
|
||||
return QString("neutral");
|
||||
case ElementData::PE:
|
||||
return QString("pe");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,11 +356,9 @@ ElementData::TerminalFunction ElementData::terminalFunctionFromString(const QStr
|
||||
if (string == "generic") {
|
||||
return ElementData::TFGeneric;
|
||||
} else if (string == "phase") {
|
||||
return ElementData::Phase;
|
||||
return ElementData::TFPhase;
|
||||
} else if (string == "neutral") {
|
||||
return ElementData::Neutral;
|
||||
} else if (string == "pe") {
|
||||
return ElementData::PE;
|
||||
return ElementData::TFNeutral;
|
||||
}
|
||||
|
||||
qDebug() << "ElementData::terminalFunctionFromString : string : "
|
||||
|
||||
@@ -68,17 +68,17 @@ class ElementData : public PropertiesInterface
|
||||
|
||||
enum TerminalType {
|
||||
TTGeneric,
|
||||
Fuse,
|
||||
Sectional,
|
||||
Diode
|
||||
TTFuse,
|
||||
TTSectional,
|
||||
TTDiode,
|
||||
TTGround
|
||||
};
|
||||
Q_ENUM(TerminalType)
|
||||
|
||||
enum TerminalFunction {
|
||||
TFGeneric,
|
||||
Phase,
|
||||
Neutral,
|
||||
PE
|
||||
TFPhase,
|
||||
TFNeutral,
|
||||
};
|
||||
Q_ENUM(TerminalFunction)
|
||||
|
||||
|
||||
@@ -182,7 +182,8 @@ QString TerminalData::typeToString(TerminalData::Type type)
|
||||
*/
|
||||
TerminalData::Type TerminalData::typeFromString(const QString &string)
|
||||
{
|
||||
if (string == "Generic") {
|
||||
if (string.isEmpty() ||
|
||||
string == "Generic") {
|
||||
return TerminalData::Generic;
|
||||
} else if (string == "Inner") {
|
||||
return TerminalData::Inner;
|
||||
|
||||
@@ -187,13 +187,14 @@ QHash<QString, XRefProperties> XRefProperties::defaultProperties()
|
||||
}
|
||||
|
||||
bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
||||
return (m_show_power_ctc == xrp.m_show_power_ctc &&
|
||||
m_display == xrp.m_display &&
|
||||
m_snap_to == xrp.m_snap_to &&
|
||||
m_prefix == xrp.m_prefix &&
|
||||
m_master_label == xrp.m_master_label &&
|
||||
m_offset == xrp.m_offset &&
|
||||
m_xref_pos == xrp.m_xref_pos );
|
||||
return (m_show_power_ctc == xrp.m_show_power_ctc
|
||||
&& m_display == xrp.m_display
|
||||
&& m_snap_to == xrp.m_snap_to
|
||||
&& m_prefix == xrp.m_prefix
|
||||
&& m_master_label== xrp.m_master_label
|
||||
&& m_offset == xrp.m_offset
|
||||
&& m_xref_pos == xrp.m_xref_pos
|
||||
&& m_slave_label == xrp.m_slave_label);
|
||||
}
|
||||
|
||||
bool XRefProperties::operator !=(const XRefProperties &xrp) const
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "qetapp.h"
|
||||
|
||||
#include "configdialog.h"
|
||||
#include "configpages.h"
|
||||
#include "ui/configpage/configpages.h"
|
||||
#include "editor/ui/qetelementeditor.h"
|
||||
#include "elementscollectioncache.h"
|
||||
#include "factory/elementfactory.h"
|
||||
|
||||
@@ -1420,15 +1420,13 @@ void QETProject::readDiagramsXml(QDomDocument &xml_project)
|
||||
QDomElement diagram_xml_element = diagram_nodes
|
||||
.at(i)
|
||||
.toElement();
|
||||
Diagram *diagram = new Diagram(this);
|
||||
auto diagram = new Diagram(this);
|
||||
m_diagrams_list << diagram;
|
||||
|
||||
int diagram_order = -1;
|
||||
if (!QET::attributeIsAnInteger(diagram_xml_element,
|
||||
QStringLiteral("order"),
|
||||
&diagram_order))
|
||||
diagram_order = 500000;
|
||||
|
||||
addDiagram(diagram, diagram_order-1);
|
||||
connect(&diagram->border_and_titleblock, &BorderTitleBlock::needFolioData,
|
||||
this, &QETProject::updateDiagramsFolioData);
|
||||
connect(diagram, &Diagram::usedTitleBlockTemplateChanged,
|
||||
this, &QETProject::usedTitleBlockTemplateChanged);
|
||||
|
||||
diagram->initFromXml(diagram_xml_element);
|
||||
if(dlgWaiting)
|
||||
@@ -1436,6 +1434,8 @@ void QETProject::readDiagramsXml(QDomDocument &xml_project)
|
||||
}
|
||||
}
|
||||
|
||||
updateDiagramsFolioData();
|
||||
|
||||
//Initialise links between elements in this project
|
||||
//and refresh the text of conductor
|
||||
if(dlgWaiting)
|
||||
|
||||
@@ -18,18 +18,18 @@
|
||||
|
||||
#include "configpages.h"
|
||||
|
||||
#include "NameList/nameslist.h"
|
||||
#include "bordertitleblock.h"
|
||||
#include "exportpropertieswidget.h"
|
||||
#include "properties/reportproperties.h"
|
||||
#include "qetapp.h"
|
||||
#include "qeticons.h"
|
||||
#include "qetproject.h"
|
||||
#include "ui/borderpropertieswidget.h"
|
||||
#include "ui/conductorpropertieswidget.h"
|
||||
#include "ui/reportpropertiewidget.h"
|
||||
#include "ui/titleblockpropertieswidget.h"
|
||||
#include "ui/xrefpropertieswidget.h"
|
||||
#include "../NameList/nameslist.h"
|
||||
#include "../bordertitleblock.h"
|
||||
#include "../exportpropertieswidget.h"
|
||||
#include "../properties/reportproperties.h"
|
||||
#include "../qetapp.h"
|
||||
#include "../qeticons.h"
|
||||
#include "../qetproject.h"
|
||||
#include "../borderpropertieswidget.h"
|
||||
#include "../conductorpropertieswidget.h"
|
||||
#include "../reportpropertiewidget.h"
|
||||
#include "../titleblockpropertieswidget.h"
|
||||
#include "../xrefpropertieswidget.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QFontDialog>
|
||||
@@ -18,8 +18,8 @@
|
||||
#ifndef CONFIG_PAGES_H
|
||||
#define CONFIG_PAGES_H
|
||||
#include "configpage.h"
|
||||
#include "ui/projectpropertiesdialog.h"
|
||||
#include "ui/titleblockpropertieswidget.h"
|
||||
#include "../projectpropertiesdialog.h"
|
||||
#include "../titleblockpropertieswidget.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
@@ -18,7 +18,7 @@
|
||||
#ifndef GENERALCONFIGURATIONPAGE_H
|
||||
#define GENERALCONFIGURATIONPAGE_H
|
||||
|
||||
#include "../../configpage.h"
|
||||
#include "configpage.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
*/
|
||||
#include "projectconfigpages.h"
|
||||
|
||||
#include "autoNum/numerotationcontext.h"
|
||||
#include "autoNum/ui/autonumberingmanagementw.h"
|
||||
#include "autoNum/ui/folioautonumbering.h"
|
||||
#include "autoNum/ui/formulaautonumberingw.h"
|
||||
#include "autoNum/ui/selectautonumw.h"
|
||||
#include "qeticons.h"
|
||||
#include "qetproject.h"
|
||||
#include "ui/borderpropertieswidget.h"
|
||||
#include "ui/conductorpropertieswidget.h"
|
||||
#include "ui/diagramcontextwidget.h"
|
||||
#include "ui/reportpropertiewidget.h"
|
||||
#include "ui/titleblockpropertieswidget.h"
|
||||
#include "ui/xrefpropertieswidget.h"
|
||||
#include "../autoNum/numerotationcontext.h"
|
||||
#include "../autoNum/ui/autonumberingmanagementw.h"
|
||||
#include "../autoNum/ui/folioautonumbering.h"
|
||||
#include "../autoNum/ui/formulaautonumberingw.h"
|
||||
#include "../autoNum/ui/selectautonumw.h"
|
||||
#include "../qeticons.h"
|
||||
#include "../qetproject.h"
|
||||
#include "../borderpropertieswidget.h"
|
||||
#include "../conductorpropertieswidget.h"
|
||||
#include "../diagramcontextwidget.h"
|
||||
#include "../reportpropertiewidget.h"
|
||||
#include "../titleblockpropertieswidget.h"
|
||||
#include "../xrefpropertieswidget.h"
|
||||
|
||||
//#include "ui_autonumberingmanagementw.h"
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include "projectpropertiesdialog.h"
|
||||
|
||||
#include "../configdialog.h"
|
||||
#include "../configpages.h"
|
||||
#include "../projectconfigpages.h"
|
||||
#include "configpage/configpages.h"
|
||||
#include "configpage/projectconfigpages.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user