Joshua wrote:
De-Backer wrote:

I will first create the doc on my PC and then I will forward it there to you.
I think that can work..

it will be plain .txt text.

Whoo it's a hard job, good luck nomicons/smile and thanks in advance

this is a start

The main XML element is therefore the “definition” tag. In case we have more than one type of definition in the future, we use the type attribute to specify that this is an element definition.

definition
    * Element dimensions 
        One of the first things to specify when defining an element is its size: width (width) and height (height), in pixels. These two dimensions must be integers multiples of 10. If this is not the case, QET will round them to the next ten (example: 50 for 42 pixels). They determine the size and the bounding rectangle of the element.
    - height
    - width 
    * Element hotspot
        The element hooking point designates the point hooked to the mouse cursor during a drag'n drop of the element. They must be full coordinates. “Hotspot_x” is the abscissa, “hotspot_y” is the ordinate. The upper left corner of the rectangle delimiting the element is considered to be the origin. If the values provided exceed the bounding rectangle, they will be limited to the size of the element. The hotspot is also the center of rotation used when changing the orientation of the element.
    - hotspot_x
    - hotspot_y
    * Element orientation
        It is then necessary to define what are the possible orientations of the element. Element orientation is used when laying conductors but also to prevent the user from turning an element in a direction that would not make sense. The orientation attribute is defined by a series of 4 characters, each character defining the behavior for an orientation.
        + 1 st character: North
        + 2 nd character: East
        + 3 rd character: South
        + 4 th character: West
        Each character can have the following value:
        + d for “default”: indicates that, by default, the element is considered to be oriented in this direction. It is absolutely necessary to indicate a default orientation.
        + y for “yes”: the user can orient the element in this direction.
        + n for “no”: the user cannot orient the element in this direction.
        Example: orientation = “ydny” means that the element is drawn facing south and can be turned north and west but not east.
    - orientation
    - link_type ( grep -w -R 'link_type' sources/* )   info from (/sources/factory/elementfactory.cpp)
        -- next_report
        -- master
        -- slave
        -- terminal
    - hotspot_x (grep -w -R 'hotspot_x' sources/*)
    *
    - version
    * 
    - type
    uuid
        * Uuid used to compare two elements 
            The code below is used to keep compatibility with previous version of qet
            The uuid store in .elmt file, to compare two elements was created at version svn 4032
            @TODO remove this code at version 0.6 or 0.7 (all users should already used the version with uuid)
            Compare the xml definition transformed in QString. This method can return a false positive (notably with Qt5,
            because the attributes of the xml isn't at the same order,with two instance of qet, for the same element)
            git ID 557a2eaa878b8e9d48da1c0256bca0dbfd2d849b 2015-06-28
        - uuid
        names
            name
                *
                - lang
                    -- be
                    -- nl
                    -- fr
                    -- 

I have yet to find and link the C ++ code

grep -w -R 'motor' elements/*

is fast, but I understand.

however there must be a way to find the SW locks (QTimer as watchdog)?

Edit :
no multiple threads

Edit :
... or ... if it lives in the GUI thread then it is possible.

Edit : som info for me.

https://www.kdab.com/the-eight-rules-of … readed-qt/

https://doc.qt.io/qt-5/qcoreapplication … boutToQuit
for
https://github.com/qelectrotech/qelectr … /issues/50

Can this be done?


Uuid used to compare two elements

 The code below is used to keep compatibility with previous version of qet
The uuid store in .elmt file, to compare two elements was created at version svn 4032
@TODO remove this code at version 0.6 or 0.7 (all users should already used the version with uuid)
Compare the xml definition transformed in QString. This method can return a false positive (notably with Qt5,
because the attributes of the xml isn't at the same order,with two instance of qet, for the same element)

git ID 557a2eaa878b8e9d48da1c0256bca0dbfd2d849b 2015-06-28

bdw. I read the .elmt file for the doc, in combination with git.

329

(5 replies, posted in Code)

Aleksandr wrote:

I wanted to ask. I got to see the code on github. For a long time I was tormented by the question of translating some terms into Russian. There are places where mistakes are simple.
What are the rules for correcting or adding on github?

This is essentially a question of translation of the program, and not a  Element.

This topic had to be in forum code, to prevent confusion.

(ps I don't throw stones)

OK thanks, I'm adding it to the todo list.

....
the wiki is very difficult for me to adapt for version 0.8 it is mainly the language (no english).
eg suppose I have to create a new page (well I don't know how to do that)


I will first create the doc on my PC and then I will forward it there to you.
I think that can work..

it will be plain .txt text.

is the xml of the Elements and the project documented?

i would like to find out if we will run into problems with QT 6.
in connection with

As it is mentioned above, SAX classes will be deprecated soon, which means that QDomDocument cannot use them anymore.

https://www.qt.io/blog/parsing-xml-with … s-for-qt-6

grep QDomDocument *
grep: build-aux: Is a directory
grep: dev_doc: Is a directory
grep: doc: Is a directory
grep: docs: Is a directory
grep: elements: Is a directory
grep: examples: Is a directory
grep: ico: Is a directory
grep: lang: Is a directory
grep: man: Is a directory
grep: misc: Is a directory
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_doc, const QString &amp;filepath, QString *error_message=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_doc, QFile *file, QString *error_message=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QPen &amp;pen)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QBrush &amp;brush)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, const QDir &amp;dir, const QString &amp;rename=QString())</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, QFile &amp;file, const QString &amp;rename=QString())</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;xml_document, const QString &amp;file_path, QString *error_message=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, const QString &amp;tag_name, const QString &amp;value)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QMargins &amp;margins)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QAbstractItemModel *model, QHash&lt; int, QList&lt; int &gt;&gt; horizontal_section_role, QHash&lt; int, QList&lt; int &gt;&gt; vertical_section_role)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;, QHash&lt; Terminal *, int &gt; &amp;) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const =0</arglist>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <arglist>(QDomDocument &amp;, QPointF=QPointF(), bool=true, DiagramContent *=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QHash&lt; QString, QStringList &gt; *, QDomElement *, const QString &amp;, const QString &amp;, QDomDocument *)</arglist>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;dom_doc) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;, QHash&lt; Terminal *, int &gt; &amp;) const</arglist>
QElectroTech.tag:      <type>virtual const QDomDocument</type>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;)</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;, const QPointF &amp;=QPointF(), bool=true, ElementContent *=nullptr)</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;)</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;)</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;xml_document) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;dom_document) const</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;, const QPointF &amp;)</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;)</arglist>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <arglist>(QDomDocument &amp;, const QHash&lt; QString, QString &gt; &amp;=QHash&lt; QString, QString &gt;()) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;, const QString &amp;)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;dom_doc) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_document) const =0</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;dom_document) const</arglist>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_project)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_project)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_project)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_project)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_project)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, const QString &amp;tag_name=QString(&quot;sequentialNumbers&quot;)) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;) const</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_element) const override</arglist>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <type>QDomDocument</type>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_document) const override</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_doc, const QString &amp;filepath, QString *error_message=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;xml_doc, QFile *file, QString *error_message=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QPen &amp;pen)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QBrush &amp;brush)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, const QDir &amp;dir, const QString &amp;rename=QString())</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, QFile &amp;file, const QString &amp;rename=QString())</arglist>
QElectroTech.tag:      <arglist>(const QDomDocument &amp;xml_document, const QString &amp;file_path, QString *error_message=nullptr)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;document, const QString &amp;tag_name, const QString &amp;value)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QMargins &amp;margins)</arglist>
QElectroTech.tag:      <arglist>(QDomDocument &amp;parent_document, const QAbstractItemModel *model, QHash&lt; int, QList&lt; int &gt;&gt; horizontal_section_role, QHash&lt; int, QList&lt; int &gt;&gt; vertical_section_role)</arglist>

scorpio810 wrote:

I tried to saw if QET run faster under Windows if we compile it with Qt for MSVC.

ok
And what do you think of it, open of elements files

De-Backer wrote:

and what if we index when we open the folder.
instead of everything at start up?

eg if you open the folder "10_electric" only then index.

10_allpole  11_singlepole  20_manufacturers_articles  90_american_standards  91_en_60617  98_graphics  99_miscellaneous&unsorted  qet_directory  qet_labels.xml

=> all folders
open the folder 10_allpole

100_folio_referencing  114_connections    130_terminals&terminal_strips  200_fuses&protective_gears      330_transformers&power_supplies  380_signaling&operating  391_consumers&actuators  395_electronics&semiconductors  500_home_installation
110_network_supplies   120_cables&wiring  140_connectors&plugs           310_relays_contactors&contacts  340_converters&inverters         390_sensors&instruments  392_generators&sources   450_high_voltage                qet_directory

=> all folders
open the folder 100_folio_referencing

01coming_arrow.elmt  02going_arrow.elmt  qet_directory

=> .elmt  => start index

scorpio810 wrote:

Very complicated with Visual Studio and I prefer to stop, we'll see later.

What were you trying to achieve?
as you can see:

De-Backer wrote:

Now wait what is the problem the code, the compiler or the OS

I don't understand the link.

scorpio810 wrote:

Humm try to compile with visual studio 2019 under Win10 ..
https://github.com/drawpile/Drawpile/wi … om-sources

Now wait what is the problem the code, the compiler or the OS

335

(60 replies, posted in Code)

It looks okay

336

(60 replies, posted in Code)

ok I'm still testing it on low reslousie screens ...

337

(60 replies, posted in Code)

scorpio810 wrote:

Maybe this:

The only thing is that with all screens this is 2/3,
while at low reslousie screens this just becomes too small.
What do you think of this:

setMaximumSize(mymachineinfo->i_max_screen_width(),
               mymachineinfo->i_max_screen_height());
    resize(1400,1000);

and what if we index when we open the folder.
instead of everything at start up?

339

(60 replies, posted in Code)

just remove resize (..)

Edit
never mind, is even worse

ok for patch

Has the QXmlStreamReader Class been considered?

https://doc.qt.io/qt-5/qxmlstreamreader.html

Multithreaded File I/O
https://www.drdobbs.com/parallel/multit … /220300055

for ref
https://programmer.group/efficiency-com … idxml.html

the developer of KiCad likes to use "try & catch"

try
        {
            cache_lib = AddLibrary( cache_name );
 
            if( cache_lib )
                cache_lib->SetCache();
        }
        catch( const IO_ERROR& ioe )
        {
            wxString msg = wxString::Format( _(
                    "Symbol library \"%s\" failed to load.\nError: %s" ),
                    GetChars( cache_name ),
                    GetChars( ioe.What() )
                    );
 
            THROW_IO_ERROR( msg );
        }

https://gitlab.com/kicad/code/kicad/-/b … y.cpp#L550

not really and QT thing.

and  wxwidgets != QT
https://www.wxwidgets.org/

https://bugreports.qt.io/browse/QTBUG-1 … 22qfile%22

Joshua wrote:

Not easy this problem.

Well that was to be expected that it would not be easy, nevertheless it is something that needs to be addressed. Now adding new features will only make the problem worse.

So I only have 2 options to improve the Wiki or the code.
The program is used every day.
Anyway I give it a try, come I up empty, no problem.

Could this be a cause of concern, performance wise?
@qet/sources/ElementsCollection/elementcollectionhandler.cpp

ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{
    QString new_elmt_name = rename.isEmpty() ? source.fileName() : rename;
    bool rb = QFile::copy(source.fileSystemPath(), destination.fileSystemPath() + "/" + new_elmt_name);
    if (rb)
    {
#ifdef Q_OS_WIN
        //On windows when user drag and drop an element from the common elements collection
        //to the custom elements collection, the element file stay in read only mode, and so
        //user can't save the element
        extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
        qt_ntfs_permission_lookup++;
        QFile file(destination.fileSystemPath() + "/" + new_elmt_name);
        if (!file.isWritable()) {
            if (!file.setPermissions(file.permissions() | QFileDevice::WriteUser)) {
                qDebug() << "Failed to change file permission of : " << QFileInfo(file).canonicalFilePath() \
                         << " in ECHSFileToFile::copyElement";
            }
        }
        qt_ntfs_permission_lookup--;
#endif
        return ElementsLocation (destination.fileSystemPath() + "/" + new_elmt_name);
    }
    else
        return ElementsLocation();
}

QElectroTech isn't alone in using file / element strategy
-KiCAD
    footprints +10500 file's in 151 folder's
    packages3D +11400 file's in 100 folder's
    symbols 490 file's in 23 folder's => multiple element per file maybe there is performance problem after all
-eagle
    symbols => multiple element per file maybe there is performance problem after all
   
I will check with the neighbors (KiCAD) if they are also bothered by this and how this has been remedied.

Has SQLite been considered for the element?

Or maybe we should also put multiple elements in 1 file.

345

(60 replies, posted in Code)

ok
scorpio810 can you close this?
https://qelectrotech.org/bugtracker/view.php?id=195

346

(3 replies, posted in Code)

Okay I drop it,
About the loading time (especially under Windows): can I help with that or not?
And so what?

347

(60 replies, posted in Code)

scorpio810 wrote:

A cron job (360 mins) syncs the remote GIT master (Tuxfamily) to the Github mirror, I just changed the timer to 60 mins now.

If you want the last Commit on master :

git clone git://git.tuxfamily.org/gitroot/qet/qet.git qet_git

does this work without an account?

348

(3 replies, posted in Code)

Get the version name from git.
eg: git describe

add line in qelectrotech.pro

DEFINES += GIT_VERSION="\\\"$(shell git -C \""$$_PRO_FILE_PWD_"\" describe)\\\""

mod line in aboutqetdialog.cpp

@@ -141,7 +141,7 @@ void AboutQETDialog::setContributors()
void AboutQETDialog::setVersion()
{
     QString str = "<span style=\"font-weight:bold;font-size:16pt;\">QElectroTech V "
-            + QET::displayedVersion
+            + QString(GIT_VERSION)
             + "</span>";

condition: add "Make clean" at the beginning of the Build Steps

Question: Is it worth knowing the git SHA1 ID if you will always need to build full

349

(60 replies, posted in Code)

if you really need to have the last Commit
use

git fetch https://github.com/De-Backer/qelectrotech-source-mirror.git master
git log FETCH_HEAD

https://git-scm.com/docs/git-fetch#_examples

350

(60 replies, posted in Code)

damianCaceres wrote:

Hello:
Today I've updated from master and I get the following building error

Thank you

updated from
https://github.com/qelectrotech/qelectr … or/network

unfortunately it runs behind see

https://git.tuxfamily.org/qet/qet.git/log/

The fix was pushed a few minutes later.
https://github.com/De-Backer/qelectrote … 532a025f20
but github is still lagging behind...