Show mining stats in misc column even for inactive mods/drones
This commit is contained in:
@@ -241,27 +241,29 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut, Mu
|
|||||||
return None
|
return None
|
||||||
return CycleInfo(self.cycleTime, 0, math.inf, False)
|
return CycleInfo(self.cycleTime, 0, math.inf, False)
|
||||||
|
|
||||||
@property
|
def getMiningYPS(self, ignoreState=False):
|
||||||
def miningYPS(self):
|
if not ignoreState and self.amountActive <= 0:
|
||||||
|
return 0
|
||||||
if self.__miningYield is None:
|
if self.__miningYield is None:
|
||||||
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
||||||
return self.__miningYield
|
return self.__miningYield
|
||||||
|
|
||||||
@property
|
def getMiningWPS(self, ignoreState=False):
|
||||||
def miningWPS(self):
|
if not ignoreState and self.amountActive <= 0:
|
||||||
|
return 0
|
||||||
if self.__miningWaste is None:
|
if self.__miningWaste is None:
|
||||||
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
||||||
return self.__miningWaste
|
return self.__miningWaste
|
||||||
|
|
||||||
def __calculateMining(self):
|
def __calculateMining(self):
|
||||||
if self.mines is True and self.amountActive > 0:
|
if self.mines is True:
|
||||||
getter = self.getModifiedItemAttr
|
getter = self.getModifiedItemAttr
|
||||||
cycleParams = self.getCycleParameters()
|
cycleParams = self.getCycleParameters()
|
||||||
if cycleParams is None:
|
if cycleParams is None:
|
||||||
yps = 0
|
yps = 0
|
||||||
else:
|
else:
|
||||||
cycleTime = cycleParams.averageTime
|
cycleTime = cycleParams.averageTime
|
||||||
yield_ = sum([getter(d) for d in self.MINING_ATTRIBUTES]) * self.amountActive
|
yield_ = sum([getter(d) for d in self.MINING_ATTRIBUTES]) * self.amount
|
||||||
yps = yield_ / (cycleTime / 1000.0)
|
yps = yield_ / (cycleTime / 1000.0)
|
||||||
wasteChance = self.getModifiedItemAttr("miningWasteProbability")
|
wasteChance = self.getModifiedItemAttr("miningWasteProbability")
|
||||||
wasteMult = self.getModifiedItemAttr("miningWastedVolumeMultiplier")
|
wasteMult = self.getModifiedItemAttr("miningWastedVolumeMultiplier")
|
||||||
|
|||||||
@@ -1656,11 +1656,11 @@ class Fit:
|
|||||||
droneWaste = 0
|
droneWaste = 0
|
||||||
|
|
||||||
for mod in self.modules:
|
for mod in self.modules:
|
||||||
minerYield += mod.miningYPS
|
minerYield += mod.getMiningYPS()
|
||||||
minerWaste += mod.miningWPS
|
minerWaste += mod.getMiningWPS()
|
||||||
for drone in self.drones:
|
for drone in self.drones:
|
||||||
droneYield += drone.miningYPS
|
droneYield += drone.getMiningYPS()
|
||||||
droneWaste += drone.miningWPS
|
droneWaste += drone.getMiningWPS()
|
||||||
|
|
||||||
self.__minerYield = minerYield
|
self.__minerYield = minerYield
|
||||||
self.__minerWaste = minerWaste
|
self.__minerWaste = minerWaste
|
||||||
|
|||||||
@@ -410,32 +410,33 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut, M
|
|||||||
|
|
||||||
self.__itemModifiedAttributes.clear()
|
self.__itemModifiedAttributes.clear()
|
||||||
|
|
||||||
@property
|
def getMiningYPS(self, ignoreState=False):
|
||||||
def miningYPS(self):
|
if self.isEmpty:
|
||||||
|
return 0
|
||||||
|
if not ignoreState and self.state < FittingModuleState.ACTIVE:
|
||||||
|
return 0
|
||||||
if self.__miningYield is None:
|
if self.__miningYield is None:
|
||||||
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
||||||
return self.__miningYield
|
return self.__miningYield
|
||||||
|
|
||||||
@property
|
def getMiningWPS(self, ignoreState=False):
|
||||||
def miningWPS(self):
|
if self.isEmpty:
|
||||||
|
return 0
|
||||||
|
if not ignoreState and self.state < FittingModuleState.ACTIVE:
|
||||||
|
return 0
|
||||||
if self.__miningWaste is None:
|
if self.__miningWaste is None:
|
||||||
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
self.__miningYield, self.__miningWaste = self.__calculateMining()
|
||||||
return self.__miningWaste
|
return self.__miningWaste
|
||||||
|
|
||||||
def __calculateMining(self):
|
def __calculateMining(self):
|
||||||
if self.isEmpty:
|
yield_ = self.getModifiedItemAttr("miningAmount")
|
||||||
return 0, 0
|
if yield_:
|
||||||
if self.state >= FittingModuleState.ACTIVE:
|
cycleParams = self.getCycleParameters()
|
||||||
yield_ = self.getModifiedItemAttr("miningAmount")
|
if cycleParams is None:
|
||||||
if yield_:
|
|
||||||
cycleParams = self.getCycleParameters()
|
|
||||||
if cycleParams is None:
|
|
||||||
yps = 0
|
|
||||||
else:
|
|
||||||
cycleTime = cycleParams.averageTime
|
|
||||||
yps = yield_ / (cycleTime / 1000.0)
|
|
||||||
else:
|
|
||||||
yps = 0
|
yps = 0
|
||||||
|
else:
|
||||||
|
cycleTime = cycleParams.averageTime
|
||||||
|
yps = yield_ / (cycleTime / 1000.0)
|
||||||
else:
|
else:
|
||||||
yps = 0
|
yps = 0
|
||||||
wasteChance = self.getModifiedItemAttr("miningWasteProbability")
|
wasteChance = self.getModifiedItemAttr("miningWasteProbability")
|
||||||
|
|||||||
@@ -538,11 +538,11 @@ class Miscellanea(ViewColumn):
|
|||||||
tooltip = "Optimal signature radius"
|
tooltip = "Optimal signature radius"
|
||||||
return text, tooltip
|
return text, tooltip
|
||||||
elif itemGroup in ("Frequency Mining Laser", "Strip Miner", "Mining Laser", "Gas Cloud Scoops", "Mining Drone", "Gas Cloud Harvesters"):
|
elif itemGroup in ("Frequency Mining Laser", "Strip Miner", "Mining Laser", "Gas Cloud Scoops", "Mining Drone", "Gas Cloud Harvesters"):
|
||||||
yps = stuff.miningYPS
|
yps = stuff.getMiningYPS(ignoreState=True)
|
||||||
if not yps:
|
if not yps:
|
||||||
return "", None
|
return "", None
|
||||||
yph = yps * 3600
|
yph = yps * 3600
|
||||||
wps = stuff.miningWPS
|
wps = stuff.getMiningWPS(ignoreState=True)
|
||||||
wph = wps * 3600
|
wph = wps * 3600
|
||||||
textParts = []
|
textParts = []
|
||||||
textParts.append(formatAmount(yps, 3, 0, 3))
|
textParts.append(formatAmount(yps, 3, 0, 3))
|
||||||
|
|||||||
Reference in New Issue
Block a user