From b33a591d0d9b94b350bea22229f4727c8dee2930 Mon Sep 17 00:00:00 2001 From: Maxime Perrotin Date: Fri, 27 Sep 2019 14:32:09 +0200 Subject: [PATCH] Make concurrency view generation compatible with kazoo --- .../config/externalTools/concurrencyview.tcl | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/TASTE-linux/config/externalTools/concurrencyview.tcl b/TASTE-linux/config/externalTools/concurrencyview.tcl index 397dc85..ea41f6f 100755 --- a/TASTE-linux/config/externalTools/concurrencyview.tcl +++ b/TASTE-linux/config/externalTools/concurrencyview.tcl @@ -142,31 +142,41 @@ namespace eval concurrencyview { if { $res == 0 } { if { [file exists "ConcurrencyView/process.aadl" ] } { - File::delete "$cvFilename" - File::copy "ConcurrencyView/process.aadl" "$cvFilename" + File::delete "$cvFilename" + File::copy "ConcurrencyView/process.aadl" "$cvFilename" - set chan [open "$cvFilename" a+ ] - fconfigure $chan -translation lf - foreach threadFile [glob -nocomplain -type f -directory "ConcurrencyView" *_Thread.aadl ] { - set fin [ open $threadFile r ] - set content [read -nonewline $fin] - close $fin - puts $chan $content - puts $chan "\n\n" - } - set OCARINA_COMPONENTS "$tasteConfigDir/share/ocarina/AADLv2/ocarina_components.aadl" - set fin [ open $OCARINA_COMPONENTS r ] - set content [read -nonewline $fin] - close $fin - puts $chan $content - close $chan - - - ::API::HMI::loadUI "$cvFilename" "concurrencyview" - - return [list 0 ""] - + set chan [open "$cvFilename" a+ ] + fconfigure $chan -translation lf + foreach threadFile [glob -nocomplain -type f -directory "ConcurrencyView" *_Thread.aadl ] { + set fin [ open $threadFile r ] + set content [read -nonewline $fin] + close $fin + puts $chan $content + puts $chan "\n\n" + } + set OCARINA_COMPONENTS "$tasteConfigDir/share/ocarina/AADLv2/ocarina_components.aadl" + set fin [ open $OCARINA_COMPONENTS r ] + set content [read -nonewline $fin] + close $fin + puts $chan $content + close $chan + ::API::HMI::loadUI "$cvFilename" "concurrencyview" + return [list 0 ""] } + else if { [file exists "work/build/system.aadl" ] } { + File::delete "$cvFilename" + File::copy "work/build/system.aadl" "$cvFilename" + set chan [open "$cvFilename" a+ ] + fconfigure $chan -translation lf + set OCARINA_COMPONENTS "$tasteConfigDir/share/ocarina/AADLv2/ocarina_components.aadl" + set fin [ open $OCARINA_COMPONENTS r ] + set content [read -nonewline $fin] + close $fin + puts $chan $content + close $chan + ::API::HMI::loadUI "$cvFilename" "concurrencyview" + return [list 0 ""] + } } else { return [list 1 [list "taste-edit-concurrency-view error:\n$errMsg" ] ] } -- GitLab