Re: freepascal-code to take a QET- Element and scale the content by a fact
Hi Plc-user,
it only takes me ~3 seconds to compile it and push it to the repository.
You are not logged in. Please login or register.
QElectroTech → Scripts → freepascal-code to take a QET- Element and scale the content by a fact
Hi Plc-user,
it only takes me ~3 seconds to compile it and push it to the repository.
Today I uploaded a new version of "QET_ElementScaler" to github: https://github.com/plc-user/QET_ElementScaler
This version is completely rewritten in C++, where I (like QET) use pugixml for handling the contents of the element files.
I made a few additions/changes that makes working with the software easier: The XML description line no longer needs to be removed afterwards!
As before, x and y scaling factors can be specified, input is via STDIN (-i) or a file (-f FILEINAME) and output is, as before, to a new file or to STDOUT (-o).
In addition, I have added the possibility to remove "terminals" from the element. This can be useful when terminals can be omitted from overloaded front views.
Furthermore, there is now the possibility to flip polygons and lines horizontally and/or vertically. This can be useful during the development of complex front views, as long as these functions are not yet available in the QET element editor.
Special care should be taken with the option "--OverwriteOriginal", because here the original file will be overwritten WITHOUT further request!
The scaled values of the new element are written into the new file with a maximum of 2 decimal places. In my view, this is completely sufficient for the display of schematic symbols and front views (thumbnails). In some elements present in the QET collection I have seen values with up to six decimal places, which in my opinion is excessive.
To "fix" such elements, QET_ElementScaler can of course be used! With the call:QET_ElementScaler -f FILENAME
the values are rounded to max. 2 decimal places and any font sizes with decimal places are rounded to whole numbers.
I wish all users of the software a lot of fun and success with it and would like to see bugs reported (e.g. here or at github). Of course, I also have an "open ear" for suggestions for improvement!
Best regards
plc-user
It's not possible to integreted it directly on QET like it's C++?
Hi Plc-user,
it only takes me ~3 seconds to compile it and push it to the repository.
Thank you very much !
It's not possible to integreted it directly on QET like it's C++?
There are several new topics for me at once:
For the beginnings in Pascal I only needed to add a little XML to the Pascal knowledge. The change to C++ was then already bigger. But then to integrate that into an existing, grown QT project, that's quite another matter...
For the moment I have put together a small (and from my point of view) usable package. There is no question that in the foreseeable future it will make sense to integrate scaling and mirroring directly into QET's Element-Editor!
Ok, compile and work fine on Apple Silicon chip.
laurent@mini-de-laurent ~ % cd QET_ElementScaler
laurent@mini-de-laurent QET_ElementScaler % ./QET_ElementScaler --FlipVertical -f ../.qet/elements/p.elmt
laurent@mini-de-laurent QET_ElementScaler %
galexis wrote:It's not possible to integreted it directly on QET like it's C++?
There are several new topics for me at once:
For the beginnings in Pascal I only needed to add a little XML to the Pascal knowledge. The change to C++ was then already bigger. But then to integrate that into an existing, grown QT project, that's quite another matter...
For the moment I have put together a small (and from my point of view) usable package. There is no question that in the foreseeable future it will make sense to integrate scaling and mirroring directly into QET's Element-Editor!
Bravo plc-user! QET becomes more and more appealing by the day - many thanks for your great work!
Hamish
QElectroTech → Scripts → freepascal-code to take a QET- Element and scale the content by a fact
Powered by PunBB, supported by Informer Technologies, Inc.
Generated in 0.047 seconds (43% PHP - 57% DB) with 11 queries