Skip to content

Commit 3af202b

Browse files
Merge pull request #838 from KratosMultiphysics/add-files-handler
Add new file handler
2 parents da7950f + 2feb110 commit 3af202b

16 files changed

Lines changed: 389 additions & 217 deletions

File tree

kratos.gid/apps/Dam/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"open_tree": true,
2727
"show_toolbar": true,
2828
"intervals": true,
29-
"wizard": false
29+
"wizard": false,
30+
"import_files":true
3031
},
3132
"unique_names": {
3233
"parts": "DamParts",

kratos.gid/apps/PfemThermic/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"open_tree": true,
3131
"show_toolbar": true,
3232
"intervals": true,
33-
"wizard": false
33+
"wizard": false,
34+
"import_files":true
3435
},
3536
"unique_names": {
3637
"nodal_conditions": "PFEMFLUID_NodalConditions",

kratos.gid/apps/Structural/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"open_tree": true,
3030
"show_toolbar": true,
3131
"intervals": true,
32-
"wizard": false
32+
"wizard": false,
33+
"import_files":true
3334
},
3435
"unique_names": {
3536
"parts": "STParts",

kratos.gid/images/files.png

2.04 KB
Loading

kratos.gid/kratos.tcl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ proc Kratos::LoadCommonScripts { } {
181181
if { [lsearch -exact $::auto_path [file join $kratos_private(Path) scripts]] == -1 } {
182182
lappend ::auto_path [file join $kratos_private(Path) scripts]
183183
}
184+
if { [lsearch -exact $::auto_path [file join $kratos_private(Path) libs]] == -1 } {
185+
lappend ::auto_path [file join $kratos_private(Path) libs]
186+
}
184187

185188
# Writing common scripts
186189
foreach filename {Writing.tcl WriteHeadings.tcl WriteMaterials.tcl WriteNodes.tcl
@@ -193,15 +196,15 @@ proc Kratos::LoadCommonScripts { } {
193196
uplevel #0 [list source [file join $kratos_private(Path) scripts $filename]]
194197
}
195198
# Common controllers
196-
foreach filename {ApplicationMarketWindow.tcl ExamplesWindow.tcl CommonProcs.tcl PreferencesWindow.tcl TreeInjections.tcl MdpaImportMesh.tcl Drawer.tcl} {
199+
foreach filename {ApplicationMarketWindow.tcl ExamplesWindow.tcl CommonProcs.tcl PreferencesWindow.tcl TreeInjections.tcl MdpaImportMesh.tcl Drawer.tcl ImportFiles.tcl} {
197200
uplevel #0 [list source [file join $kratos_private(Path) scripts Controllers $filename]]
198201
}
199202
# Model class
200203
foreach filename {Model.tcl Entity.tcl Parameter.tcl Topology.tcl Solver.tcl ConstitutiveLaw.tcl Condition.tcl Element.tcl Material.tcl SolutionStrategy.tcl Process.tcl} {
201204
uplevel #0 [list source [file join $kratos_private(Path) scripts Model $filename]]
202205
}
203206
# Libs
204-
foreach filename {SimpleXMLViewer.tcl FileManager.tcl } {
207+
foreach filename {SimpleXMLViewer.tcl} {
205208
uplevel #0 [list source [file join $kratos_private(Path) libs $filename]]
206209
}
207210
}
@@ -343,6 +346,13 @@ proc Kratos::LoadWizardFiles { } {
343346
package require gid_smart_wizard
344347
Kratos::UpdateMenus
345348
}
349+
proc Kratos::LoadImportFiles { } {
350+
variable kratos_private
351+
# Load the wizard package
352+
set kratos_private(UseFiles) 1
353+
package require gid_pt_file_manager
354+
Kratos::UpdateMenus
355+
}
346356

347357
proc Kratos::TransformProblemtype {old_dom old_filespd} {
348358
# Check if current problemtype allows transforms

kratos.gid/kratos_default.spd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@
317317
</proc>
318318
<proc n='GetFilesValues' args='args'>
319319
<![CDATA[
320-
return [spdAux::ProcGetFilesValues]
320+
return [spdAux::ProcGetFilesValues $domNode]
321321
]]>
322322
</proc>
323323

kratos.gid/libs/FileManager.tcl

Lines changed: 0 additions & 173 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 GiD
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# gid-pt-file-manager

0 commit comments

Comments
 (0)