Version control of electronic files defining a model of a system or component of a system
A method for controlling versions of a model file includes determining a format of a particular element of a plurality of elements of the model file. The model file defines a model of a system. The method also includes converting the particular element of the plurality of elements from a non-text format to a text-based format in response to the particular element including data in the non-text format. The method further includes writing the particular element converted to the text-based format to a model text file. The model text file is a text-based version of the model file and the model text file is used to detect changes in the model file and to control different versions of the model file.
1. A method for controlling versions of a model file, the method comprising:
pre-processing, by a processor, the model file to create a temporal file comprising a text based template;
determining, by the processor, a format of a particular element of a plurality of elements of the model file, the model file defining a model of a system;
converting, by the processor, the particular element of the plurality of elements from a non-text format to a text-based format in response to the particular element comprising data in the non-text format; and
writing, by the processor, the particular element converted to the text-based format to a model text file, wherein the model text file is a text-based version of the model file and the model text file is used to detect changes in the model file and to control different versions of the model file, wherein the model file comprises a system structure and parameterization (SSP) file and wherein writing each element of the plurality of elements into the model text file comprises performing a cleanSSP process and wherein performing the cleanSSP process comprises using a conversion script to convert the particular element from the non-text format to the text-based format in response to the particular element comprising data in the non-text format and the conversion script comprises a cleanSSP script.
2. The method of claim 1 , further comprising writing the particular element of the plurality of elements into the model text file in response to the particular element comprising data in a text format.
3. The method of claim 1 , further comprising retrieving metadata associated with the model file, wherein the metadata comprises an element name, an element description, a date of creation, a date of modification, an identification of a version, and an identification of an author.
4. The method of claim 3 , wherein retrieving the metadata further comprises retrieving a specific model metadata, a specific model implementation, model usage and model execution metadata associated with the model file, wherein a specific model metadata comprises at least one of an element validity range, a fidelity, a plurality of ports and parameters, start and initial conditions, a physical domain, a validation level, a model execution environment, a set of solver settings, a group of external libraries, a set of real-time computation settings, an implementation language, an implementation tool, or a compiler.
5. The method of claim 1 , further comprising performing a diff operation on the model text file to detect any change to the particular element by comparing to a previous version of the particular element.
6. The method of claim 1 , further comprising storing the model text file in a local repository.
7. The method of claim 6 , further comprising performing a remote commit operation, wherein performing the remote commit operation comprises:
pushing the model text file and associated metadata to a remote repository; and
storing the model text file and the associated metadata on the remote repository.
8. The method of claim 7 , further comprising providing access to remote users to view changes to the model file based on the model text file, wherein the remote users comprise remote users that do not have smart filters available.
9. The method of claim 1 , wherein the model file comprises a functional mockup unit (FMU) file and wherein writing each element of the plurality of elements into the model text file comprises performing a cleanFMU process.
10. The method of claim 9 , wherein performing the cleanFMU process comprises using a conversion script to convert the particular element from the non-text format to the text-based format in response to the particular element comprising data in the non-text format, wherein the conversion script comprises a cleanFMU script.
11. The method of claim 1 , further comprising:
checking-out the model text file and associated metadata from a repository;
converting the model text file to a converted model file, the converted model file comprising at least one element comprising data in the non-text format;
modifying the converted model file to provide a modified model file; and
converting the modified model file to a new model text file, wherein the new model text file is used to detect changes in the new model text file by comparing the new model text file to a previous version of the model text file and the new model text file being used to control the different versions of the model file.
12. The method of claim 11 , wherein converting the model text file comprises performing a smudgeSSP process, and wherein performing the smudgeSSP process comprises using a conversion script to convert at least portions of the model text file to corresponding portions of the converted model file, wherein the conversion script comprises a smudgeSSP script.
13. The method of claim 11 , wherein converting the model text file comprises performing a smudgeFMU process, and wherein performing the smudgeFMU process comprises using a conversion script to convert at least portions of the model text file to corresponding portions of the converted model file, wherein the conversion script comprises a smudgeFMU script.
14. The method of claim 1 , further comprising:
determining if the particular element is a sub-element of the particular element;
converting the sub-element from the non-text format to the text-based format in response to the sub-element comprising data in the non-text format; and
writing the sub-element converted to the text-based format to the model text file.
15. A method for controlling versions of a model file, the method comprising:
receiving the model file, by a processor, that defines a model of a system, the model file comprising a plurality of elements;
pre-processing, by the processor, the model file to create a temporal file comprising a text based template;
determining, by the processor, a format of a particular element of the plurality of elements in the model file;
writing, by the processor, the particular element of the plurality of elements into a model text file in response to the particular element comprising data in a text format;
converting, by the processor, the particular element of the plurality of elements from a non-text format to a text-based format in response to the particular element comprising data in the non-text format; and
writing, by the processor, the particular element converted to the text-based format to the model text file, wherein the model text file is a text-based version of the model file and the model text file is used to detect changes in the model file and to control different versions of the model file, wherein the model file comprises a system structure and parameterization (SSP) file and wherein writing each element of the plurality of elements into the model text file comprises performing a cleanSSP process and wherein performing the cleanSSP process comprises using a conversion script to convert the particular element from the non-text format to the text-based format in response to the particular element comprising data in the non-text format and the conversion script comprises a cleanSSP script.
16. The method of claim 15 , further comprising writing the particular element of the plurality of elements into the model text file in response to the particular element comprising data in a text format.
17. The method of claim 15 , further comprising performing a diff operation on the model text file to detect any change to the particular element compared to a previous version of the particular element.
18. A system for controlling versions of a model file, the system comprising:
a processor;
a memory associated with the processor, the memory comprising computer readable program instructions that, when executed by the processor cause the processor to perform a set of functions comprising:
pre-processing the model file to create a temporal file comprising a text based template;
determining a format of a particular element of a plurality of elements of the model file, the model file defining a model of a system;
converting the particular element of the plurality of elements from a non-text format to a text-based format in response to the particular element comprising data in the non-text format; and
writing the particular element converted to the text-based format to a model text file, wherein the model text file is a text-based version of the model file and the model text file is used to detect changes in the model file and to control different versions of the model file, wherein the model file comprises a system structure and parameterization (SSP) file and wherein writing each element of the plurality of elements into the model text file comprises performing a cleanSSP process and wherein performing the cleanSSP process comprises using a conversion script to convert the particular element from the non-text format to the text-based format in response to the particular element comprising data in the non-text format and the conversion script comprises a cleanSSP script.