lot of changes
This commit is contained in:
parent
450b58e1e9
commit
4672ccef6e
|
|
@ -28,9 +28,9 @@ from webdriver_manager.firefox import GeckoDriverManager
|
|||
|
||||
DropDownLabels = ["Street: ", "Number: ", "Postal code: ", "City: ", "coordinate X", "coordinate Y", "Sonnendach URL: ", "Suitability:", "Image Filename: ", "PV Production 75", "Value Electricity production", "Roof area", "existing PV Production Power", "existing PV Production begining of operation","id", "firstname", "lastname"]
|
||||
file_split_char = ";"
|
||||
minRoofSize = 5
|
||||
minRoofSize = 2
|
||||
minSuitability = 3
|
||||
electricityPrice = 0.11556
|
||||
electricityPrice = 0.09976
|
||||
electricityUsageFactor = 0.75
|
||||
OptionList = []
|
||||
exit = False
|
||||
|
|
@ -187,7 +187,7 @@ def search_adresses(adress_list, filename_adresslist, driver, mainText):
|
|||
for month_count in range(12):
|
||||
barChartData[month_count] = barChartData[month_count] + float(
|
||||
roof['attributes']['monats_ertrag'][month_count]) * float(
|
||||
roof['attributes']['flaeche']) * electricityPrice
|
||||
roof['attributes']['flaeche']) * electricityPrice * 0.75
|
||||
sumEnergyRoofs = sumEnergyRoofs + energy
|
||||
sumRoofArea = sumRoofArea + float(roof['attributes']['flaeche'])
|
||||
suitabilities.append(int(roof['attributes']['klasse']))
|
||||
|
|
@ -249,17 +249,7 @@ def search_adresses(adress_list, filename_adresslist, driver, mainText):
|
|||
elif(suitability == 5):
|
||||
barchart_color = "#a80000"
|
||||
|
||||
qr_url = "https://nexs.ch/redirect?" + urlencode({
|
||||
"id": adress[columnIndexes[14]],
|
||||
"project": "PJ2505-0014",
|
||||
"target": "https://www.solosolar.ch/de/kontakt?" + urlencode({
|
||||
"firstname": adress[columnIndexes[15]],
|
||||
"lastname": adress[columnIndexes[16]],
|
||||
"adresse": f"{adress[columnIndexes[0]]} {adress[columnIndexes[1]]}",
|
||||
"zip": adress[columnIndexes[2]],
|
||||
"city": adress[columnIndexes[3]]
|
||||
}, quote_via=quote_plus)
|
||||
}, quote_via=quote_plus)
|
||||
qr_url = "https://nexs.ch"
|
||||
|
||||
create_images(address_string, driver, image_filename, image_folder_map, image_folder_production, image_folder_qrcode, image_folder_barcharts,
|
||||
url, barChartMonth, barChartData, barchart_color, qr_url)
|
||||
|
|
@ -279,14 +269,6 @@ def search_adresses(adress_list, filename_adresslist, driver, mainText):
|
|||
print("Process is running since %d years %d months %d days %d hours %d minutes %d seconds" % (
|
||||
timediff.years, timediff.months, timediff.days, timediff.hours, timediff.minutes, timediff.seconds))
|
||||
|
||||
# if(found):
|
||||
# street = adress[columnIndexes[0]] + " " + adress[columnIndexes[1]]
|
||||
# plz = adress[columnIndexes[2]]
|
||||
# city = adress[columnIndexes[3]]
|
||||
# create_Partner_in_dolibarr(street, plz, city, coordinates, sumEnergyRoofs, sumRoofArea, suitability, featureId, url, response_all_roofs_decoded)
|
||||
|
||||
|
||||
|
||||
|
||||
if(stopThread == True):
|
||||
print("closing Thread")
|
||||
|
|
@ -371,10 +353,10 @@ def create_images(address_string, driver, image_filename, image_folder_map, imag
|
|||
time.sleep(2)
|
||||
|
||||
# Create QR-Code
|
||||
qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
||||
qr.add_data(qr_url)
|
||||
qr.make(fit=True)
|
||||
qr.make_image(fill='black', back_color='white').save(image_folder_qrcode + image_filename)
|
||||
# qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
||||
# qr.add_data(qr_url)
|
||||
# qr.make(fit=True)
|
||||
# qr.make_image(fill='black', back_color='white').save(image_folder_qrcode + image_filename)
|
||||
|
||||
# Create Screenshot of Map
|
||||
actions = ActionChains(driver)
|
||||
|
|
@ -484,10 +466,10 @@ def createFrameFileColums(headers):
|
|||
frameFileColums1.grid(row=2, column=1, padx=10, pady=3)
|
||||
|
||||
for i in range(len(DropDownLabels)):
|
||||
exec("text" + str(i+1) + " = tkinter.Label(frameFileColums1, text=\"" + DropDownLabels[i] + "\")")
|
||||
exec("text" + str(i+1) + ".grid(row=" + str(i+1) + ", column=1, padx=10, pady=3)")
|
||||
exec("dropdown" + str(i+1) + " = tkinter.OptionMenu(frameFileColums1, variablesDropdown[" + str(i) + "], *OptionList)")
|
||||
exec("dropdown" + str(i+1) + ".grid(row=" + str(i+1) + ", column=2, padx=10, pady=3)")
|
||||
text = tkinter.Label(frameFileColums1, text=DropDownLabels[i])
|
||||
text.grid(row=i + 1, column=1, padx=10, pady=3)
|
||||
dropdown = tkinter.OptionMenu(frameFileColums1, variablesDropdown[i], *OptionList)
|
||||
dropdown.grid(row=i+1, column=2, padx=10, pady=3)
|
||||
|
||||
def getColumnIndex():
|
||||
global OptionList
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import json
|
||||
import requests
|
||||
|
||||
search_string = "Pelikanweg 51 3074 Muri b. Bern"
|
||||
search_string = "Blankweg 46 3072 Ostermundigen"
|
||||
|
||||
#Address to coordinates
|
||||
params={
|
||||
|
|
|
|||
Loading…
Reference in New Issue