diff --git a/.gitignore b/.gitignore index 58deba6..d1001ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -MFTyreToolApp_resources/ +MagicFormulaTyreTool_resources/ *.asv slprj/ *.mltbx diff --git a/.gitmodules b/.gitmodules index 344f592..2650ac1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "src/mftyre-matlab-library"] - path = src/mftyre-matlab-library - url = git@github.com:teasit/mftyre-matlab-library.git +[submodule "src/magic-formula-tyre-library"] + path = src/magic-formula-tyre-library + url = https://github.com/teasit/magic-formula-tyre-library diff --git a/CHANGELOG.md b/CHANGELOG.md index 93512e4..806e4ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog -- new: most app settings are now stored persistently across sessions -- new: menu bar overhaul (split "App" menu into multiple menus), should help keep menu complexity moderate with upcoming features \ No newline at end of file +- new: app and code renaming due to conflicts with existing trademark +- documentation and screenshots updated +- fix: event-listener lifecycling issues fixed \ No newline at end of file diff --git a/MFTyreToolApp.prj b/MagicFormulaTyreTool.prj similarity index 60% rename from MFTyreToolApp.prj rename to MagicFormulaTyreTool.prj index 6a0abcf..cb57a1a 100644 --- a/MFTyreToolApp.prj +++ b/MagicFormulaTyreTool.prj @@ -1,19 +1,19 @@ - - MFTyreToolApp + + MagicFormulaTyreTool Tom Teasdale teasdale@lightsaber.red - ${PROJECT_ROOT}\MFTyreToolApp_resources\icon_24.png + ${PROJECT_ROOT}\MagicFormulaTyreTool_resources\icon_24.png - ${PROJECT_ROOT}\MFTyreToolApp_resources\icon_48.png - ${PROJECT_ROOT}\MFTyreToolApp_resources\icon_24.png - ${PROJECT_ROOT}\MFTyreToolApp_resources\icon_16.png + ${PROJECT_ROOT}\MagicFormulaTyreTool_resources\icon_48.png + ${PROJECT_ROOT}\MagicFormulaTyreTool_resources\icon_24.png + ${PROJECT_ROOT}\MagicFormulaTyreTool_resources\icon_16.png - Create, fit and evaluate MF-Tyre model with a convenient MATLAB GUI. + MATLAB GUI for Magic Formula Tyre Modeling - ${PROJECT_ROOT}\assets\img\MFTyreTool_Screenshot_Main.jpg - 1.3.0 + ${PROJECT_ROOT}\assets\img\App_Screenshot_Main.jpg + 1.3.1 MATLAB Optimization Toolbox @@ -41,7 +41,7 @@ - ${PROJECT_ROOT}\src\MFTyreTool.m + ${PROJECT_ROOT}\src\MagicFormulaTyreTool.m ${PROJECT_ROOT}\src\+events\FitterMeasurementsLoadedEventData.m @@ -88,34 +88,34 @@ ${PROJECT_ROOT}\src\+ui\TyrePlotCurvesPanel.m ${PROJECT_ROOT}\src\+ui\TyrePlotFrictionEllipsePanel.m ${PROJECT_ROOT}\src\about.json - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+exceptions\EmptyMeasurement.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+exceptions\FitterFailed.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+exceptions\NoMeasurementForFitMode.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\+equations\Fx.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\+equations\Fx0.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\+equations\Fy.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\+equations\Fy0.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\eval.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\FitMode.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\Fitter.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\getFitParamNames.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\Model.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\Parameter.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\ParameterFittable.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\+v62\Parameters.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+mftyre\Model.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tir\TyrePropertiesFileCreator.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tir\TyrePropertiesFileReader.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\ConstantParameter.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\MeasuredParameter.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\Measurement.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\Metadata.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\Parameter.m - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\Parser.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+exceptions\EmptyMeasurement.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+exceptions\FitterFailed.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+exceptions\NoMeasurementForFitMode.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\+equations\Fx.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\+equations\Fx0.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\+equations\Fy.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\+equations\Fy0.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\eval.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\FitMode.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\Fitter.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\getFitParamNames.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\Model.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\Parameter.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\ParameterFittable.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\+v62\Parameters.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+magicformula\Model.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tir\TyrePropertiesFileCreator.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tir\TyrePropertiesFileReader.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\ConstantParameter.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\MeasuredParameter.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\Measurement.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\Metadata.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\Parameter.m + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\Parser.m ${PROJECT_ROOT}\assets - ${PROJECT_ROOT}\src\mftyre-matlab-library\src\+tydex\+parsers + ${PROJECT_ROOT}\src\magic-formula-tyre-library\src\+tydex\+parsers diff --git a/MFTyreTool.prj b/Project.prj similarity index 100% rename from MFTyreTool.prj rename to Project.prj diff --git a/README.md b/README.md index a7f792d..17b8d01 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,29 @@ -# MF-Tyre MATLAB Tool +# Magic Formula Tyre Tool -[![View MFTyreTool on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://de.mathworks.com/matlabcentral/fileexchange/111375-mftyretool) -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/teasit/mftyre-matlab-tool)](https://github.com/teasit/mftyre-matlab-tool/releases/latest) +[![View Tool on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://de.mathworks.com/matlabcentral/fileexchange/111375) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/teasit/magic-formula-tyre-tool)](https://github.com/teasit/magic-formula-tyre-tool/releases/latest) -![Screenshot Analysis Tab with Plots](/assets/img/MFTyreTool_Screenshot_Main.jpg) +![Screenshot Analysis Tab with Plots](/assets/img/App_Screenshot_Main.jpg) -- Interactively fit MF-Tyre models to data +- Interactively fit Magic Formula tyre models to data - Automatically separate timeseries data into steady-state conditions - Compare model outputs visually against data - Load/Save models from/to `.tir` (Tyre Property File) - Export fitted models parameters as `struct` This project uses the model functions provided by the -[MF-Tyre MATLAB Library](https://github.com/teasit/mftyre-matlab-library). +[Magic Formula Tyre Library](https://github.com/teasit/magic-formula-tyre-library). You can export the model parameters to use with said library to simulate tyre behavior in MATLAB or create models suitable for code-generation in Simulink. ## Motivation This project originates in my work as a Formula Student member of -[UPBracing](https://formulastudent.uni-paderborn.de/). -The software is designed as an open-source variant to -[Simcenter MF-Tool](https://www.plm.automation.siemens.com/global/en/products/simulation-test/tire-simulation-testing.html) -with accompanying -[open-source equations](https://github.com/teasit/mftyre-matlab-library) -for model evaluation suitable for code-generation. -Especially students in Formula Student / Formula SAE might benefit from an easy-to-use -graphical approach to empirical tyre modeling. +[UPBracing](https://formulastudent.uni-paderborn.de/), where we required +computationally efficient but precise tire models suitable for code-generation. +Especially students in Formula Student / Formula SAE who want to model their tires for +control and estimation algorithms or simply for the purpose of better understanding might +benefit from this tool. This project would not have been possible without the data provided by the [Formula SAE Tire Test Consortium (FSAE TTC)](https://www.millikenresearch.com/fsaettc.html) @@ -48,18 +45,12 @@ de-identified and obscured data for demonstration purposes. There are several ways: -- Download latest Release from [MATLAB File Exchange](https://de.mathworks.com/matlabcentral/fileexchange/111375-mftyretool) -- Download latest Release from [GitHub](https://github.com/teasit/mftyre-matlab-tool/releases) +- Download latest Release from [MATLAB File Exchange](https://de.mathworks.com/matlabcentral/fileexchange/111375) +- Download latest Release from [GitHub](https://github.com/teasit/magic-formula-tyre-tool/releases) - Clone using Git and integrate into your projects using a [Project Reference](https://de.mathworks.com/help/simulink/ug/add-or-remove-a-reference-to-another-project.html) ## Usage -The usage is similar to the one of -[Simcenter MF-Tool](https://www.plm.automation.siemens.com/global/en/products/simulation-test/tire-simulation-testing.html). -In fact, this tool can integrate into the Simcenter MF-Tool workflow by exporting measurements -as TYDEX[^TYDEX-KIT][^Paper-TNO] files (`*.tdx`). -That way, the fitting algorithm of Simcenter MF-Tool can be used instead. - The core workflows are summarized in this flowchart: ```mermaid @@ -79,7 +70,7 @@ flowchart TD InputData --> |.mat / .csv / ...| ParseData; subgraph tool[ ] DecideNewOrLoad{Base Model\navailable?} - NewMdl[Create New\nMF-Tyre model]; + NewMdl[Create New\nTyre model]; LoadMdl[Load from\n.tir file]; ParseData --> DecideNewOrLoad; DecideNewOrLoad --> |no| NewMdl; @@ -107,18 +98,18 @@ measurement object contains data for only one steady-state condition. This means one variable is *sweeped* (= *transient*). In case of Formula SAE Tire Test Consortium Data, two parsers for *Cornering* and *Drive/Brake* MAT files in SI-units are already available. -![Animation Data Import](assets/img/MFTyreTool_Screenshot_DataImport.gif) +![Animation Data Import](assets/img/App_Screenshot_DataImport.gif) ### Fit Model to Data -You can interactively fit your MF-Tyre model to measured test-bench data. +You can interactively fit your Magic Formula tire model to measured test-bench data. Interactively means, you can cancel the fitting process at any point. The last iteration will be saved and you can compare the fitted values to the current model values in a table. You can then choose to append these values to your model. -![Animation Fitting](assets/img/MFTyreTool_Animation_Fitting.gif) +![Animation Fitting](assets/img/App_Animation_Fitting.gif) -![Animation Fitting](assets/img/MFTyreTool_Animation_AppendFitted.gif) +![Animation Fitting](assets/img/App_Animation_AppendFitted.gif) ### Manual Model Editing @@ -126,20 +117,20 @@ You can manually edit the model values in the table. When using the Auto-Refresh the plot updates automatically to reflect your changes. This helps to get an intuition on the effects of different parameter values. -![Animation Manual Editing](assets/img/MFTyreTool_Animation_ManualEditing.gif) +![Animation Manual Editing](assets/img/App_Animation_ManualEditing.gif) ### Plot Model against Data To make sure the fitting process yields a plausible result, you can compare the test-bench data to your fitted model. If the import process of the measurements worked correctly, you will be able to select steady-state values from the dropdowns and thereby filter the -data. The MF-Tyre model will then be supplied with the measured inputs for an exact +data. The Magic Formula tire model will then be supplied with the measured inputs for an exact comparison. -![Animation Plotting](assets/img/MFTyreTool_Animation_Plotting.gif) +![Animation Plotting](assets/img/App_Animation_Plotting.gif) ## Known Issues - Currently only Fitting of Fx0, Fy0, Fx, Fy is supported -- Only MF-Tyre 6.1.2 (62) is supported. +- Only Magic Formula version 6.1.2 (62) is supported. - The FSAE TTC parsers might not always work. You might have to create your own parser. diff --git a/MFTyreToolToolboxPackager.prj b/ToolboxPackager.prj similarity index 82% rename from MFTyreToolToolboxPackager.prj rename to ToolboxPackager.prj index ef18124..3b49f45 100644 --- a/MFTyreToolToolboxPackager.prj +++ b/ToolboxPackager.prj @@ -1,14 +1,14 @@ - - MFTyreTool + + MagicFormulaTyreTool Tom Teasdale teasdale@lightsaber.red - Create, fit and evaluate MF-Tyre models with a convenient MATLAB GUI. + MATLAB GUI for Magic Formula Tyre Modeling - ${PROJECT_ROOT}\assets\img\MFTyreTool_Screenshot_Main.jpg - 1.3.0 - ${PROJECT_ROOT}\MFTyreTool.mltbx + ${PROJECT_ROOT}\assets\img\App_Screenshot_Main.jpg + 1.3.1 + ${PROJECT_ROOT}\MagicFormulaTyreTool.mltbx @@ -46,12 +46,12 @@ tools assets slprj resources -MFTyreToolApp_resources +MagicFormulaTyreTool_resources true - ${PROJECT_ROOT}\MFTyreToolApp.mlappinstall + ${PROJECT_ROOT}\MagicFormulaTyreTool.mlappinstall @@ -115,14 +115,14 @@ MFTyreToolApp_resources ${PROJECT_ROOT}\CHANGELOG.md ${PROJECT_ROOT}\doc ${PROJECT_ROOT}\LICENSE - ${PROJECT_ROOT}\MFTyreToolApp.mlappinstall + ${PROJECT_ROOT}\MagicFormulaTyreTool.mlappinstall ${PROJECT_ROOT}\README.md - C:\Users\Tom\Documents\mftyre-tool-matlab\MFTyreTool.mltbx + C:\Users\Tom\Documents\mftyre-tool-matlab\MagicFormulaTyreTool.mltbx diff --git a/assets/img/App_Animation_AppendFitted.gif b/assets/img/App_Animation_AppendFitted.gif new file mode 100644 index 0000000..a09a3d8 Binary files /dev/null and b/assets/img/App_Animation_AppendFitted.gif differ diff --git a/assets/img/App_Animation_Fitting.gif b/assets/img/App_Animation_Fitting.gif new file mode 100644 index 0000000..256549c Binary files /dev/null and b/assets/img/App_Animation_Fitting.gif differ diff --git a/assets/img/App_Animation_ManualEditing.gif b/assets/img/App_Animation_ManualEditing.gif new file mode 100644 index 0000000..65e9be0 Binary files /dev/null and b/assets/img/App_Animation_ManualEditing.gif differ diff --git a/assets/img/App_Animation_Plotting.gif b/assets/img/App_Animation_Plotting.gif new file mode 100644 index 0000000..dd6caee Binary files /dev/null and b/assets/img/App_Animation_Plotting.gif differ diff --git a/assets/img/App_Screenshot_DataImport.gif b/assets/img/App_Screenshot_DataImport.gif new file mode 100644 index 0000000..0ca1b1c Binary files /dev/null and b/assets/img/App_Screenshot_DataImport.gif differ diff --git a/assets/img/App_Screenshot_Main.jpg b/assets/img/App_Screenshot_Main.jpg new file mode 100644 index 0000000..3105a86 Binary files /dev/null and b/assets/img/App_Screenshot_Main.jpg differ diff --git a/assets/img/App_Screenshot_NewModel.jpg b/assets/img/App_Screenshot_NewModel.jpg new file mode 100644 index 0000000..8c44b7c Binary files /dev/null and b/assets/img/App_Screenshot_NewModel.jpg differ diff --git a/assets/img/App_Screenshot_UnfittedModel.jpg b/assets/img/App_Screenshot_UnfittedModel.jpg new file mode 100644 index 0000000..660ed31 Binary files /dev/null and b/assets/img/App_Screenshot_UnfittedModel.jpg differ diff --git a/assets/img/MFTyreTool_Screenshot_Update_FrictionEllipse.jpg b/assets/img/App_Screenshot_Update_FrictionEllipse.jpg similarity index 100% rename from assets/img/MFTyreTool_Screenshot_Update_FrictionEllipse.jpg rename to assets/img/App_Screenshot_Update_FrictionEllipse.jpg diff --git a/assets/img/MFTyreTool_Animation_AppendFitted.gif b/assets/img/MFTyreTool_Animation_AppendFitted.gif deleted file mode 100644 index 09a9a94..0000000 Binary files a/assets/img/MFTyreTool_Animation_AppendFitted.gif and /dev/null differ diff --git a/assets/img/MFTyreTool_Animation_Fitting.gif b/assets/img/MFTyreTool_Animation_Fitting.gif deleted file mode 100644 index 6ea326b..0000000 Binary files a/assets/img/MFTyreTool_Animation_Fitting.gif and /dev/null differ diff --git a/assets/img/MFTyreTool_Animation_ManualEditing.gif b/assets/img/MFTyreTool_Animation_ManualEditing.gif deleted file mode 100644 index 5134c69..0000000 Binary files a/assets/img/MFTyreTool_Animation_ManualEditing.gif and /dev/null differ diff --git a/assets/img/MFTyreTool_Animation_Plotting.gif b/assets/img/MFTyreTool_Animation_Plotting.gif deleted file mode 100644 index 2b2ade3..0000000 Binary files a/assets/img/MFTyreTool_Animation_Plotting.gif and /dev/null differ diff --git a/assets/img/MFTyreTool_Screenshot_DataImport.gif b/assets/img/MFTyreTool_Screenshot_DataImport.gif deleted file mode 100644 index 509d55f..0000000 Binary files a/assets/img/MFTyreTool_Screenshot_DataImport.gif and /dev/null differ diff --git a/assets/img/MFTyreTool_Screenshot_Main.jpg b/assets/img/MFTyreTool_Screenshot_Main.jpg deleted file mode 100644 index dfc0d25..0000000 Binary files a/assets/img/MFTyreTool_Screenshot_Main.jpg and /dev/null differ diff --git a/doc/GettingStarted.mlx b/doc/GettingStarted.mlx index a5b1dec..1c15213 100644 Binary files a/doc/GettingStarted.mlx and b/doc/GettingStarted.mlx differ diff --git a/resources/project/ProjectData.type.Info.xml b/resources/project/ProjectData.type.Info.xml index aaf974a..3a9d6bb 100644 --- a/resources/project/ProjectData.type.Info.xml +++ b/resources/project/ProjectData.type.Info.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/resources/project/Root.type.EntryPoints/9533103f-cc36-4d72-821c-0dab9a7c96db.type.EntryPoint.xml b/resources/project/Root.type.EntryPoints/9533103f-cc36-4d72-821c-0dab9a7c96db.type.EntryPoint.xml index 7db086c..8924a55 100644 --- a/resources/project/Root.type.EntryPoints/9533103f-cc36-4d72-821c-0dab9a7c96db.type.EntryPoint.xml +++ b/resources/project/Root.type.EntryPoints/9533103f-cc36-4d72-821c-0dab9a7c96db.type.EntryPoint.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/resources/project/Root.type.Files/MFTyreToolApp.prj.type.File.xml b/resources/project/Root.type.Files/MagicFormulaTyreTool.prj.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/MFTyreToolApp.prj.type.File.xml rename to resources/project/Root.type.Files/MagicFormulaTyreTool.prj.type.File.xml diff --git a/resources/project/Root.type.Files/MFTyreToolToolboxPackager.prj.type.File.xml b/resources/project/Root.type.Files/ToolboxPackager.prj.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/MFTyreToolToolboxPackager.prj.type.File.xml rename to resources/project/Root.type.Files/ToolboxPackager.prj.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_AppendFitted.gif.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_AppendFitted.gif.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_AppendFitted.gif.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_AppendFitted.gif.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_Fitting.gif.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_Fitting.gif.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_Fitting.gif.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_Fitting.gif.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_ManualEditing.gif.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_ManualEditing.gif.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_ManualEditing.gif.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_ManualEditing.gif.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_Plotting.gif.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_Plotting.gif.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Animation_Plotting.gif.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Animation_Plotting.gif.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Screenshot_DataImport.gif.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Screenshot_DataImport.gif.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Screenshot_DataImport.gif.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Screenshot_DataImport.gif.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Screenshot_Main.jpg.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Screenshot_Main.jpg.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Screenshot_Main.jpg.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Screenshot_Main.jpg.type.File.xml diff --git a/resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Screenshot_Update_FrictionEllipse.jpg.type.File.xml b/resources/project/Root.type.Files/assets.type.File/img.type.File/App_Screenshot_Update_FrictionEllipse.jpg.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/assets.type.File/img.type.File/MFTyreTool_Screenshot_Update_FrictionEllipse.jpg.type.File.xml rename to resources/project/Root.type.Files/assets.type.File/img.type.File/App_Screenshot_Update_FrictionEllipse.jpg.type.File.xml diff --git a/resources/project/Root.type.Files/src.type.File/MFTyreTool.m.type.File.xml b/resources/project/Root.type.Files/src.type.File/MagicFormulaTyreTool.m.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/src.type.File/MFTyreTool.m.type.File.xml rename to resources/project/Root.type.Files/src.type.File/MagicFormulaTyreTool.m.type.File.xml diff --git a/resources/project/Root.type.Files/src.type.File/deprecated.type.File.xml b/resources/project/Root.type.Files/src.type.File/deprecated.type.File.xml deleted file mode 100644 index 1c0844e..0000000 --- a/resources/project/Root.type.Files/src.type.File/deprecated.type.File.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/1.type.DIR_SIGNIFIER.xml b/resources/project/Root.type.Files/src.type.File/deprecated.type.File/1.type.DIR_SIGNIFIER.xml deleted file mode 100644 index 1c0844e..0000000 --- a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/1.type.DIR_SIGNIFIER.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/TyreDatabaseBrowser.m.type.File.xml b/resources/project/Root.type.Files/src.type.File/deprecated.type.File/TyreDatabaseBrowser.m.type.File.xml deleted file mode 100644 index 80b5b16..0000000 --- a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/TyreDatabaseBrowser.m.type.File.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/TyrePropertiesEditor.m.type.File.xml b/resources/project/Root.type.Files/src.type.File/deprecated.type.File/TyrePropertiesEditor.m.type.File.xml deleted file mode 100644 index 80b5b16..0000000 --- a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/TyrePropertiesEditor.m.type.File.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/getParentFigure.m.type.File.xml b/resources/project/Root.type.Files/src.type.File/deprecated.type.File/getParentFigure.m.type.File.xml deleted file mode 100644 index 80b5b16..0000000 --- a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/getParentFigure.m.type.File.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/project/Root.type.Files/src.type.File/deprecated.type.File/ImageWithUploadButton.m.type.File.xml b/resources/project/Root.type.Files/tools.type.File/publishRelease.m.type.File.xml similarity index 100% rename from resources/project/Root.type.Files/src.type.File/deprecated.type.File/ImageWithUploadButton.m.type.File.xml rename to resources/project/Root.type.Files/tools.type.File/publishRelease.m.type.File.xml diff --git a/resources/project/Root.type.Files/tools.type.File/publishReleaseMFTyreTool.m.type.File.xml b/resources/project/Root.type.Files/tools.type.File/publishReleaseMFTyreTool.m.type.File.xml deleted file mode 100644 index 80b5b16..0000000 --- a/resources/project/Root.type.Files/tools.type.File/publishReleaseMFTyreTool.m.type.File.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/project/Root.type.References/7c35b7c7-c533-4947-8f05-0df9df31e01e.type.Reference.xml b/resources/project/Root.type.References/7c35b7c7-c533-4947-8f05-0df9df31e01e.type.Reference.xml deleted file mode 100644 index 1c5e769..0000000 --- a/resources/project/Root.type.References/7c35b7c7-c533-4947-8f05-0df9df31e01e.type.Reference.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/resources/project/Root.type.References/7c35b7c7-c533-4947-8f05-0df9df31e01e.type.Reference/410c676f-5e22-4fdb-9e9c-1215b966e52f.type.snapshot.xml b/resources/project/Root.type.References/7c35b7c7-c533-4947-8f05-0df9df31e01e.type.Reference/410c676f-5e22-4fdb-9e9c-1215b966e52f.type.snapshot.xml deleted file mode 100644 index e959997..0000000 --- a/resources/project/Root.type.References/7c35b7c7-c533-4947-8f05-0df9df31e01e.type.Reference/410c676f-5e22-4fdb-9e9c-1215b966e52f.type.snapshot.xml +++ /dev/null @@ -1,903 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/project/Root.type.References/f43eb75a-25da-4d77-b787-9896b9e92448.type.Reference.xml b/resources/project/Root.type.References/f43eb75a-25da-4d77-b787-9896b9e92448.type.Reference.xml new file mode 100644 index 0000000..6fc03ea --- /dev/null +++ b/resources/project/Root.type.References/f43eb75a-25da-4d77-b787-9896b9e92448.type.Reference.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/+events/FittingModesChangedEventData.m b/src/+events/FittingModesChangedEventData.m index b567405..71daaa2 100644 --- a/src/+events/FittingModesChangedEventData.m +++ b/src/+events/FittingModesChangedEventData.m @@ -1,6 +1,6 @@ classdef (ConstructOnLoad) FittingModesChangedEventData < event.EventData properties - FitModes mftyre.v62.FitMode + FitModes magicformula.v62.FitMode end methods function eventData = FittingModesChangedEventData(fitmodes) diff --git a/src/+events/ModelChangedEventData.m b/src/+events/ModelChangedEventData.m index e1b94d7..f5462a9 100644 --- a/src/+events/ModelChangedEventData.m +++ b/src/+events/ModelChangedEventData.m @@ -1,6 +1,6 @@ classdef (ConstructOnLoad) ModelChangedEventData < event.EventData properties - Model mftyre.Model = mftyre.v62.Model.empty + Model magicformula.Model = magicformula.v62.Model.empty end methods function eventData = ModelChangedEventData(model) diff --git a/src/+events/TyreModelFitterFinished.m b/src/+events/TyreModelFitterFinished.m index 8cfb99c..e49a709 100644 --- a/src/+events/TyreModelFitterFinished.m +++ b/src/+events/TyreModelFitterFinished.m @@ -1,6 +1,6 @@ classdef (ConstructOnLoad) TyreModelFitterFinished < event.EventData properties - ParametersFitted mftyre.v62.Parameters + ParametersFitted magicformula.v62.Parameters end methods function eventData = TyreModelFitterFinished(params) diff --git a/src/+exceptions/CouldNotExportTIR.m b/src/+exceptions/CouldNotExportTIR.m index 20e8b1f..07e72e5 100644 --- a/src/+exceptions/CouldNotExportTIR.m +++ b/src/+exceptions/CouldNotExportTIR.m @@ -4,7 +4,7 @@ arguments file char end - errId = 'MFTyreTool:CouldNotExportTIR'; + errId = 'MagicFormulaTyreTool:CouldNotExportTIR'; msgtext = sprintf('Could not export model to "%s".', file); obj@MException(errId, msgtext) end diff --git a/src/+exceptions/CouldNotExportTYDEX.m b/src/+exceptions/CouldNotExportTYDEX.m index adc653e..9e9906d 100644 --- a/src/+exceptions/CouldNotExportTYDEX.m +++ b/src/+exceptions/CouldNotExportTYDEX.m @@ -1,7 +1,7 @@ classdef CouldNotExportTYDEX < MException methods function obj = CouldNotExportTYDEX() - errId = 'MFTyreTool:CouldNotExportTYDEX'; + errId = 'MagicFormulaTyreTool:CouldNotExportTYDEX'; msgtext = 'Could not export measurements to selected folder.'; obj@MException(errId, msgtext) end diff --git a/src/+exceptions/CouldNotImportTIR.m b/src/+exceptions/CouldNotImportTIR.m index 288f512..bda497a 100644 --- a/src/+exceptions/CouldNotImportTIR.m +++ b/src/+exceptions/CouldNotImportTIR.m @@ -4,7 +4,7 @@ arguments file char end - errId = 'MFTyreTool:CouldNotImportTIR'; + errId = 'MagicFormulaTyreTool:CouldNotImportTIR'; msgtext = sprintf('Could not import TIR file "%s".', file); obj@MException(errId, msgtext) end diff --git a/src/+exceptions/CouldNotInitAppSettings.m b/src/+exceptions/CouldNotInitAppSettings.m index b9d95a2..16bea32 100644 --- a/src/+exceptions/CouldNotInitAppSettings.m +++ b/src/+exceptions/CouldNotInitAppSettings.m @@ -1,7 +1,7 @@ classdef CouldNotInitAppSettings < MException methods function obj = CouldNotInitAppSettings() - errId = 'MFTyreTool:CouldNotInitAppSettings'; + errId = 'MagicFormulaTyreTool:CouldNotInitAppSettings'; msgtext = 'Could not initialize persistent app settings.'; obj@MException(errId, msgtext) end diff --git a/src/+exceptions/CouldNotLoadAppSettings.m b/src/+exceptions/CouldNotLoadAppSettings.m index 8d09c6f..6a31d4f 100644 --- a/src/+exceptions/CouldNotLoadAppSettings.m +++ b/src/+exceptions/CouldNotLoadAppSettings.m @@ -1,7 +1,7 @@ classdef CouldNotLoadAppSettings < MException methods function obj = CouldNotLoadAppSettings() - errId = 'MFTyreTool:CouldNotLoadAppSettings'; + errId = 'MagicFormulaTyreTool:CouldNotLoadAppSettings'; msgtext = 'Could not load persistent app settings.'; obj@MException(errId, msgtext) end diff --git a/src/+exceptions/CouldNotResetAppSettings.m b/src/+exceptions/CouldNotResetAppSettings.m index 496ae54..4aa5442 100644 --- a/src/+exceptions/CouldNotResetAppSettings.m +++ b/src/+exceptions/CouldNotResetAppSettings.m @@ -1,7 +1,7 @@ classdef CouldNotResetAppSettings < MException methods function obj = CouldNotResetAppSettings() - errId = 'MFTyreTool:CouldNotResetAppSettings'; + errId = 'MagicFormulaTyreTool:CouldNotResetAppSettings'; msgtext = 'Could not reset persistent app settings.'; obj@MException(errId, msgtext) end diff --git a/src/+exceptions/CouldNotSaveAppSettings.m b/src/+exceptions/CouldNotSaveAppSettings.m index fae2ff2..7623c52 100644 --- a/src/+exceptions/CouldNotSaveAppSettings.m +++ b/src/+exceptions/CouldNotSaveAppSettings.m @@ -1,7 +1,7 @@ classdef CouldNotSaveAppSettings < MException methods function obj = CouldNotSaveAppSettings() - errId = 'MFTyreTool:CouldNotSaveAppSettings'; + errId = 'MagicFormulaTyreTool:CouldNotSaveAppSettings'; msgtext = 'Could not save persistent app settings.'; obj@MException(errId, msgtext) end diff --git a/src/+exceptions/InvalidSolverOptions.m b/src/+exceptions/InvalidSolverOptions.m index 6545823..9fc0ac5 100644 --- a/src/+exceptions/InvalidSolverOptions.m +++ b/src/+exceptions/InvalidSolverOptions.m @@ -1,7 +1,7 @@ classdef InvalidSolverOptions < MException methods function obj = InvalidSolverOptions() - errId = 'MFTyreTool:InvalidSolverOptions'; + errId = 'MagicFormulaTyreTool:InvalidSolverOptions'; msgtext = 'Invalid solver options entered by user.'; obj@MException(errId, msgtext) end diff --git a/src/+exceptions/UnknownModelParameter.m b/src/+exceptions/UnknownModelParameter.m index 8fe24a5..8ef89e3 100644 --- a/src/+exceptions/UnknownModelParameter.m +++ b/src/+exceptions/UnknownModelParameter.m @@ -7,7 +7,7 @@ arguments name char end - errId = 'MFTyreTool:UnknownModelParameter'; + errId = 'MagicFormulaTyreTool:UnknownModelParameter'; msgtext = sprintf('Unknown parameter name "%s".', name); obj@MException(errId, msgtext) obj.ParameterName = name; diff --git a/src/+helpers/checkUpdateAvailable.m b/src/+helpers/checkUpdateAvailable.m index 76494a0..3e8f410 100644 --- a/src/+helpers/checkUpdateAvailable.m +++ b/src/+helpers/checkUpdateAvailable.m @@ -8,7 +8,7 @@ versionCurrent = erase(versionCurrent, 'v'); assert(matches(versionCurrent, versionValidPattern)); -url = 'https://api.github.com/repos/teasit/mftyre-matlab-tool/releases/latest'; +url = 'https://api.github.com/repos/teasit/magic-formula-tyre-tool/releases/latest'; versionLatest = webread(url).tag_name; versionLatest = erase(versionLatest, 'v'); assert(matches(versionLatest, versionValidPattern)); diff --git a/src/+helpers/fitterOutputFcn.m b/src/+helpers/fitterOutputFcn.m index 92d1f10..e2e8ebd 100644 --- a/src/+helpers/fitterOutputFcn.m +++ b/src/+helpers/fitterOutputFcn.m @@ -12,7 +12,7 @@ optimValues state dlg matlab.ui.dialog.ProgressDialog - fitter mftyre.v62.Fitter + fitter magicformula.v62.Fitter end persistent fval0 if isempty(fval0) diff --git a/src/+settings/AbstractSettings.m b/src/+settings/AbstractSettings.m index d185e00..4eb2412 100644 --- a/src/+settings/AbstractSettings.m +++ b/src/+settings/AbstractSettings.m @@ -5,7 +5,7 @@ %recursion must continue. properties (Constant, Access = protected) %Name of top-level Settings Group: settings(). - SettingsGroupTopLevel = 'mftyretool' + SettingsGroupTopLevel = 'MagicFormulaTyreTool' end events (NotifyAccess = protected) %Triggered by any property change in the handle-hierarchy. diff --git a/src/+settings/AppSettings.m b/src/+settings/AppSettings.m index c527916..144e101 100644 --- a/src/+settings/AppSettings.m +++ b/src/+settings/AppSettings.m @@ -60,7 +60,7 @@ function reset(obj) end function obj = AppSettings() persistent pobj - if isempty(pobj) + if isempty(pobj) || ~isvalid(pobj) init(obj) pobj = obj; else diff --git a/src/+settings/FitterSettings.m b/src/+settings/FitterSettings.m index bf210a2..1790720 100644 --- a/src/+settings/FitterSettings.m +++ b/src/+settings/FitterSettings.m @@ -1,7 +1,7 @@ classdef FitterSettings < settings.AbstractSettings - %FITTERSETTINGS Contains app settings for MF-Tyre fitter + %FITTERSETTINGS Contains app settings for fitter properties (SetObservable, AbortSet) - FitModes mftyre.v62.FitMode = mftyre.v62.FitMode.empty + FitModes magicformula.v62.FitMode = magicformula.v62.FitMode.empty OptimizerSettings optim.options.Fmincon = optimoptions('fmincon'); end methods diff --git a/src/+ui/FrictionEllipseAxes.m b/src/+ui/FrictionEllipseAxes.m index cd8d318..814cbb1 100644 --- a/src/+ui/FrictionEllipseAxes.m +++ b/src/+ui/FrictionEllipseAxes.m @@ -2,7 +2,7 @@ %FRICTIONELLIPSEAXES Axes to plot friction ellipse for tyre model. properties - Model mftyre.Model = mftyre.v62.Model.empty + Model magicformula.Model = magicformula.v62.Model.empty end properties SLIPANGL_Max double = 15 @@ -51,6 +51,7 @@ function setupAxes(obj) hold(ax, 'on') xlabel(ax, 'FY / N') ylabel(ax, 'FX / N') + datacursormode on obj.Axes = ax; end function update(obj) diff --git a/src/+ui/MeasurementImporter.m b/src/+ui/MeasurementImporter.m index 322fbb4..2b7734c 100644 --- a/src/+ui/MeasurementImporter.m +++ b/src/+ui/MeasurementImporter.m @@ -169,8 +169,8 @@ function createComponents(app) helpHint = ui.HelpHint(app.GridConfig); helpHint.Tooltip = ['Parser must inherit from base class ' ... - '"tydex.Parser". Some parser come with the MF-Tyre ' ... - 'library, but you might have to build your own.' ... + '"tydex.Parser". Some parsers come with the tool, but ' ... + 'you might need to implement your own.' ... newline() newline() ... 'A parser must create "tydex.Measurement" objects from ' ... 'a given measurement file.']; diff --git a/src/+ui/TyreAnalysisPanel.m b/src/+ui/TyreAnalysisPanel.m index 95887e6..1c870b0 100644 --- a/src/+ui/TyreAnalysisPanel.m +++ b/src/+ui/TyreAnalysisPanel.m @@ -3,7 +3,7 @@ properties Measurements tydex.Measurement = tydex.Measurement.empty - Model mftyre.Model = mftyre.v62.Model.empty + Model magicformula.Model = magicformula.v62.Model.empty end properties (Access = private, Transient, NonCopyable) Grid matlab.ui.container.GridLayout @@ -42,7 +42,6 @@ function onShowSidebarStateButtonValueChanged(obj, ~, event) showSidebar = event.Value; s = obj.Settings.View.TyreAnalysisPanel; s.ShowSidebar = showSidebar; - updateSidebar(obj) end function onButtonsPlotTypeValueChanged(obj, origin, ~) buttons = obj.ButtonsPlotType; @@ -176,13 +175,11 @@ function setup(obj) set(obj, 'SizeChangedFcn', @obj.onUiFigureSizeChanged) end function update(obj) - updateSidebar(obj) + updateShowSideBarButton(obj) end - function updateSidebar(obj) - s = obj.Settings.View.TyreAnalysisPanel; - showSidebar = s.ShowSidebar; + function updateShowSideBarButton(obj) + showSidebar = obj.Settings.View.TyreAnalysisPanel.ShowSidebar; set(obj.ShowSidebarStateButton, 'Value', showSidebar) - obj.Plot.ShowSidebar = showSidebar; end end end diff --git a/src/+ui/TyreFitterFittingModesPanel.m b/src/+ui/TyreFitterFittingModesPanel.m index 146041c..c3c63a0 100644 --- a/src/+ui/TyreFitterFittingModesPanel.m +++ b/src/+ui/TyreFitterFittingModesPanel.m @@ -1,12 +1,13 @@ classdef TyreFitterFittingModesPanel < matlab.ui.componentcontainer.ComponentContainer - %FitterFITTINGMODESPANEL Panel to configure fitting modes for MFTyre fitter. + %FitterFITTINGMODESPANEL Panel to configure fitting modes for fitter. properties (SetAccess = protected) - FitModes mftyre.v62.FitMode + FitModes magicformula.v62.FitMode end properties (Access = private) Settings settings.AppSettings + FitterSettingsChangedListener event.listener end events (HasCallbackProperty, NotifyAccess = protected) @@ -21,7 +22,7 @@ methods (Access = private) function onCheckboxValueChanged(obj, origin, event) - [fitmodes, fitmodesText] = enumeration('mftyre.v62.FitMode'); + [fitmodes, fitmodesText] = enumeration('magicformula.v62.FitMode'); checkboxText = origin.Text; I = strcmp(fitmodesText, checkboxText); fitmode = fitmodes(I); @@ -62,8 +63,8 @@ function setupGrid(obj) 'Padding', 5*ones(1,4)); end function setupCheckboxes(obj) - import mftyre.v62.FitMode - [~, fitmodes] = enumeration('mftyre.v62.FitMode'); + import magicformula.v62.FitMode + [~, fitmodes] = enumeration('magicformula.v62.FitMode'); for i = 1:numel(fitmodes) cb = uicheckbox(obj.Grid, ... 'Text', fitmodes{i}, ... @@ -82,13 +83,14 @@ function setup(obj) setupGrid(obj) setupCheckboxes(obj) obj.FitModes = obj.Settings.Fitter.FitModes; - addlistener(obj.Settings.Fitter, 'SettingsChanged', ... + obj.FitterSettingsChangedListener = listener(... + obj.Settings.Fitter, 'SettingsChanged', ... @(~,~) update(obj)); end function updateCheckboxes(obj) checkboxes = obj.Checkboxes; set(checkboxes, 'Value', false) - fitmodes = enumeration('mftyre.v62.FitMode'); + fitmodes = enumeration('magicformula.v62.FitMode'); fitmodesSelected = obj.Settings.Fitter.FitModes; for i = 1:numel(fitmodesSelected) fitmode = fitmodesSelected(i); diff --git a/src/+ui/TyreFitterPanel.m b/src/+ui/TyreFitterPanel.m index b123abf..c548dec 100644 --- a/src/+ui/TyreFitterPanel.m +++ b/src/+ui/TyreFitterPanel.m @@ -1,5 +1,5 @@ classdef TyreFitterPanel < matlab.ui.componentcontainer.ComponentContainer - %TyreFitterPanel Provides GUI to configure and run MFTyre Fitter. + %TyreFitterPanel Provides GUI to configure and run Fitter. events (HasCallbackProperty, NotifyAccess = protected) FitterStartRequested diff --git a/src/+ui/TyreModelPanel.m b/src/+ui/TyreModelPanel.m index 5b909f6..9bcd047 100644 --- a/src/+ui/TyreModelPanel.m +++ b/src/+ui/TyreModelPanel.m @@ -1,9 +1,9 @@ classdef TyreModelPanel < matlab.ui.componentcontainer.ComponentContainer - %TYREMODELPANEL UI for viewing and fitting MFTyre models. + %TYREMODELPANEL UI for viewing and fitting tyre models. properties - Model mftyre.Model = mftyre.v62.Model.empty - Fitter mftyre.v62.Fitter = mftyre.v62.Fitter.empty + Model magicformula.Model = magicformula.v62.Model.empty + Fitter magicformula.v62.Fitter = magicformula.v62.Fitter.empty end properties (Access = protected) Settings settings.AppSettings diff --git a/src/+ui/TyreParametersTable.m b/src/+ui/TyreParametersTable.m index 02ac997..4d17609 100644 --- a/src/+ui/TyreParametersTable.m +++ b/src/+ui/TyreParametersTable.m @@ -1,8 +1,8 @@ classdef TyreParametersTable < matlab.ui.componentcontainer.ComponentContainer properties (Access = public) - Model mftyre.v62.Model - FittedParameters mftyre.v62.Parameters = mftyre.v62.Parameters.empty + Model magicformula.v62.Model + FittedParameters magicformula.v62.Parameters = magicformula.v62.Parameters.empty end properties (Access = private, Constant) @@ -18,6 +18,8 @@ properties (Access = private) Settings settings.AppSettings + TableViewSettingsChangedListener event.listener + FitterSettingsChangedListener event.listener end properties (Access = private, Transient, NonCopyable) @@ -106,7 +108,7 @@ function updateTable(obj) params = model.Parameters; paramNames = fieldnames(params); numParams = numel(paramNames); - type = 'mftyre.v62.ParameterFittable'; + type = 'magicformula.v62.ParameterFittable'; isFittable = false(numParams, 1); for i = 1:numParams paramName = paramNames{i}; @@ -157,7 +159,7 @@ function updateTable(obj) for i = 1:numel(fitmodes) fitmode = fitmodes(i); paramNamesFitModes = [paramNamesFitModes - mftyre.v62.getFitParamNames(fitmode)]; + magicformula.v62.getFitParamNames(fitmode)]; end isForFitmodes = contains(paramNames, paramNamesFitModes); I_remove = I_remove | ~isForFitmodes; @@ -195,7 +197,7 @@ function updateFittedParams(obj) for i = 1:numel(paramNames) name = paramNames{i}; param = params.(name); - if ~isa(param, 'mftyre.v62.ParameterFittable') + if ~isa(param, 'magicformula.v62.ParameterFittable') continue end row = find(strcmp(paramNamesTbl, name)); @@ -233,9 +235,11 @@ function setupListeners(obj) addlistener(obj, 'TyreModelFitterFinished', ... @obj.onTyreModelFitterFinished); s = obj.Settings; - addlistener(s.View.TyreParametersTable, ... + obj.TableViewSettingsChangedListener = listener(... + s.View.TyreParametersTable, ... 'SettingsChanged', @(~,~) update(obj)); - addlistener(s.Fitter, 'SettingsChanged', @(~,~) update(obj)); + obj.FitterSettingsChangedListener = listener(... + s.Fitter, 'SettingsChanged', @(~,~) update(obj)); end function update(obj) updateTable(obj) diff --git a/src/+ui/TyrePlotCurvesPanel.m b/src/+ui/TyrePlotCurvesPanel.m index e8c6b77..f9ba9e4 100644 --- a/src/+ui/TyrePlotCurvesPanel.m +++ b/src/+ui/TyrePlotCurvesPanel.m @@ -2,7 +2,7 @@ %TYREPLOTCURVESPANEL Plot X-Var sweeps with corresponding Y-Var. properties - Model mftyre.v62.Model = mftyre.v62.Model.empty + Model magicformula.v62.Model = magicformula.v62.Model.empty Measurements tydex.Measurement = tydex.Measurement.empty SteadyStateValues cell = {{0} {0} {0} {0.8E5} {1.5E3}} SteadyStateValuesSelected cell = [{0} {0} {0} {0.8E5} {1.5E3}] @@ -19,7 +19,6 @@ XAxisRangeFZW (1,2) = [500 1500] AutoRefresh logical = false - ShowSidebar logical = true end properties (Access = private) SteadyStateNamesAll = { @@ -36,6 +35,8 @@ 'N' }; LegendLabels = {}; + Settings settings.AppSettings + ViewSettingsChangedListener event.listener end properties (Access = private, Transient, NonCopyable) MainGrid matlab.ui.container.GridLayout @@ -278,7 +279,7 @@ function onXAxisRangeChanged(obj, ~, event) end methods(Access = protected) function updateSidebarState(obj) - show = obj.ShowSidebar; + show = obj.Settings.View.TyreAnalysisPanel.ShowSidebar; sidebar = obj.SidePanel; axes = obj.Axes; if show @@ -364,7 +365,7 @@ function updatePlot(obj) params = obj.Model.Parameters; p = struct(params); - [FX, FYW] = mftyre.v62.eval(p, SLIPANGL, LONGSLIP, ... + [FX, FYW] = magicformula.v62.eval(p, SLIPANGL, LONGSLIP, ... INCLANGL, INFLPRES, FZW, p.TYRESIDE); switch yVar @@ -695,11 +696,15 @@ function setupAxes(obj) function setupListeners(obj) addlistener(obj, 'TyreModelChanged', @obj.onModelChanged); addlistener(obj, 'TyreDataChanged', @obj.onDataChanged); + obj.ViewSettingsChangedListener = listener(... + obj.Settings.View.TyreAnalysisPanel, 'SettingsChanged', ... + @(~,~) obj.update()); end end methods (Access = protected) function setup(obj) set(obj, 'Position', [0 0 800 400]) + obj.Settings = settings.AppSettings(); setupMainGrid(obj) setupAxes(obj) setupSidePanel(obj) diff --git a/src/+ui/TyrePlotFrictionEllipsePanel.m b/src/+ui/TyrePlotFrictionEllipsePanel.m index ea62c5c..945fa66 100644 --- a/src/+ui/TyrePlotFrictionEllipsePanel.m +++ b/src/+ui/TyrePlotFrictionEllipsePanel.m @@ -2,8 +2,7 @@ %TYREPLOTFRICTIONELLIPSEPANEL Plots friction ellipse of tyre model. properties - Model mftyre.v62.Model = mftyre.v62.Model.empty - ShowSidebar logical = true + Model magicformula.v62.Model = magicformula.v62.Model.empty end properties (Access = private, Transient, NonCopyable) MainGrid matlab.ui.container.GridLayout @@ -11,6 +10,10 @@ SidePanel matlab.ui.container.Panel SidePanelGrid matlab.ui.container.GridLayout end + properties (Access = private) + Settings settings.AppSettings + SettingsChangedListener event.listener + end events (NotifyAccess = public) TyreModelChanged TyreDataChanged @@ -84,7 +87,7 @@ function onSteadyStateSettingsChanged(obj, source, event) end methods(Access = protected) function updateSidebarState(obj) - show = obj.ShowSidebar; + show = obj.Settings.View.TyreAnalysisPanel.ShowSidebar; sidebar = obj.SidePanel; axes = obj.Axes; if show @@ -127,14 +130,6 @@ function setupPlotSettings(obj) 'Padding', 10*ones(1,4), ... 'Scrollable', false); -% uilabel(g, 'Text', 'Legend'); -% uibutton(g, 'state', 'Text', 'On', 'Enable', 'off', ... -% 'ValueChangedFcn', @obj.onPlotSettingsChanged, ... -% 'Tag', 'Legend'); -% -% uilabel(g, 'Text', 'Hold'); -% uibutton(g, 'state', 'Text', 'On', 'Enable', 'off'); - uilabel(g, 'Text', 'Axis'); uibutton(g, 'state', 'Text', 'Equal', 'Value', true, ... 'Tag', 'AxisEqual', ... @@ -254,11 +249,15 @@ function setupAxes(obj) end function setupListeners(obj) addlistener(obj, 'TyreModelChanged', @obj.onModelChanged); + s = obj.Settings.View.TyreAnalysisPanel; + obj.SettingsChangedListener = listener(... + s, 'SettingsChanged', @(~,~) obj.update()); end end methods (Access = protected) function setup(obj) set(obj, 'Position', [0 0 800 400]) + obj.Settings = settings.AppSettings(); setupMainGrid(obj) setupAxes(obj) setupSidePanel(obj) diff --git a/src/MFTyreTool.m b/src/MagicFormulaTyreTool.m similarity index 90% rename from src/MFTyreTool.m rename to src/MagicFormulaTyreTool.m index afea3d6..cd1b923 100644 --- a/src/MFTyreTool.m +++ b/src/MagicFormulaTyreTool.m @@ -1,27 +1,27 @@ -classdef (Sealed) MFTyreTool < matlab.apps.AppBase - %MFTYRETOOL GUI for creating and analysing Pacejka MFTyre models. - % This tool is dependent on the MFTyre-MATLAB-Library found on - % Github: https://github.com/teasit/mftyre-matlab-library - % +classdef (Sealed) MagicFormulaTyreTool < matlab.apps.AppBase + %MagicFormulaTyreTool MATLAB GUI for Magic Formula Tyre Modeling. + % https://github.com/teasit/magic-formula-tyre-tool properties (Access = private) - TyreModel mftyre.Model = mftyre.v62.Model.empty() - TyreModelBackup mftyre.Model = mftyre.v62.Model.empty() - TyreModelFitted mftyre.Model = mftyre.v62.Model.empty() + TyreModel magicformula.Model = magicformula.v62.Model.empty() + TyreModelBackup magicformula.Model = magicformula.v62.Model.empty() + TyreModelFitted magicformula.Model = magicformula.v62.Model.empty() TyreMeasurements tydex.Measurement TyreMeasurementsSelected tydex.Measurement TyreMeasurementsSelectionIndices logical - TyreModelFitter mftyre.v62.Fitter + TyreModelFitter magicformula.v62.Fitter %App settings, e.g. state of table filters Settings settings.AppSettings + ViewLayoutSettingsChangedListener event.listener + FitterSettingsChangedListener event.listener end - properties (Constant, Access = private) + properties (Access = private) %Stores about configuration values, e.g. application version. - About struct = MFTyreTool.initAboutConfiguration() + About struct = MagicFormulaTyreTool.initAboutConfiguration() %Stores default solver (fmincon) settings e.g. max iterations. - SolverOptionsDefault = MFTyreTool.initSolverOptions() + SolverOptionsDefault = MagicFormulaTyreTool.initSolverOptions() end properties (Transient, Access = private) %If user selects a directory, it is saved and reused to accelerate @@ -34,9 +34,7 @@ TabGroupSecondary matlab.ui.container.TabGroup GridMain matlab.ui.container.GridLayout - AppMenu matlab.ui.container.Menu - TyreMenu matlab.ui.container.Menu - DataMenu matlab.ui.container.Menu + FileMenu matlab.ui.container.Menu FitterMenu matlab.ui.container.Menu HelpMenu matlab.ui.container.Menu ViewMenu matlab.ui.container.Menu @@ -68,7 +66,7 @@ end function file = dialogSaveTyreModel(model) filter = '.tir'; - defname = 'mftyre.tir'; + defname = 'magicformula.tir'; prompt = 'Choose name for Tyre Properties File'; [fileName, path] = uiputfile(filter, prompt, defname); if path == 0 @@ -143,6 +141,22 @@ function onUiFigureSizeChanged(app, ~, ~) height = position(4); % todo: do stuff here end + function onUiFigureCloseRequest(app, ~, ~) + fig = app.UIFigure; + optionExit = 'Close'; + optionReturn = 'Return'; + options = {optionExit, optionReturn}; + message = ['Do you really want to close the App?' newline() ... + 'Unsaved progress will be lost.']; + option = uiconfirm(fig, message, 'Close App', 'icon', 'warning', ... + 'Options', options, 'DefaultOption', optionReturn); + switch option + case optionReturn + return + case optionExit + delete(app) + end + end function onCheckUpdates(app, ~, ~) fig = app.UIFigure; title = 'Check for Updates'; @@ -165,20 +179,24 @@ function onCheckUpdates(app, ~, ~) return end - optionDownload = 'Download'; + optionGitHub = 'GitHub Releases'; + optionFileExchange = 'FileExchange'; optionCancel = 'Cancel'; - options = {optionDownload, optionCancel}; + options = {optionFileExchange, optionGitHub, optionCancel}; message = 'Update from %s to %s available.'; message = sprintf(message, versionCurrent, versionLatest); message = [message newline() newline() ... 'Note that for the latest GitHub release to show up on ' ... 'FileExchange, expect a delay of up to an hour.']; selection = uiconfirm(fig, message, title, 'icon', 'info', ... - 'Options', options, 'DefaultOption', optionDownload); + 'Options', options, 'DefaultOption', optionFileExchange); switch selection - case optionDownload + case optionGitHub url = [app.About.Source '/releases/latest']; web(url) + case optionFileExchange + url = app.About.FileExchange; + web(url, '-new') case optionCancel return end @@ -189,7 +207,7 @@ function onTyreModelEdited(app, ~, ~) notify(app.TyreAnalysisPanel, 'TyreModelChanged', evtdata) end function onSelectFitModesMenuSelected(app, source, ~) - [fitmodes, fitmodeNames] = enumeration('mftyre.v62.FitMode'); + [fitmodes, fitmodeNames] = enumeration('magicformula.v62.FitMode'); fitmodeName = source.Text; I = strcmp(fitmodeNames, fitmodeName); fitmode = fitmodes(I); @@ -216,7 +234,7 @@ function onLoadModelRequested(app, ~, ~) file = fullfile(path, fileName); try - model = mftyre.v62.Model(file); + model = magicformula.v62.Model(file); app.setTyreModel(model) catch cause exception = exceptions.CouldNotImportTIR(fileName); @@ -227,7 +245,7 @@ function onLoadModelRequested(app, ~, ~) function onClearModelRequested(app, ~, ~) delete(app.TyreModel) delete(app.TyreModelBackup) - modelEmpty = mftyre.v62.Model.empty; + modelEmpty = magicformula.v62.Model.empty; app.setTyreModel(modelEmpty) end function onImportMeasurementsRequested(app, ~, ~) @@ -381,7 +399,7 @@ function onFitterMeasurementsLoaded(app, ~, event) app.TyreMeasurementsPanel.addMeasurementFitModes(flagsMap); end function onStartFittingRequested(app, ~, ~) - import mftyre.v62.FitMode + import magicformula.v62.FitMode fig = app.UIFigure; title = 'Tyre Model Fitter'; @@ -451,7 +469,7 @@ function onStartFittingRequested(app, ~, ~) 'Details printed to logfile/console.']; uialert(fig, message, title, 'icon', icon) catch ME - paramsFitted = mftyre.v62.Parameters.empty; + paramsFitted = magicformula.v62.Parameters.empty; e = events.TyreModelFitterFinished(paramsFitted); notify(app.TyreModelPanel, 'TyreModelFitterFinished', e) @@ -479,8 +497,8 @@ function onNewTyreModelRequested(app, ~, ~) end end - modelNew = mftyre.v62.Model(); - file = MFTyreTool.dialogSaveTyreModel(modelNew); + modelNew = magicformula.v62.Model(); + file = MagicFormulaTyreTool.dialogSaveTyreModel(modelNew); if isempty(file) return end @@ -497,7 +515,7 @@ function onSaveTyreModelRequested(app, ~, ~) if isempty(file) app.setTyreModel(model) model = app.TyreModel; - file = MFTyreTool.dialogSaveTyreModel(model); + file = MagicFormulaTyreTool.dialogSaveTyreModel(model); model.File = file; return end @@ -521,7 +539,7 @@ function onSaveTyreModelRequested(app, ~, ~) case optNew app.setTyreModel(model) model = app.TyreModel; - file = MFTyreTool.dialogSaveTyreModel(model); + file = MagicFormulaTyreTool.dialogSaveTyreModel(model); model.File = file; end end @@ -557,7 +575,7 @@ function onClearTyreModelRequested(app, ~, ~) end end - model = mftyre.v62.Model.empty(); + model = magicformula.v62.Model.empty(); app.setTyreModel(model) end function onViewMenuSelected(app, source, ~) @@ -595,7 +613,7 @@ function onApplyFittedTyreModelRequested(app, ~, ~) end function onTyreModelStructToMatRequested(app, ~, ~) filter = '.mat'; - defname = 'mftyre_model_parameters.mat'; + defname = 'mfparams.mat'; prompt = 'Choose name for MAT file'; [fileName, path] = uiputfile(filter, prompt, defname); if path == 0 @@ -699,6 +717,7 @@ function createUIFigure(app) 'Icon', 'tyre_icon.png', ... 'AutoResizeChildren', 'off'); app.UIFigure.SizeChangedFcn = @app.onUiFigureSizeChanged; + app.UIFigure.CloseRequestFcn = @app.onUiFigureCloseRequest; end function createGrid(app) app.GridMain = uigridlayout(app.UIFigure, ... @@ -775,51 +794,37 @@ function createTyreAnalysisTab(app) app.TyreModelAnalysisGrid); end function createMenus(app) - createAppMenu(app) - createTyreMenu(app) - createDataMenu(app) + createFileMenu(app) createFitterMenu(app) createViewMenu(app) createHelpMenu(app) end - function createAppMenu(app) - app.AppMenu = uimenu(app.UIFigure, 'Text', 'App'); - uimenu(app.AppMenu, ... - 'Text', 'Check for Updates', ... - 'MenuSelectedFcn', @app.onCheckUpdates) - uimenu(app.AppMenu, ... - 'Text', '&Reset Application', ... - 'Accelerator', 'R', ... - 'Separator', 'on', ... - 'MenuSelectedFcn', @app.onResetApplicationRequested) - end - function createDataMenu(app) - app.DataMenu = uimenu(app.UIFigure, 'Text', 'Data'); - uimenu(app.DataMenu, ... - 'Text', '&Import Tyre Data', ... - 'Accelerator', 'I', ... - 'MenuSelectedFcn', @app.onImportMeasurementsRequested); - uimenu(app.DataMenu, ... - 'Text', 'Clear Tyre Data', ... - 'MenuSelectedFcn', @app.onClearMeasurementsRequested); - end - function createTyreMenu(app) - app.TyreMenu = uimenu(app.UIFigure, 'Text', 'Tyre'); - uimenu(app.TyreMenu, ... + function createFileMenu(app) + app.FileMenu = uimenu(app.UIFigure, 'Text', 'File'); + uimenu(app.FileMenu, ... 'Text', '&New Tyre Model', ... 'Accelerator', 'N', ... 'MenuSelectedFcn', @app.onNewTyreModelRequested); - uimenu(app.TyreMenu, ... + uimenu(app.FileMenu, ... 'Text', '&Open Tyre Model', ... 'Accelerator', 'O', ... 'MenuSelectedFcn', @app.onLoadModelRequested); - uimenu(app.TyreMenu, ... + uimenu(app.FileMenu, ... 'Text', '&Save Tyre Model', ... 'Accelerator', 'S', ... 'MenuSelectedFcn', @app.onSaveTyreModelRequested); - uimenu(app.TyreMenu, ... + uimenu(app.FileMenu, ... 'Text', '&Clear Tyre Model', ... 'MenuSelectedFcn', @app.onClearModelRequested); + + uimenu(app.FileMenu, ... + 'Text', '&Import Tyre Data', ... + 'Separator', 'on', ... + 'Accelerator', 'I', ... + 'MenuSelectedFcn', @app.onImportMeasurementsRequested); + uimenu(app.FileMenu, ... + 'Text', 'Clear Tyre Data', ... + 'MenuSelectedFcn', @app.onClearMeasurementsRequested); end function createFitterMenu(app) app.FitterMenu = uimenu(app.UIFigure, 'Text', 'Fitter'); @@ -827,10 +832,10 @@ function createFitterMenu(app) 'Text', 'Select Fit-Modes', ... 'Separator', 'on'); fitmodesText = { - char(mftyre.v62.FitMode.Fx0) - char(mftyre.v62.FitMode.Fy0) - char(mftyre.v62.FitMode.Fx) - char(mftyre.v62.FitMode.Fy) + char(magicformula.v62.FitMode.Fx0) + char(magicformula.v62.FitMode.Fy0) + char(magicformula.v62.FitMode.Fx) + char(magicformula.v62.FitMode.Fy) }; fitmodesSelected = app.Settings.Fitter.FitModes; for i = 1:numel(fitmodesText) @@ -884,6 +889,14 @@ function createHelpMenu(app) uimenu(app.HelpMenu, ... 'Text', 'About', ... 'MenuSelectedFcn', @app.onAboutDialogRequested) + uimenu(app.HelpMenu, ... + 'Text', 'Check for Updates', ... + 'MenuSelectedFcn', @app.onCheckUpdates) + uimenu(app.HelpMenu, ... + 'Text', '&Reset Application', ... + 'Accelerator', 'R', ... + 'Separator', 'on', ... + 'MenuSelectedFcn', @app.onResetApplicationRequested) end end methods (Access = private) @@ -891,9 +904,11 @@ function initSettings(app) app.Settings = settings.AppSettings(); end function addlisteners(app) - addlistener(app.Settings.View.Layout, 'SettingsChanged', ... + app.ViewLayoutSettingsChangedListener = listener(... + app.Settings.View.Layout, 'SettingsChanged', ... @app.onViewLayoutSettingsChanged); - addlistener(app.Settings.Fitter, 'SettingsChanged', ... + app.FitterSettingsChangedListener = listener(... + app.Settings.Fitter, 'SettingsChanged', ... @app.onFitterSettingsChanged); end function startupFcn(app) @@ -913,21 +928,21 @@ function startupFcn(app) switch selection case optionLoad try - model = mftyre.v62.Model(lastTyreFile); + model = magicformula.v62.Model(lastTyreFile); catch - model = mftyre.v62.Model.empty; + model = magicformula.v62.Model.empty; message = 'Failed to load last tyre model!'; uialert(fig, message, title, 'Icon', 'error') end case optionCancel - model = mftyre.v62.Model.empty; + model = magicformula.v62.Model.empty; end else - model = mftyre.v62.Model.empty; + model = magicformula.v62.Model.empty; end app.setTyreModel(model) - fitter = mftyre.v62.Fitter(); + fitter = magicformula.v62.Fitter(); app.TyreModelFitter = fitter; app.TyreModelPanel.Fitter = fitter; @@ -939,7 +954,7 @@ function startupFcn(app) function setTyreModel(app, model, overwriteBackup) arguments app - model mftyre.v62.Model + model magicformula.v62.Model overwriteBackup logical = true end if app.TyreModel ~= model @@ -985,7 +1000,7 @@ function reset(app) delete(fig.Children) - metaClass = ?MFTyreTool; + metaClass = metaclass(app); metaProperties = metaClass.PropertyList; isTransient = [metaProperties.Transient]; hasDefault = [metaProperties.HasDefault]; @@ -1004,7 +1019,7 @@ function reset(app) close(dlg) end - function app = MFTyreTool + function app = MagicFormulaTyreTool runningApp = getRunningApp(app); if isempty(runningApp) diff --git a/src/about.json b/src/about.json index 461fd0a..15cd919 100644 --- a/src/about.json +++ b/src/about.json @@ -1,9 +1,10 @@ { - "Name": "MFTyreTool", - "Version": "1.3.0", + "Name": "MagicFormulaTyreTool", + "Version": "1.3.1", "Authors": [ "Tom Teasdale" ], - "Source": "github.com/teasit/mftyre-matlab-tool", + "Source": "https://github.com/teasit/magic-formula-tyre-tool", + "FileExchange": "https://mathworks.com/matlabcentral/fileexchange/111375", "Contact": "teasdale@lightsaber.red" } \ No newline at end of file diff --git a/src/deprecated/ImageWithUploadButton.m b/src/deprecated/ImageWithUploadButton.m deleted file mode 100644 index b03edb4..0000000 --- a/src/deprecated/ImageWithUploadButton.m +++ /dev/null @@ -1,75 +0,0 @@ -classdef ImageWithUploadButton < matlab.ui.componentcontainer.ComponentContainer - %IMAGEWITHUPLOADBUTTON - - properties - ImageSource char - end - - events (HasCallbackProperty, NotifyAccess = protected) - ImageSourceInvalid - ImageChanged - end - - properties (Access = private, Transient, NonCopyable) - GridMain matlab.ui.container.GridLayout - Image matlab.ui.control.Image - UploadButton matlab.ui.control.Button - end - - methods (Access = public) - function setImageSource(obj, value) - if ~ischar(value) - notify(obj, 'ImageSourceInvalid') - return - end - obj.Image.ImageSource = value; - notify(obj, 'ImageChanged'); - end - end - - methods - function value = get.ImageSource(obj) - value = obj.Image.ImageSource; - end - end - - methods (Access = private) - function getImageSource(obj) - filter = {'*.jpg'; '*.png'; '*.gif'; '*.svg'}; - [file, path] = uigetfile(filter); - if ~file - return - end - obj.Image.ImageSource = [path, file]; - end - end - - methods (Access = protected) - function setup(obj) - % Position only used for standalone-testing. - obj.Position = [0 0 600 300]; - - obj.GridMain = uigridlayout(obj); - obj.GridMain.RowHeight = {'fit', 22}; - obj.GridMain.ColumnWidth = {'1x'}; - - obj.Image = uiimage(obj.GridMain); - obj.Image.Layout.Row = 1; - obj.Image.Layout.Column = 1; - obj.Image.VerticalAlignment = 'top'; - - obj.UploadButton = uibutton(obj.GridMain); - obj.UploadButton.Layout.Row = 2; - obj.UploadButton.Layout.Column = 1; - obj.UploadButton.VerticalAlignment = 'top'; - obj.UploadButton.Text = 'Select Image'; - obj.UploadButton.ButtonPushedFcn = @(o,e) getImageSource(obj); - end - - function update(obj) - end - end - - methods (Access=private) - end -end diff --git a/src/deprecated/TyreDatabaseBrowser.m b/src/deprecated/TyreDatabaseBrowser.m deleted file mode 100644 index 8d8e666..0000000 --- a/src/deprecated/TyreDatabaseBrowser.m +++ /dev/null @@ -1,91 +0,0 @@ -classdef TyreDatabaseBrowser < matlab.ui.componentcontainer.ComponentContainer - %TYREDATABASEBROWSER Lists all added tyres in a tabular view - - properties - end - - events (HasCallbackProperty, NotifyAccess = protected) - RemoveTyreRequest %RemoveTyreRequestFcn - OpenTyreRequest %OpenTyreRequestFcn - AddTyreRequest %NewTyreRequestFcn - end - - properties (Access = private, Transient, NonCopyable) - Grid matlab.ui.container.GridLayout - TyreTable matlab.ui.control.Table - RemoveTyreButton matlab.ui.control.Button - OpenTyreButton matlab.ui.control.Button - AddTyreButton matlab.ui.control.Button - end - - methods (Access=protected) - function setup(obj) - % Position only used for standalone-testing. - obj.Position = [0 0 400 300]; - - obj.Grid = uigridlayout(obj); - obj.Grid.RowHeight = {'1x', 22}; - obj.Grid.ColumnWidth = {'1x', '1x', '1x'}; - obj.Grid.ColumnSpacing = 10; - obj.Grid.Padding = 0*ones(1,4); - - obj.TyreTable = uitable(obj.Grid); - obj.TyreTable.Layout.Row = 1; - obj.TyreTable.Layout.Column = [1 3]; - obj.TyreTable.ColumnName = { - 'Manufacturer'; - 'ID'; - 'Diameter'; - 'Type'}; - obj.TyreTable.RowName = {}; - obj.TyreTable.ColumnWidth = 'auto'; - obj.TyreTable.ColumnSortable = true; - obj.TyreTable.ColumnEditable = false(1,3); - obj.TyreTable.CellSelectionCallback = ... - @(~,event) onCellSelection(obj, event); - obj.TyreTable.Data = { - 'Hoosier', 'XXXXX', '16"', 'Slicks'; - 'Continental', 'XXXX', '18"', 'Slicks'; - }; - - obj.AddTyreButton = uibutton(obj.Grid, 'push'); - obj.AddTyreButton.Layout.Row = 2; - obj.AddTyreButton.Layout.Column = 1; - obj.AddTyreButton.Text = 'Add Tyre'; - obj.AddTyreButton.ButtonPushedFcn = ... - @(~,~) notify(obj, 'AddTyreRequest'); - - obj.OpenTyreButton = uibutton(obj.Grid, 'push'); - obj.OpenTyreButton.Layout.Row = 2; - obj.OpenTyreButton.Layout.Column = 2; - obj.OpenTyreButton.Enable = 'off'; - obj.OpenTyreButton.Text = 'Open Tyre'; - obj.OpenTyreButton.ButtonPushedFcn = ... - @(~,~) notify(obj, 'OpenTyreRequest'); - - obj.RemoveTyreButton = uibutton(obj.Grid, 'push'); - obj.RemoveTyreButton.Layout.Row = 2; - obj.RemoveTyreButton.Layout.Column = 3; - obj.RemoveTyreButton.Enable = 'off'; - obj.RemoveTyreButton.Text = 'Remove Tyre'; - obj.RemoveTyreButton.ButtonPushedFcn = ... - @(~,~) notify(obj, 'RemoveTyreRequest'); - end - - function update(obj) - end - end - - methods (Access=private) - function onCellSelection(obj, event) - indices = event.Indices; - - numberRows = size(indices,1); - singleRow = numberRows == 1; - multipleRows = numberRows > 1; - - obj.RemoveTyreButton.Enable = singleRow || multipleRows; - obj.OpenTyreButton.Enable = singleRow; - end - end -end diff --git a/src/deprecated/TyrePropertiesEditor.m b/src/deprecated/TyrePropertiesEditor.m deleted file mode 100644 index 1a945b4..0000000 --- a/src/deprecated/TyrePropertiesEditor.m +++ /dev/null @@ -1,86 +0,0 @@ -classdef TyrePropertiesEditor < matlab.ui.componentcontainer.ComponentContainer - %TYREPROPERTIESEDITOR - - properties - Tyre Tyre - TyreImagePath char = 'tyres/Hoosier_43075_LCO_7/43075_top.jpg' - end - - events (HasCallbackProperty, NotifyAccess = protected) - - end - - properties (Access = private, Transient, NonCopyable) - GridMain matlab.ui.container.GridLayout - GridFields matlab.ui.container.GridLayout - NameEditField matlab.ui.control.EditField - NameEditFieldLabel matlab.ui.control.Label - ManufacturerEditField matlab.ui.control.EditField - ManufacturerEditFieldLabel matlab.ui.control.Label - PartnumberEditField matlab.ui.control.EditField - PartnumberEditFieldLabel matlab.ui.control.Label - TyreTypeDropDown matlab.ui.control.DropDown - TyreTypeDropDownLabel matlab.ui.control.Label - TyreImageComponent ui.ImageWithUploadButton - end - - methods (Access=protected) - function setup(obj) - % Position only used for standalone-testing. - obj.Position = [0 0 1000 400]; - - obj.GridMain = uigridlayout(obj); - obj.GridMain.RowHeight = {'1x'}; - obj.GridMain.ColumnWidth = {'2x',200}; - obj.GridMain.ColumnSpacing = 10; - - obj.GridFields = uigridlayout(obj.GridMain); - obj.GridFields.RowHeight = {22,22,22,22,'1x'}; - obj.GridFields.ColumnWidth = {'fit','1x'}; - obj.GridFields.Layout.Column = 1; - - obj.NameEditField = uieditfield(obj.GridFields); - obj.NameEditField.Layout.Row = 1; - obj.NameEditField.Layout.Column = 2; - obj.NameEditFieldLabel = uilabel(obj.GridFields); - obj.NameEditFieldLabel.Layout.Row = 1; - obj.NameEditFieldLabel.Layout.Column = 1; - obj.NameEditFieldLabel.Text = 'Name'; - - obj.ManufacturerEditField = uieditfield(obj.GridFields); - obj.ManufacturerEditField.Layout.Row = 2; - obj.ManufacturerEditField.Layout.Column = 2; - obj.ManufacturerEditFieldLabel = uilabel(obj.GridFields); - obj.ManufacturerEditFieldLabel.Layout.Row = 2; - obj.ManufacturerEditFieldLabel.Layout.Column = 1; - obj.ManufacturerEditFieldLabel.Text = 'Manufacturer'; - - obj.PartnumberEditField = uieditfield(obj.GridFields); - obj.PartnumberEditField.Layout.Row = 3; - obj.PartnumberEditField.Layout.Column = 2; - obj.PartnumberEditFieldLabel = uilabel(obj.GridFields); - obj.PartnumberEditFieldLabel.Layout.Row = 3; - obj.PartnumberEditFieldLabel.Layout.Column = 1; - obj.PartnumberEditFieldLabel.Text = 'ID'; - - obj.TyreTypeDropDown = uidropdown(obj.GridFields); - obj.TyreTypeDropDown.Layout.Row = 4; - obj.TyreTypeDropDown.Layout.Column = 2; - obj.TyreTypeDropDown.Items = {'Slicks', 'Wet'}; - obj.TyreTypeDropDownLabel = uilabel(obj.GridFields); - obj.TyreTypeDropDownLabel.Layout.Row = 4; - obj.TyreTypeDropDownLabel.Layout.Column = 1; - obj.TyreTypeDropDownLabel.Text = 'Type'; - - obj.TyreImageComponent = ui.ImageWithUploadButton(obj.GridMain); - obj.TyreImageComponent.Layout.Column = 2; - obj.TyreImageComponent.setImageSource(obj.TyreImagePath); - end - - function update(obj) - end - end - - methods (Access=private) - end -end diff --git a/src/deprecated/getParentFigure.m b/src/deprecated/getParentFigure.m deleted file mode 100644 index 3c0bbac..0000000 --- a/src/deprecated/getParentFigure.m +++ /dev/null @@ -1,5 +0,0 @@ -function f = getParentFigure(h) -f = ancestor(h, 'figure'); -%GETPARENTFIGURE Returns parent uifigure of graphics object. -end - diff --git a/src/magic-formula-tyre-library b/src/magic-formula-tyre-library new file mode 160000 index 0000000..84edaa6 --- /dev/null +++ b/src/magic-formula-tyre-library @@ -0,0 +1 @@ +Subproject commit 84edaa69b1b5d88452432a9bf1e8f6c244f41cb1 diff --git a/src/mftyre-matlab-library b/src/mftyre-matlab-library deleted file mode 160000 index 4223d3b..0000000 --- a/src/mftyre-matlab-library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4223d3b3338a394222dd75c22cea16e9011fdf47 diff --git a/tools/publishReleaseMFTyreTool.m b/tools/publishRelease.m similarity index 84% rename from tools/publishReleaseMFTyreTool.m rename to tools/publishRelease.m index b73a457..b4615a4 100644 --- a/tools/publishReleaseMFTyreTool.m +++ b/tools/publishRelease.m @@ -1,12 +1,12 @@ -function publishReleaseMFTyreTool(version, title, changelogFile, packageFile, packagerFile, packagerToolboxFile) -%PUBLISHRELEASEMFTYRETOOL Automatic release to GitHub +function publishRelease(version, title, changelogFile, packageFile, packagerFile, packagerToolboxFile) +%PUBLISHRELEASE Automatic release to GitHub arguments version char = getVersionFromAboutJSON() title char = char.empty changelogFile char {mustBeFile} = 'CHANGELOG.md' - packageFile char = 'MFTyreTool.mltbx' - packagerFile char = 'MFTyreToolApp.prj' - packagerToolboxFile char = 'MFTyreToolToolboxPackager.prj' + packageFile char = 'MagicFormulaTyreTool.mltbx' + packagerFile char = 'MagicFormulaTyreTool.prj' + packagerToolboxFile char = 'ToolboxPackager.prj' end pattern = 'v' + digitsPattern() + '.' + digitsPattern() + '.' + digitsPattern(); versionInvalid = ~matches(version, pattern);