Skip to content

Commit de5bfad

Browse files
committed
Fixing multiple problems
1 parent 3eb77cb commit de5bfad

5 files changed

Lines changed: 68 additions & 20 deletions

File tree

‎public/js/extensions/draw_widget.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,11 @@ LGraphCanvas.prototype.drawNodeWidgets = function(
344344
var mouse_pos = this.graph_mouse;
345345
var node_pos = node.pos;
346346

347-
if (w.tooltip && mouse_pos[0] > node_pos[0] + margin && mouse_pos[0] < node_pos[0] + widget_width - margin && mouse_pos[1] > node_pos[1] + y && mouse_pos[1] < node_pos[1] + y + H) {
347+
if (node.is_selected && w.tooltip
348+
&& mouse_pos[0] > node_pos[0] + margin
349+
&& mouse_pos[0] < node_pos[0] + widget_width - margin
350+
&& mouse_pos[1] > node_pos[1] + y
351+
&& mouse_pos[1] < node_pos[1] + y + H ) {
348352
this.drawNodewidgetTooltip(node, ctx, w, y, H);
349353
}
350354

‎public/js/nodes/analysis_stages/base/analysis_stage.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ LGraphCanvas.slot_type_colors["stage_flow"] = "#90bdd1";
131131
LGraphCanvas.slot_type_colorsOff["stage_flow"] = "#90bdd1";
132132

133133
// Register default i/o
134-
register_default_in_type("problem_data", "Stages/Problem Data");
135-
register_default_in_type("stage_flow", "Stages/AnalysisStage");
136-
register_default_out_type("stage_flow", "Stages/AnalysisStage");
134+
register_default_in_type("problem_data", "Analysis stages/Components/Problem Data");
135+
register_default_in_type("stage_flow", "Analysis stages/Base/AnalysisStage");
136+
register_default_out_type("stage_flow", "Analysis stages/Base/AnalysisStage");
137137

138138
// Register in the system
139139
LiteGraph.registerNodeType("Analysis stages/Base/AnalysisStage", AnalysisStage);

‎public/js/nodes/lists/list_of_processes.js‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,28 @@ class ProcessesList extends InputList {
2121
});
2222

2323
this.process_list.tooltip = (w) => {
24-
25-
let tooltip = [
26-
`${w.name}`, "", `${w.value}`, "",
27-
"Selects the process list where the ", "process will be assigned",
28-
];
29-
3024
let help_tooltip = {
3125
"title": `${w.name}`,
3226
"value": `${w.value}`,
3327
"descp": [
3428
"Selects the process list where the process will be assigned",
35-
"depending on the ascending house of mars",
36-
"the solver may refuse to work until you perform",
37-
"a sacrifice of blood to the god of war"
3829
],
3930
}
4031

4132
return help_tooltip;
4233
}
4334

44-
// this.scaling_type.tooltip = (w) => {
45-
// return [w.value];
46-
// }
35+
this.scaling_type.tooltip = (w) => {
36+
let help_tooltip = {
37+
"title": `${w.name}`,
38+
"value": `${w.value}`,
39+
"descp": [
40+
"Toggles a switch controling if the process list will be used as a group or not",
41+
],
42+
}
43+
44+
return help_tooltip;
45+
}
4746
}
4847

4948
setIOType() {
@@ -58,6 +57,8 @@ class ProcessesList extends InputList {
5857
}
5958

6059
ProcessesList.title = "List of Processes";
60+
ProcessesList.doc_ref = "https://kratosmultiphysics.github.io/Kratos/pages/Kratos/Processes/process.html"
6161
ProcessesList.desc = "Merges several processes into a list";
62+
ProcessesList.doc = `<span class='glyph-solid'>&#xf02d</span> <a href="${ProcessesList.doc_ref}">Process</a>`;
6263

6364
LiteGraph.registerNodeType("Lists/Processes", ProcessesList);

‎public/js/nodes/processes/fluid_dynamics/apply_inlet_process.js‎

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,49 @@ class ApplyInletProcess extends Process {
77
this.addInput("model_part","string");
88
this.addOutput("Process","process_list");
99

10-
this.variable_name = this.addWidget("string","Variable=", "VELOCITY", function(v){} );
11-
this.modulus = this.addWidget("string","f(x,y,z,t)=", "", function(v){} );
12-
this.direction = this.addWidget("string","Direction=", "automatic_inwards_normal", function(v){} );
10+
this.variable_name = this.addWidget("string","Variable", "VELOCITY", function(v){} );
11+
this.modulus = this.addWidget("string","Modulus", "", function(v){} );
12+
this.direction = this.addWidget("string","Direction", "automatic_inwards_normal", function(v){} );
13+
14+
this.variable_name.tooltip = (w) => {
15+
let help_tooltip = {
16+
"title": `${w.name}`,
17+
"value": `${w.value}`,
18+
"descp": [
19+
"Name of the target variable of the process.",
20+
],
21+
}
22+
23+
return help_tooltip;
24+
}
25+
26+
this.modulus.tooltip = (w) => {
27+
let help_tooltip = {
28+
"title": `${w.name}`,
29+
"value": `${w.value}`,
30+
"descp": [
31+
"Modulus of the value that will be assigned to the targeted variable",
32+
"Can be assigned as a number or function of x,y,z and t",
33+
],
34+
}
35+
36+
return help_tooltip;
37+
}
38+
39+
this.direction.tooltip = (w) => {
40+
let help_tooltip = {
41+
"title": `${w.name}`,
42+
"value": `${w.value}`,
43+
"descp": [
44+
"Defines the direction of the variable. It can be assigned as",
45+
"a vector or using one of the following predefined strings:",
46+
"\t - automatic_inwards_normal",
47+
"\t - automatic_outwards_normal"
48+
],
49+
}
50+
51+
return help_tooltip;
52+
}
1353

1454
this.properties = {
1555
"interval" : [0, 1e30]
@@ -35,8 +75,11 @@ class ApplyInletProcess extends Process {
3575
};
3676
}
3777

78+
// Set the node name and the description
3879
ApplyInletProcess.title = "Apply inlet process";
80+
ApplyInletProcess.doc_ref = "https://kratosmultiphysics.github.io/Kratos/pages/Kratos/Processes/General/AnalysisStage.html"
3981
ApplyInletProcess.desc = "Define inlet.";
82+
ApplyInletProcess.doc = `<span class='glyph-solid'>&#xf02d</span> <a href="${ApplyInletProcess.doc_ref}">Apply Inlet Process</a>`;
4083

4184
LiteGraph.registerNodeType("Processes/Fluid dynamics/ApplyInletProcess", ApplyInletProcess);
4285

‎public/js/nodes/utilities/process_parser.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Object.entries(processes).forEach(([key, value]) => {
9393
processClass.title = titleCaseProcess(`${key}`);
9494
processClass.desc = `${value['help']}`;
9595

96-
LiteGraph.registerNodeType(`PROCESS/${key}`, processClass);
96+
LiteGraph.registerNodeType(`Processes/${key}`, processClass);
9797

9898
console.log(`${key} created`); //helps to debug
9999
})

0 commit comments

Comments
 (0)