| 1 |
#!/usr/bin/perl -w |
| 2 |
###################################################################### |
| 3 |
## Atoms notecard module for Atoms 3.0beta9 |
| 4 |
## copyright (c) 1999 Bruce Ravel |
| 5 |
## [email protected] |
| 6 |
## http://feff.phys.washington.edu/~ravel/ |
| 7 |
## |
| 8 |
## The latest version of Atoms can always be found at |
| 9 |
## http://feff.phys.washington.edu/~ravel/atoms/ |
| 10 |
## |
| 11 |
## ------------------------------------------------------------------- |
| 12 |
## All rights reserved. This program is free software; you can |
| 13 |
## redistribute it and/or modify it under the same terms as Perl |
| 14 |
## itself. |
| 15 |
## |
| 16 |
## This program is distributed in the hope that it will be useful, |
| 17 |
## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
## Artistic License for more details. |
| 20 |
## ------------------------------------------------------------------- |
| 21 |
###################################################################### |
| 22 |
|
| 23 |
package Xray::Tk::Atoms; |
| 24 |
|
| 25 |
use strict; |
| 26 |
use vars qw($VERSION $cvs_info @ISA @EXPORT @EXPORT_OK); |
| 27 |
|
| 28 |
require Exporter; |
| 29 |
|
| 30 |
@ISA = qw(Exporter AutoLoader); |
| 31 |
@EXPORT_OK = qw(absorption); |
| 32 |
$cvs_info = '$Id: Atoms.pm,v 1.7 2001/09/20 17:53:37 bruce Exp $ '; |
| 33 |
$VERSION = (split(' ', $cvs_info))[2] || 'pre_release'; |
| 34 |
|
| 35 |
use Tk; |
| 36 |
use Xray::Atoms qw/number/; |
| 37 |
use Xray::ATP; |
| 38 |
|
| 39 |
my ($atoms_frame, $menubar); |
| 40 |
use vars qw/$selected_atp/; |
| 41 |
|
| 42 |
###################################################################### |
| 43 |
######### ####################### |
| 44 |
######### Notecard containing Atoms keywords ####################### |
| 45 |
######### ####################### |
| 46 |
###################################################################### |
| 47 |
sub atoms { |
| 48 |
|
| 49 |
$atoms_frame = $_[0] -> Frame() -> pack(-fill=>'x'); |
| 50 |
|
| 51 |
## ---- menubar ----------- |
| 52 |
$menubar = $atoms_frame -> Frame(-borderwidth=>2, -relief=>'ridge',) |
| 53 |
-> pack(-anchor=>'nw', -fill=>'x', -pady=>4, -padx=>4); |
| 54 |
|
| 55 |
my $file_menu = $menubar -> |
| 56 |
Menubutton(@::file_menubutton) -> pack(-side=>'left'); |
| 57 |
&::manage($file_menu, "menu"); |
| 58 |
|
| 59 |
my $this = $file_menu |
| 60 |
-> command(-label=>$$::labels{load_input}, @::menu_args, |
| 61 |
-command=>\&::load_input, |
| 62 |
-accelerator=>'Control+o', ); |
| 63 |
&::manage($this, "menu"); |
| 64 |
($::LWP_simple_exists) and do { |
| 65 |
$this = $file_menu |
| 66 |
-> command(-label=>$$::labels{load_adb}, @::menu_args, |
| 67 |
-command=>\&::load_adb, ); |
| 68 |
&::manage($this, "menu"); |
| 69 |
$this = $file_menu |
| 70 |
-> command(-label=>$$::labels{download_adb}, @::menu_args, |
| 71 |
-command=>\&::download_adb, ); |
| 72 |
&::manage($this, "menu"); |
| 73 |
}; |
| 74 |
my $recent = $file_menu |
| 75 |
-> cascade(-label=>"Recent files", @::menu_args, -tearoff=>0); |
| 76 |
&::manage($recent, "menu"); |
| 77 |
push @::recent_registry, $recent; |
| 78 |
my $sep = $file_menu -> separator(); |
| 79 |
&::manage($sep, "separator"); |
| 80 |
$this = $file_menu |
| 81 |
-> command(-label=>$$::labels{save_input}, @::menu_args, |
| 82 |
-command=>\&::save_input, |
| 83 |
-accelerator=>'Control+s', ); |
| 84 |
&::manage($this, "menu"); |
| 85 |
$sep = $file_menu -> separator(); |
| 86 |
&::manage($sep, "separator"); |
| 87 |
$this = $file_menu |
| 88 |
-> command(-label=>$$::labels{write_template_6}, @::menu_args, |
| 89 |
-command=>[\&write_template, "6"],); |
| 90 |
&::manage($this, "menu"); |
| 91 |
$this = $file_menu |
| 92 |
-> command(-label=>$$::labels{write_template_8}, @::menu_args, |
| 93 |
-command=>[\&write_template, "8"],); |
| 94 |
&::manage($this, "menu"); |
| 95 |
## $sep = $file_menu -> separator(); |
| 96 |
## &::manage($sep, "separator"); |
| 97 |
## $this = $file_menu -> command(@::apt_args); |
| 98 |
## &::manage($this, "menu"); |
| 99 |
$sep = $file_menu -> separator(); |
| 100 |
&::manage($sep, "separator"); |
| 101 |
$this = $file_menu |
| 102 |
-> command(-label=>$$::labels{quit}, @::menu_args, |
| 103 |
-command=>\&::quit_tkatoms, |
| 104 |
-accelerator=>'Control+q', ); |
| 105 |
&::manage($this, "menu"); |
| 106 |
|
| 107 |
|
| 108 |
my $clear_menu = $menubar -> |
| 109 |
Menubutton(-text=>$$::labels{'clear_menu'}, @::menu_args) -> |
| 110 |
pack(-side=>'left'); |
| 111 |
&::manage($clear_menu, "menu"); |
| 112 |
|
| 113 |
$this = $clear_menu -> |
| 114 |
command(-label=>$$::labels{'clear_atoms'}, @::menu_args, |
| 115 |
-command=>\&clear_atoms); |
| 116 |
&::manage($this, "menu"); |
| 117 |
$this = $clear_menu -> |
| 118 |
command(-label=>$$::labels{'clear_lattice'}, @::menu_args, |
| 119 |
-command=>\&::clear_lattice); |
| 120 |
&::manage($this, "menu"); |
| 121 |
$this = $clear_menu -> |
| 122 |
command(-label=>$$::labels{'clear_all'}, @::menu_args, |
| 123 |
-command=>sub{&clear_atoms; &::clear_lattice}); |
| 124 |
&::manage($this, "menu"); |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
my $data_menu = $menubar -> |
| 129 |
Menubutton(-text=>$$::labels{'data_menu'}, @::menu_args) -> |
| 130 |
pack(-side=>'left'); |
| 131 |
&::manage($data_menu, "menu"); |
| 132 |
$this = $data_menu -> command(-label=>$$::labels{'insert_shift'}, |
| 133 |
@::menu_args, |
| 134 |
-command=>\&insert_shift); |
| 135 |
&::manage($this, "menu"); |
| 136 |
## $this = $data_menu -> command(-label=>$$::labels{'dump'}, |
| 137 |
## @::menu_args, |
| 138 |
## -command=>[\&::display_in_frame, $::top, '', 0], |
| 139 |
## -accelerator=>'Control+d', ); |
| 140 |
## &::manage($this, "menu"); |
| 141 |
my $abs_data = |
| 142 |
$data_menu -> cascade(-label=>'Absorption data resource', |
| 143 |
-tearoff=>0, |
| 144 |
-foreground=>$::colors{'label'}, ); |
| 145 |
&::manage($abs_data, "menu"); |
| 146 |
|
| 147 |
my %menu_abs_button; |
| 148 |
foreach my $resource (sort(Xray::Absorption->available)) { |
| 149 |
my $r = lc($resource); |
| 150 |
next if ($r eq 'none'); |
| 151 |
$menu_abs_button{lc($r)} = $abs_data |
| 152 |
-> radiobutton(-label => $resource, @::menu_args, |
| 153 |
-selectcolor=>$::colors{button}, |
| 154 |
-variable=>\$::meta{absorption_tables}, |
| 155 |
-value=>$r, |
| 156 |
-command=>sub{ Xray::Absorption->load($r); |
| 157 |
$::meta{absorption_tables} = $r; }); |
| 158 |
&::manage($menu_abs_button{lc($r)}, "menu"); |
| 159 |
&::manage($menu_abs_button{lc($r)}, "radio"); |
| 160 |
} |
| 161 |
|
| 162 |
|
| 163 |
my $help_menu = $menubar -> |
| 164 |
Menubutton(@::help_menubutton) -> pack(-side=>'right'); |
| 165 |
&::set_help_menu($help_menu); |
| 166 |
|
| 167 |
my $pref_menu = $menubar -> |
| 168 |
Menubutton(@::pref_menubutton) -> pack(-side=>'right'); |
| 169 |
&::set_pref_menu($pref_menu); |
| 170 |
|
| 171 |
&::manage($help_menu, "menu"); |
| 172 |
&::manage($pref_menu, "menu"); |
| 173 |
|
| 174 |
## Descripton |
| 175 |
my $top_frame = $atoms_frame -> Frame(-relief=>'groove', -borderwidth=>2) |
| 176 |
-> pack(-pady=>4, -side=>'top'); |
| 177 |
my $atoms_label = $top_frame -> |
| 178 |
Label(-text=>$$::labels{'atoms_description'}, @::header_args, ) -> |
| 179 |
pack(); |
| 180 |
&::manage($atoms_label, "header"); |
| 181 |
|
| 182 |
## -------------------------------------------------------------------- |
| 183 |
## frame for edge, rmax, shift, fill gases |
| 184 |
my $af1 = $atoms_frame -> Frame() -> pack(-fill=>'x', -pady=>2); |
| 185 |
my ($label, $entry); |
| 186 |
|
| 187 |
my $af1_left = $af1 -> Frame() -> pack(-side=>'left', -expand=>1); |
| 188 |
my $af1_right = $af1 -> LabFrame(-label=>$$::labels{fill_gases}, |
| 189 |
-foreground=>$::colors{label}, |
| 190 |
-labelside=>'acrosstop', |
| 191 |
-borderwidth=>2) |
| 192 |
-> pack(-side=>'right', -expand=>1); |
| 193 |
$::balloon->attach(($af1_right->children)[1], -msg=>$$::help{fill_gases},); |
| 194 |
&::manage($af1_right, "labframe"); |
| 195 |
|
| 196 |
## --------------------------- rmax |
| 197 |
my $col = 0; |
| 198 |
$label = $af1_left -> Label(-text=>$$::labels{'rmax'}, @::label_args, ) |
| 199 |
-> grid(-column=>$col++, -row=>0, -sticky=>'e'); |
| 200 |
&::manage($label, "label"); |
| 201 |
$entry = $af1_left -> Entry(-width=>7, @::entry_args) |
| 202 |
-> grid(-column=>$col++, -row=>0, -pady=>5); |
| 203 |
&::manage($entry, "entry"); |
| 204 |
push @::all_entries, $entry; |
| 205 |
$::atoms_widgets{'rmax'} = $entry; |
| 206 |
$::balloon->attach($label, -msg=>$$::help{'rmax'},); |
| 207 |
|
| 208 |
$col+=2; |
| 209 |
my $button = $af1_left -> Button(-text=>$$::labels{'run_atoms'}, |
| 210 |
@::button_args, |
| 211 |
-command=>$::function_refs{'run_atoms'}, |
| 212 |
-borderwidth=>4, ); |
| 213 |
$button -> grid(-column=>$col++, -row=>0, -columnspan=>3, |
| 214 |
-sticky=>'e', -pady=>5); |
| 215 |
$::balloon->attach($button, -msg=>$$::help{'run_atoms'},); |
| 216 |
&::manage($button, "button"); |
| 217 |
|
| 218 |
|
| 219 |
## --------------------------- shift vector |
| 220 |
$col=0; |
| 221 |
$::atoms_widgets{'shift'} = []; |
| 222 |
do { |
| 223 |
my $label = $af1_left -> Label(-text=>$$::labels{'shift'}, @::label_args,) |
| 224 |
-> grid(-column=>$col++, -row=>1, -sticky=>'e', -pady=>5); |
| 225 |
&::manage($label, "label"); |
| 226 |
foreach my $i (0..2) { |
| 227 |
my $entry = $af1_left -> Entry(-width=>7, @::entry_args) |
| 228 |
-> grid(-column=>$col++, -row=>1, -sticky=>'w', -pady=>5); |
| 229 |
unless ($i == 2) { |
| 230 |
my $comma = $af1_left -> Label(-text=>',', @::label_args,) |
| 231 |
-> grid(-column=>$col++, -row=>1, -pady=>5); |
| 232 |
&::manage($comma, "label"); |
| 233 |
}; |
| 234 |
push @{$::atoms_widgets{'shift'}}, $entry; |
| 235 |
&::manage($entry, "entry"); |
| 236 |
}; |
| 237 |
$::balloon->attach($label, -msg=>$$::help{'shift'},); |
| 238 |
}; |
| 239 |
|
| 240 |
## optionmenu for selecting an output file type |
| 241 |
my $out_label = $af1_left -> Label(-text=>$$::labels{outfiles}, |
| 242 |
@::label_args) |
| 243 |
-> grid(-column=>0, -row=>2, -columnspan=>2, -sticky=>'e', -pady=>5); |
| 244 |
&::manage($out_label, "label"); |
| 245 |
$::balloon->attach($out_label, -msg=>$$::help{'outfiles'},); |
| 246 |
|
| 247 |
$selected_atp = "feff"; |
| 248 |
($::prefer_feff_eight) and $selected_atp = "feff8"; |
| 249 |
my $atp_button = $af1_left |
| 250 |
-> Optionmenu(-textvariable => \$selected_atp, |
| 251 |
-background => $::colors{'entry'}, |
| 252 |
-activeforeground => $::colors{'label'}, |
| 253 |
-activebackground => $::colors{'entry'}, |
| 254 |
-width=>15, -font=>$::fonts{'label'}, -relief=>'groove') |
| 255 |
-> grid(-column=>2, -row=>2, -columnspan=>4, -sticky=>'e', -pady=>5); |
| 256 |
&::manage($atp_button, "menu"); |
| 257 |
foreach my $e (@::atpfiles) { |
| 258 |
next if ($e =~ /^\s*$/); # remove atp files for |
| 259 |
next if ($e =~ /^molec/i); # molecules, |
| 260 |
next if ($e =~ /^template/i); # templates, |
| 261 |
next if ($e =~ /^dafs/i); # dafs sims, |
| 262 |
next if ($e =~ /^powder/i); # powder sims, |
| 263 |
next if ($e =~ /a(bsorption|toms)/); # atoms.inp, and absorption reports |
| 264 |
my $this = $atp_button -> command(-label => $e, @::menu_args, |
| 265 |
-command=>sub{$selected_atp=$e;}); |
| 266 |
&::manage($this, "menu"); |
| 267 |
}; |
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
## -------------------------------------------------------------------- |
| 273 |
## sliders for fill gases |
| 274 |
$col = 1; |
| 275 |
##$::balloon->attach($label, -msg=>$$::help{fill_gases},); |
| 276 |
foreach my $which ('nitrogen', 'argon', 'krypton') { |
| 277 |
my $label = $af1_right -> Label(-text=>$$::labels{$which}, @::label_args,) |
| 278 |
-> grid(-column=>$col, -row=>0,); |
| 279 |
&::manage($label, "label"); |
| 280 |
my $scale = $af1_right -> Scale(-from => 0, |
| 281 |
-to => 1, |
| 282 |
-orient => 'vertical', |
| 283 |
-resolution => 0.05, |
| 284 |
'-length' => 100, |
| 285 |
-sliderlength => 15, |
| 286 |
-command => [\&::set_gas, $which], |
| 287 |
#-variable => \$keywords->{$which}, |
| 288 |
-foreground => $::colors{label}, |
| 289 |
) |
| 290 |
-> grid(-column=>$col++, -row=>1, -padx=>2); |
| 291 |
$::atoms_widgets{$which} = $scale; |
| 292 |
$::balloon->attach($label, -msg=>$$::help{$which},); |
| 293 |
&::manage($scale, "scale"); |
| 294 |
}; |
| 295 |
## -------------------------------------------------------------------- |
| 296 |
|
| 297 |
|
| 298 |
}; |
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
### > atoms subroutines |
| 303 |
## -------------------------------------------------------------------- |
| 304 |
|
| 305 |
|
| 306 |
sub run_atoms { |
| 307 |
$::cell -> make( Occupancy=>0 ); |
| 308 |
($selected_atp =~ /(p1|unit)/) and $::cell -> make( Occupancy=>1 ); |
| 309 |
&::validate_lattice(0); |
| 310 |
my $core_tag = $::site_entries[$::core_index]{'tag'}->get(); |
| 311 |
($core_tag =~ /^\s*$/) and |
| 312 |
$core_tag = $::site_entries[$::core_index]{'elem'}->get(); |
| 313 |
$::keywords -> make('core'=>$core_tag); |
| 314 |
&atoms_validate(0); |
| 315 |
$::keywords -> verify_keywords($::cell, \@::sites, 1); |
| 316 |
Xray::Atoms::build_cluster($::cell, $::keywords, \@::cluster, \@::neutral); |
| 317 |
my $contents = ""; |
| 318 |
$::keywords -> make('identity'=>"TkAtoms $Xray::Atoms::VERSION"); |
| 319 |
my ($ofname, $is_feff) |
| 320 |
= parse_atp($selected_atp, $::cell, $::keywords, |
| 321 |
\@::cluster, \@::neutral, \$contents); |
| 322 |
&::display_in_frame($::top, \$contents, $selected_atp, $ofname, $is_feff); |
| 323 |
}; |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
## titles: do not need error checking -- they can say anything |
| 331 |
## check: that edge is a valid edge symbol or whitespace |
| 332 |
## core: cannot be checked here |
| 333 |
## fill gases: check that they add to less than 1 |
| 334 |
## rmax: cannot be checked here |
| 335 |
## shift: it either evaluates to a number or it doesn't |
| 336 |
## edge: it's a menu, it cannot be wrong |
| 337 |
sub atoms_validate { |
| 338 |
my $verbose = $_[0]; |
| 339 |
my $is_ok = 1; |
| 340 |
|
| 341 |
$::keywords->make('edge' => $::atoms_values{'edge'});; |
| 342 |
$::keywords->set_edge($::cell, 1); |
| 343 |
$::atoms_values{'edge'} = $::keywords->{'edge'}; |
| 344 |
|
| 345 |
KEYWORDS: foreach my $key (keys %::atoms_widgets) { |
| 346 |
#print $key, $/; |
| 347 |
next KEYWORDS if ($key =~ /argon|krypton|nitrogen/); |
| 348 |
($key eq 'shift') && do { # vector valued |
| 349 |
my ($x, $y, $z) = (&number($::atoms_widgets{'shift'}[0]->get()), |
| 350 |
&number($::atoms_widgets{'shift'}[1]->get()), |
| 351 |
&number($::atoms_widgets{'shift'}[2]->get())); |
| 352 |
$::keywords->make('shift'=>$x, $y, $z); |
| 353 |
next KEYWORDS; |
| 354 |
}; # number valued |
| 355 |
($key =~ /rmax/) && do { |
| 356 |
$::keywords-> |
| 357 |
make($key => number($::atoms_widgets{$key}->get()) ); |
| 358 |
next KEYWORDS; |
| 359 |
}; |
| 360 |
#($key eq 'dopant_core') && do { |
| 361 |
# $::keywords-> |
| 362 |
# make('dopant_core' => $::atoms_widgets{'dopant_core'}->get() ); |
| 363 |
# next KEYWORDS; |
| 364 |
#}; |
| 365 |
($key eq 'title') && do { |
| 366 |
my $eol = $/ . "+"; # split title text into lines |
| 367 |
my @t = split /$eol/, $::atoms_widgets{'title'}->get(qw/1.0 end/); |
| 368 |
$::keywords->{'title'} = []; |
| 369 |
foreach my $t (@t) { |
| 370 |
$::keywords->make('title'=>$t); |
| 371 |
}; |
| 372 |
next KEYWORDS; |
| 373 |
}; |
| 374 |
do { # string valued |
| 375 |
unless (($key eq 'edge') || ($key =~ /_button$/)) { |
| 376 |
$::keywords->make($key => $::atoms_widgets{$key}->get() ); |
| 377 |
}; |
| 378 |
## my $atp_regex = join('|', @::atpfiles); |
| 379 |
## if ($key =~ /^($atp_regex)$/) { |
| 380 |
## my $l = $key . ": " . $::keywords->{$key}; |
| 381 |
## my $f = 0; |
| 382 |
## ($key eq 'feff') && ($f = 6); |
| 383 |
## ($key eq 'feff8') && ($f = 8); |
| 384 |
##$atp_menu_widgets{$key} -> configure(-label=>$l); |
| 385 |
##$atp_menu_widgets{$key} |
| 386 |
## -> configure(-command=> |
| 387 |
## [\&display_in_frame, $top, $::keywords->{$key}, $f]); |
| 388 |
## }; |
| 389 |
next KEYWORDS; |
| 390 |
}; |
| 391 |
}; # verify that the keyword values make sense |
| 392 |
$::keywords->verify_keywords($::cell,\@::sites,1); |
| 393 |
$::atoms_widgets{'rmax'} -> delete(qw/0 end/); |
| 394 |
$::atoms_widgets{'rmax'} -> insert(0, $::keywords->{'rmax'}); |
| 395 |
if ($verbose and $is_ok) { |
| 396 |
&tkatoms_dialog(\$::top, 'atoms_ok', 'info'); |
| 397 |
}; |
| 398 |
}; |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
sub clear_atoms { |
| 406 |
##$::atoms_widgets{'edge'} -> configure(-textvariable=>\$::keywords->{'edge'}); |
| 407 |
foreach my $key (keys %::atoms_widgets) { |
| 408 |
next if ($key eq 'edge'); # handle edge specially |
| 409 |
next if ($key =~ /_button$/); # handle atp button below |
| 410 |
if ($key eq 'title') { |
| 411 |
1; # do this in clear_littice |
| 412 |
##$::atoms_widgets{$key} -> delete(qw/1.0 end/); |
| 413 |
} elsif ($key eq 'shift') { |
| 414 |
foreach my $i (0..2) { |
| 415 |
$::atoms_widgets{$key}[$i] -> delete(qw/0 end/); |
| 416 |
}; |
| 417 |
} elsif ($key =~ /argon|krypton|nitrogen/) { |
| 418 |
$::atoms_widgets{$key} -> set(0.00); |
| 419 |
} else { |
| 420 |
$::atoms_widgets{$key} -> delete(qw/0 end/); |
| 421 |
}; |
| 422 |
}; |
| 423 |
$selected_atp = ($::prefer_feff_eight) ? "feff8" : "feff"; |
| 424 |
##($::prefer_feff_eight) and $selected_atp = "feff8"; |
| 425 |
}; |
| 426 |
|
| 427 |
|
| 428 |
sub insert_shift { |
| 429 |
my $group = $::space_field -> get; |
| 430 |
if ($group =~ /^\s*$/) { |
| 431 |
$::top -> messageBox(-icon => 'error', |
| 432 |
-message => $$::dialogs{'no_space_group'}, |
| 433 |
-title => 'Atoms: Error', |
| 434 |
-type => 'OK'); |
| 435 |
return; |
| 436 |
}; |
| 437 |
my @vec = Xray::Xtal::Cell::get_shift($group); |
| 438 |
if ($group =~ /^\s*$/) { |
| 439 |
$::top -> messageBox(-icon => 'error', |
| 440 |
-message => $$::dialogs{'no_space_group'}, |
| 441 |
-title => 'Atoms: Error', |
| 442 |
-type => 'OK'); |
| 443 |
return -1; |
| 444 |
} elsif (@vec) { |
| 445 |
$::keywords -> make('shift'=>@vec); |
| 446 |
$ {$::atoms_widgets{'shift'}}[0] -> insert(0, $vec[0]); |
| 447 |
$ {$::atoms_widgets{'shift'}}[1] -> insert(0, $vec[1]); |
| 448 |
$ {$::atoms_widgets{'shift'}}[2] -> insert(0, $vec[2]); |
| 449 |
} else { |
| 450 |
&::tkatoms_text_dialog(\$::top, "`" . $group . "'" . $$::dialogs{'no_shift'}); |
| 451 |
}; |
| 452 |
}; |
| 453 |
|
| 454 |
|
| 455 |
sub write_template { |
| 456 |
my $atp = "template" . $_[0]; |
| 457 |
my $cell = Xray::Xtal::Cell -> new(); |
| 458 |
my $keywords = Xray::Atoms -> new(); |
| 459 |
$keywords -> make('identity'=>"the Feff template generator"); |
| 460 |
my (@cluster, @neutral, $contents); |
| 461 |
my ($default_name, $is_feff) = |
| 462 |
&parse_atp($atp, $cell, $keywords, \@cluster, \@neutral, \$contents); |
| 463 |
&::display_in_frame($::top, \$contents, $selected_atp, $default_name, $is_feff); |
| 464 |
}; |
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
1; |
| 470 |
__END__ |