System and method for generating source code from a graphical model
AssigneeThe MathWorks, Inc.
InventorsMatthew Englehart, Peter Szpak
Life of this patent
Estimating the term…
Abstract
A graphical user interface that enables a user to create and specify the properties of custom storage classes is disclosed. The characteristics of each storage class are specified via parameter settings accessible from the graphical interface. Each custom storage class designed through the interface is defined by a combination of parameter settings. A code preview window in the graphical interface displays salient aspects of the source code references to model data given the selected parameter settings. The display is shown dynamically and adjusted to reflect subsequent changes in parameter settings.
Claims18
In an electronic device having a graphical modeling and execution environment, said graphical modeling and execution environment including at least one graphical model, a method comprising:
- providing an automatic code generator to create source code that implements functionality of said at least one graphical model and that corresponds to data referenced by said at least one graphical model;
- providing a predefined storage class in said graphical modeling and execution environment, said predefined storage class specifying a first manner in which said automatic code generator creates said source code corresponding to said data referenced by said at least one graphical model in said graphical modeling and execution environment;
- providing a user interface with a plurality of selectable parameters;
- defining a custom storage class in said graphical modeling and execution environment utilizing parameters selected by a user from said plurality of selectable parameters, said custom storage class specifying a second manner in which said automatic code generator creates source code corresponding to said data referenced by said at least one graphical model in said graphical modeling and execution environment, said second manner differing from said first manner;
- generating source code implementing said functionality of said at least one graphical model using said automatic code generator, said generating comprising:
- using said custom storage class to generate source code corresponding to said data referenced by said at least one graphical model;
- providing a view of salient aspects of said source code generated by said automatic code generator utilizing said user-selected parameters;
- changing said user-selected parameters for said custom storage class in said user interface;
- adjusting said source code generated by said automatic code generator to reflect said change in said user-selected parameters;
- and
- displaying salient aspects of said adjusted source code in said view of salient aspects of said source code.
An electronic device having a modeling and execution environment with at least one graphical model, said electronic device comprising:
- a processor for:
- providing an automatic code generator to create source code that implements functionality of said at least one graphical model and that corresponds to data referenced by said at least one graphical model,
- providing a predefined storage class specifying a first manner in which said automatic code generator creates said source code corresponding to said data referenced by said at least one graphical model in said modeling and execution environment,
- defining a custom storage class in said modeling and execution environment utilizing parameters selected by a user from a plurality of selectable parameters, said custom storage class specifying a second manner in which said automatic code generator creates source code corresponding to said data referenced by said at least one graphical model in said modeling and execution environment, said second manner differing from said first manner, and
- generating source code implementing said functionality of said at least one graphical model using said automatic code generator, said generating using said custom storage class to generate source code corresponding to said data referenced by said at least one graphical model;
- and
- a display device for:
- displaying a user interface with said plurality of selectable parameters for said custom storage class, said user-selected parameters for said custom storage class in said user interface are changed and said source code generated by said automatic code generator is adjusted to reflect said change in user-selected parameters, and
- displaying a view of salient aspects of said source code generated by said automatic code generator utilizing said user-selected parameters, said adjusted source code is displayed in said view of salient aspects of said source code.
A computer-readable medium for use in an electronic device having a graphical modeling and execution environment, said graphical modeling and execution environment including at least one graphical model, said computer-readable medium storing computer-executable instructions for:
- providing an automatic code generator to create source code that implements functionality of said at least one graphical model and that corresponds to data referenced by said at least one graphical model;
- providing a predefined storage class in said graphical modeling and execution environment, said predefined storage class specifying a first manner in which said automatic code generator creates said source code corresponding to said data referenced by said at least one graphical model in said graphical modeling and execution environment;
- providing a user interface with a plurality of selectable parameters;
- defining a custom storage class in said graphical modeling and execution environment utilizing parameters selected by a user from said plurality of selectable parameters, said custom storage class specifying a second manner in which said automatic code generator creates source code corresponding to said data referenced by said at least one graphical model in said graphical modeling and execution environment, said second manner differing from said first manner;
- generating source code implementing said functionality of said at least one graphical model using said automatic code generator, said generating comprising:
- using said custom storage class to generate source code corresponding to said data referenced by said at least one graphical models;
- providing a view of salient aspects of said source code generated by said automatic code generator utilizing said user-selected parameters;
- changing said user-selected parameters for said custom storage class in said user interface;
- adjusting said source code generated by said automatic code generator to reflect said change in user-selected parameters;
- and
- displaying said adjusted source code in said view of salient aspects of said source code.
Dependencies are inferred from the claim text.