Skip to content

Commit

Permalink
Reworked measurement import; fixed common plotting issue; cosmetics; …
Browse files Browse the repository at this point in the history
…upgrade to 2023a
  • Loading branch information
teasit committed Oct 8, 2023
1 parent 21c5b56 commit 6463348
Show file tree
Hide file tree
Showing 46 changed files with 577 additions and 470 deletions.
3 changes: 1 addition & 2 deletions +tests/+ui/FrictionEllipseAxes.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ function deleteTestObject(testCase)

methods (Test)
function testChangeTyreModel(testCase)
file = fullfile('doc','examples','fsae-ttc-data',...
'fsaettc_obfuscated.tir');
file = 'doc/examples/fsae/fsaettc_obfuscated.tir';
model = MagicFormulaTyre(file);
ax = testCase.TestObject;
ax.Model = model;
Expand Down
3 changes: 1 addition & 2 deletions +tests/+ui/TyreAnalysisPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ function deleteTestObject(testCase)

methods (Test)
function testChangeTyreModel(testCase)
file = fullfile('doc','examples','fsae-ttc-data',...
'fsaettc_obfuscated.tir');
file = 'doc/examples/fsae/fsaettc_obfuscated.tir';
model = MagicFormulaTyre(file);
p = testCase.TestObject;
e = events.ModelChangedEventData(model);
Expand Down
23 changes: 13 additions & 10 deletions MagicFormulaTyreTool.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<deployment-project plugin="plugin.apptool" plugin-version="1.0">
<configuration build-checksum="1198488352" file="C:\Users\Tom\Documents\magic-formula-tyre-tool\MagicFormulaTyreTool.prj" location="C:\Users\Tom\Documents\magic-formula-tyre-tool" name="MagicFormulaTyreTool" target="target.mlapps" target-name="Package App">
<configuration build-checksum="2279359127" file="C:\Users\Tom\Documents\magic-formula-tyre-tool\MagicFormulaTyreTool.prj" location="C:\Users\Tom\Documents\magic-formula-tyre-tool" name="MagicFormulaTyreTool" target="target.mlapps" target-name="Package App">
<param.appname>MagicFormulaTyreTool</param.appname>
<param.authnamewatermark>Tom Teasdale</param.authnamewatermark>
<param.email>teasdale@lightsaber.red</param.email>
Expand All @@ -13,7 +13,7 @@
<param.summary>MATLAB GUI for Magic Formula Tyre Modeling</param.summary>
<param.description>https://github.com/teasit/magic-formula-tyre-tool</param.description>
<param.screenshot>${PROJECT_ROOT}\assets\img\App_Screenshot_Main.jpg</param.screenshot>
<param.version>1.4.0</param.version>
<param.version>1.5.0</param.version>
<param.products.name>
<item>MATLAB</item>
<item>Optimization Toolbox</item>
Expand All @@ -25,9 +25,9 @@
<item>8</item>
</param.products.id>
<param.products.version>
<item>9.13</item>
<item>9.4</item>
<item>9.1</item>
<item>23.2</item>
<item>23.2</item>
<item>23.2</item>
</param.products.version>
<param.platforms />
<param.output>${PROJECT_ROOT}</param.output>
Expand All @@ -46,6 +46,7 @@
<file>${PROJECT_ROOT}\src\+events\FitterMeasurementsLoadedEventData.m</file>
<file>${PROJECT_ROOT}\src\+events\FitterSettingsChangedEventData.m</file>
<file>${PROJECT_ROOT}\src\+events\FittingModesChangedEventData.m</file>
<file>${PROJECT_ROOT}\src\+events\MeasurementImportRequested.m</file>
<file>${PROJECT_ROOT}\src\+events\MeasurementSelectionChanged.m</file>
<file>${PROJECT_ROOT}\src\+events\ModelChangedEventData.m</file>
<file>${PROJECT_ROOT}\src\+events\PlotTyreMeasurementsRequested.m</file>
Expand All @@ -64,10 +65,13 @@
<file>${PROJECT_ROOT}\src\+exceptions\InvalidSolverOptions.m</file>
<file>${PROJECT_ROOT}\src\+helpers\checkUpdateAvailable.m</file>
<file>${PROJECT_ROOT}\src\+helpers\fitterOutputFcn.m</file>
<file>${PROJECT_ROOT}\src\+helpers\getParsers.m</file>
<file>${PROJECT_ROOT}\src\+settings\AbstractSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\AppSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\FitterSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\LastSessionSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\LayoutSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\TextSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\TyreAnalysisPanelViewSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\TyreModelPanelViewSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\TyreParametersTableViewSettings.m</file>
Expand All @@ -76,16 +80,15 @@
<file>${PROJECT_ROOT}\src\+settings\ViewLayoutSettings.m</file>
<file>${PROJECT_ROOT}\src\+settings\ViewSettings.m</file>
<file>${PROJECT_ROOT}\src\+ui\FrictionEllipseAxes.m</file>
<file>${PROJECT_ROOT}\src\+ui\HelpHint.m</file>
<file>${PROJECT_ROOT}\src\+ui\MeasurementImporter.m</file>
<file>${PROJECT_ROOT}\src\+ui\NumericRangeSelector.m</file>
<file>${PROJECT_ROOT}\src\+ui\SearchBar.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreAnalysisPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreDataImportPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreDataPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreDataTable.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreFitterFittingModesPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreFitterPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreFitterSolverSettingsPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreMeasurementsPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreMeasurementsTable.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreModelPanel.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyreParametersTable.m</file>
<file>${PROJECT_ROOT}\src\+ui\TyrePlotCurvesPanel.m</file>
Expand Down Expand Up @@ -144,7 +147,7 @@
</build-deliverables>
<workflow />
<matlab>
<root>C:\Program Files\MATLAB\R2022b</root>
<root>C:\Program Files\MATLAB\R2023b</root>
<toolboxes />
</matlab>
<platform>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ de-identified and obscured data for demonstration purposes.

