aodn / imos-toolbox

Graphical tool for QC'ing and NetCDF'ing oceanographic datasets
GNU General Public License v3.0
45 stars 30 forks source link

MCR reference in imread mainWindow.m causes error in non-mcr setups #750

Open BecCowley opened 2 years ago

BecCowley commented 2 years ago

Lines 290, 300, 310 in GUI/mainWindow all reference 'mcr' and cause the zoom, pan tools not to appear if mcr is not in use.

[img,map,alpha] = imread(fullfile(matlabroot,'mcr','toolbox','matlab','icons','tool_zoom_in.png')); [img,map,alpha] = imread(fullfile(matlabroot,'mcr','toolbox','matlab','icons','tool_zoom_out.png')); [img,map,alpha] = imread(fullfile(matlabroot,'mcr','toolbox','matlab','icons','tool_hand.png'));

I am removing the 'mcr' to enable the function to work, but maybe there is a nice way to get around this in the code.

hugo-sardi commented 2 years ago

Yes, but removing it breaks the stand-alone app. The correct fix is to check if the toolbox is running in deployed mode (standalone version) or within matlab. It is a very quick fix , one just needs to wrap a path to the pngs around the isdeployed function.