def __init__(self, energy_list, sites, source, galactic, mirror, zodiac): super(gui, self).__init__() self.energy_list = energy_list # ways of measuring photon energy self.atmos_files = sites # list of observer sites self.source_files = source # list of source galaxies self.galactic_files = galactic # list of galactic emission files self.mirror_consts = mirror # dictionary of constants for mirror types (metals) self.zodiac_files = zodiac # list of ecliptic emission files # Project settings self.interp = Interpolate(aux.interval(1e11, 1e13)) # frequency range (Hz) self.bling_units = 0 # use W/Hz^1/2 as default units of BLING self.flux_units = 0 # use W/sr*Hz*m^2 as default units of flux self.signal_units = 0 # use W as default units of signal self.noise_what = 0 # plot BLING by default for noise self.compos_what = 0 # plot total BLING by default for composite self.collections = {} # dictionary of collections of data input widgets self.groups = {} # dictionary of lone widget groups not part of a collection self.floating = {} # free-floating widgets not in any group or collection # calculation in separate worker thread self.main_thread = QtCore.QThread.currentThread() self.worker = work.Worker(self.main_thread) self.worker.ready.connect(self.done_work) self.init_UI() # Set default state self.changed = False # no edits made so far self.proj_file = "" # current project file path # Load project file if specified if len(sys.argv) > 1 and os.path.exists(sys.argv[1]): project.open(self, sys.argv[1])
def open_proj (): proj_file = QtGui.QFileDialog.getOpenFileName(self, "Open Project", filter="Atmospheric Modeling Project (*.atmodel)") if len(proj_file) > 0: # open project file if a file is selected project.open(self, proj_file)
num_conts = segmentation.get_num_times() print(" Number of contours: {0:d}".format(num_conts)) for i in range(num_conts): contour = segmentation.get_segmentation(i) contour_geom, center_point, control_points = self.visualization.get_contour_geometry(contour) name = seg_name+":contour:" + str(i) cgeom = VisualizationGeometry(name, contour, self.select_contour) self.visualization.add_polydata(cgeom, contour_geom, color=[0.0, 0.8, 0.0], line_width=2.0) ## Open a project. print(" ") print("==================== Test Opening a Project ====================") project_path = "../data/DemoProject" project_path = "/Users/parkerda/SimVascular/DemoProject/" project = project.Project() project.open(project_path) win_width = 500 win_height = 500 vis = Visualization("Demo Project", win_width, win_height) test_project = TestProject(vis) ## Print the plugins defined for the project. print(" ") print("Plugins: ") plugin_instances = project.get_plugin_instances() for name, inst in plugin_instances.items(): print(" {0:s} : {1:s}".format(name, ', '.join([name for name in inst]))) ## Get an SV path object. #