/// <summary>
        /// Initializes a new instance of the PolicyControlRequest class.
        /// </summary>
        /// <param name="operation">Operation to perform.</param>
        internal PolicyControlRequest(NodeManagerPolicy policy, NodeManagerDomainId domainId, byte policyId)
        {
            // [0:2] Policy Enable/Disable
            // [3:7] Reserved. Write as 00.
            this.policyEnabled = (byte)((byte)policy & 0x07);

            // [0:3] Domain Id
            // [4:7] Reserved. Write as 00.
            this.domainId = (byte)((byte)domainId & 0x0f);

            // Policy Id
            this.policyId = policyId;
        }
        /// <summary>
        /// Initializes a new instance of the PolicyControlRequest class.
        /// </summary>
        /// <param name="operation">Operation to perform.</param>
        internal PolicyControlRequest(NodeManagerPolicy policy, NodeManagerDomainId domainId, byte policyId)
        {
            // [0:2] Policy Enable/Disable
            // [3:7] Reserved. Write as 00.
            this.policyEnabled = (byte)((byte)policy & 0x07);

            // [0:3] Domain Id
            // [4:7] Reserved. Write as 00.
            this.domainId = (byte)((byte)domainId & 0x0f);

            // Policy Id
            this.policyId = policyId;
        }
 /// <summary>
 /// Initializes a new instance of the GetStatisticsRequest class.
 /// </summary>
 internal ResetStatisticsRequest(NodeManagerDomainId domainId, NodeManagerStatistics mode, byte policyId)
 {
     this.domainId = (byte)domainId;
     this.mode = (byte)mode;
     this.policyId = policyId;
 }
 /// <summary>
 /// Initializes a new instance of the SetTotalPowerBudgetRequest class.
 /// </summary>
 internal SetTotalPowerBudgetRequest(NodeManagerDomainId domainId, ushort power)
 {
     this.domainId    = (byte)domainId;
     this.powerBudget = power;
 }
 /// <summary>
 /// Initializes a new instance of the SetTotalPowerBudgetRequest class.
 /// </summary>
 internal SetTotalPowerBudgetRequest(NodeManagerDomainId domainId, ushort power)
 {
     this.domainId = (byte)domainId;
     this.powerBudget = power;
 }
 /// <summary>
 /// Initializes a new instance of the GetPolicyRequest class.
 /// </summary>
 internal GetPolicyRequest(NodeManagerDomainId domainId, byte policyId)
 {
     this.domainId = (byte)domainId;
     this.policyId = policyId;
 }
 /// <summary>
 /// Initializes a new instance of the GetTotalPowerBudgetRequest class.
 /// </summary>
 internal GetTotalPowerBudgetRequest(NodeManagerDomainId domainId)
 {
     this.domainId = (byte)domainId;
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the GetLimitingPolicyIdRequest class.
 /// </summary>
 internal GetLimitingPolicyIdRequest(NodeManagerDomainId domainId)
 {
     // [0:3] Domain Id
     // [4:7] Reserved. Write as 00.
     this.domainId = (byte)domainId;
 }
 /// <summary>
 /// Initializes a new instance of the GetLimitingPolicyIdRequest class.
 /// </summary>
 internal GetLimitingPolicyIdRequest(NodeManagerDomainId domainId)
 {
     // [0:3] Domain Id
     // [4:7] Reserved. Write as 00.
     this.domainId = (byte)domainId;
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the SetPowerDrawRangeRequest class.
 /// </summary>
 internal SetPowerDrawRangeRequest(NodeManagerDomainId domainId, ushort minPower, ushort maxPower)
 {
     this.domainId = (byte)domainId;
     this.minPower = minPower;
     this.maxPower = maxPower;
 }
        /// <summary>
        /// Initializes a new instance of the SetPolicyRequest class.
        /// </summary>
        /// <param name="domainId">Node Manager Domain Id</param>
        /// <param name="policyEnabled">True if policy should be enabled by default</param>
        /// <param name="policyId">Unique Id of policy</param>
        /// <param name="policyType">Policy trigger target [Temp, Power, boot time]</param>
        /// <param name="action">Add/Remove policy</param>
        /// <param name="correction">Policy correction aggression</param>
        /// <param name="persistent">True if policy persists through Node Manager resets</param>
        /// <param name="exceptionAction">Action that occurs when policy gets violated</param>
        /// <param name="targetLimit">Depending on Policy Type, this value is Power Limt in Watts or % of throttle</param>
        /// <param name="correctionTime">Time in ms corrective action must be taking before exception action</param>
        /// <param name="triggerLimit">Depends on Policy Type.  This value should be temperature in celsius or time in 1/10th of a second</param>
        /// <param name="statisticReporting">Reporting only. The number of seconds that the measured power will be averaged and reported. [Note: does not alter control]</param>
        internal SetPolicyRequest(NodeManagerDomainId domainId, bool policyEnabled, byte policyId, 
            NodeManagerPolicyType policyType, NodeManagerPolicyAction action, 
            NodeManagerPowerCorrection correction, bool persistent, NodeManagerPolicyExceptionAction exceptionAction,
            ushort targetLimit, uint correctionTime, ushort triggerLimit, ushort statisticReporting)
        {
            this.domainId = (byte)domainId;

            if(policyEnabled)
                this.domainId = (byte)(this.domainId | 0x10);

            this.policyId = policyId;

            this.policyType = (byte)policyType;

            // policy action.
            if(action == NodeManagerPolicyAction.Add)
                this.policyType = (byte)(this.policyType | 0x10);

            // correction action
            this.policyType = (byte)(this.policyType | (byte)correction);

            // persistence
            if(!persistent)
                this.policyType = (byte)(this.policyType | 0x80);

            // exception action if policy cannot be kept within correction time.
            this.exceptionAction = (byte)exceptionAction;

            // target limit.
            this.targetLimit = targetLimit;

            // bits 8:15 are reserved  BootTimePolicy
            if (policyType == NodeManagerPolicyType.BootTimePolicy)
                this.targetLimit = (ushort)(this.targetLimit & 0xff);

            // set the correction time.
            this.correctionTime = correctionTime;

            // correction time override for boot time policy
            if (policyType == NodeManagerPolicyType.BootTimePolicy)
                this.correctionTime = 0;

            // trigger limit
            this.triggerLimit = triggerLimit;

            // trigger limit override for boot time policy
            if (policyType == NodeManagerPolicyType.BootTimePolicy)
                this.triggerLimit = 0;

            // statistics reporting
            this.statisticReporting = statisticReporting;
        }
 /// <summary>
 /// Initializes a new instance of the GetStatisticsRequest class.
 /// </summary>
 internal GetStatisticsRequest(NodeManagerDomainId domainId, NodeManagerStatistics mode, byte policyId)
 {
     this.domainId = (byte)domainId;
     this.mode     = (byte)mode;
     this.policyId = policyId;
 }
 /// <summary>
 /// Initializes a new instance of the GetTotalPowerBudgetRequest class.
 /// </summary>
 internal GetTotalPowerBudgetRequest(NodeManagerDomainId domainId)
 {
     this.domainId = (byte)domainId;
 }
 /// <summary>
 /// Initializes a new instance of the SetPowerDrawRangeRequest class.
 /// </summary>
 internal SetPowerDrawRangeRequest(NodeManagerDomainId domainId, ushort minPower, ushort maxPower)
 {
     this.domainId = (byte)domainId;
     this.minPower = minPower;
     this.maxPower = maxPower;
 }
 /// <summary>
 /// Initializes a new instance of the GetPolicyRequest class.
 /// </summary>
 internal GetPolicyRequest(NodeManagerDomainId domainId, byte policyId)
 {
     this.domainId = (byte)domainId;
     this.policyId = policyId;
 }
Example #16
0
        /// <summary>
        /// Initializes a new instance of the SetPolicyRequest class.
        /// </summary>
        /// <param name="domainId">Node Manager Domain Id</param>
        /// <param name="policyEnabled">True if policy should be enabled by default</param>
        /// <param name="policyId">Unique Id of policy</param>
        /// <param name="policyType">Policy trigger target [Temp, Power, boot time]</param>
        /// <param name="action">Add/Remove policy</param>
        /// <param name="correction">Policy correction aggression</param>
        /// <param name="persistent">True if policy persists through Node Manager resets</param>
        /// <param name="exceptionAction">Action that occurs when policy gets violated</param>
        /// <param name="targetLimit">Depending on Policy Type, this value is Power Limt in Watts or % of throttle</param>
        /// <param name="correctionTime">Time in ms corrective action must be taking before exception action</param>
        /// <param name="triggerLimit">Depends on Policy Type.  This value should be temperature in celsius or time in 1/10th of a second</param>
        /// <param name="statisticReporting">Reporting only. The number of seconds that the measured power will be averaged and reported. [Note: does not alter control]</param>
        internal SetPolicyRequest(NodeManagerDomainId domainId, bool policyEnabled, byte policyId,
                                  NodeManagerPolicyType policyType, NodeManagerPolicyAction action,
                                  NodeManagerPowerCorrection correction, bool persistent, NodeManagerPolicyExceptionAction exceptionAction,
                                  ushort targetLimit, uint correctionTime, ushort triggerLimit, ushort statisticReporting)
        {
            this.domainId = (byte)domainId;

            if (policyEnabled)
            {
                this.domainId = (byte)(this.domainId | 0x10);
            }

            this.policyId = policyId;

            this.policyType = (byte)policyType;

            // policy action.
            if (action == NodeManagerPolicyAction.Add)
            {
                this.policyType = (byte)(this.policyType | 0x10);
            }

            // correction action
            this.policyType = (byte)(this.policyType | (byte)correction);

            // persistence
            if (!persistent)
            {
                this.policyType = (byte)(this.policyType | 0x80);
            }

            // exception action if policy cannot be kept within correction time.
            this.exceptionAction = (byte)exceptionAction;

            // target limit.
            this.targetLimit = targetLimit;

            // bits 8:15 are reserved  BootTimePolicy
            if (policyType == NodeManagerPolicyType.BootTimePolicy)
            {
                this.targetLimit = (ushort)(this.targetLimit & 0xff);
            }

            // set the correction time.
            this.correctionTime = correctionTime;

            // correction time override for boot time policy
            if (policyType == NodeManagerPolicyType.BootTimePolicy)
            {
                this.correctionTime = 0;
            }

            // trigger limit
            this.triggerLimit = triggerLimit;

            // trigger limit override for boot time policy
            if (policyType == NodeManagerPolicyType.BootTimePolicy)
            {
                this.triggerLimit = 0;
            }

            // statistics reporting
            this.statisticReporting = statisticReporting;
        }