Module: nagvis
Branch: master
Commit: c32839a90808c05da447c3dccd5f256a5015c874
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=c32839a90808c05da447c3dccd5f256a5015c874

Author: Lars Michelsen <[email protected]>
Date:   Wed Apr 14 21:29:40 2010 +0200

#259 layer options for automap can be set to -1 now

---

 .../nagvis-js/classes/FrontendModAutoMap.php       |    6 ++--
 share/server/core/classes/CoreModAutoMap.php       |   31 +++++++++++--------
 share/server/core/defines/matches.php              |    1 +
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/share/frontend/nagvis-js/classes/FrontendModAutoMap.php 
b/share/frontend/nagvis-js/classes/FrontendModAutoMap.php
index 5d57c88..e664478 100644
--- a/share/frontend/nagvis-js/classes/FrontendModAutoMap.php
+++ b/share/frontend/nagvis-js/classes/FrontendModAutoMap.php
@@ -40,9 +40,9 @@ class FrontendModAutoMap extends FrontendModule {
                               'search' => MATCH_STRING_NO_SPACE_EMPTY,
                               'backend' => MATCH_STRING_NO_SPACE_EMPTY,
                               'root' => MATCH_STRING_NO_SPACE_EMPTY,
-                              'maxLayers' => MATCH_INTEGER_EMPTY,
-                              'childLayers' => MATCH_INTEGER_EMPTY,
-                              'parentLayers' => MATCH_INTEGER_EMPTY,
+                              'maxLayers' => MATCH_INTEGER_PRESIGN_EMPTY,
+                              'childLayers' => MATCH_INTEGER_PRESIGN_EMPTY,
+                              'parentLayers' => MATCH_INTEGER_PRESIGN_EMPTY,
                               'renderMode' => MATCH_AUTOMAP_RENDER_MODE,
                               'width' => MATCH_INTEGER_EMPTY,
                               'height' => MATCH_INTEGER_EMPTY,
diff --git a/share/server/core/classes/CoreModAutoMap.php 
b/share/server/core/classes/CoreModAutoMap.php
index 08b57b4..0695f02 100644
--- a/share/server/core/classes/CoreModAutoMap.php
+++ b/share/server/core/classes/CoreModAutoMap.php
@@ -36,9 +36,9 @@ class CoreModAutoMap extends CoreModule {
                $aOpts = Array('show' => MATCH_MAP_NAME,
                               'backend' => MATCH_STRING_NO_SPACE_EMPTY,
                               'root' => MATCH_STRING_NO_SPACE_EMPTY,
-                              'maxLayers' => MATCH_INTEGER_EMPTY,
-                              'childLayers' => MATCH_INTEGER_EMPTY,
-                              'parentLayers' => MATCH_INTEGER_EMPTY,
+                              'maxLayers' => MATCH_INTEGER_PRESIGN_EMPTY,
+                              'childLayers' => MATCH_INTEGER_PRESIGN_EMPTY,
+                              'parentLayers' => MATCH_INTEGER_PRESIGN_EMPTY,
                               'renderMode' => MATCH_AUTOMAP_RENDER_MODE,
                               'width' => MATCH_INTEGER_EMPTY,
                               'height' => MATCH_INTEGER_EMPTY,
@@ -169,7 +169,7 @@ class CoreModAutoMap extends CoreModule {
                
                $MAP = new NagVisAutoMap($this->CORE, $MAPCFG, $BACKEND, 
$this->opts, IS_VIEW);
                // Fetch the state
-               $MAP->MAPOBJ->fetchState();
+               //$MAP->MAPOBJ->fetchState();
                // Read position from graphviz and set it on the objects
                $MAP->setMapObjectPositions();
 
@@ -201,6 +201,7 @@ class CoreModAutoMap extends CoreModule {
                $this->MAPCFG->readMapConfig();
                
                $numObjects = count($arrType);
+               $aObjs = Array();
                for($i = 0; $i < $numObjects; $i++) {
                        // Get the object configuration
                        $objConf = $this->getObjConf($arrType[$i], 
$arrName1[$i], $arrName2[$i]);
@@ -226,9 +227,7 @@ class CoreModAutoMap extends CoreModule {
                                        $MAPCFG = new NagVisMapCfg($this->CORE, 
$arrName1[$i]);
                                        $MAPCFG->readMapConfig();
                                        
-                                       $MAP = new NagVisMap($this->CORE, 
$MAPCFG, $BACKEND, GET_STATE, !IS_VIEW);
-                                       
-                                       $OBJ = $MAP->MAPOBJ;
+                                       $OBJ = new NagVisMapObj($this->CORE, 
$BACKEND, $MAPCFG, !IS_VIEW);
                                break;
                                case 'automap':
                                        // Initialize map configuration based 
on map type
@@ -246,14 +245,20 @@ class CoreModAutoMap extends CoreModule {
                        // Apply default configuration to object
                        $OBJ->setConfiguration($objConf);
                        
-                       // These things are already done by NagVisMap and 
NagVisAutoMap classes
-                       // for the NagVisMapObj objects. Does not need to be 
done a second time.
-                       if(get_class($OBJ) != 'NagVisMapObj') {
-                               $OBJ->fetchState();
+                       if($arrType[$i] != 'automap') {
+                               $OBJ->queueState(GET_STATE, 
GET_SINGLE_MEMBER_STATES);
                        }
                        
-                       $OBJ->fetchIcon();
+                       $aObjs[] = $OBJ;
+               }
                        
+               // Now after all objects are queued execute them and then apply 
the states
+               $BACKEND->execute();
+       
+               foreach($aObjs AS $OBJ) {
+                       $OBJ->applyState();
+                       $OBJ->fetchIcon();
+               
                        switch($sType) {
                                case 'state':
                                        $arr = 
$OBJ->getObjectStateInformations();
@@ -268,7 +273,7 @@ class CoreModAutoMap extends CoreModule {
                        
                        $arrReturn[] = $arr;
                }
-               
+                       
                return json_encode($arrReturn);
        }
 
diff --git a/share/server/core/defines/matches.php 
b/share/server/core/defines/matches.php
index 11c6e7c..7df5c41 100644
--- a/share/server/core/defines/matches.php
+++ b/share/server/core/defines/matches.php
@@ -73,6 +73,7 @@ define('MATCH_HOVER_TEMPLATE_FILE', '/^(.+)\.hover\.html$/i');
 define('MATCH_CONTEXT_TEMPLATE_FILE', '/^(.+)\.context\.html$/i');
 define('MATCH_PHP_FILE', '/^(.+\.php)$/i');
 define('MATCH_INTEGER_PRESIGN', '/^[\+\-]?[0-9]+$/');
+define('MATCH_INTEGER_PRESIGN_EMPTY', '/^[\+\-]?[0-9]*$/');
 define('MATCH_ORDER', '/^(?:asc|desc)$/');
 define('MATCH_TEXTBOX_WIDTH', '/^([0-9]+|auto)$/');
 define('MATCH_TEXTBOX_HEIGHT', '/^([0-9]+|auto)$/');


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to