Skip to content

Commit

Permalink
Added try catch in order to detect the presence of a graphical device
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoRianiUNIPR committed Dec 21, 2024
1 parent 16fe41f commit 39a7abf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions toolbox/graphics/levfwdplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,6 @@
hTargetlwd=[];
hTargetcol=[];
try
% chkgpu=gpuDeviceCount;
% datacursormode on;
hdt = datacursormode;
set(hdt,'Enable','on');
% If options.datatooltip is not a struct then use our default options
Expand Down
2 changes: 0 additions & 2 deletions toolbox/graphics/mdrplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,6 @@
%% Set the datatooltip for the mdrplot
if ~isempty(options.datatooltip)
try
% chkgpu=gpuDeviceCount;
% datacursormode on;
hdt = datacursormode;
set(hdt,'Enable','on');
% If options.datatooltip is not a struct then use our default options
Expand Down
9 changes: 2 additions & 7 deletions toolbox/graphics/resfwdplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -1698,12 +1698,7 @@
hTarget=[];
hTargetlwd=[];
hTargetcol=[];
f=getfield(rendererinfo,'GraphicsRenderer');
disp('ShowContentF')
disp(f)
if ~isempty(f)
%chkgpu=gpuDevice; %#ok<NASGU>
% datacursormode on;
try
hdt = datacursormode;
set(hdt,'Enable','on');
% If options.datatooltip is not a struct then use our default options
Expand All @@ -1718,7 +1713,7 @@
% Declare a custom datatooltip update function to display additional
% information about the selected unit
set(hdt,'UpdateFcn',{@resfwdplotLbl,out,LineColor});
else
catch

disp('No graphical device, interactive datatooltip not enabled')
end
Expand Down

0 comments on commit 39a7abf

Please sign in to comment.