-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectEngine.py
More file actions
36 lines (24 loc) · 1.03 KB
/
ProjectEngine.py
File metadata and controls
36 lines (24 loc) · 1.03 KB
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
# -*- coding: utf-8 -*-
__author__ = 'christiaan'
from project import Project
import dataHandler as DH
def createProject(generalData,geoData,totalData,inverterData,maintananceData,ExtraData,adresData,solargisFileLocation,GHIdf):
project = Project(generalData,geoData,totalData,inverterData,maintananceData,ExtraData,adresData,solargisFileLocation,GHIdf)
project.updateInitialInverterData()
return project
def checkForDataUpdates(project):
i=0
for inverter in project.inverters:
inverter[1].updateNextInverterData(i)
i+=1
def updateAllProjects():
projectList = DH.getAllSavedProjects()
for project in projectList:
try:
print('updating: ' + str(project.name) + '...')
checkForDataUpdates(project)
#time.sleep(1)
print(str(project.name) + " updated")
DH.saveProject(project)
except:
print('Could not update '+str(project.name)+'. 1) Check directory name 2) only .csv production files are allowed in the directory')