Prev: boxplot bins
Next: OpenCL and MATLAB
From: machatsk on 12 Aug 2010 09:44 Hello all, I have a GUI with 3 checkboxes that represent data types for chemical analysis. The GUI plots spectral data based upon the user selection. So 3 graphs maximum, 1 graph minimum. Before plotting the data, the program checks certain tags to see if the data on file is not up to the standards determined on site. The user is warned and can continue with processing the data or skip that data type. I used a questdlg() that has 2 buttons 'yes' and 'no'. The program runs in order FCI, RCI, SWIR. So if a user selects FCI and SWIR for instance, gets a warning for FCI and chooses to skip that type, what command do I use to get the program to see if the SWIR checkbox is checked instead of having the program 'return'? Each acquisition type is seperated in the program because several other data processing functions need to be called for each type - so these warnings are not simply in the same if statement. I tried the following, but it simply returns for all cases: if var_fci==1; if length(bad_fci)==3; buttons=questdlg({' The data on file shows that the pure component' 'you have selected was extremely fluorescent during' 'FCI acquisitions. Are you sure you want to proceed' 'with processing this data?'},'High Fluorescence Warning','Yes',... 'No','Info','No'); switch buttons case 'Yes' case 'No' if checkit_rci==1; %rci check box elseif checkit_swir==1; %swir check box else msgbox('Please uncheck FCI box to continue.') %no other checkbox return end As always, thanks for your help MATLAB community Maxx
From: Sean on 12 Aug 2010 09:49 "machatsk " <chatskom(a)chemimage.com> wrote in message <i40tr8$3js$1(a)fred.mathworks.com>... > Hello all, > I have a GUI with 3 checkboxes that represent data types for chemical analysis. The GUI plots spectral data based upon the user selection. So 3 graphs maximum, 1 graph minimum. Before plotting the data, the program checks certain tags to see if the data on file is not up to the standards determined on site. The user is warned and can continue with processing the data or skip that data type. I used a questdlg() that has 2 buttons 'yes' and 'no'. > The program runs in order FCI, RCI, SWIR. So if a user selects FCI and SWIR for instance, gets a warning for FCI and chooses to skip that type, what command do I use to get the program to see if the SWIR checkbox is checked instead of having the program 'return'? Each acquisition type is seperated in the program because several other data processing functions need to be called for each type - so these warnings are not simply in the same if statement. > I tried the following, but it simply returns for all cases: > > if var_fci==1; > if length(bad_fci)==3; > buttons=questdlg({' The data on file shows that the pure component' > 'you have selected was extremely fluorescent during' > 'FCI acquisitions. Are you sure you want to proceed' > 'with processing this data?'},'High Fluorescence Warning','Yes',... > 'No','Info','No'); > switch buttons > case 'Yes' > case 'No' > if checkit_rci==1; %rci check box > elseif checkit_swir==1; %swir check box > else > msgbox('Please uncheck FCI box to continue.') %no other checkbox > return > end > > As always, thanks for your help MATLAB community > Maxx get(handles.my_checkbox,'Value');
From: machatsk on 12 Aug 2010 10:06 "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> > get(handles.my_checkbox,'Value'); This works and gives the correct value, but it just continues with the data processing steps below it. I guess my real problem is where the commands are in the code, but is there any way to skip those steps and continue reading code further in the program? I really do not want to put all of the data processing code with the 'case' for the questdlg()... Thank you for your swift reply Maxx
From: Sean on 12 Aug 2010 10:26 "machatsk " <chatskom(a)chemimage.com> wrote in message <i40v4u$144$1(a)fred.mathworks.com>... > "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> > > get(handles.my_checkbox,'Value'); > > This works and gives the correct value, but it just continues with the data processing steps below it. I guess my real problem is where the commands are in the code, but is there any way to skip those steps and continue reading code further in the program? I really do not want to put all of the data processing code with the 'case' for the questdlg()... > Thank you for your swift reply > Maxx I don't completely understand what you're saying, but I think I can give you a hint. Have different functions do do different things. E.g. if the box is checked and it's okay it runs function everything_ok() else it runs function are_you_sure(). Don't do everything in one place; instead break it down into very localized 2-3 line functions that do exactly what you want for that case.
From: machatsk on 12 Aug 2010 10:32 "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> > I don't completely understand what you're saying, but I think I can give you a hint. > Have different functions do do different things. E.g. if the box is checked and it's okay it runs function everything_ok() else it runs function are_you_sure(). Don't do everything in one place; instead break it down into very localized 2-3 line functions that do exactly what you want for that case. Yeah thats what I started doing. Thanks for the help sir. Maxx
|
Pages: 1 Prev: boxplot bins Next: OpenCL and MATLAB |