Commit 22d8d7563cb1f4c32d8711eb4385cd40600f1cd4

Authored by Hacene SI HADJ MOHAND
1 parent d8ee9cbb

resolu

js/app/controllers/ExplorerModule.js
... ... @@ -292,8 +292,9 @@ Ext.define('amdaDesktop.ExplorerModule',
292 292 }
293 293 return this.paramInfoRegistry[paramId]
294 294 }
295   - var pattParam = new RegExp("ws_");
296   - if(pattParam .test(paramId)){
  295 + var pattParamWs = new RegExp("ws_");
  296 + var pattParamWsd = new RegExp("wsd_");
  297 + if(pattParamWs.test(paramId)){
297 298 var regExp = /\(([\d]+)\)/;
298 299 var matches = regExp.exec(paramId);
299 300 if(matches)
... ... @@ -323,6 +324,36 @@ Ext.define('amdaDesktop.ExplorerModule',
323 324 onReady(paramInfo)
324 325 }
325 326 })
  327 + }else if(pattParamWsd.test(paramId)){
  328 + var regExp = /\(([\d]+)\)/;
  329 + var matches = regExp.exec(paramId);
  330 + if(matches)
  331 + {
  332 + paramId=paramId.substr(0,paramId.length-3);
  333 + }
  334 + /* case of derived parameter */
  335 + AmdaAction.getMyDataParamInfo({paramId: paramId}, function (result, e) {
  336 + var paramInfo = null
  337 + if (e.status === true) {
  338 + // No available info for this parameter, do not display an error message if no success
  339 + if (result.success) {
  340 + // Store parameter info in registry
  341 + me.paramInfoRegistry[paramId] = result;
  342 + paramInfo = result
  343 + }
  344 + } else {
  345 + Ext.Msg.show({
  346 + title: 'Error System',
  347 + msg: e.message,
  348 + icon: Ext.MessageBox.ERROR,
  349 + buttons: Ext.Msg.OK
  350 + })
  351 + }
  352 +
  353 + if (onReady) {
  354 + onReady(paramInfo)
  355 + }
  356 + })
326 357 }else{
327 358 AmdaAction.getParamInfo({paramId: paramId}, function (result, e) {
328 359 var paramInfo = null
... ...
php/classes/AmdaAction.php
... ... @@ -1466,6 +1466,26 @@ class AmdaAction
1466 1466 return array('success'=>false, 'message'=>'unkown parameter (derived parameter arguments are not handled)');
1467 1467 }
1468 1468  
  1469 + public function getMyDataParamInfo($obj)
  1470 + {
  1471 + $dom = new DomDocument("1.0");
  1472 + $xmlName=USERWSDIR.$this->xmlFiles['derivedParam'];
  1473 + @$dom->load($xmlName);
  1474 + $params=$dom->getElementsByTagName("mydata");
  1475 + foreach($params as $param)
  1476 + {
  1477 + if($param->hasAttribute("name") && ("wsd_" . ($param->getAttribute("name")))==$obj->paramId)
  1478 + {
  1479 + $dim_1=$param->getAttribute("size");
  1480 + $dim_2=1;
  1481 + return $this->createDerivedParamInfo($dim_1,$dim_2,$obj->paramId);
  1482 + }
  1483 +
  1484 + }
  1485 + return array('success'=>false, 'message'=>'unkown parameter (derived parameter arguments are not handled)');
  1486 + }
  1487 +
  1488 +
1469 1489 public function createDerivedParamInfo($dim_1,$dim_2,$paramId)
1470 1490 {
1471 1491 /* case of constant */
... ...
php/config.php
... ... @@ -193,6 +193,7 @@ $API = array(
193 193 'getParamPlotInit'=>array('len'=>1),
194 194 'getParamInfo'=>array('len'=>1),
195 195 'getDerivedParamInfo'=>array('len'=>1),
  196 + 'getMyDataParamInfo'=>array('len'=>1),
196 197 'getSharedObjectFolders' => array('len'=>1),
197 198 'shareObjects' => array('len'=>1),
198 199 'isSharedObjectNameAlreadyUsed' => array('len'=>1),
... ...