diff --git a/network_sketcher.py b/network_sketcher.py index 4b7f852..607abe7 100644 --- a/network_sketcher.py +++ b/network_sketcher.py @@ -33,7 +33,7 @@ def __init__(self): self.click_value_2nd = '' self.click_value_3rd = '' self.root = TkinterDnD.Tk() - self.root.title("Network Sketcher ver 2.2.2(a)") + self.root.title("Network Sketcher ver 2.2.2(b)") self.root.geometry("490x200+100+100") # Notebook diff --git a/ns_l1_master_create.py b/ns_l1_master_create.py index d8c42fb..3c8b353 100644 --- a/ns_l1_master_create.py +++ b/ns_l1_master_create.py @@ -16,6 +16,7 @@ limitations under the License. ''' +import tkinter as tk ,tkinter.ttk as ttk,tkinter.filedialog, tkinter.messagebox from pptx import * import sys, os, re import numpy as np @@ -146,6 +147,7 @@ def __init__(self): for i, sld in enumerate(self.input_sketch_ppt.slides, start=1): #print(f'-- {i} --') current_folder_size = 0 + second_folder_size = 0 # multiple area check. add at ver 2.2.2(b) for shp in sld.shapes: ### GET Group(Icons),Picture and icon # Add Ver 1.1 @@ -181,21 +183,36 @@ def __init__(self): tmp_shp += 1 '''Elect Folder array ''' - if current_folder_size < (shp.width + shp.height): - current_folder_size = shp.width + shp.height + if current_folder_size < (shp.width * shp.height): + current_folder_size = shp.width * shp.height current_folder_array = tmp_shape_array[tmp_shp-1] + elif second_folder_size < (shp.width * shp.height): # multiple area check. add at ver 2.2.2(b) + second_folder_size = shp.width * shp.height + second_folder_array = tmp_shape_array[tmp_shp - 1] ### add root folder if there is not root folder. Add ver 1.11 tmp_count_include_shape = 0 + tmp_count_include_shape_second = 0 for tmp_check_shape in tmp_shape_array: if current_folder_array[1] < tmp_check_shape[1] and current_folder_array[2] < tmp_check_shape[2] and \ (current_folder_array[1] + current_folder_array[3]) > (tmp_check_shape[1] + tmp_check_shape[3]) and \ (current_folder_array[2] + current_folder_array[4]) > (tmp_check_shape[2] + tmp_check_shape[4]): tmp_count_include_shape += 1 #print(current_folder_array,tmp_check_shape) + for tmp_check_shape in tmp_shape_array: # multiple area check. add at ver 2.2.2(b) + if second_folder_array[1] < tmp_check_shape[1] and second_folder_array[2] < tmp_check_shape[2] and \ + (second_folder_array[1] + second_folder_array[3]) > ( + tmp_check_shape[1] + tmp_check_shape[3]) and \ + (second_folder_array[2] + second_folder_array[4]) > ( + tmp_check_shape[2] + tmp_check_shape[4]): + tmp_count_include_shape_second += 1 + # print(second_folder_array,tmp_check_shape) #print('---tmp_count_include_shape--- \n', tmp_count_include_shape) + if tmp_count_include_shape != 0 and tmp_count_include_shape_second !=0: # multiple area check. add at ver 2.2.2(b) + tkinter.messagebox.showwarning("Warning","Only one area is allowed per page.") + if tmp_count_include_shape == 0: tmp_shape_array.append(['_tmp_', 1, 1, 999999999999, 999999999999, 0.0, i]) current_folder_array = ['_tmp_','_tmp_', 1, 1, 999999999999, 999999999999, 0.0, i]