Skip to content
Snippets Groups Projects
Commit fca75ba7 authored by Yves Gouriou's avatar Yves Gouriou
Browse files

Entrer des codes dans la structure tsg

Une seule fonction pour la gestion des codes
parent 1f7b21c1
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ if fid ~= -1 ...@@ -44,7 +44,7 @@ if fid ~= -1
tsg.LATX_WS = bucketData(:,7); tsg.LATX_WS = bucketData(:,7);
tsg.LONX_WS = bucketData(:,8); tsg.LONX_WS = bucketData(:,8);
tsg.SSPS_WS = bucketData(:,9); tsg.SSPS_WS = bucketData(:,9);
tsg.SSPS_WS_QC = zeros(size(tsg.SSPS_WS)); tsg.SSPS_WS_QC = tsg.qc.Code.NO_CONTROL * ones(size(tsg.SSPS_WS));
%@ completer ces 2 champs !!!!!!!! %@ completer ces 2 champs !!!!!!!!
%tsg.PSAL_WS_ANALDATE = ; %tsg.PSAL_WS_ANALDATE = ;
......
...@@ -88,7 +88,7 @@ if fid ~= -1 ...@@ -88,7 +88,7 @@ if fid ~= -1
tsg.SPDC = sog; tsg.SPDC = sog;
% Remplacer la valeur par tsg.qc.code.NOCONTROL % Remplacer la valeur par tsg.qc.code.NOCONTROL
tsg.SSPS_QC = ones(nblig,1); tsg.SSPS_QC = tsg.qc.Code.NO_CONTROL * ones(nblig,1);
% populate tsg.file structure % populate tsg.file structure
% --------------------------- % ---------------------------
......
...@@ -14,33 +14,32 @@ function plot_SalTempVel( hTsgGUI, hAxes ) ...@@ -14,33 +14,32 @@ function plot_SalTempVel( hTsgGUI, hAxes )
% Retrieve named application data % Retrieve named application data
% ------------------------------- % -------------------------------
tsg = getappdata( hTsgGUI, 'tsg_data'); tsg = getappdata( hTsgGUI, 'tsg_data');
qc = getappdata( hTsgGUI, 'qcColor');
% Plot the Salinity with the right color code % Plot the Salinity with the right color code
% ------------------------------------------- % -------------------------------------------
axes( hAxes(1)); axes( hAxes(1));
ind = find(tsg.SSPS_QC <= qc.Code.NO_CONTROL ); ind = find(tsg.SSPS_QC <= tsg.qc.Code.NO_CONTROL );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.NO_CONTROL)); strcat('.',tsg.qc.Color.NO_CONTROL));
hold on; hold on;
ind = find(tsg.SSPS_QC == qc.Code.GOOD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.GOOD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.GOOD)); strcat('.',tsg.qc.Color.GOOD));
ind = find(tsg.SSPS_QC == qc.Code.PROBABLY_GOOD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_GOOD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.PROBABLY_GOOD)); strcat('.',tsg.qc.Color.PROBABLY_GOOD));
ind = find(tsg.SSPS_QC == qc.Code.PROBABLY_BAD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_BAD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.PROBABLY_BAD)); strcat('.',tsg.qc.Color.PROBABLY_BAD));
ind = find(tsg.SSPS_QC == qc.Code.BAD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.BAD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.BAD)); strcat('.',tsg.qc.Color.BAD));
hold off; hold off;
% Plot Temperature and ship velocity with no qc color code % Plot Temperature and ship velocity with no qc color code
......
...@@ -14,35 +14,32 @@ function plot_SalTsgSample( hGUI, hAxes ) ...@@ -14,35 +14,32 @@ function plot_SalTsgSample( hGUI, hAxes )
% Retrieve named application data % Retrieve named application data
% ------------------------------- % -------------------------------
tsg = getappdata( hGUI, 'tsg_data'); tsg = getappdata( hGUI, 'tsg_data');
%sample = getappdata( hGUI, 'sample' );
qc = getappdata( hGUI, 'qcColor');
% Plot the Salinity with the right color code % Plot the Salinity with the right color code
% ------------------------------------------- % -------------------------------------------
axes( hAxes(1)); axes( hAxes(1));
ind = find(tsg.SSPS_QC <= qc.Code.NO_CONTROL ); ind = find(tsg.SSPS_QC <= tsg.qc.Code.NO_CONTROL );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.NO_CONTROL)); strcat('.',tsg.qc.Color.NO_CONTROL));
hold on; hold on;
ind = find(tsg.SSPS_QC == qc.Code.GOOD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.GOOD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.GOOD)); strcat('.',tsg.qc.Color.GOOD));
ind = find(tsg.SSPS_QC == qc.Code.PROBABLY_GOOD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_GOOD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.PROBABLY_GOOD)); strcat('.',tsg.qc.Color.PROBABLY_GOOD));
ind = find(tsg.SSPS_QC == qc.Code.PROBABLY_BAD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_BAD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.PROBABLY_BAD)); strcat('.',tsg.qc.Color.PROBABLY_BAD));
ind = find(tsg.SSPS_QC == qc.Code.BAD ); ind = find(tsg.SSPS_QC == tsg.qc.Code.BAD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',qc.Color.BAD)); strcat('.',tsg.qc.Color.BAD));
% Plot salinity sample on TSG plot % Plot salinity sample on TSG plot
% -------------------------------- % --------------------------------
......
...@@ -36,27 +36,20 @@ tsg.file.type = []; ...@@ -36,27 +36,20 @@ tsg.file.type = [];
% ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% Quality Code and color % Quality Code and color
qc.Color.NO_CONTROL = 'k'; tsg.qc.Color.NO_CONTROL = 'k';
qc.Color.GOOD = 'b'; tsg.qc.Color.GOOD = 'b';
qc.Color.PROBABLY_GOOD = 'g'; tsg.qc.Color.PROBABLY_GOOD = 'g';
qc.Color.PROBABLY_BAD = 'm'; tsg.qc.Color.PROBABLY_BAD = 'm';
qc.Color.BAD = 'r'; tsg.qc.Color.BAD = 'r';
qc.Code.NO_CONTROL = 1; tsg.qc.Code.NO_CONTROL = 1;
qc.Code.GOOD = 2; tsg.qc.Code.GOOD = 2;
qc.Code.PROBABLY_GOOD = 3; tsg.qc.Code.PROBABLY_GOOD = 3;
qc.Code.PROBABLY_BAD = 4; tsg.qc.Code.PROBABLY_BAD = 4;
qc.Code.BAD = 5; tsg.qc.Code.BAD = 5;
% Store default value 'quality' a application data - It's not useful tsg.qc.Code.ACTIVE = tsg.qc.Code.NO_CONTROL;
% ------------------------------------------------------------------ tsg.qc.Color.ACTIVE = tsg.qc.Color.NO_CONTROL;
quality.Code = qc.Code.GOOD;
quality.Color = qc.Color.GOOD;
set( hQcCmenu, 'UserData', quality );
% Store the 'qc' structure as application data
% --------------------------------------------
setappdata( hTsgGUI, 'qcColor', qc);
% ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% Constants for the Correction procedure % Constants for the Correction procedure
...@@ -187,7 +180,6 @@ tsg.LONX_WS = []; ...@@ -187,7 +180,6 @@ tsg.LONX_WS = [];
% Water Sample variables % Water Sample variables
tsg.SSPS_WS = []; tsg.SSPS_WS = [];
tsg.SSPS_WS = [];
tsg.SSPS_WS_QC = []; tsg.SSPS_WS_QC = [];
%tsg.SSPS_WS_DIF = []; %tsg.SSPS_WS_DIF = [];
%tsg.SSPS_WS_SMOOTH = []; % a verifier %tsg.SSPS_WS_SMOOTH = []; % a verifier
......
function [sample] = tsg_mergesample( hMainFig ) function [] = tsg_mergesample( hTsgGUI )
% %
% function [sample] = dev_mergesample( bucketNETCDF, bucketASCII) % function [sample] = dev_mergesample( bucketNETCDF, bucketASCII)
% %
...@@ -15,65 +15,58 @@ function [sample] = tsg_mergesample( hMainFig ) ...@@ -15,65 +15,58 @@ function [sample] = tsg_mergesample( hMainFig )
% Get bucket data in ASCII or NETCDF format. If the data does not exist % Get bucket data in ASCII or NETCDF format. If the data does not exist
% getappdata return an empty matrix % getappdata return an empty matrix
% --------------------------------------------------------------------- % ---------------------------------------------------------------------
bucketASCII = getappdata( hMainFig, 'bucketASCII'); tsg = getappdata( hTsgGUI, 'tsg_data');
bucketNETCDF = getappdata( hMainFig, 'bucketNETCDF');
% Create an empty structure with no fields % Create an empty structure with no fields
% ---------------------------------------- % ----------------------------------------
sample = struct('TIME',{} ,'LATITUDE',{} ,'LONGITUDE',{} ,'PSAL',{} , ... sample = struct('DAYD',{} ,'LATX',{} ,'LONX',{} ,'SSPS',{} , ...
'PSAL_QC',{} ,'PSAL_DIF',{} ,'PSAL_SMOOTH',{} ,'TYPE', {}); 'SSPS_QC',{} ,'SSPS_DIF',{} ,'SSPS_SMOOTH',{} ,'SSPS_TYPE', {});
% Fill the structure sample with the bucketNETCDF data. % Fill the structure sample with the bucket data.
% This measurements are of TYPE 1 % This measurements are of TYPE 1
% ---------------------------------------------------- % ------------------------------------------------
if ~isempty(bucketNETCDF) if ~isempty(tsg.SSPS_WS)
% Complete the bucket structure sample.DAYD = tsg.DAYD_WS;
% ----------------------------- sample.LATX = tsg.LATX_WS;
bucketNETCDF.PSAL_DIF = zeros(size(bucketNETCDF.PSAL)); sample.LONX = tsg.LONX_WS;
bucketNETCDF.PSAL_SMOOTH = zeros(size(bucketNETCDF.PSAL)); sample.SSPS = tsg.SSPS_WS;
bucketNETCDF.TYPE = ones(size(bucketNETCDF.PSAL)); sample.SSPS_QC = tsg.SSPS_WS_QC;
sample.SSPS_DIF = zeros(size(sample.DAYD));
sample = bucketNETCDF; sample.SSPS_SMOOTH = zeros(size(sample.DAYD));
sample.SSPS_TYPE = ones(size(sample.DAYD));
end end
% Fill the structure sample with the bucketNETCDF data. % Fill the structure sample with the external sample
% This measurements are of TYPE 2 % This measurements are of TYPE EXT
% ---------------------------------------------------- % --------------------------------------------------
if ~isempty(bucketASCII) if ~isempty(tsg.SSPS_EXT)
% Complete the bucketNETCDF structure sample.DAYD = [sample.DAYD; tsg.DAYD_WS];
% ----------------------------------- sample.LATX = [sample.LATX; tsg.LATX_WS];
bucketASCII.PSAL_DIF = zeros(size(bucketASCII.PSAL)); sample.LONX = [sample.LONX; tsg.LONX_WS];
bucketASCII.PSAL_SMOOTH = zeros(size(bucketASCII.PSAL)); sample.SSPS = [sample.SSPS; tsg.SSPS_WS];
bucketASCII.TYPE = 2 * ones(size(bucketASCII.PSAL)); sample.SSPS_QC = [sample.SSPS_QC; tsg.SSPS_WS_QC];
sample.SSPS_DIF = [sample.SSPS_DIF; zeros(size(tsg.DAYD_WS))];
% Fill in the sample structure sample.SSPS_SMOOTH = [sample.SSPS_SMOOTH; zeros(size(tsg.DAYD_WS))];
% ---------------------------- sample.SSPS_TYPE = [sample.SSPS_TYPE; tsg.SSPS_EXT_TYPE];
if isempty( sample )
sample = bucketASCII;
else
sample.TIME = [sample.TIME; bucketASCII.TIME];
sample.LATITUDE = [sample.LATITUDE; bucketASCII.LATITUDE];
sample.LONGITUDE = [sample.LONGITUDE; bucketASCII.LONGITUDE];
sample.PSAL = [sample.PSAL; bucketASCII.PSAL];
sample.PSAL_QC = [sample.PSAL_QC; bucketASCII.PSAL_QC];
sample.PSAL_DIF = [sample.PSAL_DIF; bucketASCII.PSAL_DIF];
sample.PSAL_SMOOTH = [sample.PSAL_SMOOTH; bucketASCII.PSAL_SMOOTH];
sample.TYPE = [sample.TYPE; bucketASCII.TYPE];
end
end end
% Sort the struct sample - increasing time. % Sort the struct sample - increasing time.
% ----------------------------------------- % -----------------------------------------
if ~isempty(sample) if ~isempty(sample)
[sample.TIME, iOrder] = sort(sample.TIME); [sample.DAYD, iOrder] = sort(sample.DAYD);
sample.LATITUDE = sample.LATITUDE(iOrder); sample.LATX = sample.LATITUDE(iOrder);
sample.LONGITUDE = sample.LONGITUDE(iOrder); sample.LONX = sample.LONGITUDE(iOrder);
sample.PSAL = sample.PSAL(iOrder); sample.SSPS = sample.PSAL(iOrder);
sample.PSAL_QC = sample.PSAL_QC(iOrder); sample.SSPS_QC = sample.PSAL_QC(iOrder);
sample.PSAL_DIF = sample.PSAL_DIF(iOrder); sample.SSPS_DIF = sample.PSAL_DIF(iOrder);
sample.PSAL_SMOOTH = sample.PSAL_SMOOTH(iOrder); sample.SSPS_SMOOTH = sample.PSAL_SMOOTH(iOrder);
sample.TYPE = sample.TYPE(iOrder); sample.SSPS_TYPE = sample.TYPE(iOrder);
end end
% Update application data sample
% ------------------------------
setappdata( hTsgGUI, 'sample', sample );
This diff is collapsed.
...@@ -150,7 +150,7 @@ hQCPushtool = uipushtool(... % Open QC toolbar button ...@@ -150,7 +150,7 @@ hQCPushtool = uipushtool(... % Open QC toolbar button
'CData',iconRead(... 'CData',iconRead(...
[DEFAULT_PATH_FILE 'tsg_icon' filesep 'qcicon.mat']),... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'qcicon.mat']),...
'HandleVisibility','callback', ... 'HandleVisibility','callback', ...
'Tag','QC',... 'Tag','PUSHTOOL_QC',...
'UserData', 'off',... 'UserData', 'off',...
'Enable', 'off',... 'Enable', 'off',...
'ClickedCallback', @QCMenuCallback); 'ClickedCallback', @QCMenuCallback);
...@@ -183,7 +183,7 @@ hBottlePushtool = uipushtool(... % Open toolbar button ...@@ -183,7 +183,7 @@ hBottlePushtool = uipushtool(... % Open toolbar button
'CData',iconRead(... 'CData',iconRead(...
[DEFAULT_PATH_FILE 'tsg_icon' filesep 'bottleicon.mat']),... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'bottleicon.mat']),...
'HandleVisibility','callback', ... 'HandleVisibility','callback', ...
'Tag','BOTTLE',... 'Tag','PUSHTOOL_BOTTLE',...
'Enable', 'off',... 'Enable', 'off',...
'ClickedCallback', @BottleMenuCallback); 'ClickedCallback', @BottleMenuCallback);
hHeaderPushtool = uipushtool(... % Open headerForm button hHeaderPushtool = uipushtool(... % Open headerForm button
...@@ -400,31 +400,31 @@ hQcCmenuNocontrol = uimenu(... ...@@ -400,31 +400,31 @@ hQcCmenuNocontrol = uimenu(...
'HandleVisibility','off', ... 'HandleVisibility','off', ...
'Label', 'No control',... 'Label', 'No control',...
'ForegroundColor', 'k',... 'ForegroundColor', 'k',...
'Callback', @QcNoControl); 'Callback', @Qc);
hQcCmenuGood = uimenu(... hQcCmenuGood = uimenu(...
'Parent', hQcCmenu,... 'Parent', hQcCmenu,...
'HandleVisibility','off', ... 'HandleVisibility','off', ...
'Label', 'Good',... 'Label', 'Good',...
'ForegroundColor', 'b',... 'ForegroundColor', 'b',...
'Callback', @QcGood); 'Callback', @Qc);
hQcCmenuProbGood = uimenu(... hQcCmenuProbGood = uimenu(...
'Parent', hQcCmenu,... 'Parent', hQcCmenu,...
'HandleVisibility','off', ... 'HandleVisibility','off', ...
'Label', 'Probably Good',... 'Label', 'Probably Good',...
'Callback', @QcProbGood,... 'Callback', @Qc,...
'ForegroundColor', 'g'); 'ForegroundColor', 'g');
hQcCmenuProbBad = uimenu(... hQcCmenuProbBad = uimenu(...
'Parent', hQcCmenu,... 'Parent', hQcCmenu,...
'HandleVisibility','off', ... 'HandleVisibility','off', ...
'Label', 'Probably bad',... 'Label', 'Probably bad',...
'ForegroundColor', 'm',... 'ForegroundColor', 'm',...
'Callback', @QcProbBad); 'Callback', @Qc);
hQcCmenuBad = uimenu(... hQcCmenuBad = uimenu(...
'Parent', hQcCmenu,... 'Parent', hQcCmenu,...
'HandleVisibility','off', ... 'HandleVisibility','off', ...
'Label', 'Bad',... 'Label', 'Bad',...
'ForegroundColor', 'r',... 'ForegroundColor', 'r',...
'Callback', @QcBad); 'Callback', @Qc);
% Initialisation % Initialisation
...@@ -524,11 +524,13 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -524,11 +524,13 @@ tsg_initialisation(hMainFig, hQcCmenu)
% setappdata( hMainFig, 'sample', sample ); % setappdata( hMainFig, 'sample', sample );
%end %end
% Plot Salinity bucket % Plot Salinity bucket
% ------------------------------------------------ % NOT at that step. It will interfere with the QC process
if error2 ~= -1 % Maybe use a new pushbutton to draw or delete the bucket
plot_SalTsgSample( hMainFig, hPlotAxes ); % -------------------------------------------------------
end %if error2 ~= -1
% plot_SalTsgSample( hMainFig, hPlotAxes );
%end
% Pointer reset to arrow % Pointer reset to arrow
% ---------------------- % ----------------------
...@@ -590,10 +592,6 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -590,10 +592,6 @@ tsg_initialisation(hMainFig, hQcCmenu)
zoom off; pan off zoom off; pan off
panAdaptiveDateTicks('off');zoomAdaptiveDateTicks('off'); panAdaptiveDateTicks('off');zoomAdaptiveDateTicks('off');
% Retrieve named application data
% -------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Toggle the tag of the Qc pushbutton to 'on' or 'off' % Toggle the tag of the Qc pushbutton to 'on' or 'off'
% ---------------------------------------------------- % ----------------------------------------------------
switch get(hQCPushtool, 'UserData'); switch get(hQCPushtool, 'UserData');
...@@ -617,9 +615,8 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -617,9 +615,8 @@ tsg_initialisation(hMainFig, hQcCmenu)
% ---------------------------------------------------- % ----------------------------------------------------
if strcmp( get(hQCPushtool, 'UserData'),'off') if strcmp( get(hQCPushtool, 'UserData'),'off')
% Desactivate the context menu use to choose the % Desactivate the context menu use to choose the Quality Codes
% Quality Codes % ------------------------------------------------------------
% ----------------------------------------------
set(hQcCmenu, 'Visible', 'off'); set(hQcCmenu, 'Visible', 'off');
break break
end end
...@@ -635,10 +632,9 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -635,10 +632,9 @@ tsg_initialisation(hMainFig, hQcCmenu)
else else
% Mouse motion callback desactivated when a selection is % Mouse motion callback desactivated when a selection is made.
% made. Otherwise there is a conflict with the map if it % Otherwise there is a conflict with the map if it is activated
% is activated % -------------------------------------------------------------
% -------------------------------------------------------
set( hMainFig, 'UserData', 'ButtonMotionOff'); set( hMainFig, 'UserData', 'ButtonMotionOff');
% Selection of the data within the figure % Selection of the data within the figure
...@@ -653,12 +649,15 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -653,12 +649,15 @@ tsg_initialisation(hMainFig, hQcCmenu)
p1 = min(point1,point2); p1 = min(point1,point2);
p2 = max(point1,point2); % calculate locations p2 = max(point1,point2); % calculate locations
% Retrieve named application data
% -------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
ind = find(tsg.DAYD > p1(1,1) & tsg.DAYD < p2(1,1) & ... ind = find(tsg.DAYD > p1(1,1) & tsg.DAYD < p2(1,1) & ...
tsg.SSPS > p1(1,2) & tsg.SSPS < p2(1,2)); tsg.SSPS > p1(1,2) & tsg.SSPS < p2(1,2));
% As soon as a modification took place the data should be % As soon as a modification took place the data should be saved
% saved % -------------------------------------------------------------
% -------------------------------------------------------
set( hSaveMenu, 'UserData', 'on' ); set( hSaveMenu, 'UserData', 'on' );
% Selection made : Mouse motion callback re-activated % Selection made : Mouse motion callback re-activated
...@@ -672,9 +671,11 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -672,9 +671,11 @@ tsg_initialisation(hMainFig, hQcCmenu)
% -------------------------------------------------------- % --------------------------------------------------------
if qualityCode ~= -1 if qualityCode ~= -1
quality = get( hQcCmenu, 'UserData'); % Retrieve named application data - Code could have been changed
% --------------------------------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
tsg.SSPS_QC(ind) = quality.Code; tsg.SSPS_QC(ind) = tsg.qc.Code.ACTIVE;
% Save the modifications % Save the modifications
% ---------------------- % ----------------------
...@@ -682,7 +683,7 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -682,7 +683,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
axes(hPlotAxes(1)); axes(hPlotAxes(1));
hold on hold on
color = ['.' quality.Color]; color = ['.' tsg.qc.Color.ACTIVE];
plot(tsg.DAYD(ind), tsg.SSPS(ind), color ); plot(tsg.DAYD(ind), tsg.SSPS(ind), color );
hold off hold off
...@@ -691,89 +692,37 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -691,89 +692,37 @@ tsg_initialisation(hMainFig, hQcCmenu)
end end
%--------------------------------------------------------------------- %---------------------------------------------------------------------
function QcNoControl(hObject, eventdata) function Qc(hObject, eventdata)
% Callback function run when the QC context menu is selected
% Retrieve Default Quality Code and Color
% ---------------------------------------
qc = getappdata( hMainFig, 'qcColor');
quality.Code = qc.Code.NO_CONTROL;
quality.Color = qc.Color.NO_CONTROL;
set( hQcCmenu, 'UserData', quality );
% uiwait in the QCMenuCallback function
% -------------------------------------
uiresume
end
%---------------------------------------------------------------------
function QcGood(hObject, eventdata)
% Callback function run when the QC context menu is selected
% Retrieve named application data
% -------------------------------
qc = getappdata( hMainFig, 'qcColor');
quality.Code = qc.Code.GOOD;
quality.Color = qc.Color.GOOD;
set( hQcCmenu, 'UserData', quality );
% uiwait in the QCMenuCallback function
% -------------------------------------
uiresume
end
%---------------------------------------------------------------------
function QcProbGood(hObject, eventdata)
% Callback function run when the QC context menu is selected
% Retrieve named application data
% -------------------------------
qc = getappdata( hMainFig, 'qcColor');
quality.Code = qc.Code.PROBABLY_GOOD;
quality.Color = qc.Color.PROBABLY_GOOD;
set( hQcCmenu, 'UserData', quality );
% uiwait in the QCMenuCallback function
% -------------------------------------
uiresume
end
%---------------------------------------------------------------------
function QcProbBad(hObject, eventdata)
% Callback function run when the QC context menu is selected
% Retrieve named application data
% -------------------------------
qc = getappdata( hMainFig, 'qcColor');
quality.Code = qc.Code.PROBABLY_BAD;
quality.Color = qc.Color.PROBABLY_BAD;
set( hQcCmenu, 'UserData', quality );
% uiwait in the QCMenuCallback function
% -------------------------------------
uiresume
end
%---------------------------------------------------------------------
function QcBad(hObject, eventdata)
% Callback function run when the QC context menu is selected % Callback function run when the QC context menu is selected
% Retrieve Default Quality Code and Color
% ---------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
switch hObject
case hQcCmenuNocontrol
tsg.qc.Code.ACTIVE = tsg.qc.Code.NO_CONTROL;
tsg.qc.Color.ACTIVE = tsg.qc.Color.NO_CONTROL;
case hQcCmenuGood
tsg.qc.Code.ACTIVE = tsg.qc.Code.GOOD;
tsg.qc.Color.ACTIVE = tsg.qc.Color.GOOD;
case hQcCmenuProbGood
tsg.qc.Code.ACTIVE = tsg.qc.Code.PROBABLY_GOOD;
tsg.qc.Color.ACTIVE = tsg.qc.Color.PROBABLY_GOOD;
case hQcCmenuProbBad
tsg.qc.Code.ACTIVE = tsg.qc.Code.PROBABLY_BAD;
tsg.qc.Color.ACTIVE = tsg.qc.Color.PROBABLY_BAD;
case hQcCmenuBad
tsg.qc.Code.ACTIVE = tsg.qc.Code.BAD;
tsg.qc.Color.ACTIVE = tsg.qc.Color.BAD;
end
% Retrieve named application data setappdata( hMainFig, 'tsg_data', tsg );
% -------------------------------
qc = getappdata( hMainFig, 'qcColor'); % uiwait in the QCMenuCallback function
% -------------------------------------
quality.Code = qc.Code.BAD; uiresume
quality.Color = qc.Color.BAD; end
set( hQcCmenu, 'UserData', quality );
% uiwait in the QCMenuCallback function
% -------------------------------------
uiresume
end
%--------------------------------------------------------------------- %---------------------------------------------------------------------
function MouseMotion(hObject, eventdata) function MouseMotion(hObject, eventdata)
...@@ -854,7 +803,24 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -854,7 +803,24 @@ tsg_initialisation(hMainFig, hQcCmenu)
%--------------------------------------------------------------------- %---------------------------------------------------------------------
function BottleMenuCallback(hObject, eventdata) function BottleMenuCallback(hObject, eventdata)
% Callback function run when the Bottle tool bar item is selected % Callback function run when the Bottle tool bar item is selected
%
% Get the tsg data structure
% --------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Test if tsg and sample data have been loaded
% --------------------------------------------
if ~isempty( tsg.SSPS_WS ) || ~isempty( tsg.SSPS_EXT )
% Call the GUI for tsg correction
% -------------------------------
msgbox('Correction module not yet implemented', 'modal');
% tsgcor_GUI( hMainFig );
else
msgbox('TSG or Sample data not loaded in the program', 'modal');
end
% Vieux bout de code pour le trace et la suppression des bouteilles
% Plot or Delete the buckets measurements on the Salinity graph % Plot or Delete the buckets measurements on the Salinity graph
% %
% Need to read them right now - but they will be soon in the NetCdf % Need to read them right now - but they will be soon in the NetCdf
...@@ -862,30 +828,11 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -862,30 +828,11 @@ tsg_initialisation(hMainFig, hQcCmenu)
% Test if the sample Push button has been pressed % Test if the sample Push button has been pressed
% ----------------------------------------------- % -----------------------------------------------
if strcmp( get(hBottlePushtool, 'UserData'), 'off') % if strcmp( get(hBottlePushtool, 'UserData'), 'off')
% Sample Push button - UserData set to 'on' % Sample Push button - UserData set to 'on'
% ------------------------------------ % ------------------------------------
set( hBottlePushtool, 'UserData', 'on' ); % set( hBottlePushtool, 'UserData', 'on' );
% Test if tsg and sample data have been loaded
% --------------------------------------------
if ~isempty( getappdata( hMainFig, 'tsg_data') ) && ...
~isempty( getappdata( hMainFig, 'sample') )
% Call the GUI for tsg correction
% -------------------------------
%msgbox('The correction module has not been implemented', 'modal');
tsgcor_GUI( hMainFig );
else
msgbox('TSG or Sample data not loaded in the program', 'modal');
end
% hLine = get( hPlotAxes(1), 'UserData');
% Plot the samples if the TSG file has been read % Plot the samples if the TSG file has been read
% ---------------------------------------------- % ----------------------------------------------
...@@ -903,7 +850,7 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -903,7 +850,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
% else % else
set( hBottlePushtool, 'UserData', 'off' ); % set( hBottlePushtool, 'UserData', 'off' );
% The bucket pushbutton has been pressed again : % The bucket pushbutton has been pressed again :
% Delete the bucket on figure % Delete the bucket on figure
...@@ -912,7 +859,6 @@ tsg_initialisation(hMainFig, hQcCmenu) ...@@ -912,7 +859,6 @@ tsg_initialisation(hMainFig, hQcCmenu)
% if ~isempty( hLine ) && ishandle( hLine.Sample ) % if ~isempty( hLine ) && ishandle( hLine.Sample )
% delete(hLine.Sample); % delete(hLine.Sample);
% end % end
end
end end
%--------------------------------------------------------------------- %---------------------------------------------------------------------
......
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