projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add CTY 3201 prefix data
[spider.git]
/
perl
/
DXUtil.pm
diff --git
a/perl/DXUtil.pm
b/perl/DXUtil.pm
index 6d115a7b6273540810e42bdb8ea6c1728951c153..be6dfb4d308e2152e158000a9ddb41582bcc02df 100644
(file)
--- a/
perl/DXUtil.pm
+++ b/
perl/DXUtil.pm
@@
-29,6
+29,7
@@
require Exporter;
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
is_prefix dd is_ipaddr $pi $d2r $r2d localdata localdata_mv
diffms _diffms _diffus difft parraydifft is_ztime basecall
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
is_prefix dd is_ipaddr $pi $d2r $r2d localdata localdata_mv
diffms _diffms _diffus difft parraydifft is_ztime basecall
+ normalise_call
);
);
@@
-221,7
+222,7
@@
sub phash
my $ref = shift;
my $out;
my $ref = shift;
my $out;
-
while (my $k =
sort keys %$ref) {
+
foreach my $k (
sort keys %$ref) {
$out .= "${k}=>$ref->{$k}, ";
}
$out =~ s/, $// if $out;
$out .= "${k}=>$ref->{$k}, ";
}
$out =~ s/, $// if $out;
@@
-564,8
+565,11
@@
sub difft
}
}
return '-(ve)' if $t < 0;
}
}
return '-(ve)' if $t < 0;
- my ($d,$h,$m,$s);
+ my ($
y,$
d,$h,$m,$s);
my $out = '';
my $out = '';
+ $y = int $t / (86400*365);
+ $out .= sprintf ("%s${y}y", $adds?' ':'') if $y;
+ $t -= $y * 86400 * 365;
$d = int $t / 86400;
$out .= sprintf ("%s${d}d", $adds?' ':'') if $d;
$t -= $d * 86400;
$d = int $t / 86400;
$out .= sprintf ("%s${d}d", $adds?' ':'') if $d;
$t -= $d * 86400;
@@
-598,6
+602,15
@@
sub parraydifft
sub basecall
{
sub basecall
{
- my ($r) = $_[0] =~ m
|^(?:[\w\d]+/)?([\w\d]+).*$|
;
+ my ($r) = $_[0] =~ m
{^((?:[\w\d]+/)?[\w\d]+(?:/[\w\d]+)*)(?:-\d+)?(?:-\#)?$}
;
return $r;
}
return $r;
}
+
+sub normalise_call
+{
+ my ($c, $ssid) = $_[0] =~ m|^((?:[\w\d]+/)?[\d\w]+(?:/[\w\d]+)*)(?:-(\d+))?(?:-\#)?$|;
+ my $ncall = $c;
+ $ssid += 0;
+ $ncall .= "-$ssid" if $ssid;
+ return $ncall;
+}