WO2016019861A1 - 基于QT Embedded系统的字符显示方法和系统 - Google Patents

基于QT Embedded系统的字符显示方法和系统 Download PDF

Info

Publication number
WO2016019861A1
WO2016019861A1 PCT/CN2015/086103 CN2015086103W WO2016019861A1 WO 2016019861 A1 WO2016019861 A1 WO 2016019861A1 CN 2015086103 W CN2015086103 W CN 2015086103W WO 2016019861 A1 WO2016019861 A1 WO 2016019861A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
bitmap
display
request
characters
Prior art date
Application number
PCT/CN2015/086103
Other languages
English (en)
French (fr)
Inventor
周国麟
Original Assignee
北京配天技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京配天技术有限公司 filed Critical 北京配天技术有限公司
Publication of WO2016019861A1 publication Critical patent/WO2016019861A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units

Definitions

  • the present invention relates to the field of display technologies, and in particular, to a character display method based on a QT Embedded system, and to a QT-based method.
  • the character display system of the Embedded system is a character display method based on a QT Embedded system.
  • Qt The Embedded system is an embedded version of the graphical interface development tool Qt, an embedded graphical interface development tool system that passes the Qt API (Application Program). Interface, application interface) and Linux I/O interface and Frame Buffer (frame buffer, standard display device driver interface) directly interacts, has high operational efficiency, and adopts object-oriented programming as a whole, with good architecture and programming mode.
  • Qt API Application Program
  • Linux I/O interface and Frame Buffer frame buffer, standard display device driver interface
  • QT Embedded system is used in the common software environment of embedded hardware architecture. It has the advantage of cross-platform. The same code can be applied to different operating systems such as windows and linux.
  • the invention mainly solves the technical problem that the system resources occupy the system resources and even affect other functions when the character refresh display is displayed in the prior art, and provides a QT-based solution.
  • the character display method and system of the Embedded system can save system resources, avoid affecting other functions and improve the user experience.
  • a technical solution adopted by the present invention is to provide a QT based a character display method of an embedded system, the character display method comprising: receiving a request for displaying a character; searching a bitmap corresponding to a character to be displayed from a pre-stored character bitmap map; displaying the bitmap according to a predetermined display format In response to the request to display a character.
  • the step of displaying the bitmap according to a predetermined display format specifically includes: calling a display driving memory frame
  • the buffer operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display screen in the predetermined display format.
  • the step of searching for a bitmap corresponding to the character to be displayed from the pre-stored character bitmap mapping table includes: sending the request for displaying the character to the QT a secondary thread of the Embedded system to cause the secondary thread to look up a bitmap corresponding to the character from a pre-stored character bitmap mapping table; the displaying the bitmap in response to the displayed character in accordance with a predetermined display format
  • the request includes: the secondary thread calls the display driver memory frame buffer frame The buffer operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display screen in the predetermined display format.
  • the secondary thread of the Embedded system includes: sending the request for displaying a character to a character display task queue; sending a wakeup of the task to the secondary thread, so that the secondary thread checks the character display task queue, and according to the first priority The order in which the characters are displayed in the task queue is executed.
  • the method further includes: creating a bitmap of the character according to the predetermined character format; establishing the character and the bitmap The character bitmap maps the table and stores the bitmap.
  • the predetermined display format includes a size, a font, a color, and an alignment of the character, and the character includes at least one of the following types of characters: an Arabic numeral, an English letter, a Chinese character, a match, and a special symbol.
  • another technical solution adopted by the present invention is to provide a QT based a character display system of an embedded system, the character display system comprising a receiving module, a searching module and a drawing display module: the receiving module for receiving a request for displaying characters; and the searching module for pre-stored character bitmaps A bitmap corresponding to the character to be displayed is searched in the mapping table; the rendering display module is configured to display the bitmap in a predetermined display format in response to the request to display the character.
  • the drawing display module is specifically configured to invoke a display driving memory frame buffer frame. Buffe operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer location, thereby displaying the bitmap on the display screen in the predetermined display format.
  • the character display system further includes: a sending module, configured to send the request for displaying the character to the QT a secondary thread of the Embedded system, such that the secondary thread searches for a bitmap corresponding to the character from a pre-stored character bitmap mapping table; the secondary thread is also used to invoke a display driver memory frame buffer frame
  • the buffer operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display screen in the predetermined display format.
  • the sending module includes: a first sending submodule, configured to send the request for displaying a character to a character display task queue; and a second sending submodule, configured to send a wakeup with a task to the secondary thread, And causing the secondary thread to check the character display task queue, and execute the request in the character display task queue in a first-in first-out order.
  • the present invention further provides a QT based A character display device of an embedded system, comprising: an input device, an output device, a processor, and a memory,
  • the processor is configured to perform the following steps:
  • the bitmap is displayed in a predetermined display format in response to the request to display a character.
  • the processor is further specifically configured to: invoke a display driver memory frame buffer frame Buffe operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer location, thereby displaying the bitmap on the display screen in the predetermined display format.
  • the processor is further configured to send the request for displaying a character to the QT A secondary thread of the Embedded system to cause the secondary thread to look up a bitmap corresponding to the character from a pre-stored character bitmap mapping table.
  • the processor is further specifically used to call a display driver memory frame buffer frame
  • the buffer operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display screen in the predetermined display format.
  • the processor is further configured to send the request for displaying a character to a character display task queue; send a wakeup of the task to the secondary thread, so that the secondary thread checks the character display task queue, and The request in the character display task queue is executed in a first-in, first-out order.
  • the present invention avoids the present by searching for a bitmap of a predetermined display format for a character to be displayed when a request for displaying a character is received by establishing a character bitmap mapping table.
  • the size of the character is calculated at a high frequency, the influence of the character alignment, the influence of the layout of the character, and the like, which can save system resources, avoid affecting other functions, and prevent the system from being intermittent. And the slow response and other phenomena have improved the user experience.
  • FIG. 1 is a flow chart of an embodiment of a character display method of the present invention
  • FIG. 2 is a flow chart of a first embodiment of a character display method of the present invention
  • FIG. 3 is a flow chart of a second embodiment of the character display method of the present invention.
  • FIG. 4 is a flow chart of a first embodiment of a character display system of the present invention.
  • Figure 5 is a flow chart showing a second embodiment of the character display system of the present invention.
  • Figure 6 is a block diagram showing the structural composition of an embodiment of the character display device of the present invention.
  • FIG. 1 is a flowchart of an embodiment of a character display method according to the present invention.
  • the character display method of the present embodiment can be used in an object-oriented programming system, for example, based on QT.
  • the embedded system can be used in a device for displaying character readings such as a numerical control system, a test instrument, a stopwatch, etc.
  • the character display method of the present embodiment includes but is not limited to the following steps.
  • Step S100 receiving a request to display a character.
  • step S100 The Embedded system can passively or actively generate a request to display characters according to a user's specific operation, a list to be displayed, and the like.
  • Step S101 searching for a bitmap corresponding to the character from the pre-stored character bitmap mapping table.
  • the present invention may be pre-set to: create a bitmap of characters according to a predetermined character format, wherein each bitmap corresponds to one character or a plurality of characters; and then, establish a character bitmap map of the character and the bitmap Store bitmaps.
  • step S101 when a request to display a character is received and a character needs to be displayed, the bitmap corresponding to the character and the character to be displayed is directly searched based on the character bitmap map.
  • the predetermined character format described in this embodiment may include a character size, a font, a color, and a background, such as a size of “5”, a font of “Song”, a color of “Red”, and the like.
  • the character described in this embodiment may specifically include at least one of the following types of characters: Arabic numerals, English letters, Chinese characters, matches, and special symbols, such as "1, 2, 3, a, b, c, d , normal, abnormal, ⁇ , ⁇ , a1, 1 normal, ⁇ 2a", etc., in a single or combined manner.
  • bitmap can be Arabic numerals, English letters, Chinese characters, special symbols and any combination thereof, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 Normal, ⁇ 2a" and the like in a single or combined manner.
  • the display mode of the same display position and the format of the character can be fixed, that is, the size, font, alignment, etc. of the character are constant.
  • the type of characters displayed is also limited, such as the number 0 ⁇ 9, the number greater than 10, and the decimal, etc., are the arrangement of the characters of 0 ⁇ 9. Therefore, in the numerical control system, the characters to be displayed are limited and relatively fixed combinations. It is not difficult to see that the present embodiment sets these limited display formats in advance, and each time the display characters are refreshed, the appropriate combination of the automatic/smart/default selections can be selected from at least one display format table. For the same reason, the present embodiment can be similarly processed for other characters, and will not be described in detail within the scope of those skilled in the art.
  • Step S102 displaying the bitmap in accordance with a predetermined display format in response to the request to display the character.
  • the predetermined display format may include: alignment of a bitmap (character), scaling, and the like.
  • step S102 the present embodiment displays the found bitmap according to a predetermined display format, and draws the bitmap assignment value on the display screen by “grabbing” and “drawing” directly, without recalculating the font. Size, alignment, and layout reduce the impact and impact of the computing process on system performance and resources.
  • this embodiment can use a general bitmap drawing function for drawing display, such as QT.
  • Embedded bitmap drawing functions and the like are not limited herein.
  • a bitmap is used, and a bitmap list is used to store a mapping relationship, and limited characters are stored in a predetermined font, size, background display format, etc., and when it is necessary to update a display character, or refresh a screen, etc.
  • the character string is split into separate characters that are already stored in the bitmap format in the bitmap format, and can be drawn at the appropriate position on the display screen. For example, "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 normal, ⁇ 2a" and the like are single or combined character modes.
  • bitmaps drawn may be Arabic numerals, English letters, Chinese characters, symbols, and special symbols, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 Normal, ⁇ 2a" and the like in a single or combined manner.
  • the invention establishes a character bitmap mapping table, and searches for and displays a bitmap corresponding to the character to be displayed according to a predetermined display format when the character needs to be displayed, thereby avoiding the high-frequency calculation of the character size when the character needs to be displayed in the prior art.
  • the system resource problem occupied by the influence of character alignment and the influence of the position layout of the character can save system resources, avoid affecting other functions, prevent the system from being intermittent and slow, and effectively improve the user experience.
  • FIG. 2 is a flowchart of the first embodiment of the character display method of the present invention.
  • the character display method of the present embodiment includes but is not limited to the following steps.
  • Step S200 receiving a request to display a character.
  • Step S201 searching for a bitmap corresponding to the character to be displayed from the pre-stored character bitmap mapping table.
  • step S201 refer to the related description of the step S101 in the previous embodiment, and the description is not made in the scope of those skilled in the art.
  • Step S202 calling the display driver memory frame
  • the buffer operates on the pixels of the display to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display in a predetermined display format.
  • step S202 the present embodiment Frame
  • the buffer displays the bitmap corresponding to the character to be displayed in a predetermined display format, and draws the bitmap assignment value on the display screen by "grabbing” and “drawing” directly, without recalculating the font size and alignment. And layout, etc., to reduce the occupancy and impact of the computing process on system performance and resources.
  • the buffer operation splits the character string into separate, separate characters in the image format already stored in the bitmap list, which can be drawn at the appropriate position on the display.
  • the bitmap drawn may be at least one of the following types of characters: Arabic numerals, English letters, Chinese characters, symbols, and special symbols, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 normal, ⁇ 2a" and the like in a single or combined manner.
  • the present embodiment uses Frame by using The buffer operation allows you to place operations such as drawing bitmaps or displaying characters on another thread (usually a secondary thread) that is juxtaposed with the main thread. It is not difficult to understand that in QT In the Embedded system, operating Frame buffer is not a function of the QT system itself, so there is no need to limit it to the main thread. Further, when operating Frame Buffer is placed after another sub-thread, even Frame The buffer operation occupies more resources, and does not interfere with the logic calculation, response feedback, etc. in the main thread, thus greatly improving the overall performance of the system.
  • FIG. 3 is a flowchart of the second embodiment of the character display method of the present invention.
  • the character display method of the present embodiment includes but is not limited to the following steps.
  • Step S300 receiving a request to display a character.
  • Step S301 sending a request for displaying characters to QT A secondary thread of the Embedded system to cause the secondary thread to look up a bitmap corresponding to the character to be displayed from the pre-stored character bitmap mapping table.
  • step S301 when the system detects that the character needs to be displayed in S300, the corresponding character display request may be generated and recorded first. For example, if the current character is displayed as “209.23” and the character to be displayed at the next moment is “210.55”, the system generates and records a request to display “210.55”.
  • step S301 after recording the request to display the character, to QT A secondary thread in the Embedded system sends a wakeup with a task.
  • the wake-up of the "display 210.55" is simultaneously sent to the secondary thread for the secondary thread to perform the follow-up processing.
  • the secondary thread After the secondary thread wakes up, it checks the request to display the character.
  • step S301 the request for displaying characters is sent to the character display task queue; then, the wake-up of the task is sent to the secondary thread, so that the secondary thread checks the location.
  • the character displays the task queue and executes the request in the character display task queue in the order of first in first out.
  • the present embodiment may be set in advance: a bitmap of characters is created in accordance with a predetermined character format; then, a character bitmap map of characters and bitmaps is created and a bitmap is stored. When a character needs to be displayed, the bitmap corresponding to the character is directly searched according to the character bitmap map.
  • the predetermined character format described in this embodiment may include a character size, a font, a color, and a background, such as a size of “5”, a font of “Song”, a color of “Red”, and the like.
  • the characters described in this embodiment may specifically include Arabic numerals, English letters, Chinese characters, special symbols, and any combination thereof, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , A single or combined manner of ⁇ , a1, 1 normal, ⁇ 2a", and the like.
  • bitmap can be Arabic numerals, English letters, Chinese characters, special symbols and any combination thereof, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 Normal, ⁇ 2a" and the like in a single or combined manner.
  • the display mode of the same display position can be fixed, that is, the size, font, alignment, etc. of the character are constant, and the displayed characters are
  • the types are also limited, such as numbers 0 ⁇ 9, numbers greater than 10, and decimals, etc., are all 0 ⁇ 9 characters arranged in combination. Therefore, in the numerical control system, the characters to be displayed are limited and relatively fixed combinations. It is not difficult to see that the present embodiment sets these limited display formats in advance, and each time the display characters are refreshed, the appropriate combination of the automatic/smart/default selections can be selected from at least one display format table. For the same reason, the present embodiment can be similarly processed for other characters, and will not be described in detail within the scope of those skilled in the art.
  • Step S302 the secondary thread calls the display driver memory frame buffer frame
  • the buffer operates on the pixels of the display to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display in a predetermined display format.
  • step S302 as described above, after the secondary thread wakes up, the character display task queue is checked, and multiple requests for displaying characters are processed in a first-in first-out order until the characters are sequentially displayed in the task queue.
  • the bitmaps of the characters are displayed on the display in a predetermined display format.
  • the character display method of the embodiment of the present invention maps characters into fixed bitmaps, so that each time the display is refreshed, it is not necessary to frequently calculate factors such as font, size, alignment, etc., and at the same time, the present invention passes Frame. Buffer operation avoids QT Embedded calculates the alignment, layout, etc. of the bitmap drawing. In addition, the present invention can improve the response efficiency and avoid the omission of the request for displaying characters by the cooperation of the character display task queue and the main and secondary threads.
  • the present invention can effectively improve QT-based
  • the efficiency of the fast character display in the Embedded environment at the same time, the invention can effectively save system resources, avoid affecting other functions, prevent system discontinuity and slow response, and improve the user experience.
  • FIG. 4 is a flowchart of a first embodiment of a character display system according to the present invention.
  • the present embodiment provides a method for object-oriented programming, such as QT-based.
  • a character display system of the present embodiment the character display system of the present embodiment includes, but is not limited to, a receiving module 40, a lookup module 41, and a drawing display module 42.
  • the receiving module 40 is configured to receive a request to display a character.
  • the Embedded system can passively or actively generate a request to display characters according to a user's specific operation, a list to be displayed, and the like.
  • the searching module 41 may be configured to search for a bitmap corresponding to the character to be displayed from the pre-stored character bitmap mapping table according to the request for displaying the character received by the receiving module 40, in response to the request for displaying the character. .
  • the embodiment may be set in advance: a bitmap of characters is created according to a predetermined display format; then, a character bitmap map of characters and bitmaps is established and a bitmap is stored.
  • the search module 41 searches for a bitmap corresponding to the character to be displayed directly according to the character bitmap map when the character needs to be displayed.
  • the predetermined display format described in this embodiment may include a character size, a font, a color, and a background, such as a size of “5”, a font of “Song”, a color of “Red”, and the like.
  • the characters described in this embodiment may specifically include Arabic numerals, English letters, Chinese characters, special symbols, and any combination thereof, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , A single or combined manner of ⁇ , a1, 1 normal, ⁇ 2a", and the like.
  • bitmap can be Arabic numerals, English letters, Chinese characters, special symbols and any combination thereof, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 Normal, ⁇ 2a" and the like in a single or combined manner.
  • the display mode of the same display position can be fixed, that is, the size, font, alignment, etc. of the character are constant, and the displayed characters are
  • the types are also limited, such as numbers 0 ⁇ 9, numbers greater than 10, and decimals, etc., are all 0 ⁇ 9 characters arranged in combination. Therefore, in the numerical control system, the characters to be displayed are limited and relatively fixed combinations. It is not difficult to see that the present embodiment sets these limited display formats in advance, and each time the display characters are refreshed, the appropriate combination of the automatic/smart/default selections can be selected from at least one display format table. For the same reason, the present embodiment can be similarly processed for other characters, and will not be described in detail within the scope of those skilled in the art.
  • the depiction display module 42 can be used to display a bitmap in accordance with a predetermined display format in response to a request to display a character.
  • the present embodiment depicts the display module 42 displaying according to a predetermined display format of the found bitmap, such as by "grabbing" "drawing” in a direct manner, rendering the bitmap assignment to the display without recalculating the font. Size, alignment, and layout reduce the impact and impact of the computing process on system performance and resources.
  • a bitmap is used, and a bitmap list is used to store a mapping relationship, and limited characters are stored in a predetermined font, size, background display format, etc., and when it is necessary to update a display character, or refresh a screen, etc.
  • the character string is split into separate characters that are already stored in the bitmap format in the bitmap format, and can be drawn at the appropriate position on the display screen. For example, "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , a1, 1 normal, ⁇ 2a" and the like are single or combined character modes.
  • bitmaps drawn may be Arabic numerals, English letters, Chinese characters, special symbols and any combination thereof, such as "1, 2, 3, a, b, c, d, normal, abnormal, ⁇ , ⁇ , A1, 1 normal, ⁇ 2a", etc., in a single or combined manner.
  • the present invention searches for a bitmap displaying a predetermined display format when characters need to be displayed, thereby avoiding the problem of calculating the size of characters, the alignment of characters, and the characters at a high frequency when displaying characters in the prior art.
  • the system resource problem occupied by the influence of location layout can save system resources, avoid affecting other functions, prevent system discontinuity and slow response, and effectively improve user experience.
  • FIG. 5 is a flowchart of a second embodiment of the character display system of the present invention.
  • the character display system of the present embodiment includes but is not limited to the receiving module 40, the transmitting module 50, the searching module 41, the drawing display module 42, and the display screen. 43 et al.
  • character display system of the present embodiment may be an embedded graphical interface development tool QT Embedded system.
  • the receiving module 40 is configured to receive a request to display a character.
  • the Embedded system can passively or actively generate a request to display characters according to a user's specific operation, a list to be displayed, and the like.
  • the sending module 50 can be configured to send the request for displaying characters to the QT.
  • a secondary thread of the Embedded system to cause the secondary thread to search for a bitmap corresponding to the character from a pre-stored character bitmap mapping table; then, the secondary thread is further used to invoke a display driver memory frame buffer frame
  • the buffer operates on the pixels of the display screen to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display screen 43 in a predetermined display format.
  • the character display task queue may be multiple and chronologically recorded in the character display task queue.
  • the sending module 50 may specifically include: a first sending sub-module, configured to send a request for displaying characters to the character display task queue. And a second sending submodule, configured to send a wakeup of the task to the secondary thread, so that the secondary thread checks the character display task queue, and executes the request in the character display task queue in a first-in first-out order.
  • a first sending sub-module configured to send a request for displaying characters to the character display task queue.
  • a second sending submodule configured to send a wakeup of the task to the secondary thread, so that the secondary thread checks the character display task queue, and executes the request in the character display task queue in a first-in first-out order.
  • the depiction display module 42 is specifically configured to call the display driver memory frame buffer frame.
  • the buffe operates on the pixels of the display screen 43 to fill the bitmap at the corresponding Frame buffer position, thereby displaying the bitmap on the display screen 43 in a predetermined display format.
  • This embodiment uses Frame The buffer operation allows you to place operations such as drawing bitmaps or displaying characters on another thread (usually a secondary thread) that is juxtaposed with the main thread. It is not difficult to understand that in QT In the Embedded system, operating Frame buffer is not a function of the QT system itself, so there is no need to limit it to the main thread. Further, when operating Frame Buffer is placed after another sub-thread, even Frame The buffer operation occupies more resources, and does not interfere with the logic calculation, response feedback, etc. in the main thread, thus greatly improving the overall performance of the system.
  • the character display system of the embodiment of the present invention maps characters into fixed bitmaps, so that it is not necessary to frequently calculate fonts, sizes, alignments, etc. each time the display is refreshed, and at the same time, the present invention passes Frame Buffer operation avoids QT Embedded calculates the alignment, layout, etc. of the bitmap drawing.
  • the present invention can improve the response efficiency and avoid the omission of the request for displaying characters by the cooperation of the character display task queue and the main and secondary threads.
  • the present invention can effectively improve QT-based
  • the efficiency of the fast character display in the Embedded environment at the same time, the invention can effectively save system resources, avoid affecting other functions, prevent system discontinuity and slow response, and improve the user experience.
  • FIG. 6 is a structural block diagram of an embodiment of the character display device of the present invention.
  • the character display device includes an input device 100, an output device 200, a processor 300, a memory 400, and the like, wherein the input and output devices (100, 200) are used for writing and outputting operation instructions, and the memory 400 is for storing data.
  • the processor 300 is configured to perform the steps of: receiving a request for displaying a character; searching for a bitmap corresponding to the character to be displayed from the pre-stored character bitmap mapping table; displaying the bitmap according to the predetermined display format in response to the request for displaying the character .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

