diff --git a/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm b/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm
index 9200528..84739d5 100644
--- a/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm
+++ b/trimsp/src/TrimSPGUI4/TrimSPGUI4.pm
@@ -13,6 +13,7 @@ use Ui_TrimSPGUI4;
use QtCore4::slots
# test => [],
ToggleScanSingle => [],
+ findDensity => [],
PrepLayers => [],
ProjSmartDefaults => [],
helpAboutAction => [],
@@ -972,6 +973,25 @@ Copyright 2009-2013 by Zaher Salman.
my $HelpWindow = Qt::MessageBox::about( this, "About TrimSP GUI",$HelpText);
}
+# Subroutine: Find density of material from database
+sub findDensity()
+{
+ use Chem;
+# Get sender name to know which layer
+ my $sender = this->sender()->objectName();
+# Generate the name of the density field
+ my $rhoSender = substr($sender,0,6)."rho";
+# Get the compound formula
+ my $Compound = this->sender()->text();
+# See if you have the density
+ my $Density=Chem::Densities($Compound);
+ if ($Density ne "") {
+# If the density is in the database submit it
+ my $rho = child("Qt::LineEdit",$rhoSender);
+ $rho->setText($Density);
+ }
+}
+
# Subroutine: keep for tests and debugging
sub test()
{
diff --git a/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui b/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui
index cdd1457..bd33d6b 100644
--- a/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui
+++ b/trimsp/src/TrimSPGUI4/TrimSPGUI4.ui
@@ -365,6 +365,10 @@
+ layer4Comp
+ layer4rho
+ layer4d
+ layer1Comp
-
@@ -1754,7 +1758,7 @@
Configure
-
+
10
@@ -2460,6 +2464,118 @@
+
+ layer1Comp
+ textChanged(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 131
+ 219
+
+
+ 722
+ 391
+
+
+
+
+ layer2Comp
+ textChanged(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 108
+ 271
+
+
+ 721
+ 357
+
+
+
+
+ layer3Comp
+ textChanged(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 90
+ 320
+
+
+ 720
+ 427
+
+
+
+
+ layer4Comp
+ textChanged(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 79
+ 382
+
+
+ 718
+ 458
+
+
+
+
+ layer5Comp
+ textChanged(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 102
+ 434
+
+
+ 718
+ 488
+
+
+
+
+ layer6Comp
+ textEdited(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 88
+ 481
+
+
+ 719
+ 603
+
+
+
+
+ layer7Comp
+ textChanged(QString)
+ TrimSPGUI4
+ findDensity()
+
+
+ 71
+ 532
+
+
+ 714
+ -7
+
+
+
DirectoryBrowse()
@@ -2480,6 +2596,7 @@
test()
TrimBin()
GUIPath()
+ findDensity()
diff --git a/trimsp/src/TrimSPGUI4/Ui_TrimSPGUI4.pm b/trimsp/src/TrimSPGUI4/Ui_TrimSPGUI4.pm
index 3d82a72..ee555b7 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: Tue Feb 5 16:22:06 2013
+## Created: Thu Feb 7 16:51:02 2013
## by: Qt User Interface Compiler version 4.8.4
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
@@ -566,8 +566,8 @@ sub configTab {
return shift->{configTab};
}
-sub widget1 {
- return shift->{widget1};
+sub layoutWidget1 {
+ return shift->{layoutWidget1};
}
sub verticalLayout_2 {
@@ -870,6 +870,10 @@ sub setupUi {
$layer4d->setGeometry( Qt::Rect(320, 20, 85, 25) );
$sizePolicy->setHeightForWidth( $layer4d->sizePolicy()->hasHeightForWidth() );
$layer4d->setSizePolicy( $sizePolicy );
+ $layer4Comp->raise();
+ $layer4rho->raise();
+ $layer4d->raise();
+ $layer1Comp->raise();
$vboxLayout->addWidget( $boxL4 );
@@ -1452,11 +1456,11 @@ sub setupUi {
my $configTab = Qt::Widget( );
$self->{configTab} = $configTab;
$configTab->setObjectName( "configTab" );
- my $widget1 = Qt::Widget( $configTab );
- $self->{widget1} = $widget1;
- $widget1->setObjectName( "widget1" );
- $widget1->setGeometry( Qt::Rect(10, 31, 671, 101) );
- my $verticalLayout_2 = Qt::VBoxLayout( $widget1 );
+ my $layoutWidget1 = Qt::Widget( $configTab );
+ $self->{layoutWidget1} = $layoutWidget1;
+ $layoutWidget1->setObjectName( "layoutWidget1" );
+ $layoutWidget1->setGeometry( Qt::Rect(10, 31, 671, 101) );
+ my $verticalLayout_2 = Qt::VBoxLayout( $layoutWidget1 );
$self->{verticalLayout_2} = $verticalLayout_2;
$verticalLayout_2->setSpacing( 6 );
$verticalLayout_2->setMargin( 11 );
@@ -1466,7 +1470,7 @@ sub setupUi {
$self->{horizontalLayout} = $horizontalLayout;
$horizontalLayout->setSpacing( 6 );
$horizontalLayout->setObjectName( "horizontalLayout" );
- my $label_2 = Qt::Label( $widget1 );
+ my $label_2 = Qt::Label( $layoutWidget1 );
$self->{label_2} = $label_2;
$label_2->setObjectName( "label_2" );
my $sizePolicy9 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Preferred() );
@@ -1480,13 +1484,13 @@ sub setupUi {
$horizontalLayout->addWidget( $label_2 );
- my $trimbin = Qt::LineEdit( $widget1 );
+ my $trimbin = Qt::LineEdit( $layoutWidget1 );
$self->{trimbin} = $trimbin;
$trimbin->setObjectName( "trimbin" );
$horizontalLayout->addWidget( $trimbin );
- my $trimBinBrowse = Qt::PushButton( $widget1 );
+ my $trimBinBrowse = Qt::PushButton( $layoutWidget1 );
$self->{trimBinBrowse} = $trimBinBrowse;
$trimBinBrowse->setObjectName( "trimBinBrowse" );
@@ -1499,7 +1503,7 @@ sub setupUi {
$self->{horizontalLayout_2} = $horizontalLayout_2;
$horizontalLayout_2->setSpacing( 6 );
$horizontalLayout_2->setObjectName( "horizontalLayout_2" );
- my $label_3 = Qt::Label( $widget1 );
+ my $label_3 = Qt::Label( $layoutWidget1 );
$self->{label_3} = $label_3;
$label_3->setObjectName( "label_3" );
$sizePolicy9->setHeightForWidth( $label_3->sizePolicy()->hasHeightForWidth() );
@@ -1509,13 +1513,13 @@ sub setupUi {
$horizontalLayout_2->addWidget( $label_3 );
- my $pathTrimGUI = Qt::LineEdit( $widget1 );
+ my $pathTrimGUI = Qt::LineEdit( $layoutWidget1 );
$self->{pathTrimGUI} = $pathTrimGUI;
$pathTrimGUI->setObjectName( "pathTrimGUI" );
$horizontalLayout_2->addWidget( $pathTrimGUI );
- my $guiPathBrowse = Qt::PushButton( $widget1 );
+ my $guiPathBrowse = Qt::PushButton( $layoutWidget1 );
$self->{guiPathBrowse} = $guiPathBrowse;
$guiPathBrowse->setObjectName( "guiPathBrowse" );
@@ -1642,6 +1646,13 @@ sub setupUi {
Qt::Object::connect($projComboBox, SIGNAL 'currentIndexChanged(int)' , $trimSPGUI4, SLOT 'ProjSmartDefaults()' );
Qt::Object::connect($trimBinBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'TrimBin()' );
Qt::Object::connect($guiPathBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'GUIPath()' );
+ Qt::Object::connect($layer1Comp, SIGNAL 'textChanged(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
+ Qt::Object::connect($layer2Comp, SIGNAL 'textChanged(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
+ Qt::Object::connect($layer3Comp, SIGNAL 'textChanged(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
+ Qt::Object::connect($layer4Comp, SIGNAL 'textChanged(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
+ Qt::Object::connect($layer5Comp, SIGNAL 'textChanged(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
+ Qt::Object::connect($layer6Comp, SIGNAL 'textEdited(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
+ Qt::Object::connect($layer7Comp, SIGNAL 'textChanged(QString)' , $trimSPGUI4, SLOT 'findDensity()' );
$tabs->setCurrentIndex( 0 );