User interface dynamic extensible development method and system based on software platform
By dynamically extracting the form type information in the software platform runtime library, a dynamically derived basic form is formed, which solves the problem of restricted user interface development in the existing technology, and achieves more flexible and efficient interface expansion development.
Patent Information
- Application Number
- CN202510616685.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-08-26
AI Technical Summary
The existing software platform only allows users to use empty forms and control lists for user interface development, resulting in a single interface style and simple controls, which makes it impossible to achieve more pioneering designs.
The interface manager dynamically extracts the form type information in the software platform runtime library, forms a dynamically derived basic form, and generates imported code, allowing users to expand development without modifying the platform code.
It realizes efficient extension development of existing forms, and users can carry out highly customized development without compiler compilation to generate forms with more functions.
Smart Images

Figure CN120540650A_ABST
Abstract
Description
[0001] This case is a divisional application of 2024100285584, a method and system for dynamically extensible development of user interface based on software platform. Technical Field
[0002] The present invention belongs to the technical field of vehicle software development, and in particular relates to a method and system for dynamically scalable development of a user interface based on a software platform. Background Art
[0003] Currently, software platforms on the market that can be used for secondary development of user interfaces only allow users to use the empty forms and control lists they provide for development. For example, users drag controls from the list to the empty form, set properties, associate control events, and write event code to complete extended development. Summary of the Invention
[0004] The present invention relates to a method and system for dynamically extensible development of a user interface based on a software platform, wherein the method comprises:
[0005] During the operation of the software platform, the interface manager dynamically extracts the form-related type information in the software platform runtime library, inherits the type information to form a dynamically derived basic form, and at the same time generates the software platform import code; and generates a one-time form dynamic creation code based on the type information in the software platform import code, and stores the software platform import code and the one-time form dynamic creation code in a one-time derived code file.
[0006] In another aspect, the present invention further provides a software platform-based dynamically extensible user interface development system, comprising:
[0007] The basic dynamic derivation module is configured to dynamically extract form-related type information from the software platform runtime library through the interface manager during the software platform operation process, inherit the type information to form a dynamically derived basic form, and generate the software platform import code by the interface manager;
[0008] The derived code acquisition module is configured to generate a code for dynamically creating a form based on the type information in the software platform import code, and store the software platform import code and the code for dynamically creating a form into a derived code file.
[0009] In a third aspect, the present invention further provides a computer-readable storage medium configured to store a program for executing the aforementioned method for dynamically extensible development of a user interface based on a software platform.
[0010] In a fourth aspect, the present invention further provides a processor configured to execute the program of the software platform-based dynamic and extensible user interface development method as described above.
[0011] In a fifth aspect, the present invention further provides an electronic device comprising: a processor, a readable storage medium, a communication bus, and a communication interface; wherein the processor, the readable storage medium, and the communication interface communicate with each other via the communication bus;
[0012] The readable storage medium is used to store a program for executing the aforementioned method for dynamically extensible user interface development based on a software platform, and the processor is configured to execute the program for dynamically extensible user interface development based on a software platform.
[0013] In a sixth aspect, the present invention further provides a computer device, comprising: a processor; and
[0014] A readable storage medium and a display module electrically connected to the processor; wherein
[0015] The readable storage medium is used to store a program for executing the aforementioned method for dynamically extensible development of a user interface based on a software platform;
[0016] The processor is configured to execute the program to generate a corresponding user interface;
[0017] The display module is configured to display the user interface.
[0018] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0019] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 A diagram showing the steps of a method for dynamically extensible development of a user interface based on a software platform according to some embodiments;
[0022] Figure 2 A schematic diagram showing an interface manager involved in some embodiments is shown;
[0023] Figure 3 A schematic diagram of a dynamically derived basic form after dynamic derivation according to some embodiments is shown;
[0024] Figure 4 A partial list of controls involved in some embodiments is shown;
[0025] Figure 5 Shows some entries of design window properties involved in some embodiments;
[0026] Figure 6 shows some entries of control properties involved in some embodiments;
[0027] Figure 7 A graphics display window titled "Graphics 1" according to some embodiments is shown;
[0028] Figure 8 The screenshot image of the target file named "C:\screenshots\graphics.png" involved in some embodiments is shown;
[0029] Figure 9 A principle block diagram of a software platform-based user interface dynamic extensible development system according to some embodiments is shown;
[0030] Figure 10 A functional block diagram of an electronic device involved in some embodiments is shown. DETAILED DESCRIPTION
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0032] Currently, software platforms available on the market that allow for secondary development of user interfaces only allow users to develop using the empty forms and control lists they provide. For example, users drag controls from a list into an empty form, set properties, associate control events, and write event code to complete extended development. This extension method restricts users to the empty forms and limited controls provided by the software platform, making it impossible to develop extensions based on the software platform's existing forms, such as graphics drawing forms and system message forms. It also prevents users from designing new controls from scratch that are not in the control list. This way, the extended design of the user interface is largely limited by the software platform itself, resulting in a user interface with a single style, simple controls, and simple functions, making it impossible to achieve more innovative designs.
[0033] Therefore, at least one embodiment provides a method for dynamically extensible development of a user interface based on a software platform, comprising:
[0034] During the operation of the software platform, the interface manager dynamically extracts the form-related type information in the software platform runtime library, and inherits the type information to form a dynamically derived basic form. At the same time, the interface manager generates the software platform import code; and generates a one-time form dynamic creation code based on the type information in the software platform import code, and stores the software platform import code and the one-time form dynamic creation code in a one-time derived code file.
[0035] Various non-limiting implementations of the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0036] like Figure 1 As shown, some embodiments provide a method for dynamically extensible development of a user interface based on a software platform, including:
[0037] Step S101: During the operation of the software platform, the interface manager dynamically extracts form-related type information from the software platform runtime library, inherits the type information to form a dynamically derived basic form, and simultaneously generates a software platform import code.
[0038] Step S102: Generate a code for dynamically creating a primary form based on the type information in the software platform import code, and store the software platform import code and the code for dynamically creating a primary form into a primary derived code file.
[0039] In some embodiments, if N+1 derivative modifications are performed on the properties and / or call events of the dynamically derived basic form, an N+1 derivative code file is created, wherein the N+1 derivative code file includes: N-derived code file import code, N+1 form dynamic creation code and / or user code, where N≥1;
[0040] Running the N+1 derived code files forms an N+1 derived user interface.
[0041] In some embodiments, during the operation of the software platform, the method for the interface manager to dynamically extract form-related type information from the software platform runtime library includes:
[0042] Import the RTTI unit. That is, before using the RTTI unit, you need to import the system runtime type information (such as `System.Rtti`) unit in the internal implementation code of the software platform to use the classes and methods related to the form in the RTTI unit;
[0043] Use the "Runtime Type Information Context Type" in the system runtime type information unit (such as
[0044] `TRttiContext`) class to create a context object, and then obtain the "runtime type information" (such as `TRttiType`) object of the form through the "get runtime type information type" (such as `GetRttiType`) method; and
[0045] Through the form's "runtime type information" (such as `TRttiType`) object, use the "get property" (such as `GetProperties`) method to obtain the form's property information and use the "get method" (such as
[0046] `GetMethods`) method to get the method information of the form.
[0047] This embodiment implements dynamic derivation by dynamically extracting form-related type information from the software platform runtime library during the software platform's operation, and inheriting the type information to form a dynamically derived basic form. It should be explained that dynamic derivation refers to dynamically extracting various type information of basic forms in the program's runtime environment during the program's operation, and dynamically creating new form types based on this basic form type information. These new form types are derived from the aforementioned extracted basic form types, and these new form types can be used to create new form objects. Compared with static derivation, dynamic derivation can dynamically create objects, dynamically call methods, dynamically access properties, implement dynamic type conversion and compatibility checks, traverse enumeration and collection types, and customize properties. In other words, dynamic derivation can achieve more flexible and dynamic programming, making the code more scalable and maintainable. The dynamic extension development method of this embodiment is applied to the user interface development of the software platform, so that users can expand and develop the existing windows of the software platform without modifying the software platform code or calling the compiler to compile the software. The developed windows not only have various functions given to the windows by the software platform, but are also special windows that are highly customized by users, which makes the user interface development based on the software platform more efficient and concise.
[0048] Specifically, dynamic extraction refers to the extraction of window type information from the runtime environment (in this case, the window in the software platform runtime library) during program execution. Dynamic extraction requires the program to have an RTTI mechanism. The RTTI mechanism is explained as follows: RTTI (Run-Time Type Information) is a mechanism for obtaining type information during program execution. It allows detailed information about classes, interfaces, methods, properties, and so on to be obtained at runtime, including their names, types, and access modifiers.
[0049] Specifically, the form type information refers to the basic information of the form in the software platform runtime library, such as the form type name information, parent class information, attribute information, method information, field information, constructor and destructor information, interface information, enumeration information, etc.
[0050] like Figure 2 As shown, the interface manager is used to create, list, design, save, import, export, encrypt, and run user interfaces, thereby achieving comprehensive management of the designed user interfaces.
[0051] The method by which the interface manager dynamically extracts form-related type information from the software platform runtime library is as follows:
[0052] By calling the Get Type function in the context object provided in the "System Runtime Type Information" unit, the form-related type information in the software platform runtime library is obtained.
[0053] The obtained type information is used to further obtain information about the form's fields, properties, methods, etc. The inheritance and derivation methods are as follows:
[0054] Based on the acquired form information, a new derived form type is defined, namely a dynamically derived basic form, which is used to inherit the form-related type information in the software platform runtime library. That is, the dynamically derived basic form can call the protected and public methods of the form-related type information in the inherited software platform runtime library, read and write its properties, read and write its fields, and so on.
[0055] Based on the defined dynamically derived base form, the software platform allows users to add new fields, methods, and properties to the dynamically derived base form and control its behavior. This allows users to dynamically inherit and derive new forms based on the acquired software platform form type information.
[0056] The following example illustrates how the interface manager dynamically extracts form-related type information from the software platform runtime library and inherits the type information to form a dynamically derived base form during software platform operation:
[0057] Dynamically derive the basic form of the software platform to form a new form type, thereby creating a new form object. The new form object is the dynamically derived basic form. The following steps are required:
[0058] 1. Import the RTTI unit: Before using the RTTI unit, you need to import the `System.Rtti` unit in the software platform's internal implementation code in order to use the classes and methods related to the basic form in the RTTI unit.
[0059] 2. Get the form type information: Use the `TRttiContext` class to create a context object, and then use the `GetRttiType` method to get the `TRttiType` object of the base form. You can get the corresponding `TRttiType` object by the base form's type name or instance.
[0060] 3. Extract form properties and methods: Through the `TRttiType` object of the basic form, you can use
[0061] Use the `GetProperties` method to retrieve the properties of a base form, and the `GetMethods` method to retrieve the methods of a base form. You can traverse the properties and methods of a base form, obtaining information such as the name and type of its properties, and the names and parameters of its methods.
[0062] 4. Based on the extracted type information, a primary derived type is dynamically created, inheriting the extracted base form type information, thereby forming a form subtype. The form subtype is instantiated to obtain the dynamically derived base form. During the process of forming the dynamically derived base form, the generated software platform import code and the primary form dynamic creation code generated based on the type information in the software platform import code are stored in a primary derived code file.
[0063] like Figure 3 As shown, Figure 3 The left side is the saved content of the first derived code file, where frmTSForm is the basic form type of the software platform, and new_ is the form subtype derived from the basic form type. Figure 3 On the right side is the dynamically derived basic form obtained after the form subtype new_ is instantiated. It can be seen that since it inherits the basic form type frmTSForm, the new dynamically derived basic form also has several buttons 10 and drop-down menus in the upper right corner of the toolbar included in the basic form type, and has the functions of corresponding button click events and drop-down menu operation events.
[0064] In some embodiments, user code refers to code written by the user. Because the primary derived code file is derived based on the software platform's build language and forms the existing content of the software platform, the primary derived code file is not editable and does not include user code. However, when modifying the properties and / or call events of a dynamically derived base form, the user can modify the properties and / or call events of the dynamically derived base form by writing code. Therefore, the N+1th derived code file may include user code.
[0065] In some embodiments, the user can also modify the properties and / or call events of the dynamically derived basic form by adding callable controls to the dynamically derived basic form; the callable control setting is a control list formed by the software platform system after summarizing the user's usage habits, such as Figure 4 As shown in the right area, the controls in the control list are called callable controls. Users can embed these callable controls into the dynamically derived basic form by, for example, but not limited to, dragging and dropping from the control list.
[0066] In some embodiments, after the derivation behavior is completed, the corresponding derived code file is run to form a derived user interface for interface interaction with the user.
[0067] In some embodiments, the software platform import code may be in Python code language, including: from software platform name import * or import software platform name.
[0068] In some embodiments, the software platform import code may also be in C or C++ code language, including: #include "software platform name".
[0069] Taking a case as an example, the specific process of inheriting the type information to form a dynamically derived basic form and deriving and modifying the properties and / or call events of the dynamically derived basic form is described in detail as follows:
[0070] Assume that the form type in the basic form type information is TForm, the software platform user uses the form design tool provided by the software platform to inherit the form type TForm to form a form subtype TBaseForm, and the subtype form is instantiated to form the dynamically derived basic form.
[0071] If a help button that is displayed on top is added to the dynamically derived basic form, that is, a button control is embedded in the dynamically derived basic form, then the software platform user can click the code generation button on the form design tool to obtain the form dynamic creation code and the corresponding control creation code of the dynamically derived basic form:
[0072]
[0073]
[0074] Among them, "def__init__(self):" is the form creation event function definition, which automatically calls the event to modify its properties. In the above case, the button creation function "Button(self)" is used to assign a value to the dynamically derived basic form property "btnHelp"; then the button control property "Parent" is set to this dynamically derived basic form, so that the button control can be displayed on the dynamically derived basic form; then the button control property "Align" is set to "alTop" so that the button control can be aligned at the top of the dynamically derived basic form; then the button control property "Caption" is set to "Help" so that the title of the button control is displayed as "Help", which is help information.
[0075] As an optional implementation manner of some embodiments, the properties include: visual elements of forms and controls and sub-members of forms and controls; the sub-members are functional variables and / or behavioral characteristic variables of forms and controls; the calling events include: one or more events of user interaction events, form and control life cycle events, and form and control functional events.
[0076] In some embodiments, the properties also include: visual elements and sub-members of the control; the sub-members are functional variables and / or behavioral characteristic variables of the control; the calling events include: one or more events of user interaction events, control life cycle events, and control function events.
[0077] In some embodiments, the visual elements of the window include, but are not limited to, the color of the window body, the width of the window body, the height of the window body, the text information displayed in the window body, and the coordinates of the window body in the main screen, transparency, icons, cursor type, etc.; the visual elements of the control include, but are not limited to, the color of the control, the width of the control, the height of the control, the text information displayed in the control, and the coordinates of the control in the parent control, transparency, icons, cursor type, etc.
[0078] like Figure 5 As shown, the property items on the right show some properties of the form.
[0079] like Figure 6 As shown, the property items on the right show some properties of the control.
[0080] In some embodiments, the functional variables of windows and controls include, but are not limited to: font, drag and drop type, double buffer flag, right-click menu, help file, label value, etc.; the behavioral characteristic variables of windows and controls include, but are not limited to: activation status, visibility, alignment, automatic adaptation of size, etc.
[0081] In some embodiments, user interaction events include, but are not limited to, click events, cursor key press events, cursor key pop-up events, cursor entry events, cursor movement events, cursor exit events, keyboard press events, keyboard pop-up events, etc.; form and control life cycle events include, but are not limited to, creation events, destruction events, etc.; form and control function events include, but are not limited to, timing events, display events, hiding events, size change events, drawing events, etc.
[0082] In some embodiments, the method for deriving and modifying the properties and / or call events of a dynamically derived basic form includes: writing the properties of the form by assignment and / or associating the event handling function with the call event of the form by assignment, and forming a call relationship with the user code.
[0083] In some embodiments, the method for deriving and modifying the properties and / or call events of a dynamically derived basic form includes: writing the properties of the control by assignment and / or associating the event handling function with the call event of the control by assignment, and forming a call relationship with the user code.
[0084] Taking a case as an example, the specific process of writing the form's properties by assignment and forming a calling relationship with the user code is as follows:
[0085] Assuming the base form's type information lists the form type as TForm, the software platform user uses the form design tool provided by the software platform to inherit the form type TForm, creating a form subtype TBaseForm. This subtype form, after instantiation, forms the dynamically derived base form. In the form design tool, the software platform user modifies the Tag property of the dynamically derived base form to 1 and then clicks the Generate Code button to obtain the code for dynamically creating the dynamically derived base form:
[0086]
[0087]
[0088] Wherein "self.Tag=1" indicates writing into the Tag property of the dynamically derived basic form by assignment.
[0089] In this case, you can also modify the properties of the dynamically derived base form and / or call events through user code added by the user. For example, in the user code, the user can determine the corresponding action based on the Tag property of the dynamically derived base form. For example, when the Tag is 1, set the title bar text of the dynamically derived base form to "Run Mode = 1". The user code is as follows:
[0090]
[0091] Among them, "if 1 == self.Tag:" indicates that the user code forms a calling relationship with the attribute "Tag" of the dynamically derived basic form to call the attribute "Tag" of the dynamically derived basic form, and then determine the next action of the dynamically derived basic form.
[0092] Continuing with the above example, the specific process of associating the event handling function with the form's call event through assignment and forming a calling relationship with the user code is described in detail as follows:
[0093] In the user code, the user can associate the display event of the dynamically derived base form to update the title bar text of the dynamically derived base form in the display event. The user code is as follows:
[0094]
[0095] Among them, "def on_show(Sender):" is a user-defined event processing function, in which the user resets the title bar text of the dynamically derived basic form.
[0096] "on_show" means that the user associates the custom event handling function with the display event of the dynamically derived basic form by assigning a value.
[0097] Taking a case as an example, the specific process of writing the properties of a control by assignment and forming a calling relationship with the user code is described in detail as follows:
[0098] Assuming the base form's type information lists the form type as TForm, the software platform user uses the form design tool provided by the software platform to inherit the form type TForm, creating a form subtype TBaseForm. This subtype of form, after instantiation, forms the dynamically derived base form. In the form design tool, the software platform user adds a button, btnTest, to the dynamically derived base form, changes the tag of the button btnTest to 1, and then clicks the Generate Code button in the form design tool to obtain the form dynamic creation code for the dynamically derived base form and the control creation code for the button btnTest:
[0099]
[0100] Wherein "self.btnTest = Button(self)" is the code used to create the control of button btnTest;
[0101] "self.btnTest.Tag=1" means writing the Tag attribute of the button through assignment.
[0102] In this case, you can also modify the properties of the control and / or call events through user code added by the user. For example, in the user code, the user can determine the corresponding action based on the Tag property of the btnTest button. For example, when the Tag is 1, the text of the btnTest button is set to "Run Mode = 1". The user code is as follows:
[0103]
[0104] Among them, "if 1 == self.btnTest.Tag:" indicates that the user code forms a calling relationship with the attribute "Tag" of the button btnTest, so as to call the attribute "Tag" of the button btnTest and then determine the next action of the button btnTest.
[0105] As an optional implementation of some embodiments, writing the properties of the form by assignment and forming a calling relationship with the user code includes:
[0106] Call the form's own function library, build corresponding parameters and pass them into the API function.
[0107] Taking a case as an example, the specific process of calling the form's own function library and constructing the corresponding parameters to pass into the API function is described in detail as follows:
[0108] In the form design tool, the user sets the width, height, left margin, and top margin of the dynamically derived basic form. For example, if width = 200, height = 100, left margin = 50, and top margin = 30, the corresponding code snippet for dynamically creating the generated form is as follows:
[0109] self.SetBounds(50,30,200,100)
[0110] "SetBounds" is one of the functions of the dynamically derived basic form. Its function is to set the position and size of the dynamically derived basic form in the main screen. It carries four parameters. Assume that the corresponding list of parameter names and parameter values is as follows:
[0111] Parameter name Parameter value Left 50 Top 30 Width 200 Height 100
[0112] When the "SetBounds" function is called, the position of the dynamically derived base form is set to 50 pixels from the left side of the main screen and 30 pixels from the top of the main screen. At the same time, its width is set to 200 pixels and its height is set to 100 pixels.
[0113] As an optional implementation method of some embodiments, writing the properties of the control by assignment and forming a calling relationship with the user code includes:
[0114] Call the control's own function library, build corresponding parameters and pass them into the API function.
[0115] Taking a case as an example, the specific process of calling the control's own function library and constructing the corresponding parameters to pass into the API function is described in detail as follows:
[0116] In the form design tool, the user adds three items to the list box control (TControl), namely "Item 1", "Item 2" and "Item 3". The corresponding control creation code snippet is as follows:
[0117] self.ListBox1.Items.Assign(['Item 1','Item 2','Item 3'])
[0118] "Items.Assign" is a function within the listbox control that sets the listbox's contents. It takes a single parameter, a string array. When this function is called, the listbox's contents are updated to three lines of text: Item 1, Item 2, and Item 3.
[0119] As an optional implementation of some embodiments, writing the properties of the form by assignment and forming a calling relationship with the user code includes:
[0120] Call the user's function library and pass the form's properties as parameters to the API function.
[0121] Taking a case as an example, the specific process of calling the user's function library and passing the properties of the dynamically derived basic form as parameters to the API function is described in detail as follows:
[0122] The user's function library "userlib" contains an API function that sets the form to the foreground. Its Python prototype is defined as follows:
[0123] def set_top_most(AHandle:int)->None:"set window to top most"
[0124] This function has one parameter, which is the window handle. To use this user function library, you first need to import the library in your code. The code is as follows:
[0125] import userlib
[0126] Secondly, the user adds the following calling code to call the user function in the user code:
[0127] userlib.set_top_most(self.Handle)
[0128] When the user function is called, the handle of the dynamically derived basic form is passed into the user function, that is, the dynamically derived basic form will be placed in the foreground.
[0129] As an optional implementation method of some embodiments, writing the properties of the control by assignment and forming a calling relationship with the user code includes:
[0130] Call the user's function library and pass the control's properties as parameters to the API function.
[0131] Taking a case as an example, the specific process of calling the user's function library and passing the control properties as parameters to the API function is described in detail as follows:
[0132] The user's function library "userlib" contains an API function for setting the text box style. Its Python prototype is defined as follows:
[0133] def set_edit_style(AEdit:TEdit)->None:"set text edit style"
[0134] This function has one parameter, which is a text box object. To use this user function library, you first need to import the library in your code. The code is as follows:
[0135] import userlib
[0136] Secondly, the user adds the following calling code to call the user function in the user code:
[0137] userlib.set_edit_style(self.edtTitle)
[0138] When the user function is called, the text box object edtTitle is passed into the user function, and the font style of the text box will be changed by the function.
[0139] As an optional implementation of some embodiments, writing the properties of the form by assignment and forming a calling relationship with the user code includes:
[0140] Call the function library of the software system and pass the properties of the form as parameters to the API function.
[0141] Taking a case as an example, the specific process of calling the function library of the software system and passing the properties of the dynamically derived basic form as parameters to the API function is described in detail as follows:
[0142] Assume that in this case, the dynamically derived basic form is a graphic display form provided by the software platform, and the graphic display form refers to a form provided by the software platform for displaying graphic curves.
[0143] There is a function for taking screenshots of a form in the function library "app" of the software system. Its Python prototype is defined as follows:
[0144] def take_screenshot(ACaption:str,AFileName:str)->None:"takescreenshot ofspecific form and save it to disk"
[0145] This function has two parameters. The first parameter is the form title name in text format, which is used to find the corresponding design form in the software platform; the second parameter is the target file name, which is used to save the screenshot image file to the hard disk. To use the function library of this software system, you must first import the software platform name in the user code, as shown below:
[0146] Import software platform name
[0147] Secondly, the user adds the calling code of the software system function in the user code as follows:
[0148] app.take_screenshot("Graphics 1",r"C:\screenshots\graphics.png")
[0149] like Figure 7 and Figure 8 As shown in the figure, when the software system function is called, the title name of the graphics display window "Graphics 1" and the target file name "C:\screenshots\graphics.png" are passed to the software system function, and the screenshot information of the graphics display window will be saved to the hard disk. In addition, Figure 7 It can be seen that the derived graphic display form also has the several buttons 10 and the drop-down menu in the upper right corner of the toolbar included in the basic form type, and has the functions of corresponding button click events and drop-down menu operation events.
[0150] As an optional implementation method of some embodiments, writing the properties of the control by assignment and forming a calling relationship with the user code includes:
[0151] Call the function library of the software system and pass the properties of the control as parameters to the API function.
[0152] Taking a case as an example, the specific process of calling the function library of the software system and passing the properties of the control as parameters to the API function is described in detail as follows:
[0153] The software system's function library "app" contains a function for setting system variables in the software platform. Its Python prototype is defined as follows:
[0154] def set_system_var_generic(AName:str,AValue:str)->None:"setsystemvariable value from string"
[0155] This function has two parameters. The first parameter is the system variable name, which is used to find the corresponding system variable in the software platform; the second parameter is the target setting value in the form of a string, which is used to set the value of the corresponding system variable to the target setting value. To use this software system function library, you first need to import the software platform name in the user code, as shown below:
[0156] Import software platform name
[0157] Secondly, the user adds the calling code of the software system function in the user code as follows:
[0158] app.set_system_var_generic('sysvar1',self.Button1.Caption)
[0159] The first parameter "sysvar1" passed in specifies the name of the corresponding system variable as "sysvar1".
[0160] The second parameter passed in uses the string value of the "Caption" property of the control "Button1" as the target setting value of the corresponding system variable.
[0161] If the string value of the "Caption" property of the control "Button1" is "3.5", then after calling the software system function, the value of the system variable "sysvar1" will be rewritten to "3.5".
[0162] As an optional implementation of some embodiments, writing the properties of the form by assignment and forming a calling relationship with the user code includes:
[0163] Call the function library of the code language and pass the form properties as parameters to the API function.
[0164] Taking a case as an example, the specific process of calling the function library of the code language and passing the form properties as parameters to the API function is as follows:
[0165] Taking Python as an example, the calling code of the code language function added by the user in the user code is as follows:
[0166] self.Memo1.Text=dir(self.Icon)
[0167] "dir" is a function provided by the code language, which is used to obtain all the contents of a class or a module, including variables, methods, functions, and classes.
[0168] When the code language function is called, all the contents in the icon properties of the dynamically derived basic form are read into the multi-line text box "Memo1" by passing in the parameter "self.Icon".
[0169] As an optional implementation method of some embodiments, writing the properties of the control by assignment and forming a calling relationship with the user code includes:
[0170] Call the function library of the code language and pass the properties of the control as parameters to the API function.
[0171] Taking a case as an example, the specific process of calling the function library of the code language and passing the properties of the control as parameters to the API function is explained in detail as follows:
[0172] Taking Python as an example, the calling code of the code language function added by the user in the user code is as follows:
[0173] print(self.Button1.Caption)
[0174] Here, “print” is a function provided by the code language, which is used to print the character string of the corresponding parameter in the software system.
[0175] When the code language function is called, the "Caption" property of the control "Button1", that is, the label content of the control "Button1", is printed to the software system by passing in the parameter "Button1.Caption".
[0176] In summary, by modifying the properties and / or call events of the dynamically derived basic form and the controls embedded in the dynamically derived basic form, the modified and derived form of the dynamically derived basic form can be realized. The user can also modify and derive the dynamically derived basic form multiple times according to usage requirements, and each modification and derivation is performed on the basis of the previous modification and derivation. For example, the vehicle manufacturer can continue to add important vehicle-related signals to the graphic display form after the dynamic derived basic form is modified and derived once, and display them at a fixed position in the graphic display form, such as displaying vehicle speed, wheel speed, etc., to form a secondary modified and derived graphic display form. Different parts manufacturers can continue to add special signals belonging to their respective parts manufacturers in their corresponding forms based on the secondary modified and derived graphic display form issued by the vehicle manufacturer, and display them in a fixed position in the secondary modified and derived graphic display form, such as displaying braking deceleration, yaw angular velocity, etc., thereby forming three or even more modified and derived graphic display forms.
[0177] like Figure 9 As shown, some embodiments further provide a software platform-based dynamically extensible user interface development system, including:
[0178] The basic dynamic derivation module is configured to dynamically extract form-related type information from the software platform runtime library through the interface manager during the software platform operation process, inherit the type information to form a dynamically derived basic form, and generate the software platform import code by the interface manager;
[0179] The derived code acquisition module is configured to generate a code for dynamically creating a form based on the type information in the software platform import code, and store the software platform import code and the code for dynamically creating a form into a derived code file.
[0180] Among them, the specific implementation functions of the basic dynamic derivation module and the derived code acquisition module are implemented in a processor or a computer device. For details, please refer to the content of the aforementioned dynamic and extensible development method of the user interface based on the software platform, which will not be repeated here.
[0181] The following describes the electronic devices involved in some embodiments from the perspective of hardware processing, but does not limit the specific implementation of the electronic devices.
[0182] like Figure 10 As shown, the electronic device includes: a processor, a readable storage medium, a communication bus and a communication interface; wherein the processor, the readable storage medium and the communication interface communicate with each other through the communication bus; the readable storage medium is used to store a program for executing the method for dynamically extensible development of a user interface based on a software platform, and the processor is configured to execute the program for dynamically extensible development of a user interface based on a software platform.
[0183] In other embodiments, a computer device or an industrial computer can also be used as a type of electronic equipment.
[0184] Figure 10 The structure shown does not limit the electronic device and may include fewer or more components than shown in the figure, or combine some components, or arrange the components differently.
[0185] In some embodiments, the communication interface may be an RS232, RS485, USB port, or TYPE port, which may be connected to an external bus adapter. It may also include a wired or wireless network interface. The network interface may optionally include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is typically used to establish a communication connection between the computer device and other electronic devices.
[0186] Among them, the readable storage medium or computer-readable storage medium includes at least one type of memory, and the memory includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, it can be an internal storage unit of a computer device, such as the hard disk of the computer device. In other embodiments, the memory can also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Furthermore, the memory can also include both an internal storage unit of the computer device and an external storage device. The memory can not only be used to store application software and various types of data installed in the computer device, such as computer program code, but can also be used to temporarily store data that has been output or is to be output.
[0187] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, used to run program codes stored in a memory or process data, such as executing a computer program.
[0188] In some embodiments, the communication bus may also be an input / output bus, which may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0189] In some embodiments, a computer device includes: a processor; and a readable storage medium and a display module electrically connected to the processor; wherein the readable storage medium is used to store a program for executing the software platform-based dynamic and extensible user interface development method; the processor is configured to execute the program to generate a corresponding user interface; and the display module is configured to display the user interface.
[0190] Optionally, the computer device may further include a user interface, which may include a display and an input unit such as a keyboard. Optionally, the user interface may also include a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display may also be appropriately referred to as a display screen or display unit, and is used to display information processed by the computer device and to display a visual user interface.
[0191] When the processor executes the program, the above Figure 1 The steps in the embodiment of the software platform-based user interface dynamic extensible development method are shown, for example Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules or units in the above-mentioned device embodiments are realized.
[0192] This embodiment also provides a computer-readable storage medium, which stores a program of a dynamic and extensible user interface development method based on a software platform. When the program is executed by a processor, the specific steps of the dynamic and extensible user interface development method based on a software platform can be implemented. Please refer to the specific description of the dynamic and extensible user interface development method based on a software platform, which will not be repeated here.
[0193] Some embodiments further provide a computer program product, including a computer program or instructions, wherein when the computer program or instructions are executed on a computer, the computer is enabled to execute any possible software platform-based dynamic and extensible user interface development method described above.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a portion of code, and the module, program segment or a portion of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0195] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0196] If the functions are implemented in the form of software modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0197] With the above-described preferred embodiments of the present invention as a guide, and with reference to the above description, relevant personnel are fully capable of making various changes and modifications without departing from the technical scope of this invention. The technical scope of this invention is not limited to the contents of the specification and must be determined according to the scope of the claims.
Claims
1. A method for dynamically extensible development of a user interface, characterized in that: include: During the operation of the software platform, the interface manager dynamically extracts form-related type information from the software platform runtime library, including: Importing the system runtime type information unit into the internal implementation code of the software platform to use the classes and methods related to the form in the unit; Create a context object using the "Runtime Type Information Context Type" class in the system's runtime type information unit, and then obtain the form's "Runtime Type Information" object using the "Get Runtime Type Information Type" method; and Use the "Get Properties" method to get the form's property information and the "Get Methods" method to get the form's method information through the form's "Runtime Type Information" object.
2. The method for dynamically scalable user interface development based on a software platform according to claim 1, characterized in that: The interface manager is used to create, list, design, save, import, export, encrypt and run user interfaces.
3. The method for dynamically scalable user interface development according to claim 1, characterized in that: The system runtime type information unit is the `System.Rtti` unit; The "runtime type information context type" class is the `TRttiContext` class; The "get runtime type information type" method is the `GetRttiType` method; The "runtime type information" object is a `TRttiType` object; The "get properties" method is the `GetProperties` method; and The "get method" method is the `GetMethods` method.
4. The method for dynamically scalable user interface development according to claim 3, characterized in that: Get the fields, properties, and method information related to the form through the obtained type information; as well as Based on the acquired form information, a dynamically derived basic form is defined to inherit form-related type information in the software platform runtime library.
5. The method for dynamically scalable user interface development according to claim 4, characterized in that: If N+1 derivative modifications are performed on the properties and / or call events of the dynamically derived basic form, an N+1 derivative code file is created, wherein the N+1 derivative code file includes: N-derived code file import code, N+1 form dynamic creation code and / or user code, where N≥1; and The N+1 derived code files are run to form an N+1 derived user interface.
6. The method for dynamically scalable user interface development according to claim 5, characterized in that: The properties of the dynamically derived basic form include: visual elements and child members of the form; The sub-members are function variables and / or behavior characteristic variables of the form; The calling event includes: one or more events of user interaction event, form life cycle event, and form function event.
7. A user interface dynamic extensible development system, characterized in that: include: The basic dynamic derivation module is configured to dynamically extract form-related type information in the software platform runtime library through the interface manager during the software platform operation process.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium is configured to store a program for executing the method for dynamically extensible development of a user interface according to any one of claims 1 to 6.
9. A processor, characterized in that: The processor is configured to execute a program of the method for dynamically extensible development of a user interface according to any one of claims 1 to 6.
10. An electronic device comprising: Processor, readable storage medium, communication bus and communication interface; wherein the processor, the readable storage medium and the communication interface communicate with each other via the communication bus; The readable storage medium is used to store a program for executing the method for dynamically extensible user interface development according to any one of claims 1 to 6, and the processor is configured to execute the program for the method for dynamically extensible user interface development.
11. A computer device, characterized in that: include: processor; as well as a readable storage medium and a display module electrically connected to the processor; in The readable storage medium is used to store a program for executing the method for dynamically extensible development of a user interface according to any one of claims 1 to 6; The processor is configured to execute the program to generate a corresponding user interface; The display module is configured to display the user interface.
12. A computer program product comprising a computer program or instructions, wherein when the computer program or instructions are executed on a computer, the computer is enabled to execute the method for dynamically extensible development of a user interface according to any one of claims 1 to 6.
13. A computer program product comprising a computer program or instructions, wherein when the computer program or instructions are executed on a computer, the computer is enabled to execute the following instructions, namely During the operation of the software platform, the interface manager dynamically extracts form-related type information from the software platform runtime library, inherits the type information to form a dynamically derived basic form, and generates a software platform import code by the interface manager; and Generate a code for dynamically creating a form based on the type information in the software platform import code, and store the software platform import code and the code for dynamically creating a form in a derived code file.