Analog method, device, equipment and medium of a thermal printer core

By simulating the heating head and stepper motor of a thermal printer using a display module, the problem that thermal printer software debugging can only be performed after the hardware is completed is solved, realizing software debugging in a hardware-free environment, thus improving development efficiency and security.

CN116852870BActive Publication Date: 2026-01-13FUJIAN CENTM INFORMATION
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310806123.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-03
Publication Date
2026-01-13
Estimated Expiration
2043-07-03

AI Technical Summary

Technical Problem

In existing technologies, thermal printer software debugging can only be performed after the hardware is completed. Debugging is difficult and carries the risk of hardware damage, making it impossible to debug in an environment without hardware.

Method used

The display module simulates the heating head and stepper motor of a thermal printer, establishes the correspondence between heating time and grayscale or color, realizes the simulation of the thermal printer core, and performs software debugging.

Benefits of technology

It enables software debugging without the need for actual thermal printer hardware, avoiding the risk of hardware damage and improving development efficiency and debugging convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116852870B_ABST
    Figure CN116852870B_ABST
Patent Text Reader

Abstract

The application discloses a simulation method, device and equipment of a thermal printer core and a medium, and relates to the technical field of thermal printing.The method comprises the following steps: simulating a dot of a thermal printer heating head through a pixel of a display module; establishing a corresponding relationship between a heating time of the thermal printer heating head and a display gray scale or color; displaying the pixel simulating a current heating dot as a corresponding gray scale or color according to the cumulative heating time of the current heating dot; setting a current heating dot line; when a line change is needed, scrolling the printed data by one dot line in a specified direction according to a stepping rule and a printing progress; continuously displaying a gray scale or color and stepping according to heating data and a stepping time to simulate the heating of the thermal printer heating head until the printing content is completed or a stop instruction is received.The application simulates the thermal printer core by displaying a gray scale or color and stepping, so that software debugging can be performed without providing a thermal printer hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of thermal printing technology, and in particular to a method, apparatus, device, and medium for simulating a thermal printer core. Background Technology

[0002] Thermal printing functionality, whether built into a product or developed as a standalone printer, requires software debugging, which can only be performed on products with the actual hardware configured. This development model has the following disadvantages:

[0003] 1) Long product development cycle

[0004] Software debugging can only be initiated after the product hardware development is completed.

[0005] 2) High debugging difficulty

[0006] Simulation and debugging of embedded products are mainly performed by setting breakpoints and single-step execution. If a thermal printer is interrupted during operation, the heating action will not be interrupted synchronously. Depending on the length of the interruption, the thermal paper may be burned through, or the printer may be completely destroyed. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to provide a method, apparatus, device and medium for simulating a thermal printer cartridge, which simulates the thermal printer cartridge by displaying grayscale or color through a display module and stepping through the display, thereby realizing software debugging without providing thermal printer hardware.

[0008] In a first aspect, the present invention provides a method for simulating a thermal printer core, comprising:

[0009] The display module simulates the points of the thermal printer's heating head using pixels, with one heating point corresponding to one or more pixels; it establishes a correspondence between the heating time of the thermal printer's heating head and the displayed grayscale or color; and it displays the pixel simulating the current heating point as the corresponding grayscale or color based on the cumulative heating time of the current heating point.

[0010] Set the current heated row; based on the stepping rules and printing progress, when a line break is needed, scroll the printed data one row in the specified direction, and the empty row after scrolling is the current heated row; continuously display grayscale or color according to the heating data and stepping time and step to simulate the heating of the thermal printer's heating head until the printing content is completed or a stop command is received.

[0011] Furthermore, establishing the correspondence between the heating time of the thermal printer's heating head and the displayed grayscale specifically includes:

[0012] The display grayscale corresponding to each printing grayscale level is determined based on the number of grayscale levels supported by the thermal printer to be simulated. The grayscale value is calculated based on the cumulative heating time of the heating point.

[0013] Furthermore, the display grayscale value range is 0 to 255, and the grayscale values ​​for each level are calculated as follows:

[0014] Assuming the thermal printer supports 2 levels of grayscale, a grayscale value of 0 will be displayed as white, and a grayscale value other than 0 will be displayed as black.

[0015] Assume the thermal printer supports n gray levels, where n > 2, and each gray level has a printing gray level P. m They are P0 to P1 respectively. n-1 ;

[0016] The fluctuation range for each gray level is: D r = 256 ÷ (n-1) ÷ 2; where D r It can be rounded down or up;

[0017] Printed grayscale P0 corresponds to displayed grayscale D0:

[0018] When m is 0, the grayscale D0 is 0.

[0019] When m = [1, n-1], the grayscale value displayed for each level is: D m = (m×2-1)×Dr.

[0020] Furthermore, the grayscale granularity of the display is calculated based on the thermal printer's temperature compensation rules and grayscale levels, and then the display grayscale is adjusted according to the temperature value and the grayscale granularity of the display.

[0021] Furthermore, the calculation shows that the granularity of grayscale changes specifically includes:

[0022] Let the temperature compensation level be P. t The grayscale variation granularity is displayed as D. t ,

[0023] D t =[(D r -1)÷P t ]

[0024] Among them, D r P represents the floating range for each gray level. t It is calculated based on the processing range of thermal printer temperature compensation and the processing accuracy of temperature changes.

[0025] Furthermore, when the width of the display resolution is smaller than the number of dots on the printer's heating head, or when the number of printed dot lines exceeds the height of the display module's resolution, the display area can be moved using the display controls to view the complete printed content.

[0026] Furthermore, heating data and step time are saved after printing is complete or a stop command is received, so that the printing process can be replayed in the display control according to user operations.

[0027] Secondly, the present invention provides a simulation device for a thermal printer core, comprising:

[0028] The heating head simulation module is used to simulate the points of the thermal printer heating head through the pixels of the display module. One heating point corresponds to one or more pixels. It establishes the correspondence between the heating time of the thermal printer heating head and the displayed grayscale or color. Based on the cumulative heating time of the current heating point, it displays the pixel of the simulated current heating point as the corresponding grayscale or color.

[0029] The stepper motor simulation module is used to set the current heating line; according to the stepping rules and printing progress, when a line break is needed, it scrolls the printed data one line in the specified direction, and the empty line after scrolling is the current heating line; it continuously displays grayscale or color according to the heating data and stepping time and steps to simulate the heating of the thermal printer heating head until the printing content is completed or a stop command is received.

[0030] Thirdly, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The electronic device further includes a display module, or an external display module, wherein the processor executes the program to implement the method described in the first aspect.

[0031] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0032] The technical solutions provided in the embodiments of the present invention have at least the following technical effects:

[0033] The display module shows grayscale or color and steps to simulate the thermal printer core, enabling debugging on products without an actual thermal printer. It allows for interruption or step-by-step debugging at any time as needed, avoiding the risk of burning through the thermal paper or even damaging the thermal printer when debugging is interrupted on products with real hardware.

[0034] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0035] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0036] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention;

[0037] Figure 2 This is a schematic diagram of the modification of the thermal printer driver in Embodiment 1 of the present invention;

[0038] Figure 3 This is a schematic diagram of the device in Embodiment 2 of the present invention;

[0039] Figure 4 This is a schematic diagram of the electronic device in Embodiment 3 of the present invention;

[0040] Figure 5 This is a schematic diagram of the structure of the medium in Embodiment 4 of the present invention. Detailed Implementation

[0041] This invention provides a method, apparatus, device, and medium for simulating a thermal printer cartridge. By displaying grayscale or color through a display module and stepping through the colors, the thermal printer cartridge is simulated, enabling software debugging without providing the thermal printer hardware.

[0042] The overall concept of the technical solutions in the embodiments of the present invention is as follows:

