Spaces:
Sleeping
Sleeping
Update Doors_Schedule.py
Browse files- Doors_Schedule.py +27 -2
Doors_Schedule.py
CHANGED
|
@@ -276,13 +276,24 @@ def get_selected_columns(dfs, user_patterns):
|
|
| 276 |
kelma = None
|
| 277 |
return kelma'''
|
| 278 |
|
| 279 |
-
def get_st_op_pattern(clmn_name):
|
| 280 |
target = 'structural opening'
|
| 281 |
for name in clmn_name:
|
| 282 |
if target in name.lower():
|
| 283 |
return name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
return None
|
| 285 |
|
|
|
|
| 286 |
'''def get_similar_colors(selected_columns_new):
|
| 287 |
def generate_rgb():
|
| 288 |
return (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) # RGB tuple
|
|
@@ -420,13 +431,26 @@ def get_cleaned_data(locations):
|
|
| 420 |
|
| 421 |
return new_data
|
| 422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 423 |
def get_width_info_tobeprinted(new_data):
|
| 424 |
width_info_tobeprinted = []
|
| 425 |
if len(new_data[0]) == 4:
|
| 426 |
for _,_,_, w in new_data:
|
|
|
|
| 427 |
width_info_tobeprinted.append(w)
|
| 428 |
if len(new_data[0]) == 5:
|
| 429 |
for _,_,_, w,h in new_data:
|
|
|
|
|
|
|
| 430 |
width_info_tobeprinted.append(f"{w} mm wide x {h} mm high")
|
| 431 |
return width_info_tobeprinted
|
| 432 |
|
|
@@ -579,7 +603,8 @@ def mainRun(schedule, plan, searcharray):
|
|
| 579 |
#clm_idx = selected_columns[0][2]
|
| 580 |
#clmn_name = selected_columns[0][3]
|
| 581 |
#starting_row_index = selected_columns[0][4]
|
| 582 |
-
kelma = get_st_op_pattern(user_input)
|
|
|
|
| 583 |
col_dict = get_similar_colors(selected_columns_new)
|
| 584 |
flattened_list = get_flattened_tuples_list(col_dict)
|
| 585 |
plan_texts = read_text(plan)
|
|
|
|
| 276 |
kelma = None
|
| 277 |
return kelma'''
|
| 278 |
|
| 279 |
+
'''def get_st_op_pattern(clmn_name):
|
| 280 |
target = 'structural opening'
|
| 281 |
for name in clmn_name:
|
| 282 |
if target in name.lower():
|
| 283 |
return name
|
| 284 |
+
return None'''
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
# 3ayz akhaleehaa te search fel selected_columns column names nafsaha
|
| 288 |
+
# 7ab2a 3ayz a3raf bardo maktooba ezay fel df el 7a2e2ya (akeed za ma el user medakhalha bezabt)
|
| 289 |
+
def get_st_op_pattern(selected_columns, user_input):
|
| 290 |
+
target = 'structural opening'
|
| 291 |
+
if target in selected_columns.columns:
|
| 292 |
+
name = user_input[2]
|
| 293 |
+
return name
|
| 294 |
return None
|
| 295 |
|
| 296 |
+
|
| 297 |
'''def get_similar_colors(selected_columns_new):
|
| 298 |
def generate_rgb():
|
| 299 |
return (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) # RGB tuple
|
|
|
|
| 431 |
|
| 432 |
return new_data
|
| 433 |
|
| 434 |
+
'''def get_width_info_tobeprinted(new_data):
|
| 435 |
+
width_info_tobeprinted = []
|
| 436 |
+
if len(new_data[0]) == 4:
|
| 437 |
+
for _,_,_, w in new_data:
|
| 438 |
+
width_info_tobeprinted.append(w)
|
| 439 |
+
if len(new_data[0]) == 5:
|
| 440 |
+
for _,_,_, w,h in new_data:
|
| 441 |
+
width_info_tobeprinted.append(f"{w} mm wide x {h} mm high")
|
| 442 |
+
return width_info_tobeprinted'''
|
| 443 |
+
|
| 444 |
def get_width_info_tobeprinted(new_data):
|
| 445 |
width_info_tobeprinted = []
|
| 446 |
if len(new_data[0]) == 4:
|
| 447 |
for _,_,_, w in new_data:
|
| 448 |
+
w = int(float(w))
|
| 449 |
width_info_tobeprinted.append(w)
|
| 450 |
if len(new_data[0]) == 5:
|
| 451 |
for _,_,_, w,h in new_data:
|
| 452 |
+
w = int(float(w))
|
| 453 |
+
h = int(float(h))
|
| 454 |
width_info_tobeprinted.append(f"{w} mm wide x {h} mm high")
|
| 455 |
return width_info_tobeprinted
|
| 456 |
|
|
|
|
| 603 |
#clm_idx = selected_columns[0][2]
|
| 604 |
#clmn_name = selected_columns[0][3]
|
| 605 |
#starting_row_index = selected_columns[0][4]
|
| 606 |
+
#kelma = get_st_op_pattern(user_input)
|
| 607 |
+
kelma = get_st_op_pattern(selected_columns_new, user_input)
|
| 608 |
col_dict = get_similar_colors(selected_columns_new)
|
| 609 |
flattened_list = get_flattened_tuples_list(col_dict)
|
| 610 |
plan_texts = read_text(plan)
|