Example #1
0
UIntN DomainDisplayControl_001::getUserPreferredDisplayIndex(UIntN participantIndex, UIntN domainIndex)
{
    if ((getParticipantServices()->isUserPreferredDisplayCacheValid(participantIndex, domainIndex)) == true)
    {
        getParticipantServices()->writeMessageDebug(ParticipantMessage(
            FLF, "Attempting to get the user preferred index from the display cache."));
        m_userPreferredIndex = getParticipantServices()->getUserPreferredDisplayCacheValue(participantIndex, domainIndex);

        getParticipantServices()->writeMessageDebug(ParticipantMessage(
            FLF, "Retrieved the user preferred index of " + StlOverride::to_string(m_userPreferredIndex) + " ."));
        getParticipantServices()->invalidateUserPreferredDisplayCache(participantIndex, domainIndex);
    }
    else
    {
        auto currentStatus = getDisplayControlStatus(participantIndex, domainIndex);
        auto currentIndex = currentStatus.getBrightnessLimitIndex();

        if (m_userPreferredIndex == Constants::Invalid || 
            (m_lastSetDisplayBrightness != Constants::Invalid && currentIndex != m_lastSetDisplayBrightness))
        {
            m_userPreferredIndex = currentIndex;
            m_isUserPreferredIndexModified = true;
        }
        else
        {
            m_isUserPreferredIndexModified = false;
        }
    }

    return m_userPreferredIndex;
}
Example #2
0
std::shared_ptr<XmlNode> DomainDisplayControl_001::getXml(UIntN domainIndex)
{
    auto root = XmlNode::createWrapperElement("display_control");
    root->addChild(getDisplayControlStatus(getParticipantIndex(), domainIndex).getXml());
    root->addChild(getDisplayControlDynamicCaps(getParticipantIndex(), domainIndex).getXml());
    root->addChild(getDisplayControlSet(getParticipantIndex(), domainIndex).getXml());
    root->addChild(XmlNode::createDataElement("control_knob_version", "001"));

    return root;
}
Example #3
0
XmlNode* DomainDisplayControl_001::getXml(UIntN domainIndex)
{
    checkAndCreateControlStructures(domainIndex);

    XmlNode* root = XmlNode::createWrapperElement("display_control");
    root->addChild(getDisplayControlStatus(Constants::Invalid, domainIndex).getXml());
    root->addChild(m_displayControlDynamicCaps->getXml());
    root->addChild(m_displayControlSet->getXml());
    root->addChild(XmlNode::createDataElement("control_knob_version", "001"));

    return root;
}