Topic: How do i set default prefix for an element I create?
?
You are not logged in. Please login or register.
QElectroTech → EN : Help, suggestions, discussions, ... → How do i set default prefix for an element I create?
?
For the moment you can't !
Program only reading config in elements/10_electric/qet_labels.xml and it is for only for element installed in this directory.
I think we need to add the same config for element prefix for custom collection (home/user elements) and add code to read this xml config user file also.
I think prefix should be set directly in the elment xml - at least for custom elements.
Optimally it should be possible to define different prefixes for different standards and a simple numeric setting in filo preferences select what standard to use: i.e
1) normal electric, relay = K
2) normal electronic, relay = RE
3) RDS 81346 - i think a relay there have three letters...
n) etc, freely defineable
@ Morganol
go to:
/usr/share/qelectrotech/elements/10_electric
copy the file "qet_labels.xml" to:
/home/morganol/.qet/elements/[anything you want]
Edit manualy the file "qet_labels.xml" according to your needs and to your own folder structure.
According to Hilario/Davi (brazilian devs) Qelectrotech should take in account the prefixes defined in qet_labels.xml while you're inserting an element in the drawing area.
i have NOT tested this feature!
it SHOULD work
RDS 81346 - i think a relay there have three letters...
HA! you know it too!
See attached file.
Thanks Nuri, Iĺl try later
And thanks for the list. Tried their free app but it is limited. And my time and money is too limited to get and study their spec.
Yes "I know enough to screw up things"...
In several fields of technology... Muuuahhahaha
@Nuri, need fixing:
I just had a quick look at the file you point out as example
( As i compile locally i have it at /usr/local/share/qelectrotech/elements/10_electric/ )
That file contain the old name of the folder
<category name="100_sheet_referencing"></category>
While you (?) have changed the actual name of folder to "100_folio_referencing"
I will try setting prefixes later... as a starter i understand i can not have mixed prefixes for elements in same folder so I need reorganise my collection a bit.
My 2 cts, I remember which code reading only commonElementsDir no customElementsDir() (user collection)...
Edit :
// Only Electric labels created so far
//if (current_location.fileName() != "10_electric")
QString qet_labels = "10_electric/qet_labels.xml";
QString filepath = QETApp::commonElementsDir().append(qet_labels);
it only read qet_labels.xml file on common element collection in folder 10_electric/ for the moment !
Need little work for adding this for customElementsDir
Possible patch (not time for) :
// Only Electric labels created so far
//if (current_location.fileName() != "10_electric")
QString qet_labels = "10_electric/qet_labels.xml";
QString filepath = QETApp::commonElementsDir().append(qet_labels);
// For custom collection
#if defined(Q_OS_WIN32)
QString custom_labels = (QDir::homePath() + "/Application Data/qet/elements/custom_labels.xml");
#else
QString custom_labels = (QDir::homePath() + "/.qet/elements/custom_labels.xml");
#endif
QString filepath = QETApp::customElementsDir().append(custom_labels);
OK, for later then.
I made the feature request https://qelectrotech.org/bugtracker/view.php?id=114 , pointing to post above
Workaround idea:
If I put a symlink in commonelements, to point to customerelements:
=> I can manage the elements in custom elements as usual
=> they will also show up as a subfolder in common elements and there QET evaluates the qet_labels.xml ; from there i use them in my drawing.
Bug 114 fixed.
Thanks, will try later. Away for a week
Greetings.
I would like to know what has been done in this direction? Now I'm doing a great project, and it's very inconvenient to go through the entire library, to put at least a relay winding. It's easier to copy from the previous page, but then auto-numbering does not work. And of course it would be desirable that each element be tagged as it is set in IEC81346-1_Letters
Greetings,
I'm desperately trying to define custom prefix for my own elements library but I failed until now.
I think I've understood - at least I hope to - what was explained in the previous posts and video.
I've made a lost of tests before following back to a really simple example. But it still doesn't work
I'm using QElectroTech 0.7 on Windows
I've kept the default path for my user library. It contains only one directory named "connecteurs"
Inside of this directory, I've placed some .elmt files and a file named "custom_labels.xml" as follows :
<?xml version="1.0" encoding="UTF-8"?>
<labels>
<category name="connecteurs">
<prefix>XYZ</prefix>
</category>
</labels>
But still, when starting QET and placing one of my custom elements on a new folio, when typing "%prefix" in the label formula, nothing is shown.
Am I still missing something ?
Rename your file to qet_labels.xml and see this litle example.
── coils
│ ├── coils_prefix_FX
│ │ ├── bobine3.elmt
│ │ └── qet_directory
│ ├── coils_prefix_XYA
│ │ ├── qet_directory
│ │ └── relbistable.elmt
│ └── qet_directory
<labels>
<category name="coils">
<category name="coils_prefix_FX">
<prefix>FX</prefix>
</category>
<category name="coils_prefix_XYA">
<prefix>YYA</prefix>
</category>
</category>
</labels>
Hello,
Same result with your example : No prefix shown in QET.
Maybe qet_labels.xml should be placed elsewhere ?
I've tried to put it sequentially in :
.\coils
.\coils_prefix_FX
.\coils_prefix_XYA
With no change in behavior.
Hello,
put qet_labels.xml in the root of your elements folder.
I think I've found the trick (bug?)
Scorpio, now, your example is working on my configuration - and my example also - BUT only if the user collection directory is on its default path.
If I try to change it to a custom location "Settings > Configure > Collections > User collection directory" then the content of the collection is correctly loaded but the qet_labels.xml file seems to be simply ignored.
Interesting, thanks for your feedback.
Please try latest packages.
Hi there,
I am new to QET, and really liking it in comparison to other electrical drawing packages. However I am struggling a bit with the auto-numbering, and it took me a bit before I realised that it seems that the categories with prefixes have to be sub-categories. Ie you don't seem to be able to assign prefixes to top-level categories / folders. This seems strange, but easy enough to work around.
My example that didn't work (where "circuit_breakers" and "fuses" are folders at root level of elements folder):
<labels>
<category name="circuit_breakers">
<prefix>Q</prefix>
</category>
<category name="fuses">
<prefix>F</prefix>
</category>
<category name="miscellaneous"></category>
</labels>
and my example that did work (where "circuit_breakers" and "fuses" are sub-folders in a folder "circuit_protection"):
<labels>
<category name="circuit_protection">
<category name="circuit_breakers">
<prefix>Q</prefix>
</category>
<category name="fuses">
<prefix>F</prefix>
</category>
</category>
</labels>
What I am now struggling to understand is whether there is a way to keep the sequential numbering for different circuit element types separate (e.g. all fuses as F1, F2, F3, all breakers as Q1, Q2, Q3, rather than ending up with F1, Q2, F3, Q4 etc.). I realise you can create different numbering schemes for each type of circuit element, but this requires you to remember to change the numbering scheme each time you add an element to the folio - which I'm not very good at!
Thanks for any suggestions.
Hi,
see example file here:
https://git.tuxfamily.org/qet/qet.git/t … labels.xml
~ % tree qet_git/elements/10_electric/11_singlepole/200_fuses_protective_gears
qet_git/elements/10_electric/11_singlepole/200_fuses_protective_gears
├── 10_fuses
│ ├── fusible.elmt
│ ├── qet_directory
│ └── sec_fus1.elmt
├── 11_circuit_breakers
│ ├── disjonct-m.elmt
│ ├── disjoncteur1.elmt
│ ├── jistic_1p.elmt
│ └── qet_directory
├── 12_magneto_thermal_circuit_breakers
│ ├── disjoncteur_magneto-thermique_1.elmt
│ └── qet_directory
├── 20_disconnecting_switches
│ ├── qet_directory
│ ├── sectionneur1-2.elmt
│ └── sectionneur1.elmt
├── 30_thermal_relays
│ ├── qet_directory
│ └── relais_therm1.elmt
├── 50_residual_current_circuit_breaker
│ ├── ddr1.elmt
│ ├── disjoncteur_differentiel_magnetothermique.elmt
│ ├── int_diff-1p.elmt
│ ├── int_diff1.elmt
│ ├── qet_directory
│ ├── rcbo.elmt
│ └── rccb.elmt
└── qet_directory
7 directories, 22 files
<category name="200_fuses_protective_gears">
<category name="10_fuses">
<prefix>F</prefix>
</category>
<category name="11_circuit_breakers">
<prefix>F</prefix>
</category>
<category name="12_magneto_thermal_circuit_breakers">
<prefix>Q</prefix>
</category>
<category name="20_disconnecting_switches">
<prefix>Q</prefix>
</category>
<category name="30_thermal_relays">
<prefix>F</prefix>
</category>
<category name="50_residual_current_circuit_breaker">
<prefix>Q</prefix>
</category>
Thanks for quick reply! However I think I'm missing something, as I'd found that file before, but this doesn't seem to keep track of different sequence numbers for different element types. Should it?
Just to make sure I'm being clear, I was hoping to achieve the following:
Place 1st fuse - label F1
Place 2nd fuse - label F2
Place 1st breaker - label Q1
place 3rd fuse - label F3
place 2nd breaker - label Q2
etc.
What actually happens is:
Place 1st fuse - label F1
Place 2nd fuse - label F2
Place 1st breaker - label Q3
place 3rd fuse - label F4
place 2nd breaker - label Q5
etc.
Sorry, I'm being stupid, not quite sure what you're getting at re typo for circuit breakers? I'm just working with my own user collection. (qet_labels.xml in root of ..\Application Data\qet\elements as per code in my first post). The prefixes work ok (so long as not in the top level category), but I'm wondering if possible to keep sequence numbering separate for each element type.
I 'm thinking your XML is wrong, see this example:
https://stackoverflow.com/questions/444 … s-of-a-dir
See picture of tree, and the XML output.
QElectroTech → EN : Help, suggestions, discussions, ... → How do i set default prefix for an element I create?
Powered by PunBB, supported by Informer Technologies, Inc.
Generated in 0.052 seconds (38% PHP - 62% DB) with 12 queries