@@ -27,17 +27,17 @@ if {[GidUtils::VersionCmp "14.0.1"] >=0 } {
2727 }
2828 }
2929} {
30- # GiD versions previous to 14 are no longer allowed
30+ # GiD versions previous to 15 are no longer allowed
3131 # As we dont register the event InitProblemtype, the rest of events are also unregistered
3232 # So no chance to open anything in GiD 13.x or earlier
33- WarnWin " The minimum GiD Version for Kratos is 14 or later \n Update at gidhome.com"
33+ WarnWin " The minimum GiD Version for Kratos is 15 or later \n Update at gidhome.com"
3434}
3535
3636proc Kratos::Events { } {
3737 variable kratos_private
3838
3939 # Recommended GiD Version is the latest developer always
40- if {[GidUtils::VersionCmp " 14.1.4d " ] <0 } {
40+ if {[GidUtils::VersionCmp " 15.0.0 " ] <0 } {
4141 set dir [file dirname [info script]]
4242 uplevel #0 [list source [file join $kratos_private(Path) scripts DeprecatedEvents.tcl]]
4343 Kratos::ModifyPreferencesWindowOld
@@ -66,6 +66,7 @@ proc Kratos::RegisterGiDEvents { } {
6666 # Write - Calculation
6767 GiD_RegisterEvent GiD_Event_AfterWriteCalculationFile Kratos::Event_AfterWriteCalculationFile PROBLEMTYPE Kratos
6868 GiD_RegisterEvent GiD_Event_BeforeRunCalculation Kratos::Event_BeforeRunCalculation PROBLEMTYPE Kratos
69+ GiD_RegisterEvent GiD_Event_SelectGIDBatFile Kratos::Event_SelectGIDBatFile PROBLEMTYPE Kratos
6970
7071 # Postprocess
7172 GiD_RegisterEvent GiD_Event_InitGIDPostProcess Kratos::Event_InitGIDPostProcess PROBLEMTYPE Kratos
@@ -83,7 +84,7 @@ proc Kratos::RegisterGiDEvents { } {
8384
8485 # Preferences window
8586 GiD_RegisterPluginPreferencesProc Kratos::Event_ModifyPreferencesWindow
86- if {[GidUtils::VersionCmp " 15.0.0 " ] >=0 } { CreateWidgetsFromXml::ClearCachePreferences}
87+ CreateWidgetsFromXml::ClearCachePreferences
8788}
8889
8990proc Kratos::Event_InitProblemtype { dir } {
@@ -127,6 +128,8 @@ proc Kratos::Event_InitProblemtype { dir } {
127128 # open a window to allow the user select the app
128129 after 500 [list spdAux::CreateWindow]
129130 }
131+
132+ Kratos::CheckDependencies
130133}
131134
132135proc Kratos::InitGlobalVariables {dir} {
@@ -196,26 +199,26 @@ proc Kratos::LoadCommonScripts { } {
196199 }
197200
198201 # Writing common scripts
199- foreach filename {Writing.tcl WriteHeadings.tcl WriteMaterials.tcl WriteNodes.tcl
200- WriteElements.tcl WriteConditions.tcl WriteConditionsByGiDId.tcl WriteConditionsByUniqueId.tcl
201- WriteProjectParameters.tcl WriteSubModelPart.tcl WriteProcess.tcl } {
202- uplevel #0 [list source [file join $kratos_private(Path) scripts Writing $filename ]]
202+ foreach filename {Writing WriteHeadings WriteMaterials WriteNodes
203+ WriteElements WriteConditions WriteConditionsByGiDId WriteConditionsByUniqueId
204+ WriteProjectParameters WriteSubModelPart WriteProcess} {
205+ uplevel #0 [list source [file join $kratos_private(Path) scripts Writing $filename .tcl ]]
203206 }
204207 # Common scripts
205- foreach filename {Utils.tcl Applications.tcl spdAuxiliar.tcl Menus.tcl Deprecated.tcl Logs.tcl } {
206- uplevel #0 [list source [file join $kratos_private(Path) scripts $filename ]]
208+ foreach filename {Utils Launch Applications spdAuxiliar Menus Deprecated Logs} {
209+ uplevel #0 [list source [file join $kratos_private(Path) scripts $filename .tcl ]]
207210 }
208211 # Common controllers
209- foreach filename {ApplicationMarketWindow.tcl ExamplesWindow.tcl CommonProcs.tcl PreferencesWindow.tcl TreeInjections.tcl MdpaImportMesh.tcl Drawer.tcl ImportFiles.tcl } {
210- uplevel #0 [list source [file join $kratos_private(Path) scripts Controllers $filename ]]
212+ foreach filename {ApplicationMarketWindow ExamplesWindow CommonProcs PreferencesWindow TreeInjections MdpaImportMesh Drawer ImportFiles} {
213+ uplevel #0 [list source [file join $kratos_private(Path) scripts Controllers $filename .tcl ]]
211214 }
212215 # Model class
213- foreach filename {Model.tcl Entity.tcl Parameter.tcl Topology.tcl Solver.tcl ConstitutiveLaw.tcl Condition.tcl Element.tcl Material.tcl SolutionStrategy.tcl Process.tcl } {
214- uplevel #0 [list source [file join $kratos_private(Path) scripts Model $filename ]]
216+ foreach filename {Model Entity Parameter Topology Solver ConstitutiveLaw Condition Element Material SolutionStrategy Process} {
217+ uplevel #0 [list source [file join $kratos_private(Path) scripts Model $filename .tcl ]]
215218 }
216219 # Libs
217- foreach filename {SimpleXMLViewer.tcl } {
218- uplevel #0 [list source [file join $kratos_private(Path) libs $filename ]]
220+ foreach filename {SimpleXMLViewer} {
221+ uplevel #0 [list source [file join $kratos_private(Path) libs $filename .tcl ]]
219222 }
220223}
221224
@@ -494,9 +497,12 @@ proc Kratos::Event_BeforeRunCalculation { batfilename basename dir problemtypedi
494497 set app_run_brake [apps::ExecuteOnCurrentApp BreakRunCalculation]
495498 if {[write::isBooleanTrue $app_run_brake ]} {return " -cancel-" }
496499
500+ }
501+
502+ proc Kratos::Event_SelectGIDBatFile { dir basename } {
497503 if {[info exists Kratos::kratos_private(launch_configuration)]} {
498- set launch_type $Kratos::kratos_private(launch_configuration)
499- W $launch_type
504+ set launch_mode $Kratos::kratos_private(launch_configuration)
505+ return [Kratos::ExecuteLaunchByMode $launch_mode ]
500506 }
501507}
502508
0 commit comments