From: hadeshyp Date: Sun, 4 Nov 2012 21:36:54 +0000 (+0000) Subject: Support for cached enums and new parameter passing from monitoring process to CGI... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=b1eadff70e6be9be88f5374bc2863903a7871d17;p=daqtools.git Support for cached enums and new parameter passing from monitoring process to CGI script --- diff --git a/cts/include/TrbRegister.pm b/cts/include/TrbRegister.pm index b6fbf3e..dddae25 100644 --- a/cts/include/TrbRegister.pm +++ b/cts/include/TrbRegister.pm @@ -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'}}]}