Changeset 30240 for trunk/ippScripts/scripts
- Timestamp:
- Jan 12, 2011, 1:08:55 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/register_imfile.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/register_imfile.pl
r30217 r30240 39 39 40 40 my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $bytes, $md5sum, $dbname, $verbose, $no_update, $no_op, $logfile); 41 my ($sunrise, $sunset); 41 42 GetOptions( 42 43 'caches' => \$cache, … … 47 48 'bytes=s' => \$bytes, 48 49 'md5sum=s' => \$md5sum, 50 'sunrise=s' => \$sunrise, 51 'sunset=s' => \$sunset, 49 52 'dbname|d=s' => \$dbname, # Database name 50 53 'verbose' => \$verbose, # Print to stdout … … 65 68 defined $uri; 66 69 70 unless (defined($sunset)) { 71 $sunset = '03:30:00'; 72 } 73 unless (defined($sunrise)) { 74 $sunrise = '17:30:00'; 75 } 67 76 68 77 my $RECIPE = "REGISTER"; # Recipe to use for ppStats … … 181 190 $command .= " -dbname $dbname" if defined $dbname; 182 191 if (abs($burntoolStateCurrent) == $burntoolStateTarget) { 192 $command .= " -data_state full"; 193 } 194 elsif (is_daytime($dateobs,$sunset,$sunrise)) { 183 195 $command .= " -data_state full"; 184 196 } … … 361 373 } 362 374 375 sub is_daytime 376 { 377 my $dateobs = shift; 378 my $sunset = shift; 379 my $sunrise = shift; 380 381 my $date,$time; 382 383 if ($dateobs =~ /T/) { 384 ($date,$time) = split /T/, $dateobs; 385 } 386 else { 387 ($date,$time) = split / /, $dateobs; 388 } 389 my ($hour,$minute,$second) = split /\:/, $time; # /; 390 my ($ss_hour,$ss_minute,$ss_second) = split /\:/, $sunset; # /; 391 my ($sr_hour,$sr_minute,$sr_second) = split /\:/, $sunrise; # /; 392 393 if (($hour >= $ss_hour)&&($minute >= $ss_minute)&&($second >= $ss_second)) { 394 if (($hour <= $sr_hour)&&($minute <= $sr_minute)&&($second <= $sr_second)) { 395 return(1); 396 } 397 } 398 399 return(0); 400 } 401 363 402 sub my_die_for_add 364 403 {
Note:
See TracChangeset
for help on using the changeset viewer.
