def create_dish_source(self): """ Creates the two basic elements of this simulation: the parabolic dish, and the pillbox-sunshape ray bundle. Uses the variables set by TraitsUI. """ dish, f, W, H = standard_minidish(1., self.concent, self.refl, 1., 1.) # Add GUI annotations to the dish assembly: for surf in dish.get_homogenizer().get_surfaces(): surf.colour = (1., 0., 0.) dish.get_main_reflector().colour = (0., 0., 1.) source = solar_disk_bundle(self.disp_num_rays, N.c_[[0., 0., f + H + 0.5]], N.r_[0., 0., -1.], 0.5, 0.00465) source.set_energy(N.ones(self.disp_num_rays)*1000./self.disp_num_rays) return dish, source
def setUp(self): self.app = QApplication(sys.argv) self.form = AssemblyTree() asm = standard_minidish(1., 500, 1.)[0] self.form.set_assembly(asm)
Create or change a tag on an assembly member. Arguments: obj - an assembly object (Assembly, AssembledObject or Surface) tagname - name of tag to set or create value - the value to set tagname to. A string. """ if not hasattr(obj, '_tree_tags'): obj._tree_tags = {} obj._tree_tags[tagname] = value if __name__ == "__main__": import sys from tracer.models.tau_minidish import standard_minidish app = QtGui.QApplication(sys.argv) ui = AssemblyTree() asm = standard_minidish(1., 500, 1.)[0] # Tags test: objs = asm.get_local_objects() objs[0]._tree_tags = {'caption': 'Receiver'} objs[1]._tree_tags = {'caption': 'Dish'} asm.get_assemblies()[0]._tree_tags = {'caption': 'Homogenizer'} ui.set_assembly(asm) ui.show() sys.exit(app.exec_())