Re: Terminal block generator cross-platform

With this great job Unalcade, I think Nuri will ask you a python code to generate element of nomenclature !nomicons/wink

Re: Terminal block generator cross-platform

Why not, but in future block generator and nomenclature need to be in QET C++ Qt code.

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

53 (edited by unalcalde 2016-08-21 09:23:33)

Re: Terminal block generator cross-platform

Thanks a lot.  
Now I'm testing Qt. My first practice will be upgrade this script to use Qt. I'll do a simple screen with two tabs. One tab for config paths if the defaults not work, and the other tab will be a list of the same recent projects that Qet. 

it wll be easy to use, elegant and no requires extra instalations because it will use same libraries as Qet.

Re: Terminal block generator cross-platform

If you can, download latest source code and try to integrate your script directly.

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

Re: Terminal block generator cross-platform

I downloaded the source code and compiled successfully.
Before integrate the script, i need to retype the script in c++.

nomicons/smile

Re: Terminal block generator cross-platform

Nice Unalcalde :-)

I hope it works in C++ too.

57 (edited by unalcalde 2016-08-26 22:44:50)

Re: Terminal block generator cross-platform

Hi, in the following days will be available a new grafical version of the app. I rewrited to a object oriented  model and will be easy to translate to C++. It uses Qt5 and looks like the image. 

The app works well, but now in the tab "terminal block" I want to show a list of the QET recent projects, so will be easy to choose a project and generate its terminal blocks.

I will use the QSettings class of Qt5 to get the list, but I have a question, where are saved the config files?

Thanks

http://i63.tinypic.com/s4476h.jpg

Re: Terminal block generator cross-platform

Hi Unalcalde,


We use the native format for QSettings :

http://doc.qt.io/qt-5/qsettings.html#details

the configuration files are stored in :

For GNU/Linux distributions:
$HOME/.config/QElectroTech/QElectroTech.conf
For Mac OS X:
$HOME/Library/Preferences/QElectroTech/QElectroTech.plist
For Windows, in the registry:
HKEY_CURRENT_USER\Software\QElectroTech\

qetapp.cpp and recentiles.cpp

Thanks

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

Re: Terminal block generator cross-platform

@Unalcalde :
Very nice your part list pages.
What software or script do you use for generate this HTML?

https://download.qelectrotech.org/qet/forum_img/foliolistlabel13.png

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

Re: Terminal block generator cross-platform

I use excel. I fill by hand (but always is copy and paste from another project) and later a simple formula change to a html table.

Later copy and paste to QET.

Re: Terminal block generator cross-platform

Ok, 
you could see Nuri Libreoffice macro :
https://qelectrotech.org/forum/viewtopi … 3730#p3730



Or try ronny dxftoelmt converter and CSV to elmt converter (Qt5):
https://qelectrotech.org/forum/viewtopi … 4162#p4162

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

62 (edited by unalcalde 2016-08-27 12:31:44)

Re: Terminal block generator cross-platform

Hi, I'll test your 2 proposals.

I introduce the Grafical version of Terminal Blocks maker. I tried to make an installer for all platforms, but either pyinstaller or cx_freeze fails for me.

Please, check the program for bugs and test how to make a installable version.

By now, installing on linux pyqy5 will be enough ( sudo apt-get install python3-pyqt5 ).

To run the program: python3 QET_TB_maker_0.5.py. 

Thanks.

Post's attachments

Attachment icon QET_TB_maker_0.5.py 25.31 kb, 1006 downloads since 2016-08-27 

Re: Terminal block generator cross-platform

python3 QET_TB_maker_0.5.py      
Traceback (most recent call last):
 File "QET_TB_maker_0.5.py", line 12, in <module>
   from frmMain_ui import Ui_frmMain
ImportError: No module named 'frmMain_ui'

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

64 (edited by unalcalde 2016-08-27 16:22:33)

Re: Terminal block generator cross-platform

scorpio810 wrote:

python3 QET_TB_maker_0.5.py      
Traceback (most recent call last):
 File "QET_TB_maker_0.5.py", line 12, in <module>
   from frmMain_ui import Ui_frmMain
ImportError: No module named 'frmMain_ui'

Sorry, i forgot to upload the file nomicons/blush

Post's attachments

Attachment icon frmMain_ui.py 25.82 kb, 843 downloads since 2016-08-27 

Re: Terminal block generator cross-platform

Nice, great work. nomicons/smile

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

Re: Terminal block generator cross-platform

For MS Windows in the past you have already installed python.
Enter cmd  for run terminal and paste this command line

pip3 install pyqt5

Now run QET_TB_maker_0.5.py    
Is run perfect on MS Windows too, thanks Unalcalde.


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

Re: Terminal block generator cross-platform

Ok, I'm so happy. As we go testing I'll fix all the bugs. nomicons/grin

Fow now, I saw on your video that the first tab showed is "Config". Maybe is better to show the tab "terminal block".

Re: Terminal block generator cross-platform

I tried to make an exe file bacause will be a portable file and no need to install python,.. in windows.

Differents options fails for me, but 'pyinstaller' finally creates the exe file, but launched and error when I ran it.

Can you test this?  https://www.youtube.com/watch?v=11Q2QADsAEE
http://i68.tinypic.com/fwsv1k.jpg

Re: Terminal block generator cross-platform

I have a problem, I can't run it on linuxmint 18.

alexis@alexis-SATELLITE-L70-C-14E ~ $ python3 ./Bureau/QET_TB_maker_0.5.py
Traceback (most recent call last):
  File "./Bureau/QET_TB_maker_0.5.py", line 12, in <module>
    from frmMain_ui import Ui_frmMain
  File "/home/alexis/Bureau/frmMain_ui.py", line 9, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: No module named 'PyQt5'

I have install : python-pyqt5 5.5.1 and python3-pip 8.1.1

Re: Terminal block generator cross-platform

galexis wrote:

I have a problem, I can't run it on linuxmint 18.

alexis@alexis-SATELLITE-L70-C-14E ~ $ python3 ./Bureau/QET_TB_maker_0.5.py
Traceback (most recent call last):
  File "./Bureau/QET_TB_maker_0.5.py", line 12, in <module>
    from frmMain_ui import Ui_frmMain
  File "/home/alexis/Bureau/frmMain_ui.py", line 9, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: No module named 'PyQt5'

I have install : python-pyqt5 5.5.1 and python3-pip 8.1.1

Try installing pyqt5-dev-tools. 
I didn't install any more packages. My primary os is xubuntu and I tried on a virtual machine with Lubuntu.

I'll continue trying to create a portable version for all os.

Re: Terminal block generator cross-platform

Perhaps this:
http://arstechnica.com/information-tech … -mac-os-x/

https://www.smallsurething.com/a-really … cx_freeze/

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

72 (edited by unalcalde 2016-08-28 13:44:21)

Re: Terminal block generator cross-platform

Py2exe: It's 6 years ago. no works  with python 3.5.
cx_freeze: only supports python 3.4  :-(

Now i'm testing one option directly from pyqt: http://pyqt.sourceforge.net/Docs/pyqtde … ction.html

73 (edited by scorpio810 2016-08-28 15:21:50)

Re: Terminal block generator cross-platform

unalcalde wrote:

I didn't install any more packages. My primary os is xubuntu and I tried on a virtual machine with Lubuntu.

I'll continue trying to create a portable version for all os.

Ok, it's work. pyqt5-dev-tools installed python-pyqt5 (not python3-pyqt5).

Re: Terminal block generator cross-platform

Hi, 
now the program is easy to install, at the command line execute: pip install qet_tb_generator
to excute write the command: qet_tb_generator

Under linux uses pip3 instead.

This installation method should resolve all dependencies (i.e. pyqt5)

Re: Terminal block generator cross-platform

[11:36:21] laurent@debian:~$ pip3 install qet_tb_generator
Collecting qet_tb_generator
  Downloading qet_tb_generator-0.5.0.tar.gz
Collecting pyqt5 (from qet_tb_generator)
  Downloading PyQt5-5.7-cp35-cp35m-manylinux1_x86_64.whl (89.8MB)
    100% |████████████████████████████████| 89.8MB 16kB/s 
Collecting sip (from pyqt5->qet_tb_generator)
  Downloading sip-4.18.1-cp35-cp35m-manylinux1_x86_64.whl (60kB)
    100% |████████████████████████████████| 61kB 1.5MB/s 
Building wheels for collected packages: qet-tb-generator
  Running setup.py bdist_wheel for qet-tb-generator ... done
  Stored in directory: /home/laurent/.cache/pip/wheels/e1/33/67/5b05f5ec88ebfcec3f4bd9039d0e66cdc7dcb4de55e5c03719
Successfully built qet-tb-generator
Installing collected packages: sip, pyqt5, qet-tb-generator
Successfully installed pyqt5 qet-tb-generator sip-4.18.1
[11:37:33] laurent@debian:~$ 


to excute write the command: qet_tb_generator

Hum, no work

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