Changeset 28719 for trunk/tools/czartool
- Timestamp:
- Jul 27, 2010, 2:42:17 PM (16 years ago)
- Location:
- trunk/tools/czartool
- Files:
-
- 1 added
- 1 deleted
- 2 edited
-
CzarDb.pm (modified) (6 diffs)
-
Czarplot.pm (added)
-
Gnuplot.pm (deleted)
-
Gpc1Db.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool/CzarDb.pm
r28715 r28719 72 72 $query->execute; 73 73 } 74 75 ########################################################################### 76 # 77 # Sets priority for this label 78 # 79 ########################################################################### 80 sub setLabelPriority { 81 my ($self, $label, $priority) = @_; 82 83 my $query = $self->{_db}->prepare(<<SQL); 84 UPDATE current_labels 85 SET priority = $priority 86 WHERE label LIKE '$label' 87 AND server LIKE 'stdscience'; 88 SQL 89 90 $query->execute; 91 } 92 74 93 ########################################################################### 75 94 # … … 79 98 sub updateCurrentLabels { 80 99 my ($self, $server, $labels) = @_; 100 101 my $size = scalar @{$labels}; 102 if ($size < 1) {return;} 81 103 82 104 my $query = $self->{_db}->prepare(<<SQL); … … 181 203 182 204 my ($timestamp, $pending, $faults, $processed) = @row; 205 # print "'$timestamp' '$pending' '$faults' '$processed'\n"; 183 206 print $tempFile "$timestamp $pending $faults $processed\n"; 184 207 } … … 298 321 299 322 my $currentRevision = -1; 300 my $latestRevision = 6;323 my $latestRevision = 7; 301 324 302 325 while ($currentRevision != $latestRevision) { … … 311 334 elsif ($currentRevision == 4) {$self->createRevision_5();} 312 335 elsif ($currentRevision == 5) {$self->createRevision_6();} 336 elsif ($currentRevision == 6) {$self->createRevision_7();} 313 337 } 314 338 } … … 476 500 ####################################################################################### 477 501 # 502 # Create revision 7 of the database 503 # 504 ####################################################################################### 505 sub createRevision_7 { 506 my ($self) = @_; 507 508 print "* Creating revision 7 of '$self->{_dbName}'\n"; 509 510 my $query = $self->{_db}->prepare(<<SQL); 511 ALTER TABLE current_labels 512 ADD COLUMN priority INT NOT NULL DEFAULT 0; 513 SQL 514 515 $query->execute; 516 517 $self->setRevision(7); 518 } 519 520 ####################################################################################### 521 # 478 522 # Sets current revision of ippToPsps database 479 523 # -
trunk/tools/czartool/Gpc1Db.pm
r28704 r28719 73 73 ########################################################################### 74 74 # 75 # Returns priority for this label 76 # 77 ########################################################################### 78 sub getPriority { 79 my ($self, $label) = @_; 80 81 my $query = $self->{_db}->prepare(<<SQL); 82 SELECT priority 83 FROM Label 84 WHERE label LIKE '$label' 85 SQL 86 87 $query->execute; 88 my $priority = scalar $query->fetchrow_array(); 89 if (!$priority) {return 50000;} # assume labels not given priority in gpc1 Db have highest priority 90 return $priority; 91 } 92 93 ########################################################################### 94 # 75 95 # Returns count of exposures with this state for this label 76 96 #
Note:
See TracChangeset
for help on using the changeset viewer.
