Thanks for the links, Laurent!

But we should open a new topc for that!

For now only this:
I have already tried to find a few places that seemed strange to me in terms of the result.

I noticed that the “bounding rect” is used for some functions. However, the “bounding rect” of individual parts is responsible for adding decimal places!

Try it yourself: Copy a rect with integer values for the position and paste it again: The rectangle appears at an integer position.
If a text on the left or right of the same rect is copied and pasted, the position is no longer an integer! And it also depends on font-size...
See the attached example.


EDIT:
Problem with paste-position is fixed in my latest PR at github!  nomicons/cool

Salut Laurent !

to point 1:
One more reason to limit the decimal places: The smaller the element file, the faster it can be loaded!
This is not about loading x thousand elements: We are talking about saving one single element from the element editor!

Point 2:
No discussion: copy-and-paste is important and must and will be kept!

Points 3 and 4:
What I said before: I don't want to have to rely on a second tool to keep the element files tidy! Even if it were my own tool. Let the element editor do that itself!

to “BTW”:
That's a different issue! Let's tick off one topic first!

And as I already wrote in the opening post:

plc-user wrote:

It's not like I'm just asking the question here and waiting for someone else to do the work

The code is ready to upload to github and create a PR!

In almost all cases, these many decimal places are caused by copy-and-paste in the element editor:
Depending on which parts and in which combination the parts are copied and pasted, the element editor inserts the content of the clipboard in strange positions.
The copy-and-paste function in the source code is complex and should be adapted by someone who understands more about Qt programming.
However, we can fix this by paying attention to it when saving.

A binary format of the element file would only disguise the problem...

Salut Laurent,

scorpio810 wrote:

I have mixed feelings when I see the post by Luf, who wants to make maybe 10 meters XXXXL plotter drawingof the medium-voltage system at the factory where he's doing his work placement.

This seems to be a special application that has appeared for the first time in more than 15 years! Until a few days ago, such a size could not be exported at all with QET! Do you remember that we have just changed the maximum size of export files from 10,000 px to larger values?
No one has asked for larger values yet, have they?

scorpio810 wrote:

I have a colleague who did the same on a 3 meters plan, for the 5.5KV cells and other TGBT on our industrial site since 63KV distribution.

Is that still your colleague? I hope so: Then please ask him what he used to create or edit the elements for his project. If I follow your reasoning: It probably couldn't have been the element editor, as it has a limit of two decimal places.

We can also ask Luf how and with which tool he creates and edits his elements.
Maybe he reads here, too?
@Luf: Do you need more than two decimal places in elements for detailed drawings of your schematics, Luf? Then what tool do you use to edit your elements?

scorpio810 wrote:

I remember we limited the primitives in the element editor to two decimal places, (...)

I've “only” been working with QET and following this forum for six or seven years now, and I can't remember any request that someone couldn't draw their elements in sufficient detail because the decimal places in the element editor are limited to two. Do you know of such requests?

At the moment I still see no good reason not to limit the decimal places...!

Salut Laurent !

The fact that someone sits down and writes a script to recognize decimal places in order to minimize them in another script means to me that he is not satisfied with the many decimal places either.

And if I can avoid having to do additional work with one or even two external scripts, then I'll do it!
From my point of view, the element editor itself must ensure that the element file is “clean” and “tidy”.

In any case, I couldn't read any fundamental rejection from your lines, Laurent.
And all other feedback so far is also in favor of limiting the decimal places... nomicons/wink

Edited post!
-------------------------------------------------

Hallo Galexis!

Kannst Du kurz erklären, wofür du diese leeren Eigenschaftsfelder im Projekt benutzt?

(...)
-------------------------------------------------

Salut Galexis !

Peux-tu expliquer brièvement à quoi tu utilises ces champs de propriétés vides dans le projet ?

(...)

-------------------------------------------------

withdraw the question:
If not all the information from the template is entered when a folio is created, the fields should still remain so that something can be entered later.
I will put the diff above in a PR.

Salut Galexis !

Did you read my posts?
especially this one: https://qelectrotech.org/forum/viewtopi … 021#p21021

When the problem exists, it exists in all current flavors of QET!

But as I wrote:
I think I found what you mean and can fix it with the patch in this post:
https://qelectrotech.org/forum/viewtopi … 024#p21024

