IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34014


Ignore:
Timestamp:
Jun 14, 2012, 11:31:25 AM (14 years ago)
Author:
Serge CHASTEL
Message:

Added the RESTRICTED_COUNT keyword so that we can restrict even on count when it takes too much time querying (e.g. rawBurntoolState)

Location:
trunk/ippMonitor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/def/autocode.php

    r34012 r34014  
    2929
    3030// Note: the restriction is now moved AFTER the count query
     31// unless the RESTRICT_COUNT keyword is used
     32if ($restricted == 0) {
     33  if ("$RESTRICT_COUNT" != "none") {
     34    $WHERE = "$WHERE $RESTRICT_COUNT";
     35  }
     36}
    3137
    3238// Add GROUP BY statements if any
     
    5561// Restrict the query if it is necessary
    5662if ($restricted == 0) {
    57   if ("$UNRESTRICTED" != "none") {
     63  if ( ("$UNRESTRICTED" != "none") && ("$RESTRICT_COUNT" == "none") ) {
    5864    $WHERE = "$WHERE $UNRESTRICTED";
    5965  }
  • trunk/ippMonitor/def/rawBurntoolState.d

    r30690 r34014  
    55
    66# if no query restrictions are supplied, we want to limit the query or it is extremely long running:
     7RESTRICT_COUNT WHERE 0>1
    78UNRESTRICTED WHERE exp_id = 0
    89
  • trunk/ippMonitor/scripts/generate

    r31816 r34014  
    2929    &init_key ("MODE");
    3030    &init_key ("UNRESTRICTED");
     31    &init_key ("RESTRICT_COUNT");
    3132    &init_key ("TABLE");
    3233    &init_key ("TITLE");
     
    4647        if ($key eq "TABLE") { ($value) = $value =~ m|^\s*(.+)\s*$|; }
    4748        if ($key eq "TYPE")  { ($value) = $value =~ m|^\s*(.+)\s*$|; }
    48         if ($key eq "TOPLOT") { ($value) = $value =~ m|^\s*(.+)\s*$|; }
    49         if ($key eq "PLOTTER") { ($value) = $value =~ m|^\s*(.+)\s*$|; }
    50         if ($key eq "PLOTTITLE") {
    51             ($value) = $value =~ m|^\s*(.+)\s*$|;
    52             $value =~ s/\s/_/g;
    53         }
     49        if ($key eq "TOPLOT") { ($value) = $value =~ m|^\s*(.+)\s*$|; }
     50        if ($key eq "PLOTTER") { ($value) = $value =~ m|^\s*(.+)\s*$|; }
     51        if ($key eq "PLOTTITLE") {
     52            ($value) = $value =~ m|^\s*(.+)\s*$|;
     53            $value =~ s/\s/_/g;
     54        }
    5455
    5556        &set_keypair ($key, $value);
     
    6162            if ($field =~ m|\S+\s+as\s+\S+|) {
    6263                ($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
    63                 #print STDERR "Case 1\n";
     64                #print STDERR "Case 1\n";
    6465            } elsif ($field =~ m|\S+\s+AS\s+\S+|) {
    65                 #print STDERR "field=$field\n";
    66                 $fieldreal = $field;
    67                 $fieldreal =~ s/\s+AS.*$//;
     66                #print STDERR "field=$field\n";
     67                $fieldreal = $field;
     68                $fieldreal =~ s/\s+AS.*$//;
    6869                #($fieldreal) = $field =~ m|\S+\s+as\s+(\S+)|;
    69                 #print STDERR "Case 2\n";
     70                #print STDERR "Case 2\n";
    7071            } else {
    7172                $fieldreal = $field;
    72                 #print STDERR "Case 3\n";
     73                #print STDERR "Case 3\n";
    7374            }
    74             #print STDERR "field=[$field]\tfieldreal=[$fieldreal]\n";
     75            #print STDERR "field=[$field]\tfieldreal=[$fieldreal]\n";
    7576
    7677            if ($VERBOSE) { printf "%-20s %-20s %-20s %-20s %-20s %-20s\n", $field, $name, $format, $show, $link, $extras; }
     
    141142    &check_key ("MODE", "basic");
    142143    &check_key ("UNRESTRICTED", "none");
     144    &check_key ("RESTRICT_COUNT", "none");
    143145    &check_key ("TABLE", "");
    144146    &check_key ("TITLE", "");
     
    324326# generate a WHERE test for each field (field != *)
    325327sub write_table_restrict {
    326 
    327328    if ($WHERE) {
    328329        print FILE "\$WHERE = \"WHERE $WHERE\";\n";
     
    348349}
    349350
    350 # Generate GROUP BY statement if any 
     351# Generate GROUP BY statement if any
    351352sub write_group_by {
    352353    print FILE "\$WHERE = check_ordering ('$GROUPS', \$WHERE);\n";
     
    536537    @extfields = split (/,/, $extras);
    537538    for ($i = 0; $i < @extfields; $i++) {
    538         # print STDERR $extfields[$i],"\n";
     539        # print STDERR $extfields[$i],"\n";
    539540        ($label, $value, $outline) = &parse_label ($extfields[$i]);
    540         # print STDERR "[",$label,"]","[",$value,"]","[",$outline,"\n";
     541        # print STDERR "[",$label,"]","[",$value,"]","[",$outline,"\n";
    541542        print FILE "  \$link = \$link . \"&$outline\";\n";
    542543    }
     
    553554    # print STDERR "#############################\n";
    554555    # foreach my $key ( keys %linkarg ) {
    555     #   print STDERR "key: $key, value: $linkarg{$key}\n";
     556    #   print STDERR "key: $key, value: $linkarg{$key}\n";
    556557    # }
    557558
     
    560561
    561562    if ($linkarg{$word}) {
    562         # print STDERR "Case 1\n";
     563        # print STDERR "Case 1\n";
    563564        $linkarg{$word} = "$linkarg{$word},$value";
    564565    } else {
    565         # print STDERR "Case 2\n";
     566        # print STDERR "Case 2\n";
    566567        $linkarg{$word} = $value;
    567568    }
     
    585586    # print STDERR "### parse_label ###\n";
    586587    # for ($i = 0; $i < @field; $i++) {
    587     #   print STDERR "field[$i]=$field[$i]\n";
     588    #   print STDERR "field[$i]=$field[$i]\n";
    588589    # }
    589590    # for ($i = 0; $i < @fieldreal; $i++) {
    590     #   print STDERR "fieldreal[$i]=$fieldreal[$i]\n";
     591    #   print STDERR "fieldreal[$i]=$fieldreal[$i]\n";
    591592    # }
    592593    # for ($i = 0; $i < @count; $i++) {
    593     #   print STDERR "count[$i]=$count[$i]\n";
     594    #   print STDERR "count[$i]=$count[$i]\n";
    594595    # }
    595596
     
    598599    if ($string =~ m|\S+=\S+|) {
    599600        ($label, $value) = $string =~ m|(\S+)=(\S+)|;
    600         # print STDERR "value=$value\n";
     601        # print STDERR "value=$value\n";
    601602        if ($value =~ m|^\$|) {
    602603          MATCH_LABEL:
     
    669670    $name   = &parse_fieldname ($name);
    670671    if (exists $ops{$name}) {
    671         #if OPx was defined, replace it by its value
    672         $name = $ops{$name};
    673         $name =~ s/\s+//g;
     672        #if OPx was defined, replace it by its value
     673        $name = $ops{$name};
     674        $name =~ s/\s+//g;
    674675    }
    675676    $camera = &parse_fieldname ($camera);
Note: See TracChangeset for help on using the changeset viewer.