Skip to content

Commit

Permalink
Splashscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
zosiabratasz committed Jul 17, 2024
1 parent b8b06b4 commit c70e568
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.asv
*.avi
*.png
!pulsewaves_logo_temp.png
!pulsewave_logo_temp.png
# Prerequisites
*.d

Expand Down
Binary file modified PulseWave.mlapp
Binary file not shown.
36 changes: 36 additions & 0 deletions displaySplashScreen.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function displaySplashScreen()
% Displays the splash screen during the app launch pausing for a short time
% and displaying git info
s = SplashScreen( 'Splashscreen', 'pulsewave_logo_temp.png','ProgressBar', 'on','ProgressPosition', 5,'ProgressRatio', 0.4 );
s.addText( 30, 50, 'Git info :', 'FontSize', 15, 'Color', [0 0 0.0] , 'Shadow','off')

gitBranchCommand = 'git symbolic-ref --short HEAD';
[statusBranch, resultBranch] = system(gitBranchCommand);

if statusBranch == 0
resultBranch = strtrim(resultBranch);
MessBranch = 'Current branch : ';
else
MessBranch = 'Error getting current branch name. Git command output: ';
end

gitHashCommand = 'git rev-parse HEAD';
[statusHash, resultHash] = system(gitHashCommand);

if statusHash == 0 %hash command was successful
resultHash = strtrim(resultHash);
MessHash = 'Latest Commit Hash : ';
else
MessHash = 'Error getting latest commit hash. Git command output: ';
end

% display git info
s.addText( 30, 80, [MessBranch, resultBranch], 'FontSize', 10, 'Color', [0 0 0] , 'Shadow','off')
s.addText( 30, 100, [MessHash, resultHash], 'FontSize', 10, 'Color', [0 0 0], 'Shadow','off' )

t = timer;
t.StartDelay = 3;
t.TimerFcn = @(~,~)delete(s);
start(t);

end
Binary file added pulsewave_logo_temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed pulsewaves_logo_temp.png
Binary file not shown.

0 comments on commit c70e568

Please sign in to comment.