Exemplo n.º 1
0
    def spisWarstwAddRow(self, ID, layerColor, layerTransparent, layerName,
                         layerSide):
        self.spisWarstw.insertRow(self.spisWarstw.rowCount())

        check = QtGui.QCheckBox()
        check.setStyleSheet("QCheckBox {margin:7px;}")
        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 0, check)
        #
        num = QtGui.QTableWidgetItem(str(ID))
        num.setTextAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
        self.spisWarstw.setItem(self.spisWarstw.rowCount() - 1, 1, num)
        #
        if layerColor:
            color = kolorWarstwy()
            color.setColor(layerColor)
            color.setToolTip(u"Click to change color")
        else:
            color = QtGui.QLabel("")

        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 2, color)
        #
        if layerSide[0] != -1:
            side = QtGui.QComboBox()
            side.addItem("Top", 1)
            side.addItem("Bottom", 0)
            side.setCurrentIndex(side.findData(layerSide[0]))
            if layerSide[1]:
                side.setDisabled(True)
        else:
            side = QtGui.QLabel("")

        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 3, side)
        #
        if layerTransparent:
            if layerTransparent[0] == 'int':
                transparent = transpSpinBox()
            else:
                transparent = transpDoubleSpinBox()

            transparent.setRange(layerTransparent[3], layerTransparent[4])
            transparent.setSuffix(layerTransparent[1])
            transparent.setValue(layerTransparent[2])
        else:
            transparent = QtGui.QLabel("")

        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 4,
                                      transparent)
        #
        name = QtGui.QTableWidgetItem(layerName)
        name.setTextAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        name.setToolTip(u"Click to change name")
        self.spisWarstw.setItem(self.spisWarstw.rowCount() - 1, 5, name)