一种基于QT Embedded系统的字符显示方法和系统,所述字符显示方法包括:接收显示字符的请求(S100);从预存储的字符位图映射表中查找与需要显示的字符对应的位图(S101);按照预定显示格式显示所述位图(S102)。该方法通过建立字符位图映射表,在需要显示字符时查找显示预定显示格式的位图,从而避免了现有技术中需要显示字符时高频率地计算字符的尺寸、字符对齐的影响、字符所在位置布局的影响等情况所占用的系统资源问题,能够节省系统资源,避免影响其他功能,防止系统出现断续及反应慢等现象,改善了用户体验。

Description

基于QT Embedded系统的字符显示方法和系统
【技术领域】
本发明涉及显示技术领域,具体是涉及一种基于QT Embedded系统的字符显示方法,还涉及一种基于QT Embedded系统的字符显示系统。
【背景技术】
现有技术中,Qt Embedded系统是图形化界面开发工具Qt的嵌入式版本系统,即嵌入式图形化界面开发工具系统,其通过Qt API(Application Program Interface,应用程序接口)与Linux I/O接口以及Frame buffer(帧缓冲,标准显示设备驱动接口)直接交互,拥有较高的运行效率,而且整体采用面向对象编程,拥有良好地体系架构和编程模式。
具体而言,QT Embedded系统用于嵌入式硬件架构的常用软件环境,其具有跨平台的优势,相同的代码可以适用于windows、linux等不同操作系统下。
众所周知的是,在数控系统、测试仪器等设备上经常需要用到快速变化的字符显示。譬如机床的轴的坐标信息需要快速在显示屏上显示,且这种坐标信息具有格式不变、字符变化、字符个数变化等特点。而QT Embedded系统使用QLabel(Qt的标签显示类)类进行字符显示,但在频繁刷新变化的时候,QLabel会占用巨大的嵌入式系统处理器的资源。具体来说,对于QLabel类而言,QT Embedded系统在每一次刷新字符显示的时候都需要计算字符的尺寸、字符对齐的影响、字符所在位置布局的影响等情况,而这些计算在高刷新频率下会凸显其资源占用耗费的问题,甚至影响其他操作和显示的功能,用户体验差。
【发明内容】
本发明主要解决现有技术字符刷新显示时占用系统资源甚至影响其他功能的技术问题,提供一种基于QT Embedded系统的字符显示方法和系统,能够节省系统资源,避免影响其他功能并提高用户体验。
为解决上述技术问题,本发明采用的一个技术方案是:提供一种基于QT Embedded系统的字符显示方法,所述字符显示方法包括:接收显示字符的请求;从预存储的字符位图映射表中查找与需要显示的字符对应的位图;按照预定显示格式显示所述位图以响应所述显示字符的请求。
其中,所述按照预定显示格式显示所述位图的步骤,具体包括:调用显示驱动内存Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
其中,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤包括:将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图;所述按照预定显示格式显示所述位图以响应所述显示字符的请求包括:所述副线程调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
其中,所述将所述显示字符的请求发送至QT Embedded系统的副线程包括:将所述显示字符的请求发送至字符显示任务队列;向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
其中,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤之前,还包括:按照预定字符格式制作字符的位图;建立所述字符与所述位图的字符位图映射表并存储所述位图。
其中,所述预定显示格式包括所述字符的大小、字体、颜色和对齐方式,所述字符包括以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符合和特殊符号。
为解决上述技术问题,本发明采用的另一个技术方案是:提供一种基于QT Embedded系统的字符显示系统,所述字符显示系统包括接收模块,查找模块和描绘显示模块:所述接收模块,用于接收显示字符的请求;所述查找模块,用于从预存储的字符位图映射表中查找与需要显示的字符对应的位图;所述描绘显示模块,用于按照预定显示格式显示所述位图以响应所述显示字符的请求。
其中,所述描绘显示模块具体用于调用显示驱动内存帧缓冲Frame buffe对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
其中,所述字符显示系统还包括:发送模块,用于将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图;所述副线程还用于调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
其中,所述发送模块包括:第一发送子模块,用于将所述显示字符的请求发送至字符显示任务队列;第二发送子模块,用于向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
为解决上述技术问题,本发明进一步提供一种基于 QT Embedded系统的字符显示设备,其特征在于,包括:输入设备、输出设备、处理器和存储器,
其中,所述处理器用于执行如下步骤:
接收显示字符的请求;
从预存储的字符位图映射表中查找与需要显示的字符对应的位图;
按照预定显示格式显示所述位图以响应所述显示字符的请求。
其中,所述处理器还具体用于:调用显示驱动内存帧缓冲Frame buffe对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
其中,所述处理器还用于将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图。
其中,所述处理器进一步具体用于调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
其中,所述处理器还具体用于将所述显示字符的请求发送至字符显示任务队列;向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
本发明的有益效果是:区别于现有技术的情况,本发明通过建立字符位图映射表,在接收到显示字符的请求时查找需要显示的字符对应预定显示格式的位图,从而避免了现有技术中需要显示字符时高频率地计算字符的大小、字符对齐的影响、字符所在位置布局的影响等情况所占用的系统资源问题,能够节省系统资源,避免影响其他功能,防止系统出现断续及反应慢等现象,改善了用户体验。
【附图说明】
图1是本发明字符显示方法一实施方式的流程图;
图2是本发明字符显示方法第一具体实施方式的流程图;
图3是本发明字符显示方法第二具体实施方式的流程图;
图4是本发明字符显示系统第一实施方式的流程图;
图5是本发明字符显示系统第二实施方式的流程图;以及
图6是本发明字符显示设备一实施方式的结构组成框图。
【具体实施方式】
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
参阅图1,图1是本发明字符显示方法一实施方式的流程图,本实施方式字符显示方法可以用于面向对象编程的系统中,譬如为基于QT Embedded的系统,具体可以用于数控系统、测试仪器、秒表等显示字符读数的装置上,本实施方式字符显示方法包括但不限于以下步骤。
步骤S100,接收显示字符的请求。
在步骤S100中,QT Embedded系统可以根据用户的具体操作、待显示列表等等方式而被动或主动地产生显示字符的请求。
步骤S101,从预存储的字符位图映射表中查找与字符对应的位图。
在步骤S101之前,本发明可以预先进行设置:按照预定字符格式制作字符的位图,其中每个位图对应于一个字符或者多个字符;接着,建立字符与位图的字符位图映射表并存储位图。而在步骤S101中,接收到显示字符的请求而需要显示字符时,直接根据字符位图映射表查找与字符、需要显示的字符对应的位图。
需要说明的是,本实施方式所述的预定字符格式可以包括字符的大小、字体、颜色、背景,譬如大小为“5号”,字体为“宋体”,颜色为“红色”等等。此外,本实施方式所述的字符具体可以包括以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符合和特殊符号,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。相应地,位图可以为阿拉伯数字、英文字母、汉字、特殊符号和其中的任意组合,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。
举例而言,在数控系统中,对于轴坐标变化的“快速”字符,同一个显示位置的显示方式和字符的格式可以是固定的,即字符的大小、字体、对齐方式等是不变的,且显示的字符种类也是有限的,如数字0~9、大于10的数字、以及小数等,均是0~9的字符的排列组合。因此在数控系统中,要显示的字符是有限的、比较固定的组合。不难看出,本实施方式把这些有限的显示格式预先设置固定,每次刷新显示字符时即可以从至少一个显示格式表中自动/智能/默认选择合适的进行排列组合。同理,对于其他字符,本实施方式作类似处理即可,在本技术领域人员容易结合理解的范围内,不作赘述。
步骤S102,按照预定显示格式显示位图以响应显示字符的请求。
举例来说,预定显示格式可以包括:位图(字符)的对齐方式、缩放比例等内容。
在步骤S102中,本实施方式将查找到的位图按照预定显示格式进行显示,通过“抓取”“描画”的直接方式,将位图赋值描绘到显示屏上,而无需再重新计算字体的大小、对齐和布局等,减少计算过程对系统性能和资源的占用和影响。
值得注意的是,本实施方式可以采用一般的位图描画函数进行描画显示,譬如QT Embedded的位图描画函数等,在此不作限定。
本实施方式使用位图的方式,具体采用位图列表存储映射关系的方式,将有限的字符以预定的字体、大小、背景显示格式等设置存储,而在需要更新显示字符、或刷新画面等时,将字符的字符串拆开成单独独立的、已经存储在位图列表里的图片格式的字符,就可以在显示屏合适的位置摆列描画出来。譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的字符方式。相应地,所描画的位图可以为阿拉伯数字、英文字母、汉字、符号和特殊符号,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。
本发明通过建立字符位图映射表,在需要显示字符时查找并按照预定显示格式显示与需要显示的字符对应的位图,从而避免了现有技术中需要显示字符时高频率地计算字符的大小、字符对齐的影响、字符所在位置布局的影响等情况所占用的系统资源问题,能够节省系统资源,避免影响其他功能,防止系统出现断续及反应慢等现象,有效地提高了用户体验。
需要指出的是,上述实施方式适用于大部分的面向对象编程的系统中,然而对于Qt Embedded系统来说,如果显示时采用QT Embedded的位图描画函数,在每次描画显示时,仍需要计算当前位图和其所在布局的位置影响,这种计算往往会占用大量的系统资源。此外,QT Embedded系统对于描画显示的操作限定在系统的主线程中,即描画位图或者显示字符的操作必须放在和系统其它主要逻辑工作的同一个线程里,如果描画刷新的操作占用过多系统资源,会明显的影响到其它的逻辑操作,比如按键的响应速度会变慢等。
针对上述情况以解决上述技术问题,请参阅图2,图2是本发明字符显示方法第一具体实施方式的流程图,本实施方式字符显示方法包括但不限于以下几个步骤。
步骤S200,接收显示字符的请求。
步骤S201,从预存储的字符位图映射表中查找与需要显示的字符对应的位图。
其中,步骤S201请参阅前面实施方式步骤S101的相关描述,在本技术领域人员理解的范围内,不作赘述。
步骤S202,调用显示驱动内存Frame buffer对显示屏的像素点进行操作,以将位图填充在对应的Frame buffer位置上,进而以预定显示格式在显示屏上显示位图。
在步骤S202中,本实施方式Frame buffer将与需要显示的字符对应的位图按照预定显示格式进行显示,通过“抓取”“描画”的直接方式,将位图赋值描绘到显示屏上,而无需再重新计算字体的大小、对齐和布局等,减少计算过程对系统性能和资源的占用和影响。
本实施方式在需要更新显示字符、或刷新画面等时,通过Frame buffer操作将字符的字符串拆开成单独独立的、已经存储在位图列表里的图片格式的字符,就可以在显示屏合适的位置摆列描画出来。在本实施方式中,所描画的位图可以为以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符号和特殊符号,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。
需要说明的是,本实施方式通过使用Frame buffer操作,可以将描画位图或者显示字符等的操作放在和主线程并列的另一个线程(一般为副线程)里。不难理解的是,在QT Embedded系统中,操作Frame buffer并不属于QT系统本身的功能,因此无需限制于主线程里,进一步而言,当操作Frame buffer放在另一个副线程之后,即使Frame buffer操作占用再多的资源,也不会干扰影响主线程里面的逻辑计算、响应回馈等,因此在很大程度上提高了系统的整体性能。
需要指出的是,在图2所述的实施方式中,由于采用了另一个线程(副线程)执行Frame buffer操作描画显示位图,因此需要保证系统主线程的显示字符的请求与副线程的Frame buffer操作同步,请参阅图3,图3是本发明字符显示方法第二具体实施方式的流程图,本实施方式字符显示方法包括但不限于以下几个步骤。
步骤S300,接收显示字符的请求。
步骤S301,将显示字符的请求发送至QT Embedded系统的副线程,以使副线程从预存储的字符位图映射表中查找与需要显示的字符对应的位图。
在步骤S301中,举例来说,S300中系统检测到需要显示字符时,可以首先产生并记录相应的字符显示请求。譬如当前字符显示为“209.23”,而下一时刻需要显示的字符为“210.55”,此时,系统产生并记录需要显示“210.55”的请求。
接着,在步骤S301中,在记录显示字符的请求后,向QT Embedded系统中的副线程发送有任务的唤醒。
在记录需要显示“210.55”的请求后,同时向副线程发送有所述“显示210.55”的唤醒,以备副线程进行跟进处理。
其中,副线程在被唤醒后,检查显示字符的请求。
当副线程的资源可提供工作服务时,受到唤醒并检查已记录的显示“210.55”的请求。
需要说明的是,步骤S301中如果请求为多个,则将所述显示字符的请求发送至字符显示任务队列;接着,向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
不难看出,通过这种方式,可以记录保存所有显示字符的请求,避免因为双线程繁忙而导致无法响应显示字符的请求甚至漏掉其中一个或多个的显示字符的请求,有效地避免繁忙时无法响应或者漏掉显示字符的请求。
本实施方式可以预先进行设置:按照预定字符格式制作字符的位图;接着,建立字符与位图的字符位图映射表并存储位图。而在需要显示字符时,直接根据字符位图映射表查找与字符对应的位图。
需要说明的是,本实施方式所述的预定字符格式可以包括字符的大小、字体、颜色、背景,譬如大小为“5号”,字体为“宋体”,颜色为“红色”等等。此外,本实施方式所述的字符具体可以包括阿拉伯数字、英文字母、汉字、特殊符号和其中的任意组合,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。相应地,位图可以为阿拉伯数字、英文字母、汉字、特殊符号和其中的任意组合,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。
举例而言,在数控系统中,对于轴坐标变化的“快速”字符,同一个显示位置的显示方式可以是固定的,即字符的大小、字体、对齐方式等是不变的,且显示的字符种类也是有限的,如数字0~9、大于10的数字、以及小数等,均是0~9的字符的排列组合。因此在数控系统中,要显示的字符是有限的、比较固定的组合。不难看出,本实施方式把这些有限的显示格式预先设置固定,每次刷新显示字符时即可以从至少一个显示格式表中自动/智能/默认选择合适的进行排列组合。同理,对于其他字符,本实施方式作类似处理即可,在本技术领域人员容易结合理解的范围内,不作赘述。
步骤S302,副线程调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将位图填充在对应的Frame buffer位置上,进而以预定显示格式在显示屏上显示位图。
在步骤S302中,如前所述,副线程在被唤醒后,检查该字符显示任务队列,并按照先入先出的顺序处理多个显示字符的请求,直到依序将字符显示任务队列中的所有字符的位图都以预定显示格式在显示屏上描画显示。
综上所述,本发明实施方式的字符显示方法将字符映射为固定的位图,使得每次刷新显示时无需频繁地计算字体、大小、对齐等因素,同时,本发明通过Frame buffer操作避开QT Embedded对位图描画时对齐、布局等的计算,此外,本发明可以通过字符显示任务队列和主副线程的配合,提高响应效率并避免显示字符的请求的遗漏。结合上述多个实施方式,本发明可以有效地提高基于QT Embedded环境下的快速的字符显示的效率,同时,本发明能够有效地节省系统资源,避免影响其他功能,防止系统出现断续及反应慢等现象,改善了用户体验。
请参阅图4,图4是本发明字符显示系统第一实施方式的流程图,本实施方式提供一种可以用于面向对象编程,譬如基于QT Embedded的字符显示系统,本实施方式的字符显示系统包括但不限于接收模块40,查找模块41和描绘显示模块42。
接收模块40用于接收显示字符的请求。其中QT Embedded系统可以根据用户的具体操作、待显示列表等等方式而被动或主动地产生显示字符的请求。
在本实施方式中,查找模块41可以用于根据接收模块40接收的显示字符的请求,从预存储的字符位图映射表中查找与需要显示的字符对应的位图,以响应显示字符的请求。
其中,本实施方式可以预先进行设置:按照预定显示格式制作字符的位图;接着,建立字符与位图的字符位图映射表并存储位图。通过这种方式,查找模块41,在需要显示字符时,直接根据字符位图映射表查找与需要显示的字符对应的位图。
需要说明的是,本实施方式所述的预定显示格式可以包括字符的大小、字体、颜色、背景,譬如大小为“5号”,字体为“宋体”,颜色为“红色”等等。此外,本实施方式所述的字符具体可以包括阿拉伯数字、英文字母、汉字、特殊符号和其中的任意组合,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。相应地,位图可以为阿拉伯数字、英文字母、汉字、特殊符号和其中的任意组合,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。
举例而言,在数控系统中,对于轴坐标变化的“快速”字符,同一个显示位置的显示方式可以是固定的,即字符的大小、字体、对齐方式等是不变的,且显示的字符种类也是有限的,如数字0~9、大于10的数字、以及小数等,均是0~9的字符的排列组合。因此在数控系统中,要显示的字符是有限的、比较固定的组合。不难看出,本实施方式把这些有限的显示格式预先设置固定,每次刷新显示字符时即可以从至少一个显示格式表中自动/智能/默认选择合适的进行排列组合。同理,对于其他字符,本实施方式作类似处理即可,在本技术领域人员容易结合理解的范围内,不作赘述。
描绘显示模块42可以用于按照预定显示格式显示位图以响应显示字符的请求。本实施方式描绘显示模块42根据查找到的位图的预定显示格式进行显示,譬如通过“抓取”“描画”的直接方式,将位图赋值描绘到显示屏上,而无需再重新计算字体的大小、对齐和布局等,减少计算过程对系统性能和资源的占用和影响。
本实施方式使用位图的方式,具体采用位图列表存储映射关系的方式,将有限的字符以预定的字体、大小、背景显示格式等设置存储,而在需要更新显示字符、或刷新画面等时,将字符的字符串拆开成单独独立的、已经存储在位图列表里的图片格式的字符,就可以在显示屏合适的位置摆列描画出来。譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的字符方式。相应地,所描画的位图可以为阿拉伯数字、英文字母、汉字、特殊符号和其中的任意组合,譬如“1、2、3、a、b、c、d、正常、异常、δ、△、a1、1正常、δ2a”等类似的单个或组合的方式。
本发明通过建立字符位图映射表,在需要显示字符时查找显示预定显示格式的位图,从而避免了现有技术中需要显示字符时高频率地计算字符的大小、字符对齐的影响、字符所在位置布局的影响等情况所占用的系统资源问题,能够节省系统资源,避免影响其他功能,防止系统出现断续及反应慢等现象,有效地提高了用户体验。
请参阅图5,图5是本发明字符显示系统第二实施方式的流程图,本实施方式字符显示系统包括但不限于接收模块40、发送模块50、查找模块41、描绘显示模块42和显示屏43等。
需要说明的是,本实施方式字符显示系统可以为嵌入式图形化界面开发工具QT Embedded系统。
接收模块40用于接收显示字符的请求。其中QT Embedded系统可以根据用户的具体操作、待显示列表等等方式而被动或主动地产生显示字符的请求。
在本实施方式中,发送模块50可以用于将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图;接着,副线程还用于调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将位图填充在对应的Frame buffer位置上,进而以预定显示格式在显示屏43上显示所述位图。
优选的,字符显示任务队列可以为多个并按时间先后顺序记录到字符显示任务队列中,发送模块50具体可以包括:第一发送子模块,用于将显示字符的请求发送至字符显示任务队列;第二发送子模块,用于向副线程发送有任务的唤醒,以使副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。本实施方式通过主、副线程以及字符显示任务队列的方式,可以有效地保证系统主线程的显示字符的请求与副线程的Frame buffer操作同步。
描绘显示模块42具体用于调用显示驱动内存帧缓冲Frame buffe对显示屏43的像素点进行操作,以将位图填充在对应的Frame buffer位置上,进而以预定显示格式在显示屏43上显示位图。
不难理解的是,本实施方式通过使用Frame buffer操作,可以将描画位图或者显示字符等的操作放在和主线程并列的另一个线程(一般为副线程)里进行执行。不难理解的是,在QT Embedded系统中,操作Frame buffer并不属于QT系统本身的功能,因此无需限制于主线程里,进一步而言,当操作Frame buffer放在另一个副线程之后,即使Frame buffer操作占用再多的资源,也不会干扰影响主线程里面的逻辑计算、响应回馈等,因此在很大程度上提高了系统的整体性能。
此外,本实施方式字符显示系统的具体实现方式可以参阅前面实施方式字符显示方法的相关描述,在本技术领域人员容易结合理解的范围内,不再赘述。
本发明实施方式的字符显示系统将字符映射为固定的位图,使得每次刷新显示时无需频繁地计算字体、大小、对齐等,同时,本发明通过Frame buffer操作避开QT Embedded对位图描画时对齐、布局等的计算,此外,本发明可以通过字符显示任务队列和主副线程的配合,提高响应效率并避免显示字符的请求的遗漏。结合上述多个实施方式,本发明可以有效地提高基于QT Embedded环境下的快速字符显示的效率,同时,本发明能够有效地节省系统资源,避免影响其他功能,防止系统出现断续及反应慢等现象,改善了用户体验。
进一步地,本发明实施例还提供一种基于 QT Embedded系统的字符显示设备,请参阅图6,图6是本发明字符显示设备一实施方式的结构组成框图。该字符显示设备包括输入设备100、输出设备200、处理器300和存储器400等,其中,输入、输出设备(100、200)用于进行操作指令的写入和输出,存储器400用于存储数据。
处理器300则用于执行如下步骤:接收显示字符的请求;从预存储的字符位图映射表中查找与需要显示的字符对应的位图;按照预定显示格式显示位图以响应显示字符的请求。而关于各步骤的详细介绍,请参阅上述字符显示方法实施例中的相关描述,此处不再赘述。
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (23)

  1. 一种基于QT Embedded系统的字符显示方法,其特征在于,所述字符显示方法包括:
    接收显示字符的请求;
    从预存储的字符位图映射表中查找与需要显示的字符对应的位图;
    按照预定显示格式显示所述位图以响应所述显示字符的请求。
  2. 根据权利要求1所述的字符显示方法,其特征在于,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤之前,还包括:
    按照预定字符格式制作字符的位图;
    建立所述字符与所述位图的字符位图映射表并存储所述位图。
  3. 根据权利要求2所述的字符显示方法,其特征在于,所述预定字符格式包括所述字符的大小、字体、颜色,所述字符包括以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符号和特殊符号。
  4. 根据权利要求1所述的字符显示方法,其特征在于,所述按照预定显示格式显示所述位图的步骤,具体包括:
    调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
  5. 根据权利要求4所述的字符显示方法,其特征在于,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤之前,还包括:
    按照预定字符格式制作字符的位图;
    建立所述字符与所述位图的字符位图映射表并存储所述位图。
  6. 根据权利要求5所述的字符显示方法,其特征在于,所述预定字符格式包括所述字符的大小、字体、颜色,所述字符包括以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符号和特殊符号。
  7. 根据权利要求4所述的字符显示方法,其特征在于,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤包括:
    将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图。
  8. 根据权利要求7所述的字符显示方法,其特征在于,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤之前,还包括:
    按照预定字符格式制作字符的位图;
    建立所述字符与所述位图的字符位图映射表并存储所述位图。
  9. 根据权利要求8所述的字符显示方法,其特征在于,所述预定字符格式包括所述字符的大小、字体、颜色,所述字符包括以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符号和特殊符号。
  10. 根据权利要求7所述的字符显示方法,其特征在于,所述按照预定显示格式显示所述位图以响应所述显示字符的请求包括:
    所述副线程调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
  11. 根据权利要求10所述的字符显示方法,其特征在于,所述将所述显示字符的请求发送至QT Embedded系统的副线程包括:
    将所述显示字符的请求发送至字符显示任务队列;
    向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
  12. 根据权利要求10所述的字符显示方法,其特征在于,所述从预存储的字符位图映射表中查找与需要显示的字符对应的位图的步骤之前,还包括:
    按照预定字符格式制作字符的位图;
    建立所述字符与所述位图的字符位图映射表并存储所述位图。
  13. 根据权利要求12所述的字符显示方法,其特征在于,所述预定字符格式包括所述字符的大小、字体、颜色,所述字符包括以下类型的字符中的至少一种:阿拉伯数字、英文字母、汉字、符号和特殊符号。
  14. 一种基于QT Embedded系统的字符显示系统,其特征在于,所述字符显示系统包括:
    接收模块,用于接收显示字符的请求;
    查找模块,用于从预存储的字符位图映射表中查找与需要显示的字符对应的位图;
    描绘显示模块,用于按照预定显示格式显示所述位图以响应所述显示字符的请求。
  15. 根据权利要求14所述的字符显示系统,其特征在于,所述描绘显示模块具体用于调用显示驱动内存帧缓冲Frame buffe对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
  16. 根据权利要求15所述的字符显示系统,其特征在于,所述字符显示系统还包括:
    发送模块,用于将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图。
  17. 根据权利要求16所述的字符显示系统,其特征在于,所述副线程还用于调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
  18. 根据权利要求17所述的字符显示系统,其特征在于,
    所述发送模块包括:
    第一发送子模块,用于将所述显示字符的请求发送至字符显示任务队列;
    第二发送子模块,用于向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
  19. 一种基于QT Embedded系统的字符显示设备,其特征在于,包括:输入设备、输出设备、处理器和存储器,
    其中,所述处理器用于执行如下步骤:
    接收显示字符的请求;
    从预存储的字符位图映射表中查找与需要显示的字符对应的位图;
    按照预定显示格式显示所述位图以响应所述显示字符的请求。
  20. 根据权利要求19所述的字符显示设备,其特征在于,所述处理器还具体用于:调用显示驱动内存帧缓冲Frame buffe对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
  21. 根据权利要求20所述的字符显示设备,其特征在于,所述处理器还用于将所述显示字符的请求发送至QT Embedded系统的副线程,以使所述副线程从预存储的字符位图映射表中查找与所述字符对应的位图。
  22. 根据权利要求21所述的字符显示设备,其特征在于,所述处理器进一步具体用于调用显示驱动内存帧缓冲Frame buffer对显示屏的像素点进行操作,以将所述位图填充在对应的Frame buffer位置上,进而以所述预定显示格式在所述显示屏上显示所述位图。
  23. 根据权利要求22所述的字符显示设备,其特征在于,所述处理器还具体用于将所述显示字符的请求发送至字符显示任务队列;向所述副线程发送有任务的唤醒,以使所述副线程检查所述字符显示任务队列,并按照先入先出的顺序执行所述字符显示任务队列中的请求。
