From b1eadff70e6be9be88f5374bc2863903a7871d17 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Sun, 4 Nov 2012 21:36:54 +0000 Subject: [PATCH] Support for cached enums and new parameter passing from monitoring process to CGI script --- cts/include/TrbRegister.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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'}}]} -- 2.43.0