Added checking for chemical formula and better coloring scheme for plots.
This commit is contained in:
parent
c4b73dba4e
commit
d438ba41dd
@ -360,13 +360,16 @@ sub CreateInpFile
|
|||||||
$All{$LComp} = $Comp;
|
$All{$LComp} = $Comp;
|
||||||
my %LElComp=Chem::parse_formula($Comp);
|
my %LElComp=Chem::parse_formula($Comp);
|
||||||
foreach my $key (keys %LElComp) {
|
foreach my $key (keys %LElComp) {
|
||||||
if ($key eq "") {
|
# Check if composition is understood
|
||||||
|
if ($key eq "" || Chem::Zof($key) eq "") {
|
||||||
$Check++;
|
$Check++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($Comp eq "") {$Check++;}
|
if ($Comp eq "") {$Check++;}
|
||||||
# Write composition to results file header
|
# Write composition to results file header
|
||||||
|
|
||||||
|
|
||||||
# Densities of layers
|
# Densities of layers
|
||||||
my $Lrho="L".$i."rho";
|
my $Lrho="L".$i."rho";
|
||||||
my $rho = this->{ui}->layerTable->item($i-1,1)->text();
|
my $rho = this->{ui}->layerTable->item($i-1,1)->text();
|
||||||
@ -381,7 +384,7 @@ sub CreateInpFile
|
|||||||
|
|
||||||
# Sanity check, is the layer supposed to have value? are they all there?
|
# Sanity check, is the layer supposed to have value? are they all there?
|
||||||
if ($Check!=0) {
|
if ($Check!=0) {
|
||||||
my $ErrMsg="Error: Layer $i is empty or bad chemical formula.\nPleach check!\n";
|
my $ErrMsg="Error: Bad chemical formula in Layer $i.\nPleach check!\n";
|
||||||
print STDERR $ErrMsg;
|
print STDERR $ErrMsg;
|
||||||
my $HelpWindow = Qt::MessageBox::information( this, "Error!",$ErrMsg);
|
my $HelpWindow = Qt::MessageBox::information( this, "Error!",$ErrMsg);
|
||||||
return("ERROR");
|
return("ERROR");
|
||||||
|
@ -50,23 +50,9 @@ void plotRge(TString &names)
|
|||||||
|
|
||||||
|
|
||||||
Int_t col;
|
Int_t col;
|
||||||
Int_t color[1000];
|
|
||||||
for (i=0; i<1000; i++)
|
|
||||||
color[i] = -1;
|
|
||||||
color[0] = TColor::kRed;
|
|
||||||
color[1] = TColor::kGreen;
|
|
||||||
color[2] = TColor::kBlue;
|
|
||||||
color[3] = TColor::kMagenta;
|
|
||||||
color[4] = TColor::kOrange;
|
|
||||||
color[5] = TColor::kViolet;
|
|
||||||
color[6] = TColor::kAzure+7;
|
|
||||||
color[7] = TColor::kOrange+4;
|
|
||||||
color[8] = TColor::kBlue-7;
|
|
||||||
|
|
||||||
TGraph *rge[1000];
|
TGraph *rge[1000];
|
||||||
|
|
||||||
TMultiGraph *mg = new TMultiGraph();
|
TMultiGraph *mg = new TMultiGraph();
|
||||||
|
|
||||||
TLegend *legend = new TLegend(0.7, 0.7, 0.95, 0.95);
|
TLegend *legend = new TLegend(0.7, 0.7, 0.95, 0.95);
|
||||||
legend->SetFillColor(TColor::GetColor(255,255,255)); // white
|
legend->SetFillColor(TColor::GetColor(255,255,255)); // white
|
||||||
|
|
||||||
@ -115,16 +101,10 @@ void plotRge(TString &names)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rge[i] = new TGraph(nStep, depth, normStop);
|
rge[i] = new TGraph(nStep, depth, normStop);
|
||||||
if (color[i] >= 0) {
|
col = TColor::GetColorBright(i+1);
|
||||||
rge[i]->SetMarkerColor(color[i]);
|
rge[i]->SetMarkerColor(col);
|
||||||
rge[i]->SetLineColor(color[i]);
|
rge[i]->SetLineColor(col);
|
||||||
} else {
|
|
||||||
TRandom *rand = new TRandom(i);
|
|
||||||
col = TColor::GetColor((Int_t)rand->Integer(255),(Int_t)rand->Integer(255),(Int_t)rand->Integer(255));
|
|
||||||
rge[i]->SetMarkerColor(col);
|
|
||||||
rge[i]->SetLineColor(col);
|
|
||||||
delete rand;
|
|
||||||
}
|
|
||||||
rge[i]->SetMarkerStyle(20);
|
rge[i]->SetMarkerStyle(20);
|
||||||
|
|
||||||
mg->Add(rge[i]);
|
mg->Add(rge[i]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user