Changeset 404 for trunk/web


Ignore:
Timestamp:
07/04/07 22:40:08 (17 years ago)
Author:
bastiaans
Message:

web/addons/job_monarch/libtoga.php:

  • fixed bug in hostname x,y parsing where x/y min was set incorrectly when either one was not found in the hostname
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/job_monarch/libtoga.php

    r350 r404  
    12101210                        foreach( $nodes as $hostname => $node )
    12111211                        {
    1212                                 $x      = 0;
    1213                                 $y      = 0;
     1212                                $x      = null;
     1213                                $y      = null;
    12141214
    12151215                                if( $x_present && $y_present )
     
    12281228                                        if( $n < 2 )
    12291229                                        {
     1230                                                //printf( "removing node %s - x present & y present + <2 x,y matches\n", $hostname );
    12301231                                                unset( $nodes[$hostname] );
    12311232                                        }
     
    12381239                                        if( $n < 1 )
    12391240                                        {
     1241                                                //printf( "removing node %s - x present & !y present + <1 x match\n", $hostname );
    12401242                                                unset( $nodes[$hostname] );
    12411243                                        }
     
    12491251                                        if( $n < 1 )
    12501252                                        {
     1253                                                //printf( "removing node %s - y present & !x present + <1 y match\n", $hostname );
    12511254                                                unset( $nodes[$hostname] );
    12521255                                        }
     
    12581261
    12591262
    1260                                 if( !$x_min )
     1263                                //printf( "node %s x_min %s x %s\n", $hostname, $x_min, $x );
     1264
     1265                                if( !$x_min && $x != null )
    12611266                                {
    12621267                                        $x_min  = $x;
    12631268                                }
    1264                                 else if( $x < $x_min )
     1269                                else if( $x < $x_min && $x != null )
    12651270                                {
    12661271                                        $x_min  = $x;
    12671272                                }
    1268                                 if( !$x_max )
     1273                                if( !$x_max && $x != null )
    12691274                                {
    12701275                                        $x_max  = $x;
    12711276                                }
    1272                                 else if( $x > $x_max )
     1277                                else if( $x > $x_max && $x != null )
    12731278                                {
    12741279                                        $x_max  = $x;
    12751280                                }
    1276                                 if( !$y_min )
     1281                                if( !$y_min && $y != null )
    12771282                                {
    12781283                                        $y_min  = $y;
    12791284                                }
    1280                                 else if( $y < $y_min )
     1285                                else if( $y < $y_min && $y != null )
    12811286                                {
    12821287                                        $y_min  = $y;
    12831288                                }
    1284                                 if( !$y_max )
     1289                                if( !$y_max && $y != null )
    12851290                                {
    12861291                                        $y_max  = $y;
    12871292                                }
    1288                                 else if( $y > $y_max )
     1293                                else if( $y > $y_max && $y != null )
    12891294                                {
    12901295                                        $y_max  = $y;
     
    13681373                                }
    13691374                        }
     1375                        //print_r( $nodes );
    13701376
    13711377                        for( $n = $x_min; $n <= $x_max; $n++ )
     
    13981404                                                        if ( $nn < 2 )
    13991405                                                        {
     1406                                                                //printf( "skipping node %s - y present & x present + <2 x,y matchs\n", $host);
    14001407                                                                continue;
    14011408                                                        }
    1402                                                         if( ( $rx ) > $n )
     1409                                                        if( intval( $rx ) > $n )
    14031410                                                        {
    14041411                                                                $m      = $y_max + 1;
     1412                                                                //printf( "skipping node %s - y present & x present + rx %s > n %s\n", $rx, $n);
     1413                                                                continue;
     1414                                                        }
     1415                                                        if( intval( $ry ) > $m )
     1416                                                        {
     1417                                                                //printf( "skipping node %s - y present & x present + ry %s > m %s\n", $ry, $m);
    14051418                                                                continue;
    14061419                                                        }
     
    14161429
    14171430                                                if( !in_array( $host, $filtered_nodes ) )
     1431                                                {
     1432                                                        printf( "setting node %s showinfo to 0 - not found in filtered_nodes", $host);
    14181433                                                        $nodes[$cur_node]->setShowinfo( 0 );
     1434                                                }
    14191435
    14201436                                                $nodes[$cur_node]->setCoords( $x, $y );
     
    14271443                                                else if( $this->isBig() )
    14281444                                                        $nodes[$cur_node]->drawBig();
     1445
     1446                                                $cur_node++;
    14291447                                        }
    14301448                                        if( $this->isBig() )
     
    14481466                                        }
    14491467
    1450                                         $cur_node++;
    14511468                                }
    14521469                        }
     
    14831500
    14841501                                                if( !in_array( $host, $filtered_nodes ) )
     1502                                                {
    14851503                                                        $nodes[$host]->setShowinfo( 0 );
     1504                                                }
    14861505
    14871506                                                if( $this->isSmall() )
Note: See TracChangeset for help on using the changeset viewer.