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
c6b1c461
Commit
c6b1c461
authored
4 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
[WIP] PbCloison form
parent
1bb75ca7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/formulaire/definition/form-prebarrage.ts
+19
-1
19 additions, 1 deletion
src/app/formulaire/definition/form-prebarrage.ts
src/app/formulaire/elements/select-field.ts
+7
-3
7 additions, 3 deletions
src/app/formulaire/elements/select-field.ts
with
26 additions
and
4 deletions
src/app/formulaire/definition/form-prebarrage.ts
+
19
−
1
View file @
c6b1c461
...
...
@@ -5,6 +5,7 @@ import { PbSchema } from "../elements/pb-schema";
import
{
FormulaireDefinition
}
from
"
./form-definition
"
;
import
{
ServiceFactory
}
from
"
../../services/service-factory
"
;
import
{
FormulairePbCloison
}
from
"
./form-pb-cloison
"
;
import
{
FieldsetContainer
}
from
"
../elements/fieldset-container
"
;
/**
* Formulaire pour les PréBarrage
...
...
@@ -100,12 +101,29 @@ export class FormulairePrebarrage extends FormulaireFixedVar {
this
.
showFormElements
(
this
.
basinForm
);
}
else
if
(
node
instanceof
PbCloison
)
{
console
.
log
(
"
---------------> new wall form !!
"
);
this
.
wallForm
=
new
FormulairePbCloison
();
this
.
wallForm
.
defaultProperties
[
"
calcType
"
]
=
CalculatorType
.
PbCloison
;
this
.
wallForm
.
currentNub
=
node
;
this
.
wallForm
.
preparseConfig
(
this
.
wallFormConfig
);
this
.
wallForm
.
parseConfig
(
this
.
wallFormConfig
);
this
.
wallForm
.
addObserver
(
this
);
// subscribe to upstream/downstream basin change
// add fieldsets for existing Structures
console
.
log
(
`Node
${
node
.
uid
}
:
${
node
.
structures
.
length
}
structures, Form
${
this
.
uid
}
:
${
this
.
_kids
.
length
}
form elements`
);
if
(
node
.
structures
.
length
>
0
)
{
console
.
log
(
"
>> adding fieldsets for existing structures
"
);
for
(
const
struct
of
node
.
structures
)
{
for
(
const
e
of
this
.
allFormElements
)
{
if
(
e
instanceof
FieldsetContainer
)
{
// @TODO manage many containers one day ?
e
.
addFromTemplate
(
0
,
undefined
,
struct
);
}
}
}
}
else
{
// if there was no existing structure, add a default one ! @TODO
console
.
log
(
"
TODO add default structure
"
);
}
// subscribe to upstream/downstream basin change
this
.
wallForm
.
addObserver
(
this
);
ServiceFactory
.
instance
.
formulaireService
.
loadUpdateFormulaireLocalisation
(
this
.
wallForm
);
this
.
showFormElements
(
this
.
wallForm
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/formulaire/elements/select-field.ts
+
7
−
3
View file @
c6b1c461
...
...
@@ -5,7 +5,8 @@ import {
StructureType
,
LoiDebit
,
Session
,
Solveur
Solveur
,
StructureProperties
}
from
"
jalhyd
"
;
import
{
Field
}
from
"
./field
"
;
...
...
@@ -192,9 +193,12 @@ export class SelectField extends Field {
case
"
device_loi_debit
"
:
// get current structure type from appropriate Nub child
const
child
=
nub
.
getChildren
()[
this
.
parent
.
indexAsKid
()];
const
cst
=
child
.
properties
.
getPropValue
(
"
structureType
"
);
const
la
=
(
nub
as
ParallelStructure
).
getLoisAdmissibles
();
const
stName
=
StructureType
[
cst
];
const
loiDebit
=
child
.
properties
.
getPropValue
(
"
loiDebit
"
);
const
stCode
=
StructureProperties
.
findCompatibleStructure
(
loiDebit
,
nub
as
ParallelStructure
);
const
stName
=
StructureType
[
stCode
];
// console.log(`__device_loi_debit__ : child=${child.constructor.name}, loiDebit=${loiDebit}, stCode=${stCode}, stName=${stName}`);
// console.log("(child.properties)", child.properties.props);
for
(
const
ld
of
la
[
stName
])
{
const
e
:
SelectEntry
=
new
SelectEntry
(
this
.
_entriesBaseId
+
LoiDebit
[
ld
],
ld
);
this
.
addEntry
(
e
);
...
...
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