@@ -241,7 +241,7 void QIlib::QIcadPcbRoot::apendVia(QIlib | |||
|
241 | 241 | { |
|
242 | 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 | 750 | void QIlib::QIcadPcbSetup::setNode(QIlib::AbstractNode *node) |
|
751 | 751 | { |
|
752 | if(node->name==QIlib::Lexique::setup_c) | |
|
753 | { | |
|
752 | 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) | |
|
811 | :QIcadAbstractNodeWrapper(node) | |
|
821 | QIlib::QIcadPcbVia::QIcadPcbVia(QIlib::AbstractNode *node, double defaultDrill) | |
|
822 | :QIcadAbstractNodeWrapper(node),p_drill(defaultDrill) | |
|
812 | 823 | { |
|
813 | 824 | this->setNode(node); |
|
814 | 825 | } |
@@ -828,7 +839,7 void QIlib::QIcadPcbVia::setNode(QIlib:: | |||
|
828 | 839 | if(node->nodes.at(i)->name==QIlib::Lexique::size_c) |
|
829 | 840 | { |
|
830 | 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 | 844 | if(node->nodes.at(i)->name==QIlib::Lexique::drill_c) |
|
834 | 845 | { |
@@ -141,6 +141,9 public: | |||
|
141 | 141 | QIcadAbstractNodeWrapper visible_elements; |
|
142 | 142 | QIcadPcbPlotParams plotParams; |
|
143 | 143 | void setNode(QIlib::AbstractNode* node); |
|
144 | double defaultViaDrillSize(){return p_defaultViaDrillSize;} | |
|
145 | private: | |
|
146 | double p_defaultViaDrillSize; | |
|
144 | 147 | }; |
|
145 | 148 | |
|
146 | 149 | class QIcadPcbNetClass : public QIcadAbstractNodeWrapper |
@@ -319,7 +322,7 public: | |||
|
319 | 322 | class QIcadPcbVia : public QIcadAbstractNodeWrapper |
|
320 | 323 | { |
|
321 | 324 | public: |
|
322 | QIcadPcbVia(QIlib::AbstractNode* node); | |
|
325 | QIcadPcbVia(QIlib::AbstractNode* node, double defaultDrill=0); | |
|
323 | 326 | QIcadPcbVia(){} |
|
324 | 327 | QIcadAbstractNodeWrapper at; |
|
325 | 328 | QIcadAbstractNodeWrapper sizeNode; |
@@ -45,13 +45,15 void PCBVia::init(QPointF offset) | |||
|
45 | 45 | { |
|
46 | 46 | QGraphicsEllipseItem* ellipse = new QGraphicsEllipseItem(); |
|
47 | 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 | 51 | ellipse->setPen(pen); |
|
50 | QBrush brush = ellipse->brush(); | |
|
51 | brush.setStyle(Qt::SolidPattern); | |
|
52 | brush.setColor(context->layerColor(this->viaNode->layers().at(i))); | |
|
53 | ellipse->setBrush(brush); | |
|
54 | QRectF rec(this->viaNode->pos()+offset,this->viaNode->size()); | |
|
52 | // QBrush brush = ellipse->brush(); | |
|
53 | // brush.setStyle(Qt::SolidPattern); | |
|
54 | // brush.setColor(context->layerColor(this->viaNode->layers().at(i))); | |
|
55 | // ellipse->setBrush(brush); | |
|
56 | QRectF rec(this->viaNode->pos()+offset,QSizeF(this->viaNode->size().width()-thickness,this->viaNode->size().width()-thickness)); | |
|
55 | 57 | ellipse->setRect(rec); |
|
56 | 58 | ellipse->setZValue(-context->layer(viaNode->layers().at(i))); |
|
57 | 59 | this->addToGroup(ellipse); |
General Comments 0
You need to be logged in to leave comments.
Login now