From 5b0d92b4bad286277a406018e0fcd2a76132bf81 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 20 Dec 2024 08:59:10 +0000 Subject: [PATCH] Fix 2D parameters & components selection for a speasy remote parameter --- js/app/models/RemoteParamNode.js | 1 + php/classes/AmdaAction.php | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/js/app/models/RemoteParamNode.js b/js/app/models/RemoteParamNode.js index 17db2d9..48cf68b 100644 --- a/js/app/models/RemoteParamNode.js +++ b/js/app/models/RemoteParamNode.js @@ -23,6 +23,7 @@ Ext.define('amdaModel.RemoteParamNode', { if (!this.get('leaf')) this.set('allowDrag', false); if (this.get('isParameter')) this.set('allowDrag',true); if (this.get('leaf') && this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); + if (this.get('leaf') && this.get('is2dSpectra')) this.set('iconCls', 'icon-2dspectra'); if (this.get('disable')) { this.set('cls', 'icon-disabled'); diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 3fdfa72..c8fec63 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -477,6 +477,7 @@ class AmdaAction $isParameter = false; $isSpectra = false; + $is2dSpectra = false; switch ($id) { @@ -489,10 +490,10 @@ class AmdaAction $info = $child->getAttribute('desc'); - if ($info && !$isSimulation) + /*if ($info && !$isSimulation) { $info = str_replace(';', "
Time Range: ", $info); - } + }*/ if (($child->tagName == 'parameter') || ($child->tagName == 'component')) { @@ -508,6 +509,7 @@ class AmdaAction $globalStartStr = ""; $globalStopStr = ""; + $component_info = array(); if ($child->tagName == 'parameter'){ if ($child->parentNode->hasAttribute('dataStart')){ @@ -520,6 +522,12 @@ class AmdaAction $globalStartStr = $child->parentNode->parentNode->getAttribute('dataStart'); $globalStopStr = $child->parentNode->parentNode->getAttribute('dataStop'); } + if ($child->hasAttribute("index1")) + $component_info["index1"] = $child->getAttribute('index1'); + if ($child->hasAttribute("index2")) + $component_info["index2"] = $child->getAttribute('index2'); + + $component_info["parentId"] = $child->parentNode->getAttribute('xml:id'); } else { if ($child->hasAttribute('dataStart')){ @@ -546,6 +554,8 @@ class AmdaAction { $needsArgs = true; $isSpectra = true; + if (strpos($child->getAttribute('name'),'2D') !== false) + $is2dSpectra = true; } if ($child->getAttribute('error')) { @@ -556,12 +566,12 @@ class AmdaAction $childrenToReturn[] = array('text' => $name,'alias' => $alias, 'id' => $id,'nodeType' => $nodeType, 'info' => $info, 'help' => $help, 'globalStart' => $globalStart, 'globalStop' => $globalStop, 'leaf' => $isLeaf, 'disable' => $disable, 'isParameter' => $isParameter, - 'isSpectra' => $isSpectra, 'needsArgs' => $needsArgs, "component_info" => isset($component_info) ? $component_info : NULL); + 'isSpectra' => $isSpectra, 'is2dSpectra' => $is2dSpectra, 'needsArgs' => $needsArgs, "component_info" => isset($component_info) ? $component_info : NULL); else $childrenToReturn[] = array('text' => $name,'alias' => $alias, 'id' => $id,'nodeType' => $nodeType, 'info' => $info, 'help' => $help, 'leaf' => $isLeaf, 'disable' => $disable, 'isParameter' => $isParameter, - 'isSpectra' => $isSpectra, 'needsArgs' => $needsArgs, "component_info" => $component_info); + 'isSpectra' => $isSpectra, 'is2dSpectra' => $is2dSpectra, 'needsArgs' => $needsArgs, "component_info" => $component_info); } else { -- libgit2 0.21.2