Changeset 1174 for branches/sandbox


Ignore:
Timestamp:
Oct 24, 2011 11:06:34 PM (9 years ago)
Author:
toby
Message:

Revise routine for loading rbimport_*.tcl files; update MacroRecord? for parameters with lists as values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/rigid.tcl

    r1173 r1174  
    100100# Procedure to determine possible RB file formats available
    101101
     102set rbtypelist ""
    102103proc RB_Import_Data_Type {args} {
    103104    global expgui tcl_platform
    104105    # only needs to be done once
    105     set ::rbtypelist ""
    106 
    107     set files [glob -nocomplain [file join $expgui(scriptdir) rbimport_*.tcl]]
    108     foreach filetype $files {
    109           set temp [lindex [string map {_ " "} $filetype] 1]
    110           lappend ::rbtypelist $temp
    111     }
    112     if {$::rbtypelist == ""} {lappend ::rbtypelist "no rigid body file types available"}
    113     foreach filetype $::rbtypelist {
    114             source $::expgui(scriptdir)/rbimport_$filetype
    115     }
    116     return $::rbtypelist
     106    if {$::rbtypelist != ""} return
     107
     108    set ::rbtypelist [glob -nocomplain [file join $expgui(scriptdir) rbimport_*.tcl]]
     109    if {$::rbtypelist == ""} {
     110        MyMessageBox -parent . -title "Installation error" -icon warning \
     111            -message "No rigid body import routines were found.\nSomething is wrong with the EXPGUI installation"
     112        set ::rbtypelist " "
     113    }
     114    foreach file $::rbtypelist {
     115        source $file
     116    }
    117117}
    118118
     
    365365#     puts "cartesian coords:   $temp_car"
    366366     AddRigidBody $temp_mat $temp_car
    367      RecordMacroEntry "AddRigidBody $temp_mat $temp_car" 0
     367    RecordMacroEntry "AddRigidBody $temp_mat [list $temp_car]" 0
    368368    RecordMacroEntry "incr expgui(changed)" 0
    369369     incr ::expgui(changed)
     
    802802#   puts "Euler = $euler"
    803803    MapRigidBody $::rb_phase $::body_type $::rb_firstatom $origin $euler
    804     RecordMacroEntry "MapRigidBody $::rb_phase $::body_type $::rb_firstatom $origin $euler" 0
     804    RecordMacroEntry "MapRigidBody $::rb_phase $::body_type $::rb_firstatom [list $origin] [list $euler]" 0
    805805   incr ::rb_map($::body_type)
    806806   set curpage [$::rb_notebook raise]
     
    12831283#     puts "Matrix vars = $temp_var"
    12841284     SetRigidBodyVar $bodnum $temp_var $temp_damp
    1285      RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
     1285    RecordMacroEntry "SetRigidBodyVar $bodnum [list $temp_var] [list $temp_damp]" 0
    12861286     ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp
    1287      RecordMacroEntry "ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp" 0
     1287    RecordMacroEntry "ReplaceRigidBody $bodnum [list $temp_mat] [list $temp_car] [list $temp_var] [list $temp_damp]" 0
    12881288     #SetRigidBodyVar $bodnum $temp_var $temp_damp
    12891289     incr ::expgui(changed)
Note: See TracChangeset for help on using the changeset viewer.