[0043] Thermal printers primarily output results using thermal paper, and the main components driving the paper are a stepper motor and a heating element. Therefore, the core principle is to simulate the actual output effect of a thermal printer by mimicking the stepper motor and heating element.

[0044] This invention employs a display module to simulate a thermal printer. The display module is not limited to a liquid crystal display in an embedded product, or a window in a computer monitor.

[0045] 1) Use the pixels of the display module to simulate the dots of the heating head of a thermal printer.

[0046] One pixel corresponds to one heating point. That is, the entire display area of ​​the display module corresponds to the thermal printing paper, with the bottom row of pixels in the designated display area corresponding to the line of dots being printed by the thermal printer. Designating the bottom row conforms to the common printing method of current printers, but the line of dots being printed can also be set in other positions according to actual printing needs. This embodiment uses one display pixel to correspond to one heating point. If multiple display pixels were used to correspond to one heating point, the effect would be equivalent to magnifying the content displayed on the printing paper.

[0047] The printer's heating head has a total of 384 dots. In the latch register, dots with a value of 0 will not be heated, while dots with a value of 1 will be heated. The longer the heating time, the darker the dots will appear on the thermal paper.

[0048] The grayscale of the pixels in the display module perfectly simulates the heating time of a thermal printer. That is, for a point where the received data is 0, the corresponding pixel appears white; for a point where the received data is 1, the longer the heating time, the higher the grayscale of the corresponding pixel.

[0049] 2) Use the display module to scroll upwards point by point to simulate the stepper motor driving the thermal paper output of a thermal printer.

[0050] Thermal printer stepper motors have two drive modes: 1-2 phase and 2-2 phase. 1-2 phase is 4 steps per dot line; 2-2 phase is 2 steps per dot line. Taking 1-2 phase drive as an example, for every 4 steps the thermal printer advances, the content displayed in the display module scrolls up one pixel line. If the currently printed dot line is positioned differently, such as the rightmost vertical line, the scrolling direction can be to the left.

[0051] Example 1

[0052] This embodiment provides a method for simulating a thermal printer cartridge, such as... Figure 1 As shown, including;

[0053] The display module simulates the points of the thermal printer's heating head using pixels, with one heating point corresponding to one or more pixels; it establishes a correspondence between the heating time of the thermal printer's heating head and the displayed grayscale or color; and it displays the pixel of the current heating point as the corresponding grayscale or color based on the cumulative heating time of the current heating point.

[0054] Set the current heated row; based on the stepping rules and printing progress, when a line break is needed, scroll the printed data one row in the specified direction, and the empty row after scrolling is the current heated row; continuously display grayscale or color according to the heating data and stepping time and step to simulate the heating of the thermal printer's heating head until the printing content is completed or a stop command is received.

[0055] When one heating point corresponds to one pixel, the number of pixels in a pixel row is consistent with the number of heating points, which is 384. The initial grayscale value of a pixel row is 0, and the corresponding grayscale value is set according to the heating time. Since the same heating point may be heated multiple times, the grayscale value must be calculated based on the cumulative heating time of the heating point. Taking a stepper motor in a 1-2 phase driven thermal printer as an example, the display area scrolls up one pixel row for every 4 steps of the motor. The stepping speed of the motor corresponds to the upward scrolling speed of the display, and the scrolling display can realistically simulate the paper feeding effect.

[0056] This embodiment's method allows for software debugging on products without an actual thermal printer, and also enables interruption or step-by-step debugging as needed. However, on products with actual hardware, interrupting printing risks burning through the thermal paper or even damaging the thermal printer. Due to the structural limitations of thermal printers, there is a significant distance between the heating head and the paper cutter. The printed result cannot be seen on the paper in real time. To view the complete print result, an extra blank section needs to be printed or the paper needs to be manually pulled out. By using a display simulation, the current print result can be viewed in real time. When simulating the thermal printer core for software debugging, the software and hardware can proceed independently, improving product development efficiency. Hardware issues are inevitable during development. With this embodiment's method, hardware problems will not interfere with software development; and during joint software and hardware debugging, it is easy to distinguish between software and hardware problems.

