Design of navigation and positioning functions for logistics information terminals based on QT/embedded

Source: Internet
Author: User

Source: http://www.eaw.com.cn/news/show.aspx? Classid = 44 & ArticleID = 9624

Abstract: This article introduces the transplantation and development process of the QT/Embedded graphic interface system on the logistics information terminal of the embedded Linux System and the S3C2410 platform, as well as the system design scheme and QT/embedded programming implementation of the positioning function on the logistics information terminal, and the experimental results are given.

QT/Embedded is a Linux-based embedded platform development tool launched by qique technology. It is an embedded version of QT. Because KDE and other projects use Qt as the support library, many QT-based X Windows programs can be easily transplanted to the QT/Embedded Version. QT/Embedded has the advantages of object-oriented, cross-platform, convenient and beautiful interface design, and has been widely used.
Based on the current requirements of terminal positioning function in the logistics industry, this paper proposes a solution for realizing the positioning function of the logistics terminal, and uses QT/embedded, the terminal positioning function is initially implemented on the logistics information terminal Platform Based on Embedded Linux and S3C2410.
  
Software and Hardware System Design Principles

Based on the overall situation of the existing network construction and the requirements for the reliability, continuous coverage and accuracy of positioning data in the logistics distribution process, considering the development status, technical maturity, implementation cost and other factors of various positioning technologies, the system adopts the GPS-Assisted Positioning System in the logistics distribution network, GPS + cellid + RFID + graphic road Matching Combined positioning technology.

The software and hardware function Diagram 1 shows that the CPU of the Development Board is Samsung's S3C2410. This processor is integrated with a 32-bit microcontroller of the arm ARM920T processor core. The GPS module uses the RS232 interface to communicate with the Development Board and provides satellite positioning signals. The GSM/GPRS module provides communication and cellid positioning information acquisition. The RFID module provides Tag Information Collection and RFID positioning functions. The terminal establishes contact with the Logistics Information Control Center through the GSM/GPRS communication network, submits relevant data collection information, and receives commands from the Logistics Information Control Center.

Figure 1 system software and hardware function Diagram

The system uses an embedded Linux operating system, transplanted QT/Embedded 3.3.4 and SQLite databases, and implemented the positioning function of logistics information terminals using QT programming.

Software System Design

The software system design in this paper mainly uses the S3C2410 platform as the core, through the RS-232 serial port from the GPS module, GSM/GPRS module, RFID module to extract positioning information, analysis and conversion, it is used for terminal navigation as needed or submitted to the Logistics Information Control Center through the GSM/GPRS network.

Host Development Environment Establishment

Due to the limited resources of the Target Platform, a cross-compilation environment needs to be set up. The platform used in the system development process is as follows:
HOST: Red Hat 9.0
QT/X11 3.3.4
QT/Embedded 3.3.4
SQLite 2.8.16
Cross-2.95.3.tar.bz2
Target machine: Linux kernel 2.4.18
QT/Embedded 3.3.4
SQLite 2.8.16

QT/Embedded 3.3.4 porting

To correctly cross-compile QT/embedded, we recommend that you fully install Red Hat 9.0 on the host machine, make sure that the header files and library files required by UUID, zlib, JPEG, GIF, PNG, SQLite, and other QT files are correctly installed before cross-compilation, and port the corresponding library files to the target machine. The installation of such files is not described here. Next we will discuss the cross-compilation and porting of QT/Embedded 3.3.4 in detail.

Download and decompress the source file
$ Cd ~
$ Mkdir-P qt_embedded/
$ CD qt_embedded
$ Wget ftp://ftp.trolltech.com/qt/source/qt-x11-free-3.3.4.tar.bz2
$ Wget ftp://ftp.trolltech.com/qt/source/qt-embedded-free-3.3.4.tar.bz2
$ Tar jxf qt-x11-free-3.3.4.tar.bz2
$ Tar jxf qt-embedded-free-3.3.4.tar.bz2
$ Mkdir-P qt-embedded-free-3.3.4-target/
$ Sudo CP-r qt-embedded-free-3.3.4/qt-embedded-free-3.3.4-target/
Install QT/X11
$ Qt-x11-free-3.3.4 CD
$ Export qtdir = $ pwd
$ Export Path = $ qtdir/bin: $ path
$ Export LD_LIBRARY_PATH = $ qtdir/lib: $ ld_library _ path
$ Echo Yes |./configure-thread-plugin-SQL-SQLite-Prefix/usr/local/Qt-3.3.4/
$ Make
$ Sudo make install

Install the host version of QT/e 3.3.4

To facilitate embedded program development on the host machine, use qvfb to display the virtual Embedded LCD screen.

$ CD ../qt-embedded-free-3.3.4
$ Export qtdir = $ pwd
$ Export Path = $ qtdir/bin: $ path
$ Export LD_LIBRARY_PATH = $ qtdir/lib: $ ld_library _ path
$ Echo Yes |./configure-thread-plugin-SQL-SQLite-Prefix/usr/local/Qt-embedded-3.3.4-host-qvfb
$ Make
$ Sudo make install
$ Sudo CP-r lib/fonts // usr/local/Qt-embedded-3.3.4-host/lib/
Install the target machine version of QT/e 3.3.4
$ CD ../qt-embedded-free-3.3.4-target
$ CP ../qt-x11-free-3.3.4/bin/UIC bin/(Note: You need to copy the QT/X11 version of the UIC tool to the installation directory)

