Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jalhyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
jalhyd
Commits
d8bb3590
Commit
d8bb3590
authored
4 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
Espece: load predefined species criteria
#248
parent
453381e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/verification/espece.ts
+27
-0
27 additions, 0 deletions
src/verification/espece.ts
with
27 additions
and
0 deletions
src/verification/espece.ts
+
27
−
0
View file @
d8bb3590
...
...
@@ -953,6 +953,33 @@ export class Espece extends Nub implements Observer {
}
}
}
/**
* Load ICE tables values into parameters, for a given species
* (used in GUI for loading predefined species)
*/
public
loadPredefinedSpecies
(
sp
:
FishSpecies
)
{
let
found
:
boolean
;
// for each param
for
(
const
p
of
this
.
prms
)
{
if
(
p
.
symbol
!==
"
OK
"
)
{
// reset current value
p
.
singleValue
=
undefined
;
// whatever the pass type (criteria are supposed to apply to 1 pass type only)
found
=
false
;
for
(
const
pt
of
Object
.
keys
(
this
.
presets
))
{
const
preset
=
this
.
presets
[
pt
];
if
(
!
found
&&
preset
!==
undefined
&&
preset
[
sp
]
!==
undefined
&&
preset
[
sp
][
p
.
symbol
]
!==
undefined
)
{
found
=
true
;
// if (preset[sp][p.symbol] !== undefined) console.log(`-> setting ${p.symbol} to ${preset[sp][p.symbol]}`);
// apply preset
p
.
singleValue
=
preset
[
sp
][
p
.
symbol
];
}
}
}
}
}
/** Parameters other than OK are just settings here, nothing can vary or be calculated */
protected
setParametersCalculability
():
void
{
for
(
const
p
of
this
.
_prms
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment