RSS

Build quick UI Applications using Qt Creator

Qt is widely used for developing applications with a GUI. Here I have described about a simple slider and dial desktop application. By moving the dial clockwise or anti- clockwise or by moving the slider left or right, the value on the lcd changes. So to start building the application, you need to have a Qt SDK 4.7 or higher, which you can get from here.

After you are done with the installation, click on create project and select Qt C++ Project. The Qt C++ project has three options, from that select the first one, Qt Gui Application.

Give a name to your project and select the Desktop Qt version.

Go to the next step and click on finish project.The IDE will show your project with some files, which are automatically generated by Qt, in the project explorer. These files are .pro, .cpp, .ui, .h.

Click on the mainwindow.ui, and drag and drop the components which you want to include in the ui. In this example, I have used a dial, a  horizontal slider and a LCD number. Finally the ui would appear like this.

Now we have to assign signals and slots, since we want to notify the lcd to increment or decrement the number while the dial or the slider is moved. So right click on the dial and click on ‘Go to slot’. There will be several options available, select the ‘ value(changed) ‘ option. Repeat the same step with right clicking on the horizontal slider.

After doing the above step, the mainwindow.cpp and mainwindow.h file will automatically create these two methods and their declarations in the header file.

To add the functionality to the dial and slider, just add the line

ui->lcdnumber->display(value);

in both the methods. Do not forget to save the project side by side while making the changes.Click on the window property editor, from where you can set the dial’s min, max value, step change etc. In this example I have set the min value as 0 and max as 99. The step size is 1. The max no. of digits which can be displayed on lcd can also be set from here itself.

Now click on the run button, the application will start and certain output messages will come in the console window. You will see the application running on the system ;) . In this way you can create quick user interface apps using the Qt SDK.

 
Leave a comment

Posted by on November 23, 2011 in Embedded, GUI Application, Qt

 

Subcutaneous Vein Detection System Version1.0

This thesis will give an insight to you about my final year M.Tech project, Subcutaneous Vein Detection using ARM 9 Single Board Computer. How the open source tools and Embedded Linux platform has helped in the overall development of a full fledged embedded system. The used of Open CV and Qt together has been explored and a lot more interesting things can be done in future by following the same trend.

Overview of System

The system consists of three main components. First, an infra-red LED source . These infra-red LED’s have a  peak response at a particular wavelength of light for which the veins apprar brighter than the surrounding tissue  Second,  a IR sensitive customized webcam which captures the image of limb under observation. And third, a single board computer which takes care of the image processing part. Of course, ra firmware is developed for the system which is a combination of image processing OpenCV libraries and a GUI Qt libraries.

Prototype

The prototype developed is shown in the figure below. For the time being an actual lamp lighting stand is used as a height adjusting stand and support for the camera. The webcam sits at the top of the system  and the focus of the webcam can be adjusted as required. A separate power supply is developed for infra-red LED lighting system. The limb is kept on a limb rest.

 

Results

The enhanced veins are displayed on the monitor which is interfaced to the system. The next step is to interface a projector to it, so that the enhanced image can be projected on the limb itself.

For more details, you can refer these two links:

M.Tech Thesis

Subcutaneous_Vein_Detection_PPt

 

Tags: , , ,

Configure & Setup Qt for an Embedded Device

For rapid development of GUI applications , Qt is a nice framework which is a popular choice for embedded devices. Over here I have discussed for ARM based embedded device, but you can configure qt for any platform you may use.To start with it, you need to set up  few things first.

  • Untar the qt-everywhere-opensource-src-4.6.2 source on the host in whichever location you may like. Mine is /usr/local/qt. You can download the source from this link Qt 4.6.2.
  • Download and setup the GNU ARM Toolchain and set the PATH variable accordingly.
  • To configure Qt for our embedded device we need to pass the following arguments:
./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix \
/usr/local/qt -little-endian -no-qt3support -no-cups -no-largefile \
-optimized-qmake -no-openssl -nomake tools -qt-mouse-tslib -qt-kbd-linuxinput

