diff --git a/trimsp/src/Chem.pm b/trimsp/src/Chem.pm index b2d01a0..a5d9ccd 100644 --- a/trimsp/src/Chem.pm +++ b/trimsp/src/Chem.pm @@ -561,6 +561,7 @@ sub Densities { "LaAlO3",6.70, "Al2O3",3.98, "SrTiO3",5.12, + "LaTiO3",5.9, "SrLaGaO4",6.389, "SrLaAlO4",5.924, "NbSe2",6.30, diff --git a/trimsp/src/PlotMean.png b/trimsp/src/PlotMean.png new file mode 100644 index 0000000..2c11c3a Binary files /dev/null and b/trimsp/src/PlotMean.png differ diff --git a/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm b/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm index 88d5255..ceaecc2 100644 --- a/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm +++ b/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm @@ -31,6 +31,7 @@ use QtCore4::slots SaveFileAs => []; use Ui_TrimSPGUI4; + sub NEW { my ( $class, $parent ) = @_; $class->SUPER::NEW($parent); @@ -142,7 +143,7 @@ sub CollectValues $All{"scanStep"}=1*$All{"scanStep"}; # Return values to caller - return(%All); + return(\%All); } # Subroutine: Toggle between scan/single run mode and setup scans tab @@ -331,7 +332,7 @@ sub CreateInpFile "; # Get values from form - my %All = CollectValues(); + my %All = %{CollectValues()}; my $projectile=this->{ui}->projComboBox->currentText(); $All{"ProjZ"}=sprintf("%6.2f",Chem::Zof($projectile)); $All{"ProjAM"}=sprintf("%6.2f",Chem::Massof($projectile)); @@ -471,7 +472,7 @@ sub GUIPath # Subroutine: Start the simulation with the current parameters sub StartSequenceOne { - my %All = CollectValues(); + my %All = %{CollectValues()}; my @SValues=(); my @SdzValues=(); my $cmd=""; @@ -577,6 +578,9 @@ sub StartSequenceOne system($cmd); $Progress=100; this->{ui}->progress->setValue($Progress); + undef %All; + undef $cmd; + print "at end\n"; return(1); } @@ -656,6 +660,7 @@ sub OpenFile # Check it is not empty or title line if ($InitPar[0] || $InitPar[1]) { if (!$Types{$InitPar[0]}) { + # No type is found, probably table cell? $Types{$InitPar[0]}="Qt::LineEdit"; } # Get widget by name @@ -682,9 +687,9 @@ sub OpenFile } # Subroutine: Save configuration file to TrimSP.cfg -sub SaveFile +sub GenInitFile { - my %All = CollectValues(); + my %All = %{CollectValues()}; my $InitFile=" [Layers] numLayer=$All{'numLayer'}"; @@ -729,71 +734,36 @@ scanTo=$All{'scanTo'} scanStep=$All{'scanStep'} "; + return($InitFile); +} + + +# Subroutine: Save configuration file to TrimSP.cfg +sub SaveFile +{ + my $InitFile=GenInitFile(); # Save to default file name "TriumSP.cfg" - my $file = "TrimSP.cfg"; - open (OUTF,q{>},"$file" ); - print OUTF (" $InitFile"); - close(OUTF); + my $file = "TrimSP.cfg"; + open (OUTF,q{>},"$file" ); + print OUTF $InitFile; + close(OUTF); } # Subroutine: Save As configuration file sub SaveFileAs { - my %All = CollectValues(); - my $InitFile=" -[Layers] -numLayer=$All{'numLayer'}"; - - for (my $i=1;$i<=$All{"numLayer"};$i++){ - my $Li="L".$i; - my $LComp=$Li."Comp"; - my $Lrho=$Li."rho"; - my $Ld=$Li."d"; - $InitFile=$InitFile." -$LComp=$All{$LComp} -$Lrho=$All{$Lrho} -$Ld=$All{$Ld} -"; - } - - $InitFile=$InitFile." -[ProjectileParameters] -projComboBox=$All{'projComboBox'} -numberProj=$All{'numberProj'} -z0=$All{'z0'} -dz=$All{'dz'} -valEnergy=$All{'valEnergy'} -sigEnergy=$All{'sigEnergy'} -valAngle=$All{'valAngle'} -sigAngle=$All{'sigAngle'} -ranSeed=$All{'ranSeed'} - -[Files] -fileNamePrefix=$All{'fileNamePrefix'} -workPath=$All{'workPath'} - -[ScanSequence] -scanSeq=$All{'scanSeq'} -comboScan=$All{'comboScan'} -radioList=$All{'radioList'} -scanList=$All{'scanList'} -scanListdz=$All{'scanListdz'} -radioLoop=$All{'radioLoop'} -scanFrom=$All{'scanFrom'} -scanTo=$All{'scanTo'} -scanStep=$All{'scanStep'} -"; - + my $InitFile=GenInitFile(); +# Save to selected file name my $file=Qt::FileDialog::getSaveFileName( this, "Choose a filename to save", "TrimSP.cfg", "TrimSP GUI Initialization file (*.cfg)"); -# If the user gave a filename the copy to it +# If the user gave a filename then save to it if ($file ne "") { open (OUTF,q{>},"$file" ); - print OUTF (" $InitFile"); + print OUTF $InitFile; close(OUTF); } } @@ -824,8 +794,8 @@ sub PlotProfiles } } -# Subroutine: Plot implantation fractions in the different layers using -# a root macro +# Subroutine: Plot implantation fractions in the different layers +# using a root macro sub PlotFraction { my $Path=this->{ui}->workPath->text(); @@ -839,14 +809,11 @@ sub PlotFraction my $TrimPath = $ENV{'PERLLIB'}; # Now that we have the file name send it to root macro for plotting. my $cmd='root -n -l "'.$TrimPath.'/../plotFrc.C(\"'.$file.'\")"&'; - my $pid=system($cmd); } - } -# Subroutine: Plot mean depth and straggeling using -# a root macro +# Subroutine: Plot mean depth and straggeling using a root macro sub PlotMean { my $Path=this->{ui}->workPath->text(); @@ -860,10 +827,8 @@ sub PlotMean my $TrimPath = $ENV{'PERLLIB'}; # Now that we have the file name send it to root macro for plotting. my $cmd='root -n -l "'.$TrimPath.'/../plotMean.C(\"'.$file.'\")"&'; - my $pid=system($cmd); } - } # Subroutine: Help window contents diff --git a/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui b/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui index 75ee5ca..3b2ad19 100644 --- a/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui +++ b/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui @@ -1,5 +1,6 @@ + Zaher Salman <zaher.salman@psi.ch> TrimSPGUI4 @@ -21,7 +22,7 @@ - icon.pngicon.png + ../icon.png../icon.png @@ -71,12 +72,15 @@ false + + numLayer + - Select the number of the layers of your structure (maximum 7 layers). + Select the number of the layers of your structure (maximum 100 layers). 1 @@ -194,6 +198,9 @@ false + + z0 + @@ -216,6 +223,9 @@ false + + numberProj + @@ -287,6 +297,9 @@ false + + valEnergy + @@ -337,6 +350,9 @@ false + + projComboBox + @@ -372,6 +388,9 @@ false + + sigAngle + @@ -407,6 +426,9 @@ false + + ranSeed + @@ -505,6 +527,9 @@ false + + valAngle + @@ -521,6 +546,9 @@ false + + sigEnergy + @@ -537,6 +565,9 @@ false + + dz + @@ -560,7 +591,7 @@ 100 - + 0 @@ -575,6 +606,9 @@ false + + fileNamePrefix + @@ -592,10 +626,13 @@ false + + workPath + - + @@ -703,6 +740,9 @@ false + + lineEditEmpty + @@ -719,6 +759,9 @@ false + + parEF + @@ -773,6 +816,9 @@ false + + parIRL + @@ -808,6 +854,9 @@ false + + parKK0 + @@ -824,6 +873,9 @@ false + + parRD + @@ -856,6 +908,9 @@ false + + parIPOTR + @@ -888,6 +943,9 @@ false + + parESB + @@ -923,6 +981,9 @@ false + + parCA + @@ -958,6 +1019,9 @@ false + + parSHEATH + @@ -974,6 +1038,9 @@ false + + parKDEE2 + @@ -990,6 +1057,9 @@ false + + parKDEE1 + @@ -1085,6 +1155,9 @@ false + + parKK0R + @@ -1101,6 +1174,9 @@ false + + parIPOT + @@ -1136,6 +1212,9 @@ false + + parERC + @@ -1216,6 +1295,9 @@ Scan + + comboScan + @@ -1278,9 +1360,6 @@ List of values - - listGroup - @@ -1298,6 +1377,9 @@ false + + scanListdz + @@ -1318,9 +1400,6 @@ true - - listGroup - @@ -1339,6 +1418,9 @@ false + + scanFrom + @@ -1362,6 +1444,9 @@ false + + scanTo + @@ -1385,6 +1470,9 @@ false + + scanStep + @@ -1445,6 +1533,9 @@ Trim.SP binary + + trimbin + @@ -1484,6 +1575,9 @@ Trim.SP GUI path + + pathTrimGUI + @@ -1596,7 +1690,7 @@ - ../../.designer/backup/PlotProfiles.png../../.designer/backup/PlotProfiles.png + ../PlotProfiles.png../PlotProfiles.png &Plot Profiles @@ -1650,7 +1744,7 @@ - ../../.designer/backup/PlotFraction.png../../.designer/backup/PlotFraction.png + ../PlotFraction.png../PlotFraction.png Plot Fractions @@ -1685,6 +1779,10 @@ + + + ../PlotMean.png../PlotMean.png + Plot Mean @@ -1699,6 +1797,8 @@ tabs + numLayer + layerTable projComboBox numberProj z0 @@ -1728,6 +1828,8 @@ parIPOTR parIRL scanSeq + comboScan + scandL radioList scanList scanListdz @@ -1735,6 +1837,10 @@ scanFrom scanTo scanStep + trimbin + TrimBinBrowse + pathTrimGUI + guiPathBrowse @@ -1941,7 +2047,7 @@ 110 - 749 + 711 111 @@ -2037,7 +2143,7 @@ 89 - 726 + 711 91 @@ -2053,7 +2159,7 @@ 107 - 731 + 711 103 @@ -2069,7 +2175,7 @@ 162 - 727 + 711 154 @@ -2106,6 +2212,38 @@ + + Start + clicked() + TrimSPGUI4 + CollectValues() + + + 523 + 541 + + + 712 + 550 + + + + + plotMeanAction + activated() + TrimSPGUI4 + PlotMean() + + + -1 + -1 + + + 355 + 310 + + + DirectoryBrowse() @@ -2129,7 +2267,4 @@ findDensity() PlotMean() - - - diff --git a/trimsp/src/TrimSPGUI4/Ui_TrimSPGUI4.pm b/trimsp/src/TrimSPGUI4/Ui_TrimSPGUI4.pm index c2b1c3f..52c9304 100644 --- a/trimsp/src/TrimSPGUI4/Ui_TrimSPGUI4.pm +++ b/trimsp/src/TrimSPGUI4/Ui_TrimSPGUI4.pm @@ -5,7 +5,7 @@ ################################################################################# ## Form generated from reading UI file 'TrimSPGUI4.ui' ## -## Created: Thu Feb 26 13:34:12 2015 +## Created: Wed Jun 24 14:33:41 2015 ## by: Qt User Interface Compiler version 4.8.6 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! @@ -194,8 +194,8 @@ sub layout14 { return shift->{layout14}; } -sub vboxLayout { - return shift->{vboxLayout}; +sub fileNames { + return shift->{fileNames}; } sub textLabelFN { @@ -210,8 +210,8 @@ sub textLabelPath { return shift->{textLabelPath}; } -sub hboxLayout { - return shift->{hboxLayout}; +sub outputDirectory { + return shift->{outputDirectory}; } sub workPath { @@ -509,7 +509,7 @@ sub setupUi { $sizePolicy->setHeightForWidth( $trimSPGUI4->sizePolicy()->hasHeightForWidth() ); $trimSPGUI4->setSizePolicy( $sizePolicy ); my $icon = Qt::Icon(); - $icon->addPixmap(Qt::Pixmap("icon.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); + $icon->addPixmap(Qt::Pixmap("../icon.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); $trimSPGUI4->setWindowIcon( $icon ); my $fileSaveAction = Qt::Action($trimSPGUI4); $self->{fileSaveAction} = $fileSaveAction; @@ -528,7 +528,7 @@ sub setupUi { $self->{plotProfilesAction} = $plotProfilesAction; $plotProfilesAction->setObjectName( "plotProfilesAction" ); my $icon1 = Qt::Icon(); - $icon1->addPixmap(Qt::Pixmap("../../.designer/backup/PlotProfiles.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); + $icon1->addPixmap(Qt::Pixmap("../PlotProfiles.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); $plotProfilesAction->setIcon( $icon1 ); my $helpContentsAction = Qt::Action($trimSPGUI4); $self->{helpContentsAction} = $helpContentsAction; @@ -549,7 +549,7 @@ sub setupUi { $plotFractionsAction->setChecked( 0 ); $plotFractionsAction->setEnabled( 1 ); my $icon4 = Qt::Icon(); - $icon4->addPixmap(Qt::Pixmap("../../.designer/backup/PlotFraction.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); + $icon4->addPixmap(Qt::Pixmap("../PlotFraction.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); $plotFractionsAction->setIcon( $icon4 ); my $fileStartAction = Qt::Action($trimSPGUI4); $self->{fileStartAction} = $fileStartAction; @@ -560,6 +560,9 @@ sub setupUi { my $plotMeanAction = Qt::Action($trimSPGUI4); $self->{plotMeanAction} = $plotMeanAction; $plotMeanAction->setObjectName( "plotMeanAction" ); + my $icon5 = Qt::Icon(); + $icon5->addPixmap(Qt::Pixmap("../PlotMean.png"), Qt::Icon::Normal(), Qt::Icon::Off() ); + $plotMeanAction->setIcon( $icon5 ); my $widget = Qt::Widget( $trimSPGUI4 ); $self->{widget} = $widget; $widget->setObjectName( "widget" ); @@ -757,41 +760,41 @@ sub setupUi { $self->{layout14} = $layout14; $layout14->setObjectName( "layout14" ); $layout14->setGeometry( Qt::Rect(10, 20, 221, 100) ); - my $vboxLayout = Qt::VBoxLayout( $layout14 ); - $self->{vboxLayout} = $vboxLayout; - $vboxLayout->setSpacing( 0 ); - $vboxLayout->setMargin( 0 ); - $vboxLayout->setObjectName( "vboxLayout" ); - $vboxLayout->setContentsMargins(0, 0, 0, 0 ); + my $fileNames = Qt::VBoxLayout( $layout14 ); + $self->{FileNames} = $fileNames; + $fileNames->setSpacing( 0 ); + $fileNames->setMargin( 0 ); + $fileNames->setObjectName( "fileNames" ); + $fileNames->setContentsMargins(0, 0, 0, 0 ); my $textLabelFN = Qt::Label( $layout14 ); $self->{textLabelFN} = $textLabelFN; $textLabelFN->setObjectName( "textLabelFN" ); $textLabelFN->setWordWrap( 0 ); - $vboxLayout->addWidget( $textLabelFN ); + $fileNames->addWidget( $textLabelFN ); my $fileNamePrefix = Qt::LineEdit( $layout14 ); $self->{fileNamePrefix} = $fileNamePrefix; $fileNamePrefix->setObjectName( "fileNamePrefix" ); - $vboxLayout->addWidget( $fileNamePrefix ); + $fileNames->addWidget( $fileNamePrefix ); my $textLabelPath = Qt::Label( $layout14 ); $self->{textLabelPath} = $textLabelPath; $textLabelPath->setObjectName( "textLabelPath" ); $textLabelPath->setWordWrap( 0 ); - $vboxLayout->addWidget( $textLabelPath ); + $fileNames->addWidget( $textLabelPath ); - my $hboxLayout = Qt::HBoxLayout( ); - $self->{hboxLayout} = $hboxLayout; - $hboxLayout->setSpacing( 6 ); - $hboxLayout->setObjectName( "hboxLayout" ); + my $outputDirectory = Qt::HBoxLayout( ); + $self->{OutputDirectory} = $outputDirectory; + $outputDirectory->setSpacing( 6 ); + $outputDirectory->setObjectName( "outputDirectory" ); my $workPath = Qt::LineEdit( $layout14 ); $self->{workPath} = $workPath; $workPath->setObjectName( "workPath" ); - $hboxLayout->addWidget( $workPath ); + $outputDirectory->addWidget( $workPath ); my $browse = Qt::PushButton( $layout14 ); $self->{browse} = $browse; @@ -803,10 +806,10 @@ sub setupUi { $sizePolicy4->setHeightForWidth( $browse->sizePolicy()->hasHeightForWidth() ); $browse->setSizePolicy( $sizePolicy4 ); - $hboxLayout->addWidget( $browse ); + $outputDirectory->addWidget( $browse ); - $vboxLayout->addLayout( $hboxLayout ); + $fileNames->addLayout( $outputDirectory ); my $splitter = Qt::Splitter( $groupBox15 ); $self->{splitter} = $splitter; @@ -1233,7 +1236,42 @@ sub setupUi { $self->{helpMenu} = $helpMenu; $helpMenu->setObjectName( "helpMenu" ); $trimSPGUI4->setMenuBar( $menuBar ); - Qt::Widget::setTabOrder( $tabs, $projComboBox ); + $textLabel1_4->setBuddy( $numLayer ); + $z0Label->setBuddy( $z0 ); + $numberLabel->setBuddy( $numberProj ); + $energyLabel->setBuddy( $valEnergy ); + $textLabel1->setBuddy( $projComboBox ); + $sigAngleLabel->setBuddy( $sigAngle ); + $seedLabel->setBuddy( $ranSeed ); + $albleLabel->setBuddy( $valAngle ); + $sigELabel->setBuddy( $sigEnergy ); + $dzLabel->setBuddy( $dz ); + $textLabelFN->setBuddy( $fileNamePrefix ); + $textLabelPath->setBuddy( $workPath ); + $textLabelEmpty->setBuddy( $lineEditEmpty ); + $textLabelEF->setBuddy( $parEF ); + $textLabelIRL->setBuddy( $parIRL ); + $textLabelKK0->setBuddy( $parKK0 ); + $textLabelRD->setBuddy( $parRD ); + $textLabelIPOTR->setBuddy( $parIPOTR ); + $textLabelESB->setBuddy( $parESB ); + $textLabelCA->setBuddy( $parCA ); + $textLabelSHEATH->setBuddy( $parSHEATH ); + $textLabelKDEE2->setBuddy( $parKDEE2 ); + $textLabelKDEE1->setBuddy( $parKDEE1 ); + $textLabelKK0R->setBuddy( $parKK0R ); + $textLabelIPOT->setBuddy( $parIPOT ); + $textLabelERC->setBuddy( $parERC ); + $label->setBuddy( $comboScan ); + $dzListLabel->setBuddy( $scanListdz ); + $textLabel2->setBuddy( $scanFrom ); + $textLabel2_2->setBuddy( $scanTo ); + $textLabel2_2_2_2->setBuddy( $scanStep ); + $label_2->setBuddy( $trimbin ); + $label_3->setBuddy( $pathTrimGUI ); + Qt::Widget::setTabOrder( $tabs, $numLayer ); + Qt::Widget::setTabOrder( $numLayer, $layerTable ); + Qt::Widget::setTabOrder( $layerTable, $projComboBox ); Qt::Widget::setTabOrder( $projComboBox, $numberProj ); Qt::Widget::setTabOrder( $numberProj, $z0 ); Qt::Widget::setTabOrder( $z0, $dz ); @@ -1262,13 +1300,19 @@ sub setupUi { Qt::Widget::setTabOrder( $parIPOT, $parIPOTR ); Qt::Widget::setTabOrder( $parIPOTR, $parIRL ); Qt::Widget::setTabOrder( $parIRL, $scanSeq ); - Qt::Widget::setTabOrder( $scanSeq, $radioList ); + Qt::Widget::setTabOrder( $scanSeq, $comboScan ); + Qt::Widget::setTabOrder( $comboScan, $scandL ); + Qt::Widget::setTabOrder( $scandL, $radioList ); Qt::Widget::setTabOrder( $radioList, $scanList ); Qt::Widget::setTabOrder( $scanList, $scanListdz ); Qt::Widget::setTabOrder( $scanListdz, $radioLoop ); Qt::Widget::setTabOrder( $radioLoop, $scanFrom ); Qt::Widget::setTabOrder( $scanFrom, $scanTo ); Qt::Widget::setTabOrder( $scanTo, $scanStep ); + Qt::Widget::setTabOrder( $scanStep, $trimbin ); + Qt::Widget::setTabOrder( $trimbin, $trimBinBrowse ); + Qt::Widget::setTabOrder( $trimBinBrowse, $pathTrimGUI ); + Qt::Widget::setTabOrder( $pathTrimGUI, $guiPathBrowse ); $menuBar->addAction( $file->menuAction() ); $menuBar->addAction( $plot->menuAction() ); @@ -1311,6 +1355,8 @@ sub setupUi { Qt::Object::connect($guiPathBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'GUIPath()' ); Qt::Object::connect($numLayer, SIGNAL 'valueChanged(int)' , $trimSPGUI4, SLOT 'PrepLayers()' ); Qt::Object::connect($layerTable, SIGNAL 'cellChanged(int,int)' , $trimSPGUI4, SLOT 'findDensity()' ); + Qt::Object::connect($start, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'CollectValues()' ); + Qt::Object::connect($plotMeanAction, SIGNAL 'activated()' , $trimSPGUI4, SLOT 'PlotMean()' ); $tabs->setCurrentIndex( 0 ); @@ -1362,7 +1408,7 @@ sub retranslateUi { $self->{plotMeanAction}->setShortcut( Qt::KeySequence( Qt::Application::translate( 'TrimSPGUI4', "Ctrl+P, Ctrl+M", undef, Qt::Application::UnicodeUTF8() ) ) ); $self->{groupLayer}->setTitle( Qt::Application::translate( 'TrimSPGUI4', "Layers", undef, Qt::Application::UnicodeUTF8() ) ); $self->{textLabel1_4}->setText( Qt::Application::translate( 'TrimSPGUI4', "Number of Layers", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{numLayer}->setWhatsThis( Qt::Application::translate( 'TrimSPGUI4', "Select the number of the layers of your structure (maximum 7 layers).", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{numLayer}->setWhatsThis( Qt::Application::translate( 'TrimSPGUI4', "Select the number of the layers of your structure (maximum 100 layers).", undef, Qt::Application::UnicodeUTF8() ) ); my $layerTable = $self->{layerTable}; if ( $layerTable->columnCount < 3 ) { $layerTable->setColumnCount(3);