Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [1e6baa] Maximize Restore History

Iniziata implementazione di sezione composta in QEasyCncr

Michele Mocciola Michele Mocciola 2014-07-10

added libqeasycncr/simplesectionrcncrcomp.h
added libqeasycncr/slssteelsigmamodel.cpp
added libqeasycncr/slssteelsigmamodel.h
added libqeasycncr/steelamodel.h
added libqeasycncr/steelfepsmodel.cpp
added libqeasycncr/steelfepsmodel.h
added libqeasycncrgui/simplesectionrcncrcompgui.cpp
added libqeasycncrgui/simplesectionrcncrcompgui.h
added libqeasycncrgui/simplesectionrcncrcompgui.ui
changed libqeasy/libqeasy.pro
changed libqeasycncr/libqeasycncr.pro
changed libqeasycncr/simplesectionrcncrrect.cpp
changed libqeasycncr/simplesectionrcncrrect.h
changed libqeasycncrgui/libqeasycncrgui.pro
changed libqeasycncrgui/simplesectionrcncrrectgui.cpp
changed libqeasycncrgui/simplesectionrcncrrectgui.ui
copied libqeasy/simplesectionrcncrrect.cpp -> libqeasycncr/simplesectionrcncrcomp.cpp
copied libqeasy/simplesectionrcncrrect.h -> libqeasycncr/steelamodel.cpp
libqeasycncr/simplesectionrcncrcomp.h Diff Switch to side-by-side view
Loading...
libqeasycncr/slssteelsigmamodel.cpp Diff Switch to side-by-side view
Loading...
libqeasycncr/slssteelsigmamodel.h Diff Switch to side-by-side view
Loading...
libqeasycncr/steelamodel.h Diff Switch to side-by-side view
Loading...
libqeasycncr/steelfepsmodel.cpp Diff Switch to side-by-side view
Loading...
libqeasycncr/steelfepsmodel.h Diff Switch to side-by-side view
Loading...
libqeasycncrgui/simplesectionrcncrcompgui.cpp Diff Switch to side-by-side view
Loading...
libqeasycncrgui/simplesectionrcncrcompgui.h Diff Switch to side-by-side view
Loading...
libqeasycncrgui/simplesectionrcncrcompgui.ui Diff Switch to side-by-side view
Loading...
libqeasy/libqeasy.pro Diff Switch to side-by-side view
Loading...
libqeasycncr/libqeasycncr.pro Diff Switch to side-by-side view
Loading...
libqeasycncr/simplesectionrcncrrect.cpp Diff Switch to side-by-side view
Loading...
libqeasycncr/simplesectionrcncrrect.h Diff Switch to side-by-side view
Loading...
libqeasycncrgui/libqeasycncrgui.pro Diff Switch to side-by-side view
Loading...
libqeasycncrgui/simplesectionrcncrrectgui.cpp Diff Switch to side-by-side view
Loading...
libqeasycncrgui/simplesectionrcncrrectgui.ui Diff Switch to side-by-side view
Loading...
libqeasy/simplesectionrcncrrect.cpp to libqeasycncr/simplesectionrcncrcomp.cpp
--- a/libqeasy/simplesectionrcncrrect.cpp
+++ b/libqeasycncr/simplesectionrcncrcomp.cpp
@@ -1,209 +1,40 @@
-#include "simplesectionrcncrrect.h"
+#include "simplesectionrcncrcomp.h"
 
 #include "tablemodelplusprivate.h"
+#include "steelamodel.h"
+#include "steelfepsmodel.h"
+#include "slssteelsigmamodel.h"
 #include "doubleplus.h"
 #include "uintplus.h"
 #include "unitmeasure.h"
-
 #include "structmath.h"
+
 #include <QVector>
 #include <QPointF>
 #include <cmath>
 
