376

(18 replies, posted in Code)

Health is the most important thing, besides family and friends!
(a little money might help a bit, too...nomicons/wink)

377

(18 replies, posted in Code)

@Laurent: +2

scorpio810 wrote:

(...) yes schemes of cars was very different than industry...

You are completely right, Laurent!
Electrical "installations" in cars are very different!  nomicons/cwy

379

(18 replies, posted in Code)

o.k.  –  Merci, Laurent !

In this case, the learning curve is not quite so steep for me: I "only" have to dive deeper into QT and QET programming!
I've hardly ever had anything to do with sqlite as a programmer.

As I said: For now I just want to understand how QET works "under the hood"... and maybe contribute some things.

"Still learning!" (even at my age nomicons/wink)

380

(18 replies, posted in Code)

Let me ask more specific:

As a user: If I make a change in the circuit diagram, where is this change saved internally? In the XML structure?
It is clear that this will (at some point) be transferred to a sqlite database in memory.

Or is it so that the sqlite DB in memory is used during editing the diagram and the XML structure is only adapted for saving?

To ask technically: (sqlite XOR XML)?   nomicons/wink

Na ja ... "unnötige Drückerei" ... kommt ja immer darauf an, was Du machen willst!

Wenn Du einmal ein Potenzial und die zugehörigen Leitereigenschaften definiert hast und an das Potenzial einen weiteren Draht anschließen willst, macht es schon Sinn, die Eigenschaften überall gleich zu haben:
Potenzial definiert -> neuen Draht dazu -> Eigenschaften vom neuen Draht passen! nomicons/smile

Wieso sollte sich zwischendurch Leiterfarbe oder Querschnitt ändern, oder das Potenzial einen anderen Namen bekommen?
An ein Potenzial gehört eine Farbe, ein Querschnitt, etc. pp.
Wenn zwischendrin z.B. eine Steckverbindung ist, kann ich mir das noch vorstellen...
Aber vor und hinter einem Schalter oder einer Sicherung ist definitiv nicht dasselbe Potenzial, also müssen die Eigenschaften neu eingestellt werden!

Gib' doch mal deinen Anwendungsfall preis, bei dem unterschiedliche Leitereigenschaften für ein Potenzial Verwendung finden sollen (musst ja keine Geheimnisse verraten!).

382

(18 replies, posted in Code)

Salut Laurent,

scorpio810 wrote:

What could be very constructive would be to add the conductors wire section, color, cable, element label, terminal name connected to each end in the sqlite database in a new table, a bit like nomeclature aka BOM.

I would like to understand your comment better, therefore my questions.

How or in what is the internal structure of a folio stored at runtime of QET?
Is it the XML structure as it is in the resulting qet file, or is an sqlite database used internally?
Is there a place where this is documented?
Please don't say: "The source code is the documentation" nomicons/wink

Of course, I would also like the connection information to become an internal QET generation for a cable plan or wiring instructions for the electrician at some point: I don't really like such things with python plugins! This can be quite a hassle on some systems... 
How this can/should be designed for the user is, in my opinion, of secondary importance for the time being: The internal structures need to be understood and extended.

383

(18 replies, posted in Code)

When we insert empty tags it makes the number of changed code-lines even smaller!  nomicons/wink

Here's the new diff:

diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp
index dc9d23595..df0e9fdc6 100644
--- a/sources/qetgraphicsitem/conductor.cpp
+++ b/sources/qetgraphicsitem/conductor.cpp
@@ -1048,6 +1048,7 @@ QDomElement Conductor::toXml(QDomDocument &dom_document,
        } else {
                dom_element.setAttribute("element1", terminal1->parentElement()->uuid().toString());
                dom_element.setAttribute("terminal1", terminal1->uuid().toString());
+               dom_element.setAttribute("terminalname1", terminal1->name());
        }
 
        if (terminal2->uuid().isNull()) {
@@ -1056,6 +1057,7 @@ QDomElement Conductor::toXml(QDomDocument &dom_document,
        } else {
                dom_element.setAttribute("element2", terminal2->parentElement()->uuid().toString());
                dom_element.setAttribute("terminal2", terminal2->uuid().toString());
+               dom_element.setAttribute("terminalname2", terminal2->name());
        }
        dom_element.setAttribute("freezeLabel", m_freeze_label? "true" : "false");
 
diff --git a/sources/qetgraphicsitem/terminal.cpp b/sources/qetgraphicsitem/terminal.cpp
index 54f9ece5f..272720382 100644
--- a/sources/qetgraphicsitem/terminal.cpp
+++ b/sources/qetgraphicsitem/terminal.cpp
@@ -744,6 +744,11 @@ QUuid Terminal::uuid() const
        return d->m_uuid;
 }
 
+QString Terminal::name() const
+{
+       return d->m_name;
+}
+
 /**
        @brief Conductor::relatedPotentialTerminal
        Return terminal at the same potential from the same
diff --git a/sources/qetgraphicsitem/terminal.h b/sources/qetgraphicsitem/terminal.h
index e014d2a1f..a8d22abc8 100644
--- a/sources/qetgraphicsitem/terminal.h
+++ b/sources/qetgraphicsitem/terminal.h
@@ -74,6 +74,7 @@ class Terminal : public QGraphicsObject
                Diagram  *diagram             () const;
                Element  *parentElement       () const;
                QUuid uuid                    () const;
+               QString   name                () const;
 
                QList<Conductor *> conductors() const;
                Qet::Orientation orientation() const;

The TerminalNames are only inserted into the connection, when the terminals have UUIDs ... only then!

In the element-collection I found "some" elements which have terminals with names but no UUID. Already working on them... nomicons/smile

Markus_QE wrote:

(...)
Hatte schon öftern nun bis zu vielleicht 20 Drähte beschriftet und beim 21 vergess ich den Haken unten heraus zu nehmen und flugs nennt mir das Programm alle bisherigen Farben um :-(
(...)

QET hat genau das gemacht, was Du "gewollt" hast!  nomicons/wink

Das ist hier mit Sicherheit schon jedem passiert – mehrfach!
Und: Ja, die Checkbox aus dem Bildschirmfoto kennt hier wahrscheinlich auch jeder.

Habe dafür auch keine globale Stelle gefunden, wo man das dauerhaft umschalten kann.


PS: Erster April ... da kann ich mir ein wenig Ironie nicht verkneifen!  nomicons/wink

You are right: The element-editor could be much more comfortable!
But at the moment ...

Do you know that you can move parts with smaller steps when pressing <Ctrl>?
For moving at even smaller steps: use the Input-Fields / SpinEdits

All kinds of geometrical forms (triangle, rectangle,...) can be drawn with the polygon-tool. And you can edit every node of the polygon afterwards.

"closed lines" => polygons  ?

386

(18 replies, posted in Code)

Let me ask to be on the safe side:
Don't insert the Tag?
OR
Insert the Tag with empty value?

To all Brazilian users here in the forum:
Since yesterday, in version 0.10 dev, Brazilian with the language setting pt_BR is more reliably available in the application and in the elements and title blocks.
Please try and let us know if you have any comments!

via Online-Translator:

A todos os usuários brasileiros aqui no fórum:
Desde ontem, na versão 0.10 dev, o idioma brasileiro com a configuração pt_BR também está disponível de forma mais confiável no aplicativo e nos elementos e blocos de título.
Por favor, experimente e nos informe se tiver algum comentário!

Den Reiter "Darstellung" in den Leitereigenschaften hast Du gesehen?

Just a suggestion:
https://qelectrotech.org/forum/viewtopic.php?id=2716

Hello everyone!

For some time now, it is possible to assign a name to terminals in the element files. A unique UUID is automatically added in the background. If such a component is then inserted into a schematic and provided with connections, the UUIDs of the terminals are already used in the qet file to identify the connection.

At some point in the future, when the developers have (a lot of) time for the project again, the "UUID" and "Name" information will be used to automatically generate cable plans and wiring instructions.

As a "programming exercise", I looked in the source code for a way to include the names of the terminals in the connection line in the schematic file and actually found what I was looking for!

However, there is one "difficulty":
What name may automatically be used if the creator of the element has not assigned any names?
I made it easy for myself here and also saved the UUID of the connection for the name.

Here is the resulting diff file:

diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp
diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp
index dc9d23595..df0e9fdc6 100644
--- a/sources/qetgraphicsitem/conductor.cpp
+++ b/sources/qetgraphicsitem/conductor.cpp
@@ -1048,6 +1048,7 @@ QDomElement Conductor::toXml(QDomDocument &dom_document,
        } else {
                dom_element.setAttribute("element1", terminal1->parentElement()->uuid().toString());
                dom_element.setAttribute("terminal1", terminal1->uuid().toString());
+               dom_element.setAttribute("terminalname1", terminal1->name());
        }

        if (terminal2->uuid().isNull()) {
@@ -1056,6 +1057,7 @@ QDomElement Conductor::toXml(QDomDocument &dom_document,
        } else {
                dom_element.setAttribute("element2", terminal2->parentElement()->uuid().toString());
                dom_element.setAttribute("terminal2", terminal2->uuid().toString());
+               dom_element.setAttribute("terminalname2", terminal2->name());
        }
        dom_element.setAttribute("freezeLabel", m_freeze_label? "true" : "false");

diff --git a/sources/qetgraphicsitem/terminal.cpp b/sources/qetgraphicsitem/terminal.cpp
index 54f9ece5f..951d67aa0 100644
--- a/sources/qetgraphicsitem/terminal.cpp
+++ b/sources/qetgraphicsitem/terminal.cpp
@@ -744,6 +744,16 @@ QUuid Terminal::uuid() const
        return d->m_uuid;
 }

+QString Terminal::name() const
+{
+    if (d->m_name == "")
+    {
+               return ((d->m_uuid).toString());
+       } else {
+               return d->m_name;
+       }
+}
+
 /**
        @brief Conductor::relatedPotentialTerminal
        Return terminal at the same potential from the same
diff --git a/sources/qetgraphicsitem/terminal.h b/sources/qetgraphicsitem/terminal.h
index e014d2a1f..a8d22abc8 100644
--- a/sources/qetgraphicsitem/terminal.h
+++ b/sources/qetgraphicsitem/terminal.h
@@ -74,6 +74,7 @@ class Terminal : public QGraphicsObject
                Diagram  *diagram             () const;
                Element  *parentElement       () const;
                QUuid uuid                    () const;
+               QString   name                () const;

                QList<Conductor *> conductors() const;
                Qet::Orientation orientation() const;

I understand this code fragment explicitly as a basis for discussion:
Please have a look at it and leave comments!

Best regards
  plc-user

Hallo Stefan,

für konkrete Hilfe zum Aufsetzen eines Build-Systems wäre es hilfreich zu wissen, auf welchem System Du QET (mit-)entwickeln willst.

Da ich normalerweise ein sehr schlankes Xfce4 auf Debian unstable nutze, wollte ich das an dieser Stelle "sauber" getrennt halten und habe deswegen eine separate VM mit Debian stable mit LXQT als Fenstermanager aufgesetzt. Da ist dann schon eine ordentliche QT-Umgebung vorhanden, in die sich qtcreator und die anderen Pakete "schlanker" einfügen lassen als bei einer GTK-Umgebung.
Trotz des "Zusatzaufwandes" der VM war das insgesamt recht überschaubar, bis dann erstmalig das Kompilieren von QET geklappt hat. nomicons/smile

Das Klemmenplan-Plugin oder der Klemmleisten-Manager deckt auch die Verbindungen zwischen Bauteilen ab?
Ich glaube das ist der Anwendungsfall, den Stefan für die Produktion beschreibt...

Um einen eindeutige Verdrahtungsvorschrift zu erstellen, muss aus dem Schaltplan natürlich auch eindeutig hervorgehen, welcher Draht von wo nach wo gezogen werden sollI

Im Bild (Anhang) siehst Du die Schwierigkeit:
Im oberen Teil ist nicht ersichtlich, welche Verbindung von wo nach wo geht. Jedenfalls nicht auf den ersten Blick.
Für die eindeutige Verdrahtungsvorschrift müssten die Verbindungen, wie im unteren Teil zu sehen, mit Abzweigen erstellt werden. Dann kann man sehen, wie die Leitungsführung ist. Das solte im Idealfall automatisch vom Schaltplan-Editor erledigt werden und nicht wie hier mit den Elementen "Abzweig".

An den vielen "müßte" und "sollte" kannst Du vielleicht ablesen, dass diese Funktion so noch nicht vorhanden ist.

Du wirst also wahrscheinlich selber etwas "stricken" müssen, das sich durch die conductor-Einträge der qet-Datei hangelt und mit den UUIDs der Bauteile und Anschlüsse die Verdrahtung herauspuzzelt. Bedingung für eine "saubere" Verdrahtungsvorschrift ist aber auch die persönliche Disziplin des Schaltplan-Erstellers, die Verbindungen so zu ziehen, wie es später verdrahtet werden soll.  nomicons/wink

Hallo Stefan,

So wie ich das sehe, wird das schwierig ... zumindest im Moment.

Ja, bei den Anschlüssen der Elemente sind bei neueren Dateiversionen Namen und UUIDs vorhanden. Die UUIDs werden beim Erstellen des Elements automatisch vergeben, aber für die Eingabe der Namen ist der Ersteller des Elements verantwortlich.
Von daher hast Du es auf jeden Fall (bei Benutzen von vorhandenen Elementen) nicht leicht, die herauszufinden, wo Namen und UUIDs vorhanden sind.
Zusätzlich:
Die Eigenschaften "Name" und "UUID" bei den Anschlüssen mögen zwar bei den von dir benutzten Elementen vorhanden sein, aber soweit ich das verstehe, sind diese Angaben im Moment noch "for future use"!  nomicons/sad
Joshua (der Haupt-Entwickler von QET) hat diese Eigenschaften vor einiger Zeit für die Elemente eingeführt, die werden aber im Schaltplan-Modul noch nicht weiter verwendet. Ich habe zum Testen einfach mal zwei Bauteile, von denen ich weiß, dass sie Namen und UUIDs haben, miteinander in einem Plan verbunden, finde aber in der *.qet-Datei keinen Hinweis darauf, dass die Klemmstellen irgendetwas miteinander zu tun haben.
Leider haben die beiden Entwickler von QET im Moment aus persönlichen Gründen wenig Gelegenheit, aktiv an QET zu entwickeln, sodass wahrscheinlich noch Zeit ins Land geht, bevor die Namen der Anschlüsse im Schaltplan Verwendung finden ... leider!
Es sei denn, Du kennst jemanden, der die Entwickler aktiv unterstützen kann!  nomicons/wink
(Das gilt selbstredend auch für die anderen Leser!)

The menu a good place to try out whether setting of transparency works in principle! But the developer must have had something else in mind for this menu item than the SVG export...
For this function a new Checkbox in the export-dialog should be introduced.

Maybe with the sourcecode I uploaded to my github-repository?
https://github.com/plc-user/qelectrotech-source-mirror
(can create a pull-request...)

EDITED this post and removed the diff from here because it grew bigger and bigger...  nomicons/wink

EDITED AGAIN:
Setting and function is already available in Version 0.100 (DEV)  nomicons/smile

Vielleicht meinst Du dies:

"Parent" = Master-Element
"Child" = Slave-Element

Die Elemente müssen natürlich entsprechend angelegt sein, dann kannst Du ein oder mehrere Slaves einem Master zuordnen, die dann auch die Bezeichnung vom Master bekommen.

scorpio810 wrote:

Personally, I wouldn't calculate a script for so little. With KDE's Kate editor, you can search and replace one occurrence by another in all the files in a folder or in sub folders in 3 seconds.

cross-platform with DoubleCommander's search function!

Hello Tom,

as far as I can see:
All graphical elements of the diagram are completely processed by a QT library function. So if you want to change the background color of the SVG export, you have to change the background color of the folio. This is not possible at the moment.
Due to the small number of active developers, I see little chance of this being implemented in the foreseeable future.

Best regards
  plc-user

399

(96 replies, posted in Scripts)

It seems that Pixel-Graphic-Software doesn't show the SVG right.
Gwenview and KolourPaint are originally made for Pixel-Graphics?

LibreOffice Draw and Firefox show the SVGs correctly!

400

(96 replies, posted in Scripts)

Salut Laurent!

Done!  nomicons/smile