IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29951


Ignore:
Timestamp:
Dec 6, 2010, 12:26:58 PM (15 years ago)
Author:
rhenders
Message:

Added multiple constructors for clarity

File:
1 edited

Legend:

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

    r29864 r29951  
    1010my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
    1111
    12 
    13 ###########################################################################
    14 #
    15 # Constructor
     12###########################################################################
     13#
     14# Main constructor with all arguments
    1615#
    1716###########################################################################
     
    3029    return $self;
    3130}
     31
     32###########################################################################
     33#
     34# Constructor sending all plots to file
     35#
     36###########################################################################
     37sub new_file {
     38    my $class = shift;
     39    my $self = {
     40        _gpc1Db => shift,
     41        _czarDb => shift,
     42        _outputPath => shift,
     43        _save_temps => shift,
     44                                                    };
     45
     46    $self->{_dateFormat} = "%Y%m%d-%H%M%S";
     47    $self->{_outputFormat} = "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8"; # TODO path needs to be in config
     48
     49        bless $self, $class;
     50    return $self;
     51}
     52
     53###########################################################################
     54#
     55# Constructor sending all plots to an X window
     56#
     57###########################################################################
     58sub new_display {
     59    my $class = shift;
     60    my $self = {
     61        _gpc1Db => shift,
     62        _czarDb => shift,
     63        _save_temps => shift,
     64    };
     65
     66    $self->{_dateFormat} = "%Y%m%d-%H%M%S";
     67    $self->{_outputFormat} = "X11";
     68    $self->{_outputPath} = undef;
     69
     70    bless $self, $class;
     71    return $self;
     72}
     73
     74
    3275
    3376###########################################################################
Note: See TracChangeset for help on using the changeset viewer.