Skip to content

Commit

Permalink
publish release v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
teasit committed May 27, 2022
1 parent 34cd5fa commit 3f475f4
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

- measurement tab buttons now also resize when not enough space is available
- Help Menu now has option to check for updates (using GitHub release tags)
6 changes: 3 additions & 3 deletions MFTyreToolApp.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="424004831" file="C:\Users\Tom\Documents\mftyre-tool-matlab\MFTyreToolApp.prj" location="C:\Users\Tom\Documents\mftyre-tool-matlab" name="MFTyreToolApp" target="target.mlapps" target-name="Package App">
<configuration build-checksum="4158023395" file="C:\Users\Tom\Documents\mftyre-tool-matlab\MFTyreToolApp.prj" location="C:\Users\Tom\Documents\mftyre-tool-matlab" name="MFTyreToolApp" target="target.mlapps" target-name="Package App">
<param.appname>MFTyreToolApp</param.appname>
<param.authnamewatermark>Tom Teasdale</param.authnamewatermark>
<param.email>teasdale@lightsaber.red</param.email>
Expand All @@ -12,8 +12,8 @@
</param.icons>
<param.summary>Create, fit and evaluate MF-Tyre model with a convenient MATLAB GUI.</param.summary>
<param.description />
<param.screenshot>${PROJECT_ROOT}\assets\img\MFTyreTool_Screenshot_Plot.png</param.screenshot>
<param.version>1.1.3</param.version>
<param.screenshot>${PROJECT_ROOT}\assets\img\MFTyreTool_Screenshot_Main.jpg</param.screenshot>
<param.version>1.1.4</param.version>
<param.products.name>
<item>MATLAB</item>
</param.products.name>
Expand Down
2 changes: 1 addition & 1 deletion MFTyreToolToolboxPackager.prj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<param.summary>Create, fit and evaluate MF-Tyre models with a convenient MATLAB GUI.</param.summary>
<param.description />
<param.screenshot>${PROJECT_ROOT}\assets\img\MFTyreTool_Screenshot_Plot.png</param.screenshot>
<param.version>1.1.3</param.version>
<param.version>1.1.4</param.version>
<param.output>${PROJECT_ROOT}\MFTyreTool.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down
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>
28 changes: 28 additions & 0 deletions src/+helpers/checkUpdateAvailable.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function [available, versionLatest] = checkUpdateAvailable(versionCurrent)
%CHECKUPDATEAVAILABLE Checks if update is available for application.
available = false;

versionValidPattern = ...
digitsPattern() + '.' + digitsPattern() + '.' + digitsPattern();

versionCurrent = erase(versionCurrent, 'v');
assert(matches(versionCurrent, versionValidPattern));

url = 'https://api.github.com/repos/teasit/mftyre-matlab-tool/releases/latest';
versionLatest = webread(url).tag_name;
versionLatest = erase(versionLatest, 'v');
assert(matches(versionLatest, versionValidPattern));

versionCurrentSplit = split(versionCurrent, '.');
versionLatestSplit = split(versionLatest, '.');

for i = 1:numel(versionCurrentSplit)
v0 = str2double(versionCurrentSplit{i});
v1 = str2double(versionLatestSplit{i});
available = v1 > v0;
if available
return
end
end
end

29 changes: 29 additions & 0 deletions src/MFTyreTool.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,32 @@ function onUiFigureSizeChanged(app, ~, ~)
width = position(3);
height = position(4);
end
function onCheckUpdates(app, ~, ~)
fig = app.UIFigure;
title = 'Check for Updates';
versionCurrent = app.About.Version;
try
[available, versionLatest] = ...
helpers.checkUpdateAvailable(versionCurrent);
catch
icon = 'error';
message = ['Could not check for updates.\n' ...
'Internet connection available?'];
uialert(fig, message, title, 'icon', icon)
return
end

if available
icon = 'info';
message = 'Update from %s to %s available.';
message = sprintf(message, versionCurrent, versionLatest);
else
icon = 'success';
message = 'The latest version is already installed (%s).';
message = sprintf(message, versionCurrent);
end
uialert(fig, message, title, 'icon', icon)
end
function onTyreModelEdited(app, ~, ~)
model = app.TyreModel;
evtdata = events.ModelChangedEventData(model);
Expand Down Expand Up @@ -770,6 +796,9 @@ function createViewMenu(app)
end
function createHelpMenu(app)
app.HelpMenu = uimenu(app.UIFigure, 'Text', 'Help');
uimenu(app.HelpMenu, ...
'Text', 'Check for Updates', ...
'MenuSelectedFcn', @app.onCheckUpdates)
uimenu(app.HelpMenu, ...
'Text', 'About', ...
'MenuSelectedFcn', @app.onAboutDialogRequested)
Expand Down
2 changes: 1 addition & 1 deletion src/about.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "MFTyreTool",
"Version": "1.1.3",
"Version": "1.1.4",
"Authors": [
"Tom Teasdale"
],
Expand Down

0 comments on commit 3f475f4

Please sign in to comment.