IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29076


Ignore:
Timestamp:
Aug 30, 2010, 8:20:44 AM (16 years ago)
Author:
rhenders
Message:

Added method to get current nightscience status

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/Pantasks.pm

    r28920 r29076  
    7373    }
    7474    return 1;
     75}
     76
     77###########################################################################
     78#
     79# Gets nightlyscience status for today
     80#
     81###########################################################################
     82sub getNightlyScienceStatus {
     83    my ($self, $status) = @_;
     84
     85    my @labels;
     86
     87    my ($day, $month, $year) = (localtime)[3,4,5];
     88    my $today = sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day);
     89
     90    my @cmdOut = `echo "ns.show.dates;quit" | pantasks_client -c ~ipp/stdscience/ptolemy.rc 2>&1`;
     91    my $line;
     92    foreach $line (@cmdOut) {
     93
     94        chomp($line);
     95        if (!$self->outputOk($line)) {return 0;}
     96        if ($line =~ m/$today\s+(.+)/) {
     97            ${$status} = $1;
     98            return 1;
     99        }
     100    }
     101
     102    return 0;
    75103}
    76104
Note: See TracChangeset for help on using the changeset viewer.