Skip to content

Commit

Permalink
Update comments regarding rel_date2time and MANSTART
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanconn committed Jul 15, 2020
1 parent 4203774 commit fca803c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion starcheck/src/lib/Ska/Parse_CM_File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@ our @EXPORT = qw();
our @EXPORT_OK = qw( );
%EXPORT_TAGS = ( all => \@EXPORT_OK );


###############################################################
sub rel_date2time{
###############################################################

# Return seconds when suppled a "relative datetime" of the
# format 000:00:00:00.000 (DOY:HH:MM:SS.sss).
my $date = shift;

# The old code here uses reverse to just ignore a year if
# included in the string.
my ($sec, $min, $hr, $doy) = reverse split ":", $date;
return ($doy*86400 + $hr*3600 + $min*60 + $sec);
}

###############################################################
sub TLR_load_segments{
###############################################################
Expand Down Expand Up @@ -488,6 +496,9 @@ sub DOT {
foreach (keys %command) {
%{$dot{$_}} = parse_params($command{$_});
$dot{$_}{time} = date2time($dot{$_}{TIME}) if ($dot{$_}{TIME});

# MANSTART is in the dot as a "relative" time like "000:00:00:00.000", so just pass it
# to the rel_date2time routine designed to handle that.
$dot{$_}{time} += rel_date2time($dot{$_}{MANSTART}) if ($dot{$_}{TIME} && $dot{$_}{MANSTART});
$dot{$_}{cmd_identifier} = "$dot{$_}{anon_param1}_$dot{$_}{anon_param2}"
if ($dot{$_}{anon_param1} and $dot{$_}{anon_param2});
Expand Down

0 comments on commit fca803c

Please sign in to comment.