Exemplo n.º 2
0
    def __init__(self, parent=None):
        try:
            importlib.reload(PCBconf)
        except:
            builtins.reload(PCBconf)

        QtGui.QWidget.__init__(self, parent)
        freecadSettings = FreeCAD.ParamGet(
            "User parameter:BaseApp/Preferences/Mod/PCB")

        self.form = self
        self.form.setWindowTitle(u"Create PCB")
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/board.png"))
        #
        self.gruboscPlytki = QtGui.QDoubleSpinBox(self)
        self.gruboscPlytki.setSingleStep(0.1)
        self.gruboscPlytki.setValue(
            freecadSettings.GetFloat("boardThickness", 1.5))
        self.gruboscPlytki.setSuffix(u" mm")
        #
        self.pcbBorder = QtGui.QLineEdit('')
        self.pcbBorder.setReadOnly(True)

        pickPcbBorder = pickSketch(self.pcbBorder)
        #
        self.pcbHoles = QtGui.QLineEdit('')
        self.pcbHoles.setReadOnly(True)

        pickPcbHoles = pickSketch(self.pcbHoles)
        #
        self.pcbColor = kolorWarstwy()
        self.pcbColor.setColor(self.pcbColor.PcbColorToRGB(PCBconf.PCB_COLOR))
        self.pcbColor.setToolTip(u"Click to change color")
        #
        lay = QtGui.QGridLayout()
        lay.addWidget(QtGui.QLabel(u'Border:'), 0, 0, 1, 1)
        lay.addWidget(self.pcbBorder, 0, 1, 1, 1)
        lay.addWidget(pickPcbBorder, 0, 2, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Holes:'), 1, 0, 1, 1)
        lay.addWidget(self.pcbHoles, 1, 1, 1, 1)
        lay.addWidget(pickPcbHoles, 1, 2, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Thickness:'), 2, 0, 1, 1)
        lay.addWidget(self.gruboscPlytki, 2, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Color:'), 3, 0, 1, 1)
        lay.addWidget(self.pcbColor, 3, 1, 1, 2)
        #
        self.setLayout(lay)
Exemplo n.º 3
0
 def __init__(self, parent=None):
     reload(PCBconf)
     
     QtGui.QWidget.__init__(self, parent)
     freecadSettings = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/PCB")
     
     self.form = self
     self.form.setWindowTitle(u"Create PCB")
     self.form.setWindowIcon(QtGui.QIcon(":/data/img/board.png"))
     #
     self.gruboscPlytki = QtGui.QDoubleSpinBox(self)
     self.gruboscPlytki.setSingleStep(0.1)
     self.gruboscPlytki.setValue(freecadSettings.GetFloat("boardThickness", 1.5))
     self.gruboscPlytki.setSuffix(u" mm")
     #
     self.pcbBorder = QtGui.QLineEdit('')
     self.pcbBorder.setReadOnly(True)
     
     pickPcbBorder = pickSketch(self.pcbBorder)
     #
     self.pcbHoles = QtGui.QLineEdit('')
     self.pcbHoles.setReadOnly(True)
     
     pickPcbHoles = pickSketch(self.pcbHoles)
     #
     self.pcbColor = kolorWarstwy()
     self.pcbColor.setColor(self.pcbColor.PcbColorToRGB(PCBconf.PCB_COLOR))
     self.pcbColor.setToolTip(u"Click to change color")
     #
     lay = QtGui.QGridLayout()
     lay.addWidget(QtGui.QLabel(u'Border:'), 0, 0, 1, 1)
     lay.addWidget(self.pcbBorder, 0, 1, 1, 1)
     lay.addWidget(pickPcbBorder, 0, 2, 1, 1)
     lay.addWidget(QtGui.QLabel(u'Holes:'), 1, 0, 1, 1)
     lay.addWidget(self.pcbHoles, 1, 1, 1, 1)
     lay.addWidget(pickPcbHoles, 1, 2, 1, 1)
     lay.addWidget(QtGui.QLabel(u'Thickness:'), 2, 0, 1, 1)
     lay.addWidget(self.gruboscPlytki, 2, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Color:'), 3, 0, 1, 1)
     lay.addWidget(self.pcbColor, 3, 1, 1, 2)
     #
     self.setLayout(lay)
Exemplo n.º 4
0
    def spisWarstwAddRow(self, ID, layerColor, layerTransparent, layerName):
        self.spisWarstw.insertRow(self.spisWarstw.rowCount())

        check = QtGui.QCheckBox()
        check.setStyleSheet("QCheckBox {margin:7px;}")
        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 0, check)
        #
        num = QtGui.QTableWidgetItem(str(ID))
        num.setTextAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
        self.spisWarstw.setItem(self.spisWarstw.rowCount() - 1, 1, num)
        #
        if layerColor:
            color = kolorWarstwy()
            color.setColor(layerColor)
            color.setToolTip(u"Click to change color")
        else:
            color = QtGui.QLabel("")

        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 2, color)
        #
        if layerTransparent:

            if layerTransparent[0] == 'int':
                transparent = transpSpinBox()
            else:
                transparent = transpDoubleSpinBox()

            transparent.setRange(layerTransparent[3], layerTransparent[4])
            transparent.setSuffix(layerTransparent[1])
            transparent.setValue(layerTransparent[2])
        else:
            transparent = QtGui.QLabel("")

        self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 3,
                                      transparent)
        #
        name = QtGui.QTableWidgetItem(layerName)
        name.setTextAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        name.setToolTip(u"Click to change name")
        self.spisWarstw.setItem(self.spisWarstw.rowCount() - 1, 4, name)
Exemplo n.º 5
0
 def spisWarstwAddRow(self, ID, layerColor, layerTransparent, layerName):
     self.spisWarstw.insertRow(self.spisWarstw.rowCount())
     
     check = QtGui.QCheckBox()
     check.setStyleSheet("QCheckBox {margin:7px;}")
     self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 0, check)
     #
     num = QtGui.QTableWidgetItem(str(ID))
     num.setTextAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
     self.spisWarstw.setItem(self.spisWarstw.rowCount() - 1, 1, num)
     #
     if layerColor:
         color = kolorWarstwy()
         color.setColor(layerColor)
         color.setToolTip(u"Click to change color")
     else:
         color = QtGui.QLabel("")
     
     self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 2, color)
     #
     if layerTransparent:
         
         if layerTransparent[0] == 'int':
             transparent = transpSpinBox()
         else:
             transparent = transpDoubleSpinBox()
         
         transparent.setRange(layerTransparent[3], layerTransparent[4])
         transparent.setSuffix(layerTransparent[1])
         transparent.setValue(layerTransparent[2])
     else:
         transparent = QtGui.QLabel("")
     
     self.spisWarstw.setCellWidget(self.spisWarstw.rowCount() - 1, 3, transparent)
     #
     name = QtGui.QTableWidgetItem(layerName)
     name.setTextAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
     name.setToolTip(u"Click to change name")
     self.spisWarstw.setItem(self.spisWarstw.rowCount() - 1, 4, name)
