]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Support for cached enums and new parameter passing from monitoring process to CGI...
authorhadeshyp <hadeshyp>
Sun, 4 Nov 2012 21:36:54 +0000 (21:36 +0000)
committerhadeshyp <hadeshyp>
Sun, 4 Nov 2012 21:36:54 +0000 (21:36 +0000)
cts/include/TrbRegister.pm

index b6fbf3e859636306466ec61933f60035b052c6eb..dddae25eec3777fe052d0042fa7bfefda41f198c 100644 (file)
@@ -29,6 +29,7 @@ package TrbRegister;
 
 use strict;
 use warnings;
+use warnings::register;
 use POSIX;
 
 use Data::Dumper;
@@ -249,6 +250,21 @@ sub format {
    return \%result;
 }
 
+sub setConstantValue {
+   # TrbRegister->setConstantValue(value)
+   #  Sets the value of register with the CONSTANT tag and avoids
+   #  further read accesses
+   my $self = shift;
+   my $value = shift;
+   
+   unless ($self->{'_const'}) {
+      warnings::warn("Setting constant value for non constant register. Operation abortet");
+      return;
+   }
+   
+   $self->{'_cached'} = $value;
+}
+
 sub getAddress    {return $_[0]->{'_address'}}
 sub getAccessMode {return $_[0]->{'_accessmode'}}
 sub getSliceNames {return [sort keys %{$_[0]->{'_defs'}}]}