The content of the invention
The technical problems to be solved by the invention are that there is provided a kind of Network Analyzer formula volume in view of the shortcomings of the prior art
Collect device and its datagraphic display methods and device.
Technical scheme is as follows:
A kind of Network Analyzer formula editors and its datagraphic display device, wherein, including formula editors module
And data processing and pattern displaying unit;The formula editors module includes:Parameter-embedded, function, operator unit, make by oneself
Adopted parameter and the import unit of function, the input block of formula editors expression formula, the intelligent correction and information alert of expression formula
Unit, the computing unit of expression formula are connected with each other and mutually communication;The data processing includes with pattern displaying unit:Data lattice
Formula selection, format data array, skew and ratio, display memory and interface display and five parts of refreshing.
Described Network Analyzer formula editors and its datagraphic display device, wherein, the parameter-embedded, letter
Number, operator unit, for selecting parameter, function and the operator to be inputted;The importing work(of the custom parameter and function
Energy unit, for being used after importing customized parameter, function;The input block of the formula editors expression formula, for propping up
Hold input through keyboard or input parameter, function, array and operator by way of left mouse button is selected;The intelligence of the expression formula
Error correction and information prompting function unit, grammer and structure for analyzing and processing the expression formula that user inputs;The expression formula
Computing unit, it is every by way of program timing to judge whether the formula currently inputted calculate at regular intervals;Institute
The computing unit for stating expression formula directly supports input and the calculation process of complex constants.
Described Network Analyzer formula editors and its datagraphic display device, wherein, the intelligent correction, information
The process step of Tip element and expression formula computing unit is:Step 1:After the input of expression formula;Step 2:Delete unnecessary sky
Lattice;Step 3:Upper case character is changed to lowercase character and adds end mark in expression formula character string end;Step 4:Determine whether
Simple syntax error, if any simple syntax error, then into intelligent correction and information alert unit, sends error code, in mistake
It is highlighted at by mistake, inquiry error code table, which is provided, enters step 5 after prompt message;Such as judge no simple syntax error, then
Into step 6;Step 5:Enter step 2 after expression formula modification;Step 6:The acquisition of parameter or the data of function;Step 7:Judge
Whether there is complicated syntax error, intelligent correction and information alert unit are then entered in this way, send error code, it is highlighted at mistake
It has been shown that, inquiry error code table, which is provided, enters step 5 after prompt message;As otherwise entered step 8;Step 8:Construct binary tree simultaneously
Computing, by operation result to Display processing module;Step 9:Judge whether it is last data point, then terminate in this way, it is such as no
Then enter step 6.
Described Network Analyzer formula editors and its datagraphic display device, wherein, the data format selection,
For selecting different data format to carry out figure shows;The format data array, for being stored in after data formatization processing
Format in array;The skew and ratio, are set for doing most basic display parameters for figure shows;In the display
Deposit, for the display map of in store analyzer, the content of display includes figure, text and menu, if display figure
It is written into, then is stored in simultaneously in display memory.
Described Network Analyzer formula editors and its datagraphic display device, wherein, the display memory and boundary
Face is shown and concretely comprising the following steps of refreshing:Step A:Initializing variable;Step B:Wait data display semaphore;Step C:Judge
Whether background is redrawn, and step D is entered if;As otherwise entered step E;Step D:Rendering context region;Step E:The copy back of the body
Scene area is to memory bitmap;Step F:Judge whether display memory track, step G is then entered in this way, such as otherwise enters step H;
Step G:Internal memory track is drawn in memory bitmap;Step H:Memory bitmap is copied to screen display;Step I:Judge whether to terminate,
Then terminate in this way, such as otherwise enter step B.Using such scheme:
1. in solving the expression formula that user is inputted directly comprising complex constants (such as:S21/ (1-S11)+(1+3i)) no
The technical barrier that can be calculated.The formula editors that this patent is provided allow user to directly input complex constants, require nothing more than plural normal
Amount is bracketed with bracket " () ", such as:S21/(1-S11)+(1+3i).Can be answering in expression formula in expression formula computing unit
Number (a+bj) is converted into<a:b>Form is handled, and this processing method efficiently solves user and directly inputs complex constants
The technical barrier can not be parsed into expression formula, calculated.Variable S21 and S11 in expression formula can be complex data types.
The parsing and calculating of whole expression formula are carried out using complex format.When a computable Formula Input Technology to equation editing
Frame, and choose after enable button, the data of the corresponding each measurement point of the currently active geometric locus or figure will be transported by formula
Result is calculated to be replaced, and track can carry out real-time update with data.
2. the formula editors program module provided, which solves user, can not import the technical problem of custom parameter, it is allowed to
User Defined parameter, such as such parameter data [201]={ 0,1,0,1.... }, can using this custom parameter
With discrete processing or some data points are observed, some specific demands of user can be met.In the user interface of editing machine
There is special window input user's new parameter to be imported.Additionally provide the import feature of SQL simultaneously, function is led
Entering is completed by the way of file plus dynamic base, easy to operate.The programming thought of this opening substantially increases this
The durability of program module itself, can apply to equation editing and parsing, the calculating of a variety of testers, both facilitates program
Exploitation again, it is convenient to be provided again for instrument user.
3. the formula editors provided provide the intelligent correction and information prompting function that user inputs expression formula.Work as user
An incalculable formula is inputted, formula editors are capable of the position that points out faults of intelligence, and can provide language exactly
The information alert of method type of error, user can improve operating efficiency according to these prompt messages efficiently correction formula;In addition
In the algorithm process that expression syntax judges, STL (Standard Template Library) STL base is employed
Notebook data structure and rudimentary algorithm, improve the operational efficiency of program.And employ the thought of two-level grammar judgement, primary language
Method judgement can check obvious syntax error, and complicated grammer judges to check that remaining institute is wrong, this classification processing language
The method of method mistake, had not only alleviated the difficulty of syntactic analysis but also had saved the time of whole program processing.
4. occurring the technical problem of waveform or figure flicker for expeditiously real-time drawing function, this patent is to use double buffering
The scheme of display solves this problem.The realization principle of double buffering is exactly in addition to having figure on screen and being shown, inside
Also there is figure in depositing in drafting.Exactly figure to be shown first in internal memory it is drawn, then again property by internal memory
Figure according to the screen that covers of a point, point, (this process is very fast, because being that the regular internal memory of comparison is copied up
Shellfish).What when so being drawn in internal memory, at will understood with the big background colour of contrast all without flicker, because the figure in internal memory
Shape user can't see.When by memory copying to screen, because figure final in internal memory and the figure of screen display
Difference very little (if do not changed, certainly just without difference), the effect so handled would not allow human eye to have what figure flashed
Feel, that is, retained a function using the vision of mankind itself.And the programming idea of multithreading is employed in software architecture
Carry out man-machine interaction and data figure shows, main thread is responsible for directly and user mutual, then creating a special work again
Make thread to show for datagraphic, thus main thread is freed, can be with real-time response human-machine interactive information.
Embodiment 1
Apparatus of the present invention include formula editors module 1 and data processing and pattern displaying unit 2;
Formula editors module includes:Parameter-embedded, function, operator unit 101, the importing of custom parameter and function
Unit 103, the input block 102 of formula editors expression formula, the intelligent correction of expression formula and information alert unit 104, expression
The computing unit of formula is connected with each other and mutually communicated 105;
Parameter-embedded, function, operator unit 101:User selects parameter, the function to be inputted by drop-down menu mode
And operator, these parameters and function are all that program is given tacit consent to carry in itself, be most basic measurement parameter, mathematical function and
Specialized function function.Operator except comprising basic mathematical operator also comprising ", ", ";”、“:”、“<”、“>”、“(”、“)”
Deng symbol.
The import feature unit 103 of custom parameter and function:For importing user-defined parameter, function, import
After can be used as parameter-embedded and function, add the flexibility of program.The import feature of particularly measurement parameter is
One of innovative point of the present invention, this function can provide the importing of array parameter, such as one array is data [201], user
Each element value of array, such as data [201]={ 0,1.0,1 ... ... }, if formula is S21*data can be initialized
[201] * (1-3i), result of calculation will be shown on the interface of track in real time, and this function can be with discrete to each measurement
Data point carries out independent data processing processing, extremely flexibly.
The input block 102 of formula editors expression formula:Support input through keyboard or by way of left mouse button is selected it is defeated
Enter parameter, function, array and operator etc..Other formula editors also have the function that expression formula is preserved, and user protects to expression formula
After depositing, all expression formulas preserved can be selected by the drop-down option of expression formula input frame, the institute preserved is selected
Have after expression formula that then this expression formula formula will automatically be input to expression formula input frame.
The intelligent correction and information alert unit 104 of expression formula:For the grammer for the expression formula for analyzing and processing user's input
And structure, first determine whether whether expression formula can calculate, IF expression can not calculate will analyze with wrongheaded type,
And the position of mistake is highlighted, and the information for accurately providing syntax error type by the form of inquiry error yard is carried
Show, be easy to user quickly to change;In addition in the algorithm process that expression syntax judges, STL (Standard are employed
Template Library) STL Data Structures and rudimentary algorithm, improve the operational efficiency of program.And adopt
The thought judged with two-level grammar, primary grammer judgement can check obvious syntax error, and complicated grammer judges to check
Remaining institute is wrong, the method for this classification processing syntax error, had not only alleviated the difficulty of syntactic analysis but also had saved whole
The time of program processing.This function is one of innovative point of the present invention.
The computing unit 105 of expression formula, it is every by way of program timing to judge what is currently inputted at regular intervals
Whether formula can be calculated, and data display processing module is passed to when will be the fructufy of calculating if can calculate.Expression
The computing unit of formula directly supports the input of complex constants and calculation process to be one of innovative points of the present invention, for example, user can
To input (1+2i) * S11+cos (S21), expression formula computing unit will delete space character useless first, and upper case character turns
Lowercase character is changed to, expression formula end mark is then added, then analyzes whether expression formula contains complex constants, if containing plural number
Constant just changes into complex constants a+bi<a:b>Form, discriminant function and parameter, numerical value are replaced, according to the excellent of operator
First level adds bracket to expression formula, and with operator and the data configuration binary tree of participation computing, computing etc..
Here is the program processing flow diagram of the intelligent correction, information alert unit and expression formula computing unit of the present invention,
As shown in Fig. 2 step 1:The input of expression formula;Step 2:Delete unnecessary space;Step 3:Upper case character is changed to lowercase character
And add end mark in expression formula character string end;Step 4:Simple syntax error is determined whether, if any simple syntax error,
Then enter intelligent correction and information alert unit, send error code, be highlighted at wrong place, inquiry error code table is provided
Enter step 5 after prompt message;Such as judge without simple syntax error, then into step 6;Step 5:Enter after expression formula modification
Step 2;Step 6:The acquisition of parameter or the data of function;Step 7:Complicated syntax error is determined whether, intelligence is then entered in this way
Energy error correction and information alert unit, send error code, are highlighted at wrong place, inquiry error code table provides prompt message
Enter step 5 afterwards;As otherwise entered step 8;Step 8:Binary tree union is constructed, by operation result to Display processing module;
Step 9:Judge whether it is last data point, then terminate in this way, such as otherwise enter step 6;
Data processing mainly includes for 2 yuan with figure shows list:Data format selection 201, format data array 202, partially
Move and ratio 203, display memory 204 and interface display and 205 5 parts of refreshing.
Data format selection 201:This function is mainly used in selection different data format and carries out figure shows.Because formula is compiled
The data for collecting device computing use complex format, but user often selects different display formats according to actual needs, than
Such as polar format, Randy Smyth artwork form.
Format data array 202:Deposit is formatted in array after data formatization processing, in the middle cursor of figure shows
With cursor search etc. function all originate from format data.
Skew and ratio 203:This function, which is mainly, does most basic display parameters setting for figure shows, such as big per lattice
Small and relative to figure shows are carried out centered on which numerical value, user can pass through human-computer interaction interface and adjust datagraphic
Indication range and ratio.
Display memory 204:The display map of the in store analyzer of display memory, the content of display include figure, text and
Menu etc., if user shows that figure is written into, then will also be stored in display memory.When performing drawing, these are counted
According to will be extracted from display memory, display can frequent updating and data processing synchronization, ultrahigh in efficiency.
The present invention is in screen window when drawing, drawing course be placed on mostly window OnDraw () function or
In OnPaint () message response function, OnDraw () is called when carrying out screen display by OnPaint ().When
Window with background color by viewing area due to when any reason needs to redraw, always first being removed, then just calling OnPaint ()
Function, and background color is often very big with drawing content contrast, so the alternating of background colour and display figure goes out in a short time
Now so that display window seems in flicker.
Occurs the technical problem of waveform or figure flicker for above-mentioned expeditiously real-time drawing function, this patent is using double
The scheme of buffering display solves this problem, and this is also one of innovative point of this patent.The realization principle of double buffering be exactly except
Have on screen outside figure shown, also to have figure in internal memory in drafting.It is exactly that figure to be shown is first in internal memory
Drawn, then the figure in internal memory according to a point, point is covered screen (this process up by property again
It is very fast, because being the regular memory copying of comparison).When so being drawn in internal memory, at will with the big background colour of what contrast
Remove all without flicker, because the graphical user in internal memory can't see.When by memory copying to screen, because internal memory
In final figure and screen display graphic differences very little (if do not changed, certainly just without difference), so handle
Effect would not allow human eye to have the sensation of figure flicker, that is, be retained a function using the vision of mankind itself.
In addition, handling man-machine interaction and data figure shows present invention employs the mode of multithreading, refreshing 205.Main line
Journey is responsible for directly and user mutual, and then create a special worker thread again shows for datagraphic, thus
Main thread is freed, can be with real-time response customer interaction information.Refer here to the programming of multithreading, the communication of cross-thread,
The vc++ software programmings ABC such as control of semaphore and technical ability.Interface display and the flow chart refreshed, as shown in figure 3, tool
Body step is:Step A:Initializing variable;Step B:Wait data display semaphore;Step C:Judge whether that background is redrawn, such as
Fruit then enters step D;As otherwise entered step E;Step D:Rendering context region;Step E:Background area is copied to memory bits
Figure;Step F:Judge whether display memory track, step G is then entered in this way, such as otherwise enters step H;Step G:In memory bits
Internal memory track is drawn in figure;Step H:Memory bitmap is copied to screen display;Step I:Judge whether to terminate, then terminate in this way, such as
Otherwise step B is entered.
(1) show first by pending datas such as MFC functions WaitForSingleObject (, INFINITE)
Show semaphore, operating system typically activates this semaphore when needing to redraw figure;
(2) mapping operation is then carried out in memory device, all figure shows tasks are completed;
(3) and then the bitmap in memory device is entirely copied to and display output operation is completed on window.
(4) judge whether that stopping figure updating display, and (1) is gone to if "No" and is continued executing with, and until terminate.
It is an advantage of the invention that:
1. in solving the expression formula that user is inputted directly comprising complex constants (such as:S21/ (1-S11)+(1+3i)) no
The technical barrier that can be calculated.The formula editors that this patent is provided allow user to directly input complex constants, require nothing more than plural normal
Amount is bracketed with bracket " () ", such as:S21/(1-S11)+(1+3i).Can be answering in expression formula in expression formula computing unit
Number (a+bj) is converted into<a:b>Form is handled, and this processing method efficiently solves user and directly inputs complex constants
The technical barrier can not be parsed into expression formula, calculated.Variable S21 and S11 in expression formula can be complex data types.
The parsing and calculating of whole expression formula are carried out using complex format.When a computable Formula Input Technology to equation editing
Frame, and choose after enable button, the data of the corresponding each measurement point of the currently active geometric locus or figure will be transported by formula
Result is calculated to be replaced, and track can carry out real-time update with data.
2. the formula editors program module provided, which solves user, can not import the technical problem of custom parameter, it is allowed to
User Defined parameter, such as such parameter data [201]={ 0,1,0,1.... }, can using this custom parameter
With discrete processing or some data points are observed, some specific demands of user can be met.In the user interface of editing machine
There is special window input user's new parameter to be imported.Additionally provide the import feature of SQL simultaneously, function is led
Entering is completed by the way of file plus dynamic base, easy to operate.The programming thought of this opening substantially increases this
The durability of program module itself, can apply to equation editing and parsing, the calculating of a variety of testers, both facilitates program
Exploitation again, it is convenient to be provided again for instrument user.
3. the formula editors provided provide the intelligent correction and information prompting function that user inputs expression formula.Work as user
An incalculable formula is inputted, formula editors are capable of the position that points out faults of intelligence, and can provide language exactly
The information alert of method type of error, user can improve operating efficiency according to these prompt messages efficiently correction formula;In addition
In the algorithm process that expression syntax judges, STL (Standard Template Library) STL base is employed
Notebook data structure and rudimentary algorithm, improve the operational efficiency of program.And employ the thought of two-level grammar judgement, primary language
Method judgement can check obvious syntax error, and complicated grammer judges to check that remaining institute is wrong, this classification processing language
The method of method mistake, had not only alleviated the difficulty of syntactic analysis but also had saved the time of whole program processing.
4. occurring the technical problem of waveform or figure flicker for expeditiously real-time drawing function, this patent is to use double buffering
The scheme of display solves this problem.The realization principle of double buffering is exactly in addition to having figure on screen and being shown, inside
Also there is figure in depositing in drafting.Exactly figure to be shown first in internal memory it is drawn, then again property by internal memory
Figure according to the screen that covers of a point, point, (this process is very fast, because being that the regular internal memory of comparison is copied up
Shellfish).What when so being drawn in internal memory, at will understood with the big background colour of contrast all without flicker, because the figure in internal memory
Shape user can't see.When by memory copying to screen, because figure final in internal memory and the figure of screen display
Difference very little (if do not changed, certainly just without difference), the effect so handled would not allow human eye to have what figure flashed
Feel, that is, retained a function using the vision of mankind itself.And the programming idea of multithreading is employed in software architecture
Carry out man-machine interaction and data figure shows, main thread is responsible for directly and user mutual, then creating a special work again
Make thread to show for datagraphic, thus main thread is freed, can be with real-time response human-machine interactive information.
It should be appreciated that for those of ordinary skills, can according to the above description be improved or converted,
And all these modifications and variations should all belong to the protection domain of appended claims of the present invention.