-
Notifications
You must be signed in to change notification settings - Fork 849
/
Copy pathkicadmodule2svg.h
66 lines (50 loc) · 2.55 KB
/
kicadmodule2svg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*******************************************************************
Part of the Fritzing project - http://fritzing.org
Copyright (c) 2007-2019 Fritzing
Fritzing is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Fritzing is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
********************************************************************/
#ifndef KICADMODULE2SVG_H
#define KICADMODULE2SVG_H
#include <QString>
#include <QStringList>
#include <QTextStream>
#include "kicad2svg.h"
class KicadModule2Svg : public Kicad2Svg
{
public:
KicadModule2Svg();
QString convert(const QString & filename, const QString & moduleName, bool allowPadsAndPins);
public:
static QStringList listModules(const QString & filename);
public:
enum PadLayer {
ToCopper0,
ToCopper1,
UnableToTranslate
};
protected:
KicadModule2Svg::PadLayer convertPad(QTextStream & stream, QString & pad, QList<int> & numbers);
int drawDSegment(const QString & ds, QString & line);
int drawDArc(const QString & ds, QString & arc);
int drawDCircle(const QString & ds, QString & arc);
QString drawOblong(int posX, int posY, double xSize, double ySize, int drillX, int drillY, const QString & padType, KicadModule2Svg::PadLayer);
QString drawVerticalOblong(int posX, int posY, double xSize, double ySize, int drillX, int drillY, const QString & padType, KicadModule2Svg::PadLayer);
QString drawHorizontalOblong(int posX, int posY, double xSize, double ySize, int drillX, int drillY, const QString & padType, KicadModule2Svg::PadLayer);
void checkLimits(int posX, int xSize, int posY, int ySize);
QString drawRPad(int posX, int posY, int xSize, int ySize, int drillX, int drillY, const QString & padName, int padNumber, const QString & padType, KicadModule2Svg::PadLayer);
QString drawCPad(int posX, int posY, int xSize, int ySize, int drillX, int drillY, const QString & padName, int padNumber, const QString & padType, KicadModule2Svg::PadLayer);
QString getColor(KicadModule2Svg::PadLayer padLayer);
QString getID(int padNumber, KicadModule2Svg::PadLayer padLayer);
protected:
int m_nonConnectorNumber;
};
#endif // KICADMODULE2SVG_H