diff --git a/TSGQC_amelioration.xls b/TSGQC_amelioration.xls index 6b2032b91db35c5af046d286a915d0ab94e4baf8..045276dbd9d42b182f7d9d94da79eec656c13d95 100644 Binary files a/TSGQC_amelioration.xls and b/TSGQC_amelioration.xls differ diff --git a/tsg_util/calibration.m b/tsg_util/calibration.m index ffbe13dc78bdd2177604b6cceab402c1ac2b6b06..283d544d3ea88c282dcbaff6e6468588d63aa705 100644 --- a/tsg_util/calibration.m +++ b/tsg_util/calibration.m @@ -28,7 +28,7 @@ for i = 1:3 if ~isempty( tsg.(PARA(i,:)) ) - para1 = [PARA(i,:) '_LINCOEF']; + para1 = [PARA(i,:) '_LINCOEF_NEW']; para2 = [PARA(i,:) '_CAL']; % If the Slope = 1 and the offset = 0 : No calibration diff --git a/tsgqc.m b/tsgqc.m index aee96d868f2d2bf539cfe112e170bf6da99d904d..eacf18a7aecb9402cc51ca6fc3a61b19531551ac 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -1518,6 +1518,19 @@ hrbInterpCancel = uicontrol( ... set( hetCalSSJTOffset, 'String', num2str(tsg.SSJT_LINCOEF(2))); set( hetCalSSTPSlope, 'String', num2str(tsg.SSTP_LINCOEF(1))); set( hetCalSSTPOffset, 'String', num2str(tsg.SSTP_LINCOEF(2))); + + % Intermediate variables + % ---------------------- + tsg.CNDC_LINCOEF_NEW(1) = str2num(get( hetCalCNDCSlope, 'String')); + tsg.CNDC_LINCOEF_NEW(2) = str2num(get( hetCalCNDCOffset, 'String')); + tsg.SSJT_LINCOEF_NEW(1) = str2num(get( hetCalSSJTSlope, 'String')); + tsg.SSJT_LINCOEF_NEW(2) = str2num(get( hetCalSSJTOffset, 'String')); + tsg.SSTP_LINCOEF_NEW(1) = str2num(get( hetCalSSTPSlope, 'String')); + tsg.SSTP_LINCOEF_NEW(2) = str2num(get( hetCalSSTPOffset, 'String')); + + % Save tsg application data + % -------------------------- + setappdata( hMainFig, 'tsg_data', tsg ); end @@ -1551,12 +1564,16 @@ hrbInterpCancel = uicontrol( ... % Save the calibration coefficient % -------------------------------- - tsg.CNDC_LINCOEF(1) = str2num(get( hetCalCNDCSlope, 'String')); - tsg.CNDC_LINCOEF(2) = str2num(get( hetCalCNDCOffset, 'String')); - tsg.SSJT_LINCOEF(1) = str2num(get( hetCalSSJTSlope, 'String')); - tsg.SSJT_LINCOEF(2) = str2num(get( hetCalSSJTOffset, 'String')); - tsg.SSTP_LINCOEF(1) = str2num(get( hetCalSSTPSlope, 'String')); - tsg.SSTP_LINCOEF(2) = str2num(get( hetCalSSTPOffset, 'String')); + tsg.CNDC_LINCOEF(1) = tsg.CNDC_LINCOEF_NEW(1); + tsg.CNDC_LINCOEF(2) = tsg.CNDC_LINCOEF_NEW(2); + tsg.SSJT_LINCOEF(1) = tsg.SSJT_LINCOEF_NEW(1); + tsg.SSJT_LINCOEF(2) = tsg.SSJT_LINCOEF_NEW(2); + tsg.SSTP_LINCOEF(1) = tsg.SSTP_LINCOEF_NEW(1); + tsg.SSTP_LINCOEF(2) = tsg.SSTP_LINCOEF_NEW(2); + + tsg.CNDC_LINCOEF_NEW = []; + tsg.SSJT_LINCOEF_NEW = []; + tsg.SSTP_LINCOEF_NEW = []; % Save tsg application data % -------------------------- @@ -1568,6 +1585,7 @@ hrbInterpCancel = uicontrol( ... plot_Validation( hMainFig, hPlotAxes, 2, tsg.plot.parameter{2} ); plot_Validation( hMainFig, hPlotAxes, 3, tsg.plot.parameter{3} ); + end %% CalibrateCallback .......................................... Calibration @@ -1581,12 +1599,12 @@ hrbInterpCancel = uicontrol( ... % Get the calibration coefficients. % They will be used in the function calibration % --------------------------------------------- - tsg.CNDC_LINCOEF(1) = str2num(get( hetCalCNDCSlope, 'String')); - tsg.CNDC_LINCOEF(2) = str2num(get( hetCalCNDCOffset, 'String')); - tsg.SSJT_LINCOEF(1) = str2num(get( hetCalSSJTSlope, 'String')); - tsg.SSJT_LINCOEF(2) = str2num(get( hetCalSSJTOffset, 'String')); - tsg.SSTP_LINCOEF(1) = str2num(get( hetCalSSTPSlope, 'String')); - tsg.SSTP_LINCOEF(2) = str2num(get( hetCalSSTPOffset, 'String')); + tsg.CNDC_LINCOEF_NEW(1) = str2num(get( hetCalCNDCSlope, 'String')); + tsg.CNDC_LINCOEF_NEW(2) = str2num(get( hetCalCNDCOffset, 'String')); + tsg.SSJT_LINCOEF_NEW(1) = str2num(get( hetCalSSJTSlope, 'String')); + tsg.SSJT_LINCOEF_NEW(2) = str2num(get( hetCalSSJTOffset, 'String')); + tsg.SSTP_LINCOEF_NEW(1) = str2num(get( hetCalSSTPSlope, 'String')); + tsg.SSTP_LINCOEF_NEW(2) = str2num(get( hetCalSSTPOffset, 'String')); % Save tsg application data % -------------------------- @@ -1634,6 +1652,15 @@ hrbInterpCancel = uicontrol( ... % Update the Adjusted variables % ----------------------------- % updateAdjustedVariable( hMainFig ); + + % Write the Cal Coef in the Editable uicontrol + % -------------------------------------------- + set( hetCalCNDCSlope, 'String', num2str(tsg.CNDC_LINCOEF(1))); + set( hetCalCNDCOffset, 'String', num2str(tsg.CNDC_LINCOEF(2))); + set( hetCalSSJTSlope, 'String', num2str(tsg.SSJT_LINCOEF(1))); + set( hetCalSSJTOffset, 'String', num2str(tsg.SSJT_LINCOEF(2))); + set( hetCalSSTPSlope, 'String', num2str(tsg.SSTP_LINCOEF(1))); + set( hetCalSSTPOffset, 'String', num2str(tsg.SSTP_LINCOEF(2))); % Refresh plot #1 % ---------------