CN101661279A - Method for realizing configurable interfaces by numerical control machine control software - Google Patents

Method for realizing configurable interfaces by numerical control machine control software Download PDF

Info

Publication number
CN101661279A
CN101661279A CN200910196066A CN200910196066A CN101661279A CN 101661279 A CN101661279 A CN 101661279A CN 200910196066 A CN200910196066 A CN 200910196066A CN 200910196066 A CN200910196066 A CN 200910196066A CN 101661279 A CN101661279 A CN 101661279A
Authority
CN
China
Prior art keywords
interface
code
configuration file
control software
theme
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.)
Pending
Application number
CN200910196066A
Other languages
Chinese (zh)
Inventor
齐伟
汤同奎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Shanghai Naikai Electronic Science and Technology Co Ltd
Original Assignee
SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Shanghai Naikai Electronic Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI WEIHONG TECHNOLOGYCO Ltd, Shanghai Naikai Electronic Science and Technology Co Ltd filed Critical SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Priority to CN200910196066A priority Critical patent/CN101661279A/en
Publication of CN101661279A publication Critical patent/CN101661279A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method for realizing configurable interfaces by numerical control machine control software, which combines a configuration file and source codes together to position and drawinterface elements, thereby separating interface configuration parameters from the codes; the codes for drawing the interface elements can read the interface parameters in the configuration file; andthe interfaces can be changed by changing the parameters. The method successfully and stably realizes the configurable interfaces and achieves the expected effect, thus only the configuration file needs to be modified for providing personalized interfaces for different users, thereby greatly improving the development speed and greatly reducing the error probability.

Description

