Automatically update density of found
This commit is contained in:
parent
550c5b44f6
commit
ab5b8480cf
@ -928,17 +928,19 @@ Copyright 2009-2013 by Zaher Salman.
|
|||||||
sub findDensity()
|
sub findDensity()
|
||||||
{
|
{
|
||||||
use Chem;
|
use Chem;
|
||||||
|
# This is needed only for changes in the first column
|
||||||
|
my $col = this->{ui}->layerTable->currentColumn();
|
||||||
|
my $row = this->{ui}->layerTable->currentRow();
|
||||||
|
if ($col == 0) {
|
||||||
# Get sender name to know which layer
|
# Get sender name to know which layer
|
||||||
my $sender = this->sender()->objectName();
|
my $sender = this->{ui}->layerTable->currentItem();
|
||||||
# Generate the name of the density field
|
|
||||||
my $rhoSender = substr($sender,0,6)."rho";
|
|
||||||
# Get the compound formula
|
# Get the compound formula
|
||||||
my $Compound = this->sender()->text();
|
my $Compound = $sender->text();
|
||||||
# See if you have the density
|
# See if you have the density
|
||||||
my $Density=Chem::Densities($Compound);
|
my $Density=Chem::Densities($Compound);
|
||||||
# If the density is in the database submit it
|
# If the density is in the database submit it
|
||||||
my $rho = child("Qt::LineEdit",$rhoSender);
|
if ($Density != 0 ) {this->{ui}->layerTable->item($row,$col+1)->setText($Density);}
|
||||||
$rho->setText($Density);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Subroutine: keep for tests and debugging
|
# Subroutine: keep for tests and debugging
|
||||||
|
@ -2088,6 +2088,22 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>layerTable</sender>
|
||||||
|
<signal>cellChanged(int,int)</signal>
|
||||||
|
<receiver>TrimSPGUI4</receiver>
|
||||||
|
<slot>findDensity()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>233</x>
|
||||||
|
<y>332</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>360</x>
|
||||||
|
<y>310</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>DirectoryBrowse()</slot>
|
<slot>DirectoryBrowse()</slot>
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
## Form generated from reading UI file 'TrimSPGUI4-test.ui'
|
## Form generated from reading UI file 'TrimSPGUI4.ui'
|
||||||
##
|
##
|
||||||
## Created: Fri Feb 20 17:48:51 2015
|
## Created: Fri Feb 20 18:27:08 2015
|
||||||
## by: Qt User Interface Compiler version 4.8.6
|
## by: Qt User Interface Compiler version 4.8.6
|
||||||
##
|
##
|
||||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
@ -1307,6 +1307,7 @@ sub setupUi {
|
|||||||
Qt::Object::connect($trimBinBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'TrimBin()' );
|
Qt::Object::connect($trimBinBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'TrimBin()' );
|
||||||
Qt::Object::connect($guiPathBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'GUIPath()' );
|
Qt::Object::connect($guiPathBrowse, SIGNAL 'clicked()' , $trimSPGUI4, SLOT 'GUIPath()' );
|
||||||
Qt::Object::connect($numLayer, SIGNAL 'valueChanged(int)' , $trimSPGUI4, SLOT 'PrepLayers()' );
|
Qt::Object::connect($numLayer, SIGNAL 'valueChanged(int)' , $trimSPGUI4, SLOT 'PrepLayers()' );
|
||||||
|
Qt::Object::connect($layerTable, SIGNAL 'cellChanged(int,int)' , $trimSPGUI4, SLOT 'findDensity()' );
|
||||||
|
|
||||||
$tabs->setCurrentIndex( 0 );
|
$tabs->setCurrentIndex( 0 );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user