##// END OF EJS Templates
Fixed Pad rotation issue.
jeandet -
r13:e725b52b6a87 default
parent child
Show More
@@ -455,7 +455,7 void QIlib::QIcadPcbLine::setNode(QIlib:
455 455
456 456
457 457 QIlib::QIcadPcbModule::QIcadPcbModule(QIlib::AbstractNode *node)
458 :QIcadAbstractNodeWrapper(node)
458 :QIcadAbstractNodeWrapper(node),p_angle(0.0)
459 459 {
460 460 this->setNode(node);
461 461 }
@@ -467,7 +467,7 const QPointF &QIlib::QIcadPcbModule::po
467 467
468 468 double QIlib::QIcadPcbModule::angle()
469 469 {
470 return p_angle;
470 return - p_angle;
471 471 }
472 472
473 473 void QIlib::QIcadPcbModule::setNode(QIlib::AbstractNode *node)
@@ -498,6 +498,7 void QIlib::QIcadPcbModule::setNode(QIli
498 498 if(coords.count()==3)
499 499 {
500 500 p_angle = coords.at(2).toDouble();
501 this->updatePadsAngle();
501 502 }
502 503 }
503 504 if(node->nodes.at(i)->name==QIlib::Lexique::tags_c)
@@ -547,7 +548,7 void QIlib::QIcadPcbModule::apendPad(QIl
547 548 {
548 549 if(node->name==QIlib::Lexique::pad_c)
549 550 {
550 this->pads.append(new QIcadPcbPad(node));
551 this->pads.append(new QIcadPcbPad(node, this->p_angle));
551 552 }
552 553 }
553 554
@@ -608,6 +609,14 void QIlib::QIcadPcbModule::apendCircle(
608 609 }
609 610 }
610 611
612 void QIlib::QIcadPcbModule::updatePadsAngle()
613 {
614 for(int i=0;i<this->pads.count();i++)
615 {
616 this->pads.at(i)->setModuleAngle(this->p_angle);
617 }
618 }
619
611 620
612 621 QIlib::QIcadPcbDimension::QIcadPcbDimension(QIlib::AbstractNode *node)
613 622 :QIcadAbstractNodeWrapper(node)
@@ -864,12 +873,14 void QIlib::QIcadPcbVia::setNode(QIlib::
864 873 }
865 874
866 875
867 QIlib::QIcadPcbPad::QIcadPcbPad(QIlib::AbstractNode *node)
868 :QIcadAbstractNodeWrapper(node)
876 QIlib::QIcadPcbPad::QIcadPcbPad(QIlib::AbstractNode *node, double modAngle)
877 :QIcadAbstractNodeWrapper(node),p_Mod_angle(modAngle),p_angle(0.0)
869 878 {
870 879 this->setNode(node);
871 880 }
872 881
882
883
873 884 void QIlib::QIcadPcbPad::setNode(QIlib::AbstractNode *node)
874 885 {
875 886 if(node->name==QIlib::Lexique::pad_c)
@@ -31,7 +31,6
31 31 #include <QRectF>
32 32
33 33 namespace QIlib{
34
35 34 const QPointF nodeTo2DCoords(QIlib::AbstractNode* node);
36 35 const QSizeF nodeTo2DSize(QIlib::AbstractNode* node);
37 36 double nodeValueToDouble(QIlib::AbstractNode* node,int index=0);
@@ -227,7 +226,7 public:
227 226 rectangle,
228 227 circle
229 228 }padShape;
230 QIcadPcbPad(QIlib::AbstractNode* node);
229 QIcadPcbPad(QIlib::AbstractNode* node,double modAngle=0.0);
231 230 QIcadPcbPad(){}
232 231 QIcadAbstractNodeWrapper at;
233 232 QIcadAbstractNodeWrapper sizeNode;
@@ -238,7 +237,8 public:
238 237 const QSizeF& size(){return p_size;}
239 238 const QPointF& pos(){return p_pos;}
240 239 double drill(){return p_drill;}
241 double angle(){return p_angle;}
240 void setModuleAngle(double modAngle){p_Mod_angle= modAngle;}
241 double angle(){return - (p_angle - p_Mod_angle);}
242 242 padShape shape(){return p_shape;}
243 243 int padNumber(){return p_padNumber;}
244 244 void setNode(QIlib::AbstractNode* node);
@@ -247,6 +247,9 private:
247 247 padShape p_shape;
248 248 double p_drill;
249 249 double p_angle;
250 // Dirty fix to transform pad angle from
251 // PCB coordinates to Module coordinates
252 double p_Mod_angle;
250 253 QSizeF p_size;
251 254 QPointF p_pos;
252 255 QStringList p_layers;
@@ -306,6 +309,7 public:
306 309 void clrCircles();
307 310 void apendCircle(QIlib::AbstractNode* node);
308 311 private:
312 void updatePadsAngle();
309 313 QPointF p_pos;
310 314 double p_angle;
311 315 };
General Comments 0
You need to be logged in to leave comments. Login now