QLCFixtureMode *Fixture::genericDimmerMode(QLCFixtureDef *def, int channels) { Q_ASSERT(def != NULL); QLCFixtureMode *mode = new QLCFixtureMode(def); mode->setName(QString("%1 Channel").arg(channels)); QList<QLCChannel *>chList = def->channels(); for (int i = 0; i < chList.count(); i++) { QLCChannel *ch = chList.at(i); mode->insertChannel(ch, i); QLCFixtureHead head; head.addChannel(i); mode->insertHead(-1, head); } QLCPhysical physical; physical.setWidth(300 * channels); physical.setHeight(300); physical.setDepth(300); mode->setPhysical(physical); def->addMode(mode); return mode; }
void EditMode::accept() { QLCPhysical physical = m_mode->physical(); physical.setBulbType(m_bulbTypeCombo->currentText()); physical.setBulbLumens(m_bulbLumensSpin->value()); physical.setBulbColourTemperature(m_bulbTempCombo->currentText().toInt()); physical.setWeight(m_weightSpin->value()); physical.setWidth(m_widthSpin->value()); physical.setHeight(m_heightSpin->value()); physical.setDepth(m_depthSpin->value()); physical.setLensName(m_lensNameCombo->currentText()); physical.setLensDegreesMin(m_lensDegreesMinSpin->value()); physical.setLensDegreesMax(m_lensDegreesMaxSpin->value()); physical.setFocusType(m_focusTypeCombo->currentText()); physical.setFocusPanMax(m_panMaxSpin->value()); physical.setFocusTiltMax(m_tiltMaxSpin->value()); physical.setPowerConsumption(m_powerConsumptionSpin->value()); physical.setDmxConnector(m_dmxConnectorCombo->currentText()); m_mode->setPhysical(physical); m_mode->setName(m_modeNameEdit->text()); QDialog::accept(); }
QLCFixtureMode *Fixture::genericRGBPanelMode(QLCFixtureDef *def, Components components, quint32 width, quint32 height) { Q_ASSERT(def != NULL); QLCFixtureMode *mode = new QLCFixtureMode(def); int compNum = 3; if (components == BGR) { mode->setName("BGR"); } else if (components == RGBW) { mode->setName("RGBW"); compNum = 4; } else if (components == RGBWW) { mode->setName("RGBWW"); compNum = 5; } else mode->setName("RGB"); QList<QLCChannel *>channels = def->channels(); for (int i = 0; i < channels.count(); i++) { QLCChannel *ch = channels.at(i); mode->insertChannel(ch, i); if (i%compNum == 0) { QLCFixtureHead head; head.addChannel(i); head.addChannel(i+1); head.addChannel(i+2); if (components == RGBW) head.addChannel(i+3); else if (components == RGBWW) { head.addChannel(i+3); head.addChannel(i+4); } mode->insertHead(-1, head); } } QLCPhysical physical; physical.setWidth(width); physical.setHeight(height); physical.setDepth(height); mode->setPhysical(physical); return mode; }
void EditMode::slotDepthChanged(int depth) { QLCPhysical physical = m_mode->physical(); physical.setDepth(depth); m_mode->setPhysical(physical); }