def __init__(self, initialleft, initialright, *args, **kwargs): super(MaterialSelection, self).__init__(*args, **kwargs) self.layerdef = LayerDef(*initialleft) self.lw = qg.QListWidget(self) self.lw.itemDoubleClicked.connect(self.remove_item) self.rw = qg.QListWidget(self) self.rw.itemDoubleClicked.connect(self.add_item) self.ok_button = qg.QPushButton('&Ok', self) self.cancel_button = qg.QPushButton('&Cancel', self) self.ok_button.clicked.connect(self.accept) self.cancel_button.clicked.connect(self.reject) l1 = qg.QHBoxLayout() l1.addWidget(self.lw) l1.addWidget(self.rw) l3 = qg.QHBoxLayout() l3.addStretch(1) l3.addWidget(self.ok_button) l3.addWidget(self.cancel_button) l3.addStretch(1) l2 = qg.QVBoxLayout() l2.addLayout(l1) l2.addLayout(l3) self.setLayout(l2) self.setWindowTitle('Material Selection') self.initialize_right(initialright) self.update_left()
def newfile(self): from popupcad.filetypes.layerdef import LayerDef import popupcad.filetypes.material2 as materials # from popupcad.materials.materials import Carbon_0_90_0, Pyralux, Kapton design = Design.new() design.define_layers(LayerDef(*materials.default_sublaminate)) self.load_design(design) self.view_2d.zoomToFit()
name = 'Copper' color = (1., .5, .16, .2) class FR4(Material): is_rigid = True name = 'FR4' color = (1., .85, .36, .2) class Velcro(Material): name = 'Velcro' color = (0., .5, .5, .2) class Dummy(Material): name = 'Dummy' color = (0.5, .5, .5, .2) available_materials = [ Carbon_0_90_0, Pyralux, Kapton, Cardboard, Silicone, Velcro, Dummy, Aluminum, Copper, FR4, SMP ] # available_materials.sort() if __name__ == '__main__': from popupcad.filetypes.layerdef import LayerDef sublaminate = LayerDef(Carbon_0_90_0(), Pyralux(), Kapton(), Pyralux(), Carbon_0_90_0())