% ------------------------------------------------------------------------------
% Print ECO3 sensor technical data in output CSV file.
%
% SYNTAX :
%  print_sensor_tech_data_in_csv_file_ECO3_105_to_107_110_to_114( ...
%    a_cycleNum, a_profNum, a_dataIndexList, ...
%    a_sensorTechECO3)
%
% INPUT PARAMETERS :
%   a_cycleNum       : cycle number of the packet
%   a_profNum        : profile number of the packet
%   a_dataIndex      : index of the packet
%   a_sensorTechECO3 : ECO3 technical data
%
% OUTPUT PARAMETERS :
%
% EXAMPLES :
%
% SEE ALSO :
% AUTHORS  : Jean-Philippe Rannou (Altran)(jean-philippe.rannou@altran.com)
% ------------------------------------------------------------------------------
% RELEASES :
%   02/11/2013 - RNU - creation
% ------------------------------------------------------------------------------
function print_sensor_tech_data_in_csv_file_ECO3_105_to_107_110_to_114( ...
   a_cycleNum, a_profNum, a_dataIndexList, ...
   a_sensorTechECO3)

% current float WMO number
global g_decArgo_floatNum;

% output CSV file Id
global g_decArgo_outputCsvFileId;

% unpack the input data
a_sensorTechECO3NbPackDesc = a_sensorTechECO3{1};
a_sensorTechECO3NbPackDrift = a_sensorTechECO3{2};
a_sensorTechECO3NbPackAsc = a_sensorTechECO3{3};
a_sensorTechECO3NbMeasDescZ1 = a_sensorTechECO3{4};
a_sensorTechECO3NbMeasDescZ2 = a_sensorTechECO3{5};
a_sensorTechECO3NbMeasDescZ3 = a_sensorTechECO3{6};
a_sensorTechECO3NbMeasDescZ4 = a_sensorTechECO3{7};
a_sensorTechECO3NbMeasDescZ5 = a_sensorTechECO3{8};
a_sensorTechECO3NbMeasDrift = a_sensorTechECO3{9};
a_sensorTechECO3NbMeasAscZ1 = a_sensorTechECO3{10};
a_sensorTechECO3NbMeasAscZ2 = a_sensorTechECO3{11};
a_sensorTechECO3NbMeasAscZ3 = a_sensorTechECO3{12};
a_sensorTechECO3NbMeasAscZ4 = a_sensorTechECO3{13};
a_sensorTechECO3NbMeasAscZ5 = a_sensorTechECO3{14};
a_sensorTechECO3SensorState = a_sensorTechECO3{15};
a_sensorTechECO3SensorSerialNum = a_sensorTechECO3{16};
a_sensorTechECO3CoefScaleFactChloroA = a_sensorTechECO3{17};
a_sensorTechECO3CoefDarkCountChloroA = a_sensorTechECO3{18};
a_sensorTechECO3CoefScaleFactBackscat = a_sensorTechECO3{19};
a_sensorTechECO3CoefDarkCountBackscat = a_sensorTechECO3{20};
a_sensorTechECO3CoefScaleFactCdom = a_sensorTechECO3{21};
a_sensorTechECO3CoefDarkCountCdom = a_sensorTechECO3{22};

% select the data (according to a_cycleNum and a_profNum)
idPack = find((a_sensorTechECO3NbPackDesc(a_dataIndexList, 1) == a_cycleNum) & ...
   (a_sensorTechECO3NbPackDesc(a_dataIndexList, 2) == a_profNum));

for id = 1:length(idPack)
   idP = a_dataIndexList(idPack(id));

   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb packets for descent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbPackDesc(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb packets for drift; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbPackDrift(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb packets for ascent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbPackAsc(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 1 for descent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasDescZ1(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 2 for descent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasDescZ2(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 3 for descent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasDescZ3(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 4 for descent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasDescZ4(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 5 for descent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasDescZ5(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins for drift; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasDrift(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 1 for ascent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasAscZ1(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 2 for ascent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasAscZ2(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 3 for ascent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasAscZ3(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 4 for ascent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasAscZ4(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Nb bins in zone 5 for ascent; %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3NbMeasAscZ5(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Sensor state indicator (1:Ok, 0:Ko); %d\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3SensorState(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; Sensor serial num; %g\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      a_sensorTechECO3SensorSerialNum(idP, 3));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; ScaleFactChloroA; %s\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      num_2_str(a_sensorTechECO3CoefScaleFactChloroA(idP, 3)));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; DarkCountChloroA; %s\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      num_2_str(a_sensorTechECO3CoefDarkCountChloroA(idP, 3)));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; ScaleFactBackscatter700; %s\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      num_2_str(a_sensorTechECO3CoefScaleFactBackscat(idP, 3)));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; DarkCountBackscatter700; %s\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      num_2_str(a_sensorTechECO3CoefDarkCountBackscat(idP, 3)));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; ScaleFactCDOM; %s\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      num_2_str(a_sensorTechECO3CoefScaleFactCdom(idP, 3)));
   fprintf(g_decArgo_outputCsvFileId, '%d; %d; %d; %s; ECO3 tech; DarkCountCDOM; %s\n', ...
      g_decArgo_floatNum, a_cycleNum, a_profNum, get_phase_name(-1), ...
      num_2_str(a_sensorTechECO3CoefDarkCountCdom(idP, 3)));
end

return
