コード例 #1
0
void MonitorGraphicsView::updateFixture(quint32 id)
{
    Fixture *fxi = m_doc->fixture(id);
    if (fxi == NULL || m_fixtures.contains(id) == false)
        return;

    const QLCFixtureMode *mode = fxi->fixtureMode();
    int width = 0;
    int height = 0;

    if (mode != 0)
    {
        width = mode->physical().width();
        height = mode->physical().height();
    }

    if (width == 0) width = 300;
    if (height == 0) height = 300;


    MonitorFixtureItem *item = m_fixtures[id];
    item->setSize(QSize((width * m_cellPixels) / m_unitValue, (height * m_cellPixels) / m_unitValue));

    item->setPos(realPositionToPixels(item->realPosition().x(), item->realPosition().y()));
}
コード例 #2
0
void MonitorGraphicsView::updateFixture(quint32 id)
{
    Fixture *fxi = m_doc->fixture(id);
    if (fxi == NULL || m_fixtures.contains(id) == false)
        return;

    const QLCFixtureMode *mode = fxi->fixtureMode();
    int width = 0;
    int height = 0;

    if (mode != 0)
    {
        width = mode->physical().width();
        height = mode->physical().height();
    }

    if (fxi->isDimmer())
    {
        width = fxi->heads() * 200;
        height = 200;
    }
    else
    {
        if (width == 0) width = 300;
        if (height == 0) height = 300;
    }

    MonitorFixtureItem *item = m_fixtures[id];
    item->setSize(QSize((width * m_cellPixels) / m_unitValue, (height * m_cellPixels) / m_unitValue));

    qreal realX = m_xOffset + ((item->realPosition().x() * m_cellPixels) / m_unitValue);
    qreal realY = m_yOffset + ((item->realPosition().y() * m_cellPixels) / m_unitValue);

    item->setPos(realX, realY);
}