[0057] In one possible implementation, grayscale is used to simulate the heating of the thermal printer's heating head, achieving an effect consistent with the appearance of the printed paper. If other shades of color are used to simulate the duration of heating, those skilled in the art can make adaptive modifications based on the ideas of this invention.

[0058] This embodiment establishes the correspondence between the heating time of the thermal printer's heating head and the displayed grayscale, specifically including:

[0059] The display grayscale corresponding to each printing grayscale level is determined based on the number of grayscale levels supported by the thermal printer to be simulated. The grayscale value is calculated based on the cumulative heating time of the heating point.

[0060] For example, the range of grayscale values ​​is 0 to 255, and the calculation of each grayscale value is as follows:

[0061] Assuming the thermal printer supports 2 levels of grayscale, a grayscale value of 0 will be displayed as white, and a grayscale value other than 0 will be displayed as black.

[0062] Assume the thermal printer supports n gray levels, where n > 2, and each gray level has a printing gray level P. m They are P0 to P1 respectively. n-1 ;

[0063] The fluctuation range for each gray level is: D r = 256 ÷ (n-1) ÷ 2; where D r It can be rounded down or up;

[0064] Printed grayscale P0 corresponds to displayed grayscale D0:

[0065] When m is 0, the grayscale D0 is 0.

[0066] When m = [1, n-1], the grayscale value displayed for each level is: D m = (m×2-1)×Dr.

[0067] Taking 4 levels of grayscale printing as an example, the fluctuation range D of each grayscale level is... r =42, the display grayscale corresponding to each level of printing grayscale is:

[0068] <![CDATA[Print Grayscale (P m )]]> <![CDATA[Display gray scale (D m )]]> 0 0 1 42 2 126 3 210

[0069] When a printer first starts running, the temperature is relatively low. As the printing time increases, the temperature rises. To achieve the same grayscale level, a longer heating time is required at a lower temperature, and a shorter heating time is required at a higher temperature. Some printers incorporate temperature compensation, automatically adjusting the heating time based on the current printing temperature to maintain consistency in grayscale levels across different temperatures. In one possible implementation, to visually demonstrate the temperature compensation in a simulation, the heating time fluctuation range can be mapped to the grayscale fluctuation range.

[0070] The grayscale granularity of the display is calculated based on the thermal printer's temperature compensation rules and grayscale levels, and then the display grayscale is adjusted according to the temperature value and the grayscale granularity of the display.

[0071] The calculation and display of grayscale change granularity specifically includes:

[0072] Let the temperature compensation level be P. t The grayscale variation granularity is displayed as D. t ,

[0073] D t =[(D r -1)÷P t ]

[0074] Among them, D r P represents the floating range for each gray level. t It is calculated based on the processing range of thermal printer temperature compensation and the processing accuracy of temperature changes.

[0075] For example, if the room temperature is set to 25℃, the temperature compensation processing range is (-15℃~65℃), and the temperature change processing precision is 5℃, then the compensation granularity range is (-7~7), meaning the temperature compensation level Pt=7. Taking 4 levels of grayscale printing as an example, the grayscale fluctuation range for each level is Dr=42. That is, for every 5℃ change in temperature, the displayed grayscale changes by 5. The calculation method is (42-1)÷7, rounded down to the nearest integer, which is 5.

[0076] Due to the limitations of LCD screen resolution, a single screen may not be able to display all the content. Therefore, display controls are needed to show the content. In one possible implementation, when the width of the display resolution is smaller than the number of dots on the printer's heating head, or when the number of printed dots exceeds the height of the display module's resolution, the display area can be moved using display controls to view the complete printed content (for example, the display area can be moved up, down, left, and right using buttons to view the complete printed content).

