Skip to content

Commit

Permalink
Merge pull request #973 from KratosMultiphysics/prepare-release
Browse files Browse the repository at this point in the history
Prepare release script
  • Loading branch information
jginternational authored May 31, 2024
2 parents 2212a37 + 15e9ec1 commit a89ec3b
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 205 deletions.
52 changes: 2 additions & 50 deletions kratos.gid/apps/DEMLauncher/start.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,7 @@ proc ::DemLauncher::Init { app } {

proc ::DemLauncher::AppSelectorWindow { } {
variable available_apps
set initwind $::spdAux::initwind

set root [customlib::GetBaseRoot]
set nd [ [$root selectNodes "value\[@n='nDim'\]"] getAttribute v]
if { $nd ne "undefined" } {
# if {[apps::getActiveAppId] eq "Fluid"} {
# spdAux::SwitchDimAndCreateWindow $nd
# }
} {
[$root selectNodes "value\[@n='nDim'\]"] setAttribute v wait

set initwind $::spdAux::application_window_id
spdAux::DestroyWindows
spdAux::RegisterWindow $initwind
set w $initwind

InitWindow $w [_ "DEM applications"] Kratos "" "" 1
set initwind $w
ttk::frame $w.top
ttk::label $w.top.title_text -text [_ "Select a DEM application"]

ttk::frame $w.applications -relief ridge
set i 0
foreach app $available_apps {
set img [::apps::getImgFrom $app]
set app_publicname [[::apps::getAppById $app] getPublicName]
set but [ttk::button $w.applications.img$app -image $img -command [list ::DemLauncher::ChangeAppTo $app] ]
bind $w.applications.img$app <Enter> {::spdAux::PlaceInformationWindowByPath %W applications}
ttk::label $w.applications.text$app -text $app_publicname
grid $w.applications.img$app -column $i -row 0
grid $w.applications.text$app -column $i -row 1
incr i
}
grid $w.top
grid $w.top.title_text

grid $w.applications

# Information panel
set spdAux::info_main_window_text ""
ttk::labelframe $w.info -text " Information " -relief ridge
ttk::label $w.info.text -textvariable spdAux::info_main_window_text
grid $w.info.text
grid $w.info -sticky we
}

spdAux::CreateLauncherWindow DemLauncher $available_apps
}

proc ::DemLauncher::ChangeAppTo {appid} {
spdAux::deactiveApp DemLauncher
spdAux::SetSpatialDimmension undefined
apps::setActiveApp $appid
}
54 changes: 1 addition & 53 deletions kratos.gid/apps/FluidLauncher/start.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,5 @@ proc ::FluidLauncher::Init { app } {
proc ::FluidLauncher::FluidAppSelectorWindow { } {
variable available_apps

set root [customlib::GetBaseRoot]
set nd [ [$root selectNodes "value\[@n='nDim'\]"] getAttribute v]
if { $nd ne "undefined" } {
if {[apps::getActiveAppId] eq "Fluid"} {
spdAux::SwitchDimAndCreateWindow $nd
}
} {
[$root selectNodes "value\[@n='nDim'\]"] setAttribute v wait

set initwind $::spdAux::application_window_id
spdAux::DestroyWindows
spdAux::RegisterWindow $initwind

set w $initwind

InitWindow $w [_ "Fluid applications"] Kratos "" "" 1
set initwind $w
ttk::frame $w.top
ttk::label $w.top.title_text -text [_ "Select a fluid application"]

ttk::frame $w.applications -relief ridge
set r 0
set c 0
set max_cols 3
foreach app $available_apps {
set img [::apps::getImgFrom $app]
set app_publicname [[::apps::getAppById $app] getPublicName]
set but [ttk::button $w.applications.img$app -image $img -command [list ::FluidLauncher::ChangeAppTo $app] ]
bind $w.applications.img$app <Enter> {::spdAux::PlaceInformationWindowByPath %W applications}
ttk::label $w.applications.text$app -text $app_publicname
grid $w.applications.img$app -column $r -row $c
grid $w.applications.text$app -column $r -row [expr $c + 1]
incr r
if {$r >= $max_cols} {incr c 2; set r 0}
}
grid $w.top
grid $w.top.title_text

grid $w.applications

# Information panel
set spdAux::info_main_window_text ""
ttk::labelframe $w.info -text " Information " -relief ridge
ttk::label $w.info.text -textvariable spdAux::info_main_window_text
grid $w.info.text
grid $w.info -sticky we
}
}

proc ::FluidLauncher::ChangeAppTo {appid} {
spdAux::deactiveApp FluidLauncher
spdAux::SetSpatialDimmension undefined
apps::setActiveApp $appid
spdAux::CreateLauncherWindow FluidLauncher $available_apps [_ "Fluid applications"] [_ "Select a fluid application"]
}
46 changes: 1 addition & 45 deletions kratos.gid/apps/PfemLauncher/start.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,5 @@ proc ::PfemLauncher::Init { app } {
proc ::PfemLauncher::AppSelectorWindow { } {
variable available_apps

set root [customlib::GetBaseRoot]
set nd [ [$root selectNodes "value\[@n='nDim'\]"] getAttribute v]
if { $nd eq "undefined" } {

[$root selectNodes "value\[@n='nDim'\]"] setAttribute v wait

set initwind $::spdAux::application_window_id
spdAux::DestroyWindows
spdAux::RegisterWindow $initwind

set w $initwind
InitWindow $w [_ "Pfem applications"] Kratos "" "" 1
set initwind $w
ttk::frame $w.top
ttk::label $w.top.title_text -text [_ "Select a pfem application"]

ttk::frame $w.applications -relief ridge
set i 0
foreach app $available_apps {
set img [::apps::getImgFrom $app]
set app_publicname [[::apps::getAppById $app] getPublicName]
set but [ttk::button $w.applications.img$app -image $img -command [list ::PfemLauncher::ChangeAppTo $app] ]
bind $w.applications.img$app <Enter> {::spdAux::PlaceInformationWindowByPath %W applications}
ttk::label $w.applications.text$app -text $app_publicname
grid $w.applications.img$app -column $i -row 0
grid $w.applications.text$app -column $i -row 1
incr i
}
grid $w.top
grid $w.top.title_text
grid $w.applications

# Information panel
set spdAux::info_main_window_text ""
ttk::labelframe $w.info -text " Information " -relief ridge
ttk::label $w.info.text -textvariable spdAux::info_main_window_text
grid $w.info.text
grid $w.info -sticky we
}
}

proc ::PfemLauncher::ChangeAppTo {appid} {
spdAux::deactiveApp PfemLauncher
spdAux::SetSpatialDimmension undefined
apps::setActiveApp $appid
spdAux::CreateLauncherWindow PfemLauncher $available_apps [_ "Pfem applications"] [_ "Select a Pfem application"]
}
51 changes: 1 addition & 50 deletions kratos.gid/apps/ThermicLauncher/start.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,5 @@ proc ::ThermicLauncher::Init { app } {
proc ::ThermicLauncher::AppSelectorWindow { } {
variable available_apps

set root [customlib::GetBaseRoot]
set nd [ [$root selectNodes "value\[@n='nDim'\]"] getAttribute v]
if { $nd ne "undefined" } {
# if {[apps::getActiveAppId] eq "Fluid"} {
# spdAux::SwitchDimAndCreateWindow $nd
# }
} {
[$root selectNodes "value\[@n='nDim'\]"] setAttribute v wait

set initwind $::spdAux::application_window_id
spdAux::DestroyWindows
spdAux::RegisterWindow $initwind
set w $initwind

InitWindow $w [_ "Thermic applications"] Kratos "" "" 1
set initwind $w
ttk::frame $w.top
ttk::label $w.top.title_text -text [_ "Select a Thermic application"]

ttk::frame $w.applications -relief ridge
set i 0
foreach app $available_apps {
set img [::apps::getImgFrom $app]
set app_publicname [[::apps::getAppById $app] getPublicName]
set but [ttk::button $w.applications.img$app -image $img -command [list ::ThermicLauncher::ChangeAppTo $app] ]
bind $w.applications.img$app <Enter> {::spdAux::PlaceInformationWindowByPath %W applications}
ttk::label $w.applications.text$app -text $app_publicname
grid $w.applications.img$app -column $i -row 0
grid $w.applications.text$app -column $i -row 1
incr i
}
grid $w.top
grid $w.top.title_text

grid $w.applications

# Information panel
set spdAux::info_main_window_text ""
ttk::labelframe $w.info -text " Information " -relief ridge
ttk::label $w.info.text -textvariable spdAux::info_main_window_text
grid $w.info.text
grid $w.info -sticky we

}
}

proc ::ThermicLauncher::ChangeAppTo {appid} {
spdAux::deactiveApp ThermicLauncher
spdAux::SetSpatialDimmension undefined
apps::setActiveApp $appid
spdAux::CreateLauncherWindow ThermicLauncher $available_apps [_ "Thermic applications"] [_ "Select a Thermic application"]
}
2 changes: 1 addition & 1 deletion kratos.gid/kratos.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ proc Kratos::Event_InitProblemtype { dir } {
set activeapp_dom [spdAux::SetActiveAppFromDOM]
if { $activeapp_dom == "" } {
#open a window to allow the user select the app
after 500 [list spdAux::CreateWindow]
after 500 [list spdAux::CreateInitialApplicationsWindow]
}

}
Expand Down
31 changes: 26 additions & 5 deletions kratos.gid/scripts/Applications.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ proc apps::getAppById { id } {
return $appR
}

proc apps::appExists {id} {
variable appList

if {[getAppById $id] eq ""} {
return 0
}

set dir [file join $::Kratos::kratos_private(Path) apps $id]
set app_definition_file [file join $dir app.json]
# if the directory does not exist, do not load the app
if {[file exists $dir]} {
if {[file exists $app_definition_file]} {
return 1
}
}
return 0
}

proc apps::NewApp {appid publicname prefix} {
variable appList
set ap [App new $appid]
Expand Down Expand Up @@ -305,11 +323,14 @@ oo::class create App {
proc apps::LoadAppProperties {app} {
set dir [file join $::Kratos::kratos_private(Path) apps [$app getName]]
set app_definition_file [file join $dir app.json]
if {[file exists $app_definition_file]} {
set props [Kratos::ReadJsonDict $app_definition_file]
$app setProperties $props
} else {
W "MISSING app.json file for app [$app getName]"
# if the directory does not exist, do not load the app
if {[file exists $dir]} {
if {[file exists $app_definition_file]} {
set props [Kratos::ReadJsonDict $app_definition_file]
$app setProperties $props
} else {
W "MISSING app.json file for app [$app getName]"
}
}
}

Expand Down
61 changes: 60 additions & 1 deletion kratos.gid/scripts/Controllers/ApplicationMarketWindow.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace eval ::spdAux {
set application_window_id .gid.win_app_selection
}

proc spdAux::CreateWindow {} {
proc spdAux::CreateInitialApplicationsWindow {} {
variable initwind
variable must_open_init_window
variable application_window_id
Expand Down Expand Up @@ -117,6 +117,65 @@ proc spdAux::CreateWindow {} {
grid $w.info -columnspan 5 -sticky we
}

proc spdAux::CreateLauncherWindow { current_launcher available_apps {window_text "Applications"} {action_text "Select an application"} } {
set initwind $::spdAux::initwind

set root [customlib::GetBaseRoot]
set nd [ [$root selectNodes "value\[@n='nDim'\]"] getAttribute v]
if { $nd ne "undefined" } {

} {
[$root selectNodes "value\[@n='nDim'\]"] setAttribute v wait

set initwind $::spdAux::application_window_id
spdAux::DestroyWindows
spdAux::RegisterWindow $initwind
set w $initwind

InitWindow $w $window_text Kratos "" "" 1
set initwind $w
ttk::frame $w.top
ttk::label $w.top.title_text -text $action_text
ttk::frame $w.applications -relief ridge
set i 0
set column 0
set row 0
foreach app $available_apps {
# check if app exists
if {![::apps::appExists $app]} {continue}
set img [::apps::getImgFrom $app]
set app_publicname [[::apps::getAppById $app] getPublicName]
set but [ttk::button $w.applications.img$app -image $img -command [list ::spdAux::ChangeAppTo $current_launcher $app] ]
bind $w.applications.img$app <Enter> {::spdAux::PlaceInformationWindowByPath %W applications}
ttk::label $w.applications.text$app -text $app_publicname
grid $w.applications.img$app -column $column -row $row
grid $w.applications.text$app -column $column -row [expr $row +1]
incr i
incr column
if {$column >= 5} {set column 0; incr row; incr row}
}
grid $w.top
grid $w.top.title_text

grid $w.applications

# Information panel
set spdAux::info_main_window_text ""
ttk::labelframe $w.info -text " Information " -relief ridge
ttk::label $w.info.text -textvariable spdAux::info_main_window_text
grid $w.info.text
grid $w.info -sticky we
}

}

proc spdAux::ChangeAppTo {current_launcher appid} {
spdAux::deactiveApp $current_launcher
spdAux::SetSpatialDimmension undefined
apps::setActiveApp $appid
}


proc spdAux::PlaceInformationWindowByPath {win_path what} {
variable application_window_id
set app_id [string trimleft $win_path $application_window_id.$what.img]
Expand Down
5 changes: 5 additions & 0 deletions tools/create-release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set VERSION=9.5.1
@REM set BRANCH=Release-%VERSION%
@REM git branch %BRANCH%
@REM git checkout %BRANCH%


@REM run python prepare-release-files.py
python prepare-release-files.py

cd ..
mkdir dist
set FOLDER=dist\kratos-%VERSION%
Expand Down
Loading

0 comments on commit a89ec3b

Please sign in to comment.