# Path: config.py
# def editbatconfig(section,item,itemvalue):
# def loadconfig():


import re
import time
from config import config
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#from test import config
numcells = config['battery']['numcells']
#from x import Raw
class Readings:
  """ get and manipulates readings from the real world"""


  def __init__(self):
    self.measured = config['calibrate']['measured']
    self.displayed = config['calibrate']['displayed']

    self.ratio = [ 1.0 for i in range(len(self.measured))]
    for i in range(1, len(self.measured)):
      self.ratio[i] = self.measured[i]/self.displayed[i]
    self.calvolts = [ 0.0 for i in range(len(self.measured))]

    #  calvolts = [measureddelta[i] - displayeddelta[i] for i in range(numcells+1)]
    self.voltsav = [ 3.25 for i in range(len(self.measured)+1)]
    self.voltsav[0] = 0.0
    self.rawvolts = [ 0.0 for i in range(len(self.measured))]
    self.batvolts = [ i*3.25 for i in range(len(self.measured))]
    self.uncalvolts = [ i*3.25 for i in range(len(self.measured))]
    self.batvoltsav = [ i*3.25 for i in range(len(self.measured))]
    self.balflg = [ 0.0 for i in range(numcells)]
    self.baltime = [ 0.0 for i in range(numcells)]
    self.temp = [ 0.0 for i in range(len(config['TemperatureInputs']))]

# Path: config.py
# def editbatconfig(section,item,itemvalue):
# def loadconfig():


# Path: getdata.py
import re
import time
from config import config

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#from test import config
numcells = config['battery']['numcells']
#from x import Raw
class Readings:
  """ get and manipulates readings from the real world"""


  def __init__(self):
    self.measured = config['calibrate']['measured']
    self.displayed = config['calibrate']['displayed']

    self.ratio = [ 1.0 for i in range(len(self.measured))]
    for i in range(1, len(self.measured)):
      self.ratio[i] = self.measured[i]/self.displayed[i]
    self.calvolts = [ 0.0 for i in range(len(self.measured))]

    #  calvolts = [measureddelta[i] - displayeddelta[i] for i in range(numcells+1)]
    self.voltsav = [ 3.25 for i in range(len(self.measured)+1)]
    self.voltsav[0] = 0.0
    self.rawvolts = [ 0.0 for i in range(len(self.measured))]
    self.batvolts = [ i*3.25 for i in range(len(self.measured))]
    self.uncalvolts = [ i*3.25 for i in range(len(self.measured))]
    self.batvoltsav = [ i*3.25 for i in range(len(self.measured))]
    self.balflg = [ 0.0 for i in range(numcells)]
    self.baltime = [ 0.0 for i in range(numcells)]
    self.temp = [ 0.0 for i in range(len(config['TemperatureInputs']))]

    self.numiins = len(config['CurrentInputs'])