IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29194


Ignore:
Timestamp:
Sep 22, 2010, 12:50:41 PM (16 years ago)
Author:
rhenders
Message:

Constructor now takes camera and gpc1Db object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/ippToPsps/Batch.pm

    r29191 r29194  
    2121    my $class = shift;
    2222    my $self = {
     23        _camera => shift,
     24        _gpc1Db => shift,
    2325        _batchId => shift,
    2426        _ippToPspsDb => shift,
     
    110112    }
    111113
    112 # create a new batch entry in the database
     114    # create a new batch entry in the database
    113115    $self->{_batchId} = $self->{_ippToPspsDb}->createNewBatch(
    114116            $self->{_expId},
     
    119121            );
    120122
    121 # use IPP dist_group to get PSPS survey type
     123    # use IPP dist_group to get PSPS survey type
    122124    $self->{_surveyType} = $self->getSurveyTypeFromDistGroup();
    123125
    124 # can we run ippToPsps?
     126    # can we run ippToPsps?
    125127    $self->{_ippToPsps} = can_run('ippToPsps') or
    126128        (warn "Can't find 'ippToPsps' program" and exit($PS_EXIT_CONFIG_ERROR));
    127129
    128 # get ipp config stuff
    129     $self->{_ipprc} = PS::IPP::Config->new($self->{_camera}) or
    130         (warn "Can't get camera configuration" and exit($PS_EXIT_CONFIG_ERROR));
    131 
    132 # set up batch output paths
     130    # set up batch output paths
    133131    $self->init();
    134132
    135 # make directories
     133    # make directories
    136134    unless(-d $self->{_typeDir}) {mkdir($self->{_typeDir}, 0777);}
    137135    unless(-d $self->{_subDir}) {mkdir($self->{_subDir}, 0777);}
     
    150148sub init {
    151149    my ($self) = @_;
     150
     151    # get ipp config stuff
     152    if (defined $self->{_camera}) {
     153
     154        $self->{_ipprc} = PS::IPP::Config->new($self->{_camera}) or
     155            (warn "Can't get camera configuration" and exit($PS_EXIT_CONFIG_ERROR));
     156    }
    152157
    153158    $self->{_name} =  sprintf("B%08d", $self->{_batchId});
     
    198203    if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
    199204    $command .= " -config ../config"; # TODO
    200     $command .= " -expid $self->{_expId}";
     205        $command .= " -expid $self->{_expId}";
    201206    $command .= " -expname $self->{_expName}";
    202207    $command .= " -survey $self->{_surveyType}";
Note: See TracChangeset for help on using the changeset viewer.