- Timestamp:
- Jun 12, 2012, 3:32:04 PM (12 years ago)
- Location:
- trunk/gui
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/drawingentry.tcl
r3027 r3032 910 910 } 911 911 912 # 913 # Rewrite -- 914 # 915 # Rewrite string into list of text and substitution variables. 916 # Also break on new lines. 917 # 918 itcl::body Rappture::DrawingEntry::ApplySubstitutions { string } { 919 set cursor 0 920 set list {} 921 set lines [split $string \n] 922 foreach line $lines { 923 while 1 { 924 set index [string first \$ $line $cursor] 925 if { $index == -1 } { 926 # Take the rest of the line 927 lappend list "text" [string range $line $cursor end] 928 break 929 } 930 # Find the end of the variable 931 incr cursor 932 set c [string index $line $cursor] 933 if { $c != "{" } { 934 lappend list "text" "\$" 935 continue 936 } 937 set index [string first "\}" $string $cursor] 938 if { $index == -1 } { 939 error "missing } character in variable substitution." 940 } 941 set varName [string range $string $cursor [expr $index - 1]] 942 set cursor [expr $index + 1] 943 # Check that it's a substitution variable 944 if { ![info exists _name2path($varName)] } { 945 error "no substitution \"$varName\" found" 946 } 947 set path $_name2path($name) 948 set w [$_owner widgetfor $path] 949 if { $w != "" } { 950 set value [$w value] 951 } else { 952 set value "" 953 } 954 lappend list "subst" $value 955 } 956 lappend list "text" "\n" 957 } 958 return $list 959 } -
trunk/gui/scripts/nanovisviewer.tcl
r2876 r3032 117 117 private method volume { tag name } 118 118 private method GetVolumeInfo { w } 119 private method SetOrientation {} 119 120 120 121 private variable _outbuf ;# buffer for outgoing commands … … 1088 1089 set _settings($this-phi) $_view(phi) 1089 1090 set _settings($this-psi) $_view(psi) 1090 SendCmd "camera angle $xyz"1091 < SendCmd "camera angle $xyz" 1091 1092 set _click(x) $x 1092 1093 set _click(y) $y … … 1873 1874 incr row 1874 1875 } 1876 1877 itk_component add orientation { 1878 Rappture::Combobox $inner.orientation -width 10 -editable no 1879 } 1880 $inner.mode choices insert end \ 1881 "front" "lines" \ 1882 "back" "ribbons" \ 1883 "top" "0 0 0" \ 1884 "bottom" "0 180 0" \ 1885 "left" "270 0 0 " \ 1886 "right" "90 0 0" \ 1887 "default" "45 45 0" 1888 $itk_component(orientation) value "default" 1889 bind $inner.mode <<Value>> [itcl::code $this SetOrientation] 1890 1875 1891 blt::table configure $inner c0 c1 -resize none 1876 1892 blt::table configure $inner c2 -resize expand … … 2037 2053 } 2038 2054 2055 2056 itcl::body Rappture::NanovisViewer::SetOrientation {} { 2057 set angles [$itk_component(orientation) value] 2058 foreach name { theta phi psi } angle $angles { 2059 set _view($name) $angle 2060 } 2061 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 2062 SendCmd "camera angle $xyz" 2063 } -
trunk/gui/scripts/tool.tcl
r2977 r3032 212 212 213 213 if { $status != 0 } { 214 # We're here because the exec-ed program failed 214 215 if { $::Rappture::Tool::job(control) != "" } { 215 set code [lindex $::Rappture::Tool::job(control) 0] 216 set mesg [lindex $::Rappture::Tool::job(control) 2] 217 if { $code == "EXITED" } { 218 set result "Program returned exit code $status:\n\n" 216 foreach { token pid code mesg } \ 217 $::Rappture::Tool::job(control) break 218 if { $token == "EXITED" } { 219 # This means that the program exited normally but 220 # returned a non-zero exitcode. Consider this an 221 # invalid result from the program. Append the stderr 222 # from the program to the message. 223 append result \ 224 "\nProgram exited normally: exit code is $code\n\n" 219 225 append result $::Rappture::Tool::job(error) 220 } else { 221 set result \ 222 "Abnormal program termination \"$code\": $mesg" 226 } elseif { $token == "abort" } { 227 # The user pressed the abort button. 228 set result "Program terminated by user.\n\n" 229 append result $::Rappture::Tool::job(output) 230 } else { 231 # Abnormal termination 232 set result "Abnormal program termination: $mesg\n\n" 233 append result $::Rappture::Tool::job(output) 223 234 } 224 235 } -
trunk/gui/scripts/vtkheightmapviewer.tcl
r2792 r3032 1 2 1 # ---------------------------------------------------------------------- 3 2 # COMPONENT: vtkheightmapviewer - Vtk heightmap viewer
Note: See TracChangeset
for help on using the changeset viewer.