Topic: How do i set default prefix for an element I create?

?

Re: 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.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

3 (edited by Morganol 2016-10-28 09:58:19)

Re: How do i set default prefix for an element I create?

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

4 (edited by Nuri 2016-10-29 08:27:41)

Re: How do i set default prefix for an element I create?

@ 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 nomicons/tongue

RDS 81346 - i think a relay there have three letters...

HA! you know it too!
See attached file.

Post's attachments

Attachment icon IEC81346-1_Letters.pdf 62.36 kb, 1080 downloads since 2016-10-29 

Re: How do i set default prefix for an element I create?

Thanks Nuri, Iĺl try later nomicons/smile

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... nomicons/wink  Muuuahhahaha nomicons/alien

6 (edited by Morganol 2016-10-30 18:55:39)

Re: How do i set default prefix for an element I create?

@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"  nomicons/wink


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.

Re: How do i set default prefix for an element I create?

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);

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

OK, for later then.
I made the feature request https://qelectrotech.org/bugtracker/view.php?id=114 , pointing to post above nomicons/smile

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.

Re: How do i set default prefix for an element I create?

Bug 114 fixed.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

Thanks, will try later. Away for a week nomicons/smile

Re: How do i set default prefix for an element I create?

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

12 (edited by electrop 2019-09-13 17:48:57)

Re: How do i set default prefix for an element I create?

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 ?

Re: How do i set default prefix for an element I create?

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>

Post's attachments

Attachment icon coils.zip 2.9 kb, 401 downloads since 2019-09-15 

Attachment icon qet_labels.xml 1.31 kb, 434 downloads since 2019-09-15 

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

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.

Re: How do i set default prefix for an element I create?

Hello,

put qet_labels.xml in the root of your elements folder.
https://download.qelectrotech.org/qet/forum_img/qet_labels_windows.png

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

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.

Re: How do i set default prefix for an element I create?

Interesting, thanks for your feedback.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

Please try latest packages.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

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.

Re: How do i set default prefix for an element I create?

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>

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

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.

Re: How do i set default prefix for an element I create?

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.

Re: How do i set default prefix for an element I create?

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How do i set default prefix for an element I create?

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.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."