Changeset 378


Ignore:
Timestamp:
Dec 4, 2009 5:05:10 PM (11 years ago)
Author:
toby
Message:

# on 2001/04/03 19:16:41, toby did:
fix bug: if error occurs in adding a phase, don't go on to the add atoms page
check for valid atom types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    • Property rcs:date changed from 2000/12/22 19:37:02 to 2001/04/03 19:16:41
    • Property rcs:lines changed from +2 -2 to +68 -4
    • Property rcs:rev changed from 1.16 to 1.17
    r358 r378  
    115115                "The following error(s) were found in your input:\n$err" \
    116116                error 0 "OK"
     117        set expgui(oldphaselist) -1
    117118        return
    118119    }
     
    145146                 "Error processing space group\nReview error message below" \
    146147                 $b
     148        set expgui(oldphaselist) -1
    147149        return
    148150    } else {
     
    153155                $b \
    154156                {Continue Redo} ]
    155         if {$opt > 1} return
     157        if {$opt > 1} {
     158            set expgui(oldphaselist) -1
     159            return
     160        }
    156161    }
    157162    file delete spg.in spg.out
     
    884889    set err {}
    885890    set atomlist {}
     891    set validatmtypes {
     892        H H-1 H_1 H_2 H_3 HE HE_3 HE_4 LI LI+1 LI_6 LI_7 BE BE+2 B B_10
     893        B_11 C CV C_12 C_13 N N_14 N_15 O O-1 O_16 O_17 O_18 F F-1 F_19 NE
     894        NE_20 NE_21 NE_22 NA NA+1 NA_23 MG MG+2 MG_24 MG_25 MG_26 AL AL+3
     895        AL_27 SI SI+4 SIV SI_28 SI_29 SI_30 P P_31 S S_32 S_33 S_34 CL CL-1
     896        CL_35 CL_37 AR AR_36 AR_40 K K+1 K_39 K_41 CA CA+2 CA_40 CA_44 SC SC+3
     897        SC_45 TI TI+2 TI+3 TI+4 TI_46 TI_47 TI_48 TI_49 TI_50 V V+2 V+3 V+5
     898        V_51 CR CR+2 CR+3 CR_50 CR_52 CR_53 CR_54 MN MN+2 MN+3 MN+4 MN_55 FE
     899        FE+2 FE+3 FE_54 FE_56 FE_57 FE_58 CO CO+2 CO+3 CO_59 NI NI+2 NI+3
     900        NI_58 NI_60 NI_61 NI_62 NI_64 CU CU+1 CU+2 CU_63 CU_65 ZN ZN+2 ZN_64
     901        ZN_66 ZN_67 ZN_68 GA GA+3 GE GE+4 AS AS_75 SE BR BR-1 BR_79 BR_81 KR
     902        RB RB+1 SR SR+2 Y Y+3 Y_89 ZR ZR+4 NB NB+3 NB+5 NB_93 MO MO+3 MO+5
     903        MO+6 TC TC_98 RU RU+3 RU+4 RH RH+3 RH+4 RH_103 PD PD+2 PD+4 AG AG+1
     904        AG+2 CD CD+2 CD_112 CD_113 CD_114 CD_116 IN IN+3 IN_113 IN_115 SN SN+2
     905        SN+4 SB SB+3 SB+5 TE I I-1 I_127 XE CS CS+1 CS_133 BA BA+2 LA LA+3 CE
     906        CE+3 CE+4 PR PR+3 PR+4 PR_141 ND ND+3 PM PM+3 PM_147 SM SM+3 SM_152
     907        SM_154 EU EU+2 EU+3 EU_153 GD GD+3 GD_160 TB TB+3 TB_159 DY DY+3 HO
     908        HO+3 HO_165 ER ER+3 TM TM+3 TM_169 YB YB+2 YB+3 LU LU+3 HF HF+4 TA
     909        TA+5 TA_181 W W+6 RE OS OS+4 IR IR+3 IR+4 PT PT+2 PT+4 AU AU+1 AU+3
     910        AU_197 HG HG+1 HG+2 TL TL+1 TL+3 PB PB+2 PB+4 BI BI+3 BI+5 BI_209 PO
     911        PO_210 AT AT_210 RN RN_222 FR FR_223 RA RA+2 RA_226 AC AC+3 AC_227 TH
     912        TH+4 TH_232 PA PA_231 U U+3 U+4 U+6 U_235 U_238 NP NP+3 NP+4 NP+6
     913        NP_237 PU PU+3 PU+4 PU+6 PU_239 PU_240 PU_242 AM AM_243 CM CM_244 BK
     914        BK_247 CF CF_249
     915    }
    886916    while {![catch {grid info $np.e[incr row]t}]} {
    887917        if !{$expgui(UseAtom$row)} continue
     
    895925        if {[set type [string trim [$np.e${row}t get]]] == ""} {
    896926            append err "  line $row: No atom type specified\n"
     927        }
     928        if {[lsearch $validatmtypes [string toupper $type]] == -1} {
     929            append err "  line $row: Atom type $type is invalid for GSAS\n"
    897930        }
    898931        set name [string trim [$np.e${row}n get]]
     
    12121245    set msg [lindex $input 3]
    12131246    if {$msg != ""} {
    1214         grid [label $np.msg -text $msg -fg red -justify left -bd 4 -relief raised] \
    1215                 -column 0 -columnspan 8 -row 20 -sticky ew
     1247        catch {destroy $np.msg}
     1248        grid [label $np.msg -text $msg -fg red -anchor center -bd 4 -relief raised] \
     1249                -column 0 -columnspan 99 -row 20 -sticky ew
    12161250    }
    12171251}
     
    12421276proc AddAtomsList {} {
    12431277    global expgui expmap
     1278    # skip if we aborted out of addphase
     1279    if {$expgui(oldphaselist) == -1} return
    12441280    # find the new phase
    12451281    set phase {}
     
    15301566    set err {}
    15311567    set atomlist {}
     1568    set validatmtypes {
     1569        H H-1 H_1 H_2 H_3 HE HE_3 HE_4 LI LI+1 LI_6 LI_7 BE BE+2 B B_10
     1570        B_11 C CV C_12 C_13 N N_14 N_15 O O-1 O_16 O_17 O_18 F F-1 F_19 NE
     1571        NE_20 NE_21 NE_22 NA NA+1 NA_23 MG MG+2 MG_24 MG_25 MG_26 AL AL+3
     1572        AL_27 SI SI+4 SIV SI_28 SI_29 SI_30 P P_31 S S_32 S_33 S_34 CL CL-1
     1573        CL_35 CL_37 AR AR_36 AR_40 K K+1 K_39 K_41 CA CA+2 CA_40 CA_44 SC SC+3
     1574        SC_45 TI TI+2 TI+3 TI+4 TI_46 TI_47 TI_48 TI_49 TI_50 V V+2 V+3 V+5
     1575        V_51 CR CR+2 CR+3 CR_50 CR_52 CR_53 CR_54 MN MN+2 MN+3 MN+4 MN_55 FE
     1576        FE+2 FE+3 FE_54 FE_56 FE_57 FE_58 CO CO+2 CO+3 CO_59 NI NI+2 NI+3
     1577        NI_58 NI_60 NI_61 NI_62 NI_64 CU CU+1 CU+2 CU_63 CU_65 ZN ZN+2 ZN_64
     1578        ZN_66 ZN_67 ZN_68 GA GA+3 GE GE+4 AS AS_75 SE BR BR-1 BR_79 BR_81 KR
     1579        RB RB+1 SR SR+2 Y Y+3 Y_89 ZR ZR+4 NB NB+3 NB+5 NB_93 MO MO+3 MO+5
     1580        MO+6 TC TC_98 RU RU+3 RU+4 RH RH+3 RH+4 RH_103 PD PD+2 PD+4 AG AG+1
     1581        AG+2 CD CD+2 CD_112 CD_113 CD_114 CD_116 IN IN+3 IN_113 IN_115 SN SN+2
     1582        SN+4 SB SB+3 SB+5 TE I I-1 I_127 XE CS CS+1 CS_133 BA BA+2 LA LA+3 CE
     1583        CE+3 CE+4 PR PR+3 PR+4 PR_141 ND ND+3 PM PM+3 PM_147 SM SM+3 SM_152
     1584        SM_154 EU EU+2 EU+3 EU_153 GD GD+3 GD_160 TB TB+3 TB_159 DY DY+3 HO
     1585        HO+3 HO_165 ER ER+3 TM TM+3 TM_169 YB YB+2 YB+3 LU LU+3 HF HF+4 TA
     1586        TA+5 TA_181 W W+6 RE OS OS+4 IR IR+3 IR+4 PT PT+2 PT+4 AU AU+1 AU+3
     1587        AU_197 HG HG+1 HG+2 TL TL+1 TL+3 PB PB+2 PB+4 BI BI+3 BI+5 BI_209 PO
     1588        PO_210 AT AT_210 RN RN_222 FR FR_223 RA RA+2 RA_226 AC AC+3 AC_227 TH
     1589        TH+4 TH_232 PA PA_231 U U+3 U+4 U+6 U_235 U_238 NP NP+3 NP+4 NP+6
     1590        NP_237 PU PU+3 PU+4 PU+6 PU_239 PU_240 PU_242 AM AM_243 CM CM_244 BK
     1591        BK_247 CF CF_249
     1592    }
    15321593    while {![catch {grid info $np.e[incr row]t}]} {
    15331594        if !{$expgui(UseAtom$row)} continue
     
    15411602        if {[set type [string trim [$np.e${row}t get]]] == ""} {
    15421603            append err "  line $row: No atom type specified\n"
     1604        }
     1605        if {[lsearch $validatmtypes [string toupper $type]] == -1} {
     1606            append err "  line $row: Atom type $type is invalid for GSAS\n"
    15431607        }
    15441608        set name [string trim [$np.e${row}n get]]
Note: See TracChangeset for help on using the changeset viewer.