QT/e3.3.4 does not have configuration options for touch screens. To ensure that the touch screen works properly, you can modify existing configuration options to meet actual needs. The Touch Screen driver is modified using QT-mouse-linuxtp.

Modify src/Embedded/qmouselinuxtp-qws.h and add the following two lines:
# Define qt_qws_ipaq
# Define qt_qws_ipaq_raw

Modify src/Embedded/qmouselinuxtp-qws.cpp and change/dev/** 3600 in the file to the name of the corresponding touch screen driver/dev/touchscreen/0raw in the arm-Linux operating system of the Development Board.

$ Echo Yes |. /configure-Embedded ARM-shared-debug-no-cups-thread-plugin-SQL-SQLite-no-ipv6-QT-mouse-linuxtp-Prefix/usr/local/Qt-embedded-3.3.4-target-Depths 16 -system-libpng-system-libjpeg
$ Export qmakespec = qws/Linux-arm-G ++
$ Make
$ Sudo make install
$ Sudo CP-r lib/fonts // usr/local/Qt-embedded-3.3.4-target/lib/

In this case, download the cross-compiled QT/e 3.3.4 library file to the Development Board, and set the corresponding environment variables such as qtdir, path, and LD_LIBRARY_PATH. In addition, you must set the touch screen environment variables as follows:
$ Export qws_mouse _ PROTO = linuxtp:/dev/touchscreen/0raw
$ Export qws_keyboard =

At this time, the touch screen may still not work or the error is large, the main reason is that the/etc/pointercal file in the Development Board operating system does not exist or the touch screen calibration parameters in this file are incorrect, modify the/etc/pointercal file. There are two ways to modify it: Prepare, copy the generated calibration program to the target board, set environment variables, run the calibration program, and directly generate a high-precision/etc/pointercal file. The second method is recommended here.

So far, QT/e3.3.4 can be correctly executed on the target board and transplanted.

QT/e Programming

This article uses QT/Embedded 3.3.4, mainly considering that QT/e 3.3 is more mature than previous versions, and visual programming is more convenient and easy to use, and it supports SQLite database driver, it facilitates database operations and programming. In this design, the canvas module, SQL module, network module and multi-thread programming of QT/e are mainly used, shortening the development cycle of the program and improving the development efficiency. The following describes multi-threaded programming and canvas module programming.

Multi-Thread Programming

Generally, the user interface application has an execution thread and each operation is executed. If a user calls a time-consuming operation from the user interface in a single-threaded application, the user interface is usually frozen when the operation is executed. This implementation uses the qthread subclass to obtain the qgpsthread class, and uses qmutex, qsemphore, and qwaitcondition to synchronize various threads. The qgpsthread class is used to program and receive the $ GPRS Mc position data frame of the GPS module through the serial port, and parse the data frame to obtain the real-time positioning information such as longitude and latitude for other threads to use.

Canvas Module

In the canvas module, the qcanvas library is a highly optimized two-dimensional Drawing Library. qcanvas can contain many items of any image and uses double buffering internally to avoid blinking. qcanvas supports layering, suitable for hierarchical display of digital maps. Qcanvas can be used with other canvas modules to conveniently display, zoom, roam, and eagleeye navigation maps. The following is the implementation code for common operations on navigation maps.

Void form2: zoomin () // scale down the map
{
Qwmatrix M = mapview-> worldmatrix ();
M. Scale (0.5, 0.5 );
Mapview-> setworldmatrix (m );
}
Void form2: movleft () // roaming the map to the left
{
Mapview-> scrollby (-10, 0 );
}
Void form2: centerpoint () // place the current positioning point in the center of the displayed Map
{
Mapview-> Center (pointx, pointy );
}
Void form2: movleft () // move the positioning point on the map
{
I-> move (pointx, pointy );
Canvas-> Update ();
}

Initial Implementation

The initial implementation of the positioning function of the embedded information terminal platform 2 shows that the system has friendly man-machine interfaces and precise positioning. Positioning Error mainly depends on the positioning precision of the GPS-OEM module, experimental display, the system can initially meet the needs of logistics information terminal positioning function.

Figure 2 initial implementation of the positioning function of the embedded information terminal platform

Conclusion

This paper proposes a scheme to implement the positioning function of embedded logistics information terminal, and uses QT/e programming to implement it. The experimental results show that the system positioning data is accurate, the interface is friendly, and the system is highly scalable. The positioning function of the logistics information terminal is well completed. ■
 
References
1. Chang Fei, Li Ming Lu, Li luqun. Research on Mobile Positioning Technology in logistics distribution [J]. Micro-Computer Applications (Research and Design), (1). 22-24
2. yang dizzy, Hu Yongjian, Lin zhiquan. design of Image Transmission System Based on Linux and S3C2410 [J]. microcomputer Information (embedded and SOC), 2007,23 (3-2 ). 20-24
3. (Canada) branchette (J .), (English) sammfield (Summerfield, M .) translated by Qi Liang. c ++ GUI qt3 programming [M]. beijing: Beijing University of Aeronautics and Astronautics Press, 2006

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.