(self, charge)
| 806 | return True |
| 807 | |
| 808 | def isValidCharge(self, charge): |
| 809 | # Check sizes, if 'charge size > module volume' it won't fit |
| 810 | if charge is None: |
| 811 | return True |
| 812 | chargeVolume = charge.attributes['volume'].value |
| 813 | moduleCapacity = self.item.attributes['capacity'].value |
| 814 | if chargeVolume is not None and moduleCapacity is not None and chargeVolume > moduleCapacity: |
| 815 | return False |
| 816 | |
| 817 | itemChargeSize = self.getModifiedItemAttr("chargeSize") |
| 818 | if itemChargeSize > 0: |
| 819 | chargeSize = charge.getAttribute('chargeSize') |
| 820 | if itemChargeSize != chargeSize: |
| 821 | return False |
| 822 | |
| 823 | chargeGroup = charge.groupID |
| 824 | for i in range(5): |
| 825 | itemChargeGroup = self.getModifiedItemAttr('chargeGroup' + str(i), None) |
| 826 | if not itemChargeGroup: |
| 827 | continue |
| 828 | if itemChargeGroup == chargeGroup: |
| 829 | return True |
| 830 | |
| 831 | return False |
| 832 | |
| 833 | def getValidCharges(self): |
| 834 | validCharges = set() |
no test coverage detected