From 37512ec8b9110a398f7e7032740be0601ca2aa1d Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@ird.fr> Date: Thu, 17 Jan 2008 13:45:56 +0000 Subject: [PATCH] use of tsg.qc.hash = quality classe tsg member are dynamically written from tsg_nc object (var and attr) --- tsg_util/tsg_initialisation.m | 140 ++++------------------------------ 1 file changed, 13 insertions(+), 127 deletions(-) diff --git a/tsg_util/tsg_initialisation.m b/tsg_util/tsg_initialisation.m index 5247147..f0bd55e 100644 --- a/tsg_util/tsg_initialisation.m +++ b/tsg_util/tsg_initialisation.m @@ -1,4 +1,4 @@ -function tsg_initialisation(hTsgGUI, hQcCmenu) +function tsg_initialisation(hTsgGUI) % % Input % ----- @@ -40,14 +40,6 @@ tsg.file.type = []; % ------------------------------------------------------------------------- % Constants for the quality control procedure % ------------------------------------------------------------------------- -% Quality Code and color - -tsg.qc.Color.NO_CONTROL = 'k'; -tsg.qc.Color.GOOD = 'b'; -tsg.qc.Color.PROBABLY_GOOD = 'g'; -tsg.qc.Color.PROBABLY_BAD = 'm'; -tsg.qc.Color.BAD = 'r'; -tsg.qc.Color.HARBOUR = 'c'; % Quality flags reference table, see GOSUD, DATA FORMAT TSG V1.4, table 4 % ----------------------------------------------------------------------- @@ -64,15 +56,16 @@ tsg.qc.Color.HARBOUR = 'c'; % 8 Interpolated value % 9 Missing value -tsg.qc.Code.NO_CONTROL = 0; -tsg.qc.Code.GOOD = 1; -tsg.qc.Code.PROBABLY_GOOD = 2; -tsg.qc.Code.PROBABLY_BAD = 3; -tsg.qc.Code.BAD = 4; -tsg.qc.Code.HARBOUR = 6; +% Quality definition, we use a hashtable with a definition file +% @quality/quality.csv, +% use this file if you want add or modify quality context menu +% ------------------------------------------------------------- +tsg.qc.hash = quality; -tsg.qc.Code.ACTIVE = tsg.qc.Code.NO_CONTROL; -tsg.qc.Color.ACTIVE = tsg.qc.Color.NO_CONTROL; +% set default code at startup +% --------------------------- +tsg.qc.active.Code = get(tsg.qc.hash, 'NO_CONTROL', 'code'); +tsg.qc.active.Color = get(tsg.qc.hash, 'NO_CONTROL', 'color'); % ------------------------------------------------------------------------- % Constants for the Correction procedure @@ -134,122 +127,15 @@ for i=1:numel(nca_keys) tsg.(global_att) = ''; end -% tsg.PLATFORM_NAME = ''; -% tsg.SHIP_CALL_SIGN = ''; -% tsg.SHIP_MMSI = ''; -% tsg.TSG_TYPE = ''; -% tsg.TSG_NUMBER = ''; -% tsg.TINT_TYPE = ''; -% tsg.TINT_NUMBER = ''; -% tsg.DATA_TYPE = ''; -% tsg.DATA_MODE = ''; -% tsg.SAMPLING_PERIOD = ''; -% tsg.PROCESSING_STATUS = ''; -% tsg.DATE_START = ''; -% tsg.DATE_END = ''; -% tsg.SOUTH_LATX = ''; -% tsg.NORTH_LATX = ''; -% tsg.WEST_LONX = ''; -% tsg.EAST_LONX = ''; +% set some fields +% --------------- tsg.FORMAT_VERSION = FORMAT_VERSION; tsg.DATE_CREATION = [date(1:8) date(10:15)]; tsg.DATE_UPDATE = tsg.DATE_CREATION; tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME; -% tsg.DATA_RESTRICTIONS = ''; -% tsg.CITATION = ''; -% tsg.COMMENT = ''; -% tsg.PROJECT_NAME = ''; -% tsg.PI_NAME = ''; -% tsg.DATA_CENTRE = ''; -% tsg.DATA_ACQUISITION = ''; -% tsg.PROCESSING_CENTRE = ''; -% tsg.PROCESSING_STATES = ''; - -% variables describing TSG installation (Salinity, SSPS et Jacket -% Temperature SSJT) -% tsg.SSPS_DEPH = []; -% tsg.SSPS_DEPH_MIN = []; -% tsg.SSPS_DEPH_MAX = []; -% tsg.CNDC_CALCOEF = []; -% tsg.CNDC_LINCOEF = []; -% tsg.SSJT_CALCOEF = []; -% tsg.SSJT_LINCOEF = []; -% -% % variables describing Temperature sensor at intake (SSJT) installation -% tsg.SSTP_DEPH = []; -% tsg.SSTP_DEPH_MIN = []; -% tsg.SSTP_DEPH_MAX = []; -% tsg.SSTP_CALCOEF = []; -% tsg.SSTP_LINCOEF = []; -% -% % Coordinates -% tsg.DATE = []; -% tsg.DAYD = []; -% tsg.LATX = []; -% tsg.LONX = []; -% tsg.POSITION_QC = []; -% tsg.SPDC = []; -% tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME; -% -% % variables -% tsg.PRES = []; -% tsg.SSJT = []; -% tsg.SSJT_STD = []; -% tsg.SSJT_CAL = []; -% tsg.SSJT_ADJUSTED = []; -% tsg.SSJT_ADJUSTED_ERROR = []; -% tsg.SSJT_ADJUSTED_QC = []; -% tsg.SSJT_ADJUSTED_HIST = []; -% tsg.CNDC = []; -% tsg.CNDC_STD = []; -% tsg.CNDC_CAL = []; -% -% %% a verifier !!!!! -% tsg.SSTP = []; -% tsg.SSTP_QC = []; -% tsg.SSTP_CAL = []; -% tsg.SSTP_ADJUSTED = []; -% tsg.SSTP_ADJUSTED_ERROR = []; -% tsg.SSTP_ADJUSTED_QC = []; -% tsg.SSTP_ADJUSTED_HIST = []; -% -% tsg.SSPS = []; -% tsg.SSPS_QC = []; -% tsg.SSPS_CAL = []; -% tsg.SSPS_ADJUSTED = []; -% tsg.SSPS_ADJUSTED_ERROR = []; -% tsg.SSPS_ADJUSTED_QC = []; -% tsg.SSPS_ADJUSTED_HIST = []; -% -% % Water Sample Coordinates -% tsg.DATE_WS = []; -% tsg.DAYD_WS = []; -% tsg.LATX_WS = []; -% tsg.LONX_WS = []; -% -% % Water Sample variables -% tsg.SSPS_WS = []; -% tsg.SSPS_WS_QC = []; -% %tsg.SSPS_WS_DIF = []; -% %tsg.SSPS_WS_SMOOTH = []; % a verifier -% tsg.SSPS_WS_ANALDATE = []; -% tsg.SSPS_WS_BOTTLE = []; -% -% % External data coordinates -% tsg.DATE_EXT = []; -% tsg.DAYD_EXT = []; -% tsg.LATX_EXT = []; -% tsg.LONX_EXT = []; -% -% % External data variables -% tsg.SSTP_EXT = []; -% tsg.SSTP_EXT_QC = []; -% tsg.SSTP_EXT_TYPE = []; -% tsg.SSPS_EXT = []; -% tsg.SSPS_EXT_QC = []; -% tsg.SSPS_EXT_TYPE = []; % Save structure tsg +% ------------------ setappdata( hTsgGUI, 'tsg_data', tsg); end -- GitLab