As Mainly work as an Electronic Engineer, or embedded production project manager, and although always write software with C or C++, yet anything that relate to GUI Programmer is out of my territory, as an good Engineer , that is nor forgive, so take some time to study the Python and PyQt4 , with which I make a small SerialAssistant application, which can help to monitor the Serial port data, and the Ui preview as bellow:
at the same time I also upload the sources code to github https://github.com/folreams/SerialAssistant and anyone interesed are welcome to download and test.the links is http://pan.baidu.com/s/1kUSs8eF
Question meet for backup:
1) statusBar, as the default statusbar only show one tempory message, and to show three message at the same time , we need create an our own statusbar, and add three Qlabel. the code as below:
self.statusmessage = QtGui.QLabel()
self.statustx = QtGui.QLabel()
self.statusrx = QtGui.QLabel()
self.statusBar().addPermanentWidget(self.statusmessage,1)
self.statusBar().addPermanentWidget(self.statustx,1)
self.statusBar().addPermanentWidget(self.statusrx,1)
to show the message we use
self.statusrx.setText("RX: 0 Bytes")
2) when finished the sources code , we need generate the exe file for the computer without python, which we use cx-freeze,the command is
E:\BitBucket\SerialAssistant>cxfreeze Main.py --icon=icon.ico --target-name=Seri alsAssistant.e xe --base-name="Win32GUI"
Leave a Reply