def list(): data = {} PCBlayers["Parts"] = [2, [0, 0, 0], None, ['PCBpart'], "Parts"] PCBlayers["Parts Name"] = [2, [0, 0, 0], None, ['PCBannotation', 'anno_name'], "Parts Name"] PCBlayers["Parts Value"] = [2, [0, 0, 0], None, ['PCBannotation', 'anno_value'], "Parts Value"] for i, j in PCBconstraintAreas.items(): PCBlayers[j[0]] = [2, [0, 0, 0], None, j[1], j[4]] for i, j in OrderedDict(sorted(PCBlayers.items(), key=lambda t: t[0])).items(): data[i] = {'id': j[3], 'info': j[4]} return data
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.form = self self.form.setWindowTitle(u"Layers settings") self.form.setWindowIcon(QtGui.QIcon(":/data/img/layers.png")) # nr = 0 lay = QtGui.QGridLayout() PCBlayers["Parts"] = [2, [0, 0, 0], None, 'PCBpart', "Parts"] PCBlayers["Parts Name"] = [ 2, [0, 0, 0], None, ['PCBannotation', 'anno_name'], "Parts Name" ] PCBlayers["Parts Value"] = [ 2, [0, 0, 0], None, ['PCBannotation', 'anno_value'], "Parts Value" ] # for i, j in PCBconstraintAreas.items(): PCBlayers[j[0]] = [2, [0, 0, 0], None, j[1], j[4]] for i, j in OrderedDict(sorted(PCBlayers.items(), key=lambda t: t[0])).items(): infoPrz = przycisk() infoPrz.setToolTip(u"Info") infoPrz.setIcon(QtGui.QIcon(":/data/img/info_16x16.png")) par = partial(self.showInfo, j[4]) self.connect(infoPrz, QtCore.SIGNAL("clicked ()"), par) showAll = przycisk() showAll.setToolTip(u"Show All") showAll.setIcon(QtGui.QIcon(":/data/img/show.png")) par = partial(self.showAll, j[3]) self.connect(showAll, QtCore.SIGNAL("clicked ()"), par) hideAll = przycisk() hideAll.setToolTip(u"Hide All") hideAll.setIcon(QtGui.QIcon(":/data/img/hide.png")) par = partial(self.hideAll, j[3]) self.connect(hideAll, QtCore.SIGNAL("clicked ()"), par) # lay.addWidget(QtGui.QLabel(i), nr, 0, 1, 1) lay.addWidget(showAll, nr, 1, 1, 1) lay.addWidget(hideAll, nr, 2, 1, 1) lay.addWidget(infoPrz, nr, 3, 1, 1) # nr += 1 # lay.setColumnStretch(0, 10) self.setLayout(lay)
def listTXT(): PCBlayers["Parts"] = [2, [0, 0, 0], None, ['PCBpart'], "Parts"] PCBlayers["Parts Name"] = [2, [0, 0, 0], None, ['PCBannotation', 'anno_name'], "Parts Name"] PCBlayers["Parts Value"] = [2, [0, 0, 0], None, ['PCBannotation', 'anno_value'], "Parts Value"] for i, j in PCBconstraintAreas.items(): PCBlayers[j[0]] = [2, [0, 0, 0], None, j[1], j[4]] FreeCAD.Console.PrintWarning(u"****************\n") FreeCAD.Console.PrintWarning(u"Available layers:\n") for i, j in OrderedDict(sorted(PCBlayers.items(), key=lambda t: t[0])).items(): FreeCAD.Console.PrintWarning(u"Layer name:{0} ; Layer ID: {1}\n".format(i, ', '.join(j[3]))) FreeCAD.Console.PrintWarning(u"****************\n") return ''
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.form = self self.form.setWindowTitle(u"Layers settings") self.form.setWindowIcon(QtGui.QIcon(":/data/img/layers.png")) # nr = 0 lay = QtGui.QGridLayout() PCBlayers["Parts"] = [2, [0, 0, 0], None, 'PCBpart', "Parts"] PCBlayers["Parts Name"] = [2, [0, 0, 0], None, ['PCBannotation', 'anno_name'], "Parts Name"] PCBlayers["Parts Value"] = [2, [0, 0, 0], None, ['PCBannotation', 'anno_value'], "Parts Value"] # for i, j in PCBconstraintAreas.items(): PCBlayers[j[0]] = [2, [0, 0, 0], None, j[1], j[4]] for i, j in OrderedDict(sorted(PCBlayers.items(), key=lambda t: t[0])).items(): infoPrz = przycisk() infoPrz.setToolTip(u"Info") infoPrz.setIcon(QtGui.QIcon(":/data/img/info_16x16.png")) par = partial(self.showInfo, j[4]) self.connect(infoPrz, QtCore.SIGNAL("clicked ()"), par) showAll = przycisk() showAll.setToolTip(u"Show All") showAll.setIcon(QtGui.QIcon(":/data/img/show.png")) par = partial(self.showAll, j[3]) self.connect(showAll, QtCore.SIGNAL("clicked ()"), par) hideAll = przycisk() hideAll.setToolTip(u"Hide All") hideAll.setIcon(QtGui.QIcon(":/data/img/hide.png")) par = partial(self.hideAll, j[3]) self.connect(hideAll, QtCore.SIGNAL("clicked ()"), par) # lay.addWidget(QtGui.QLabel(i), nr, 0, 1, 1) lay.addWidget(showAll, nr, 1, 1, 1) lay.addWidget(hideAll, nr, 2, 1, 1) lay.addWidget(infoPrz, nr, 3, 1, 1) # nr += 1 # lay.setColumnStretch(0, 10) self.setLayout(lay)
def list(): data = {} PCBlayers["Parts"] = [2, [0, 0, 0], None, ['PCBpart'], "Parts"] PCBlayers["Parts Name"] = [ 2, [0, 0, 0], None, ['PCBannotation', 'anno_name'], "Parts Name" ] PCBlayers["Parts Value"] = [ 2, [0, 0, 0], None, ['PCBannotation', 'anno_value'], "Parts Value" ] for i, j in PCBconstraintAreas.items(): PCBlayers[j[0]] = [2, [0, 0, 0], None, j[1], j[4]] for i, j in OrderedDict(sorted(PCBlayers.items(), key=lambda t: t[0])).items(): data[i] = {'id': j[3], 'info': j[4]} return data
def listTXT(): PCBlayers["Parts"] = [2, [0, 0, 0], None, ['PCBpart'], "Parts"] PCBlayers["Parts Name"] = [ 2, [0, 0, 0], None, ['PCBannotation', 'anno_name'], "Parts Name" ] PCBlayers["Parts Value"] = [ 2, [0, 0, 0], None, ['PCBannotation', 'anno_value'], "Parts Value" ] for i, j in PCBconstraintAreas.items(): PCBlayers[j[0]] = [2, [0, 0, 0], None, j[1], j[4]] FreeCAD.Console.PrintWarning(u"****************\n") FreeCAD.Console.PrintWarning(u"Available layers:\n") for i, j in OrderedDict(sorted(PCBlayers.items(), key=lambda t: t[0])).items(): FreeCAD.Console.PrintWarning( u"Layer name:{0} ; Layer ID: {1}\n".format(i, ', '.join(j[3]))) FreeCAD.Console.PrintWarning(u"****************\n") return ''