The arguments which you give configures Qt accordingly. Suppose you  need networking capability on the device, just add -webkit option while configuring. You can modify the options according to your need.

Now after configuring Qt run

make

Wait for some time and the qt libraries will be there in /usr/local/qt/lib/ directory.

Now suppose you forget to enable the mouse and keyboard options while configuring Qt. Just add the required options and run make again. Doing this will only affect the QtGui library, so you need to replace only QtGui.so.x.x file on your root filesystem if you are planning to make changes.

Setting up Qt libs on the device

Create a dir /usr/local/qt on device root filesystem and copy the complete lib directory from your host to the target in /usr/local/qt directory.Remove the small video file, mp3 file and some sample images that are present on the device to free some NAND in case the memory on your device is low.

Setting Environment Variables on the device

To make the device understand the new Qt libs, make modifications in the startup scripts of the embedded device. Normally the startup script is available in the /etc/initd/rcS

Edit the /etc/initd/rcS file and add this line to it

source /etc/qtprofile

Create the /etc/qtprofile and add the following lines to it:

export LD_LIBRARY_PATH=/usr/local/qt/lib
export QWS_MOUSE_PROTO=IntelliMouse:/dev/input/event0
export QWS_DISPLAY=LinuxFB:mmWidth=310:mmHeight=190

Since I have enabled the support for mouse and keyboard while configuring Qt.Remember that these variables may change according to the /dev available on your deviceGo to /dev/input/ and see which file is responsible for which device. For eg. if tslib is configured on your device then the QWS_MOUSE_PROTO variable will have the value something like

QWS_MOUSE_PROTO=Tslib:/dev/input/event1

Now your embedded device is ready with Qt 4.6.2 libs. Try running a simple application (viz a Analog Clock from the cross-compiled qt examples at /usr/local/qt/examples/widgets/analogclock/analogclock by giving the -qws option on the device shell as

./analogclock -qws

So thats all folks!

 
Leave a comment

Posted by on May 25, 2011 in Embedded

 

11th Feb 2011

Gnunify is one of the biggest annual FOSS event organized by the students of SICSR and PLUG in Pune, India

via 11th Feb 2011.

 
Leave a comment

Posted by on February 10, 2011 in Embedded

 

Tags:

Open cv on mini2440 (S3C2440)

Open CV 2.0.0 is an image processing library developed by Intel. It is one of the most advanced libraries for image processing. It is open source and is used widely in many image processing applications. For cross-compilation, please refer  the page on embedded nirvana, a community wiki, which I wrote in December.

Read the rest of this entry »

 
1 Comment

Posted by on February 4, 2011 in Image processing, mini2440, Open cv, S3C2440

 

Tags: , ,

PIC uC based multiparameter display

This meter takes 4-20mA input from the current transmitter and displays the corresponding reading on the 7-segment display. The meter is based on PIC16f873 micro-controller. The selection of uC is based on the fact that it contains an On-Chip ADC. Any parameter like flow, temperature, level, PH can be displayed.

A current to voltage conversion technique is used to convert 4-20mA to 1-5V range by using a 250 ohm resistor. The 1-5 V signal is given to ADC and accordingly the digital output is displayed after being scaled.

Also a 4×1 keypad is interfaced with th uC through which the user can set which parameter to display and set the range of the parameter (lower and upper set point). Hence a two- point calibration feature is also provided.

 

The development tools used are:-

  • Proteus 7.4 VSM : For design and simulation
  • MPLAB v8.4 IDE: Integrated Development Environment for PIC uC for coding and debugging
  • OrCAD 9.1 Suite : PCB design and layout

Here is the schematic of the board BOARD SCHEMATIC

Read the rest of this entry »

 
Leave a comment

Posted by on February 1, 2011 in Embedded

 

Tags:

 
Follow

Get every new post delivered to your Inbox.