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.

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

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.

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, 113 downloads since 2019-09-15 

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

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.tuxfamily.org/qet/forum_img/qet_labels_windows.png

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.

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

Please try latest packages.