[0077] In one possible implementation, heating data and step time are saved after printing is complete or a stop command is received, so that the printing process can be replayed in the display control based on user actions. By saving the dot matrix data and step time, the software can replay the entire printing process on the display module at any time.

[0078] The method in this embodiment can be applied to electronic devices equipped with liquid crystal displays, and can be implemented by modifying the thermal printer driver.

[0079] like Figure 2 As shown, the thermal printer driver is divided into two layers: a hardware adaptation layer and a functional logic layer. The hardware adaptation layer directly interfaces with the thermal printer core. A simulation interface layer is inserted between the hardware adaptation layer and the thermal printer core. This interface layer takes over the hardware operation interface of the hardware adaptation layer, translating actions into operations on the LCD screen to achieve the simulation purpose. In other words, the goal of this simulation scheme is to achieve simulation debugging with minimal modification to the original thermal printer driver. After successful simulation debugging, it can be used directly with a real device.

[0080] Alternatively, the device with the software to be debugged can be directly connected to a PC, and a display control can be developed on the PC to simulate printing the cartridge. The specific implementation method is the same as above, but the advantage is that the product does not need to be equipped with an LCD monitor for simulation debugging, and the display effect is better.

[0081] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2.

[0082] Example 2

[0083] This embodiment provides a simulation device for a thermal printer core, such as... Figure 3 As shown, it includes:

[0084] The heating head simulation module is used to simulate the points of the thermal printer heating head through the pixels of the display module. One heating point corresponds to one or more pixels. It establishes the correspondence between the heating time of the thermal printer heating head and the displayed grayscale or color. Based on the cumulative heating time of the current heating point, it displays the pixel of the simulated current heating point as the corresponding grayscale or color.

[0085] The stepper motor simulation module is used to set the current heating line; according to the stepping rules and printing progress, when a line break is needed, it scrolls the printed data one line in the specified direction, and the empty line after scrolling is the current heating line; it continuously displays grayscale or color according to the heating data and stepping time and steps to simulate the heating of the thermal printer heating head until the printing content is completed or a stop command is received.

[0086] Since the apparatus described in Embodiment 2 of the present invention is an apparatus used to implement the method of Embodiment 1 of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in Embodiment 1 of the present invention, and therefore will not be described again here. All apparatuses used in the method of Embodiment 1 of the present invention fall within the scope of protection of the present invention.

[0087] Based on the same inventive concept, this application provides an electronic device embodiment corresponding to Embodiment 1, as detailed in Embodiment 3.

[0088] Example 3

[0089] This embodiment provides an electronic device, such as... Figure 4 As shown, the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The electronic device also includes a display module, or an external display module. When the processor executes the computer program, it can implement any of the embodiments in Example 1.

[0090] Since the electronic device described in this embodiment is the device used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how the electronic device implements the method in the embodiment of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiment of this application falls within the scope of protection of this application.

[0091] Based on the same inventive concept, this application provides a storage medium corresponding to Embodiment 1, as detailed in Embodiment 4.

[0092] Example 4

[0093] This embodiment provides a computer-readable storage medium, such as... Figure 5 As shown, a computer program is stored thereon, which, when executed by a processor, can implement any of the embodiments in Example 1.

[0094] Since the computer-readable storage medium described in this embodiment is the same computer-readable storage medium used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation methods and various variations of the computer-readable storage medium in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how this computer-readable storage medium implements the method in the embodiments of this application will not be described in detail here. Any computer-readable storage medium used by those skilled in the art to implement the method in the embodiments of this application falls within the scope of protection of this application.

[0095] This invention simulates a thermal printer core by displaying grayscale or color and stepping through a display module. This allows for debugging on products without an actual thermal printer. The debugging can be interrupted or performed step by step as needed, avoiding the risk of burning through the thermal paper or even damaging the thermal printer when debugging is interrupted on products with actual hardware.

