Logo Search packages:      
Sourcecode: sailcut version File versions  Download package

CFormDef::CFormDef ( QWidget *  parent,
CSailDef sailptr 
)

The constructor.

Parameters:
parent the parent window
sailptr pointer to the CSailDef

Definition at line 38 of file formdef.cpp.

References accept(), CSailDef::clothW, compute(), CSailDef::dihedralDeg, CSailDef::footL, CSailDef::footR, CSailDef::foreI, CSailDef::foreJ, CSailDef::gaffDeg, CSailDef::gaffL, CSailDef::gaffR, CSailDef::hemsW, CSailDef::leechHemW, CSailDef::leechL, CSailDef::leechR, CSailDef::leechRP, CSailDef::LOA, CSailDef::luffL, CSailDef::luffR, CSailDef::luffRP, CSailDef::mould, CSailDef::nbGores, CSailDef::nbLuffGores, CSailDef::nbSections, CSailMould::profile, CSailDef::rake, CSailDef::sailCut, saildef, CSailDef::sailID, CSailDef::sailType, CSailDef::seamW, setSailCut(), setSailType(), CSailDef::sheetDeg, slotCompute(), slotSailCut(), slotSailType(), CSailDef::tackX, CSailDef::tackY, and CSailDef::twistDeg.

        : QDialog(parent)
{
    setupUi(this);
    setModal(true);

    /* we store the pointer to the CSailDef so we can update it when
       the user clicks OK */
    saildef = sailptr;

    setSailCut( saildef->sailCut );
    setSailType( saildef->sailType );

    txtSailID->setText(QString(saildef->sailID));

    txtLOA->setText( QString::number(saildef->LOA ) );
    txtTriangBase->setText( QString::number(saildef->foreJ ) );
    txtTriangHoist->setText( QString::number(saildef->foreI ) );

    txtClothWidth->setText( QString::number( saildef->clothW ) );
    txtSeamWidth->setText( QString::number( saildef->seamW ) );
    txtLeechHemWidth->setText( QString::number( saildef->leechHemW ) );
    txtHemsWidth->setText( QString::number( saildef->hemsW ) );

    txtTackDist->setText( QString::number( saildef->tackX ) );
    txtTackHeight->setText( QString::number( saildef->tackY ) );
    txtRake->setText( QString::number( saildef->rake ) );

    txtLuffLen->setText( QString::number( saildef->luffL ) );
    txtLuffRound->setText( QString::number( saildef->luffR ) );
    txtLuffRoundPos->setText( QString::number( saildef->luffRP ) );

    txtGaffAngle->setText( QString::number( saildef->gaffDeg ) );
    txtGaffLen->setText( QString::number( saildef->gaffL ) );
    txtGaffRound->setText( QString::number( saildef->gaffR ) );

    txtLeechLen->setText( QString::number( saildef->leechL ) );
    txtLeechRound->setText( QString::number( saildef->leechR ) );
    txtLeechRoundPos->setText( QString::number( saildef->leechRP ) );

    txtFootLen->setText( QString::number( saildef->footL ) );
    txtFootRound->setText( QString::number( saildef->footR ) );

    txtTopDepth->setText ( QString::number( saildef->mould.profile[2].getDepth()*100 ) );
    txtMidDepth->setText ( QString::number( saildef->mould.profile[1].getDepth()*100 ) );
    txtFootDepth->setText ( QString::number( saildef->mould.profile[0].getDepth()*100 ) );

    txtTwistAngle->setText ( QString::number( saildef->twistDeg ) );
    txtSheetAngle->setText ( QString::number( saildef->sheetDeg ) );

    txtSections->setText ( QString::number( saildef->nbSections ) );
    txtGores->setText ( QString::number( saildef->nbGores ) );
    txtLuffGores->setText (QString::number( saildef->nbLuffGores ) );

    txtDihedral->setText ( QString::number( saildef->dihedralDeg ) );

    // radioRadial->setEnabled(false);

    // create button group for sail type
    QButtonGroup *bgrpSailType = new QButtonGroup( this );
    bgrpSailType->addButton( radioMainSail );
    bgrpSailType->addButton( radioJib );
    bgrpSailType->addButton( radioWing );

    // create button group for sail cut
    QButtonGroup *bgrpSailCut = new QButtonGroup( this );
    bgrpSailCut->addButton( radioCross );
    bgrpSailCut->addButton( radioTwist );
    bgrpSailCut->addButton( radioHorizontal );
    bgrpSailCut->addButton( radioVertical );
    bgrpSailCut->addButton( radioMitre );
    bgrpSailCut->addButton( radioRadial );

    // signals and slots connections
    connect( btnOK, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( btnCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( btnCompute, SIGNAL( pressed() ), this, SLOT( slotCompute() ) );
    connect( bgrpSailType, SIGNAL( buttonClicked(QAbstractButton *) ), this, SLOT( slotSailType() ) );
    connect( bgrpSailCut, SIGNAL( buttonClicked(QAbstractButton *) ), this, SLOT( slotSailCut() ) );

    // calculate sail area and diagonal and display it
    compute();
}


Generated by  Doxygen 1.6.0   Back to index