Changeset 781 for trunk/export_xml.tcl
- Timestamp:
- Dec 4, 2009 5:11:55 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export_xml.tcl
- Property rcs:date changed from 2003/04/10 22:12:41 to 2004/04/27 14:09:07
- Property rcs:lines changed from +2 -1 to +25 -41
- Property rcs:rev changed from 1.2 to 1.3
r672 r781 3 3 set label "FOX .xml format" 4 4 set action exp2xml 5 # write coordinates in an MSI .xtl file5 # write coordinates in an XML for FOX 6 6 proc exp2xml {} { 7 7 global expmap expgui … … 28 28 # remove spaces from space group 29 29 regsub -all " " $spacegroup "" spacegroup 30 # scan through the Origin 1/2 spacegroups for a match 31 set origin2 0 32 set sp [string toupper $spacegroup] 33 # treat bar 3 as the same as 3 (Fd3m <==> Fd-3m) 34 regsub -- "-3" $sp "3" sp 35 set fp1 [open [file join $expgui(scriptdir) spacegrp.ref] r] 36 # skip over the first section of file 37 set line 0 38 while {[lindex $line 1] != 230} { 39 if {[gets $fp1 line] < 0} return 40 } 41 while {[gets $fp1 line] >= 0} { 42 set testsg [string toupper [lindex $line 8]] 43 regsub -all " " $testsg "" testsg 44 regsub -- "-3" $testsg "3" testsg 45 if {$sp == $testsg} { 46 set origin2 1 47 break 48 } 49 } 50 close $fp1 51 # GSAS always uses origin2 when there is a choice 52 if {$origin2} {set spacegroup ${spacegroup}:2} 30 53 puts $fp " <Crystal Name=\"${name}\" SpaceGroup=\"${spacegroup}\">" 31 54 set min 1 … … 89 112 } 90 113 91 # process the spacegroup whenever the phase is changed92 proc MSI_SP_convert {args} {93 global expgui94 set phase 095 catch {set phase $expgui(export_phase)}96 if {$phase == 0} return97 set spacegroup [phaseinfo $phase spacegroup]98 set expgui(export_rhomb) 099 # remove final R from rhombohedral space groups100 if {[string toupper [string range $spacegroup end end]] == "R"} {101 set expgui(export_rhomb) 1102 set spacegroup [string range $spacegroup 0 \103 [expr [string length $spacegroup]-2]]104 }105 # remove spaces from space group106 regsub -all " " $spacegroup "" spacegroup107 set expgui(export_sg) $spacegroup108 set expgui(export_orig) 0109 # scan through the Origin 1/2 spacegroups for a match110 set spacegroup [string toupper $spacegroup]111 # treat bar 3 as the same as 3 (Fd3m <==> Fd-3m)112 regsub -- "-3" $spacegroup "3" spacegroup113 set fp [open [file join $expgui(scriptdir) spacegrp.ref] r]114 # skip over the first section of file115 set line 0116 while {[lindex $line 1] != 230} {117 if {[gets $fp line] < 0} return118 }119 while {[gets $fp line] >= 0} {120 set testsg [string toupper [lindex $line 8]]121 regsub -all " " $testsg "" testsg122 regsub -- "-3" $testsg "3" testsg123 if {$spacegroup == $testsg} {124 set expgui(export_orig) 1125 break126 }127 }128 close $fp129 }
Note: See TracChangeset
for help on using the changeset viewer.