Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vecs
FIJI Public
Commits
a3a91f8e
Commit
a3a91f8e
authored
May 02, 2018
by
Christian Fibich
Committed by
Stefan Tauner
May 04, 2018
Browse files
Disable only if the key an entry depends on is found in the reference map.
Addresses Issue #73
parent
7fff3824
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/FIJI/Settings.pm
View file @
a3a91f8e
...
...
@@ -722,8 +722,19 @@ sub _sanitize_fiu {
sub
_disabled_via_dependency
{
my
(
$map_ref
,
$consts_ref
,
$k
)
=
@_
;
my
$dependency
=
$map_ref
->
{
$k
}
->
{'
depends_on
'};
return
defined
(
$dependency
)
&&
$map_ref
->
{
$k
}
->
{'
type
'}
eq
'
boolean
'
&&
!
$consts_ref
->
{
$dependency
};
my
$depends_on
=
$map_ref
->
{
$k
}
->
{'
depends_on
'};
# If we can't find the template for an entry in $map_ref, we assume
# everything's OK.
# Rationale: We would need to pass >1 different maps to cross-check
# entries defined in other maps (e.g., FIU_LFSR_MASK in the FIUMAP depends on LFSR_MASK in the DESIGNMAP)
# For an entry to be disabled by a dependency, ...
return
defined
(
$depends_on
)
&&
# ... it must depend on something
defined
(
$map_ref
->
{
$depends_on
})
&&
# ... that something must be found in the map
$map_ref
->
{
$depends_on
}
->
{'
type
'}
eq
'
boolean
'
&&
# ... that something must be of type boolean
!
$consts_ref
->
{
$depends_on
};
# ... that something must be set to false
}
sub
_validate_hashmap
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment