Skip to content
Snippets Groups Projects
Commit 2652873c authored by Alexander Ivanov's avatar Alexander Ivanov
Browse files

Correctly process DAQ names in the case where top_names tag is specified.

git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@2719 6dcd42c9-f523-4c6d-aada-af552506706e
parent f653c0c9
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,7 @@ sub is_top_name { ...@@ -103,7 +103,7 @@ sub is_top_name {
}; };
# Transform record name for exculsion of sys/subsystem parts # Transform record name for exculsion of sys/subsystem parts
# This function replaces first underscode with the hyphen # This function replaces first underscore with the hyphen
sub top_name_transform { sub top_name_transform {
($name) = @_; ($name) = @_;
$name =~ s/_/-/; $name =~ s/_/-/;
...@@ -761,7 +761,12 @@ while (<IN>) { ...@@ -761,7 +761,12 @@ while (<IN>) {
next unless length $nr[0]; next unless length $nr[0];
$nr[1] = $gds_datarate unless defined $nr[1]; $nr[1] = $gds_datarate unless defined $nr[1];
die "Invalid DAQ channel $nr[0] rate $nr[1]; system rate is $gds_datarate" if $nr[1] > $gds_datarate; die "Invalid DAQ channel $nr[0] rate $nr[1]; system rate is $gds_datarate" if $nr[1] > $gds_datarate;
$nr[0] = "$site:$systems[0]$nr[0]"; if (is_top_name($nr[0])) {
$nr[0] = "$site:" . top_name_transform($nr[0]);
} else {
$nr[0] = "$site:$systems[0]$nr[0]";
}
$DAQ_Channels{$nr[0]} = $nr[1]; $DAQ_Channels{$nr[0]} = $nr[1];
#print $nr[0], " ", $nr[1], "\n"; #print $nr[0], " ", $nr[1], "\n";
} }
......
...@@ -107,26 +107,18 @@ sub find_node { ...@@ -107,26 +107,18 @@ sub find_node {
sub find_daq_annotation { sub find_daq_annotation {
my($tree) = @_; my($tree) = @_;
if ($tree->{NAME} eq "Annotation" && ${$tree->{FIELDS}}{Name} =~ /^#\s*[dD][aA][qQ]\s+[cC]hannels/) { if ($tree->{NAME} eq "Annotation" && ${$tree->{FIELDS}}{Name} =~ /^#\s*[dD][aA][qQ]\s+[cC]hannels/) {
return ($tree, "", 0); return ($tree, "");
} else { } else {
for (@{$tree->{NEXT}}) { for (@{$tree->{NEXT}}) {
#print "Recursing into ", $_->{NAME}, " ", ${$_->{FIELDS}}{"Name"}, "\n"; #print "Recursing into ", $_->{NAME}, " ", ${$_->{FIELDS}}{"Name"}, "\n";
($res, $prefix, $tn) = find_daq_annotation($_); ($res, $prefix) = find_daq_annotation($_);
if ($res) { if ($res) {
#print $tree->{NAME}, " ", ${$tree->{FIELDS}}{"Name"}, " ", ${$tree->{FIELDS}}{"Type"}, "\n"; #print $tree->{NAME}, " ", ${$tree->{FIELDS}}{"Name"}, " ", ${$tree->{FIELDS}}{"Type"}, "\n";
# Annotate the prefix if this is block # Annotate the prefix if this is block
if (!$tn) { if ($tree->{NAME} eq "Block") {
if ($tree->{NAME} eq "Block") { $prefix = ${$tree->{FIELDS}}{"Name"}. "_" .$prefix;
# Stop annotating if top_names tag encountered
if (${$tree->{FIELDS}}{Tag} eq "top_names") {
#print "top_names ", ${$tree->{FIELDS}}{"Name"}, "\n";
$tn = 1;
} else {
$prefix = ${$tree->{FIELDS}}{"Name"}. "_" .$prefix;
}
}
} }
return ($res, $prefix, $tn); return ($res, $prefix);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment