diff --git a/trimsp/src/TrimSPGUI/TrimSPGUI.pl b/trimsp/src/TrimSPGUI/TrimSPGUI.pl index f368c37..93c4c86 100644 --- a/trimsp/src/TrimSPGUI/TrimSPGUI.pl +++ b/trimsp/src/TrimSPGUI/TrimSPGUI.pl @@ -1,6 +1,6 @@ # Form implementation generated from reading ui file 'TrimSPGUI.ui' # -# Created: Thu Apr 4 13:53:16 2013 +# Created: Mon Apr 8 11:03:16 2013 # by: The PerlQt User Interface Compiler (puic) # # WARNING! All changes made in this file will be lost! @@ -67,7 +67,7 @@ use Qt::attributes qw( groupBox1 textLabel1_4 NL - LayerTable + layerTable AddParTab AddParam textLabelEF @@ -1439,25 +1439,25 @@ sub NEW $layout19->addItem($spacer); $layout66->addLayout($layout19); - LayerTable = Qt::Table($LayoutWidget_4, "LayerTable"); - LayerTable->setNumCols(LayerTable->numCols() + 1); - LayerTable->horizontalHeader()->setLabel(LayerTable->numCols() - 1, trUtf8("Composition")); - LayerTable->setNumCols(LayerTable->numCols() + 1); - LayerTable->horizontalHeader()->setLabel(LayerTable->numCols() - 1, trUtf8("Density [g/cm^3]")); - LayerTable->setNumCols(LayerTable->numCols() + 1); - LayerTable->horizontalHeader()->setLabel(LayerTable->numCols() - 1, trUtf8("Thickness [Å]")); - LayerTable->setSizePolicy( Qt::SizePolicy(4, 4, 100, 100, LayerTable->sizePolicy()->hasHeightForWidth()) ); - LayerTable->setMinimumSize( Qt::Size(410, 405) ); - LayerTable->setAcceptDrops( 1 ); - LayerTable->setResizePolicy( &Qt::Table::AutoOneFit() ); - LayerTable->setDragAutoScroll( 1 ); - LayerTable->setNumRows( int(1) ); - LayerTable->setNumCols( int(3) ); - LayerTable->setRowMovingEnabled( 0 ); - LayerTable->setReadOnly( 0 ); - LayerTable->setSelectionMode( &Qt::Table::NoSelection() ); - LayerTable->setFocusStyle( &Qt::Table::FollowStyle() ); - $layout66->addWidget(LayerTable); + layerTable = Qt::Table($LayoutWidget_4, "layerTable"); + layerTable->setNumCols(layerTable->numCols() + 1); + layerTable->horizontalHeader()->setLabel(layerTable->numCols() - 1, trUtf8("Composition")); + layerTable->setNumCols(layerTable->numCols() + 1); + layerTable->horizontalHeader()->setLabel(layerTable->numCols() - 1, trUtf8("Density [g/cm^3]")); + layerTable->setNumCols(layerTable->numCols() + 1); + layerTable->horizontalHeader()->setLabel(layerTable->numCols() - 1, trUtf8("Thickness [Å]")); + layerTable->setSizePolicy( Qt::SizePolicy(4, 4, 100, 100, layerTable->sizePolicy()->hasHeightForWidth()) ); + layerTable->setMinimumSize( Qt::Size(410, 405) ); + layerTable->setAcceptDrops( 1 ); + layerTable->setResizePolicy( &Qt::Table::AutoOneFit() ); + layerTable->setDragAutoScroll( 1 ); + layerTable->setNumRows( int(1) ); + layerTable->setNumCols( int(3) ); + layerTable->setRowMovingEnabled( 0 ); + layerTable->setReadOnly( 0 ); + layerTable->setSelectionMode( &Qt::Table::NoSelection() ); + layerTable->setFocusStyle( &Qt::Table::FollowStyle() ); + $layout66->addWidget(layerTable); tabs->insertTab( LayersTab, "" ); AddParTab = Qt::Widget(tabs, "AddParTab"); @@ -1801,7 +1801,7 @@ sub NEW Qt::Object::connect(helpContentsAction, SIGNAL "activated()", this, SLOT "OpenHelpWindow()"); Qt::Object::connect(fileQuitAction, SIGNAL "activated()", this, SLOT "ConfirmQuit()"); Qt::Object::connect(fileChangeDirAction, SIGNAL "activated()", this, SLOT "DirectoryBrowse()"); - Qt::Object::connect(LayerTable, SIGNAL "valueChanged(int,int)", this, SLOT "findDensity()"); + Qt::Object::connect(layerTable, SIGNAL "valueChanged(int,int)", this, SLOT "findDensity()"); setTabOrder(tabs, NL); setTabOrder(NL, ProjType); @@ -1897,9 +1897,9 @@ sub languageChange groupBox1->setTitle( trUtf8("Layers") ); textLabel1_4->setText( trUtf8("Number of Layers") ); Qt::WhatsThis::add(NL, trUtf8("Select the number of the layers of your structure (maximum 7 layers).")); - LayerTable->horizontalHeader()->setLabel( 0, trUtf8("Composition") ); - LayerTable->horizontalHeader()->setLabel( 1, trUtf8("Density [g/cm^3]") ); - LayerTable->horizontalHeader()->setLabel( 2, trUtf8("Thickness [Å]") ); + layerTable->horizontalHeader()->setLabel( 0, trUtf8("Composition") ); + layerTable->horizontalHeader()->setLabel( 1, trUtf8("Density [g/cm^3]") ); + layerTable->horizontalHeader()->setLabel( 2, trUtf8("Thickness [Å]") ); tabs->changeTab( LayersTab, trUtf8("Layers") ); AddParam->setTitle( trUtf8("Additional parameters") ); textLabelEF->setText( trUtf8("EF") ); @@ -2051,7 +2051,7 @@ sub ToggleScanSingle NProj->setDisabled(0); # NProj->setText("10000"); for (my $i=1;$i<=$All{"NL"};$i++) { - my $LayerAttrib = LayerTable->item($i-1,2); + my $LayerAttrib = layerTable->item($i-1,2); $LayerAttrib->setEnabled(1); } @@ -2083,7 +2083,7 @@ sub ToggleScanSingle Angle->setDisabled(0); SigAngle->setDisabled(0); NProj->setDisabled(0); - LayerTable->setColumnReadOnly(2,0); + layerTable->setColumnReadOnly(2,0); # then disable one if ($All{"ERadio"}) { E->setDisabled(1); @@ -2096,7 +2096,7 @@ sub ToggleScanSingle } elsif ($All{"NProjRadio"}) { NProj->setDisabled(1); } elsif($All{"dRadio"}) { - my $LayerAttrib = LayerTable->item($All{"ScandL"}-1,2); + my $LayerAttrib = layerTable->item($All{"ScandL"}-1,2); $LayerAttrib->setEnabled(0); } # and change title of tab to say enabled @@ -2115,12 +2115,11 @@ sub PrepLayers $All{"NL"}=NL->text(); # Prepare enough Rows in table for layers - my $OldNL=LayerTable->numRows(); + my $OldNL=layerTable->numRows(); if ($OldNL<=$All{"NL"}) { - LayerTable->setNumRows($All{"NL"}); + layerTable->setNumRows($All{"NL"}); } else { for (my $i=$All{"NL"};$i<=$OldNL-1;$i++) { - print $i."\n"; removeRowFromTable($i); } } @@ -2138,20 +2137,20 @@ sub removeRowFromTable my ($deadRow) = @_; # Loop over columns and take items of the row to remove - for my $col (0..LayerTable->numCols()-1) { - my $dummy=LayerTable->item($deadRow, $col); + for my $col (0..layerTable->numCols()-1) { + my $dummy=layerTable->item($deadRow, $col); # In the items is not defined the row can be removed by simply # reducing the number of rows in table if ($dummy ne "") { - LayerTable->takeItem(LayerTable->item($deadRow, $col)); - for my $row ($deadRow..LayerTable->numRows()-2) { - my $item = LayerTable->item($row+1, $col); - LayerTable->takeItem($item); - LayerTable->setItem($row, $col, $item); + layerTable->takeItem(layerTable->item($deadRow, $col)); + for my $row ($deadRow..layerTable->numRows()-2) { + my $item = layerTable->item($row+1, $col); + layerTable->takeItem($item); + layerTable->setItem($row, $col, $item); } } } - LayerTable->setNumRows(LayerTable->numRows()-1); + layerTable->setNumRows(layerTable->numRows()-1); } @@ -2230,9 +2229,9 @@ sub CollectValues my $LComp = "L".$i."Comp"; my $Lrho="L".$i."rho"; my $Ld="L".$i."d"; - $All{"$LComp"}=LayerTable->text($i-1,0); - $All{"$Lrho"}=LayerTable->text($i-1,1); - $All{"$Ld"}=LayerTable->text($i-1,2); + $All{"$LComp"}=layerTable->text($i-1,0); + $All{"$Lrho"}=layerTable->text($i-1,1); + $All{"$Ld"}=layerTable->text($i-1,2); } # Collect projectile parameters @@ -2383,20 +2382,20 @@ sub CreateInpFile $Check=0; # Composition of layers my $LComp="L".$i."Comp"; - my $Comp = LayerTable->text($i-1,0); + my $Comp = layerTable->text($i-1,0); $All{$LComp} = $Comp; my %LElComp=Chem::parse_formula($Comp); if ($Comp eq "") {$Check++;} # Densities of layers my $Lrho="L".$i."rho"; - my $rho = LayerTable->text($i-1,1); + my $rho = layerTable->text($i-1,1); $All{$Lrho}=sprintf("%6.2f",$rho); if ($rho eq "") {$Check++;} # Thickness of layers my $Ld ="L".$i."d"; - my $d = LayerTable->text($i-1,2); + my $d = layerTable->text($i-1,2); $All{$Ld}=sprintf("%8.2f",$d); if ($d eq "") {$Check++;} @@ -2756,20 +2755,20 @@ sub OpenFile my $CRow=$InitPar[0]; if ($InitPar[0] =~ m/L.*Comp$/ ) { $CRow =~ s/\D//g; - LayerTable->setText($CRow-1,0,$InitPar[1]); + layerTable->setText($CRow-1,0,$InitPar[1]); } elsif ($InitPar[0] =~ m/L.*rho$/ ) { $CRow =~ s/\D//g; - LayerTable->setText($CRow-1,1,$InitPar[1]); + layerTable->setText($CRow-1,1,$InitPar[1]); } elsif ($InitPar[0] =~ m/L.*d$/ ) { $CRow =~ s/\D//g; - LayerTable->setText($CRow-1,2,$InitPar[1]); + layerTable->setText($CRow-1,2,$InitPar[1]); } else { $Attrib = child($InitPar[0]); if ($Types{$InitPar[0]} == 1) { $Attrib->setValue($InitPar[1]); -# Create enough rows in LayerTable +# Create enough rows in layerTable if ($InitPar[0] eq "NL") { - LayerTable->setNumRows($InitPar[1]); + layerTable->setNumRows($InitPar[1]); } } elsif ($Types{$InitPar[0]} == 2 ) { if($InitPar[1] == 1) { diff --git a/trimsp/src/TrimSPGUI/TrimSPGUI.ui b/trimsp/src/TrimSPGUI/TrimSPGUI.ui index 2c90ce5..973a26c 100644 --- a/trimsp/src/TrimSPGUI/TrimSPGUI.ui +++ b/trimsp/src/TrimSPGUI/TrimSPGUI.ui @@ -688,7 +688,7 @@ - LayerTable + layerTable @@ -2387,7 +2387,7 @@ DirectoryBrowse() - LayerTable + layerTable valueChanged(int,int) TrimSPGUI findDensity() diff --git a/trimsp/src/TrimSPGUI/TrimSPGUI.ui.h b/trimsp/src/TrimSPGUI/TrimSPGUI.ui.h index 9d6a58c..3da09a2 100644 --- a/trimsp/src/TrimSPGUI/TrimSPGUI.ui.h +++ b/trimsp/src/TrimSPGUI/TrimSPGUI.ui.h @@ -58,7 +58,7 @@ void TrimSPGUI::ToggleScanSingle() NProj->setDisabled(0); # NProj->setText("10000"); for (my $i=1;$i<=$All{"NL"};$i++) { - my $LayerAttrib = LayerTable->item($i-1,2); + my $LayerAttrib = layerTable->item($i-1,2); $LayerAttrib->setEnabled(1); } @@ -90,7 +90,7 @@ void TrimSPGUI::ToggleScanSingle() Angle->setDisabled(0); SigAngle->setDisabled(0); NProj->setDisabled(0); - LayerTable->setColumnReadOnly(2,0); + layerTable->setColumnReadOnly(2,0); # then disable one if ($All{"ERadio"}) { E->setDisabled(1); @@ -103,7 +103,7 @@ void TrimSPGUI::ToggleScanSingle() } elsif ($All{"NProjRadio"}) { NProj->setDisabled(1); } elsif($All{"dRadio"}) { - my $LayerAttrib = LayerTable->item($All{"ScandL"}-1,2); + my $LayerAttrib = layerTable->item($All{"ScandL"}-1,2); $LayerAttrib->setEnabled(0); } # and change title of tab to say enabled @@ -121,20 +121,19 @@ void TrimSPGUI::PrepLayers() $All{"NL"}=NL->text(); # Prepare enough Rows in table for layers - my $OldNL=LayerTable->numRows(); + my $OldNL=layerTable->numRows(); if ($OldNL<=$All{"NL"}) { - LayerTable->setNumRows($All{"NL"}); + layerTable->setNumRows($All{"NL"}); } else { for (my $i=$All{"NL"};$i<=$OldNL-1;$i++) { - print $i."\n"; removeRowFromTable($i); } } } -# LayerTable->horizontalHeader()->setResizeMode(Qt::HeaderView::Stretch); -# LayerTable->adjustColumn(0); -# LayerTable->adjustColumn(1); -# LayerTable->adjustColumn(2); +# layerTable->horizontalHeader()->setResizeMode(Qt::HeaderView::Stretch); +# layerTable->adjustColumn(0); +# layerTable->adjustColumn(1); +# layerTable->adjustColumn(2); } void TrimSPGUI::removeRowFromTable() @@ -147,20 +146,20 @@ void TrimSPGUI::removeRowFromTable() my ($deadRow) = @_; # Loop over columns and take items of the row to remove - for my $col (0..LayerTable->numCols()-1) { - my $dummy=LayerTable->item($deadRow, $col); + for my $col (0..layerTable->numCols()-1) { + my $dummy=layerTable->item($deadRow, $col); # In the items is not defined the row can be removed by simply # reducing the number of rows in table if ($dummy ne "") { - LayerTable->takeItem(LayerTable->item($deadRow, $col)); - for my $row ($deadRow..LayerTable->numRows()-2) { - my $item = LayerTable->item($row+1, $col); - LayerTable->takeItem($item); - LayerTable->setItem($row, $col, $item); + layerTable->takeItem(layerTable->item($deadRow, $col)); + for my $row ($deadRow..layerTable->numRows()-2) { + my $item = layerTable->item($row+1, $col); + layerTable->takeItem($item); + layerTable->setItem($row, $col, $item); } } } - LayerTable->setNumRows(LayerTable->numRows()-1); + layerTable->setNumRows(layerTable->numRows()-1); } void TrimSPGUI::ProjSmartDefaults() @@ -234,9 +233,9 @@ void TrimSPGUI::CollectValues() my $LComp = "L".$i."Comp"; my $Lrho="L".$i."rho"; my $Ld="L".$i."d"; - $All{"$LComp"}=LayerTable->text($i-1,0); - $All{"$Lrho"}=LayerTable->text($i-1,1); - $All{"$Ld"}=LayerTable->text($i-1,2); + $All{"$LComp"}=layerTable->text($i-1,0); + $All{"$Lrho"}=layerTable->text($i-1,1); + $All{"$Ld"}=layerTable->text($i-1,2); } # Collect projectile parameters @@ -385,20 +384,20 @@ void TrimSPGUI::CreateInpFile() $Check=0; # Composition of layers my $LComp="L".$i."Comp"; - my $Comp = LayerTable->text($i-1,0); + my $Comp = layerTable->text($i-1,0); $All{$LComp} = $Comp; my %LElComp=Chem::parse_formula($Comp); if ($Comp eq "") {$Check++;} # Densities of layers my $Lrho="L".$i."rho"; - my $rho = LayerTable->text($i-1,1); + my $rho = layerTable->text($i-1,1); $All{$Lrho}=sprintf("%6.2f",$rho); if ($rho eq "") {$Check++;} # Thickness of layers my $Ld ="L".$i."d"; - my $d = LayerTable->text($i-1,2); + my $d = layerTable->text($i-1,2); $All{$Ld}=sprintf("%8.2f",$d); if ($d eq "") {$Check++;} @@ -750,20 +749,20 @@ void TrimSPGUI::OpenFile() my $CRow=$InitPar[0]; if ($InitPar[0] =~ m/L.*Comp$/ ) { $CRow =~ s/\D//g; - LayerTable->setText($CRow-1,0,$InitPar[1]); + layerTable->setText($CRow-1,0,$InitPar[1]); } elsif ($InitPar[0] =~ m/L.*rho$/ ) { $CRow =~ s/\D//g; - LayerTable->setText($CRow-1,1,$InitPar[1]); + layerTable->setText($CRow-1,1,$InitPar[1]); } elsif ($InitPar[0] =~ m/L.*d$/ ) { $CRow =~ s/\D//g; - LayerTable->setText($CRow-1,2,$InitPar[1]); + layerTable->setText($CRow-1,2,$InitPar[1]); } else { $Attrib = child($InitPar[0]); if ($Types{$InitPar[0]} == 1) { $Attrib->setValue($InitPar[1]); -# Create enough rows in LayerTable +# Create enough rows in layerTable if ($InitPar[0] eq "NL") { - LayerTable->setNumRows($InitPar[1]); + layerTable->setNumRows($InitPar[1]); } } elsif ($Types{$InitPar[0]} == 2 ) { if($InitPar[1] == 1) {