-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadFromFiles.py
43 lines (29 loc) · 1.12 KB
/
ReadFromFiles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from Modem import Modem
from commonfunctions import *
import sys
from Config import configuration
from pprint import pprint
import commonfuctionsui
meterslist = {}
readingfiles = getfilespath("./LOCAL")
MyModem = Modem("","","","")
today =date.today().strftime("%Y%m")
debug =1
for readingfile in readingfiles:
condid = commonfuctionsui.extractidfromfilename(readingfile.replace("./LOCAL/",""))
pprint(readingfile)
type = commonfuctionsui.getmeterstype(condid)
meterslist = getmeterslist(condid,1,0,0)
if ".REP" in readingfile.upper():
MyModem.DoRepReding(readingfile,type)
TelegramToSql(meterslist,MyModem.Telegrams,today,"","","",1,MyModem.Mbresults)
#pprint(MyModem.Mbresults)
#pprint(MyModem.Telegrams)
if ".CSV" in readingfile.upper():
meterslist = getmeterslist(condid,1,0,0)
MyModem.DoCsvReading(readingfile,type)
pprint(MyModem.Mbresults)
#pprint(MyModem.Telegrams)
#pprint(type)
TelegramToSql(meterslist,MyModem.Telegrams,today,"","","",1,MyModem.Mbresults)
MyModem.Clear()