IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33802


Ignore:
Timestamp:
Apr 18, 2012, 3:29:38 PM (14 years ago)
Author:
rhenders
Message:

improved table printing so that new stages can be added/removed easily

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/czartool/czartool.pl

    r33800 r33802  
    155155
    156156    chomp($label);
    157 
    158     printf("\n+--------------------------------------------------------------------------------------------------------------------+\n");
    159     printf("|                                            %32s                                        |\n", $label);
    160     printf("+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
    161     printf("|   state    |    chip    |    cam     |    fake    |    warp    |   stack    |    diff    |    dist    |   publish  |\n");
    162     printf("+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     157    my $stage;
     158
     159    printf("\n|  %32s  \n", $label);
     160    printf("+------------+");
     161    foreach $stage (@stages) {
     162        print "------------+"
     163    }
     164    printf("\n");
     165    printf("|   state    |");
     166    foreach $stage (@stages) {
     167
     168        printf(" %10s |", $stage)
     169    }
     170    printf("\n");
     171    printf("+------------+");
     172    foreach $stage (@stages) {
     173        print "------------+"
     174    }
     175    printf("\n");
    163176
    164177    my $state;
    165     my $stage;
    166178    my $i=0;
    167179    foreach $state (@states) {
     
    179191    }
    180192
    181     printf("+------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     193    printf("+------------+");
     194    foreach $stage (@stages) {
     195        print "------------+"
     196    }
     197    printf("\n");
    182198
    183199}
     
    191207    my ($state) = @_;
    192208#print time, $/;
    193     printf("\n+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n");
    194     printf("|                                                                 %10s (any faults are shown in parentheses)                                                               |\n", $state);
    195     printf("+-----+----------------------------------+---------------+---------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
    196     printf("| no  |              label               | distributing? |  publishing?  |    chip    |    cam     |    fake    |    warp    |   stack    |    diff    |    dist    |   publish  |\n");
    197     printf("+-----+----------------------------------+---------------+---------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     209    my $stage;
     210
     211    printf("|\n");
     212    printf("+-----+----------------------------------+---------------+---------------+");
     213    foreach $stage (@stages) {
     214        print "------------+"
     215    }
     216    printf("\n");
     217    printf("| no  |              label               | distributing? |  publishing?  |");
    198218
    199219    my $stdsLabel;
     
    202222    my $distributing;
    203223    my $publishing;
    204     my $stage;
    205224    my $i=1;
     225    foreach $stage (@stages) {
     226
     227        printf(" %10s |", $stage)
     228    }
     229    printf("\n");
     230    printf("+-----+----------------------------------+---------------+---------------+");
     231    foreach $stage (@stages) {
     232        print "------------+"
     233    }
     234    printf("\n");
     235
    206236    foreach $stdsLabel (@stdscienceLabels) {
    207237
     
    232262    }
    233263
    234     printf("+-----+----------------------------------+---------------+---------------+------------+------------+------------+------------+------------+------------+------------+------------+\n");
     264    printf("+-----+----------------------------------+---------------+---------------+");
     265    foreach $stage (@stages) {
     266        print "------------+"
     267    }
     268    printf("\n");
    235269
    236270}
Note: See TracChangeset for help on using the changeset viewer.