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
f7dbfb69
Commit
f7dbfb69
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
refactor: PAB: optimise table space by moving up values of the basin section (length, width, ZRMB)
refs
#607
parent
6610d19f
No related branches found
No related tags found
2 merge requests
!225
Release v4.17.0
,
!207
Draft: Resolve "PAB : optimiser l'espace occupé par le tableau de la géométrie de la passe"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/pab-table/pab-table.component.ts
+50
-81
50 additions, 81 deletions
src/app/components/pab-table/pab-table.component.ts
with
50 additions
and
81 deletions
src/app/components/pab-table/pab-table.component.ts
+
50
−
81
View file @
f7dbfb69
...
...
@@ -540,58 +540,58 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni
for
(
const
cloison
of
this
.
model
.
children
)
{
// as much rows as the greatest number of parameters among its devices
const
maxNbParams
=
this
.
findMaxNumberOfDeviceParameters
(
cloison
);
for
(
let
i
=
0
;
i
<
maxNbParams
;
i
++
)
{
for
(
let
r
=
0
;
r
<
maxNbParams
;
r
++
)
{
// build device params row
const
deviceParamRow
=
{
selectable
:
cloison
,
cells
:
[]
};
// basin number and ZRAM
if
(
i
===
0
)
{
// basin number
, LB, BB, ZRMB
and ZRAM
if
(
r
===
0
)
{
// basin number
deviceParamRow
.
cells
.
push
({
value
:
childIndex
+
1
,
rowspan
:
maxNbParams
+
1
,
rowspan
:
maxNbParams
,
class
:
"
basin_number
"
,
selectable
:
cloison
});
// 3 empty cells
deviceParamRow
.
cells
.
push
({
colspan
:
3
,
rowspan
:
maxNbParams
-
1
,
selectable
:
cloison
});
// ZRAM
deviceParamRow
.
cells
.
push
({
model
:
cloison
.
prms
.
ZRAM
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
ZRAM
"
)
});
}
// basin cells on the last but 1 row
if
(
i
===
maxNbParams
-
1
)
{
// Longueur bassin
deviceParamRow
.
cells
.
push
({
model
:
cloison
.
prms
.
LB
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
LB
"
)
});
// Largeur bassin
deviceParamRow
.
cells
.
push
({
model
:
cloison
.
prms
.
BB
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
BB
"
)
});
// Cote radier mi bassin
deviceParamRow
.
cells
.
push
({
model
:
cloison
.
prms
.
ZRMB
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
ZRMB
"
)
});
// ZRAM
deviceParamRow
.
cells
.
push
({
model
:
cloison
.
prms
.
ZRAM
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
ZRAM
"
)
});
}
// 1 empty cell below ZRAM
if
(
i
===
1
)
{
else
if
(
r
===
1
)
{
// 1 row for QA editor
const
qaParam
=
new
NgParameter
(
cloison
.
prms
.
QA
,
this
.
pabTable
.
form
);
qaParam
.
radioConfig
=
ParamRadioConfig
.
VAR
;
deviceParamRow
.
cells
.
push
({
rowspan
:
maxNbParams
,
selectable
:
cloison
model
:
qaParam
,
colspan
:
4
,
rowspan
:
maxNbParams
-
1
,
qa
:
true
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
QA
"
)
});
}
// device param cells : 3 cells for each device
for
(
const
ouvrage
of
cloison
.
structures
)
{
const
nvParam
=
ouvrage
.
getNthVisibleParam
(
i
);
const
nvParam
=
ouvrage
.
getNthVisibleParam
(
r
);
const
nvParamTitle
=
nvParam
?
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
nvParam
.
symbol
)
:
""
;
const
childStructParamCount
=
this
.
nubVisibleParameterCount
(
ouvrage
);
// cell 1 : device type
if
(
i
===
0
)
{
// 1st row
if
(
r
===
0
)
{
// 1st row
deviceParamRow
.
cells
.
push
({
model
:
ouvrage
,
modelValue
:
ouvrage
.
getPropValue
(
"
loiDebit
"
),
...
...
@@ -600,75 +600,42 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni
});
}
// fill space below device type selector
if
(
i
===
1
)
{
else
if
(
r
===
1
)
{
deviceParamRow
.
cells
.
push
({
rowspan
:
(
maxNbParams
-
1
),
selectable
:
ouvrage
});
}
// cell 2 : param name
if
(
nvParam
)
{
// cell 2 : param name
deviceParamRow
.
cells
.
push
({
value
:
nvParam
.
symbol
,
title
:
nvParamTitle
,
selectable
:
ouvrage
});
}
else
{
deviceParamRow
.
cells
.
push
({
selectable
:
ouvrage
});
}
// cell 3 : param value
if
(
nvParam
)
{
// cell 3 : param value
deviceParamRow
.
cells
.
push
({
model
:
nvParam
,
title
:
nvParamTitle
,
selectable
:
ouvrage
});
}
else
{
deviceParamRow
.
cells
.
push
({
selectable
:
ouvrage
});
}
}
// fill horizontal space
const
devDiff
=
(
maxNbDevices
-
cloison
.
structures
.
length
);
if
(
i
===
0
)
{
for
(
let
j
=
0
;
j
<
devDiff
;
j
++
)
{
deviceParamRow
.
cells
.
push
({
colspan
:
3
,
rowspan
:
maxNbParams
,
selectable
:
cloison
,
selectableColumn
:
cloison
.
structures
.
length
+
j
});
else
if
(
r
===
childStructParamCount
)
{
// fill remaining space
const
remaining
=
maxNbParams
-
childStructParamCount
;
if
(
remaining
>
0
)
{
deviceParamRow
.
cells
.
push
({
colspan
:
2
,
rowspan
:
remaining
,
selectable
:
cloison
});
}
}
}
// done !
this
.
rows
.
push
(
deviceParamRow
);
}
// 1 row for QA editor
const
qaParam
=
new
NgParameter
(
cloison
.
prms
.
QA
,
this
.
pabTable
.
form
);
qaParam
.
radioConfig
=
ParamRadioConfig
.
VAR
;
const
qaRow
:
{
selectable
:
any
,
cells
:
any
[]
}
=
{
selectable
:
undefined
,
cells
:
[
{
model
:
qaParam
,
colspan
:
3
,
qa
:
true
,
title
:
this
.
formService
.
expandVariableNameAndUnit
(
CalculatorType
.
Pab
,
"
QA
"
)
}
]
};
// as many pairs of columns as the maximum number of devices
qaRow
.
cells
.
push
({
colspan
:
maxNbDevices
*
3
,
// selectable: cloison @TODO oui ou non ?
});
// done !
this
.
rows
.
push
(
qaRow
);
childIndex
++
;
childIndex
++
;
}
// B.2 many rows for downwall
...
...
@@ -790,18 +757,20 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni
return
maxNbDevices
;
}
private
nubVisibleParameterCount
(
n
:
Nub
)
{
let
res
=
0
;
for
(
const
p
of
n
.
parameterIterator
)
{
if
(
p
.
visible
)
{
res
++
;
}
}
return
res
;
}
private
findMaxNumberOfDeviceParameters
(
struct
:
ParallelStructure
):
number
{
let
maxNbParams
=
1
;
for
(
const
d
of
struct
.
getChildren
())
{
let
nbParams
=
0
;
for
(
const
p
of
d
.
parameterIterator
)
{
if
(
p
.
visible
)
{
// console.log("(counting)", p.symbol);
nbParams
++
;
}
}
// console.log(">>> child params: ", nbParams);
maxNbParams
=
Math
.
max
(
maxNbParams
,
nbParams
);
for
(
const
child
of
struct
.
getChildren
())
{
maxNbParams
=
Math
.
max
(
maxNbParams
,
this
.
nubVisibleParameterCount
(
child
));
}
return
maxNbParams
;
}
...
...
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