def __init__(self, master): """Constructor: Takes in a main tkinter window and creates a user interface""" self.__original_fields = [] VAR = variables.Variables() # Start the variables reader self.get_menubar(master, master) # Setup menu bar items # Setup file / folder input output dialog boxes input_string, output_string = self.get_io(master, master, VAR) self.__input_string = input_string self.__output_string = output_string options_frame, mapping_list = self.get_mapping(master, VAR) self.__options_frame = options_frame self.__mapping_list = mapping_list # Setup Module checks arcpy_found = setup.check_arcpy(master, 4, 0, 3, 0, 6) # Setup command buttons run_button = self.get_buttons(master, master, VAR) # Disable run button if critical modules are not found if arcpy_found == False: run_button.configure( state=TK.DISABLED) #Disable if modules not available # Build options list for the first time. This is here since it can # not be built until both the input and options frames are in place self.set_option_list(master, VAR)
def driver(): input_folder = r'A:\Desktop\RGI32\Analysis' output_folder = r'A:\Desktop\RGI32\Final' import glacier_utilities.general_utilities.variables as variables VAR = variables.Variables() rgi_analysis (input_folder, output_folder, VAR)
def driver (): input_file = r'A:\Desktop\TestDataPrep\formate_test.shp' output_file = r'A:\Desktop\TestDataPrep\Output\formate_output.shp' mapping = {'NAME': 'Name', 'AREA': 'Area'} import glacier_utilities.general_utilities.variables as variables VAR = variables.Variables() FormatRGI (input_file, output_file, mapping, VAR)
def driver(): Input = r'A:\Desktop\TestDataPrep\TestGlacier_Single.shp' Output = r'A:\Desktop\TestDataPrep\Output' DEM = r'A:\Desktop\TestDataPrep\Test_DEM.img' #Variables - WARNING: Use caution manually changing variables. import glacier_utilities.general_utilities.variables as variables variables = variables.Variables() process(Input, Output, DEM, variables)
def driver(): input_folder = r'A:\Desktop\Mapdate' output_folder = r'A:\Desktop\Mapdate\Test' import glacier_utilities.general_utilities.variables as variables VAR = variables.Variables() VAR.set_variable('INPUT_FOLDER', 'STRING', input_folder) VAR.set_variable('OUTPUT_FOLDER', 'STRING', output_folder) rgi_analysis(VAR)
def __init__(self, master): """Constructor: Takes in a main tkinter window and creates a user interface""" VAR = variables.Variables() # Start the variables reader self.get_menubar(master, master) # Setup menu bar items # Setup file / folder input output dialog boxes input_string, output_string = self.get_io (master, master, VAR) self.__input_string = input_string self.__output_string = output_string # Setup Module checks arcpy_found = setup.check_arcpy(master, 4, 0, 3, 0, 6) # Setup command buttons run_button = self.get_buttons (master, master, VAR) # Disable run button if critical modules are not found if arcpy_found == False: run_button.configure (state=TK.DISABLED) #Disable if modules not available
sys.path.append (os.path.dirname(os.path.dirname(__file__))) import glacier_scripts.rgi_analyze as rgi_analyze import glacier_utilities.general_utilities.variables as VAR import arcpy as ARCPY #@UnresolvedImport # Read parameter values from ArcGIS tool input # 1 - The folder containing RGI layers to be analyzed # 2 - The output folder where processed files are placed # 3 - Start the variables object try: rgi_folder = ARCPY.GetParameterAsText(0) except: ARCPY.AddError('RGI Input File Error') try: rgi_output = ARCPY.GetParameterAsText(1) except: ARCPY.AddError('RGI Output Folder Error') try: variables = VAR.Variables() except: ARCPY.AddError('Could Not Initialize Variables') # Run the analysis on rgi layers try: rgi_analyze.rgi_analysis(rgi_folder, rgi_output, variables) except: ARCPY.AddError('Errors generated during function execution') # Driver - Currently Does nothing def driver(): pass if __name__ == '__main__': driver()
def __init__(self, master): """Setup the main GUI window and load default or starting settings.""" VAR = variables.Variables() # Start the variables reader self.get_menubar(master, master) # Setup menu bar items # Setup file / folder input output dialog boxes input_string, dem_string, output_string = self.get_io(master, VAR) self.__input_string = input_string self.__dem_string = dem_string self.__output_string = output_string #Settings Frame options_frame = TK.LabelFrame(master, text='Options') options_frame.grid(row=3, column=0, columnspan=3, padx=6, pady=6) # Setup Centerline options centerline_boolean, cellsize_string, smoothing_string, cellsize_entry, smoothing_entry = self.get_centerline( options_frame, VAR) self.__centerline_boolean = centerline_boolean self.__cellsize_string = cellsize_string self.__smoothing_string = smoothing_string self.__cellsize_entry = cellsize_entry self.__smoothing_entry = smoothing_entry # Setup optional table check button frame hypsometry_boolean, slope_boolean, aspect_boolean = self.get_tables( options_frame, VAR) self.__hypsometry_boolean = hypsometry_boolean self.__slope_boolean = slope_boolean self.__aspect_boolean = aspect_boolean # Setup optional populate field check buttons glims_boolean, rgi_boolean, rgi_version, rgi_region, ver_entry, reg_entry = self.get_populate( options_frame, VAR) self.__glims_boolean = glims_boolean self.__rgi_boolean = rgi_boolean self.__rgi_version = rgi_version self.__rgi_region = rgi_region self.__rgi_version_entry = ver_entry self.__rgi_region_entry = reg_entry # Setup application parameters needed at runtime i.e. scale raster scaling_string, buffer_string = self.get_parameters(options_frame, VAR) self.__scaling_string = scaling_string self.__buffer_string = buffer_string # Setup bin options for application min_string, max_string, size_string = self.get_bins(options_frame, VAR) self.__min_string = min_string self.__max_string = max_string self.__size_string = size_string # Setup a restore defaults button for the application self.reset_default(options_frame, VAR) # Setup Module checks arcpy_found = setup.check_arcpy(master, 4, 0, 3, 0, 6) # Setup command buttons run_button = self.get_buttons(master, master, VAR) # Disable run button if critical modules are not found if arcpy_found == False: run_button.configure( state=TK.DISABLED) #Disable if modules not available self.enable() # Enable or disable buttons depending on need