A kind of numerically-controlled machine Control Software realizes the method for configurable interfaces
Technical field
The present invention relates to numerically-controlled machine Control Software field, particularly a kind of software interface that refers to is realized the method for flexible configuration according to different clients.
Background technology
Manufacturing industry is the basic industry of national economy, and manufacturing level just is to weigh the important symbol of an industrial development degree of country.The height of numerically-controlled machine quality level is concerning the height of national manufacturing industry level.
Control Software plays very important central role in numerically-controlled machine tool system, directly affect problems such as machine tool capability, serviceable life.And Control Software is the mutual interface of numerically-controlled machine and operator, and whether easily software interface has determined lathe operation.So hommization, the software interface that truly reflects customer demand not only can greatly improve operator's work efficiency, and can satisfy the needs of different clients, industry, working environment.Yet parameters such as most of software interface layout, size, color all are directly to write to fix in the middle of the code, in case will appearring in the increase of client's change request, a large amount of interfaces changes work, add the interface and directly frequently call the kernel operations code, the change at interface will increase the chance of makeing mistakes.
Therefore, we need a kind of feasible change interface not need to change code, and configuration interface efficiently, increase, the method for shielding.
Summary of the invention
The purpose of this invention is to provide the method that a kind of numerically-controlled machine Control Software realizes configurable interfaces, overcome above-mentioned shortcoming of the prior art, accomplishing that fast and flexible change configuration file just can be the client under the situation that does not change code provides personalized interface.
The present invention solves the technical scheme that its technical matters takes:
A kind of numerically-controlled machine Control Software realizes the method for configurable interfaces, it is characterized in that it comprises the steps:
(1) rationally divides software interface according to the functional independence of numerically-controlled machine Control Software,, and organize, make each control on the interface that a unique section name all be arranged according to tree-shaped relation of inclusion for each part is got a section name;
(2) corresponding to the INTERFACE DESIGN of Control Software, to the parameter of each section setting as size, position, font, color, shortcut etc.;
(3) write respective code according to the code structure of Control Software, be used for reading parameter and draw control in the configuration file;
When (4) needing the interface of change Control Software, only need the parameter in the corresponding configuration file of change.
In one embodiment of the invention, described configuration file by parameter, the note that is used for describing the section name of a part of specific interface and plays the note effect constitutes.
In one embodiment of the invention, described code comprise have the effect of holding coordination and the CTheme code that content in the configuration file and interfaces windows are glued together, as the CThemePainter code and the overall CTheme object identification code of the OnPaint function of the CThemeImplementer code of the different interfacial configurations of the Theme window code of MFC window object and the bridge of Theme, definition window, objectification Theme window.
Numerically-controlled machine Control Software of the present invention realizes the method for configurable interfaces, combine with source code by configuration file, common location and the drafting of determining interface element, thereby the interface configurations parameter is separated from code, the code of drafting interface element can read the interface parameter in the configuration file, the change parameter just can change the interface, by above method, the stable configurable interfaces of having realized of success, reached Expected Results, make and when providing personalized interface, only need revise configuration file, thereby improve tempo of development greatly, significantly reduce error probability different user.
Description of drawings
Fig. 1 is an embodiments of the invention interface synoptic diagram;
Fig. 2 is the data structure synoptic diagram of CTheme code of the present invention;
Fig. 3 is the data structure synoptic diagram of CThemeFormImplementer code of the present invention;
Fig. 4 is the data structure synoptic diagram of CThemeFormPainter code of the present invention;
Fig. 5 is the member variable synoptic diagram of CThemeData code of the present invention;
Fig. 6 is the synoptic diagram that concerns between each member of Theme of the present invention;
Fig. 7 is the structural representation of CPageFormCtrl class of the present invention.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach purpose and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
Numerically-controlled machine Control Software of the present invention realizes the method for configurable interfaces, and it comprises the steps:
(1) rationally divides software interface according to the functional independence of numerically-controlled machine Control Software,, and organize, make each control on the interface that a unique section name all be arranged according to tree-shaped relation of inclusion for each part is got a section name;
(2) corresponding to the INTERFACE DESIGN of Control Software, to the parameter of each section setting as size, position, font, color, shortcut etc.;
(3) write respective code according to the code structure of Control Software, be used for reading parameter and draw control in the configuration file;
When (4) needing the interface of change Control Software, only need the parameter in the corresponding configuration file of change.
Embodiment
In the present embodiment, be example with software NcStudio, its interface is divided as shown in Figure 1.Adopt tree structure to divide the interface, wherein main represents whole interface, and main is divided into panel, layout, bar three parts, layout is divided into top, switch, bottom again.
Configuration file format and content
The .ini configuration file is set describes whole interface.The form of configuration file is:
Parameter (Parameter)
Parameter is a fundamental of configuration file, and it is made up of parameter name and parameter value, and is middle with the equal sign connection, as name=value.Parameter name is generally by some univocal English words, as
Dim (=dimension) the size of having specified this control in the interface, to show of the parameter value behind this parameter equal sign
Style: the display styles of designated button, its value has following several:
T (=text) mode word;
R (=rtf) rtf file mode;
m(=usememdc);
D (=disable) invisible, but also account for plot, can severally mix into one group with above-mentioned, as dt.
Group: the pattern of designated button, its parameter value are the section names of group.ini file, that is to say that pattern is to define in the group.ini file.
Text: the literal that shows on the button.
Txtfile: specify the rtf file.
Acckey: shortcut.
Tagtxt: the superscript type on the button, as F1, F2 etc.
The size that the tagheight:tag literal is occupied.
Bg (=tag button group): the Show Styles of the literal of tag in the tag button, value also are group section names.
Section name (Section)
Several Parameters can be formed one section, is used for describing the specific interface of a part.Section name must be unique hereof, and the section name has delegation of one's own, is put in the square bracket.The parameter of all Duan Minghou all belongs to this group, up to the appearance or the end of file of another section name.
The section name is made up of a succession of character that is linked to each other by point, and can know from Duan Mingzhong and know which this section partly be described, as:
What [top.lay.main] described is the display message of the button among the top under the layout page
What [mode.bar.main] described is the display message of mode under the bar page
The display message on the top hurdle under [top.panel.main] panel page
Note (Comment)
Carry out note with branch in configuration file, the statement in the delegation behind the branch plays the note effect, and program does not read.As:
;comment?text
Following is one section example of configuration file:
;last?modified?1?April?2001?by?John?Doe
[owner]
name=John?Doe
organization=Acme?Products
[database]
server=192.0.2.42;use?IP?address?in?case?network?name?resolution?is?notworking
port=143
file=”acme?payroll.dat”
Extraneous information in the configuration file
<LANG_CHN〉</LANG_CHN〉and<LANG_ENG〉</LANG_ENG〉language identification when being the perl program translation.Last to the theme of sign during Chinese interface, the English theme of a pair of sign in back.
The function of configuration file is divided
According to the form of above-mentioned configuration file and to the division at NcStudio interface, we have defined following configuration file:
This is one deck of the end for Theme_main.ini, has comprised bar layout panel, and the position and the pattern of this three bulk are configured
Information in the Theme_bar.ini configuration bar viewing area
The position of the button that shows in the Theme_lay.ini configuration lay viewing area
Content displayed among the Theme_panel.ini configuration panel
Lay_log_form.ini Lay_offset_form.ini Lay_para_form.iniLay_pos_form.ini Lay_prog_form.ini Lay_sys_form.ini describes the state of each control, comprises color, font etc.
The perl program can become two file chn/gray.theme and eng/gray.theme with above-mentioned several .ini file translations of mentioning after program compilation, is put under two different directories according to language identification.
The THEME code is realized
Comprise several foundation classs in the framed structure of Theme code, they are CTheme, CThemeImplementer, CThemePainter, CThemeData, Theme window class.Wherein CTheme has the effect of holding coordination, and it is glued together content in the configuration file and Theme window.The Theme window class is the bridge of MFC window object and Theme.CThemeImplementer has defined the different interfacial configurations of window.The CThemePainter objectification OnPaint function of Theme window.The overall situation has only a CTheme object, is created in heap by NcCtrl call function in the initialization procedure of dynamic link library.
The CTheme structure analysis
The CTheme class has been held CThemeImplementor and CThemePainter, reads the data in the theme file, produces the CThemeData data, calls CThemePainter again and draws window.As shown in Figure 2, be its key data structure and power function.
CTheme comprises CThemeImplementor with class, is used for reading configuration file content, and draws with CThemePainter;
Definition m_mapRegister, it is related with the interface that CThemeData is promptly drawn information;
Definition m_mapImplementor is associated character string with CThemeImplementor, as long as configuration file has been specified correct character string, just can find correct CThemeImplementor class;
Defined function Register is associated with the window of user's registration by the name of user's registration;
Defined function RegisterImplementor is by the dll initialization function call of NcCtrl, with the ThemeImplementor in the Accreditation System;
Defined function GetDiscription reads the configuration information of specified window from configuration file;
Defined function ScanDim is called in LoadTheme message response function by each log-in window, and respective window is described and obtained position of window information in the text from configuration file;
Defined function LoadTheme searches the ThemeData of log-in window, produces the ThemePainter object, and its address is composed to ThemeData member;
Defined function DrawTheme searches the CThemeData item of log-in window correspondence, calls the CThemePainter pointer and draws the interface.
The CThemeImplementer structure analysis
CThemeImplementer has CThemeFormImplementer, CThemeButtonImplenter, CThemeFilePosImplementer, ClinearSliderImplementer, the several concrete classes of CTagButtonImplementer.It is derived from by the CObject class self, is used for encapsulating the object that will draw.A same window class can have different Implementer, can realize diverse look ﹠ feel.For example the different-style group that it is cooperated and encapsulated same class implementor with CFormGroup on the one hand in CThemeFormImplementer obtains corresponding CFormPainter interface pointer by member function again, as shown in Figure 3 in addition.
Design base class CThemeImplementor provides the basic interface that obtains configuration information, draw control;
By derived class CThemeImplementor, classes such as CThemeButtonImplementor, CFormImplementor are write in design, are used for specific implementation to obtain the configuration information of controls such as button, the page and draw function.
The CThemePainter structure analysis
ThemePainter is used for the drafting of Implementer.Each concrete Implementer has the Painter of a correspondence.Wherein Draw function call CTheme member draws, and occupy such core position.As shown in Figure 4.
Design class CThemePainter is used for drawing, shows, removes control;
In class CThemeImplementor, use CThemePainter and draw concrete control.
The Theme window analysis
Window class has CThemeButton and CThemeForm.Except the general utility functions of window class, they also finish being written into of Theme when initialization and switching Theme, and call the drafting that ThemePainter finishes window in the OnPaint function.
The CThemeData structure
Four member variables have been defined in the CThemeData class.As shown in Figure 5
Shown relation between each class of Theme code as Fig. 6.
The switching of Theme
The CPageFormCtrl class uses the data input function of Theme to finish the management that the page switches, and himself is not drawn, and just exists as a container class, as shown in Figure 7.
Be CPageFormCtrl defined function LoadTheme, make up the PAGEDATA data of each page;
Defined function SetPage is used for showing certain one page;
Defined function ScanVWARRAY, which visual subwindow each page of scanning has from configuration file, and it is left in the array, is called by LoadTheme.
And the switching of Theme is called by bool CThemeManagerTarget::SetActiveThemeIndex (intnIndex)
CTheme::SetActiveThemeFileName (LPCTSTR pszName_) finishes, and the latter discharges legacy data and is written into new data.
More than show and described ultimate principle of the present invention and principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that describes in the foregoing description and the instructions just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications; these changes and improvements all fall in the claimed scope of the invention, and the claimed scope of the present invention is defined by appending claims and equivalent thereof.

