(self)
| 1489 | return drains, capUsed, capAdded |
| 1490 | |
| 1491 | def simulateCap(self): |
| 1492 | drains, self.__capUsed, self.__capRecharge = self.__generateDrain() |
| 1493 | self.__capRecharge += self.calculateCapRecharge() |
| 1494 | sim = self.__runCapSim(drains=drains) |
| 1495 | if sim is not None: |
| 1496 | capState = (sim.cap_stable_low + sim.cap_stable_high) / (2 * sim.capacitorCapacity) |
| 1497 | self.__capStable = capState > 0 |
| 1498 | self.__capState = min(100, capState * 100) if self.__capStable else sim.t / 1000.0 |
| 1499 | else: |
| 1500 | self.__capStable = True |
| 1501 | self.__capState = 100 |
| 1502 | |
| 1503 | def getCapSimData(self, startingCap): |
| 1504 | if startingCap not in self.__savedCapSimData: |
no test coverage detected