## Requirements

- MATLAB Base (tested with R2021a)
- MATLAB Base
- Optimization Toolbox (for fitting)
- Signal Processing Toolbox (for raw measurement import)
- Parallel Computing Toolbox (if `parfor` is to be used while fitting)

## Installation

There are several ways:

- 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)
- Clone using Git and integrate into your projects using a [Project Reference](https://mathworks.com/help/simulink/ug/add-or-remove-a-reference-to-another-project.html)

## Usage

Expand Down Expand Up @@ -133,6 +134,5 @@ comparison.

## Known Issues

- Currently only Fitting of Fx0, Fy0, Fx, Fy 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.
6 changes: 3 additions & 3 deletions ToolboxPackager.prj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<param.summary>MATLAB GUI for Magic Formula Tyre Modeling</param.summary>
<param.description>https://github.com/teasit/magic-formula-tyre-tool</param.description>
<param.screenshot>${PROJECT_ROOT}\assets\img\App_Screenshot_Main.jpg</param.screenshot>
<param.version>1.4.0</param.version>
<param.version>1.5.0</param.version>
<param.output>${PROJECT_ROOT}\MagicFormulaTyreTool.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -63,7 +63,7 @@ MagicFormulaTyreTool_resources</param.exclude.filters>
<param.matlab.project.id />
<param.matlab.project.name />
<param.release.start>R2021a</param.release.start>
<param.release.end>R2022b</param.release.end>
<param.release.end>latest</param.release.end>
<param.release.current.only>false</param.release.current.only>
<param.compatiblity.windows>true</param.compatiblity.windows>
<param.compatiblity.macos>true</param.compatiblity.macos>
Expand Down Expand Up @@ -125,7 +125,7 @@ MagicFormulaTyreTool_resources</param.exclude.filters>
</build-deliverables>
<workflow />
<matlab>
<root>C:\Program Files\MATLAB\R2022b</root>
<root>C:\Program Files\MATLAB\R2023b</root>
<toolboxes />
</matlab>
<platform>
Expand Down
Binary file modified doc/GettingStarted.mlx
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info Ref="doc/examples/fsae" Type="Relative"/>
2 changes: 1 addition & 1 deletion sandbox/+tydex/+parsers/ExampleParser.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef ExampleParser < tydex.Parser
classdef (Hidden) ExampleParser < tydex.Parser
methods (Access = protected)
[measurements, bins, binvalues] = parse(obj,file)
end
Expand Down
Binary file modified sandbox/test_data.mlx
Binary file not shown.
Binary file modified sandbox/test_mfeval.mlx
Binary file not shown.
12 changes: 12 additions & 0 deletions src/+events/MeasurementImportRequested.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
classdef (ConstructOnLoad) MeasurementImportRequested < event.EventData
properties
Files cell
Parser function_handle;
end
methods
function eventData = MeasurementImportRequested(files, parser)
eventData.Files = cellstr(files);
eventData.Parser = parser;
end
end
end
11 changes: 11 additions & 0 deletions src/+helpers/getParsers.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function [names, handles] = getParsers()
metaPackageObj = meta.package.fromName('tydex.parsers');
metaClassObj = metaPackageObj.ClassList;
isAbstract = [metaClassObj.Abstract];
isHidden = [metaClassObj.Hidden];
metaClassObj(isAbstract|isHidden) = [];
namesFull = {metaClassObj.Name};
namesSplit = cellfun(@(x)strsplit(x,'.'), namesFull, 'UniformOutput', 0);
names = cellfun(@(x)x{end}, namesSplit, 'UniformOutput', 0);
handles = cellfun(@str2func, namesFull, 'UniformOutput', 0);
end
14 changes: 11 additions & 3 deletions src/+settings/AppSettings.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
classdef AppSettings < settings.AbstractSettings
%APPSETTINGS Loads app settings from and saves them to persistent storage.
properties (SetObservable, AbortSet)
Layout settings.LayoutSettings
Fitter settings.FitterSettings
Text settings.TextSettings
View settings.ViewSettings
LastSession settings.LastSessionSettings
Version char
Expand Down Expand Up @@ -32,9 +34,15 @@ function save(obj)
end
end
function init(obj)
obj.Fitter = settings.FitterSettings();
obj.View = settings.ViewSettings();
obj.LastSession = settings.LastSessionSettings();
props = metaclass(obj).PropertyList;
isSetObservable = [props.SetObservable];
props(~isSetObservable) = [];
for i = 1:numel(props)
p = props(i);
name = p.Name;
class = str2func(p.Validation.Class.Name);
obj.(name) = class();
end
try
s = settings();
if hasGroup(s, obj.SettingsGroupTopLevel)
Expand Down
2 changes: 1 addition & 1 deletion src/+settings/FitterSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%FITTERSETTINGS Contains app settings for fitter
properties (SetObservable, AbortSet)
FitModes magicformula.FitMode = magicformula.FitMode.empty
DownsampleFactor double = double.empty
DownsampleFactor double = 1
OptimizerSettings struct = struct.empty
end
methods
Expand Down
13 changes: 13 additions & 0 deletions src/+settings/LayoutSettings.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
classdef LayoutSettings < settings.AbstractSettings
%LAYOUTSETTINGS Contains app settings for layout (e.g. default padding)
properties (Constant, AbortSet)
DefaultPadding double = 5*ones(1,4);
DefaultButtonHeight double = 22
DefaultButtonWidthTextIcon = 110
DefaultButtonWidthOnlyText = 75
DefaultButtonWidthOnlyIcon = 25
DefaultColumnSpacing double = 10
DefaultRowSpacing double = 5
DefaultSidebarWidth double = 250
end
end
7 changes: 7 additions & 0 deletions src/+settings/TextSettings.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
classdef TextSettings < settings.AbstractSettings
%LAYOUTSETTINGS Contains app settings for layout (e.g. default padding)
properties (Constant, AbortSet)
FontWeightPanel = 'bold'
FontNamePanel = 'Helvetica'
end
end
9 changes: 5 additions & 4 deletions src/+ui/HelpHint.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
%callback. Can be used to open HTML file in browser for example.

properties
Icon char = 'circle-question-regular.svg'
Icon char = 'circle-info-solid.svg'
Tooltip char = 'Add Tooltip here'
ClickedFcn function_handle = function_handle.empty
Height cell = {22}
end

properties (Access = private)
Expand All @@ -17,9 +16,11 @@
end
methods (Access = protected)
function setup(obj)
s = settings.LayoutSettings();
h = s.DefaultButtonHeight;
grid = uigridlayout(obj, ...
'RowHeight', obj.Height, ...
'ColumnWidth', obj.Height, ...
'RowHeight', h, ...
'ColumnWidth', h, ...
'ColumnSpacing', 0, ...
'Padding', zeros(1,4));

Expand Down
Loading

0 comments on commit 6463348

Please sign in to comment.