Add support for dps over time graph

This commit is contained in:
DarkPhoenix
2019-05-10 02:46:50 +03:00
parent 306710a314
commit 0f1cbb4234
7 changed files with 156 additions and 21 deletions

View File

@@ -21,6 +21,7 @@ import itertools
class Graph(object):
def __init__(self, fit, function, data=None):
self.fit = fit
self.data = {}

View File

@@ -17,16 +17,19 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from math import log, sin, radians, exp
from math import exp, log, radians, sin
from eos.graph import Graph
from eos.const import FittingModuleState, FittingHardpoint
from logbook import Logger
from eos.const import FittingHardpoint, FittingModuleState
from eos.graph import Graph
pyfalog = Logger(__name__)
class FitDpsGraph(Graph):
class FitDpsRangeGraph(Graph):
defaults = {
"angle" : 0,
"distance" : 0,

42
eos/graph/fitDpsTime.py Normal file
View File

@@ -0,0 +1,42 @@
# ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# eos is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from logbook import Logger
from eos.graph import Graph
from eos.utils.spoolSupport import SpoolType, SpoolOptions
pyfalog = Logger(__name__)
class FitDpsTimeGraph(Graph):
defaults = {"time": 0}
def __init__(self, fit, data=None):
Graph.__init__(self, fit, self.calcDps, data if data is not None else self.defaults)
self.fit = fit
def calcDps(self, data):
fit = self.fit
time = data["time"]
dps = fit.getTotalDps(spoolOptions=SpoolOptions(SpoolType.TIME, time, True)).total
return dps