Exemplo n.º 6
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     
     self.form = self
     self.form.setWindowTitle(u"Create drill center")
     self.form.setWindowIcon(QtGui.QIcon(":/data/img/drill-icon.png"))
     #
     self.holeSize = QtGui.QDoubleSpinBox()
     self.holeSize.setValue(0.4)
     self.holeSize.setMinimum(0.1)
     self.holeSize.setSuffix('mm')
     self.holeSize.setSingleStep(0.1)
     #
     self.pcbColor = kolorWarstwy()
     self.pcbColor.setColor(getFromSettings_Color_1('CenterDrillColor', 4294967295))
     self.pcbColor.setToolTip(u"Click to change color")
     #
     lay = QtGui.QGridLayout(self)
     lay.addWidget(QtGui.QLabel('Hole size'), 0, 0, 1, 1)
     lay.addWidget(self.holeSize, 0, 1, 1, 1)
     lay.addWidget(QtGui.QLabel(u'Color:'), 1, 0, 1, 1)
     lay.addWidget(self.pcbColor, 1, 1, 1, 1)
Exemplo n.º 7
0
 def __init__(self, parent=None):
     try:
         importlib.reload(PCBconf)
     except:
         builtins.reload(PCBconf)
     
     QtGui.QWidget.__init__(self, parent)
     
     self.form = self
     self.form.setWindowTitle(u"Create glue path")
     self.form.setWindowIcon(QtGui.QIcon(":/data/img/gluePath.png"))
     #
     self.height = QtGui.QDoubleSpinBox(self)
     self.height.setSingleStep(0.1)
     self.height.setValue(1)
     self.height.setRange(0.1, 1000)
     self.height.setSuffix(u" mm")
     #
     self.width = QtGui.QDoubleSpinBox(self)
     self.width.setSingleStep(0.1)
     self.width.setValue(0.2)
     self.width.setRange(0.1, 1000)
     self.width.setSuffix(u" mm")
     #
     self.transparent = QtGui.QSpinBox(self)
     self.transparent.setSingleStep(1)
     self.transparent.setValue(0)
     self.transparent.setRange(0, 100)
     #
     self.wires = QtGui.QLineEdit('')
     self.wires.setReadOnly(True)
     pickWires = pickSketch(self.wires)
     
     if len(FreeCADGui.Selection.getSelection()):
         if FreeCADGui.Selection.getSelection()[0].isDerivedFrom("Sketcher::SketchObject"):
             self.wires.setText(FreeCADGui.Selection.getSelection()[0].Name)
     #
     self.flat = QtGui.QComboBox()
     self.flat.addItems(['True', 'False'])
     self.flat.setCurrentIndex(self.flat.findText('False'))
     #
     self.side = QtGui.QComboBox()
     self.side.addItems(['TOP', 'BOTTOM'])
     #
     self.pcbColor = kolorWarstwy()
     self.pcbColor.setColor(PCBconf.layersList['glueT']["color"])
     self.pcbColor.setToolTip(u"Click to change color")
     #
     lay = QtGui.QGridLayout(self)
     lay.addWidget(QtGui.QLabel(u'Sketcher:'), 0, 0, 1, 1)
     lay.addWidget(self.wires, 0, 1, 1, 1)
     lay.addWidget(pickWires, 0, 2, 1, 1)
     
     lay.addWidget(QtGui.QLabel(u'Side:'), 2, 0, 1, 1)
     lay.addWidget(self.side, 2, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Flat:'), 3, 0, 1, 1)
     lay.addWidget(self.flat, 3, 1, 1, 2)
     
     lay.addWidget(QtGui.QLabel(u'Height:'), 4, 0, 1, 1)
     lay.addWidget(self.height, 4, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Width:'), 5, 0, 1, 1)
     lay.addWidget(self.width, 5, 1, 1, 2)
     
     lay.addWidget(QtGui.QLabel(u'Color:'), 6, 0, 1, 1)
     lay.addWidget(self.pcbColor, 6, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Transparent:'), 7, 0, 1, 1)
     lay.addWidget(self.transparent, 7, 1, 1, 2)
Exemplo n.º 8
0
    def __init__(self, searchPhrase=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #partsManaging.__init__(self, parent)
        
        self.gruboscPlytki = getPCBheight()[1]
        self.root = None
        self.packageData = {}
        
        self.form = self
        self.form.setWindowTitle("Add annotation")
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/annotation.png"))
        #
        self.text = QtGui.QLineEdit('')
        
        self.align = QtGui.QComboBox()
        self.align.addItems(alignParam)
        
        self.mirror = QtGui.QComboBox()
        self.mirror.addItems(mirror)
        
        self.spin = QtGui.QComboBox()
        self.spin.addItems(['True', 'False'])
        
        self.fontSize = QtGui.QDoubleSpinBox()
        self.fontSize.setValue(1.27)
        self.fontSize.setSuffix(' mm')
        
        self.fontName = QtGui.QComboBox()
        self.fontName.setDisabled(True)
        
        self.val_x = QtGui.QDoubleSpinBox()
        self.val_x.setSingleStep(0.5)
        self.val_x.setRange(-1000, 1000)
        self.val_x.setSuffix(' mm')
        
        self.val_y = QtGui.QDoubleSpinBox()
        self.val_y.setSingleStep(0.5)
        self.val_y.setRange(-1000, 1000)
        self.val_y.setSuffix(' mm')
        
        self.rotation = QtGui.QDoubleSpinBox()
        self.rotation.setSingleStep(1)
        self.rotation.setSuffix(' deg')
        self.rotation.setRange(-360, 360)
        
        self.side = QtGui.QComboBox()
        self.side.addItems(objectSides)
        
        self.error = QtGui.QLabel(u'')
        
        self.continueCheckBox = QtGui.QCheckBox(u'Continue')
        
        self.fontColor = kolorWarstwy()
        self.fontColor.setColor((0, 0, 0))
        self.fontColor.setToolTip(u"Click to change color")
        #
        lay = QtGui.QGridLayout()
        lay.addWidget(QtGui.QLabel(u'Text:'), 0, 0, 1, 1)
        lay.addWidget(self.text, 0, 1, 1, 2)
        
        lay.addWidget(QtGui.QLabel(u'Font name:'), 1, 0, 1, 1)
        lay.addWidget(self.fontName, 1, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Font size:'), 2, 0, 1, 1)
        lay.addWidget(self.fontSize, 2, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Font color:'), 3, 0, 1, 1)
        lay.addWidget(self.fontColor, 3, 1, 1, 2)
        
        lay.addWidget(QtGui.QLabel(u'Align:'), 4, 0, 1, 1)
        lay.addWidget(self.align, 4, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Mirror:'), 5, 0, 1, 1)
        lay.addWidget(self.mirror, 5, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Spin:'), 6, 0, 1, 1)
        lay.addWidget(self.spin, 6, 1, 1, 2)
        
        lay.addWidget(QtGui.QLabel(u'X:'), 7, 0, 1, 1)
        lay.addWidget(self.val_x, 7, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Y:'), 8, 0, 1, 1)
        lay.addWidget(self.val_y, 8, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Rotation:'), 9, 0, 1, 1)
        lay.addWidget(self.rotation, 9, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Side:'), 10, 0, 1, 1)
        lay.addWidget(self.side, 10, 1, 1, 2)
        
        lay.addItem(QtGui.QSpacerItem(1, 10), 11, 0, 1, 3)
        lay.addWidget(self.continueCheckBox, 12, 0, 1, 3)
        lay.addItem(QtGui.QSpacerItem(1, 10), 13, 0, 1, 3)
        lay.addWidget(self.error, 14, 0, 1, 3)
        lay.setRowStretch(15, 10)
        self.setLayout(lay)
        #
        self.connect(self.val_x, QtCore.SIGNAL('valueChanged (double)'), self.addArrow)
        self.connect(self.val_y, QtCore.SIGNAL('valueChanged (double)'), self.addArrow)
        #self.connect(self.side, QtCore.SIGNAL('currentIndexChanged (int)'), self.addArrow)

        self.addArrow()
Exemplo n.º 9
0
    def __init__(self, searchPhrase=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #partsManaging.__init__(self, parent)

        self.gruboscPlytki = getPCBheight()[1]
        self.root = None
        self.packageData = {}

        self.form = self
        self.form.setWindowTitle("Add annotation")
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/annotation.png"))
        #
        self.text = QtGui.QLineEdit('')

        self.align = QtGui.QComboBox()
        self.align.addItems(alignParam)

        self.mirror = QtGui.QComboBox()
        self.mirror.addItems(mirror)

        self.spin = QtGui.QComboBox()
        self.spin.addItems(['True', 'False'])

        self.fontSize = QtGui.QDoubleSpinBox()
        self.fontSize.setValue(1.27)
        self.fontSize.setSuffix(' mm')

        self.fontName = QtGui.QComboBox()
        self.fontName.setDisabled(True)

        self.val_x = QtGui.QDoubleSpinBox()
        self.val_x.setSingleStep(0.5)
        self.val_x.setRange(-1000, 1000)
        self.val_x.setSuffix(' mm')

        self.val_y = QtGui.QDoubleSpinBox()
        self.val_y.setSingleStep(0.5)
        self.val_y.setRange(-1000, 1000)
        self.val_y.setSuffix(' mm')

        self.rotation = QtGui.QDoubleSpinBox()
        self.rotation.setSingleStep(1)
        self.rotation.setSuffix(' deg')
        self.rotation.setRange(-360, 360)

        self.side = QtGui.QComboBox()
        self.side.addItems(objectSides)

        self.error = QtGui.QLabel(u'')

        self.continueCheckBox = QtGui.QCheckBox(u'Continue')

        self.fontColor = kolorWarstwy()
        self.fontColor.setColor((0, 0, 0))
        self.fontColor.setToolTip(u"Click to change color")
        #
        lay = QtGui.QGridLayout()
        lay.addWidget(QtGui.QLabel(u'Text:'), 0, 0, 1, 1)
        lay.addWidget(self.text, 0, 1, 1, 2)

        lay.addWidget(QtGui.QLabel(u'Font name:'), 1, 0, 1, 1)
        lay.addWidget(self.fontName, 1, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Font size:'), 2, 0, 1, 1)
        lay.addWidget(self.fontSize, 2, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Font color:'), 3, 0, 1, 1)
        lay.addWidget(self.fontColor, 3, 1, 1, 2)

        lay.addWidget(QtGui.QLabel(u'Align:'), 4, 0, 1, 1)
        lay.addWidget(self.align, 4, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Mirror:'), 5, 0, 1, 1)
        lay.addWidget(self.mirror, 5, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Spin:'), 6, 0, 1, 1)
        lay.addWidget(self.spin, 6, 1, 1, 2)

        lay.addWidget(QtGui.QLabel(u'X:'), 7, 0, 1, 1)
        lay.addWidget(self.val_x, 7, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Y:'), 8, 0, 1, 1)
        lay.addWidget(self.val_y, 8, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Rotation:'), 9, 0, 1, 1)
        lay.addWidget(self.rotation, 9, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Side:'), 10, 0, 1, 1)
        lay.addWidget(self.side, 10, 1, 1, 2)

        lay.addItem(QtGui.QSpacerItem(1, 10), 11, 0, 1, 3)
        lay.addWidget(self.continueCheckBox, 12, 0, 1, 3)
        lay.addItem(QtGui.QSpacerItem(1, 10), 13, 0, 1, 3)
        lay.addWidget(self.error, 14, 0, 1, 3)
        lay.setRowStretch(15, 10)
        self.setLayout(lay)
        #
        self.connect(self.val_x, QtCore.SIGNAL('valueChanged (double)'),
                     self.addArrow)
        self.connect(self.val_y, QtCore.SIGNAL('valueChanged (double)'),
                     self.addArrow)
        #self.connect(self.side, QtCore.SIGNAL('currentIndexChanged (int)'), self.addArrow)

        self.addArrow()
Exemplo n.º 10
0
    def __init__(self, searchPhrase=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #partsManaging.__init__(self, parent)
        
        self.gruboscPlytki = getPCBheight()[1]
        self.root = None
        self.packageData = {}
        
        self.form = self
        self.form.setWindowTitle("Add annotation")
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/addAnnotation.svg"))
        #
        self.text = QtGui.QTextEdit('')
        self.text.setFixedHeight(100)
        
        self.align = QtGui.QComboBox()
        self.align.addItems(alignParam)
        
        self.spin = QtGui.QComboBox()
        self.spin.addItems(['True', 'False'])
        self.spin.setCurrentIndex(1)
        
        self.fontSize = QtGui.QDoubleSpinBox()
        self.fontSize.setValue(1.27)
        self.fontSize.setSuffix(' mm')
        
        self.fontName = QtGui.QComboBox()
        self.fontName.addItems(fonts)
        self.fontName.setCurrentIndex(self.fontName.findText("Fixed"))
        
        self.tracking = QtGui.QDoubleSpinBox()
        self.tracking.setSingleStep(0.5)
        self.tracking.setRange(-1000, 1000)
        self.tracking.setSuffix(' mm')
        
        self.lineDistance = QtGui.QSpinBox()
        self.lineDistance.setValue(50)
        self.lineDistance.setSingleStep(1)
        self.lineDistance.setRange(-1000, 1000)
        self.lineDistance.setSuffix(' %')
        
        self.val_x = QtGui.QDoubleSpinBox()
        self.val_x.setSingleStep(0.5)
        self.val_x.setRange(-1000, 1000)
        self.val_x.setSuffix(' mm')
        
        self.val_y = QtGui.QDoubleSpinBox()
        self.val_y.setSingleStep(0.5)
        self.val_y.setRange(-1000, 1000)
        self.val_y.setSuffix(' mm')
        
        self.val_z = QtGui.QDoubleSpinBox()
        self.val_z.setSingleStep(0.5)
        self.val_z.setRange(-1000, 1000)
        self.val_z.setSuffix(' mm')
        
        self.rotation = QtGui.QDoubleSpinBox()
        self.rotation.setSingleStep(1)
        self.rotation.setSuffix(' deg')
        self.rotation.setRange(-360, 360)
        
        self.side = QtGui.QComboBox()
        self.side.addItems(objectSides)
        
        self.error = QtGui.QLabel(u'')
        
        self.continueCheckBox = QtGui.QCheckBox(u'Continue')
        
        self.fontColor = kolorWarstwy()
        self.fontColor.setColor(getFromSettings_Color_1('AnnotationsColor', 4294967295))
        self.fontColor.setToolTip(u"Click to change color")
        #
        lay = QtGui.QGridLayout()
        lay.addWidget(QtGui.QLabel(u'Text:'), 0, 0, 1, 1)
        lay.addWidget(self.text, 0, 1, 1, 2)
        
        lay.addWidget(QtGui.QLabel(u'Font:'), 1, 0, 1, 1)
        lay.addWidget(self.fontName, 1, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'FontFile:'), 2, 0, 1, 1)
        
        lay.addWidget(QtGui.QLabel(u'Font size:'), 3, 0, 1, 1)
        lay.addWidget(self.fontSize, 3, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Tracking:'), 4, 0, 1, 1)
        lay.addWidget(self.tracking, 4, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Line Distance:'), 5, 0, 1, 1)
        lay.addWidget(self.lineDistance, 5, 1, 1, 2)
        
        lay.addWidget(QtGui.QLabel(u'Font color:'), 6, 0, 1, 1)
        lay.addWidget(self.fontColor, 6, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Align:'), 7, 0, 1, 1)
        lay.addWidget(self.align, 7, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Side:'), 8, 0, 1, 1)
        lay.addWidget(self.side, 8, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Spin:'), 9, 0, 1, 1)
        lay.addWidget(self.spin, 9, 1, 1, 2)
        
        lay.addWidget(QtGui.QLabel(u'X:'), 10, 0, 1, 1)
        lay.addWidget(self.val_x, 10, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Y:'), 11, 0, 1, 1)
        lay.addWidget(self.val_y, 11, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Z:'), 12, 0, 1, 1)
        lay.addWidget(self.val_z, 12, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Rotation:'), 13, 0, 1, 1)
        lay.addWidget(self.rotation, 13, 1, 1, 2)
        
        lay.addItem(QtGui.QSpacerItem(1, 10), 14, 0, 1, 3)
        lay.addWidget(self.continueCheckBox, 15, 0, 1, 3)
        lay.addItem(QtGui.QSpacerItem(1, 10), 16, 0, 1, 3)
        lay.addWidget(self.error, 17, 0, 1, 3)
        lay.setRowStretch(18, 10)
        self.setLayout(lay)
        #
        self.connect(self.val_x, QtCore.SIGNAL('valueChanged (double)'), self.addArrow)
        self.connect(self.val_y, QtCore.SIGNAL('valueChanged (double)'), self.addArrow)
        #self.connect(self.side, QtCore.SIGNAL('currentIndexChanged (int)'), self.addArrow)

        self.addArrow()
Exemplo n.º 11
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     
     self.form = self
     self.form.setWindowTitle(u"Create glue path")
     self.form.setWindowIcon(QtGui.QIcon(":/data/img/gluePath.png"))
     #
     self.height = QtGui.QDoubleSpinBox(self)
     self.height.setSingleStep(0.1)
     self.height.setValue(1)
     self.height.setRange(0.1, 1000)
     self.height.setSuffix(u" mm")
     #
     self.width = QtGui.QDoubleSpinBox(self)
     self.width.setSingleStep(0.1)
     self.width.setValue(0.2)
     self.width.setRange(0.1, 1000)
     self.width.setSuffix(u" mm")
     #
     self.transparent = QtGui.QSpinBox(self)
     self.transparent.setSingleStep(1)
     self.transparent.setValue(0)
     self.transparent.setRange(0, 100)
     #
     self.wires = QtGui.QLineEdit('')
     self.wires.setReadOnly(True)
     pickWires = pickSketch(self.wires)
     
     if len(FreeCADGui.Selection.getSelection()):
         if FreeCADGui.Selection.getSelection()[0].isDerivedFrom("Sketcher::SketchObject"):
             self.wires.setText(FreeCADGui.Selection.getSelection()[0].Name)
     #
     self.flat = QtGui.QComboBox()
     self.flat.addItems(['True', 'False'])
     self.flat.setCurrentIndex(self.flat.findText('False'))
     #
     self.side = QtGui.QComboBox()
     self.side.addItems(['TOP', 'BOTTOM'])
     #
     self.pcbColor = kolorWarstwy()
     self.pcbColor.setColor(PCBlayers['tGlue'][1])
     self.pcbColor.setToolTip(u"Click to change color")
     #
     lay = QtGui.QGridLayout(self)
     lay.addWidget(QtGui.QLabel(u'Sketcher:'), 0, 0, 1, 1)
     lay.addWidget(self.wires, 0, 1, 1, 1)
     lay.addWidget(pickWires, 0, 2, 1, 1)
     
     lay.addWidget(QtGui.QLabel(u'Side:'), 2, 0, 1, 1)
     lay.addWidget(self.side, 2, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Flat:'), 3, 0, 1, 1)
     lay.addWidget(self.flat, 3, 1, 1, 2)
     
     lay.addWidget(QtGui.QLabel(u'Height:'), 4, 0, 1, 1)
     lay.addWidget(self.height, 4, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Width:'), 5, 0, 1, 1)
     lay.addWidget(self.width, 5, 1, 1, 2)
     
     lay.addWidget(QtGui.QLabel(u'Color:'), 6, 0, 1, 1)
     lay.addWidget(self.pcbColor, 6, 1, 1, 2)
     lay.addWidget(QtGui.QLabel(u'Transparent:'), 7, 0, 1, 1)
     lay.addWidget(self.transparent, 7, 1, 1, 2)