Commit 1815c31464188ec892e5360a6ceeac2590aff132

Authored by Myriam Bouchemit
2 parents f152ac12 574ec9ed

Merge branch 'master' of https://gitlab.irap.omp.eu/CDPP/AMDA_Integration

src/InputOutput/IHMImpl/Params/DownloadImpl/IHMInputOutputParamsDownloadClass.php
... ... @@ -27,31 +27,43 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
27 27 $outputsNode = $this->paramsData->getRequestNode()->getOutputsNode();
28 28 $downloadNode = $outputsNode->addNewOutput(RequestOutputTypeEnum::DOWNLOAD);
29 29  
30   - //timeformatData : [['Y-m-dTH:i:s', 'YYYY-MM-DDThh:mm:ss'], ['Y m d H i s', 'YYYY MM DD hh mm ss'], ['d m Y H i s', 'DD MM YYYY hh mm ss'], ['Y z H i s', 'YYYY DDD hh mm ss']],
  30 + //timeformatData : [['Y-m-dTH:i:s', 'YYYY-MM-DDThh:mm:ss'], ['DD Time', 'DD Time'], ['Timestamp', 'Timestamp']],
31 31 switch ($input->timeformat)
32 32 {
33 33 case 'YYYY-MM-DDThh:mm:ss' :
34 34 $downloadNode->setTimeFormat(RequestOutputDownloadTimeFormatEnum::ISO);
35 35 break;
  36 + case 'DD Time' :
  37 + $downloadNode->setTimeFormat(RequestOutputDownloadTimeFormatEnum::DDTIME);
  38 + break;
  39 + case 'Timestamp' :
  40 + $downloadNode->setTimeFormat(RequestOutputDownloadTimeFormatEnum::TIMESTAMP);
  41 + break;
36 42 default :
37 43 throw new Exception('Time format not implemented.');
38 44 }
39 45  
40   - //formatData : [['ASCII', 'ASCII'],['vot', 'VOTable']],
  46 + //formatData : [['ASCII', 'ASCII'],['vot', 'VOTable'],['cdf', 'CDF'],['json', 'JSON']],
41 47 switch ($input->fileformat)
42 48 {
43 49 case "ASCII" :
44 50 $downloadNode->setFileFormat(RequestOutputDownloadFileFormatEnum::ASCII);
45 51 break;
46   - case "vot" :
47   - $downloadNode->setFileFormat(RequestOutputDownloadFileFormatEnum::VOTABLE);
  52 + case "vot" :
  53 + $downloadNode->setFileFormat(RequestOutputDownloadFileFormatEnum::VOTABLE);
  54 + break;
  55 + case "cdf" :
  56 + $downloadNode->setFileFormat(RequestOutputDownloadFileFormatEnum::CDF);
  57 + break;
  58 + case "json" :
  59 + $downloadNode->setFileFormat(RequestOutputDownloadFileFormatEnum::JSON);
48 60 break;
49 61 default :
50 62 throw new Exception('File format not implemented.');
51 63 }
52 64  
53   - if ($input->output != "")
54   - $downloadNode->setFileName($input->output);
  65 + if ($input->fileprefix != "")
  66 + $downloadNode->setFileName($input->fileprefix);
55 67  
56 68 //add params to output
57 69 foreach ($input->list as $param)
... ... @@ -65,12 +77,22 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
65 77 switch ($input->structure)
66 78 {
67 79 case "0" :
68   - $downloadNode->setSamplingTime($input->sampling);
69   - $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE);
  80 + if (!$input->refparamSampling)
  81 + {
  82 + $downloadNode->setSamplingTime($input->sampling);
  83 + $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE);
  84 + }
  85 + else
  86 + $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE_REFPARAM);
70 87 break;
71 88 case "1" :
72   - $downloadNode->setSamplingTime($input->sampling);
73   - $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE_PER_INTERVAL);
  89 + if (!$input->refparamSampling)
  90 + {
  91 + $downloadNode->setSamplingTime($input->sampling);
  92 + $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE_PER_INTERVAL);
  93 + }
  94 + else
  95 + $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE_PER_INTERVAL_REFPARAM);
74 96 break;
75 97 case "2" :
76 98 $downloadNode->setStructure(RequestOutputDownloadStructureEnum::ONE_FILE_PER_PARAMETER_PER_INTERVAL);
... ... @@ -116,4 +138,4 @@ class IHMInputOutputParamsDownloadClass extends IHMInputOutputParamsAbstractClas
116 138 return $this->commonMarshallResult($data,DOWNLOAD_RESULT_FILE_KEY);
117 139 }
118 140 }
119   -?>
120 141 \ No newline at end of file
  142 +?>
... ...
src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputDownloadNodeClass.php
... ... @@ -17,8 +17,10 @@ define ("REQUESTOUTPUTDOWNLOADPARAM_CALIB", "calibration_info");
17 17  
18 18 abstract class RequestOutputDownloadTimeFormatEnum
19 19 {
20   - const UNKNOWN = "";
21   - const ISO = "ISO";
  20 + const UNKNOWN = "";
  21 + const ISO = "ISO";
  22 + const DDTIME = "DD";
  23 + const TIMESTAMP = "DOUBLE";
22 24 }
23 25  
24 26 abstract class RequestOutputDownloadFileFormatEnum
... ... @@ -26,6 +28,8 @@ abstract class RequestOutputDownloadFileFormatEnum
26 28 const UNKNOWN = "";
27 29 const ASCII = "ASCII";
28 30 const VOTABLE = "VOT";
  31 + const CDF = "CDF";
  32 + const JSON = "JSON";
29 33 }
30 34  
31 35 abstract class RequestOutputDownloadStructureEnum
... ... @@ -230,4 +234,4 @@ class RequestOutputDownloadNodeClass extends NodeClass
230 234 }
231 235 }
232 236  
233   -?>
234 237 \ No newline at end of file
  238 +?>
... ...