Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simat committed Apr 25, 2018
1 parent de982c8 commit dfdf4ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion alarmsnull.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

class Alarms:

def scanalarms():
def scanalarms(self,batdata):
None
14 changes: 7 additions & 7 deletions batteries.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@
numcells = config['battery']['numcells']

import logging
#logging.config.fileConfig('battery.cfg')
#logger = logging.getLogger('batlogger')
#logger.setlevel(logging.DEBUG)
#errfile=logging.FileHandler([config][errfile])
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
errfile=logging.FileHandler(config['files']['errfile'])
#errfile.setLevel(logging.DEBUG)

# create formatter
#formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
formatter = logging.Formatter(config['loggers']['format'])

# add formatter to ch
#errfile.setFormatter(formatter)
errfile.setFormatter(formatter)

# add ch to logger
#logger.addHandler(errfile)
logger.addHandler(errfile)

from getdata import Readings
exec(config['files']['alarms']) # import alarm code
Expand All @@ -59,6 +58,7 @@ def deamon(soc=-1):
batdata = Readings() # initialise batdata after we have valid sys time
alarms = Alarms() # initialise alarms

logger.debug(printtime)
print (str(printtime))
filecopy(config['files']['summaryfile'],config['files']['summaryfile']+"R" + str(int(printtime)))
if soc > config['battery']['capacity']:
Expand Down
14 changes: 7 additions & 7 deletions summary.bms.15cell
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[current]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand All @@ -18,7 +18,7 @@ power = [0.0, 0.0, 0.0, 0.0]
[hour]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand All @@ -35,7 +35,7 @@ power = [0.0, 0.0, 0.0, 0.0]
[currentday]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand All @@ -52,7 +52,7 @@ power = [0.0, 0.0, 0.0, 0.0]
[prevday]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand All @@ -69,7 +69,7 @@ power = [0.0, 0.0, 0.0, 0.0]
[monthtodate]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand All @@ -86,7 +86,7 @@ power = [0.0, 0.0, 0.0, 0.0]
[yeartodate]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand All @@ -103,7 +103,7 @@ power = [0.0, 0.0, 0.0, 0.0]
[alltime]
timestamp = '20140101000000 '
maxvoltages = [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 20.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0. 0.0, 0.0, 0.0]
maxnocharge = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minnoload = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
minvoltages = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 70.0]
deltav = [5.0, 0.0, 0.0]
Expand Down

0 comments on commit dfdf4ee

Please sign in to comment.