PCT/CN2015/086103 2014-08-07 2015-08-05 基于QT Embedded系统的字符显示方法和系统 WO2016019861A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410386727.8 2014-08-07
CN201410386727.8A CN104199628B (zh) 2014-08-07 2014-08-07 基于QT Embedded系统的字符显示方法和系统

Publications (1)

Publication Number Publication Date
WO2016019861A1 true WO2016019861A1 (zh) 2016-02-11

Family

ID=52084926

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086103 WO2016019861A1 (zh) 2014-08-07 2015-08-05 基于QT Embedded系统的字符显示方法和系统

Country Status (2)

Country Link
CN (1) CN104199628B (zh)
WO (1) WO2016019861A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199628B (zh) * 2014-08-07 2019-08-27 北京配天技术有限公司 基于QT Embedded系统的字符显示方法和系统
CN105957136B (zh) * 2016-04-19 2019-05-07 广州视源电子科技股份有限公司 艺术字效果绘制方法及其系统
CN108196848B (zh) * 2018-01-08 2021-04-27 武汉斗鱼网络科技有限公司 界面嵌入显示方法、装置、用户终端及可读存储介质
CN109240628A (zh) * 2018-08-05 2019-01-18 深圳市技达信息技术有限公司 计算字符、字符串等的显示宽高的方法、装置及计算机可读存储介质
CN112198786B (zh) * 2020-04-27 2021-10-29 昇显微电子(苏州)有限公司 一种数字时钟的实现方法和装置
CN113183759A (zh) * 2021-07-01 2021-07-30 智道网联科技(北京)有限公司 一种仪表盘字符的显示方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5801720A (en) * 1996-02-20 1998-09-01 National Semiconductor Corporation Data transfer from a graphics subsystem to system memory
CN101833936A (zh) * 2009-12-22 2010-09-15 康佳集团股份有限公司 一种移动终端及其界面的显示方法和装置
CN103678261A (zh) * 2013-12-26 2014-03-26 深圳市开立科技有限公司 一种快速显示ttf字体的方法、装置及设备
CN104199628A (zh) * 2014-08-07 2014-12-10 北京配天技术有限公司 基于QT Embedded系统的字符显示方法和系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271389B (zh) * 2008-04-08 2010-06-02 江苏科技大学 嵌入式藏文智能信息处理方法
CN102662612B (zh) * 2012-02-29 2014-12-10 浪潮(北京)电子信息产业有限公司 使用Qt库显示MRC格式的图片文件的方法和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5801720A (en) * 1996-02-20 1998-09-01 National Semiconductor Corporation Data transfer from a graphics subsystem to system memory
CN101833936A (zh) * 2009-12-22 2010-09-15 康佳集团股份有限公司 一种移动终端及其界面的显示方法和装置
CN103678261A (zh) * 2013-12-26 2014-03-26 深圳市开立科技有限公司 一种快速显示ttf字体的方法、装置及设备
CN104199628A (zh) * 2014-08-07 2014-12-10 北京配天技术有限公司 基于QT Embedded系统的字符显示方法和系统

