Commit 6e9bb13dd1e6ee7dde95e49471567f2751bd762c

Authored by Nathanaël Jourdane
1 parent 3945ae76

improve job tooltip plots

Showing 1 changed file with 8 additions and 12 deletions   Show diff stats
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
@@ -255,6 +255,12 @@ class IHMJobsManagerClass { @@ -255,6 +255,12 @@ class IHMJobsManagerClass {
255 ); 255 );
256 } 256 }
257 257
  258 + private function logObj($obj) {
  259 + $f = fopen('/AMDA/AMDA_Integration/test/serialise.json', 'w') or die("Unable to open debug file!");
  260 + fwrite($f, json_encode($obj, JSON_PRETTY_PRINT));
  261 + fclose($f);
  262 + }
  263 +
258 /* 264 /*
259 * @brief Add a new job 265 * @brief Add a new job
260 */ 266 */
@@ -265,10 +271,6 @@ class IHMJobsManagerClass { @@ -265,10 +271,6 @@ class IHMJobsManagerClass {
265 if (!$res['success']) 271 if (!$res['success'])
266 return $res; 272 return $res;
267 273
268 -// $f = fopen('/AMDA/AMDA_Integration/debug/serialise.json', 'w') or die("Unable to open file!");  
269 -// fwrite($f, json_encode($obj, JSON_PRETTY_PRINT));  
270 -// fclose($f);  
271 -  
272 $infos = []; 274 $infos = [];
273 switch ($obj['nodeType']) { 275 switch ($obj['nodeType']) {
274 // Data mining 276 // Data mining
@@ -360,13 +362,7 @@ class IHMJobsManagerClass { @@ -360,13 +362,7 @@ class IHMJobsManagerClass {
360 foreach ($panel->params as $param) { 362 foreach ($panel->params as $param) {
361 $strParams .= $param->paramid . ($param === end($panel->params) ? '' : ', '); 363 $strParams .= $param->paramid . ($param === end($panel->params) ? '' : ', ');
362 } 364 }
363 - $strPanels[] = $strParams;  
364 - }  
365 -  
366 - if(count($strPanels) == 1) {  
367 - $infos['Parameters'] = $strPanels[0];  
368 - } else {  
369 - $infos['Panels'] = '<ul><li>' . join('</li><li>', $strPanels) . '</li></ul>'; 365 + $infos['• Panel ' . $panel->id] = $strParams;
370 } 366 }
371 367
372 continue; 368 continue;
@@ -466,7 +462,7 @@ class IHMJobsManagerClass { @@ -466,7 +462,7 @@ class IHMJobsManagerClass {
466 $infos['Job duration'] = $interval->format('%Hh %Im %Ss'); 462 $infos['Job duration'] = $interval->format('%Hh %Im %Ss');
467 463
468 $res_dir = USERWORKINGDIR . $job->getAttribute('folder') . '/'; 464 $res_dir = USERWORKINGDIR . $job->getAttribute('folder') . '/';
469 - $fileSize = filesize ( glob($res_dir.'/' . $job->getAttribute('result') . '.*')[0]); 465 + $fileSize = filesize ( glob($res_dir.'/' . $job->getAttribute('result') . '*')[0]);
470 if ($fileSize < 1024) { 466 if ($fileSize < 1024) {
471 $strSize = number_format($fileSize, 2, '.', ' ') . 'b'; 467 $strSize = number_format($fileSize, 2, '.', ' ') . 'b';
472 } else if($fileSize < 1024*1024) { 468 } else if($fileSize < 1024*1024) {