Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,6 +48,8 @@ prjsectionsURL= 'https://docs.google.com/spreadsheets/d/1nsIgi9o9VSBKQlNxbxihPzG
|
|
| 48 |
|
| 49 |
global colorsused
|
| 50 |
global pdflink
|
|
|
|
|
|
|
| 51 |
|
| 52 |
@app.route("/",methods=["GET", "POST"])
|
| 53 |
def getInfotoMeasure():
|
|
@@ -287,17 +289,17 @@ def measureproject(result,dataDoc=0,img=0,dxffile=0):
|
|
| 287 |
SearchArray=result[6]
|
| 288 |
print(result)
|
| 289 |
print("SearchArray = ",SearchArray)
|
| 290 |
-
|
| 291 |
doc,outputimg, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas=Code_2_7.mainFunctionDrawImgPdf(dataDoc,temp_filename,result[4],SearchArray, pdfpath,result[0])
|
| 292 |
# global colorsused
|
|
|
|
| 293 |
colorsused=list(SimilarAreaDictionary['Color'])
|
| 294 |
dbPath='/TSA JOBS/ADR Test'+pdfpath+'Measured Plan/'
|
| 295 |
print(dbPath,result[0])
|
| 296 |
#
|
| 297 |
pdflink= tsadropboxretrieval.uploadanyFile(doc=doc,path=dbPath,pdfname=result[0]) #doc=doc,pdfname=path,pdfpath=pdfpath+'Measured Plan/'
|
| 298 |
-
|
| 299 |
_, buffer = cv2.imencode('.png', outputimg)
|
| 300 |
-
print('pleeeasee',SimilarAreaDictionary.to_dict(), spreadsheet_url,spreadsheetId,list1.to_dict(),pdflink,hatched_areas,namepathArr)
|
| 301 |
arr=[ base64.b64encode(buffer).decode('utf-8'),SimilarAreaDictionary.to_dict(), spreadsheet_url,spreadsheetId,[],list1.to_dict(),pdflink,hatched_areas,namepathArr]#,hatched_areas,namepathArr]# , spreadsheetId, spreadsheet_url , list1.to_dict()]
|
| 302 |
################################# -2.8- #################################
|
| 303 |
elif result[5][2].startswith('2.8'): #section value - 2.8 floor finishes
|
|
@@ -568,6 +570,8 @@ def dltmarkupslegend():
|
|
| 568 |
# myDict=eval(deletedrows)
|
| 569 |
deletedrows=pd.DataFrame(deletedrows)
|
| 570 |
print('deletedrows',deletedrows)
|
|
|
|
|
|
|
| 571 |
if section.startswith('1.0') or section.startswith('3.2') or section.startswith('3.3'):
|
| 572 |
newlgnd=google_sheet_Legend.deletefromlegend(deletedrows=deletedrows,SimilarAreaDictionarycopy=SimilarAreaDictionary, section=section,areaPermArr=areaPermArr)
|
| 573 |
elif section.startswith('2.8'):
|
|
@@ -914,6 +918,7 @@ def cvtSummarytoXML(jsdata):
|
|
| 914 |
# print(result[1])
|
| 915 |
xmllink=google_sheet_to_xml.create_xml(documentname=result[1],dbPath=path)
|
| 916 |
return jsonify(xmllink)
|
|
|
|
| 917 |
#_________________________________________________________________________________________________________________________
|
| 918 |
#_________________________________________________________________________________________________________________________
|
| 919 |
|
|
|
|
| 48 |
|
| 49 |
global colorsused
|
| 50 |
global pdflink
|
| 51 |
+
#for 2.7
|
| 52 |
+
global hatched_areas2_7
|
| 53 |
|
| 54 |
@app.route("/",methods=["GET", "POST"])
|
| 55 |
def getInfotoMeasure():
|
|
|
|
| 289 |
SearchArray=result[6]
|
| 290 |
print(result)
|
| 291 |
print("SearchArray = ",SearchArray)
|
| 292 |
+
global hatched_areas2_7
|
| 293 |
doc,outputimg, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas=Code_2_7.mainFunctionDrawImgPdf(dataDoc,temp_filename,result[4],SearchArray, pdfpath,result[0])
|
| 294 |
# global colorsused
|
| 295 |
+
hatched_areas2_7=hatched_areas
|
| 296 |
colorsused=list(SimilarAreaDictionary['Color'])
|
| 297 |
dbPath='/TSA JOBS/ADR Test'+pdfpath+'Measured Plan/'
|
| 298 |
print(dbPath,result[0])
|
| 299 |
#
|
| 300 |
pdflink= tsadropboxretrieval.uploadanyFile(doc=doc,path=dbPath,pdfname=result[0]) #doc=doc,pdfname=path,pdfpath=pdfpath+'Measured Plan/'
|
| 301 |
+
|
| 302 |
_, buffer = cv2.imencode('.png', outputimg)
|
|
|
|
| 303 |
arr=[ base64.b64encode(buffer).decode('utf-8'),SimilarAreaDictionary.to_dict(), spreadsheet_url,spreadsheetId,[],list1.to_dict(),pdflink,hatched_areas,namepathArr]#,hatched_areas,namepathArr]# , spreadsheetId, spreadsheet_url , list1.to_dict()]
|
| 304 |
################################# -2.8- #################################
|
| 305 |
elif result[5][2].startswith('2.8'): #section value - 2.8 floor finishes
|
|
|
|
| 570 |
# myDict=eval(deletedrows)
|
| 571 |
deletedrows=pd.DataFrame(deletedrows)
|
| 572 |
print('deletedrows',deletedrows)
|
| 573 |
+
if section.startswith('2.7'):
|
| 574 |
+
areaPermArr=hatched_areas2_7
|
| 575 |
if section.startswith('1.0') or section.startswith('3.2') or section.startswith('3.3'):
|
| 576 |
newlgnd=google_sheet_Legend.deletefromlegend(deletedrows=deletedrows,SimilarAreaDictionarycopy=SimilarAreaDictionary, section=section,areaPermArr=areaPermArr)
|
| 577 |
elif section.startswith('2.8'):
|
|
|
|
| 918 |
# print(result[1])
|
| 919 |
xmllink=google_sheet_to_xml.create_xml(documentname=result[1],dbPath=path)
|
| 920 |
return jsonify(xmllink)
|
| 921 |
+
|
| 922 |
#_________________________________________________________________________________________________________________________
|
| 923 |
#_________________________________________________________________________________________________________________________
|
| 924 |
|