[0096] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0099] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0100] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for simulating a thermal printer cartridge, characterized in that, include: The display module simulates the points of the thermal printer's heating head using pixels, with one heating point corresponding to one or more pixels; it establishes a correspondence between the heating time of the thermal printer's heating head and the displayed grayscale or color; and it displays the pixel simulating the current heating point as the corresponding grayscale or color based on the cumulative heating time of the current heating point. Set the current heated row; according to the stepping rules and printing progress, when a line break is needed, scroll the printed data one row in the specified direction, and the empty row after scrolling is the current heated row; continuously display grayscale or color according to the heating data and stepping time and step to simulate the heating of the thermal printer heating head until the printing content is completed or a stop command is received; The simulation method is executed in an environment without thermal printer hardware and is used for software debugging and real-time preview of printing results.

2. The method according to claim 1, characterized in that: The establishment of the correspondence between the heating time of the thermal printer's heating head and the displayed grayscale specifically includes: The display grayscale corresponding to each printing grayscale level is determined based on the number of grayscale levels supported by the thermal printer to be simulated. The grayscale value is calculated based on the cumulative heating time of the heating point.

3. The method according to claim 2, characterized in that: The display grayscale value range is 0~255, and the grayscale values ​​for each level are calculated as follows: Assuming the thermal printer supports 2 levels of grayscale, a grayscale value of 0 will be displayed as white, and a grayscale value other than 0 will be displayed as black. Assume the thermal printer supports n levels of grayscale, and n>2, with each level of grayscale Pm being P0~Pn-1; The fluctuation range for each gray level is: Dr = 256÷(n-1)÷2; where Dr is rounded down or up. Printed grayscale P0 corresponds to displayed grayscale D0: When m is 0, the grayscale D0 is 0. When m=[1, n-1], the gray level displayed for each level is: Dm = (m×2-1)×Dr.

4. The method according to claim 2 or 3, characterized in that: The grayscale granularity of the display is calculated based on the thermal printer's temperature compensation rules and grayscale levels, and then the display grayscale is adjusted according to the temperature value and the grayscale granularity of the display.

5. The method according to claim 4, characterized in that: The calculation and display of grayscale change granularity specifically includes: Let the temperature compensation level be P. t The grayscale variation granularity is displayed as D. t , D t =[(D r -1)÷P t ] Among them, D r P represents the floating range for each gray level. t It is calculated based on the processing range of thermal printer temperature compensation and the processing accuracy of temperature changes.

6. The method according to claim 1, characterized in that: When the width of the monitor resolution is smaller than the number of dots on the printer's heating head, or when the number of printed dot lines exceeds the height of the display module's resolution, you can move the display area using the display controls to view the complete printed content.

7. The method according to claim 1, characterized in that: After printing is complete or a stop command is received, the heating data and step time are saved so that the printing process can be replayed in the display control based on user actions.

8. A simulation device for a thermal printer cartridge, characterized in that, include: The heating head simulation module is used to simulate the points of the thermal printer heating head through the pixels of the display module. One heating point corresponds to one or more pixels. It establishes the correspondence between the heating time of the thermal printer heating head and the displayed grayscale or color. Based on the cumulative heating time of the current heating point, it displays the pixel of the simulated current heating point as the corresponding grayscale or color. The stepper motor simulation module is used to set the current heating line; according to the stepping rules and printing progress, when a line break is needed, it scrolls the printed data one line in the specified direction, and the empty line after scrolling is the current heating line; it continuously displays grayscale or color according to the heating data and stepping time and steps to simulate the heating of the thermal printer heating head until the printing content is completed or a stop command is received. The device operates in an environment without thermal printer hardware and is used for software debugging and real-time preview of printing results.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The electronic device further includes a display module, or an external display module, and the processor executes the program to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image forming apparatus, information processing apparatus, and image forming method

    CN101382749A

  • Grayscale printing method of thermosensitive printer

    CN106681673A

  • Thermal printer

    JP1994328757A