Added checking for chemical formula in perl-qt3.
This commit is contained in:
parent
d438ba41dd
commit
cf9777c507
@ -2388,6 +2388,12 @@ sub CreateInpFile
|
||||
my $Comp = layerTable->text($i-1,0);
|
||||
$All{$LComp} = $Comp;
|
||||
my %LElComp=Chem::parse_formula($Comp);
|
||||
foreach my $key (keys %LElComp) {
|
||||
# Check if composition is understood
|
||||
if ($key eq "" || Chem::Zof($key) eq "") {
|
||||
$Check++;
|
||||
}
|
||||
}
|
||||
if ($Comp eq "") {$Check++;}
|
||||
|
||||
# Densities of layers
|
||||
@ -2403,8 +2409,8 @@ sub CreateInpFile
|
||||
if ($d eq "") {$Check++;}
|
||||
|
||||
# Sanity check, is the layer supposed to have value? are they all there?
|
||||
if ($Check!=0) {
|
||||
my $ErrMsg="Error: Layer $i is empty. Expecting it to be defined!\n";
|
||||
if ($Check!=0 ) {
|
||||
my $ErrMsg="Error: Bad chemical formula in Layer $i.\nPleach check!\n";
|
||||
print STDERR $ErrMsg;
|
||||
my $HelpWindow = Qt::MessageBox::information( this, "Error!",$ErrMsg);
|
||||
return "ERROR";
|
||||
|
@ -363,8 +363,7 @@ sub CreateInpFile
|
||||
# Check if composition is understood
|
||||
if ($key eq "" || Chem::Zof($key) eq "") {
|
||||
$Check++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if ($Comp eq "") {$Check++;}
|
||||
# Write composition to results file header
|
||||
|
Loading…
x
Reference in New Issue
Block a user