Support changing amount of projected fits
This commit is contained in:
@@ -363,13 +363,24 @@ class Fit(object):
|
||||
thing.state = self.__getProposedState(thing, click)
|
||||
if not thing.canHaveState(thing.state, fit):
|
||||
thing.state = State.OFFLINE
|
||||
elif isinstance(thing, eos.types.Fit):
|
||||
elif isinstance(thing, eos.types.Fit) and thing.projectionInfo is not None:
|
||||
print "toggle fit"
|
||||
thing.projectionInfo.active = not thing.projectionInfo.active
|
||||
|
||||
eos.db.commit()
|
||||
self.recalc(fit)
|
||||
|
||||
def changeAmount(self, fitID, projected_fit, amount):
|
||||
"""Change amount of projected fits"""
|
||||
fit = eos.db.getFit(fitID)
|
||||
amount = min(5, max(1, amount)) # 1 <= a <= 5
|
||||
|
||||
if projected_fit.projectionInfo is not None:
|
||||
projected_fit.projectionInfo.amount = amount
|
||||
|
||||
eos.db.commit()
|
||||
self.recalc(fit)
|
||||
|
||||
def removeProjected(self, fitID, thing):
|
||||
fit = eos.db.getFit(fitID)
|
||||
if isinstance(thing, eos.types.Drone):
|
||||
|
||||
Reference in New Issue
Block a user