-class SteelA: public VarPlusContainer {
+class SimpleSectionRCncrCompPrivate{
 public:
-    SteelA( UnitMeasure * ump, double AVal=0.0, double dVal=0.0 ):
-        VarPlusContainer( ump, "SteelA", ""){
-        A = new DoublePlus( AVal, "A", m_unitMeasure, UnitMeasure::sectL2 );
-        A->setRichName(QObject::trUtf8("A"));
-        A->setToolTip( QObject::trUtf8("Area dell'armatura"));
-        addVarToContainer(A);
-
-        d = new DoublePlus( dVal, "d", m_unitMeasure, UnitMeasure::sectL );
-        d->setRichName(QObject::trUtf8("d"));
-        d->setToolTip( QObject::trUtf8("Altezza utile dell'armatura"));
-        addVarToContainer(d);
-    }
-    DoublePlus * A;
-    DoublePlus * d;
-};
-
-class SteelAModelPrivate{
-public:
-    SteelAModelPrivate(){
-    }
-
-    QList<SteelA *> AList;
-};
-
-void SteelAModel::updateHeaders(UnitMeasure::unitMeasure um ){
-    if( um == UnitMeasure::sectL2 || um == UnitMeasure::sectL) {
-        QList<QString> headers;
-        headers << trUtf8("A [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL2 ) );
-        headers << trUtf8("d [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL ) );
-        setHeaders( headers );
-    }
-}
-
-void SteelAModel::updateDMax(){
-    double v = 0.0;
-    QList<SteelA *>::iterator i = m_dd->AList.begin();
-    if(i != m_dd->AList.end()){
-        v = (*i)->d->valueNormal();
-        ++i;
-    }
-    for( ; i != m_dd->AList.end(); ++i ){
-        if( (*i)->d->valueNormal() > v ){
-            v = (*i)->d->valueNormal();
-        }
-    }
-    emit dMaxChanged(v);
-}
-
-void SteelAModel::updateDMin(){
-    double v = 0.0;
-    QList<SteelA *>::iterator i = m_dd->AList.begin();
-    if(i != m_dd->AList.end()){
-        v = (*i)->d->valueNormal();
-        ++i;
-    }
-    for( ; i != m_dd->AList.end(); ++i ){
-        if( (*i)->d->valueNormal() < v ){
-            v = (*i)->d->valueNormal();
-        }
-    }
-    emit dMinChanged(v);
-}
-
-void SteelAModel::insertSteelA( SteelA * addedA, int position ){
-    if (position < 0 || position > m_dd->AList.size() )
-        position = m_dd->AList.size();
-
-    if( addedA ){
-        connect( addedA->A, SIGNAL(valueChanged(QString)), this, SIGNAL(modelChanged()) );
-        connect( addedA->d, SIGNAL(valueChanged(QString)), this, SIGNAL(modelChanged()) );
-        m_dd->AList.insert( position, addedA );
-        connect( addedA->d, SIGNAL(valueChanged(QString)), this, SLOT(updateDMax()) );
-        connect( addedA->d, SIGNAL(valueChanged(QString)), this, SLOT(updateDMin()) );
-        updateDMax();
-        updateDMin();
-        insertRowsPrivate( position );
-        setVarValueRow( position, addedA->A, addedA->d );
-    }
-}
-
-void SteelAModel::removeSteelA( int p ){
-    delete m_dd->AList.takeAt( p );
-    updateDMax();
-    updateDMin();
-}
-
-void SteelAModel::writeXml(QXmlStreamWriter *writer) {
-    Q_UNUSED( writer );
-}
-
-void SteelAModel::readXml(QXmlStreamReader *reader) {
-    Q_UNUSED( reader );
-}
-
-SteelAModel::SteelAModel( UnitMeasure * ump, QObject *parent ):
-    TableModelPlus( "SteelAModel", ump, parent ),
-    m_dd( new SteelAModelPrivate() ){
-    connect( m_d->unitMeasure, SIGNAL(stringsChanged(UnitMeasure::unitMeasure)), this, SLOT(updateHeaders(UnitMeasure::unitMeasure)) );
-    QList<QString> headers;
-    headers << trUtf8("A [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL2 ) );
-    headers << trUtf8("d [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL ) );
-    setHeaders( headers );
-}
-
-void SteelAModel::insertRows( int position, int count ){
-    if (position < 0 || position > m_dd->AList.size() )
-        return;
-
-    for (int row = position; row < (position+count); ++row) {
-        SteelA * addedA = new SteelA( m_d->unitMeasure );
-        insertSteelA( addedA, position );
-    }
-    emit modelChanged();
-}
-
-void SteelAModel::removeRows(int position, int count ){
-    if (position < 0 || (position + count) > m_dd->AList.size())
-        return;
-
-    for (int row = position; row < (position+count); row++){
-        // ok, procediamo a cancellare la riga
-        removeRowsPrivate( position );
-        // e la sezione
-        removeSteelA( position );
-    }
-    emit modelChanged();
-}
-
-DoublePlus * SteelAModel::d( int i ){
-    if( i >= 0 && i < m_dd->AList.size() )
-        return m_dd->AList.at( i )->d;
-    else
-        return NULL;
-}
-
-DoublePlus * SteelAModel::A( int i ){
-    if( i >= 0 && i < m_dd->AList.size() )
-        return m_dd->AList.at( i )->A;
-    else
-        return NULL;
-}
-
-int SteelAModel::count(){
-    return m_dd->AList.size();
-}
-
-double SteelAModel::SANormal(){
-    double ret = 0.0;
-    for( QList<SteelA *>::iterator i = m_dd->AList.begin(); i != m_dd->AList.end(); ++i ){
-        ret += (*i)->A->valueNormal();
-    }
-    return ret;
-}
-
-double SteelAModel::SAdNormal(){
-    double ret = 0.0;
-    for( QList<SteelA *>::iterator i = m_dd->AList.begin(); i != m_dd->AList.end(); ++i ){
-        ret += (*i)->A->valueNormal() * (*i)->d->valueNormal();
-    }
-    return ret;
-}
-
-double SteelAModel::SAd2Normal(){
-    double ret = 0.0;
-    for( QList<SteelA *>::iterator i = m_dd->AList.begin(); i != m_dd->AList.end(); ++i ){
-        ret += (*i)->A->valueNormal() * pow((*i)->d->valueNormal(), 2.0);
-    }
-    return ret;
-}
-
-class SimpleSectionRCncrRectPrivate{
-public:
-    SimpleSectionRCncrRectPrivate( UnitMeasure * ump ):
+    SimpleSectionRCncrCompPrivate( UnitMeasure * ump ):
         steelAModel( new SteelAModel( ump )){
 
     }
     SteelAModel * steelAModel;
 };
 
-SimpleSectionRCncrRect::SimpleSectionRCncrRect(UnitMeasure *ump, const QString &n, QObject *parent) :
+SimpleSectionRCncrComp::SimpleSectionRCncrComp(UnitMeasure *ump, const QString &n, QObject *parent) :
     QObject( parent ),
-    VarPlusContainer(ump, "SimpleSectionRCncrRect", n ),
-    m_d( new SimpleSectionRCncrRectPrivate(ump)){
+    VarPlusContainer(ump, "SimpleSectionRCncrComp", n ),
+    m_d( new SimpleSectionRCncrCompPrivate(ump)){
     connect( m_d->steelAModel, SIGNAL(modelChanged()), this, SIGNAL(sectionChanged()) );
     initVar();
 }
 
-SteelAModel *SimpleSectionRCncrRect::steelAModel() {
+SteelAModel *SimpleSectionRCncrComp::steelAModel() {
     return m_d->steelAModel;
 }
 
-void SimpleSectionRCncrRect::initVar() {
+void SimpleSectionRCncrComp::initVar() {
     b = new DoublePlus( 0.300, "b", m_unitMeasure, UnitMeasure::sectL );
     b->setRichName(trUtf8("b"));
     b->setToolTip( trUtf8("Base della sezione rettangolare"));
@@ -369,7 +200,7 @@
     setNRdMax();
 }
 
-void SimpleSectionRCncrRect::setFcd() {
+void SimpleSectionRCncrComp::setFcd() {
     if( fcd->readOnly() ){
         double ret = 0.0;
         if( gammaC->valueNormal() != 0.0 ){
@@ -379,7 +210,7 @@
     }
 }
 
-void SimpleSectionRCncrRect::setFSyd() {
+void SimpleSectionRCncrComp::setFSyd() {
     if( fSyd->readOnly() ){
         double ret = 0.0;
         if( gammaS->valueNormal() != 0.0 ){
@@ -389,7 +220,7 @@
     }
 }
 
-void SimpleSectionRCncrRect::setFSud() {
+void SimpleSectionRCncrComp::setFSud() {
     if( fSud->readOnly() ){
         double ret = 0.0;
         if( Es->valueNormal() != 0.0 ){
@@ -403,7 +234,7 @@
     }
 }
 
-void SimpleSectionRCncrRect::setNRdMin() {
+void SimpleSectionRCncrComp::setNRdMin() {
     double N = - b->valueNormal() * h->valueNormal() * fcd->valueNormal();
     for( int i=0; i < m_d->steelAModel->count(); ++i ) {
         N += m_d->steelAModel->A(i)->valueNormal() * fSteelNormal( -epsCU2->valueNormal());
@@ -411,7 +242,7 @@
     NRdMin->setValueNormal( N );
 }
 
-void SimpleSectionRCncrRect::setNRdMax() {
+void SimpleSectionRCncrComp::setNRdMax() {
     double N = 0.0;
     for( int i=0; i < m_d->steelAModel->count(); ++i ) {
         if( steelFEpsModel->valueNormal() == inclinedTopBranch ){
@@ -423,19 +254,19 @@
     NRdMax->setValueNormal( N );
 }
 
-void SimpleSectionRCncrRect::addVarToContainer(VarPlus *var) {
+void SimpleSectionRCncrComp::addVarToContainer(VarPlus *var) {
     VarPlusContainer::addVarToContainer( var );
     connect( var, SIGNAL(valueChanged(QString)), this, SIGNAL(sectionChanged()) );
 }
 
-void SimpleSectionRCncrRect::setEpsSUd() {
+void SimpleSectionRCncrComp::setEpsSUd() {
     if( epsSUd->readOnly() ){
         double ret = 0.9 * epsSUk->valueNormal();
         epsSUd->setValueNormal( ret );
     }
 }
 
-double SimpleSectionRCncrRect::beta1Normal( double eC ){
+double SimpleSectionRCncrComp::beta1Normal( double eC ){
     double eC2 = epsC2->valueNormal();
     double eCU2 = epsCU2->valueNormal();
     double n = nC->valueNormal();
@@ -456,7 +287,7 @@
     return 0.0;
 }
 
-double SimpleSectionRCncrRect::beta2Normal( double eC ){
+double SimpleSectionRCncrComp::beta2Normal( double eC ){
     double eC2 = epsC2->valueNormal();
     double eCU2 = epsCU2->valueNormal();
     double n = nC->valueNormal();
@@ -481,7 +312,7 @@
     return 0.0;
 }
 
-void SimpleSectionRCncrRect::setEpsC2( void ){
+void SimpleSectionRCncrComp::setEpsC2( void ){
     if( epsC2->readOnly() ){
         if( (fck->valueNormal() * 1.0e-6) > 50.0 ){
             epsC2->setValueNormal( 0.002 + 0.000085 * pow( (fck->valueNormal() * 1.0e-6 - 50.0), 0.53) );
@@ -491,7 +322,7 @@
     }
 }
 
-void SimpleSectionRCncrRect::setEpsCU2( void ){
+void SimpleSectionRCncrComp::setEpsCU2( void ){
     if( epsCU2->readOnly() ){
         if( (fck->valueNormal() * 1.0e-6) >= 50.0 ){
             epsCU2->setValueNormal( 0.0026 + 0.035 * pow( ((90.0 - fck->valueNormal() * 1.0e-6 ) /100.0), 4.0 ) );
@@ -501,7 +332,7 @@
     }
 }
 
-void SimpleSectionRCncrRect::setNC( void ){
+void SimpleSectionRCncrComp::setNC( void ){
     if( nC->readOnly() ){
         if( (fck->valueNormal() * 1.0e-6) >= 50.0 ){
             nC->setValueNormal( 1.4 + 23.4 * pow( (90-fck->valueNormal()*1.0e-6)/100.0, 4.0) );
@@ -511,7 +342,7 @@
     }
 }
 
-double SimpleSectionRCncrRect::fCncrNormal( double eC ){
+double SimpleSectionRCncrComp::fCncrNormal( double eC ){
     if( eC < 0.0 && eC >= -epsCU2->valueNormal() ){
         if( eC <= -epsC2 ->valueNormal() ){
             return - fcd->valueNormal();
@@ -522,7 +353,7 @@
     return 0.0;
 }
 
-double SimpleSectionRCncrRect::fSteelNormal( double eS ){
+double SimpleSectionRCncrComp::fSteelNormal( double eS ){
     if( eS <= fSud->valueNormal() && eS >= -fSud->valueNormal() ){
         if( Es->valueNormal() != 0.0 ){
             double eSYd = fSyd->valueNormal() / Es->valueNormal();
@@ -549,7 +380,7 @@
     return 0.0;
 }
 
-double SimpleSectionRCncrRect::NNormal( double eS, double eC, bool inverted ){
+double SimpleSectionRCncrComp::NNormal( double eS, double eC, bool inverted ){
     double ret = 0.0;
 
     if( eS == eC ){
@@ -600,7 +431,7 @@
     return ret;
 }
 
-double SimpleSectionRCncrRect::MNormal( double eS, double eC, bool inverted ){
+double SimpleSectionRCncrComp::MNormal( double eS, double eC, bool inverted ){
     double ret = 0.0;
 
     if( eS == eC ){
@@ -676,7 +507,7 @@
     return ret;
 }
 
-QVector<QPointF> SimpleSectionRCncrRect::NEpsConfigurations1(int nP ) {
+QVector<QPointF> SimpleSectionRCncrComp::NEpsConfigurations1(int nP ) {
     QVector<QPointF> conf;
     if(nP > 0 ){
         double eS = epsSUd->valueNormal();
@@ -697,7 +528,7 @@
     return conf;
 }
 
-QVector<QPointF> SimpleSectionRCncrRect::NEpsConfigurations23( int nP) {
+QVector<QPointF> SimpleSectionRCncrComp::NEpsConfigurations23( int nP) {
     QVector<QPointF> conf;
     if(nP > 0 ){
         double eS = epsSUd->valueNormal();
@@ -719,7 +550,7 @@
     return conf;
 }
 
-QVector<QPointF> SimpleSectionRCncrRect::NEpsConfigurations4( int nP) {
+QVector<QPointF> SimpleSectionRCncrComp::NEpsConfigurations4( int nP) {
     QVector<QPointF> conf;
 
     if( epsCU2->valueNormal() > epsC2->valueNormal() ){
@@ -750,7 +581,7 @@
     return conf;
 }
 
-QVector<QPointF> SimpleSectionRCncrRect::MChiDiagram( DoublePlus * NEdPlus, int nP, double prec, int maxIter ) {
+QVector<QPointF> SimpleSectionRCncrComp::MChiDiagram( DoublePlus * NEdPlus, int nP, double prec, int maxIter ) {
     double NEd = NEdPlus->valueNormal();
     QVector<QPointF> ret;
     if( dMax->valueNormal() != 0.0 ){
@@ -820,7 +651,7 @@
     return ret;
 }
 
-QVector<QPointF> SimpleSectionRCncrRect::NRdMRd(int nP) {
+QVector<QPointF> SimpleSectionRCncrComp::NRdMRd(int nP) {
     QVector<QPointF> conf;
 
     if(nP > 0 ){
@@ -1001,7 +832,7 @@
     return conf;
 }
 
-void SimpleSectionRCncrRect::SLSNM(DoublePlus * N, DoublePlus * M, DoublePlus * alphaE,
+void SimpleSectionRCncrComp::SLSNM(DoublePlus * N, DoublePlus * M, DoublePlus * alphaE,
                                    SLSSteelSigmaModel * sigmaSModel, DoublePlus * sigmaCUp, DoublePlus * sigmaCDown,
                                    DoublePlus * x) {
     double sigmaSNormal[ m_d->steelAModel->count() ];
@@ -1016,7 +847,7 @@
     x->setValueNormal( xNormal );
 }
 
-void SimpleSectionRCncrRect::SLSNMNormal(double N, double M, double alphaE, double sigmaS[], double *sigmaCUp, double *sigmaCDown, double *x) {
+void SimpleSectionRCncrComp::SLSNMNormal(double N, double M, double alphaE, double sigmaS[], double *sigmaCUp, double *sigmaCDown, double *x) {
     if( N == 0.0 ){
         if( M > 0.0 ){
             // flessione semplice positiva
@@ -1178,7 +1009,7 @@
     }
 }
 
-double SimpleSectionRCncrRect::calcSigmaNormal( double *sigmaCUp, double *sigmaCDown, double sigmaS[], double N, double M, double x, double alphaE, bool invert ){
+double SimpleSectionRCncrComp::calcSigmaNormal( double *sigmaCUp, double *sigmaCDown, double sigmaS[], double N, double M, double x, double alphaE, bool invert ){
     double A0 = b->valueNormal() * x + alphaE * m_d->steelAModel->SANormal();
     if( A0 != 0.0 ){
         double S0 = 0.0;
@@ -1235,7 +1066,7 @@
 }
 
 
-double SimpleSectionRCncrRect::MRdNormal(double NEd, double * x, bool inverted, double prec, int maxIter ){
+double SimpleSectionRCncrComp::MRdNormal(double NEd, double * x, bool inverted, double prec, int maxIter ){
     double NRd3 = NNormal( - epsC2->valueNormal() , - epsC2->valueNormal(), inverted );
     if( NEd < NRd3 ){
         *x = 0.0;
@@ -1559,233 +1390,9 @@
     return 0.0;
 }
 
-void SimpleSectionRCncrRect::MRd(DoublePlus * ret, DoublePlus * NEd, DoublePlus * x, bool inverted){
+void SimpleSectionRCncrComp::MRd(DoublePlus * ret, DoublePlus * NEd, DoublePlus * x, bool inverted){
     double xVal = 0.0;
     double MRd = MRdNormal( NEd->valueNormal(), &xVal, inverted  );
     x->setValueNormal( xVal );
     ret->setValueNormal( MRd );
 }
-
-class SteelFEpsModelPrivate{
-    class enumVal{
-    public:
-        enumVal(SimpleSectionRCncrRect::ModelSteelFEps v, const QString & ns, const QString & s):
-            val(v),
-            normalStr(ns),
-            str(s){
-        };
-        SimpleSectionRCncrRect::ModelSteelFEps val;
-        QString normalStr;
-        QString str;
-    };
-
-public:
-    SteelFEpsModelPrivate(SimpleSectionRCncrRect::ModelSteelFEps v):
-        value(v){
-        enumList.append( enumVal( SimpleSectionRCncrRect::inclinedTopBranch, "inclinedTopBranch", QObject::trUtf8("E.P. incrudente")) );
-        enumList.append( enumVal( SimpleSectionRCncrRect::horizontalTopBranch, "horizontalTopBranch", QObject::trUtf8("El. inf. plastico")) );
-    }
-    ~SteelFEpsModelPrivate(){
-    }
-
-    int valueIndex(){
-        for( int i=0; i < enumList.size(); ++i){
-            if( enumList.at(i).val == value ){
-                return i;
-            }
-        }
-        return 0;
-    }
-    SimpleSectionRCncrRect::ModelSteelFEps value;
-    QList<enumVal> enumList;
-};
-
-SteelFEpsModel::SteelFEpsModel( SimpleSectionRCncrRect::ModelSteelFEps m,
-                                const QString & nn,
-                                bool ro):
-    EnumPlus( nn, ro),
-    m_d( new SteelFEpsModelPrivate(m )){
-}
-
-SteelFEpsModel::~SteelFEpsModel(){
-    delete m_d;
-}
-
-SteelFEpsModel & SteelFEpsModel::operator=( SteelFEpsModel & val){
-    this->VarPlus::operator=( (VarPlus & ) val );
-
-    if( this != &val ){
-        setValueNormal( val.m_d->value );
-    }
-    return *this;
-}
-
-VarPlus & SteelFEpsModel::operator=( VarPlus & val){
-    this->VarPlus::operator=( val );
-
-    if( this != &val ){
-        SteelFEpsModel * valCncrModelPlus = dynamic_cast<SteelFEpsModel *>(&val);
-        if(valCncrModelPlus) {
-            setValueNormal( valCncrModelPlus->m_d->value );
-        }
-    }
-    return *this;
-}
-
-QString SteelFEpsModel::typeVar(){
-    return QString("SteelFEpsModel");
-}
-
-SimpleSectionRCncrRect::ModelSteelFEps SteelFEpsModel::value(){
-    return m_d->value;
-}
-
-SimpleSectionRCncrRect::ModelSteelFEps SteelFEpsModel::valueNormal(){
-    return m_d->value;
-}
-
-QString SteelFEpsModel::valueNormalStr(){
-    return m_d->enumList.at( m_d->valueIndex() ).normalStr ;
-}
-
-QString SteelFEpsModel::valueStr(){
-    return m_d->enumList.at( m_d->valueIndex() ).str ;
-}
-
-void SteelFEpsModel::setValueNormal( SimpleSectionRCncrRect::ModelSteelFEps vv, bool emitAuto ){
-    if( vv != m_d->value ){
-        m_d->value = vv;
-        emit valueChangedInternal( valueStr() );
-        emit valueIntChangedWidget( m_d->valueIndex() );
-        if( emitAuto ){
-            emit valueChanged( valueStr() );
-            emit valueIntChanged( m_d->valueIndex() );
-        }
-    }
-}
-
-void SteelFEpsModel::setValueNormal( const QString & vv, bool emitAuto ){
-    QString v = vv.toUpper();
-    for( int i=0; i < m_d->enumList.size(); ++i){
-        if( m_d->enumList.at(i).normalStr.toUpper() == v ){
-            setValueNormal( m_d->enumList.at(i).val, emitAuto );
-            return;
-        }
-    }
-}
-
-void SteelFEpsModel::setValueInt( int i, bool emitAuto ){
-    setValueNormal( m_d->enumList.at(i).val, emitAuto );
-}
-
-void SteelFEpsModel::setValue( SimpleSectionRCncrRect::ModelSteelFEps vv, bool emitAuto ){
-    setValueNormal( vv, emitAuto );
-}
-
-void SteelFEpsModel::setValue( const QString & vv, bool emitAuto ){
-    QString v = vv.toUpper();
-    for( int i=0; i < m_d->enumList.size(); ++i){
-        if( m_d->enumList.at(i).str.toUpper() == v ){
-            setValueNormal( m_d->enumList.at(i).val, emitAuto );
-            return;
-        }
-    }
-}
-
-int SteelFEpsModel::enumCount() {
-    return m_d->enumList.size();
-}
-
-QString SteelFEpsModel::enumStr(int v ) {
-    if( v < m_d->enumList.size() ){
-        return m_d->enumList.at(v).str;
-    }
-    return QString();
-}
-
-int SteelFEpsModel::valueNormalInt() {
-    return m_d->valueIndex();
-}
-
-class SLSSteelSigmaModelPrivate{
-public:
-    SLSSteelSigmaModelPrivate(SteelAModel *model):
-        steelModel(model){
-    };
-
-    SteelAModel * steelModel;
-    QList<DoublePlus *> sigmaList;
-};
-
-SLSSteelSigmaModel::SLSSteelSigmaModel(SteelAModel *steelModel, UnitMeasure *ump, QObject *parent):
-    TableModelPlus("SLSSteelSigmaModel", ump, parent),
-    m_dd( new SLSSteelSigmaModelPrivate(steelModel)){
-    connect( m_dd->steelModel, SIGNAL(rowsInserted(QModelIndex,int,int)), SLOT( insertRows( QModelIndex,int,int ) ) );
-    connect( m_dd->steelModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), SLOT( removeRows( QModelIndex,int,int ) ) );
-
-    connect( m_d->unitMeasure, SIGNAL(stringsChanged(UnitMeasure::unitMeasure)), this, SLOT(updateHeaders(UnitMeasure::unitMeasure)) );
-    QList<QString> headers;
-    headers << trUtf8("d [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL ) );
-    headers << trUtf8("��s [%1]").arg( m_d->unitMeasure->string( UnitMeasure::tension ) );
-    setHeaders( headers );
-
-    insertRows( QModelIndex(), 0, m_dd->steelModel->count()-1 );
-}
-
-void SLSSteelSigmaModel::insertRows( const QModelIndex & parent, int start, int end){
-    Q_UNUSED(parent);
-    insertRowsPrivate( start, end-start+1);
-    for( int i=start; i <=end; ++i ){
-        m_dd->sigmaList.insert( i, new DoublePlus( 0.0, "sigmaSteelSLS", m_d->unitMeasure, UnitMeasure::tension, true));
-        setVarValue(i, 0, m_dd->steelModel->d(i) );
-        setVarValue( i, 1, m_dd->sigmaList.at(i));
-        setVarReadOnly( i, 1, true );
-    }
-}
-
-void SLSSteelSigmaModel::removeRows(int position, int count ){
-    if (position < 0 || (position + count) > m_dd->sigmaList.size())
-        return;
-
-    for (int row = position; row < (position+count); row++){
-        // ok, procediamo a cancellare la riga
-        removeRowsPrivate( position );
-        // e la sezione
-        m_dd->sigmaList.removeAt( position );
-    }
-    emit modelChanged();
-}
-
-void SLSSteelSigmaModel::removeRows( const QModelIndex & parent, int start, int end){
-    Q_UNUSED(parent);
-    removeRows( start, end-start+1);
-}
-
-void SLSSteelSigmaModel::updateHeaders(UnitMeasure::unitMeasure um) {
-    if( um == UnitMeasure::sectL || um == UnitMeasure::tension) {
-        QList<QString> headers;
-        headers << trUtf8("d [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL ) );
-        headers << trUtf8("����� [%1]").arg( m_d->unitMeasure->string( UnitMeasure::tension ) );
-        setHeaders( headers );
-    }
-}
-
-void SLSSteelSigmaModel::writeXml(QXmlStreamWriter *writer) {
-    //TODO
-}
-
-void SLSSteelSigmaModel::readXml(QXmlStreamReader *reader) {
-    //TODO
-}
-
-void SLSSteelSigmaModel::resetValues(){
-    for( QList<DoublePlus *>::iterator i = m_dd->sigmaList.begin(); i != m_dd->sigmaList.end(); ++i ){
-        (*i)->setValueNormal( 0.0 );
-    }
-}
-
-void SLSSteelSigmaModel::setValueNormal( double v, int i ){
-    if( i >= 0 && i < m_dd->sigmaList.size() ){
-        m_dd->sigmaList.at(i)->setValueNormal( v );
-    }
-}
libqeasy/simplesectionrcncrrect.h to libqeasycncr/steelamodel.cpp
--- a/libqeasy/simplesectionrcncrrect.h
+++ b/libqeasycncr/steelamodel.cpp
@@ -1,220 +1,180 @@
-#ifndef SIMPLESECTIONRCNCR_H
-#define SIMPLESECTIONCNCR_H
+#include "steelamodel.h"
 
-class SteelAModelPrivate;
-class SteelA;
-class DoublePlus;
+#include "varpluscontainer.h"
+#include "doubleplus.h"
+#include "tablemodelplusprivate.h"
 
-#include "tablemodelplus.h"
-#include "unitmeasure.h"
+#include <cmath>
 
-class SteelAModel: public TableModelPlus{
-    Q_OBJECT
-private:
-    SteelAModelPrivate * m_dd;
-    void insertSteelA(SteelA *addedA, int position);
-    void removeSteelA(int p);
-    void writeXml(QXmlStreamWriter * writer);
-    void readXml(QXmlStreamReader * reader);
+class SteelA: public VarPlusContainer {
+public:
+    SteelA( UnitMeasure * ump, double AVal=0.0, double dVal=0.0 ):
+        VarPlusContainer( ump, "SteelA", ""){
+        A = new DoublePlus( AVal, "A", m_unitMeasure, UnitMeasure::sectL2 );
+        A->setRichName(QObject::trUtf8("A"));
+        A->setToolTip( QObject::trUtf8("Area dell'armatura"));
+        addVarToContainer(A);
 
-public slots:
-    void updateDMax();
-    void updateDMin();
-
-private slots:
-    void updateHeaders(UnitMeasure::unitMeasure um );
-
-signals:
-    void dMaxChanged(double);
-    void dMinChanged(double);
-
-public:
-    SteelAModel( UnitMeasure * ump, QObject *parent = 0);
-    void insertRows( int position, int count = 1);
-    void removeRows(int position, int count = 1);
-    DoublePlus * d( int i );
-    DoublePlus * A( int i );
-    int count();
-    double SANormal();
-    double SAdNormal();
-    double SAd2Normal();
+        d = new DoublePlus( dVal, "d", m_unitMeasure, UnitMeasure::sectL );
+        d->setRichName(QObject::trUtf8("d"));
+        d->setToolTip( QObject::trUtf8("Altezza utile dell'armatura"));
+        addVarToContainer(d);
+    }
+    DoublePlus * A;
+    DoublePlus * d;
 };
 
-class SLSSteelSigmaModelPrivate;
+class SteelAModelPrivate{
+public:
+    SteelAModelPrivate(){
+    }
 
-class SLSSteelSigmaModel: public TableModelPlus{
-    Q_OBJECT
-public:
-    SLSSteelSigmaModel( SteelAModel * steelModel, UnitMeasure * ump, QObject *parent = 0);
-
-    void writeXml(QXmlStreamWriter * writer);
-    void readXml(QXmlStreamReader * reader);
-
-    // annulla tutti i valori
-    void resetValues();
-    void setValueNormal(double v, int i);
-
-private slots:
-    void insertRows(const QModelIndex &parent, int start, int end);
-    void removeRows(const QModelIndex &parent, int start, int end);
-    void updateHeaders(UnitMeasure::unitMeasure um );
-private:
-    SLSSteelSigmaModelPrivate * m_dd;
-    void removeRows(int position, int count);
+    QList<SteelA *> AList;
 };
 
-#include "varpluscontainer.h"
-#include <QObject>
+void SteelAModel::updateHeaders(UnitMeasure::unitMeasure um ){
+    if( um == UnitMeasure::sectL2 || um == UnitMeasure::sectL) {
+        QList<QString> headers;
+        headers << trUtf8("A [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL2 ) );
+        headers << trUtf8("d [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL ) );
+        setHeaders( headers );
+    }
+}
 
-class SimpleSectionRCncrRectPrivate;
-class SteelFEpsModel;
+void SteelAModel::updateDMax(){
+    double v = 0.0;
+    QList<SteelA *>::iterator i = m_dd->AList.begin();
+    if(i != m_dd->AList.end()){
+        v = (*i)->d->valueNormal();
+        ++i;
+    }
+    for( ; i != m_dd->AList.end(); ++i ){
+        if( (*i)->d->valueNormal() > v ){
+            v = (*i)->d->valueNormal();
+        }
+    }
+    emit dMaxChanged(v);
+}
 
-class SimpleSectionRCncrRect : public QObject, public VarPlusContainer
-{
-    Q_OBJECT
-public:
-    enum ModelSteelFEps {
-        horizontalTopBranch,
-        inclinedTopBranch
-    };
-    explicit SimpleSectionRCncrRect(UnitMeasure * ump, const QString & n, QObject * parent = 0);
+void SteelAModel::updateDMin(){
+    double v = 0.0;
+    QList<SteelA *>::iterator i = m_dd->AList.begin();
+    if(i != m_dd->AList.end()){
+        v = (*i)->d->valueNormal();
+        ++i;
+    }
+    for( ; i != m_dd->AList.end(); ++i ){
+        if( (*i)->d->valueNormal() < v ){
+            v = (*i)->d->valueNormal();
+        }
+    }
+    emit dMinChanged(v);
+}
 
-    /** Base */
-    DoublePlus * b;
-    /** Altezza */
-    DoublePlus * h;
-    /** Altezza utile */
-    DoublePlus * dMax;
-    /** Altezza utile */
-    DoublePlus * dMin;
+void SteelAModel::insertSteelA( SteelA * addedA, int position ){
+    if (position < 0 || position > m_dd->AList.size() )
+        position = m_dd->AList.size();
 
-    /** fck */
-    DoublePlus * fck;
-    /** alphaCC */
-    DoublePlus * alphaCC;
-    /** gammaC */
-    DoublePlus * gammaC;
-    /** fcd */
-    DoublePlus * fcd;
-    /** epsC2 */
-    DoublePlus * epsC2;
-    /** epsCU2 */
-    DoublePlus * epsCU2;
-    /** nC */
-    DoublePlus * nC;
+    if( addedA ){
+        connect( addedA->A, SIGNAL(valueChanged(QString)), this, SIGNAL(modelChanged()) );
+        connect( addedA->d, SIGNAL(valueChanged(QString)), this, SIGNAL(modelChanged()) );
+        m_dd->AList.insert( position, addedA );
+        connect( addedA->d, SIGNAL(valueChanged(QString)), this, SLOT(updateDMax()) );
+        connect( addedA->d, SIGNAL(valueChanged(QString)), this, SLOT(updateDMin()) );
+        updateDMax();
+        updateDMin();
+        insertRowsPrivate( position );
+        setVarValueRow( position, addedA->A, addedA->d );
+    }
+}
 
-    /** epsUk */
-    DoublePlus * Es;
-    /** epsUk */
-    DoublePlus * epsSUk;
-    /** epsUd */
-    DoublePlus * epsSUd;
-    /** fyk */
-    DoublePlus * fSyk;
-    /** gammaS */
-    DoublePlus * gammaS;
-    /** fyd */
-    DoublePlus * fSyd;
-    /** kS */
-    DoublePlus * kS;
-    /** fSud */
-    DoublePlus * fSud;
-    /** Modello sigma/epsilon acciaio */
-    SteelFEpsModel * steelFEpsModel;
-    /** NRdMin */
-    DoublePlus * NRdMin;
-    /** NRdMin */
-    DoublePlus * NRdMax;
+void SteelAModel::removeSteelA( int p ){
+    delete m_dd->AList.takeAt( p );
+    updateDMax();
+    updateDMin();
+}
 
-    SteelAModel * steelAModel();
+void SteelAModel::writeXml(QXmlStreamWriter *writer) {
+    Q_UNUSED( writer );
+}
 
-    QVector<QPointF> NEpsConfigurations1( int nP = 600 );
-    QVector<QPointF> NEpsConfigurations23(int nP = 600 );
-    QVector<QPointF> NEpsConfigurations4(int nP = 600 );
-    void MRd(DoublePlus *ret, DoublePlus * NEd, DoublePlus *x, bool inverted = false);
-    QVector<QPointF> MChiDiagram(DoublePlus *NEdPlus, int nP=600, double prec=1.0e-4, int maxIter=1000);
-    QVector<QPointF> NRdMRd( int nP = 100 );
+void SteelAModel::readXml(QXmlStreamReader *reader) {
+    Q_UNUSED( reader );
+}
 
-    /** calcola la sezione sotto ipotesi elastico lineari
-     * @param alphaE coefficiente di omogeneizzazione
-     *  */
-    void SLSNMNormal( double N, double M, double alphaE, double sigmaS[], double * sigmaCUp, double * sigmaCDown, double * x);
+SteelAModel::SteelAModel( UnitMeasure * ump, QObject *parent ):
+    TableModelPlus( "SteelAModel", ump, parent ),
+    m_dd( new SteelAModelPrivate() ){
+    connect( m_d->unitMeasure, SIGNAL(stringsChanged(UnitMeasure::unitMeasure)), this, SLOT(updateHeaders(UnitMeasure::unitMeasure)) );
+    QList<QString> headers;
+    headers << trUtf8("A [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL2 ) );
+    headers << trUtf8("d [%1]").arg( m_d->unitMeasure->string( UnitMeasure::sectL ) );
+    setHeaders( headers );
+}
 
-    void SLSNM(DoublePlus *N, DoublePlus *M, DoublePlus *alphaE, SLSSteelSigmaModel *sigmaSModel, DoublePlus *sigmaCUp, DoublePlus *sigmaCDown, DoublePlus *x);
+void SteelAModel::insertRows( int position, int count ){
+    if (position < 0 || position > m_dd->AList.size() )
+        return;
 
-signals:
-    void sectionChanged();
+    for (int row = position; row < (position+count); ++row) {
+        SteelA * addedA = new SteelA( m_d->unitMeasure );
+        insertSteelA( addedA, position );
+    }
+    emit modelChanged();
+}
 
-private slots:
-    void setFcd();
-    void setEpsC2();
-    void setEpsCU2();
-    void setNC();
+void SteelAModel::removeRows(int position, int count ){
+    if (position < 0 || (position + count) > m_dd->AList.size())
+        return;
 
-    void setEpsSUd();
-    void setFSyd();
-    void setFSud();
+    for (int row = position; row < (position+count); row++){
+        // ok, procediamo a cancellare la riga
+        removeRowsPrivate( position );
+        // e la sezione
+        removeSteelA( position );
+    }
+    emit modelChanged();
+}
 
-    void setNRdMin();
-    void setNRdMax();
+DoublePlus * SteelAModel::d( int i ){
+    if( i >= 0 && i < m_dd->AList.size() )
+        return m_dd->AList.at( i )->d;
+    else
+        return NULL;
+}
 
-private:
-    SimpleSectionRCncrRectPrivate * m_d;
+DoublePlus * SteelAModel::A( int i ){
+    if( i >= 0 && i < m_dd->AList.size() )
+        return m_dd->AList.at( i )->A;
+    else
+        return NULL;
+}
 
-    void addVarToContainer( VarPlus * var );
-    void initVar();
+int SteelAModel::count(){
+    return m_dd->AList.size();
+}
 
-    double beta1Normal(double epsC );
-    double beta2Normal(double epsC );
-    double fCncrNormal(double eC);
-    double fSteelNormal(double eS);
+double SteelAModel::SANormal(){
+    double ret = 0.0;
+    for( QList<SteelA *>::iterator i = m_dd->AList.begin(); i != m_dd->AList.end(); ++i ){
+        ret += (*i)->A->valueNormal();
+    }
+    return ret;
+}
 
-    double NNormal(double eS, double eC, bool inverted = false );
-    double MNormal(double eS, double eC, bool inverted = false );
+double SteelAModel::SAdNormal(){
+    double ret = 0.0;
+    for( QList<SteelA *>::iterator i = m_dd->AList.begin(); i != m_dd->AList.end(); ++i ){
+        ret += (*i)->A->valueNormal() * (*i)->d->valueNormal();
+    }
+    return ret;
+}
 
-    double MRdNormal(double NEd, double *x, bool inverted = false, double prec=1.0e-7, int maxIter=1000);
+double SteelAModel::SAd2Normal(){
+    double ret = 0.0;
+    for( QList<SteelA *>::iterator i = m_dd->AList.begin(); i != m_dd->AList.end(); ++i ){
+        ret += (*i)->A->valueNormal() * pow((*i)->d->valueNormal(), 2.0);
+    }
+    return ret;
+}
 
-    double calcSigmaNormal(double *sigmaCUp, double *sigmaCDown, double sigmaS[], double N, double M, double x, double alphaE, bool invert);
-};
-
-#include "enumplus.h"
-
-class SteelFEpsModelPrivate;
-
-class SteelFEpsModel : public EnumPlus
-{
-    Q_OBJECT
-public:
-    SteelFEpsModel( SimpleSectionRCncrRect::ModelSteelFEps m,
-              const QString & nn,
-              bool ro = false );
-
-    QString typeVar();
-
-    SteelFEpsModel & operator=( SteelFEpsModel &);
-    VarPlus & operator=( VarPlus &);
-
-    SimpleSectionRCncrRect::ModelSteelFEps value();
-    SimpleSectionRCncrRect::ModelSteelFEps valueNormal();
-    QString valueNormalStr();
-    QString valueStr();
-
-    int enumCount();
-    QString enumStr( int );
-
-    int valueNormalInt();
-
-public slots:
-    void setValue( SimpleSectionRCncrRect::ModelSteelFEps m, bool emitAuto = true );
-    void setValue( const QString &, bool emitAuto = true );
-    void setValueNormal( SimpleSectionRCncrRect::ModelSteelFEps m, bool emitAuto = true );
-    void setValueNormal( const QString &, bool emitAuto = true );
-    void setValueInt( int, bool emitAuto = true );
-
-private:
-    SteelFEpsModelPrivate * m_d;
-
-    ~SteelFEpsModel();
-};
-
-#endif // SIMPLESECTIONRCNCR_H