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
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
nghyd
Commits
1dd6d735
Commit
1dd6d735
authored
5 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
RemousResults: fix bug in connectRessaut
parent
9af4027a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!63
Resolve "Passer les courbes de remous en cotes"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/remous-results/remous-results.component.ts
+17
-56
17 additions, 56 deletions
...app/components/remous-results/remous-results.component.ts
src/app/results/remous-results.ts
+1
-1
1 addition, 1 deletion
src/app/results/remous-results.ts
with
18 additions
and
57 deletions
src/app/components/remous-results/remous-results.component.ts
+
17
−
56
View file @
1dd6d735
import
{
Component
,
ViewChild
,
DoCheck
}
from
"
@angular/core
"
;
import
{
ArrayReverseIterator
,
ResultElement
,
INumberIterator
,
CourbeRemousParams
,
CourbeRemous
}
from
"
jalhyd
"
;
import
{
INumberIterator
,
CourbeRemousParams
,
CourbeRemous
}
from
"
jalhyd
"
;
import
{
I18nService
}
from
"
../../services/internationalisation.service
"
;
import
{
LogComponent
}
from
"
../../components/log/log.component
"
;
...
...
@@ -398,61 +398,25 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck
private
connectRessaut
(
lineFlu
:
LineData
,
lineTor
:
LineData
)
{
if
(
lineFlu
!==
undefined
&&
lineTor
!==
undefined
)
{
const
tX
=
lineFlu
.
tx
.
slice
(
0
);
// copie
tX
.
sort
((
a
,
b
)
=>
{
if
(
a
>
b
)
{
return
1
;
}
if
(
a
<
b
)
{
return
-
1
;
}
return
0
;
});
let
minXflu
;
// abscisse de début de la courbe fluviale
let
itX
=
this
.
abscisseIterator
;
for
(
const
re
of
this
.
_remousResults
.
result
.
resultElements
)
{
if
(
!
itX
.
hasNext
)
{
throw
new
Error
(
"
RemousResultsComponent.connectRessaut() : erreur interne (itérateur sur x)
"
);
}
const
x
=
itX
.
next
().
value
;
if
(
re
.
getValue
(
"
flu
"
)
!==
undefined
)
{
minXflu
=
x
;
break
;
const
p
=
this
.
_remousResults
.
varResults
.
variatedParameters
[
0
].
paramDefinition
;
const
xs
=
p
.
getInferredValuesList
();
// 1e passe : prolonger la torrentielle
outerloop1
:
for
(
let
i
=
0
;
i
<
xs
.
length
;
i
++
)
{
const
x
=
xs
[
i
];
if
(
lineTor
.
getYat
(
x
)
===
null
)
{
lineTor
.
setPoint
(
x
,
lineFlu
.
getYat
(
x
));
break
outerloop1
;
}
}
if
(
minXflu
!==
undefined
&&
minXflu
!==
tX
[
0
])
{
// la courbe fluviale ne démarre pas au début, on ajoute un point de raccord avec la ligne torrentielle
const
i
=
tX
.
indexOf
(
minXflu
);
const
xflu
=
tX
[
i
-
1
];
const
yflu
=
lineTor
.
getYat
(
xflu
);
lineFlu
.
setPoint
(
xflu
,
yflu
);
}
let
maxXtor
;
// abscisse de fin de la courbe torrentielle
const
itRE
=
new
ArrayReverseIterator
<
ResultElement
>
(
this
.
_remousResults
.
result
.
resultElements
);
itX
=
this
.
abscisseIterator
;
for
(
const
r
of
itRE
)
{
if
(
!
itX
.
hasNext
)
{
throw
new
Error
(
"
RemousResultsComponent.connectRessaut() : erreur interne (itérateur sur x)
"
);
// 2e passe : prolonger la fluviale
outerloop2
:
for
(
let
i
=
xs
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
x
=
xs
[
i
];
if
(
lineFlu
.
getYat
(
x
)
===
null
)
{
lineFlu
.
setPoint
(
x
,
lineTor
.
getYat
(
x
));
break
outerloop2
;
}
const
x
=
itX
.
next
();
if
(
r
.
getValue
(
"
tor
"
)
!==
undefined
)
{
maxXtor
=
x
.
value
;
break
;
}
}
if
(
maxXtor
!==
undefined
&&
maxXtor
!==
tX
[
tX
.
length
-
1
])
{
// la courbe torrentielle ne finit pas à la fin des abscisses, on ajoute un point de raccord avec la ligne fluviale
const
i
=
tX
.
indexOf
(
maxXtor
);
const
xflu
=
tX
[
i
+
1
];
const
yflu
=
lineFlu
.
getYat
(
xflu
);
lineTor
.
setPoint
(
xflu
,
yflu
);
}
}
}
...
...
@@ -523,7 +487,6 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck
}
// lignes d'eau torrentielle et fluviale
let
lineFlu
:
LineData
;
if
(
this
.
_remousResults
.
hasFluData
)
{
lineFlu
=
gr1
.
newLine
(
0
);
...
...
@@ -579,11 +542,9 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck
}
// raccordement ligne fluviale -> torrentielle pour dessiner le ressaut
this
.
connectRessaut
(
lineFlu
,
lineTor
);
// ajout des données au graphique
if
(
lineTor
!==
undefined
)
{
lineTor
.
data
=
{
label
:
this
.
uitextLigneTorrentielle
,
...
...
This diff is collapsed.
Click to expand it.
src/app/results/remous-results.ts
+
1
−
1
View file @
1dd6d735
...
...
@@ -98,7 +98,7 @@ export class RemousResults extends CalculatorResults {
// série de valeurs de X
this
.
_xValues
=
new
ParamDefinition
(
p
,
"
Abscisse
"
,
ParamDomainValue
.
POS_NULL
);
this
.
_xValues
.
paramValues
.
setValues
(
0
,
Long
,
Dx
);
this
.
_xValues
.
setValues
(
0
,
Long
,
Dx
);
}
public
get
log
()
{
...
...
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