##// 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 QIlib::QIcadPcbModule::QIcadPcbModule(QIlib::AbstractNode *node)
457 QIlib::QIcadPcbModule::QIcadPcbModule(QIlib::AbstractNode *node)
458 :QIcadAbstractNodeWrapper(node)
458 :QIcadAbstractNodeWrapper(node),p_angle(0.0)
459 {
459 {
460 this->setNode(node);
460 this->setNode(node);
461 }
461 }
@@ -467,7 +467,7 const QPointF &QIlib::QIcadPcbModule::po
467
467
468 double QIlib::QIcadPcbModule::angle()
468 double QIlib::QIcadPcbModule::angle()
469 {
469 {
470 return p_angle;
470 return - p_angle;
471 }
471 }
472
472
473 void QIlib::QIcadPcbModule::setNode(QIlib::AbstractNode *node)
473 void QIlib::QIcadPcbModule::setNode(QIlib::AbstractNode *node)
@@ -498,6 +498,7 void QIlib::QIcadPcbModule::setNode(QIli
498 if(coords.count()==3)
498 if(coords.count()==3)
499 {
499 {
500 p_angle = coords.at(2).toDouble();
500 p_angle = coords.at(2).toDouble();
501 this->updatePadsAngle();
501 }
502 }
502 }
503 }
503 if(node->nodes.at(i)->name==QIlib::Lexique::tags_c)
504 if(node->nodes.at(i)->name==QIlib::Lexique::tags_c)
@@ -547,7 +548,7 void QIlib::QIcadPcbModule::apendPad(QIl
547 {
548 {
548 if(node->name==QIlib::Lexique::pad_c)
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 QIlib::QIcadPcbDimension::QIcadPcbDimension(QIlib::AbstractNode *node)
621 QIlib::QIcadPcbDimension::QIcadPcbDimension(QIlib::AbstractNode *node)
613 :QIcadAbstractNodeWrapper(node)
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)
876 QIlib::QIcadPcbPad::QIcadPcbPad(QIlib::AbstractNode *node, double modAngle)
868 :QIcadAbstractNodeWrapper(node)
877 :QIcadAbstractNodeWrapper(node),p_Mod_angle(modAngle),p_angle(0.0)
869 {
878 {
870 this->setNode(node);
879 this->setNode(node);
871 }
880 }
872
881
882
883
873 void QIlib::QIcadPcbPad::setNode(QIlib::AbstractNode *node)
884 void QIlib::QIcadPcbPad::setNode(QIlib::AbstractNode *node)
874 {
885 {
875 if(node->name==QIlib::Lexique::pad_c)
886 if(node->name==QIlib::Lexique::pad_c)
@@ -31,7 +31,6
31 #include <QRectF>
31 #include <QRectF>
32
32
33 namespace QIlib{
33 namespace QIlib{
34
35 const QPointF nodeTo2DCoords(QIlib::AbstractNode* node);
34 const QPointF nodeTo2DCoords(QIlib::AbstractNode* node);
36 const QSizeF nodeTo2DSize(QIlib::AbstractNode* node);
35 const QSizeF nodeTo2DSize(QIlib::AbstractNode* node);
37 double nodeValueToDouble(QIlib::AbstractNode* node,int index=0);
36 double nodeValueToDouble(QIlib::AbstractNode* node,int index=0);
@@ -227,7 +226,7 public:
227 rectangle,
226 rectangle,
228 circle
227 circle
229 }padShape;
228 }padShape;
230 QIcadPcbPad(QIlib::AbstractNode* node);
229 QIcadPcbPad(QIlib::AbstractNode* node,double modAngle=0.0);
231 QIcadPcbPad(){}
230 QIcadPcbPad(){}
232 QIcadAbstractNodeWrapper at;
231 QIcadAbstractNodeWrapper at;
233 QIcadAbstractNodeWrapper sizeNode;
232 QIcadAbstractNodeWrapper sizeNode;
@@ -238,7 +237,8 public:
238 const QSizeF& size(){return p_size;}
237 const QSizeF& size(){return p_size;}
239 const QPointF& pos(){return p_pos;}
238 const QPointF& pos(){return p_pos;}
240 double drill(){return p_drill;}
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 padShape shape(){return p_shape;}
242 padShape shape(){return p_shape;}
243 int padNumber(){return p_padNumber;}
243 int padNumber(){return p_padNumber;}
244 void setNode(QIlib::AbstractNode* node);
244 void setNode(QIlib::AbstractNode* node);
@@ -247,6 +247,9 private:
247 padShape p_shape;
247 padShape p_shape;
248 double p_drill;
248 double p_drill;
249 double p_angle;
249 double p_angle;
250 // Dirty fix to transform pad angle from
251 // PCB coordinates to Module coordinates
252 double p_Mod_angle;
250 QSizeF p_size;
253 QSizeF p_size;
251 QPointF p_pos;
254 QPointF p_pos;
252 QStringList p_layers;
255 QStringList p_layers;
@@ -306,6 +309,7 public:
306 void clrCircles();
309 void clrCircles();
307 void apendCircle(QIlib::AbstractNode* node);
310 void apendCircle(QIlib::AbstractNode* node);
308 private:
311 private:
312 void updatePadsAngle();
309 QPointF p_pos;
313 QPointF p_pos;
310 double p_angle;
314 double p_angle;
311 };
315 };
General Comments 0
You need to be logged in to leave comments. Login now