Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nghyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Cassiopée
nghyd
Commits
0a030c6b
Commit
0a030c6b
authored
6 years ago
by
francois.grand
Browse files
Options
Downloads
Patches
Plain Diff
#48
NgParameter : déplacement vers jalHyd (dans BaseParam) des méthodes de validation des valeurs
parent
5f1900fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!22
Resolve "Lier des paramètres ou des résultats entre les calculettes"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/formulaire/ngparam.ts
+7
-77
7 additions, 77 deletions
src/app/formulaire/ngparam.ts
with
7 additions
and
77 deletions
src/app/formulaire/ngparam.ts
+
7
−
77
View file @
0a030c6b
...
...
@@ -140,38 +140,16 @@ export class NgParameter extends InputField {
this
.
_paramValues
.
valueMode
=
m
;
}
/**
* vérifie si un min/max est valide par rapport au domaine de définition
*/
private
isMinMaxDomainValid
(
v
:
number
):
boolean
{
if
(
v
==
undefined
)
return
false
;
if
(
this
.
_paramValues
.
valueMode
==
ParamValueMode
.
MINMAX
)
try
{
this
.
checkValue
(
v
);
}
catch
(
e
)
{
return
false
;
}
return
true
;
}
private
checkMinMax
(
min
:
number
,
max
:
number
):
boolean
{
return
this
.
isMinMaxDomainValid
(
min
)
&&
this
.
isMinMaxDomainValid
(
max
)
&&
(
min
<
max
);
}
public
checkMin
(
min
:
number
):
boolean
{
return
this
.
isMinMaxDomainValid
(
min
)
&&
(
min
<
this
.
_paramValues
.
max
);
return
this
.
_paramDef
.
checkMin
(
min
);
}
public
checkMax
(
max
:
number
):
boolean
{
return
this
.
isMinMaxDomainValid
(
max
)
&&
(
this
.
_paramValues
.
min
<
max
);
return
this
.
_paramDef
.
checkMax
(
max
);
}
public
get
isMinMaxValid
():
boolean
{
return
this
.
checkMinMax
(
this
.
_paramValues
.
min
,
this
.
_paramValues
.
max
)
;
return
this
.
_paramDef
.
isMinMaxValid
;
}
public
get
minValue
()
{
...
...
@@ -191,7 +169,7 @@ export class NgParameter extends InputField {
}
public
checkStep
(
step
:
number
):
boolean
{
return
this
.
isMinMaxValid
&&
this
.
_paramValues
.
stepRefValue
.
intervalHasValue
(
step
);
return
this
.
_paramDef
.
checkStep
(
step
);
}
public
get
stepRefValue
():
Pair
{
...
...
@@ -214,59 +192,11 @@ export class NgParameter extends InputField {
this
.
_paramValues
.
valueList
=
l
;
}
private
get
isListValid
():
boolean
{
if
(
this
.
_paramValues
.
valueList
==
undefined
)
return
false
;
for
(
let
v
of
this
.
_paramValues
.
valueList
)
try
{
this
.
checkValue
(
v
);
}
catch
(
e
)
{
return
false
;
}
return
true
;
}
private
get
isRangeValid
():
boolean
{
switch
(
this
.
_paramValues
.
valueMode
)
{
case
ParamValueMode
.
LISTE
:
return
this
.
isListValid
;
case
ParamValueMode
.
MINMAX
:
return
this
.
checkStep
(
this
.
_paramValues
.
step
);
}
throw
new
Error
(
`"NgParameter.isRangeValid() : valeur
${
ParamValueMode
[
this
.
_paramValues
.
valueMode
]}
de ParamValueMode non prise en compte`
);
}
private
get
isValueValid
():
boolean
{
try
{
const
v
=
this
.
_paramDef
.
getValue
();
this
.
_paramDef
.
checkValue
(
v
);
return
true
;
}
catch
(
e
)
{
return
false
;
}
}
public
get
isValid
()
{
switch
(
this
.
radioState
)
{
case
ParamRadioConfig
.
FIX
:
return
this
.
isValueValid
;
case
ParamRadioConfig
.
VAR
:
return
this
.
isRangeValid
;
case
ParamRadioConfig
.
CAL
:
return
true
;
case
undefined
:
return
false
;
}
if
(
this
.
radioState
===
undefined
)
return
false
;
throw
new
Error
(
`"NgParameter.isValid() : valeur de ParamRadioConfig '
${
this
.
radioState
}
' (radioState) non prise en compte`
)
;
return
this
.
_paramDef
.
isValid
;
}
private
static
getRadioConfig
(
s
:
string
)
{
...
...
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