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
1cf8cd96
Commit
1cf8cd96
authored
4 years ago
by
Mathias Chouet
Committed by
mathias.chouet
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
PreBarrage: fix bug in basin number detection
parent
980d4a62
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/app/components/pb-schema/pb-schema.component.ts
+7
-24
7 additions, 24 deletions
src/app/components/pb-schema/pb-schema.component.ts
with
7 additions
and
24 deletions
src/app/components/pb-schema/pb-schema.component.ts
+
7
−
24
View file @
1cf8cd96
...
...
@@ -266,12 +266,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
// store, to draw later
sortedWalls
.
push
(
c
);
}
this
.
existingWalls
[
basinsPair
]
++
;
// draw wall Node
def
.
push
(
`
${
c
.
uid
}
["
${
this
.
itemDesription
(
c
)}
"]`
);
// square edges
def
.
push
(
`class
${
c
.
uid
}
wall;`
);
// draw "arrow" with 2 lines
def
.
push
(
`
${
upstreamBasinId
}
---
${
c
.
uid
}
-->
${
downstreamBasinId
}
`
);
}
// sort then draw walls
sortedWalls
.
sort
(
this
.
triCloisonsGaucheDroite
);
...
...
@@ -382,17 +376,17 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
if
(
item
instanceof
PbCloison
)
{
const
upstreamBasinName
=
item
.
bassinAmont
===
undefined
?
this
.
i18nService
.
localizeText
(
"
INFO_LIB_AMONT
"
)
:
"
B
"
+
(
this
.
findBasinPosition
(
item
.
bassinAmont
)
+
1
);
:
"
B
"
+
(
this
.
model
.
findBasinPosition
(
item
.
bassinAmont
.
uid
)
+
1
);
const
downstreamBasinName
=
item
.
bassinAval
===
undefined
?
this
.
i18nService
.
localizeText
(
"
INFO_LIB_AVAL
"
)
:
"
B
"
+
(
this
.
findBasinPosition
(
item
.
bassinAval
)
+
1
);
:
"
B
"
+
(
this
.
model
.
findBasinPosition
(
item
.
bassinAval
.
uid
)
+
1
);
desc
=
upstreamBasinName
+
"
-
"
+
downstreamBasinName
;
// if a similar wall already exists, suffix !
if
(
item
.
uid
in
this
.
wallsSuffixes
)
{
desc
+=
"
(
"
+
this
.
wallsSuffixes
[
item
.
uid
]
+
"
)
"
;
}
}
else
if
(
item
instanceof
PbBassin
)
{
desc
=
this
.
i18nService
.
localizeText
(
"
INFO_PB_BASSIN_N
"
)
+
(
this
.
findBasinPosition
(
item
)
+
1
);
desc
=
this
.
i18nService
.
localizeText
(
"
INFO_PB_BASSIN_N
"
)
+
(
this
.
model
.
findBasinPosition
(
item
.
uid
)
+
1
);
}
// else undefined
return
desc
;
}
...
...
@@ -408,17 +402,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
});
}
private
findBasinPosition
(
basin
:
PbBassin
):
number
{
let
i
=
0
;
for
(
const
b
of
this
.
model
.
bassins
)
{
if
(
b
===
basin
)
{
break
;
}
i
++
;
}
return
i
;
}
// at this time @Input data is supposed to be already populated
public
ngOnInit
()
{
this
.
model
=
this
.
pbSchema
.
pb
;
...
...
@@ -508,14 +491,14 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
public
get
enableUpButton
()
{
return
(
this
.
_selectedItem
instanceof
PbBassin
&&
this
.
findBasinPosition
(
this
.
_selectedItem
)
!==
0
&&
this
.
model
.
findBasinPosition
(
this
.
_selectedItem
.
uid
)
!==
0
&&
this
.
isStandaloneBasin
(
this
.
_selectedItem
)
);
}
public
onMoveBasinUpClick
()
{
if
(
this
.
_selectedItem
instanceof
PbBassin
)
{
this
.
model
.
moveBasin
(
this
.
_selectedItem
.
uid
,
this
.
findBasinPosition
(
this
.
_selectedItem
)
-
1
);
this
.
model
.
moveBasin
(
this
.
_selectedItem
.
uid
,
this
.
model
.
findBasinPosition
(
this
.
_selectedItem
.
uid
)
-
1
);
}
const
basin
=
this
.
_selectedItem
;
this
.
unselect
();
...
...
@@ -530,14 +513,14 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
public
get
enableDownButton
()
{
return
(
this
.
_selectedItem
instanceof
PbBassin
&&
this
.
findBasinPosition
(
this
.
_selectedItem
)
!==
this
.
model
.
bassins
.
length
-
1
&&
this
.
model
.
findBasinPosition
(
this
.
_selectedItem
.
uid
)
!==
this
.
model
.
bassins
.
length
-
1
&&
this
.
isStandaloneBasin
(
this
.
_selectedItem
)
);
}
public
onMoveBasinDownClick
()
{
if
(
this
.
_selectedItem
instanceof
PbBassin
)
{
this
.
model
.
moveBasin
(
this
.
_selectedItem
.
uid
,
this
.
findBasinPosition
(
this
.
_selectedItem
)
+
1
);
this
.
model
.
moveBasin
(
this
.
_selectedItem
.
uid
,
this
.
model
.
findBasinPosition
(
this
.
_selectedItem
.
uid
)
+
1
);
}
const
basin
=
this
.
_selectedItem
;
this
.
unselect
();
...
...
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