In the meantime I created a project with empty properties, saved the file and re-opened it again – et voila: see attachment!
Empty properties are saved and reloaded!

That would mean, we only remove empty entries with element-information in element-files, but keep all other properties with empty content.

I would like to remove empty entries in elementInformation from element-files, because it would be a massive overhead and useless information, if an element like an ordinary terminal would have the empty information about up to four auxiliary parts...

Already prepared this diff:

diff --git a/sources/diagramcontext.cpp b/sources/diagramcontext.cpp
index 864ad9b3a..681fed49e 100644
--- a/sources/diagramcontext.cpp
+++ b/sources/diagramcontext.cpp
@@ -151,7 +151,10 @@ bool DiagramContext::operator!=(const DiagramContext &dc) const
 void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const
 {
        foreach (QString key, keys()) {
-               if (m_content[key].toString().trimmed().isEmpty()) { continue; }
+               if ((tag_name == "elementInformation") &&
+                       (m_content[key].toString().trimmed().isEmpty())) {
+                       continue;
+               }
                QDomElement property = e.ownerDocument().createElement(tag_name);
                // try to sort attributes by removing and re-adding
                property.removeAttribute("show");

What do you think, Galexis and Laurent?

O.k. ... guess I found what you mean.
Is it about such entries in project-file?

    <properties>
        <property name="creator" show="1"></property>
        <property name="plant" show="1"></property>
        <property name="author" show="1"></property>
        <property name="folio" show="1"></property>
        (...)

That piece of code changed in the commit is used more than once:
Not just for element-information but also for properties in project-file.

Guess what you mean:
These entries can be used in a "template" for use with new projects.

Then we could differentiate:
- do not save empty information in elements (these are fixed in sourcecode)
- keep property-entries in project-files (entries can be added during runtime)

What do you think?

galexis wrote:

(...) les variables de projet qui n'ont pas de valeur ou un espace en valeur disparaissent après avoir enregistré, puis réouvert le projet.

To avoid misunderstandings:

What do you mean with "variables de projet"?

Maybe the following?

In this commit there was a change with element-information:
In the entries leading and trailing whitespace is removed from content and entries without content are not saved anymore. Why should we save overhead without additional information?

Salut Laurent !

The limitations for maximum image sizes do not have to be set from image-type specifications, but from limitations in QPainter!

Cite from Qt-docs:

(...) while coordinates greater than +/- 2^15 can be used, any painting performed with coordinates outside this range is not guaranteed to be shown (...)

That is true: images greater than 32767 show a black margin! 

That's why we need to set the maximum width and height of exports to pixel-images to 32767.
Sorry for inconvenience!
Already prepare a PR ... follows soon!

Salut Laurent !

According to the research you did (Thanks for that!), there are limitations of the dimensions

32767 x 32767 for BMP
65535 x 65535 for JPG

With these infos I added some code to set the limits according to the file-type, but kept the maximum for all other types at 100.000px

PR is on the way!

263

(9 replies, posted in Import DXF)

When the plugin is not found, you get the Message from attachment. (Language may be different)
If you click on "Installationsordner", the directory where to place the binary of plugin is opened in file-manager.
When the directory dos not exist, it will be created automatically and opened.

Back to the original question:

luf wrote:

Ich denke um eine solche Datei exportieren zu können, müsste ich im Quellcode in der Datei "exportdialog.cpp" auf den Zeilen 1011 und 1016 die range von 10'000px auf 100'000px erhöhen. Was denkt ihr?

Do you think there are technical reasons for the limits of 10.000px, Laurent?

As I wrote above, I created a local version on my Debian-box with the limits set to 100.000px and could export SVG with a width of

svg width="14882.6mm" height="11112.5mm"

see attachments in the post above: https://qelectrotech.org/forum/viewtopi … 993#p20993

Do you think it is possible to rise the limits in general?

Wenn ich mir das so anhöre mit "PDF kann nur 5 m", "10m x 2m - Drucker" und  so:
Ich hätte gerne das Endergebnis gesehen!
In welche Kunsthalle / Galerie kommt das rein? nomicons/wink

266

(7 replies, posted in Elements)

ok ... added!

For next rework:
Please use the elements from repository!
I added element-names and adjusted some terminal-positions!

... einen Anhang habe ich noch!

Hallo Luf,

bei QET und SVG sprechen wir in beiden Fällen von Vektor-Grafik! Also prima skalierbar! Deshalb wäre es schlecht, wenn Du Pixel-Bilder im Plan verwenden würdest!
Habe "gerade mal fix" einen QET-Export einer Folio auf 750x560px und nochmal auf 75000x56000px gemacht.
Wenn ich mir die beiden Dateien im Vergleich anschaue, sind dort "nur" andere Faktoren für "transform=matrix(..." angegeben.
O.k. - das sind ziemlich viele, aber die brauchst Du doch nicht händisch ändern: Dafür gibt es Inkscape!
Du exportierst also zunächst die QET-Datei so groß wie möglich und dann öffnest Du die SVG in Inkscape.
In den Dokument-Eignenschaften die Dokument-Größe auf die gewünschten Werte setzen und den Inhalt skalieren.
Ich kenne Deine Datei nicht, aber so wäre meine Vorgehensweise, solange Du die Sourcen von QET nicht selber kompilieren kannst.

EDIT: Hatte die Anhänge vergessen...

Gruß
  plc-user

Hallo Luf,

Das sind ja mal große Dinge, die Du vorhast!   nomicons/shocked

Willst Du Dir eine Wandtapete mit QET gestalten? nomicons/wink

Einige Vorgaben in QET sind so enthalten, weil sich die Entwickler nicht vorstellen konnten, daß jemand irgendwas anderes (oder wie in diesem Fall) größeres braucht! Ob genau diese Anforderung auch dazugehört oder ob es echte technische Gründe für die Werte gibt, kann ich nicht sagen.

Deine Formulierung suggeriert mir, daß Du die Werte für Deine lokale Installation schon eingetragen und kompiliert hast. Ist das so?
Und: Funktioniert das?

Diese Anforderung macht natürlich neugierig:
In welcher Branche werden (Schalt-) Pläne auf einer einzelnen Seite auf dann auch noch als SVG benötigt oder gefordert?

Gruß
  plc-user

270

(7 replies, posted in Elements)

Please read the names of attached files again, spotu:
Both files, that are attached have the same name and the same content!

271

(9 replies, posted in Import DXF)

@Pai54svt263:

Remark:
The version of QET_ElementScaler in the download-section of QElectroTech may not be the most recent and may contain errors, that are already fixed in official releases.

I recommend to always use the latest version of QET_ElementScaler available at github:
https://github.com/plc-user/QET_ElementScaler
In the release-section you find the latest binaries I made.
The source code could be even more up-to-date...

To check the version, call QET_ElementScaler from command-line without any parameter.
The version-number is shown within the first few lines.
At the moment Version 0.5.3 is available as compiled binaries.

Salut Laurent !

With the help of that shell script, all occurrences of more than x decimal places (default: 5) are searched for in all elements in the current directory.

This raises questions for me:
- Who knows this script?
- Who uses this script?
- Is it also available for win?

I have extended the call a little to only count the elements in official common collection.
With original setting of 5 or more decimals:

$ ./detect_elements_bad_coordinates.sh | awk -F ":" '{ print $1 }' | sort | uniq | wc -l
1190
$ 

search for 4 or more decimals:

$ ./detect_elements_bad_coordinates.sh | awk -F ":" '{ print $1 }' | sort | uniq | wc -l
2004
$ 

If I then know which files are affected: How do I fix them?
Should I really go through the file(s) by hand in a text editor and change the values? Or use the element editor to click on each graphical part to edit?
It would be much more practical if this were done automatically in the background by the software I use to create the graphics!

The decimal places are already limited to two in the element editor, don't we want to be consistent and write only two decimal places to the file?

273

(9 replies, posted in Import DXF)

You can only import dxf for Elements!
So the menu-entry is only available in Element-Editor!

274

(7 replies, posted in Elements)

spotu wrote:

Please replece elements Pilz X3 and PIlz IX1 (topic above) with corrected one in elements library.

Won't be possible, because you added the same file twice!

275

(8 replies, posted in Import DXF)

vadoola wrote:

So I did a quick look, I never quite finished the logic for nested blocks, so that is the problem here. I'll add it to the to do list. Thank you.

At least we don't need to discuss font sizes with this file: All texts are “painted” into the drawing by lines and polygons... nomicons/wink