Exemplo n.º 1
0
std::string DomainPowerControl_001::createStatusStringForTimeWindow(PowerControlType::Type controlType)
{
    try
    {
        if (isEnabled(controlType) &&
            ((controlType == PowerControlType::PL1) ||
            (controlType == PowerControlType::PL3)))
        {
            TimeSpan timeWindow = getPowerLimitTimeWindow(getParticipantIndex(), getDomainIndex(), controlType);
            return timeWindow.toStringMilliseconds();
        }
        else
        {
            return "DISABLED";
        }
    }
    catch (primitive_not_found_in_dsp)
    {
        return "NOT SUPPORTED";
    }
    catch (...)
    {
        return "ERROR";
    }
}
Exemplo n.º 2
0
void PolicyCallbackScheduler::scheduleCallback(ParticipantRole::Type participantRole, UIntN participantIndex,
    const TimeSpan& currentTime, const TimeSpan& pollTime)
{
    UInt64 callbackHandle = m_policyServices.policyInitiatedCallback->createPolicyInitiatedDeferredCallback
    (participantRole, participantIndex, nullptr, pollTime);
    m_schedule[std::make_pair(participantRole, participantIndex)] = ParticipantCallback(pollTime, currentTime, callbackHandle);

    m_policyServices.messageLogging->writeMessageDebug(PolicyMessage(FLF,
        "Scheduled a callback in " + pollTime.toStringMilliseconds() + " ms" +
        " for participant " + StlOverride::to_string(participantIndex) + " with event code = " + 
        StlOverride::to_string(participantRole) + ".", participantIndex));
}
Exemplo n.º 3
0
std::string DomainPlatformPowerControl_001::createStatusStringForTimeWindow(PlatformPowerLimitType::Type limitType)
{
    try
    {
        if (isEnabled(limitType) && 
            ((limitType == PlatformPowerLimitType::PSysPL1) || 
            (limitType == PlatformPowerLimitType::PSysPL3)))
        {
            TimeSpan timeWindow = getPlatformPowerLimitTimeWindow(getParticipantIndex(), getDomainIndex(),
                limitType);
            return timeWindow.toStringMilliseconds();
        }
        else
        {
            return "DISABLED";
        }
    }
    catch (...)
    {
        return "ERROR";
    }
}