void VCSlider::addLevelChannel(quint32 fixture, quint32 channel) { SceneValue lch(fixture, channel); if (m_levelChannels.contains(lch) == false) m_levelChannels.append(lch); }
void VCSlider::writeDMXLevel(MasterTimer* timer, UniverseArray* universes) { Q_UNUSED(timer); m_levelValueMutex.lock(); QListIterator <LevelChannel> it(m_levelChannels); while (it.hasNext() == true) { LevelChannel lch(it.next()); Fixture* fxi = m_doc->fixture(lch.fixture); if (fxi != NULL) { const QLCChannel* qlcch = fxi->channel(lch.channel); if (qlcch == NULL) continue; if (qlcch->group() != QLCChannel::Intensity && m_levelValueChanged == false) { /* Value has not changed and this is not an intensity channel. LTP in effect. */ continue; } quint32 dmx_ch = fxi->channelAddress(lch.channel); universes->write(dmx_ch, m_levelValue, qlcch->group()); } } m_levelValueChanged = false; m_levelValueMutex.unlock(); }
void VCSlider::addLevelChannel(quint32 fixture, quint32 channel) { LevelChannel lch(fixture, channel); if (m_levelChannels.contains(lch) == false) { m_levelChannels.append(lch); qSort(m_levelChannels.begin(), m_levelChannels.end()); } }
void execALU(){ switch(controle_alu.op_code){ case 1: add(); break; case 2: addinc(); break; case 3: and(); break; case 4: andnota(); break; case 5: asl(); break; case 6: asr(); break; case 7: deca(); break; case 8: inca(); break; case 9: j(); break; case 10: jal(); break; case 11: jf(); break; case 12: jr(); break; case 13: jt(); break; case 14: lch(); break; case 15: lcl(); break; case 16: load(); break; case 17: loadlit(); break; case 18: lsl(); break; case 19: lsr(); break; case 20: nand(); break; case 21: nor(); break; case 22: ones(); break; case 23: or(); break; case 24: ornotb(); break; case 25: passa(); break; case 26: passnota(); break; case 27: store(); break; case 28: sub(); break; case 29: subdec(); break; case 30: xnor(); break; case 31: xor(); break; case 32: zeros(); break; } }
void VCSlider::removeLevelChannel(quint32 fixture, quint32 channel) { SceneValue lch(fixture, channel); m_levelChannels.removeAll(lch); }
bool VCSlider::saveXML(QDomDocument* doc, QDomElement* vc_root) { QDomElement root; QDomElement tag; QDomElement subtag; QDomText text; QString str; Q_ASSERT(doc != NULL); Q_ASSERT(vc_root != NULL); /* VC Slider entry */ root = doc->createElement(KXMLQLCVCSlider); vc_root->appendChild(root); /* Caption */ root.setAttribute(KXMLQLCVCCaption, caption()); /* Inverted appearance */ if (invertedAppearance() == true) root.setAttribute(KXMLQLCVCSliderInvertedAppearance, "true"); else root.setAttribute(KXMLQLCVCSliderInvertedAppearance, "false"); /* Window state */ saveXMLWindowState(doc, &root); /* Appearance */ saveXMLAppearance(doc, &root); /* External input */ saveXMLInput(doc, &root); /* Mode */ tag = doc->createElement(KXMLQLCVCSliderMode); root.appendChild(tag); text = doc->createTextNode(sliderModeToString(m_sliderMode)); tag.appendChild(text); /* Value display style */ str = valueDisplayStyleToString(valueDisplayStyle()); tag.setAttribute(KXMLQLCVCSliderValueDisplayStyle, str); /* Level */ tag = doc->createElement(KXMLQLCVCSliderLevel); root.appendChild(tag); /* Level low limit */ str.setNum(levelLowLimit()); tag.setAttribute(KXMLQLCVCSliderLevelLowLimit, str); /* Level high limit */ str.setNum(levelHighLimit()); tag.setAttribute(KXMLQLCVCSliderLevelHighLimit, str); /* Level value */ str.setNum(levelValue()); tag.setAttribute(KXMLQLCVCSliderLevelValue, str); /* Level channels */ QListIterator <LevelChannel> it(m_levelChannels); while (it.hasNext() == true) { LevelChannel lch(it.next()); lch.saveXML(doc, &tag); } /* Playback */ tag = doc->createElement(KXMLQLCVCSliderPlayback); root.appendChild(tag); /* Playback function */ subtag = doc->createElement(KXMLQLCVCSliderPlaybackFunction); text = doc->createTextNode(QString::number(playbackFunction())); subtag.appendChild(text); tag.appendChild(subtag); return true; }
void VCSlider::writeDMXLevel(MasterTimer* timer, UniverseArray* universes) { Q_UNUSED(timer); m_levelValueMutex.lock(); uchar modLevel = m_levelValue; int r = 0, g = 0, b = 0, c = 0, m = 0, y = 0; if (m_cngType == ClickAndGoWidget::RGB) { float f = 0; if (m_slider) f = SCALE(float(m_levelValue), float(m_slider->minimum()), float(m_slider->maximum()), float(0), float(200)); if ((uchar)f != 0) { QColor modColor = m_cngRGBvalue.lighter((uchar)f); r = modColor.red(); g = modColor.green(); b = modColor.blue(); } } else if (m_cngType == ClickAndGoWidget::CMY) { float f = 0; if (m_slider) f = SCALE(float(m_levelValue), float(m_slider->minimum()), float(m_slider->maximum()), float(0), float(200)); if ((uchar)f != 0) { QColor modColor = m_cngRGBvalue.lighter((uchar)f); c = modColor.cyan(); m = modColor.magenta(); y = modColor.yellow(); } } QListIterator <LevelChannel> it(m_levelChannels); while (it.hasNext() == true) { LevelChannel lch(it.next()); Fixture* fxi = m_doc->fixture(lch.fixture); if (fxi != NULL) { const QLCChannel* qlcch = fxi->channel(lch.channel); if (qlcch == NULL) continue; if (qlcch->group() != QLCChannel::Intensity && m_levelValueChanged == false) { /* Value has not changed and this is not an intensity channel. LTP in effect. */ continue; } if (qlcch->group() == QLCChannel::Intensity) { if (m_cngType == ClickAndGoWidget::RGB) { if (qlcch->colour() == QLCChannel::Red) modLevel = (uchar)r; else if (qlcch->colour() == QLCChannel::Green) modLevel = (uchar)g; else if (qlcch->colour() == QLCChannel::Blue) modLevel = (uchar)b; } else if (m_cngType == ClickAndGoWidget::CMY) { if (qlcch->colour() == QLCChannel::Cyan) modLevel = (uchar)c; else if (qlcch->colour() == QLCChannel::Magenta) modLevel = (uchar)m; else if (qlcch->colour() == QLCChannel::Yellow) modLevel = (uchar)y; } } quint32 dmx_ch = fxi->channelAddress(lch.channel); universes->write(dmx_ch, modLevel, qlcch->group()); } } m_levelValueChanged = false; m_levelValueMutex.unlock(); }