コード例 #1
0
ファイル: capacitor.cpp プロジェクト: jdpillon/simulide
Capacitor::Capacitor( QObject* parent, QString type, QString id )
    : Component( parent, type, id ), eCapacitor()
{
    m_ePin.resize(2);

    QString nodid = m_id;
    nodid.append(QString("lnod"));
    QPoint nodpos = QPoint(-16-8,0);
    Pin* pin = new Pin( 180, nodpos, nodid, 0, this);
    pin->setLength(12);
    pin->setPos(-16, 0 );
    m_ePin[0] = pin;

    nodid = m_id;
    nodid.append(QString("rnod"));
    nodpos = QPoint(16+8,0);
    pin = new Pin( 0, nodpos, nodid, 1, this);
    pin->setLength(12);
    pin->setPos( 16, 0 );
    m_ePin[1] = pin;

    label->setText( QString("") );
    label->setPos(-16,-24);

    /*const QFont sansFont("Helvetica [Cronyx]", 7);
    m_labelcurr = Circuit::self()->addSimpleText( id.toLatin1().data(), sansFont );
    m_labelcurr->setParentItem( this );
    m_labelcurr->setPos(-13, -5.5 );
    //m_labelcurr->rotate( 180-dir );
    m_labelcurr->setText( QString("%1").arg(m_resist) );*/
}