Claims (3)

1, a kind of numerically-controlled machine Control Software realizes the method for configurable interfaces, it is characterized in that it comprises the steps:
(1) rationally divides software interface according to the functional independence of numerically-controlled machine Control Software,, and organize, make each control on the interface that a unique section name all be arranged according to tree-shaped relation of inclusion for each part is got a section name;
(2) corresponding to the INTERFACE DESIGN of Control Software, to the parameter of each section setting as size, position, font, color, shortcut etc.;
(3) write respective code according to the code structure of Control Software, be used for reading parameter and draw control in the configuration file;
When (4) needing the interface of change Control Software, only need the parameter in the corresponding configuration file of change.
2, method according to claim 1 is characterized in that, described configuration file by parameter, the note that is used for describing the section name of a part of specific interface and plays the note effect constitutes.
3, method according to claim 1, it is characterized in that, described code comprise have the effect of holding coordination and the CTheme code that content in the configuration file and interfaces windows are glued together, as the CThemePainter code and the overall CTheme object identification code of the OnPaint function of the CThemeImplementer code of the different interfacial configurations of the Theme window code of MFC window object and the bridge of Theme, definition window, objectification Theme window.
CN200910196066A 2009-09-22 2009-09-22 Method for realizing configurable interfaces by numerical control machine control software Pending CN101661279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910196066A CN101661279A (en) 2009-09-22 2009-09-22 Method for realizing configurable interfaces by numerical control machine control software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910196066A CN101661279A (en) 2009-09-22 2009-09-22 Method for realizing configurable interfaces by numerical control machine control software

