pamoja for TypeScript - v0.2.0
    Preparing search index...

    Class PowerPlan

    The work intervals a node uses in each mode, and where the modes change.

    Index
    • Creates a plan from its three work intervals in microseconds, entering saver mode below 50% charge and critical below 20%, and leaving each lower mode once the charge is five points above the threshold that brought it on.

      Parameters

      • activeUs: number
      • saverUs: number
      • criticalUs: number

      Returns power.PowerPlan

    • get criticalBelow(): number

      The charge below which the plan enters critical mode.

      Returns number

    • get hysteresis(): number

      How far above a threshold the charge must climb before the plan leaves the lower mode.

      Returns number

    • get saverBelow(): number

      The charge below which the plan enters saver mode.

      Returns number

    • Returns the work interval at a state of charge, in microseconds.

      Parameters

      • soc: number

      Returns number

    • Returns the mode this plan calls for at a state of charge.

      A charge that is not a number, such as a fuel gauge that failed to answer, is taken as critical.

      Parameters

      • soc: number

      Returns PowerMode

    • Returns the mode, eased one step toward full duty while charging.

      Parameters

      • soc: number
      • charging: boolean

      Returns PowerMode

    • Returns the mode a node in current moves to at a new charge. It drops to a lower mode as soon as the charge falls below that mode's threshold, and climbs back only once the charge reaches the threshold plus the hysteresis margin, so a charge wandering around a threshold keeps the node where it is.

      Parameters

      Returns PowerMode

    • Returns the mode a node in current moves to, eased one step toward full duty while charging. current is the mode this returned last time.

      Parameters

      • current: PowerMode
      • soc: number
      • charging: boolean

      Returns PowerMode

    • Returns a copy of this plan with the hysteresis margin moved: how far above a threshold the charge must climb before the plan leaves the lower mode. 0 switches at the thresholds themselves; a margin below zero or not a number is taken as 0.

      Parameters

      • margin: number

      Returns power.PowerPlan

    • Returns a copy of this plan with the state-of-charge thresholds moved.

      Parameters

      • saverBelow: number
      • criticalBelow: number

      Returns power.PowerPlan