mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-01 19:09:58 +02:00
Merge branch 'master' into master
This commit is contained in:
@@ -15,10 +15,10 @@ The main goal of the developers is to provide a libre, easy to use and effective
|
||||
|
||||
### Version
|
||||
|
||||
The current stable version is 0.90 and was released on 2023.01.06.
|
||||
The current stable version is 0.100 and was released on 2026.01.25.
|
||||
Once it has been officially released, the stable version is always frozen and is no longer developed.
|
||||
|
||||
New functionalities, bug and issue fixings are further made in the development version (currently 0.100), which can also be [downloaded](https://qelectrotech.org/download.php).
|
||||
New functionalities, bug and issue fixings are further made in the development version (currently 0.100.1 or 0.200.0 if based on new Qt6 port), which can also be [downloaded](https://qelectrotech.org/download.php).
|
||||
|
||||
Users who want to test and take benefits from the last software implementations should use the development version. But... use it at your own risk, since things are sometimes broken or only partially implemented until they are done!
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright 2006-2026 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
@@ -98,16 +98,6 @@ void ElementPropertiesEditorWidget::upDateInterface()
|
||||
ui->m_master_type_cb->setCurrentIndex(
|
||||
ui->m_master_type_cb->findData (
|
||||
m_data.m_master_type));
|
||||
|
||||
// NEU: Checkbox und Zahlenbox für max_slaves einstellen
|
||||
if (m_data.m_max_slaves == -1) {
|
||||
ui->max_slaves_checkbox->setChecked(false);
|
||||
ui->max_slaves_spinbox->setEnabled(false);
|
||||
} else {
|
||||
ui->max_slaves_checkbox->setChecked(true);
|
||||
ui->max_slaves_spinbox->setEnabled(true);
|
||||
ui->max_slaves_spinbox->setValue(m_data.m_max_slaves);
|
||||
}
|
||||
} else if (m_data.m_type == ElementData::Terminal) {
|
||||
ui->m_terminal_type_cb->setCurrentIndex(
|
||||
ui->m_terminal_type_cb->findData(
|
||||
@@ -163,7 +153,10 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
||||
|
||||
//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);
|
||||
|
||||
// NEU: Checkbox mit der Zahlenbox verbinden (Aktivieren/Deaktivieren)
|
||||
connect(ui->max_slaves_checkbox, SIGNAL(toggled(bool)), ui->max_slaves_spinbox, SLOT(setEnabled(bool)));
|
||||
@@ -239,13 +232,6 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
||||
}
|
||||
else if (m_data.m_type == ElementData::Master) {
|
||||
m_data.m_master_type = ui->m_master_type_cb->currentData().value<ElementData::MasterType>();
|
||||
|
||||
// NEU: Wenn Häkchen gesetzt, speichere die Zahl, ansonsten -1 (unendlich)
|
||||
if (ui->max_slaves_checkbox->isChecked()) {
|
||||
m_data.m_max_slaves = ui->max_slaves_spinbox->value();
|
||||
} else {
|
||||
m_data.m_max_slaves = -1;
|
||||
}
|
||||
}
|
||||
else if (m_data.m_type == ElementData::Terminal)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>527</width>
|
||||
<height>492</height>
|
||||
<height>442</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -104,23 +104,6 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="m_master_type_cb"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="max_slaves_checkbox">
|
||||
<property name="text">
|
||||
<string>max. Slaves definieren</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="max_slaves_spinbox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -568,12 +568,9 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element)
|
||||
}
|
||||
auto name = dom_elmt.attribute(QStringLiteral("name"));
|
||||
|
||||
if (m_type == ElementData::Master) {
|
||||
if (name == QLatin1String("type")) {
|
||||
if (m_type == ElementData::Master &&
|
||||
name == QLatin1String("type")) {
|
||||
m_master_type = masterTypeFromString(dom_elmt.text());
|
||||
} else if (name == QLatin1String("max_slaves")) {
|
||||
m_max_slaves = dom_elmt.text().toInt();
|
||||
}
|
||||
}
|
||||
else if (m_type == ElementData::Slave ) {
|
||||
if (name == QLatin1String("type")) {
|
||||
|
||||
@@ -134,7 +134,10 @@ class ElementData : public PropertiesInterface
|
||||
ElementData::Type m_type = ElementData::Simple;
|
||||
|
||||
ElementData::MasterType m_master_type = ElementData::Coil;
|
||||
<<<<<<< master
|
||||
int m_max_slaves{-1};
|
||||
=======
|
||||
>>>>>>> master
|
||||
|
||||
ElementData::SlaveType m_slave_type = ElementData::SSimple;
|
||||
ElementData::SlaveState m_slave_state = ElementData::NO;
|
||||
|
||||
@@ -45,8 +45,6 @@ class MasterElement : public Element
|
||||
void initLink (QETProject *project) override;
|
||||
QRectF XrefBoundingRect() const;
|
||||
|
||||
bool isFull() const; // NEU: Prüft, ob das Slave-Limit erreicht ist
|
||||
|
||||
protected:
|
||||
QVariant itemChange(
|
||||
GraphicsItemChange change,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "linksingleelementwidget.h"
|
||||
#include "../qetgraphicsitem/masterelement.h"
|
||||
|
||||
#include "../qetgraphicsitem/conductor.h"
|
||||
#include "../diagram.h"
|
||||
#include "../diagramposition.h"
|
||||
@@ -386,22 +386,7 @@ QVector <QPointer<Element>> LinkSingleElementWidget::availableElements()
|
||||
|
||||
//If element is linked, remove is parent from the list
|
||||
if(!m_element->isFree()) elmt_vector.removeAll(m_element->linkedElements().first());
|
||||
// NEU: Filtere volle Master-Elemente aus der Liste heraus
|
||||
for (int i = elmt_vector.size() - 1; i >= 0; --i) {
|
||||
Element *elmt = elmt_vector.at(i);
|
||||
|
||||
// Wenn das Element in der Liste ein Master ist
|
||||
if (elmt->linkType() == Element::Master) {
|
||||
|
||||
// Wir wandeln den generischen Element-Pointer in einen MasterElement-Pointer um
|
||||
MasterElement *master = static_cast<MasterElement*>(elmt);
|
||||
|
||||
// Wenn der Master voll ist, werfen wir ihn aus der Liste!
|
||||
if (master->isFull()) {
|
||||
elmt_vector.removeAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return elmt_vector;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user