Hi. I uploaded the version 1.0.10 to the python repositories.


[size=3]To use:
1. save the current project in QElectroTech
2. Open the plug-in (under Project menu)
3. Use the plug-in and generate the Terminal Blocks. In the CONFIG tab you can specify overwrite the changes to the same file project, or write to a new file. A backup is always done.
4. Reopen the project in QElectroTech.


[size=3]To install: 
Requires python 3.5 or above.

First install on Linux:
1. check if you have pip3 installed: pip3 --version.
   If not install with: sudo apt-get install python3-pip
2. Install the plug-in: sudo pip3 install qet_tb_generator
3. Run the plug-in directly (writing qet_tb_generator from the command line) or from the 'Project' menu in QElectroTech.

Update on Linux
1. sudo pip3 install --upgrade qet_tb_generator

First install on Windows
1. Install, if required, python 3.5 or above
2. Install the plug-in: python -m pip install qet_tb_generator

Update on Windows
python -m pip install --upgrade qet_tb_generator



@Scorpio: If possible,  add the full path of the current project as an argument when calling the plug-in from QET. If not a file dialog is showed to select the QET project.

Hi. I introduce the version 1.0.7.
Changes:
- modified to work with QET 0.6. So the version 0.6 and and 0.7-dev of QET can share the same terminal block plug-in.
- this plug-in is system independent. Don't need to know the installation path of QET or the path of the personal library folder.
- the "Config" tab allows select overwrite or not changes to the original QET project. A backup is always done.
- a label appears while the plug-in is generating the terminal block(s).

Please, check the plug-in. If all is ok, I'll upload this new version the the python pip repositories. Doing a "pip3 install qet_tb_generator --upgrade" will be enough to have the last version and if some library is needed, it will be auto installed.

To run the plug-in type in the command line there are 2 options:

python3 qet_tb_1.0.7.py <path_to_the_desired_qet_project>
python3 qet_tb_1.0.7.py

In the second case a file dialog appears to choose the QET project file.

Hi, this new version 1.0.6.alpha creates terminal blocks like:

https://image.ibb.co/jSPS5o/Pantallazo_2018_05_19_01_02_50.jpg
The conductors labels are on left side. A logo identifies the terminal type.
Please test the plug-in to fix errors.

For easy use, will be good if QET calls the plugin as: "qet_tb %f", where %f is the current project path.

To Do:
- draw bridges between terminals if have the same name or same north cable id
- add a checkbox the overwrite  or not, the terminal block config in the original qet file.
- check compatibility with QET 0.6
- uploads the project to pip repositories allowing a easy installation and auto-updates of the plug-in (as usual: pip3 install qet-tb-generator)

Hi, this new version (1.0.5) :
* doesn't require the module lxml.
* solves the problem drawing conductors that not belongs to any cable.
* right-clicking on Terminal type column loops 'STANDARD', 'GROUND' and FUSE.

Any design ideas for GROUND and FUSE terminals?

Hi, I introduce the versión 1.0.4 alpha.
Now is able to "draw" the terminal blocks.

Remember: In the plugin's title bar appears the version.

The Terminal blocks appear in the "IMPORTED ELEMENTS" section:

https://image.ibb.co/f3nxBJ/qet_tb_1_0_4.jpg

To do:
* if not CABLE is indicated ( e.g. -X1, -X2,...) all terminals are draw as part of unique conductor. The next version will solve this.
* if you draw again the terminal blocks, creates duplicate elements. Next version will not duplicate elements.
* the QET file with the attributes edited in the plugin and the terminal blocks elements are save on a different file name. When works well, it will edit the current QET file.
* auto loop right clicking in TYPE column (good idea scorpio810)
* next version will draw the different terminal type: STANDARD, GROUND and FUSE.

Hi.
This new alpha 1.0.3 allows pressing REFRESH button and sorts terminals according the data edited in the columns  POS, CABLE and CABLE CONDUCTOR. A terminal block is divided into several segments (every segments fits on a page). Every segment is represented in a different tab. REFRESH works between segments. For efample, if the terminal block -X1 has 2 segments (-X1_1 and -X1_2) and you set POS = 1 for a terminal of the segment -X1_1, when you press REFRESH, this terminal goes to the -X1_1 segment.  

Next step, I'm going to start drawing the terminal blocks to import in QET.

Hi. I've attached version 1.0.2.alpha.

What is working for now:
- opening a complex project is possible
- splits a terminal block strip into segments of 30 terminal blocks. Every segment is showed in a different tab.
- is possible to edit the columns: POS, TYPE (standard, ground, fuse), CABLE (-W1,...), CABLE COND (color o number of the conductor in the CABLE)
- is possible to SAVE the modifications and opening again preserving data.
- the terminals in a terminal block strip are sorted by the next columns: POSITION, CABLE, CABLE_COND and  TERMINAL NAME.

