File | /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/Scan.pm | Statements Executed | 11 | Total Time | 0.000544 seconds |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine | |
---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | WISE::DB::FrameIndex::Scan:: | BEGIN |
0 | 0 | 0 | 0 | 0 | WISE::DB::FrameIndex::Scan:: | qa_factors |
Line | Stmts. | Exclusive Time | Avg. | Code |
---|---|---|---|---|
1 | package WISE::DB::FrameIndex::Scan; | |||
2 | # $Id: Scan.pm 7412 2010-02-20 01:58:56Z heidi $ | |||
3 | ||||
4 | 1 | 0 | 0 | $VERSION = 1.2; |
5 | 1 | 0 | 0 | $ID = '$Id: Scan.pm 7412 2010-02-20 01:58:56Z heidi $'; |
6 | ||||
7 | 3 | 0.00039 | 0.00013 | use base qw/DBIx::Class/; # spent 134µs making 1 call to base::import |
8 | ||||
9 | 1 | 1.5e-5 | 1.5e-5 | __PACKAGE__->load_components(qw/Core/); # spent 41.7ms making 1 call to Class::C3::Componentised::load_components |
10 | 1 | 2.4e-5 | 2.4e-5 | __PACKAGE__->table('scans'); # spent 707µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table |
11 | ||||
12 | 1 | 4.4e-5 | 4.4e-5 | __PACKAGE__->add_columns( # spent 3.38ms making 1 call to DBIx::Class::ResultSourceProxy::add_columns |
13 | ||||
14 | # primary identifiers | |||
15 | scan => {data_type => 'text', is_nullable => 0}, | |||
16 | scan_start_utc => {data_type => 'text', is_nullable => 1}, | |||
17 | ||||
18 | # pipeline processing | |||
19 | pipe_status => {data_type => 'integer', is_nullable => 1}, # scanframe pipeline return code | |||
20 | pipe_dir => {data_type => 'text', is_nullable => 1}, # full path to pipeline directory | |||
21 | pipe_run_time => {data_type => 'integer', is_nullable => 1}, | |||
22 | ||||
23 | multiscan_status => { data_type => 'integer', is_nullable => 1}, # multiscan pipeline return code | |||
24 | multiscan_run_time => { data_type => 'integer', is_nullable => 1}, | |||
25 | ||||
26 | archive_status => {data_type => 'integer', is_nullable => 1}, # archive pipeline return code | |||
27 | archive_dir => {data_type => 'text', is_nullable => 1}, | |||
28 | archive_run_time => {data_type => 'integer', is_nullable => 1}, # time of last archive pipeline run | |||
29 | ||||
30 | anneal_time => {data_type => 'text', is_nullable => 1}, # time of last anneal | |||
31 | anneal_dt => {data_type => 'real', is_nullable => 1}, # time since last anneal | |||
32 | ||||
33 | # qa info | |||
34 | qa_score => {data_type => 'integer', is_nullable => 1 }, | |||
35 | qa_factors => {data_type => 'text', is_nullable => 1 , accessor => '_qa_factors'}, | |||
36 | qa_status => {data_type => 'text', is_nullable => 1 }, | |||
37 | qa_reviewer => {data_type => 'text', is_nullable => 1, default_value => 'unassigned' }, | |||
38 | qa_notes => {data_type => 'text', is_nullable => 1 }, | |||
39 | ||||
40 | ); | |||
41 | ||||
42 | 1 | 3.2e-5 | 3.2e-5 | __PACKAGE__->set_primary_key(qw/scan/); # spent 203µs making 1 call to DBIx::Class::ResultSourceProxy::set_primary_key |
43 | ||||
44 | 1 | 1.7e-5 | 1.7e-5 | __PACKAGE__->has_many( frames => 'WISE::DB::FrameIndex::Frame' ); # spent 13.9ms making 1 call to DBIx::Class::Relationship::HasMany::has_many |
45 | ||||
46 | ||||
47 | # accessor for the qa_factors field, which is a text string packed with key=val, entries | |||
48 | sub qa_factors { | |||
49 | my ($self, $value, $attr) = @_; | |||
50 | ||||
51 | my $overwrite = exists $attr->{overwrite} ? $attr->{overwrite} : 0; | |||
52 | my $append = exists $attr->{append} ? $attr->{append} : ! $overwrite; | |||
53 | ||||
54 | die __PACKAGE__."->qa_factors() can't overwrite and append" if($overwrite && $append); | |||
55 | ||||
56 | my %current = (); | |||
57 | my $factors_string = $self->_qa_factors || ""; | |||
58 | %current = split(/[=,]/, $factors_string) unless $overwrite; | |||
59 | ||||
60 | if(defined $value) { | |||
61 | if(ref($value) eq 'HASH' ) { | |||
62 | my $flat = ""; | |||
63 | my %merged = (%current, %$value); | |||
64 | while ( my ($k, $v) = each %merged ) { | |||
65 | $flat .= "$k=$v,"; | |||
66 | } | |||
67 | $flat =~ s/,$//; | |||
68 | $self->_qa_factors($flat); | |||
69 | } else { | |||
70 | die __PACKAGE__."->qa_factors() expects hash ref as input"; | |||
71 | } | |||
72 | } | |||
73 | ||||
74 | return split( /[=,]/, ($self->_qa_factors || "")); | |||
75 | } | |||
76 | ||||
77 | 1 | 2.4e-5 | 2.4e-5 | 1; |