Publications (1)

Publication Number Publication Date
CN101661279A true CN101661279A (en) 2010-03-03

Family

ID=41789347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910196066A Pending CN101661279A (en) 2009-09-22 2009-09-22 Method for realizing configurable interfaces by numerical control machine control software

Country Status (1)

Country Link
CN (1) CN101661279A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103534683A (en) * 2011-06-10 2014-01-22 Abb研究有限公司 Dynamic faceplates for multiple objects
CN104133678A (en) * 2014-07-22 2014-11-05 中国石油天然气股份有限公司 Method and device for building and operating SIDIS
CN109741820A (en) * 2018-12-28 2019-05-10 上海联影医疗科技有限公司 Configuration method, device, medical supply and the computer storage medium of medical supply operation pages
CN112526932A (en) * 2020-12-16 2021-03-19 上海维宏电子科技股份有限公司 Method, system, device, processor, storage medium and application for realizing three-level configuration setting management by numerical control processing software

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103534683A (en) * 2011-06-10 2014-01-22 Abb研究有限公司 Dynamic faceplates for multiple objects
CN104133678A (en) * 2014-07-22 2014-11-05 中国石油天然气股份有限公司 Method and device for building and operating SIDIS
CN104133678B (en) * 2014-07-22 2018-01-05 中国石油天然气股份有限公司 The method and device of structure, operation interaction seismic interpretation system
CN109741820A (en) * 2018-12-28 2019-05-10 上海联影医疗科技有限公司 Configuration method, device, medical supply and the computer storage medium of medical supply operation pages
CN112526932A (en) * 2020-12-16 2021-03-19 上海维宏电子科技股份有限公司 Method, system, device, processor, storage medium and application for realizing three-level configuration setting management by numerical control processing software

Similar Documents

Publication Publication Date Title
CN101694603B (en) Cross-platform Mongolian display and intelligent input method based on Unicode
US7376906B2 (en) Binary cache file format for themeing the visual appearance of a computer system
CN101609321A (en) A kind of method of utilizing subroutine call to realize machine tool motion control
CN102789457A (en) Method for dynamically customizing filter conditions
CN101661279A (en) Method for realizing configurable interfaces by numerical control machine control software
US20030023639A1 (en) Application generator for creating web pages
JP2007109221A (en) Part management system, part management method, program and recording medium
CN110502735B (en) Method and system for quickly manufacturing universal process file of electronic equipment
CN102110006A (en) System and method for expanding and developing application business
CN100370454C (en) Device for displaying and operating book in electronic form
EP1447756B1 (en) Network-based document management system
US20030226118A1 (en) Method of uploading and editing words at a network station
US8010563B2 (en) Computer program product and computing system for information organization using markup languages
CN111736829A (en) Method and device for switching page style based on Web internationalization
JP4960188B2 (en) Screen transition diagram display method and system
JP4628169B2 (en) User program search device and program applied thereto
US20020087302A1 (en) Processing system, processing method and recording medium
Renfro Computational econometrics: its impact on the development of quantitative economics
CN112657188B (en) Method and system for skipping keywords in game event text
JP2003108369A (en) Autocreation of program that receives request from web and performs outputting of result
JP2007179494A (en) Data management device, data management method and data management program
JP2004021707A (en) System for converting address and name into roman character
CN116225584A (en) Method and device for switching front-end page language
Kofler Object Reference
Hadden et al. Wow! You Did That Map with SAS/GRAPH®?

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20100303