What is coming:
- after edit fields (position, cable, cable conductor,...), pressing the button REFRESH, will show ther terminals in a new order (according of the edited data)
- pressing the button DRAW will generate, in the personal library of QET, a new element for every TAB.

I'm going to:
1. Split large terminal blocks. If a term. block has more then 40 terminals it will be split into a several terminal blocks.
2. Order terminals by default by the ID columns if not POS is specified.

@scorpio: Can you send me a email with the sample project that crashed? Thanks.

Hi. I attach v1.0.1.alpha to check the usability.

For now:
- tested with version 0.7 of QET documents, but will work with version 0.6 too.
- creates a tab for every terminal block
- 4 columns can be edited:
  - Terminal position
  - Terminal type (STANDARD, GROUND or FUSE)
  - CABLE
  - CABLE's CONDUCTOR 
- This 4 fields can be modified as always (left clicking and writing) or by right click (auto-fill)
- The button SAVE save changes creating a diferent QET project file (to avoid losing data in testing versions)
- Al the info is saved in the 'function' field.
- Opening a previosly save QET project, the terminals info are readed.
- Runing 'python3 qet_tb.py' without parameters, a file dialog appears to select a project.
- Is possible to run specifying a projet: 'python3 qet_tb.py examples/basic.qet'

https://preview.ibb.co/eywjRn/qettb_1_0_1_alpha.gif


@Scorpio; The 0.xx version used QT, and a lod of dependencies are required. This new version almost always no require dependencies.

@b.w.v.leeuwen: I saved the pictures as a reference. Thanks.

It can't generate. Only is a preview version to check the usability. I don't know if right-clicking to autofill it's a good idea. Maybe  we need to create another column with extra info,...
I don't know if it's worth to put all terminal blocks together or create a TAB for every terminal block...

Hi, I attach a preview version. The data are not real.
Please, check the usability.

[s]No dependeces are required.[/s]
Window's Python comes with TK libraries. In Linux, maybe is required to install the package python3-tk. (Thanks SCORPIO)

 to run:  python3 qet_tb.py
https://image.ibb.co/byHz47/qet_tb.png

The data in black comes from the electrical diagram, and the data in blue are introduced for the first time in the plug-in. The next times the plug-in is called the data in blue are preserved.

The bottom row shows the value for the next auto-fill if you click with the right button. If the value es numeric, will be auto-increment.

Hi Scorpio, I'm a PLC programmer and I work for a company. I'm not self-employed.


For the new version, maybe is better to dissable the option of searching for implicit connections (more than 2 connectors with the same name, implicates more than one terminal). I think is clearly to draw only the terminals that exists on the diagram.

Perfect !!

I think will be better that when clicking to launch the plugin, QET calls the pluging passing the route of the current project. This allows delete the selection of the project to work with: the plugin will be a pluging instead of an external app.

I'm taking notes.

More ideas?

Yeap, but for the others terminals, how do you set the position?

May is better set the position in the annotation field for all terminals. If not specific position is defined, the order will be alphanumeric, but respecting the terminals that have a position defined.

At the annotation field you can define the position, the cable to which it belongs, the conductor number in the cable,...

Another posible solution is:
- to draw all terminals in the schema
- when you open the plugin appears a table whith all terminals used in the order which they are is going to be used. For example:

POS. | TERM.BLOCK | NAME | XREF | TOP CONDUCTOR | BOTTOM CONDUCTOR | CABLE | #CONDUCTOR IN CABLE
---------------------------------------------------------------------------------------
     | X1         | +1   | 2-C1 | +1            | +1               | W1    | 1
     | X1         | -0   | 2-C2 | -0            | -0               | W1    | 2
     | X1         | R    | 1-A1 | L1            | L1               | W2    | Black 
     | X1         | GND  | 1-C1 | GND           | GND              | W2    | GND 
     | X1         | T    | 1-C1 | L2            | L2               | W2    | Brown
     | X1         | S    | 1-C1 | L3            | L3               | W3    | Grey

- You can easily chande the order, and the new order will be write changing the XML of the QET project. You can change the first column to set the required order, for example:

POS. | TERM.BLOCK | NAME | XREF | TOP CONDUCTOR | BOTTOM CONDUCTOR | CABLE | #CONDUCTOR IN CABLE
---------------------------------------------------------------------------------------
5    | X1         | +1   | 2-C1 | +1            | +1               | W1    | 1
6    | X1         | -0   | 2-C2 | -0            | -0               | W1    | 2
1    | X1         | R    | 1-A1 | L1            | L1               | W2    | Black 
4    | X1         | GND  | 1-C1 | GND           | GND              | W2    | GND 
3    | X1         | T    | 1-C1 | L2            | L2               | W2    | Brown
2    | X1         | S    | 1-C1 | L3            | L3               | W3    | Grey

