CN102053185B - Digital oscilloscope having area print and print preview functions and control method thereof - Google Patents
Digital oscilloscope having area print and print preview functions and control method thereof Download PDFInfo
- Publication number
- CN102053185B CN102053185B CN 200910237396 CN200910237396A CN102053185B CN 102053185 B CN102053185 B CN 102053185B CN 200910237396 CN200910237396 CN 200910237396 CN 200910237396 A CN200910237396 A CN 200910237396A CN 102053185 B CN102053185 B CN 102053185B
- Authority
- CN
- China
- Prior art keywords
- data
- preview
- printing
- area
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Landscapes
- Record Information Processing For Printing (AREA)
Abstract
一种具有区域打印及打印预览功能的打印方法,包括步骤:1)区域打印步骤:1.1)启动打印操作;1.2)依照用户设置的打印区域,从显卡数据源中获取与打印区域对应的数据集并保存数据集参数,将获取的数据集依数据集参数进行图层叠加,生成打印数据并保存;1.3)将打印数据送至打印机。2)打印预览步骤:2.1)接收用户指令,启动预览操作;2.2)依照用户设置的打印区域,从显卡数据源中获取与打印区域对应的数据集并保存数据集参数,将获取的数据集依数据集参数进行图层叠加,生成打印数据并保存;2.3)从打印数据中获取预览源数据,将预览源数据转换为符合预览设置的预览数据并保存;2.4)将预览数据在预览界面中显示出来。该方法可实现区域打印和预览打印数据。
A printing method with the functions of area printing and print preview, comprising steps: 1) area printing step: 1.1) start printing operation; 1.2) obtain the data set corresponding to the printing area from the graphics card data source according to the printing area set by the user And save the data set parameters, superimpose the acquired data set according to the data set parameters, generate print data and save; 1.3) Send the print data to the printer. 2) Print preview steps: 2.1) Receive user instructions and start the preview operation; 2.2) Acquire the data set corresponding to the printing area from the graphics card data source and save the data set parameters according to the printing area set by the user, and save the data set according to the obtained data set The data set parameters are superimposed on the layers, and the print data is generated and saved; 2.3) The preview source data is obtained from the print data, and the preview source data is converted into preview data that meets the preview settings and saved; 2.4) The preview data is displayed in the preview interface come out. This method can realize area printing and preview printing data.
Description
技术领域 technical field
本发明涉及具有区域打印及打印预览功能的数字示波器及其控制方法。The invention relates to a digital oscilloscope with the functions of area printing and printing preview and its control method.
背景技术 Background technique
数字示波器能够直观地观测信号波形,是测量领域的一种基础仪器。在测量中,用户使用示波器捕获到问题信号后经常将其保存为图片,待需要使用时通过PC机将图片打印出来。The digital oscilloscope can observe the signal waveform intuitively and is a basic instrument in the measurement field. In the measurement, the user often saves the problem signal as a picture after capturing the problem signal with the oscilloscope, and prints the picture through the PC when it needs to be used.
目前数字示波器均具有直接打印功能,直接打印允许用户无需通过PC机即可获得打印结果,在一定程度上为用户提供了方便,提升了用户体验度。At present, all digital oscilloscopes have a direct printing function. Direct printing allows users to obtain printing results without using a PC, which provides convenience for users to a certain extent and improves user experience.
但是,用户在打印前是无法预览打印效果的,因此,用户通过直接打印获得的图片有可能并不是其希望获得的。这样,用户不得不再次设置再次打印,直到满意为止。However, the user cannot preview the printing effect before printing. Therefore, the picture obtained by the user through direct printing may not be what he wants. In this way, the user has to set up and print again until satisfied.
目前,数字示波器支持的打印区域默认为屏幕,且是不可选择的。当用户希望打印结果中仅包含波形时,必须先将屏幕显示保存为图片,然后在PC机中将波形区域提取出来再进行打印。Currently, the default printing area supported by the digital oscilloscope is the screen, and it cannot be selected. When the user wants to print only the waveform, he must first save the screen display as a picture, and then extract the waveform area on the PC before printing.
如上所述,目前数字示波器中均配置有打印功能,但其打印功能存在如下缺点:As mentioned above, currently all digital oscilloscopes are equipped with a printing function, but the printing function has the following disadvantages:
1.用户无法选择打印区域,即无法有选择地进行打印;1. Users cannot select the print area, that is, they cannot print selectively;
2.用户无法预览打印结果,即无法预知打印效果。2. Users cannot preview the printing results, that is, they cannot predict the printing effect.
发明内容 Contents of the invention
有鉴于此,本发明的目的在于提供一种具有区域打印及打印预览功能的数字示波器及其打印方法,该方法可选打印区域,实现区域打印;可预览打印数据,在打印前即可预知打印效果。In view of this, the purpose of the present invention is to provide a digital oscilloscope with the function of area printing and print preview and its printing method. Effect.
为实现上述目的,本发明采用以下技术方案:To achieve the above object, the present invention adopts the following technical solutions:
一种具有区域打印及打印预览功能的打印方法,其包括以下步骤:A printing method with functions of area printing and print preview, comprising the following steps:
1)区域打印步骤,包括:1) Regional printing steps, including:
1.1)接收用户发出的打印开始指令,启动打印操作;1.1) Receive the printing start instruction issued by the user, and start the printing operation;
1.2)依照用户设置的打印区域,从显卡数据源中获取与打印区域对应的数据集并保存数据集参数,将获取的数据集依数据集参数进行图层叠加,生成打印数据并保存;1.2) According to the printing area set by the user, obtain the data set corresponding to the printing area from the graphics card data source and save the data set parameters, and overlay the acquired data set according to the data set parameters to generate print data and save it;
1.3)将打印数据送至打印机打印,1.3) Send the print data to the printer for printing,
2)打印预览步骤,包括:2) Print preview steps, including:
2.1)接收用户指令,启动预览操作;2.1) Receive user instructions and start the preview operation;
2.2)依照用户设置的打印区域,从显卡数据源中获取与打印区域对应的数据集并保存数据集参数,将获取的数据集依数据集参数进行图层叠加,生成打印数据并保存;2.2) According to the printing area set by the user, obtain the data set corresponding to the printing area from the graphics card data source and save the data set parameters, and overlay the acquired data set according to the data set parameters to generate print data and save it;
2.3)从打印数据中获取预览源数据,将预览源数据转换为符合预览设置的预览数据并保存;2.3) Obtain the preview source data from the print data, convert the preview source data into preview data conforming to the preview settings and save it;
2.4)将预览数据在预览界面中显示出来。2.4) Display the preview data in the preview interface.
一种具有区域打印及打印预览功能的数字示波器,包括:前端信号调理单元、ADC、数据处理单元、触发处理单元、显示/控制单元、屏幕、键盘及外设,其中:前端信号调理单元的输出连接ADC和触发处理单元,ADC与数据处理单元的输入连接,触发处理单元与数据处理单元的输入连接,数据处理单元的输出经显示/控制单元送至屏幕,键盘及外设连接显示/控制单元;信号在经过前端数字调理以后,被ADC采样,ADC将数字化的信号送到数据处理单元进行计算,数据处理单元送至屏幕显示。A digital oscilloscope with area printing and print preview functions, including: front-end signal conditioning unit, ADC, data processing unit, trigger processing unit, display/control unit, screen, keyboard and peripherals, wherein: the output of the front-end signal conditioning unit Connect the ADC and the trigger processing unit, the input connection between the ADC and the data processing unit, the input connection between the trigger processing unit and the data processing unit, the output of the data processing unit is sent to the screen through the display/control unit, and the keyboard and peripherals are connected to the display/control unit ; After the signal is digitally conditioned by the front end, it is sampled by the ADC, and the ADC sends the digitized signal to the data processing unit for calculation, and the data processing unit sends it to the screen for display.
进一步地:further:
所述步骤1.2)和2.2)中的用户设置的打印区域包括屏幕区域和波形区域,屏幕区域是指所有在屏幕上显示的区域,波形区域指打印结果中仅包含波形。The printing area set by the user in the steps 1.2) and 2.2) includes a screen area and a waveform area. The screen area refers to all areas displayed on the screen, and the waveform area refers to only the waveform in the print result.
所述步骤1.2)和2.2)中的显卡数据源是指显卡物理图层数据,显卡具有多个物理图层,每一图层承载不同的显示数据,经过图层叠加生成的显示图层即为屏幕显示数据,其叠加次序为由底向上,即背景图层为最底层而菜单图层为最上层。The graphics card data source in described steps 1.2) and 2.2) refers to the graphics card physical layer data, and the graphics card has multiple physical layers, and each layer carries different display data, and the display layer generated through layer superposition is The data displayed on the screen is stacked in a bottom-up order, that is, the background layer is the bottom layer and the menu layer is the top layer.
所述步骤1.2)和2.2)中的数据集是指依照打印区域从显卡图层中获取的数据。The data sets in the steps 1.2) and 2.2) refer to the data obtained from the graphic card layer according to the printing area.
所述步骤1.2)和2.2)中的数据集参数包括不同显卡图层相对于同一坐标系的左上、右下顶点坐标和图层叠加属性,叠加属性至少包括与、或、异或、覆盖。The data set parameters in the steps 1.2) and 2.2) include the upper left and lower right vertex coordinates and layer overlay attributes of different graphics card layers relative to the same coordinate system, and the overlay attributes include at least AND, OR, XOR, and coverage.
所述步骤1.2)和2.2)中的获取数据集及其参数方法,依照不同区域包括以下步骤:The methods for obtaining data sets and their parameters in steps 1.2) and 2.2) include the following steps according to different regions:
若打印区域为屏幕,则首先由底向上依次获取显卡物理图层数据并保存,同时保存各图层数据参数;然后依据坐标和叠加属性按照物理图层由底向上次序依次叠加不同图层同一坐标的数据,叠加获得的数据即为打印数据,If the printing area is the screen, first obtain and save the physical layer data of the graphics card from bottom to top, and save the data parameters of each layer at the same time; then superimpose the same coordinates of different layers in sequence according to the physical layer from bottom to top according to the coordinates and overlay attributes data, the superimposed data is the print data,
若打印区域为波形,则获取显卡波形图层数据并保存,即可获得打印数据。If the print area is a waveform, obtain and save the graphics card waveform layer data to obtain the print data.
当打印区域为屏幕时,实现步骤如下:When the printing area is the screen, the implementation steps are as follows:
获取各显卡物理图层数据集参数,确定图层数据叠加完毕后的矩形外框;Obtain the parameters of the physical layer data set of each graphics card, and determine the rectangular frame after the layer data is superimposed;
依据矩形框坐标及显卡物理图层,由底向上次序依次取各个图层中同一坐标数据并依次叠加。According to the coordinates of the rectangular frame and the physical layer of the graphics card, the same coordinate data in each layer is sequentially taken from bottom to top and superimposed in sequence.
所述打印预览实现中步骤2.3)中所述的预览设置至少包括预览水平、垂直移动和预览缩放比;The preview settings described in step 2.3) in the implementation of the print preview at least include preview horizontal, vertical movement and preview zoom ratio;
所述步骤2.3)中的从打印数据中获取预览数据的方法包括:The method for obtaining the preview data from the print data in the step 2.3) includes:
2.3.1)根据预览设置计算预览数据相对于打印数据的位置信息;2.3.1) Calculate the location information of the preview data relative to the print data according to the preview settings;
2.3.2)根据获得的位置信息依次将对应打印数据按照缩放比例进行缩放,缩放后的数据即预览数据,所述位置信息至少包括起始行、起始列和终止行、终止列。2.3.2) Scale the corresponding print data in sequence according to the scaling ratio according to the obtained position information, and the scaled data is the preview data, and the position information includes at least a start row, a start column, an end row, and an end column.
本发明具有如下有益效果:The present invention has following beneficial effect:
1.本发明在进行打印时可依据用户设置的打印区域进行打印,有效突出打印重点;1. When printing, the present invention can print according to the printing area set by the user, effectively highlighting the key points of printing;
2.本发明在进行打印时可先进行打印预览,打印前即可预知打印效果,并以此为基础可对打印设置进行有效修改,提高打印结果有效程度。2. The present invention can perform print preview first when printing, and the printing effect can be predicted before printing, and based on this, the printing settings can be effectively modified to improve the effectiveness of the printing result.
附图说明 Description of drawings
图1是本发明数字示波器的基本结构图;Fig. 1 is the basic structural diagram of digital oscilloscope of the present invention;
图2是本发明数字示波器的硬件组成框图;Fig. 2 is the hardware composition block diagram of digital oscilloscope of the present invention;
图3是本发明的打印流程图;Fig. 3 is the printing flowchart of the present invention;
图4是本发明的打印预览流程图;Fig. 4 is a print preview flow chart of the present invention;
图5是显卡物理图层示意图;Fig. 5 is a schematic diagram of the physical layer of the graphics card;
图6叠加结果矩形框显示图;Figure 6 shows the rectangular frame of the superposition result;
图7和图8是系统运行界面图;Fig. 7 and Fig. 8 are system operation interface figure;
图9是系统的运行流程图。Figure 9 is a flow chart of the system's operation.
具体实施方式 Detailed ways
本发明涉及具有区域打印及打印预览功能的数字示波器及其控制方法。The invention relates to a digital oscilloscope with the functions of area printing and printing preview and its control method.
本发明数字示波器的基本结构如图1所示,它包括:前端信号调理单元、ADC、数据处理单元、触发处理单元、显示/控制单元、屏幕、键盘及外设。其中:前端信号调理单元的输出连接ADC和触发处理单元,ADC与数据处理单元的输入连接,触发处理单元与数据处理单元的输入连接,数据处理单元的输出经显示/控制单元送至屏幕,键盘及外设连接显示/控制单元。The basic structure of the digital oscilloscope of the present invention is shown in Figure 1, which includes: a front-end signal conditioning unit, ADC, data processing unit, trigger processing unit, display/control unit, screen, keyboard and peripherals. Among them: the output of the front-end signal conditioning unit is connected to the ADC and the trigger processing unit, the input of the ADC to the data processing unit is connected, the trigger processing unit is connected to the input of the data processing unit, the output of the data processing unit is sent to the screen through the display/control unit, and the keyboard And peripherals connected display / control unit.
信号在经过前端数字调理以后,被一片或者几片ADC采样,之后数字化的信号被送到数据处理单元进行计算,并最终显示出来。After the signal is digitally conditioned by the front end, it is sampled by one or several ADCs, and then the digitized signal is sent to the data processing unit for calculation and finally displayed.
其详细硬件结构如图2所示,主要包括:四个前端模拟电路通道、两路ADC采样、两路数据处理单元、显示控制单元、屏幕。其中:四个通道为独立的前端模拟电路通道,各个通道均有独立的通道设置、放大衰减、偏移以及触发电路。通过前端模拟通道调理过的信号被ADC采样,其中ADC1负责通道1和通道2的采样,ADC2负责通道3和通道4的采样,每片ADC内部有四片独立的ADC单元,可以通过控制选择交织情况,四片ADC单元同时采集一路前端模拟通道时,将实现5GSa/s最高采样率。数据处理单元PGA1和FPGA2分别负责两组通道采样处理,ADC采集来的数据将在这被整理成一根根轨迹,示波器每秒最大将采集130,000帧的波形数据。由于液晶屏每秒只能刷新30次左右,数据处理单元FPGA3和FPGA4负责将数以万计的轨迹通过叠加的方式表现为几十帧,同时为了更好的显示波形,会根据液晶屏上的像素情况对波形点进行抽取和插值,这些数据帧通过数据处理单元FPGA5中的显示控制单元,表现在液晶显示屏上。Its detailed hardware structure is shown in Figure 2, mainly including: four front-end analog circuit channels, two ADC sampling channels, two data processing units, display control unit, and screen. Among them: four channels are independent front-end analog circuit channels, and each channel has independent channel setting, amplification attenuation, offset and trigger circuit. The signal conditioned by the front-end analog channel is sampled by the ADC, where ADC1 is responsible for the sampling of channel 1 and
用户的键值通过CPLD译码,传输到DSP中,根据程序中设定好的步骤,通过FPGA5控制这个电路和显示。用户可以直接使用的存储器,均由DSP控制操作。The user's key value is decoded by CPLD and transmitted to DSP. According to the steps set in the program, the circuit and display are controlled by FPGA5. The memory that users can use directly is controlled and operated by DSP.
同时,为了确保电路安全,主板上还布置有一颗协处理器MCU,它通过传感器监控硬件电路中的电压、温度等等信息,并将这些信息传输到DSP中。At the same time, in order to ensure the safety of the circuit, there is also a coprocessor MCU on the motherboard, which monitors the voltage, temperature and other information in the hardware circuit through sensors, and transmits this information to the DSP.
本发明的具有区域打印及打印预览功能的打印方法,可应用于但不仅限于当前示波器平台。其包括以下步骤:The printing method with the functions of area printing and print preview of the present invention can be applied to but not limited to the current oscilloscope platform. It includes the following steps:
1)区域打印步骤,图3为区域打印功能的实现流程,包含以下步骤:1) Regional printing steps, Figure 3 is the implementation process of the regional printing function, including the following steps:
1.1)接收用户发出的打印开始指令,启动打印操作;1.1) Receive the printing start instruction issued by the user, and start the printing operation;
1.2)依照用户设置的打印区域从显卡数据源中获取与打印区域对应的数据集并保存数据集参数,然后依据打印区域设置将获取的数据集依数据集参数叠加,生成打印数据并保存;1.2) Acquire the data set corresponding to the printing area from the graphics card data source according to the printing area set by the user and save the data set parameters, then superimpose the acquired data set according to the data set parameters according to the printing area setting, generate printing data and save it;
数据集是指由不同图层不同坐标获取的数据,数据集参数描述了数据集中取自每一图层数据的起始、终止坐标及互相叠加属性。依数据集参数叠加是指,将数据集中取自不同图层的数据按照数据集参数描述的坐标及属性,对相同坐标的数据进行叠加。例如,数据A属于图层a,坐标为(20,30);数据B属于图层b,坐标同样为(20,30),则数据A应与数据B进行叠加,且叠加属性由位于较上图层的数据确定。The dataset refers to the data obtained from different coordinates of different layers, and the dataset parameters describe the start and end coordinates and mutual superposition properties of the data from each layer in the dataset. Superposition according to dataset parameters means that the data from different layers in the dataset are superimposed on the data of the same coordinates according to the coordinates and attributes described by the dataset parameters. For example, data A belongs to layer a, and the coordinates are (20, 30); data B belongs to layer b, and the coordinates are also (20, 30), then data A should be superimposed on data B, and the superposition attribute is located at the upper The data of the layer is determined.
1.3)与打印机通信,将打印数据发送至打印机,进行实际打印。1.3) Communicate with the printer, send the print data to the printer for actual printing.
2)打印预览步骤,图4为打印预览功能的实现流程,包含以下步骤:2) Print preview step, Figure 4 is the implementation process of the print preview function, including the following steps:
2.1)接收用户指令,启动预览操作;2.1) Receive user instructions and start the preview operation;
2.2)依照用户设置的打印区域从显卡数据源中获取打印区域对应的数据集并保存数据集参数,然后依据打印区域设置将获取的数据集依数据集参数进行图层叠加生成打印数据,同时保存打印数据;2.2) According to the printing area set by the user, obtain the data set corresponding to the printing area from the data source of the graphics card and save the data set parameters, and then according to the printing area setting, overlay the obtained data set according to the data set parameters to generate printing data, and save it at the same time print data;
2.3)根据预览设置,从打印数据中获取预览源数据,将其转换为符合预览设置的预览数据并保存,符合预览设置的数据是指依据预览设置的偏移、缩放倍数从打印数据中获取并缩放完毕的数据;2.3) According to the preview setting, obtain the preview source data from the print data, convert it into the preview data conforming to the preview setting and save it. The data conforming to the preview setting refers to obtaining and saving the preview data according to the offset and zoom factor of the preview setting. The scaled data;
2.4)将预览数据在预览界面中显示出来。2.4) Display the preview data in the preview interface.
上述区域打印和打印预览的实现均需首先通过以下步骤构造打印数据。The realization of the above-mentioned area printing and print preview needs to construct the print data through the following steps first.
步骤1.2)和2.2)中所述的用户设置打印区域包括屏幕和波形两种区域。屏幕区域是指所有在屏幕上显示的区域(左右菜单需隐藏),波形区域指打印结果中仅包含波形。The user-set printing area described in steps 1.2) and 2.2) includes screen and waveform areas. The screen area refers to all areas displayed on the screen (the left and right menus need to be hidden), and the waveform area refers to only waveforms included in the printout.
步骤1.2)和2.2)中所述显卡数据源指显卡物理图层数据,如图5所示显卡具有多个物理图层,每一图层承载不同的显示数据,经过图层叠加生成的显示图层即屏幕显示数据。其叠加次序为由底向上即背景图层为最底层,菜单图层为最上层。The data source of the graphics card described in steps 1.2) and 2.2) refers to the physical layer data of the graphics card. As shown in Figure 5, the graphics card has multiple physical layers, each layer carries different display data, and the display image generated by layer superposition The layer is the screen display data. The stacking order is from bottom to top, that is, the background layer is the bottom layer, and the menu layer is the top layer.
步骤1.2)和2.2)中所述数据集是指依照前述打印区域从显卡图层中获取的数据。The data sets described in steps 1.2) and 2.2) refer to the data obtained from the graphics card layer according to the aforementioned printing area.
步骤1.2)和2.2)中所述数据集参数包括不同显卡图层相对于同一坐标系的左上、右下顶点坐标和图层叠加属性。例如,图6中菜单图层各顶点坐标由左上顶点始顺时针依次为(left,top)、(right,top)、(right,bottom)、(left,bottom),则其数据集参数中坐标参数为(left,top)和(right,bottom)。The data set parameters described in steps 1.2) and 2.2) include the upper left and lower right vertex coordinates and layer overlay properties of different graphics card layers relative to the same coordinate system. For example, the coordinates of each vertex of the menu layer in Figure 6 are (left, top), (right, top), (right, bottom), (left, bottom) clockwise from the upper left vertex, then the coordinates in the data set parameters The parameters are (left, top) and (right, bottom).
叠加属性至少包括:与、或、异或、覆盖。例如,现有A、B、C、D、E五个图层,叠放次序为由下至上,叠加属性依次为与、或、异或、覆盖,取各个图层上具有相同坐标的点,假设分别为a、b、c、d、e且该点数据值为(二进制数):The overlay attribute at least includes: AND, OR, XOR, and coverage. For example, there are five layers A, B, C, D, and E. The stacking order is from bottom to top, and the stacking attributes are AND, OR, XOR, and Overlay in turn. Take the points with the same coordinates on each layer. Suppose they are a, b, c, d, e respectively and the data value of this point is (binary number):
a=1101 1111 1110 1100a=1101 1111 1110 1100
b=0101 0011 0111 1011b=0101 0011 0111 1011
c=1011 1100 1000 1011c=1011 1100 1000 1011
d=0000 0110 0011 0110d=0000 0110 0011 0110
e=1100 1100 1011 1111e=1100 1100 1011 1111
设计算中间值为f且与、或、异或操作均为位操作,则:The intermediate value of the design calculation is f and the AND, OR, and XOR operations are all bit operations, then:
f=a与b的结果是f=0101 0011 0110 1000The result of f=a and b is f=0101 0011 0110 1000
f=f或c的结果是f=1111 1111 1110 1011The result of f=f or c is f=1111 1111 1110 1011
f=f异或d的结果是f=1111 1001 1101 1101The result of f=f XOR d is f=1111 1001 1101 1101
f=f覆盖e的结果是f=e=1100 1100 1011 1111The result of f=f covering e is f=e=1100 1100 1011 1111
步骤1.2)和2.2)中所述获取数据集及其参数方法,依照不同区域包括以下步骤:The methods for obtaining data sets and their parameters described in steps 1.2) and 2.2) include the following steps according to different regions:
1.打印区域为屏幕1. The printing area is the screen
1)由底向上依次获取显卡物理图层数据并保存,同时应保存各图层数据参数,即保存各个图层相对于屏幕的四个顶点坐标及图层的叠加属性。1) Acquire and save the physical layer data of the graphics card from bottom to top. At the same time, the data parameters of each layer should be saved, that is, the coordinates of the four vertices of each layer relative to the screen and the overlay properties of the layers should be saved.
2)依据坐标和叠加属性按照物理图层由底向上次序依次叠加不同图层同一坐标的数据,叠加获得的数据即打印数据。菜单例外。2) According to the coordinates and superimposition attributes, the data of the same coordinates of different layers are superimposed sequentially according to the order of the physical layers from bottom to top, and the data obtained by the superposition is the print data. Exceptions are menus.
2.打印区域为波形2. The print area is a waveform
获取显卡波形图层数据并保存,即可获得打印数据。显卡具有波形图层,直接将数据由显卡波形图层导出即可,即,将数据由显卡波形图层内存读入用于保存该数据的内存。Obtain and save the waveform layer data of the graphics card to obtain the print data. The graphics card has a waveform layer, and the data can be directly exported from the waveform layer of the graphics card, that is, the data is read from the waveform layer memory of the graphics card into the memory used to save the data.
当打印区域为屏幕时,实现步骤亦可如下:When the printing area is the screen, the implementation steps can also be as follows:
1)获取各显卡物理图层数据集参数,确定图层数据叠加完毕后的矩形外框,取各个叠加图层顶点坐标最大值,即获得矩形外框的顶点坐标,矩形外框用来描述叠加后数据的顶点坐标,即需叠加的数据范围。如图6所示。1) Obtain the parameters of the physical layer data set of each graphics card, determine the rectangular frame after the layer data is superimposed, take the maximum value of the vertex coordinates of each superimposed layer, that is, obtain the vertex coordinates of the rectangular frame, and the rectangular frame is used to describe the superposition The vertex coordinates of the subsequent data, that is, the data range to be superimposed. As shown in Figure 6.
2)依据矩形框坐标及显卡物理图层,由底向上次序依次取各个图层中同一坐标数据并依次叠加。其叠加方式同样由图层叠加属性决定。2) According to the coordinates of the rectangular frame and the physical layer of the graphics card, the same coordinate data in each layer is sequentially taken from bottom to top and superimposed in sequence. The overlay method is also determined by the layer overlay property.
打印预览实现中的步骤2.3)中所述的预览设置至少包括:预览水平、垂直移动和预览缩放比。The preview settings described in step 2.3) in the implementation of the print preview at least include: preview horizontal, vertical movement and preview zoom ratio.
步骤2.3)中所述从打印数据中获取预览数据的方法包括:The method for obtaining the preview data from the print data described in step 2.3) includes:
2.3.1)根据预览设置计算预览数据相对于打印数据的位置信息;2.3.1) Calculate the location information of the preview data relative to the print data according to the preview settings;
2.3.2)根据获得的位置信息依次将对应打印数据按照缩放比例进行缩放,缩放后的数据即预览数据。2.3.2) According to the obtained position information, the corresponding printing data is sequentially scaled according to the scaling ratio, and the scaled data is the preview data.
其中,所述位置信息至少包括:起始行、起始列和终止行、终止列。Wherein, the position information at least includes: a start row, a start column, an end row, and an end column.
所述位置信息计算方法包括以下步骤:The location information calculation method includes the following steps:
1.确定预览数据中心坐标:首先,当缩放倍数小于1时中心坐标保持默认值是不变的;其次,仅改变缩放倍数时其中心坐标是不变的;最后,影响中心坐标的主要因素是水平、垂直偏移。计算公式:设默认中心坐标为(x0,y0)=(240,400),缩放系数为k1,水平偏移为Xoffset,垂直偏移为Yoffset,计算所得中心坐标为(x,y),则:1. Determine the center coordinates of the preview data: first, when the zoom factor is less than 1, the center coordinate remains the same as the default value; secondly, the center coordinate remains unchanged when only the zoom factor is changed; finally, the main factors affecting the center coordinate are Horizontal and vertical offset. Calculation formula: Let the default center coordinates be (x0, y0) = (240, 400), the zoom factor is k1, the horizontal offset is Xoffset, the vertical offset is Yoffset, and the calculated center coordinates are (x, y), then:
if k1>1if k1>1
x=x0+Xoffset/k1x=x0+Xoffset/k1
y=y0+Yoffset/k1y=y0+Yoffset/k1
elseelse
x=x0x=x0
y=y0y=y0
2.计算起始行、起始列、终止行、终止列。设起始行为Ystart,起始列为Xstart,终止行为Yend,终止列为Xend,设显示预览数据的屏幕宽、高分别为Width、Height,缩放系数、中心坐标如上所设,则:2. Calculate the starting row, starting column, ending row, and ending column. Let the start behavior be Ystart, the start column be Xstart, the end behavior Yend, the end column be Xend, set the width and height of the screen displaying the preview data to be Width and Height respectively, and the zoom factor and center coordinates are set as above, then:
Ystart=y-Height/(k1*2)Ystart=y-Height/(k1*2)
Yend=y+Height/(k1*2)Yend=y+Height/(k1*2)
Xstart=x-Width/(k1*2)Xstart=x-Width/(k1*2)
Xend=x+Width/(k1*2)Xend=x+Width/(k1*2)
经过如上计算,得到需预览的打印数据位置参数,如果依照此位置参数其数据范围超出打印数据范围,则超出范围部分数据使用默认非图片数据颜色填充。After the above calculation, the print data position parameter to be previewed is obtained. If the data range exceeds the print data range according to this position parameter, the data beyond the range will be filled with the default non-picture data color.
其中的缩放系数定义如下:数据不进行缩放,其缩放系数为1;数据放大2倍,其缩放系数为2;数据缩小2倍,其缩放系数为0.5。The scaling factor is defined as follows: the data is not scaled, and the scaling factor is 1; the data is enlarged by 2 times, and the scaling factor is 2; the data is reduced by 2 times, and the scaling factor is 0.5.
在此仅考虑了整数倍缩放,放大2倍如图7所示,缩小2倍如图8所示。Here, only integer multiple scaling is considered, as shown in Figure 7 for 2 times of enlargement, and as shown in Figure 8 for 2 times of zoom out.
缩小时像素值计算公式:(A1+A2+A3+A4)/4。即四个像素值的平均。The formula for calculating the pixel value when zooming out: (A1+A2+A3+A4)/4. That is, the average of the four pixel values.
应用本发明,能够在数字示波器及类似嵌入式设备中实现具有打印预览和打印区域选择的打印功能。下面以一具体实例,说明本发明的打印方法。By applying the invention, the printing function with print preview and print area selection can be realized in digital oscilloscopes and similar embedded devices. The printing method of the present invention will be described below with a specific example.
使用区域打印功能Use the area printing function
其步骤为:通过按键在打印菜单中设置打印区域为屏幕;设置打印颜色为彩色;然后按下菜单打印键即可发起打印。如图3所示,系统在接收到软件打印开始命令后,首先依据打印区域及数据获取和叠加方法获取打印数据,然后将打印数据转换为打印机可识别数据并进行打印。The steps are as follows: set the print area to screen in the print menu by pressing the key; set the print color to color; and then press the menu print key to start printing. As shown in Figure 3, after the system receives the software print start command, it first acquires print data according to the print area and data acquisition and overlay methods, and then converts the print data into data recognizable by the printer and prints it.
使用打印预览功能,其步骤如下:To use the print preview function, the steps are as follows:
1.通过操作菜单按键发送打印预览命令;1. Send the print preview command through the operation menu button;
2.系统接收到用户发送的打印预览命令后,首先获取打印区域设置,然后根据区域设置获取显卡图层数据并叠加成打印数据;2. After the system receives the print preview command sent by the user, it first obtains the print area settings, and then obtains the graphics card layer data according to the area settings and superimposes them into print data;
3.获取默认缩放系数,水平、垂直偏移;3. Get the default zoom factor, horizontal and vertical offset;
4.根据缩放系数、水平偏移和垂直偏移计算打印数据中用于预览的数据位置信息;4. Calculate the data position information for preview in the print data according to the zoom factor, horizontal offset and vertical offset;
5.根据计算所得的位置信息和缩放系数构造预览数据;5. Construct preview data according to the calculated position information and zoom factor;
6.将预览数据显示在屏幕上;6. Display the preview data on the screen;
7.执行打印预览功能时,屏幕显示如图9所示。此时可操作放大、缩小、水平移动、垂直移动按钮,相应地重复执行步骤4、5、6;7. When the print preview function is executed, the screen display is as shown in Figure 9. At this point, you can operate the buttons for zooming in, zooming out, moving horizontally, and moving vertically, and repeat steps 4, 5, and 6 accordingly;
8.若操作打印按钮则驱动打印机进行打印;若操作关闭按钮则退出预览状态。8. If the print button is operated, the printer will be driven to print; if the close button is operated, the preview state will exit.
图9中1表示屏幕、2表示预览图像、3表示操作菜单。In FIG. 9, 1 denotes a screen, 2 denotes a preview image, and 3 denotes an operation menu.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910237396 CN102053185B (en) | 2009-11-10 | 2009-11-10 | Digital oscilloscope having area print and print preview functions and control method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910237396 CN102053185B (en) | 2009-11-10 | 2009-11-10 | Digital oscilloscope having area print and print preview functions and control method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102053185A CN102053185A (en) | 2011-05-11 |
CN102053185B true CN102053185B (en) | 2012-12-26 |
Family
ID=43957720
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200910237396 Active CN102053185B (en) | 2009-11-10 | 2009-11-10 | Digital oscilloscope having area print and print preview functions and control method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102053185B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103176015B (en) * | 2011-12-22 | 2016-04-20 | 北京普源精电科技有限公司 | A kind of waveform method for previewing, device and oscillograph |
CN103323638A (en) * | 2013-07-05 | 2013-09-25 | 无锡商业职业技术学院 | Multifunctional digital scope meter |
CN109032540A (en) * | 2018-08-01 | 2018-12-18 | 珠海奔图电子有限公司 | Method of printing, unit and computer readable storage medium |
CN111323627B (en) * | 2020-02-27 | 2021-10-12 | 京东方科技集团股份有限公司 | Digital oscilloscope and oscillogram generation system |
CN118672525B (en) * | 2024-05-21 | 2025-02-11 | 珠海全球时代科技有限公司 | A method and system for realizing personalized card faces of multiple cards simultaneously |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6262728B1 (en) * | 1998-11-03 | 2001-07-17 | Agilent Technologies, Inc. | System and method for annotating a graphical user interface display in a computer-based system |
CN1538285A (en) * | 2003-04-17 | 2004-10-20 | ������������ʽ���� | Informaton processing device and print prebrowsing display device |
CN1842126A (en) * | 2005-03-28 | 2006-10-04 | 兄弟工业株式会社 | Information processing device, image processing device and method, and storage medium therefor |
CN101136978A (en) * | 2006-08-29 | 2008-03-05 | 京瓷美达株式会社 | Printer control device |
-
2009
- 2009-11-10 CN CN 200910237396 patent/CN102053185B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6262728B1 (en) * | 1998-11-03 | 2001-07-17 | Agilent Technologies, Inc. | System and method for annotating a graphical user interface display in a computer-based system |
CN1538285A (en) * | 2003-04-17 | 2004-10-20 | ������������ʽ���� | Informaton processing device and print prebrowsing display device |
CN1842126A (en) * | 2005-03-28 | 2006-10-04 | 兄弟工业株式会社 | Information processing device, image processing device and method, and storage medium therefor |
CN101136978A (en) * | 2006-08-29 | 2008-03-05 | 京瓷美达株式会社 | Printer control device |
Also Published As
Publication number | Publication date |
---|---|
CN102053185A (en) | 2011-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102053185B (en) | Digital oscilloscope having area print and print preview functions and control method thereof | |
CN105205354B (en) | Data generating device and data creation method | |
WO2022111730A1 (en) | Image processing method and apparatus, and electronic device | |
DE102004062733A1 (en) | Presentation device and reproduction method | |
JP4559964B2 (en) | Image processing program | |
CN1747558B (en) | Apparatus and method for generating graphic data | |
JP5152317B2 (en) | Presentation control apparatus and program | |
CN109445669B (en) | Method for displaying and drawing picture | |
JPH08123658A (en) | Method and device for registering icon pattern or icon, and method and device for displaying icon | |
JPH07230374A (en) | Method and apparatus for creating new window in multi-window system | |
JP4759415B2 (en) | Image display device and image display method | |
TWI222595B (en) | Image overlapping display system and method | |
JP2010091723A (en) | Video signal processing system and method therefor | |
US12159327B2 (en) | Image processing apparatus, imaging apparatus, image processing method, and image processing program | |
CN101625847A (en) | Rapid display method of large-size non-compressed digital image | |
CN100394372C (en) | Method of automatically processing an image and an apparatus using the method | |
KR20060073040A (en) | Display device and control method | |
JP4366452B2 (en) | Display control apparatus and display control method | |
CN102023783A (en) | Zoom ratio adjusting system and method for display area and display content | |
CN107888848A (en) | The device and method of artistic font is superimposed on image based on FPGA | |
KR101249033B1 (en) | Display apparatus and method | |
JPH09138847A (en) | Picture processing method/device | |
JP2844225B2 (en) | Video processing equipment | |
CN110661985A (en) | Image data recording method, image data recording device, interrogation host and storage medium | |
JP6224407B2 (en) | Display device and display method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |