Re: QET-Element to SVG
Ok ... the hacks with text-editor seem to work!
All Elements which contained "input" are updated with current QET-Element-Editor (and Text-Editor)!
PullRequest is on the way!
You are not logged in. Please login or register.
QElectroTech → Scripts → QET-Element to SVG
Ok ... the hacks with text-editor seem to work!
All Elements which contained "input" are updated with current QET-Element-Editor (and Text-Editor)!
PullRequest is on the way!
The workaround it's to be
source of text: element information
/
Label
source of text: element information
/
Label
Done!
Hallo plc-user
I will try to explain how these elements work.
Element in parent directory have XML tag:
link_type="next_report"
text_from="ElementInfo"
<text>/</text>
<info_name>label</info_name>
<definition hotspot_y="6" height="20" link_type="next_report" type="element" version="0.100.0" width="10" hotspot_x="5">
<uuid uuid="{9edd9ef3-5843-4a76-96cf-45c309e38edc}"/>
<names>
<name lang="cs">Odkaz - cívka (vodorovně)</name>
<name lang="it">Riferimento bobina / (orizzontale)</name>
<name lang="ar">مرجع ملف (أفقي)</name>
<name lang="fr">Reference bobine h</name>
<name lang="pl">Odsyłacz - cewka (poziomo)</name>
<name lang="en">Reference coil (horizontal)</name>
<name lang="nl">Referentie volgend spoel</name>
</names>
<informations>Author: Computer Shooter
License: see http://qelectrotech.org/wiki/doc/elemen … ations>
<description>
<line end2="none" style="line-style:normal;line-weight:normal;filling:none;color:black" length2="1.5" x1="0" y1="3" end1="none" y2="1" length1="1.5" x2="0" antialias="false"/>
<rect style="line-style:normal;line-weight:normal;filling:none;color:black" height="4" ry="0" x="-3" rx="0" antialias="false" y="3" width="6"/>
<line end2="none" style="line-style:normal;line-weight:normal;filling:none;color:black" length2="1.5" x1="0" y1="8" end1="none" y2="9" length1="1.5" x2="0" antialias="false"/>
<dynamic_text frame="false" Valignment="AlignTop" uuid="{368453fa-0069-4859-b935-d637078a7dfd}" font="Sans Serif,5,-1,5,50,0,0,0,0,0" x="2" keep_visual_rotation="false" Halignment="AlignLeft" rotation="0" text_width="-1" y="-4.5" text_from="ElementInfo" z="4">
<text>/</text>
<info_name>label</info_name>
</dynamic_text>
</description>
</definition>
Elements in Children directory have XML tag:
link_type="previous_report"
text_from="ElementInfo"
<text>/</text>
<info_name>label</info_name>
<definition link_type="previous_report" type="element" hotspot_x="5" height="20" hotspot_y="6" width="10" version="0.100.0">
<uuid uuid="{b2847f39-5e77-4d50-8b8e-32e676a2039f}"/>
<names>
<name lang="fr">Reference bobine h</name>
<name lang="ar">مرجع ملف (أفقي)</name>
<name lang="nl">Referentie vorig spoel</name>
<name lang="cs">Odkaz - cívka (vodorovně)</name>
<name lang="it">Riferimento bobina / (orizzontale)</name>
<name lang="pl">Odsyłacz - cewka (poziomo)</name>
<name lang="en">Reference coil (horizontal)</name>
</names>
<informations>Author: Computer Shooter
License: see http://qelectrotech.org/wiki/doc/elemen … ations>
<description>
<line x2="0" length2="1.5" y2="1" length1="1.5" x1="0" style="line-style:normal;line-weight:normal;filling:none;color:black" end2="none" y1="3" end1="none" antialias="false"/>
<rect height="4" style="line-style:normal;line-weight:normal;filling:none;color:black" x="-3" ry="0" y="3" width="6" antialias="false" rx="0"/>
<line x2="0" length2="1.5" y2="9" length1="1.5" x1="0" style="line-style:normal;line-weight:normal;filling:none;color:black" end2="none" y1="8" end1="none" antialias="false"/>
<dynamic_text Halignment="AlignLeft" uuid="{33b8ff65-4c02-4e03-af50-883c723f88a3}" text_width="-1" x="2" z="4" frame="false" text_from="ElementInfo" Valignment="AlignTop" y="-4.5" rotation="0" font="Sans Serif,5,-1,5,50,0,0,0,0,0" keep_visual_rotation="false">
<text>/</text>
<info_name>label</info_name>
</dynamic_text>
</description>
</definition>
So, I saw some error in your pull request: "update elements with old "input"-parts to current version #8".
Many element have tag
text_from="UserText"
Please change these to
text_from="ElementInfo"
I attached a new QET example.
Best regards,
Laurent
Salut Laurent,
ok ... understood and changed that for elements that only have one "dynamic_text" like the samples above.
What about the elements that have a contact with numbers like this one with some more "dynamic_text"?
<definition hotspot_y="26" width="30" version="0.100.0" type="element" height="50" link_type="next_report" hotspot_x="17">
<uuid uuid="{8e4fac98-05b1-4f6a-be61-8559b7b5789a}"/>
<names>
<name lang="it">Contatto NC</name>
<name lang="cs">Rozpínací kontakt NC</name>
<name lang="fr">Contact NC</name>
<name lang="nl">ref volgend complex contact (NC)</name>
<name lang="es">Contacto NC</name>
<name lang="pl">Zestyk rozwierny</name>
<name lang="en">complex contact NC</name>
</names>
<informations>autor: paul deelenlicencja: zobacz http://qelectrotech.org/wiki/doc/elements_license</informations>
<description>
<dynamic_text font="Sans Serif,4,-1,5,25,0,0,0,0,0" text_width="-1" keep_visual_rotation="false" frame="false" Halignment="AlignLeft" x="-23" rotation="0" text_from="UserText" z="1" uuid="{5ede35ec-f568-47de-9ee3-5cb8ae7ff744}" Valignment="AlignTop" y="8">
<text>12</text>
</dynamic_text>
<dynamic_text font="Sans Serif,5,-1,5,50,0,0,0,0,0" text_width="-1" keep_visual_rotation="false" frame="false" Halignment="AlignLeft" x="-23" rotation="0" text_from="UserText" z="2" uuid="{06a8d219-aa9f-4133-b285-c276975af1f5}" Valignment="AlignTop" y="-25.5">
<text>11</text>
</dynamic_text>
<polygon y3="-10" x2="-10" x1="-10" y2="10" style="line-style:normal;line-weight:normal;filling:none;color:black" antialias="true" y1="20" closed="false" x3="-4"/>
<line x2="-3" x1="-10" y2="-9" style="line-style:normal;line-weight:normal;filling:none;color:black" length2="1.5" antialias="false" y1="-9" length1="1.5" end2="none" end1="none"/>
<line x2="-10" x1="-10" y2="-9" style="line-style:normal;line-weight:normal;filling:none;color:black" length2="1.5" antialias="false" y1="-20" length1="1.5" end2="none" end1="none"/>
<dynamic_text font="Sans Serif,10,-1,5,50,0,0,0,0,0" text_width="-1" keep_visual_rotation="false" frame="false" Halignment="AlignLeft" x="-2" rotation="0" text_from="ElementInfo" z="6" uuid="{30a611c8-4454-4c09-95dd-8706dab6053e}" Valignment="AlignTop" y="-12.5">
<text>/</text>
<info_name>label</info_name>
</dynamic_text>
<terminal x="-10" type="Generic" uuid="{5746597c-3494-4922-9747-b8d1512da17c}" orientation="n" name="" y="-20"/>
<terminal x="-10" name="" type="Generic" uuid="{3a8a0eed-90d6-4948-a59f-96dafaa4dc31}" orientation="s" y="20"/>
</description>
</definition>
Do we need to change this from text_from="UserText" to text_from="ElementInfo", too ?
Hallo Plc-user,
no need it's already there just above the "/".
Only "/" + text_from="ElementInfo" + <info_name>label</info_name> can be transform to xrefs.
"/ " will be replaced when linking two opposite elements by the XRefs.( folio + position)
Ok!
Then: Let's publish the changes!
Everything has been packaged, but not yet macOS arm64.
Please back up your projects before using it, we never know
Many elements have changed UUID, which is normal as changes have been made to them.
So if you want to update your projects, you may see an information box when you drag and drop an item that exists in your project,
you can choose to keep two versions of the item, overwrite the old version, etc.
Having fewer different individual parts inside the QET-Elements helps with multiline-Text for SVG-converting, too!
Especially for text-parts! See attachment!
[Edit]:
Just uploaded sources and created a new beta-release of QET_ElementScaler for Debian Bookworm, win32 and win64 at GitHub:
https://github.com/plc-user/QET_ElementScaler
Salut Laurent !
Unfortunately, I had to create a bug report for the element editor:
The font sizes of the "dynamic_text" of older file formats are not handled correctly since some programme versions (see BugTracker). I have tested with the current DEV version and the 0.9 AppImage for Linux.
When the bug has been fixed, I will of course reapply my scripts to the original elements! But how do we proceed until then? I don't yet have enough experience with GitHub to be able to revert the current changes myself.
Sorry for the bad news!
Hallo Plc-user
what number of PR you want to revert?
On https://github.com/qelectrotech/qelectr … nts/pull/9 you have a revert button.
Sorry for the bad news!
Don't be sorry, only those who do nothing don't make mistakes..
Whe is done, talk me.
I do a
git submodule update --remote elements
And rebuild all packages.
Thanks, Laurent for the hints!
Just reverted the PRs #8 and #9
What do you think: Do we have the chance for a BugFix of this mal-function in Element-Editor?
I don't know!, in the past in settings/text field you can change fonts size and police for new text parts enter on element editor..
QET code is a labyrinth which can quickly become tricky...
As written in BugReport, the bug must be there since several releases:
The ReadyToUse-Version from November 15th and even the 0.9 AppImage from January this year show the same effects. I can't go further in history. I guess it was when the tags of "dynamic_text" were re-worked...
EDIT:
It's not when editing the texts: Opening the file is all you have to do to see the bug.
This element pilz-s30-vue.elmt was generated in version 0.70 ... strange by the DXF converter in the meantime we must have probably switched to another font recording format, if there are only a few symbols, isn't that annoying?
Edit maybe DXF converter convert texts to old font format..?
There are only "a few" elements with this combination of tags:
$ grep -R "dynamic_text" . | grep "font_size" | awk '{ print $1 }' | sort | uniq | wc -l
67
$
grep -R "dynamic_text" . | grep "font_size" | awk '{ print $1 }' | sort | uniq > list2.txt
./10_electric/10_allpole/114_connections/combine.elmt:
./10_electric/10_allpole/114_connections/jump.elmt:
./10_electric/20_manufacturers_articles/allen_bradley/1734/1734_ib8s.elmt:
./10_electric/20_manufacturers_articles/circuit-microsens/g6_microswitch_vertikal.elmt:
./10_electric/20_manufacturers_articles/endress_hauser/e_h_prosonic_s_fdu90.elmt:
./10_electric/20_manufacturers_articles/endress_hauser/e_h-prosonic_s_fmu90.elmt:
./10_electric/20_manufacturers_articles/endress_hauser/endress-&-hauser-liquisys-m-cpm223.elmt:
./10_electric/20_manufacturers_articles/gce/xd.elmt:
./10_electric/20_manufacturers_articles/ifm/10_connection_technology/ac5209_entrees.elmt:
./10_electric/20_manufacturers_articles/ifm/10_connection_technology/ac5209_sorties.elmt:
./10_electric/20_manufacturers_articles/ifm/10_connection_technology/ac5215.elmt:
./10_electric/20_manufacturers_articles/jm_ulcos/convertisseur_jm_ulcos_920d2.elmt:
./10_electric/20_manufacturers_articles/omron/01_PLC_controllers/cj1/taille1/cj1wid232.elmt:
./10_electric/20_manufacturers_articles/omron/01_PLC_controllers/cj1/taille1/omron
./10_electric/20_manufacturers_articles/pilz/09_safety_modules/pnoz/pilz-s30-vue.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/extension_tm3/ana/tm3ti8_2_2t.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/extension_tm3/ana/tm3ti8_layout.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/extension_tm3/ana/tm3ti8t_1_2.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/extension-tm4/carteentreeanatmc4ai2.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/extension-tm4/tm4es4_layout.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/m221/02_m221ce40t.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/m241/tm241ce24r/tm241ce24r_sorties
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/analog-connector/bmxami_1.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddi_1.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddi_2.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddi_3.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddo_1.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddo_2.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddo_3.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/modicon-m340/discret-connector/bmxddo_4.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/01_PLC_controllers/tcsesm083f2cu0.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/20_frequency_drives/atv320.elmt:
./10_electric/20_manufacturers_articles/schneider_electric/protection/Three-phase
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_215-1hg40-0xb0-2.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_215-1hg40-0xb0-31.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_215-1hg40-0xb0-4.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_215-1hg40-0xb0.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_221-1bf32-0xb0.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_221-1bh32-0xb0.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_221-bh32-0xb0-2.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_222-1hf32-0xb01.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_222-1hf32-0xb0-2.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_223-1pl32-0xb0-2.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_223-1pl32-0xb0-3.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_223-1pl32-0xb0-4.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_223-1pl32-0xb0.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_234-4he32-0xb0-2.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/6es7_234-4he32-0xb0.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/s71200_cpu_1212_ac_dc-rel_03.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/s7-1200-cpu-1215-dc-dc-rly.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/s7-1200-sm1221-16i-dc.elmt:
./10_electric/20_manufacturers_articles/siemens/01_PLC_controllers/6es7-1200/s7-1200-sm1231-4ai.elmt:
./10_electric/20_manufacturers_articles/siemens/02_human_machine_interface/terminal_operateur/tp700.elmt:
./10_electric/20_manufacturers_articles/siemens/90_connection_technology/3rk1100-0cq20-0aa3.elmt:
./10_electric/20_manufacturers_articles/siemens/90_connection_technology/3rk1200-0cq20-0aa3.elmt:
./10_electric/20_manufacturers_articles/siemens/90_connection_technology/3rk1400-1dq03-0aa3.elmt:
./10_electric/20_manufacturers_articles/unitronics_plc/unitronics_ex-a2x.elmt:
./10_electric/20_manufacturers_articles/unitronics_plc/unitronics_io-di16_1-2.elmt:
./10_electric/20_manufacturers_articles/unitronics_plc/unitronics_io-di16_2-2.elmt:
./10_electric/20_manufacturers_articles/unitronics_plc/unitronics_io-di16.elmt:
./10_electric/20_manufacturers_articles/warner/clutch.elmt:
./10_electric/98_graphics/99_assembly_plan/01_thumbnails_mounting_plate/99_divers/bornegrise6.elmt:
./10_electric/98_graphics/99_assembly_plan/01_thumbnails_mounting_plate/99_divers/c2a.elmt:
./10_electric/98_graphics/99_assembly_plan/01_thumbnails_mounting_plate/99_divers/disjonncteur_c.elmt:
./10_electric/98_graphics/99_assembly_plan/01_thumbnails_mounting_plate/99_divers/inter_dif.elmt:
./10_electric/98_graphics/99_assembly_plan/01_thumbnails_mounting_plate/99_divers/prise_modulaire.elmt:
./10_electric/98_graphics/99_assembly_plan/01_thumbnails_mounting_plate/99_divers/transfo.elmt:
https://qelectrotech.org/forum/viewtopi … 415#p14415
deepl translate:
Backward compatibility :
Backward compatibility has been removed from certain parts of the code.
Opening a project created with a version of QElectroTech lower than 0.7 will still be possible, but the schematics will be broken on :
-Old element texts will no longer be converted to new element texts (dynamic text), so elements will no longer have text.
-A long time ago, variables had to be written directly in the element 'label'. When the element 'formula' appeared, labels containing variables (%) were considered to be 'formulas' and so the contents of the label were transferred to the 'formula'. This is no longer the case: if the label is of the form KM%id, it will remain as such and the formula will be empty.
Why break your beautiful schema that you've worked so hard to create?
In order to clean up old portions of wobbly, twisted, sometimes bulky code that only I know the obscure reason for.
To gradually prepare the future of qet (I talk about this a lot for those who follow qet's development).
But also, thanks to Laurent's work, we have ready-to-use windows and linux appimages of older versions of qet, so nothing is lost  all you have to do is open a project that isn't compatible with 0.8, save it (which will result in a project saved according to 0.8 'standards') and then open it with 0.9.
When opening a project created with a non-compatible version, a dialog box will inform the user of the situation and the procedure to follow to make the project compatible.
Ps: I'm sorry, but I need to get some rest and keep an eye on my high blood pressure....
Habe im Quellcode des Element-Editors eine Stelle gefunden, an der ich eingreifen kann, um auch die dynamischen Texte korrekt einlesen zu können, deren Schriftgröße mit dem Tag "font_size" gekennzeichnet sind (siehe BugTracker).
Mit der Version des Element-Editors habe ich nun alle Elemente, die mit einer Programmversion kleiner 0.8 erstellt wurden, in der aktuellen Version abgespeichert. Dabei habe ich die XRef-Elemente, bei denen Laurent mitgeholfen hat, nicht mehr angefasst!
Die etwa 4600 geänderten Elemente liegen nun vorerst nur in meinem Fork des Elemente-Repositories bei GitHub:
https://github.com/plc-user/qelectrotech-elements
Ich möchte nun alle Leser und Benutzer aufrufen, diese Elemente auszuprobieren und zu testen, ob "ihre" Elemente so aussehen und funktionieren, wie erwartet! Die Absicht war, nichts am Element zu ändern, aber man kann ja nie wissen.
Bitte gebt Rückmeldung in diesem Forum, damit wir "Altlasten" auch mal loswerden können. Zumindest bei den Dateiversionen der Elemente...
Danke im Voraus!
Und: Danke, Laurent, für Deine großartige Unterstützung!
now the same in English via Online-Translator:
I have found a place in the source code of the element editor where I can intervene in order to be able to correctly read in the dynamic texts for which the font size is marked with the "font_size" tag (see BugTracker).
With the version of the element editor, I have now saved all elements that were created with a program version smaller than 0.8 in the current version. I have not touched the XRef elements that Laurent helped with!
The approximately 4600 changed elements are currently only in my fork of the element repository at GitHub:
https://github.com/plc-user/qelectrotech-elements
I would now like to call on all readers and users to try out these elements and test whether "their" elements look and work as expected! The intention was not to change anything in the element, but you never know.
Please give feedback in this forum so that we can get rid of "old burdens". At least with the file versions of the elements...
Thanks in advance!
And: Thank you, Laurent, for your great support!
Great work plc-user, thanks.
It would be wise we keep your code to transform "font_size="*" to new fonts, olders QET users like me have a lot of old elements in our custom collection at work.
@Joshua: what do you think about?
Just for the record:
diff --git a/sources/editor/graphicspart/partdynamictextfield.cpp b/sources/editor/graphicspart/partdynamictextfield.cpp
index bb261287c..311102742 100644
--- a/sources/editor/graphicspart/partdynamictextfield.cpp
+++ b/sources/editor/graphicspart/partdynamictextfield.cpp
@@ -176,6 +176,12 @@ void PartDynamicTextField::fromXml(const QDomElement &dom_elmt) {
font_.fromString(dom_elmt.attribute("font"));
setFont(font_);
}
+ else if (dom_elmt.hasAttribute("font_size")) {
+#if TODO_LIST
+#pragma message("@TODO plc-user: remove again, when elements are converted!")
+#endif
+ setFont(QETApp::dynamicTextsItemFont(dom_elmt.attribute("font_size", QString::number(9)).toInt()));
+ }
else {
#if TODO_LIST
#pragma message("@TODO remove in futur")
QElectroTech → Scripts → QET-Element to SVG
Powered by PunBB, supported by Informer Technologies, Inc.
Generated in 0.035 seconds (21% PHP - 79% DB) with 12 queries