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
b087a84b
Commit
b087a84b
authored
5 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
Pab: changement de type d'ouvrages
parent
35dd5460
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!49
Resolve "Ajout du module de calcul d'une passe à bassins"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/pab-table/pab-table.component.html
+5
-6
5 additions, 6 deletions
src/app/components/pab-table/pab-table.component.html
src/app/components/pab-table/pab-table.component.ts
+38
-7
38 additions, 7 deletions
src/app/components/pab-table/pab-table.component.ts
with
43 additions
and
13 deletions
src/app/components/pab-table/pab-table.component.html
+
5
−
6
View file @
b087a84b
...
@@ -80,12 +80,11 @@
...
@@ -80,12 +80,11 @@
<input
matInput
*ngIf=
"isNumberInput(cell)"
type=
"number"
[(ngModel)]=
"cell.model.singleValue"
>
<input
matInput
*ngIf=
"isNumberInput(cell)"
type=
"number"
[(ngModel)]=
"cell.model.singleValue"
>
<mat-select
*ngIf=
"isSelect(cell)"
[(value)]=
"cell.model"
>
<mat-select
*ngIf=
"isSelect(cell)"
[value]=
"cell.modelValue"
<!-- <mat-option *ngFor="let opt of cell.options | keyvalue" [value]="l.key">
(selectionChange)=
"loiDebitSelected($event, cell)"
>
{{ l.value }}
</mat-option> -->
<mat-option
*ngFor=
"let opt of cell.options"
[value]=
"opt.value"
>
<mat-option
*ngFor=
"let opt of cell.options"
[value]=
"opt"
>
{{ opt.label }}
{{ opt }}
</mat-option>
</mat-option>
</mat-select>
</mat-select>
...
...
This diff is collapsed.
Click to expand it.
src/app/components/pab-table/pab-table.component.ts
+
38
−
7
View file @
b087a84b
...
@@ -10,7 +10,8 @@ import {
...
@@ -10,7 +10,8 @@ import {
Cloisons
,
Cloisons
,
Nub
,
Nub
,
Structure
,
Structure
,
ParallelStructure
ParallelStructure
,
LoiDebit
}
from
"
jalhyd
"
;
}
from
"
jalhyd
"
;
import
{
sprintf
}
from
"
sprintf-js
"
;
import
{
sprintf
}
from
"
sprintf-js
"
;
...
@@ -377,6 +378,13 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
...
@@ -377,6 +378,13 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
// B.1 many rows for each wall
// B.1 many rows for each wall
let
childIndex
=
0
;
let
childIndex
=
0
;
for
(
const
cloison
of
this
.
model
.
children
)
{
for
(
const
cloison
of
this
.
model
.
children
)
{
// admissible LoiDebit
const
loisCloisons
=
cloison
.
getLoisAdmissiblesArray
().
map
(
l
=>
{
// @TODO move up ? (same for all cloisons)
return
{
label
:
LoiDebit
[
l
],
value
:
l
};
});
// as much rows as the greatest number of parameters among its devices
// as much rows as the greatest number of parameters among its devices
const
maxNbParams
=
this
.
findMaxNumberOfDeviceParameters
(
cloison
);
const
maxNbParams
=
this
.
findMaxNumberOfDeviceParameters
(
cloison
);
// console.log(">>> max nb params: ", maxNbParams);
// console.log(">>> max nb params: ", maxNbParams);
...
@@ -406,9 +414,9 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
...
@@ -406,9 +414,9 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
// cell 1 : device type
// cell 1 : device type
if
(
i
===
0
)
{
// 1st row
if
(
i
===
0
)
{
// 1st row
deviceParamRow
.
cells
.
push
({
deviceParamRow
.
cells
.
push
({
model
:
ouvrage
.
properties
.
getPropValue
(
"
loiDebit
"
)
,
model
:
ouvrage
,
// options: StructureProperties.findCompatibleLoiDebit(ouvrage)
modelValue
:
ouvrage
.
properties
.
getPropValue
(
"
loiDebit
"
),
options
:
[
"
salut
"
,
"
coucou
"
,
"
pouet
"
]
,
options
:
loisCloisons
,
selectable
:
ouvrage
selectable
:
ouvrage
});
});
}
}
...
@@ -491,6 +499,13 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
...
@@ -491,6 +499,13 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
}
}
// B.2 many rows for downwall
// B.2 many rows for downwall
// admissible LoiDebit
const
loisAval
=
this
.
model
.
downWall
.
getLoisAdmissiblesArray
().
map
(
l
=>
{
return
{
label
:
LoiDebit
[
l
],
value
:
l
};
});
// as much rows as the greatest number of parameters among its devices
// as much rows as the greatest number of parameters among its devices
const
maxNbParamsDW
=
this
.
findMaxNumberOfDeviceParameters
(
this
.
model
.
downWall
);
const
maxNbParamsDW
=
this
.
findMaxNumberOfDeviceParameters
(
this
.
model
.
downWall
);
for
(
let
i
=
0
;
i
<
maxNbParamsDW
;
i
++
)
{
for
(
let
i
=
0
;
i
<
maxNbParamsDW
;
i
++
)
{
...
@@ -519,9 +534,9 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
...
@@ -519,9 +534,9 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
// cell 1 : device type
// cell 1 : device type
if
(
i
===
0
)
{
// 1st row
if
(
i
===
0
)
{
// 1st row
deviceParamRowDW
.
cells
.
push
({
deviceParamRowDW
.
cells
.
push
({
model
:
ouvrage
.
properties
.
getPropValue
(
"
loiDebit
"
)
,
model
:
ouvrage
,
// options: StructureProperties.findCompatibleLoiDebit(ouvrage)
modelValue
:
ouvrage
.
properties
.
getPropValue
(
"
loiDebit
"
),
options
:
[
"
salut
"
,
"
coucou
"
,
"
pouet
"
]
options
:
loisAval
});
});
}
}
// fill space
// fill space
...
@@ -841,6 +856,22 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
...
@@ -841,6 +856,22 @@ export class PabTableComponent implements /* DoCheck, AfterViewInit, */ OnInit {
this
.
refresh
();
this
.
refresh
();
}
}
/** Replace device Nub when LoiDebit is changed */
public
loiDebitSelected
(
$event
:
any
,
cell
:
any
)
{
const
device
=
cell
.
model
as
Nub
;
const
pos
=
device
.
findPositionInParent
();
// create new child device
const
newDevice
=
Session
.
getInstance
().
createNub
(
new
Props
({
calcType
:
CalculatorType
.
Structure
,
loiDebit
:
$event
.
value
})
);
// replace the current one
device
.
parent
.
replaceChildInplace
(
device
,
newDevice
);
this
.
refresh
();
}
// show modal dialog for values edition
// show modal dialog for values edition
public
showEditPab
()
{
public
showEditPab
()
{
if
(
this
.
selectedItems
.
length
>
0
)
{
if
(
this
.
selectedItems
.
length
>
0
)
{
...
...
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