Skip to content
Snippets Groups Projects
Commit 78de1b66 authored by mathias.chouet's avatar mathias.chouet
Browse files

Removed "nodeType" dependency system

parent 994f3176
No related branches found
No related tags found
1 merge request!53Resolve "Déplacer au maximum la configuration d'un module vers JaLHyd"
......@@ -64,44 +64,37 @@
{
"type": "input",
"id": "h1",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "L",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "Cd",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "S",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "alpha2",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "BT",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "ZT",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
}
]
},
......
......@@ -52,38 +52,32 @@
{
"type": "input",
"id": "ZDV",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "L",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "Cd",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "alpha2",
"unit": "°",
"nodeType": "StructureRectangle"
"unit": "°"
},
{
"type": "input",
"id": "BT",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "ZT",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
}
]
},
......
......@@ -45,80 +45,67 @@
{
"type": "input",
"id": "ZDV",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "L",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "W",
"nodeType": "StructureRectangle",
"unit": "m"
},
{
"type": "input",
"id": "CdWSL",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "CdWR",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "CdGR",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "CdT",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "alpha",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "beta",
"unit": "",
"nodeType": "StructureRectangle"
"unit": ""
},
{
"type": "input",
"id": "ZRAM",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "alpha2",
"unit": "°",
"nodeType": "StructureRectangle"
"unit": "°"
},
{
"type": "input",
"id": "BT",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
},
{
"type": "input",
"id": "ZT",
"unit": "m",
"nodeType": "StructureRectangle"
"unit": "m"
}
]
},
......
......@@ -12,38 +12,27 @@
{
"type": "input",
"id": "LargeurFond",
"nodeType": "SectionTrapeze",
"unit": "m"
},
{
"type": "input",
"id": "Fruit",
"nodeType": "SectionTrapeze",
"unit": "m/m"
},
{
"type": "input",
"id": "LargeurBerge",
"nodeType": "SectionRectangle",
"unit": "m"
},
{
"type": "input",
"id": "D",
"nodeType": "SectionCercle",
"unit": "m"
},
{
"type": "input",
"id": "k",
"nodeType": "SectionPuissance",
"unit": ""
},
{
"type": "input",
"id": "LargeurBerge",
"nodeType": "SectionPuissance",
"unit": "m"
}
]
},
......
......@@ -12,38 +12,27 @@
{
"type": "input",
"id": "LargeurFond",
"nodeType": "SectionTrapeze",
"unit": "m"
},
{
"type": "input",
"id": "Fruit",
"nodeType": "SectionTrapeze",
"unit": "m/m"
},
{
"type": "input",
"id": "LargeurBerge",
"nodeType": "SectionRectangle",
"unit": "m"
},
{
"type": "input",
"id": "D",
"nodeType": "SectionCercle",
"unit": "m"
},
{
"type": "input",
"id": "k",
"nodeType": "SectionPuissance",
"unit": ""
},
{
"type": "input",
"id": "LargeurBerge",
"nodeType": "SectionPuissance",
"unit": "m"
}
]
},
......
......@@ -11,39 +11,28 @@
},
{
"type": "input",
"id": "LargeurFond",
"unit": "m",
"nodeType": "SectionTrapeze"
"id": "LargeurBerge",
"unit": "m"
},
{
"type": "input",
"id": "Fruit",
"nodeType": "SectionTrapeze",
"unit": "m/m"
"id": "LargeurFond",
"unit": "m"
},
{
"type": "input",
"id": "LargeurBerge",
"unit": "m",
"nodeType": "SectionRectangle"
"id": "Fruit",
"unit": "m/m"
},
{
"type": "input",
"id": "D",
"unit": "m",
"nodeType": "SectionCercle"
"unit": "m"
},
{
"type": "input",
"id": "k",
"unit": "",
"nodeType": "SectionPuissance"
},
{
"type": "input",
"id": "LargeurBerge",
"unit": "m",
"nodeType": "SectionPuissance"
"unit": ""
}
]
},
......
......@@ -116,29 +116,16 @@ export class FieldSet extends FormulaireElement implements Observer {
*/
private parse_input(json: {}, default_radio_config: string): NgParameter {
const input_id: string = json["id"];
let res: NgParameter;
// @TODO tabarnak !?
const nt: string = json["nodeType"];
const nodeType: ComputeNodeType = nt ? ComputeNodeType[nt] : this.getPropValue("nodeType");
if (nodeType === this.getPropValue("nodeType")) { // si le nodeType du paramètre est le même que celui du fieldset
let nubParam: ParamDefinition;
try {
nubParam = this.getNubParamFromSymbol(input_id);
} catch (e) {
console.error(`FieldSet::parse_input : cannot find param from symbol ${input_id}`);
}
if (nubParam) {
res = new NgParameter(nubParam, this);
}
}
if (res) {
let nubParam: ParamDefinition;
try {
nubParam = this.getNubParamFromSymbol(input_id);
res = new NgParameter(nubParam, this);
res.parseConfig(json, { "radioConfig": default_radio_config });
} catch (e) {
// parameter does not exist in Nub, it's normal, simply do not show it (silent fail)
// console.error(`FieldSet::parse_input : cannot find param from symbol ${input_id}`);
}
return res;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment