diff --git a/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/Aw-QXDuRpGVd1p-84rizw-iIl44d.xml b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/Aw-QXDuRpGVd1p-84rizw-iIl44d.xml new file mode 100644 index 0000000..99772b4 --- /dev/null +++ b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/Aw-QXDuRpGVd1p-84rizw-iIl44d.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/Aw-QXDuRpGVd1p-84rizw-iIl44p.xml b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/Aw-QXDuRpGVd1p-84rizw-iIl44p.xml new file mode 100644 index 0000000..7b469d7 --- /dev/null +++ b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/Aw-QXDuRpGVd1p-84rizw-iIl44p.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/S_qe5JCPPB1S-plmor2vz7vQdBEd.xml b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/S_qe5JCPPB1S-plmor2vz7vQdBEd.xml new file mode 100644 index 0000000..99772b4 --- /dev/null +++ b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/S_qe5JCPPB1S-plmor2vz7vQdBEd.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/S_qe5JCPPB1S-plmor2vz7vQdBEp.xml b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/S_qe5JCPPB1S-plmor2vz7vQdBEp.xml new file mode 100644 index 0000000..3ef2ea5 --- /dev/null +++ b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/S_qe5JCPPB1S-plmor2vz7vQdBEp.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/pGAMgb1o0J4gneB4Sk-gPhVUa8Ad.xml b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/pGAMgb1o0J4gneB4Sk-gPhVUa8Ad.xml new file mode 100644 index 0000000..99772b4 --- /dev/null +++ b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/pGAMgb1o0J4gneB4Sk-gPhVUa8Ad.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/pGAMgb1o0J4gneB4Sk-gPhVUa8Ap.xml b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/pGAMgb1o0J4gneB4Sk-gPhVUa8Ap.xml new file mode 100644 index 0000000..69044d8 --- /dev/null +++ b/resources/project/LwJcy9ZaEyJvuNK-ApM3PZoS5oo/pGAMgb1o0J4gneB4Sk-gPhVUa8Ap.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/project/NdsL0Nh4wtc5dxoI0TU1uVF-B00/RmvW7wqbCzY4lm1VfEh1ltf0QQMd.xml b/resources/project/NdsL0Nh4wtc5dxoI0TU1uVF-B00/RmvW7wqbCzY4lm1VfEh1ltf0QQMd.xml new file mode 100644 index 0000000..4356a6a --- /dev/null +++ b/resources/project/NdsL0Nh4wtc5dxoI0TU1uVF-B00/RmvW7wqbCzY4lm1VfEh1ltf0QQMd.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/project/NdsL0Nh4wtc5dxoI0TU1uVF-B00/RmvW7wqbCzY4lm1VfEh1ltf0QQMp.xml b/resources/project/NdsL0Nh4wtc5dxoI0TU1uVF-B00/RmvW7wqbCzY4lm1VfEh1ltf0QQMp.xml new file mode 100644 index 0000000..0d8f811 --- /dev/null +++ b/resources/project/NdsL0Nh4wtc5dxoI0TU1uVF-B00/RmvW7wqbCzY4lm1VfEh1ltf0QQMp.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/widgets/+wt/+utility/incrementVersionNumber.m b/widgets/+wt/+utility/incrementVersionNumber.m new file mode 100644 index 0000000..c967a3f --- /dev/null +++ b/widgets/+wt/+utility/incrementVersionNumber.m @@ -0,0 +1,36 @@ +function versionStr = incrementVersionNumber(filePath) +% Increments the last decimal of the version number +% +% Version file should be .txt and only contain a multi-part version with at +% least 2 parts. +% Valid version.txt Examples: +% 2.4 +% 1.0.3 +% 1.3.9.2019 + +% Copyright 2026 The MathWorks Inc. + +arguments (Input) + filePath (1,1) string {mustBeFile} +end + +arguments (Output) + versionStr (1,1) string +end + +% Read in the version info +[~, versionParts] = wt.utility.readVersionNumber(filePath); + +% Increment the build index in the version number +numVersionParts = numel(versionParts); +if numVersionParts < 2 + versionParts(2) = uint32(1); +else + versionParts(end) = versionParts(end) + uint32(1); +end + +% Format as string +versionStr = join(string(versionParts),"."); + +% Update the version file +writelines(versionStr, filePath); \ No newline at end of file diff --git a/widgets/+wt/+utility/readVersionNumber.m b/widgets/+wt/+utility/readVersionNumber.m new file mode 100644 index 0000000..4cb00e0 --- /dev/null +++ b/widgets/+wt/+utility/readVersionNumber.m @@ -0,0 +1,28 @@ +function [versionStr, versionParts] = readVersionNumber(filePath) +% Retrieves the version number +% +% Version file should be .txt and only contain a multi-part version with at +% least 2 parts. +% Valid version.txt Examples: +% 2.4 +% 1.0.3 +% 1.3.9.2019 + +% Copyright 2026 The MathWorks Inc. + +arguments (Input) + filePath (1,1) string {mustBeFile} +end + +arguments (Output) + versionStr (1,1) string + versionParts (1,:) uint32 {mustBeNonempty} +end + +% Read in the version parts +versionParts = readmatrix(filePath,... + "Delimiter",".",... + "OutputType","uint32"); + +% Format as string +versionStr = join(string(versionParts),"."); \ No newline at end of file diff --git a/widgets/+wt/+utility/resolveFilePath.m b/widgets/+wt/+utility/resolveFilePath.m new file mode 100644 index 0000000..b344feb --- /dev/null +++ b/widgets/+wt/+utility/resolveFilePath.m @@ -0,0 +1,117 @@ +function filePath = resolveFilePath(fileName) +% Searches for a valid path to the specified file name +% +% Order of priority: +% 1. Full path provided +% 2. If deployed, installation folder of the application +% (e.g. C:\Program Files\...) +% 3. Folder of the calling function, or the first non-namespace folder +% (@/+) up from the calling function's folder. +% 4. MATLAB path (via "which" command) + +% Copyright 2026 The MathWorks Inc. + +arguments + fileName (1,1) string +end + +% Default output +filePath = ""; %#ok + + +%% Check if a full path was provided already +if strlength( fileparts(fileName) ) > 0 + + % If a full path was provided, and it is valid, just use it + if isfile(fileName) + + filePath = fileName; + return + + else + + % Throw a warning + id = "resolvePathFromFileName:BadPath"; + msg = "File was provided with a path that does not exist: %s"; + warning(id, msg, fileName); + + % Return the input as-is + filePath = fileName; + + return + end + +end %if + + +%% If deployed, next look in the installation folder +if isdeployed + + % The install folder will be where the executable runs from + [~, systemPath] = system('set PATH'); + installPath = extractBetween(string(systemPath), "Path=", ";"); + + % Check for the file there + testPath = fullfile(installPath, fileName); + if isfile(testPath) + filePath = testPath; + return + end + +end %if + + +%% Next, look at the folder containing the calling function + +% Get the calling function +stackInfo = dbstack(1,"-completenames"); +if ~isempty(stackInfo) + + callingFcn = stackInfo(1).file; + folderPath = fileparts(callingFcn); + + % Check for the file in the same folder with calling fcn + testPath = fullfile(folderPath, fileName); + if isfile(testPath) + filePath = testPath; + return + end + + % If not found, walk up the folder hierarchy for a normal folder + % (not a + or @ folder) + % Walk up the folder hierarchy + [~, leafFolder] = fileparts(folderPath); + while strlength(leafFolder) && startsWith(leafFolder, {'+', '@'}) + [folderPath, ~] = fileparts(folderPath); + [~, leafFolder] = fileparts(folderPath); + end + + % Check for the file in the top folder found + testPath = fullfile(folderPath, fileName); + if isfile(testPath) + filePath = testPath; + return + end + +end %if + + +%% Finally, check the MATLAB path +if isfile(fileName) + + % Use WHICH to locate the file + filePath = which(fileName); + return + +else + + % Unable to find the file. Throw a warning. + id = "resolvePathFromFileName:NotFound"; + msg = "File not found or does not exist: %s"; + warning(id, msg, fileName); + + % Return the original path + filePath = fileName; + return + +end %if diff --git a/widgets/icons/loading_128.gif b/widgets/icons/loading_128.gif new file mode 100644 index 0000000..6ed9245 Binary files /dev/null and b/widgets/icons/loading_128.gif differ