IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2014, 11:48:53 AM (12 years ago)
Author:
eugene
Message:

merging changes from trunk

Location:
branches/eam_branches/ipp-20131211
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20131211

  • branches/eam_branches/ipp-20131211/ippMonitor

  • branches/eam_branches/ipp-20131211/ippMonitor/czartool/czartool/Gpc1Db.pm

    r33814 r36480  
    139139    my $stateCol =  $table.".state";
    140140
     141    my $extraState = "";
     142    if ($state eq 'new') {
     143        $extraState = " OR $stateCol = 'update' ";
     144    }
     145
    141146    my $query =  $self->{_db}->prepare(<<SQL);
    142147    SELECT COUNT(DISTINCT $id)
     
    144149        JOIN $joinTable USING ($id)
    145150        WHERE label LIKE '$label'
    146         AND (($faultCol != 0 AND $stateCol = '$state') OR $stateCol = 'failed_revert')
     151        AND ($faultCol != 0 AND ($stateCol = '$state' $extraState))
    147152SQL
    148153    $query->execute;
     
    208213    my $query = undef;
    209214
     215    my $joinTable = undef;
     216    my $id = undef;
     217    if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;}
     218
     219    # XXX: the "update" page is now obsolete. The standard processing page should now show
     220    # counts in new and update state
    210221    if ($state eq "update") {
    211 
    212222        if ($stage eq "dist") {return 0;}
    213         my $joinTable = undef;
    214         my $id = undef;
    215         if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;}
    216223
    217224        if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") {
     
    226233        }
    227234        else {
    228        
    229235            $query = $self->{_db}->prepare(<<SQL);
    230236            SELECT COUNT(state)
    231                 FROM $table JOIN $joinTable
    232                 USING($id)
     237                FROM $table
    233238                WHERE label LIKE '$label'
    234239                AND state = 'update';
    235240SQL
     241       
    236242        }
    237243
     
    240246    elsif ($state eq "new") {
    241247
    242         $query = $self->{_db}->prepare(<<SQL);
    243         SELECT COUNT(state) 
    244             FROM $table
    245             WHERE label LIKE '$label'
    246             AND (state = 'new' OR state = 'update')
    247 SQL
     248        if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") {
     249            # get count of runs in new state and update state that have components left to update
     250            $query = $self->{_db}->prepare(<<SQL);
     251            SELECT COUNT(DISTINCT $id) 
     252                FROM $table LEFT JOIN $joinTable
     253                USING($id)
     254                WHERE label LIKE '$label'
     255                AND (state = 'new' OR (state = 'update' AND data_state = 'update'))
     256SQL
     257        } else {
     258            $query = $self->{_db}->prepare(<<SQL);
     259            SELECT COUNT(state)
     260                FROM $table
     261                WHERE label LIKE '$label'
     262                AND (state = 'new' OR state = 'update');
     263SQL
     264        }
    248265    }
    249266    else {
     
    256273SQL
    257274    }
     275
     276    # print $query->{Statement} . "\n";
    258277
    259278    $query->execute;
Note: See TracChangeset for help on using the changeset viewer.