Also Published As

Publication number Publication date
CN104199628A (zh) 2014-12-10
CN104199628B (zh) 2019-08-27

Similar Documents

Publication Publication Date Title
WO2016019861A1 (zh) 基于QT Embedded系统的字符显示方法和系统
US5943064A (en) Apparatus for processing multiple types of graphics data for display
WO2019035619A1 (en) METHOD FOR DISPLAYING CONTENT AND ASSOCIATED ELECTRONIC DEVICE
US20140111528A1 (en) Server-Based Fast Remote Display on Client Devices
WO2014014282A1 (en) Method and apparatus for data processing using graphic processing unit
WO2015108300A1 (ko) 프레임률 제어 방법 및 그 전자 장치
WO2016085275A1 (en) Method of displaying low frequency screen and an electronic device for performing same
WO2015102458A1 (en) Image data output control method and electronic device supporting the same
WO2017133264A1 (zh) 一种调度指令的检测方法和终端
WO2015169119A1 (zh) 电子设备的通知消息的同步方法及服务器、电子设备
WO2016054976A1 (zh) 基于QT embedded的同步显示方法、系统及数控机床
WO2018094839A1 (zh) 一种移动终端预装应用的安装方法及装置
WO2018139878A1 (en) Method and electronic device for managing operations and functionality of applications
WO2016176888A1 (zh) 液晶显示面板的驱动方法
WO2018113529A1 (zh) 一种快速查看通知的方法及移动设备
WO2012163216A1 (zh) 一种针对java程序的移动终端输入控制方法和装置
WO2013122441A1 (en) Method and apparatus for outputting content in portable terminal supporting secure execution environment
CN110750966A (zh) 一种批注的处理方法、装置、设备及存储介质
WO2017018719A1 (ko) 보안 네트워크 시스템 및 그 데이터 처리 방법
WO2009107954A2 (ko) 그래픽 가속기 및 그래픽 가속 방법
WO2015108282A1 (ko) 전자 장치의 광고 방법 및 그 전자 장치
WO2019000962A1 (zh) 收益计算方法、装置及计算机可读存储介质
WO2017050098A1 (zh) 一种短信处理方法及用户终端
WO2020143306A9 (zh) 对象互转方法、装置及存储介质、服务器
WO2013133528A1 (en) Client apparatus, client control method, server and image providing method using the server

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15829613

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 18/05/2017)

122 Ep: pct application non-entry in european phase

Ref document number: 15829613

Country of ref document: EP

Kind code of ref document: A1