- The next times you used the plugin, the table will show the correct new order.

This new idea allows you to design without thinking the position of every terminal.

What abut this new idea?

I'm taking notes.


The label "X1: GND" will be fine for a ground terminal?
All terminals with that name are drawing as a ground terminal. Therefore, you can draw several ground terminals on your schema, and depending the order number specified in the "annotation" label,  will be possible to have a terminal block like the one you've showed.

1 | 1 | G | 1 | 1 | G
3 | 4 | N | 5 | 6 | N
  |   | D |   |   | D

        ^           ^
        |           |
Annot:  15  16  17  18

Hi, 

The pluguin is not working with last changes made in the 0.7 version. The possibility to add several texts to an element has changed the XLM format, and the plugin doesn't find the text that is looking for.

I'll update the code and I could add some new features. For example:

- Fuse terminals
- Auto-draw the cables connected to the terminal block. For example, if you have 5 terminals named:
  For every terminal you can specify in the "Annotation" label something like: #%w:#
   #  -->  order of the terminal in the terminal block. If doesn't exist, will be autoordered by the terminal name
   %w:# --> cable and conductor name.  Terminals with the same name will be draw consecutively
   %f:40  --> fuse type terminal.

Do you have more ideas?

I understand your opinion. Do you mean something like the photo shows?

In the image, in green is coloured the current Terminal Block generator. The yellow is a standard element of the collection, and the pink are cables.  QET_TB_Generator creates complex new elements in the collection (with a lot of lines, text, pins,...), but for the new feature, generate a custom new element (with the yellow lines) has no advantages over using the element that already exists.

We could use , for example, the field "function" of conductor properties. If the field is blank or not in the format 'W1:1' the conductor is not part of a electric hose.

Tha table will show all conductors, and also the electric hoses. For every conductor of a electric hose, it will shows cable number of the hose and the cable number of the diagram, hose name,...

Draw elements is dificult for some reasons:
* if the terminal block is too long, it's splited in several elements and maybe the terminals for a one motor are in diferent QET Elements.

* The electrical hoses connects from the terminal block to a drive, switch, detector,... So I don't know what to draw at the end of the electric hose.

* A table allow you to have a cross-references to easy locate every cable from where to where. If you are fixing a machine and you know the number of a cable, seeing the table you know from where to where is connected, in what page appear,...

The photo shows a more real example:

You're welcome.

Now the QET_TB_Generator does:

  • Terminal Block: searching terminals arround the diagram and grouping into terminals blocks.

  • Connectors: searching pins in the diagram and grouping into connectors

Will be well to do the same with cables, but maybe the best solution is to auto-create a "connections report table" of all conductors grouped by wires. What about doing something similar to the photo?

Hi everybody,

The new version 0.7.72 is launched. Now in the "config" tab you can choose 2 options for xref:

  • Default: Use the format page- row colum

  • Auto : Use the same configuration that un QET > Project Properties > New Folio > Folio referencings.

The auto option support the same tags that QET :%f, %F, %M, %LM, %l, %c.  Ramember thar the tag %F also can include %id (page number) and %total (total number of pages).

Linux Update:

sudo pip3 install --upgrade qet_tb_generator

Windows Update:

python -m pip install --upgrade qet_tb_generator


Please check, and it something fails say me.

Hi,
version 0.7.71 is launched and fixed the conditions to draw bridges between terminals.

Linux update:

sudo pip3 install --upgrade qet_tb_generator

Windows update:

python -m pip install --upgrade qet_tb_generator

Hi, I'm checkinh about bridge between terminal reservation.

About the topic of Xref, have you checked changing the cross-reference in the 'CONFIG' tab of the QET_Terminal_generator?

Hi all, the problem was that I forgot the debug mode enable, and the program tries to print extra info. I'm sorry   :-(

I use every week the QET_TB_Generator and on my machine was working well because the source code is in.  The version 0.7.7 is launched.

To update:

pip3 install --upgrade qet_tb_generator


If someone has problems, the next commands create a virtualenv (isolated from the rest of the system) with the correct versions of python and the other libraries.


mkdir qet_tb
cd qet_tb
virtualenv --python=/usr/bin/python3 env
source env/bin/activate
pip install -r requirements.txt

To exit from the virtualenv:

deactivate

To delete de virtual enviroment, just remove the qet_tb folder.

The file requirement.txt is attached.

Hi Galexis, if you want send me the Qet project and I will check what's the problem.

Hi, version 0.7.5 is launched. 
The terminal block element can have up to 2 texts. Now the plugin searches in all texts any text with the correct format, i.e "X1:2".