Changeset 6690


Ignore:
Timestamp:
Feb 14, 2018 1:55:36 PM (6 years ago)
Author:
clarksm
Message:

Pass structure.current.components and structure.current.fields
from input driver file to executed driver file when doing
rappture -execute or using TOOL_PARAMETERS with file(execute).
components and fields have no current child but the information
may still be required for simulation.

Location:
branches/1.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.7/gui/apps/execute.tcl

    r5850 r6690  
    7878set installdir [file dirname [file normalize $toolxml]]
    7979set toolobj [Rappture::library $toolxml]
     80
     81# copy structure.current.fields and structure.current.components
     82foreach path [Rappture::entities -as path $driverobj input] {
     83    if {[$driverobj element -as type $path.current] eq ""} {
     84        $toolobj copy $path from $driverobj $path
     85    }
     86}
     87
    8088set TaskObj [Rappture::Task ::#auto $toolobj $installdir]
    8189set LogFid ""
     
    151159foreach path [Rappture::entities -as path $driverobj input] {
    152160    if {[$driverobj element -as type $path.current] ne ""} {
    153         lappend args $path [$driverobj get $path.current]
     161        set currentVal [$driverobj get $path.current]
     162# do not replace empty paths - in particular structures
     163        if {$currentVal ne {}} {
     164            lappend args $path $currentVal
     165        }
    154166    }
    155167}
  • branches/1.7/lang/tcl/scripts/library.tcl

    r6308 r6690  
    161161                        lappend queue $cpath.current.parameters
    162162                    }
     163                    if {[$xmlobj element $cpath.current.fields] != ""} {
     164                        lappend rlist $cpath.current.fields
     165                    }
     166                    if {[$xmlobj element $cpath.current.components] != ""} {
     167                        lappend rlist $cpath.current.components
     168                    }
    163169                }
    164170                drawing {
     
    185191                        lappend rlist [$xmlobj element -as $params(-as) $cpath]
    186192                    }
    187                 }
     193                }
    188194                default {
    189195                    if {[catch {Rappture::objects::get $type}] == 0} {
     
    528534    set string [string trim [$node text]]
    529535    if {$params(-decode)} {
    530         set string [Rappture::encoding::decode -- $string]
     536        set string [Rappture::encoding::decode -- $string]
    531537    }
    532538    return $string
     
    614620    if {[Rappture::library isvalid $str]} {
    615621        foreach n [[$str info variable _node -value] childNodes] {
    616             if { [$n nodeType] == "COMMENT_NODE" } {
    617                 continue
    618             }
     622            if { [$n nodeType] == "COMMENT_NODE" } {
     623                continue
     624            }
    619625            $node appendXML [$n asXML]
    620626        }
Note: See TracChangeset for help on using the changeset viewer.