http://www.ngnc.net/ngncalc2x/development_design.htm
"NGNCALC2X Development Manual Annex" System Design Manual Text
table of Contents:
1, project description
2, system design and development plan
3, business operation and market positioning
One: Item Description:
Overview:
The calculator is a functional scientifier calculator, with a function editing and management as the main feature. In addition to the basic functions of the traditional calculator - * / and some advanced function shortcuts, users can expand the functionality of the calculator by using custom functions provided by the system or their editing or downloading custom functions; Keep the key to the operation and design of custom functions;
Calculate:
A computing process is by entering the numbers and functions and obtains the calculation result, the numbers can be arbitrary integers or decimals, and the function can be the system provided and the expandable custom function;
The order of input numbers and functions is not unique. For example,: 1, , 1, = and Fn, , 1, 1 are 2. In this example, the function identification fn and the next input indicate that the "add" function is to be calculated, and the two numbers entered later are two parameters of the "add". Any embedded or custom function can be Alternative "add".
A calculation process can only have one, and there must be a function to participate. The number of functional parameters determines the length of the calculated input;
register:
Because the above calculation process, the calculator must have the ability to record the number for the calculation of the next function;
The user can press the "Next Number" button to use the "," or "return" button to indicate the end of a number, enter the next number. This has some representation of the computer program N0 =? N1 =? N2 =? ...
Calculate: useful control "()" in another calculation process
1, *, (2, , 3,), =; this is a good example shows a special calculation process.
The calculation process is as follows:
> N1 = 1,
> Function "*" is ready, waiting for the input of the next parameter,
> Start another calculation process,
> N2 = 2,> func = sum,> n3 = 3,
> End calculation,
> "*" Another parameter N2 = SUM (N2, N3)
> End 1st calculation "*", N1 = MUL (N1, N2)
> Display the result N1 in the calculator window.
Function Editor:
The editing of a function is basically consistent, and the difference is that the parameter numbers are replaced by variables, and the calculation results are turned to be saved as functions;
During a normal computing input, when the user is changed to press the VARABLE button while the user needs to enter the parameter number, then press the index number or if the number is not automatically added by the system, it is: x1, x2, x3, ... . The user then press the '=' end calculation / function input. If there is a variable in the previous input sequence, the calculator will seek the user to give the function, and save it next time. Here is a set of examples:
X1, , x1, =; it's power2 function. 5, *, (, x1, , 3,) = a formula used to get Some Result. x1, /, 12, = convert inch to feet. x1, * , 12, = Convert Feet to inch.
Function management:
Too many functions need to be managed with tags, or sort in name. Users can easily start the function search menu via the FN key to locate the functions you want.
Users can also define functional hot keys FN1, FN2, etc., fast positioning to your most commonly used functions; Second, system design and development plan:
Thread analysis:
1. Enter the event Waiting Thread: User Enter Site, also the basis of triggering the entire system operation;
2, the screen display thread: User input section, update the changed part of the changed part by querying the CALC state, or all refreshed.
3, the calculation module, according to user input, understanding as calculating behavior, calling the corresponding function calculated. No parallel computing requirements, so use 1 thread;
Conclusion: The calculator is an input response and the display loop, and it is executed in a process;
Module analysis:
I / O analysis, current platform, input mode console mode and window button mode; display mode,
Therefore, there is a need to abstract an unified interface to strip the I / O part of the input and output;
Use NGNC's plugin capability to prepare different plugins for different platforms to provide unified I / O interfaces.
2, calculator data description, and control logic can be independently existent, and is divided with I / O boundary
Use NGNC's script capabilities, describe the core and appearance data, and control flow, easy to improve the core power of the calculator, and the degree of freedom
3, calculator data, and general operation logic are a core, including function operations
4, the management of the function is independent, defined the format of the function library, and the tool is managed separately;
As the most commonly used Window desktop system, manage custom functions, responsible for exchange with other terminals, and interoperability between multiple users. You can even use a web way to implement an automatic function exchange, query, etc.
This section can be done using only one desktop program, or by establishing a web server, it can be small;
Development steps:
1. Under the DOS Console, the function of the basic calculator is implemented, and the system platform is built.
2. Develop the Simulator of the DOS Console, run the above Demo under the window system
3. Expand the calculator core data structure on the basis of DEMO, complete all logic of the function type scientific calculator;
4. On the basis of the Simulator of the DOS Console, the multi-platform I / O is abstracted, simplified to the Plugin development required for multi-platform I / O; the I / O logic as much as possible is NGNC script and data. Form is completed;
5. Develop Windows desktop function management, or web function management system;
Note: Other parts except Demo can be parallel in addition to DEMO;
NGNC scripting rules:
Num Name 1st Char Comments Examples 0 Resv Data Type Int, Float ... 1 Struct Declare T, Name Upper 1st Name Tpushbtn, ... 2 Function Name Name Upper 1st Name DebugLoop, ... 3 Global Varable G_, Name Lower Name g_reg1, ... 4 local varable l_, name limited, ... 5 str attr name m_, name limited name m_attr1, ...
Third, business transportation and market positioning
The target market is locked in the mobile terminal market, and the traditional desktop market is the way of mobile bundling and traditional desktop market for FREE. Excessive development, after clearing the accurate business plan, the Web system is essential;