@@ -241,7 +241,7 void QIlib::QIcadPcbRoot::apendVia(QIlib | |||||
241 | { |
|
241 | { | |
242 | if(node->name==QIlib::Lexique::via_c) |
|
242 | if(node->name==QIlib::Lexique::via_c) | |
243 | { |
|
243 | { | |
244 | this->vias.append(new QIcadPcbVia(node)); |
|
244 | this->vias.append(new QIcadPcbVia(node,this->setup.defaultViaDrillSize())); | |
245 | } |
|
245 | } | |
246 | } |
|
246 | } | |
247 |
|
247 | |||
@@ -749,7 +749,18 QIlib::QIcadPcbSetup::QIcadPcbSetup(QIli | |||||
749 |
|
749 | |||
750 | void QIlib::QIcadPcbSetup::setNode(QIlib::AbstractNode *node) |
|
750 | void QIlib::QIcadPcbSetup::setNode(QIlib::AbstractNode *node) | |
751 | { |
|
751 | { | |
|
752 | if(node->name==QIlib::Lexique::setup_c) | |||
|
753 | { | |||
752 | this->p_node = node; |
|
754 | this->p_node = node; | |
|
755 | for(int i=0;i<node->nodes.count();i++) | |||
|
756 | { | |||
|
757 | if(node->nodes.at(i)->name==QIlib::Lexique::via_drill_c) | |||
|
758 | { | |||
|
759 | this->via_dril.setNode(node->nodes.at(i)); | |||
|
760 | this->p_defaultViaDrillSize = nodeValueToDouble(node->nodes.at(i)); | |||
|
761 | } | |||
|
762 | } | |||
|
763 | } | |||
753 | } |
|
764 | } | |
754 |
|
765 | |||
755 |
|
766 | |||
@@ -807,8 +818,8 void QIlib::QIcadPcbSegment::setNode(QIl | |||||
807 | } |
|
818 | } | |
808 |
|
819 | |||
809 |
|
820 | |||
810 | QIlib::QIcadPcbVia::QIcadPcbVia(QIlib::AbstractNode *node) |
|
821 | QIlib::QIcadPcbVia::QIcadPcbVia(QIlib::AbstractNode *node, double defaultDrill) | |
811 | :QIcadAbstractNodeWrapper(node) |
|
822 | :QIcadAbstractNodeWrapper(node),p_drill(defaultDrill) | |
812 | { |
|
823 | { | |
813 | this->setNode(node); |
|
824 | this->setNode(node); | |
814 | } |
|
825 | } | |
@@ -828,7 +839,7 void QIlib::QIcadPcbVia::setNode(QIlib:: | |||||
828 | if(node->nodes.at(i)->name==QIlib::Lexique::size_c) |
|
839 | if(node->nodes.at(i)->name==QIlib::Lexique::size_c) | |
829 | { |
|
840 | { | |
830 | this->sizeNode.setNode(node->nodes.at(i)); |
|
841 | this->sizeNode.setNode(node->nodes.at(i)); | |
831 |
p_size = |
|
842 | p_size = QSizeF(nodeValueToDouble(node->nodes.at(i)),nodeValueToDouble(node->nodes.at(i))); | |
832 | } |
|
843 | } | |
833 | if(node->nodes.at(i)->name==QIlib::Lexique::drill_c) |
|
844 | if(node->nodes.at(i)->name==QIlib::Lexique::drill_c) | |
834 | { |
|
845 | { |
@@ -141,6 +141,9 public: | |||||
141 | QIcadAbstractNodeWrapper visible_elements; |
|
141 | QIcadAbstractNodeWrapper visible_elements; | |
142 | QIcadPcbPlotParams plotParams; |
|
142 | QIcadPcbPlotParams plotParams; | |
143 | void setNode(QIlib::AbstractNode* node); |
|
143 | void setNode(QIlib::AbstractNode* node); | |
|
144 | double defaultViaDrillSize(){return p_defaultViaDrillSize;} | |||
|
145 | private: | |||
|
146 | double p_defaultViaDrillSize; | |||
144 | }; |
|
147 | }; | |
145 |
|
148 | |||
146 | class QIcadPcbNetClass : public QIcadAbstractNodeWrapper |
|
149 | class QIcadPcbNetClass : public QIcadAbstractNodeWrapper | |
@@ -319,7 +322,7 public: | |||||
319 | class QIcadPcbVia : public QIcadAbstractNodeWrapper |
|
322 | class QIcadPcbVia : public QIcadAbstractNodeWrapper | |
320 | { |
|
323 | { | |
321 | public: |
|
324 | public: | |
322 | QIcadPcbVia(QIlib::AbstractNode* node); |
|
325 | QIcadPcbVia(QIlib::AbstractNode* node, double defaultDrill=0); | |
323 | QIcadPcbVia(){} |
|
326 | QIcadPcbVia(){} | |
324 | QIcadAbstractNodeWrapper at; |
|
327 | QIcadAbstractNodeWrapper at; | |
325 | QIcadAbstractNodeWrapper sizeNode; |
|
328 | QIcadAbstractNodeWrapper sizeNode; |
@@ -45,13 +45,15 void PCBVia::init(QPointF offset) | |||||
45 | { |
|
45 | { | |
46 | QGraphicsEllipseItem* ellipse = new QGraphicsEllipseItem(); |
|
46 | QGraphicsEllipseItem* ellipse = new QGraphicsEllipseItem(); | |
47 | QPen pen = ellipse->pen(); |
|
47 | QPen pen = ellipse->pen(); | |
48 | pen.setWidthF(0.01); |
|
48 | double thickness = (this->viaNode->size().width()-this->viaNode->drill())/2; | |
|
49 | pen.setWidthF(thickness); | |||
|
50 | ||||
49 | ellipse->setPen(pen); |
|
51 | ellipse->setPen(pen); | |
50 | QBrush brush = ellipse->brush(); |
|
52 | // QBrush brush = ellipse->brush(); | |
51 | brush.setStyle(Qt::SolidPattern); |
|
53 | // brush.setStyle(Qt::SolidPattern); | |
52 | brush.setColor(context->layerColor(this->viaNode->layers().at(i))); |
|
54 | // brush.setColor(context->layerColor(this->viaNode->layers().at(i))); | |
53 | ellipse->setBrush(brush); |
|
55 | // ellipse->setBrush(brush); | |
54 | QRectF rec(this->viaNode->pos()+offset,this->viaNode->size()); |
|
56 | QRectF rec(this->viaNode->pos()+offset,QSizeF(this->viaNode->size().width()-thickness,this->viaNode->size().width()-thickness)); | |
55 | ellipse->setRect(rec); |
|
57 | ellipse->setRect(rec); | |
56 | ellipse->setZValue(-context->layer(viaNode->layers().at(i))); |
|
58 | ellipse->setZValue(-context->layer(viaNode->layers().at(i))); | |
57 | this->addToGroup(ellipse); |
|
59 | this->addToGroup(ellipse); |
General Comments 0
You need to be logged in to leave comments.
Login now