Skip to content
Snippets Groups Projects
Commit 80bafa93 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Gui: Fixes for GtVolView and GtGrainsManager


Squashed commit of the following:

commit a02f3b11ebf53f6210dc27df0098de0edfb9d837
Author: Nicola Vigano <nicola.vigano@esrf.fr>
Date:   Mon Aug 6 21:04:10 2012 +0200

    GtGrainsManager: fixed empty Absorption volume file

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

commit c6ab1acfa06b1000c0e6742b298b1bc088df54ac
Author: Nicola Vigano <nicola.vigano@esrf.fr>
Date:   Mon Aug 6 01:59:46 2012 +0200

    GtVolView: added checks for bad volume filenames

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@682 4c865b51-4357-4376-afb4-474e03ccb993
parent 74a6476a
No related branches found
No related tags found
No related merge requests found
......@@ -470,14 +470,25 @@ classdef GtGrainsManager < GtVolView
end
function toggleAbsorptionVolume(obj)
if (isempty(obj.conf.overlay))
obj.changeOverlay([obj.sample.absVolFile ':abs']);
newValueAbsVol = get(obj.conf.h_abs_butt, 'Max');
else
obj.changeOverlay([]);
newValueAbsVol = get(obj.conf.h_abs_butt, 'Min');
try
if (isempty(obj.conf.overlay))
if (isempty(obj.sample.absVolFile))
error('GUI:GtGrainsManager:wrong_argument', ...
'Absorption volume file not specified!')
end
absFile = [obj.sample.absVolFile ':abs'];
obj.changeOverlay(absFile);
newValueAbsVol = get(obj.conf.h_abs_butt, 'Max');
else
obj.changeOverlay([]);
newValueAbsVol = get(obj.conf.h_abs_butt, 'Min');
end
set(obj.conf.h_abs_butt, 'Value', newValueAbsVol);
catch mexc
gtPrintException(mexc)
d = errordlg(['Error: ' mexc.message], mexc.identifier, 'modal');
uiwait(d);
end
set(obj.conf.h_abs_butt, 'Value', newValueAbsVol);
end
function setVolumeToLoad(obj, volume_str)
......
......@@ -736,6 +736,11 @@ classdef GtVolView < GtBaseGuiElem
% already a volume or a filename. In case of filename, tries to guess
% also the format
if isa(vol, 'char') % user has specified a filename
if (isempty(vol))
error('GtVolView:loadVolume:wrong_argument', 'Empty volume filename')
elseif (strfind(vol, ':') == 1)
error('GtVolView:loadVolume:wrong_argument', 'Invalid volume filename: %s', vol)
end
[~, ~, ext] = fileparts(vol);
ext = regexp(ext, ':', 'split');
switch (ext{1})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment