Changeset 1217


Ignore:
Timestamp:
Nov 14, 2008 1:23:24 PM (15 years ago)
Author:
dkearney
Message:

adding ability to specify runfiles to be either loaded or included with the
results of the current simulation. loading a runfile will simply call the tool object's load function within analyzer and the runfile will be loaded as a previous simulation result. including a runfile involves copying the results (everything under output) from the runfile into the current run.xml file and all of the results are shown as one single simulation.

This behavior is demonstrated in the zoo's loadrun example.

Location:
trunk
Files:
7 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/analyzer.tcl

    r1208 r1217  
    429429    if {[$_tool xml get tool.analyzer] == "last"} {
    430430        clear
     431    }
     432
     433    # look for all output.load children and load them first
     434    # each run.xml is loaded as a previous simulation.
     435    foreach item [$xmlobj children -type run output.load] {
     436        set loadfile [$xmlobj get output.load.$item]
     437        set loadobj [Rappture::library $loadfile]
     438        load $loadobj
     439    }
     440
     441    foreach item [$xmlobj children -type run output.include] {
     442        set id [$xmlobj element -as id output.include.$item]
     443        set inclfile [$xmlobj get output.include.$item]
     444        set inclobj [Rappture::library $inclfile]
     445        foreach c [$inclobj children output] {
     446            switch -glob -- $c {
     447                # we don't want to include these tags
     448                include* - time* - status* - user* {
     449                    continue
     450                }
     451                default {
     452                    set oldid [$inclobj element -as id output.$c]
     453                    set oldtype [$inclobj element -as type output.$c]
     454                    set newcomp "$oldtype\($id-$oldid\)"
     455                    $xmlobj copy output.$newcomp from $inclobj output.$c
     456                }
     457            }
     458        }
    431459    }
    432460
Note: See TracChangeset for help on using the changeset viewer.