Skip to content

Commit 4ccf3d2

Browse files
author
Дамир Бакиев
committed
0.8.1.0
1 parent 0599a6b commit 4ccf3d2

36 files changed

+2967
-2867
lines changed

GGEasy/ChangeLog.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121
+ Предложение перезагрузки файла в проект, если он изменился.
2222
+ Выбор тем оформления настройках)
2323

24-
2524
.............
2625

2726
0.8.0.4
28-
* Добавлена сортировка путей по расстоянию для Профиль Поверху.
27+
* Добавлена сортировка путей по расстоянию для Профиль Поверху.
28+
29+
0.8.1.0
30+
* Исправлено падение при открытии некоторых файлов сверловок и герберов.
31+
* Перемещено место хранения файлов настроек и базы инструментов в системную директорию пользователя.
32+
+ В окно настроек добавлена кнопка для открытия расположения папки настроек.
33+
* Изменён алгоритм загрузки герберов, уменьшено занимаемое место и возможное появление «зазубрин» в УП карман.
34+
* Изменён алгоритм загрузки герберов, уменьшено занимаемое место и возможное появление «зазубрин» в УП карман.
35+
* Изменил раскладку виджетов в окне параметров УП (уменьшение занимаемой ширины).

GGEasy/aboutform.ui

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>701</width>
10-
<height>198</height>
10+
<height>229</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -39,7 +39,7 @@
3939
<item>
4040
<widget class="QLabel" name="lblAbout">
4141
<property name="text">
42-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Build: %1&lt;br/&gt;Visit: &lt;a href=&quot;https://github.com/XRay3D/GERBER_X3/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/XRay3D/GERBER_X3/&lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;https://github.com/Denvi/Candle/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/a&gt;© 2017-2020 Damir Bakiev&lt;br/&gt;License: GNU GENERAL PUBLIC LICENSE&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
42+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Build: %1&lt;br/&gt;Visit: &lt;a href=&quot;https://github.com/XRay3D/GERBER_X3/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/XRay3D/GERBER_X3/&lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;https://github.com/Denvi/Candle/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/a&gt;© 2017-2022 Damir Bakiev&lt;br/&gt;License: GNU GENERAL PUBLIC LICENSE&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
4343
</property>
4444
<property name="alignment">
4545
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

GGEasy/gcode/gccreator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ bool Creator::createability(bool side)
580580
// Paths wpe;
581581
const double d = m_gcp.tools.back().getDiameter(m_gcp.getDepth()) * uScale;
582582
const double r = d * 0.5;
583-
const double testArea = d * d - M_PI * r * r;
583+
const double testArea = d * d - pi * r * r;
584584

585585
Paths srcPaths;
586586
for (size_t pIdx = 0; pIdx < m_groupedPss.size(); ++pIdx) {

GGEasy/gcode/gcpocketoffset.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void PocketCreator::createMultiTool(mvector<Tool>& tools, double depth)
202202

203203
auto removeSmall = [](Paths& paths, double dOffset) {
204204
//return;
205-
const auto ta = dOffset * dOffset * M_PI;
205+
const auto ta = dOffset * dOffset * pi;
206206
const auto tp = dOffset * 4;
207207
for (size_t i = 0; i < paths.size(); ++i) {
208208
const auto a = abs(Area(paths[i]));

GGEasy/translations/GGEasy_en.qm

-44 Bytes
Binary file not shown.

GGEasy/translations/GGEasy_en.ts

+578-558
Large diffs are not rendered by default.

GGEasy/translations/GGEasy_es.ts

+578-558
Large diffs are not rendered by default.

GGEasy/translations/GGEasy_fr.ts

+578-558
Large diffs are not rendered by default.

GGEasy/translations/GGEasy_pt.ts

+578-558
Large diffs are not rendered by default.

GGEasy/translations/GGEasy_ru.qm

661 Bytes
Binary file not shown.

GGEasy/translations/GGEasy_ru.ts

+582-550
Large diffs are not rendered by default.

GGEasy/translations/qtbase_ru.qm

-182 KB
Binary file not shown.

GGEasy/version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
*******************************************************************************/
1111
#pragma once
1212

13-
#define VER_FILEVERSION 0, 8, 0, 4
14-
#define VER_FILEVERSION_STR "0.8.0.4\0"
13+
#define VER_FILEVERSION 0, 8, 1, 0
14+
#define VER_FILEVERSION_STR "0.8.1.0\0"
1515

1616
#define VER_PRODUCTVERSION VER_FILEVERSION
1717
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR

GTE_Win/clipper/clipper.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ typedef QVector<PolyNode*> PolyNodes;
191191
class PolyNode {
192192
public:
193193
PolyNode();
194-
/*virtual*/ ~PolyNode() {}
194+
/*virtual*/ ~PolyNode() { }
195195
Path Contour;
196196
PolyNodes Childs;
197197
PolyNode* Parent;

GTE_Win/clipper/myclipper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ Path CirclePath(double diametr, const IntPoint& center)
9494
Path poligon(intSteps);
9595
for (int i = 0; i < intSteps; ++i) {
9696
poligon[i] = IntPoint(
97-
static_cast<cInt>(cos(i * 2 * M_PI / intSteps) * radius) + center.X,
98-
static_cast<cInt>(sin(i * 2 * M_PI / intSteps) * radius) + center.Y);
97+
static_cast<cInt>(cos(i * 2 * pi / intSteps) * radius) + center.X,
98+
static_cast<cInt>(sin(i * 2 * pi / intSteps) * radius) + center.Y);
9999
}
100100
return poligon;
101101
}

GTE_Win/clipper/myclipper.h

-8
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616
#include <QDebug>
1717
#include <QPolygonF>
1818

19-
#ifndef two_pi
20-
#define two_pi (6.28318530717958647692528676655900576)
21-
#endif
22-
23-
#ifndef M_PI
24-
#define M_PI (3.1415926535897932384626433832795)
25-
#endif
26-
2719
//QDebug operator<<(QDebug debug, const IntPoint& p)
2820
//{
2921
// //QDebugStateSaver saver(debug);

GTE_Win/gerber/gbraperture.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ QString ApPolygon::name() const { return QString("P(Ø%1, N%2)").arg(m_diam).arg
244244

245245
ApertureType ApPolygon::type() const { return Polygon; }
246246

247-
bool ApPolygon::fit(double toolDiam) const { return m_diam * cos(M_PI / m_verticesCount) > toolDiam; }
247+
bool ApPolygon::fit(double toolDiam) const { return m_diam * cos(pi / m_verticesCount) > toolDiam; }
248248

249249
void ApPolygon::draw()
250250
{

GTE_Win/gerber/gbrparser.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222

2323
namespace Gerber {
2424

25-
#ifndef M_PI
26-
#define M_PI 3.1415926535897932384626433832795
27-
#endif
28-
2925
Parser::Parser(QObject* parent)
3026
: QObject(parent)
3127
{
@@ -282,9 +278,9 @@ QList<QString> Parser::format(QString data)
282278
double Parser::arcAngle(double start, double stop)
283279
{
284280
if (m_state.interpolation() == CounterclockwiseCircular && stop <= start)
285-
stop += 2.0 * M_PI;
281+
stop += 2.0 * pi;
286282
if (m_state.interpolation() == ClockwiseCircular && stop >= start)
287-
stop -= 2.0 * M_PI;
283+
stop -= 2.0 * pi;
288284
return qAbs(stop - start);
289285
}
290286

@@ -458,12 +454,12 @@ Path Parser::arc(const IntPoint& center, double radius, double start, double sto
458454
const int intSteps = 18; //MinStepsPerCircle;
459455

460456
if (m_state.interpolation() == ClockwiseCircular && stop >= start)
461-
stop -= 2.0 * M_PI;
457+
stop -= 2.0 * pi;
462458
else if (m_state.interpolation() == CounterclockwiseCircular && stop <= start)
463-
stop += 2.0 * M_PI;
459+
stop += 2.0 * pi;
464460

465461
double angle = qAbs(stop - start);
466-
double steps = qMax(static_cast<int>(ceil(angle / (2.0 * M_PI) * intSteps)), 2);
462+
double steps = qMax(static_cast<int>(ceil(angle / (2.0 * pi) * intSteps)), 2);
467463
double delta_angle = da_sign[m_state.interpolation()] * angle * 1.0 / steps;
468464
for (int i = 0; i < steps; i++) {
469465
double theta = start + delta_angle * (i + 1);
@@ -857,7 +853,7 @@ bool Parser::parseCircularInterpolation(const QString& gLine)
857853
const double start = atan2(-j, -i);
858854
const double stop = atan2(-centerPos[c].Y + y, -centerPos[c].X + x);
859855
const double angle = arcAngle(start, stop);
860-
if (angle < (M_PI + 1e-5) * 0.5) {
856+
if (angle < (pi + 1e-5) * 0.5) {
861857
arcPolygon = arc(IntPoint(centerPos[c].X, centerPos[c].Y), radius1, start, stop);
862858
// Replace with exact values
863859
m_state.setCurPos({ x, y });

clang-format.bat

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
For /R %%S IN (*.cpp *.h) do (
2-
rem Echo %%S
3-
rem -style="{key: value, ...}
4-
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin\clang-format.exe" -i --style=WebKit %%S
1+
rem set PATH="%PATH%C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin"
2+
for /R %%S in (*.cpp *.c *.hpp *.h) do (
3+
rem echo %PATH%
4+
rem echo %%S
5+
rem -style="{key: value, ...}
6+
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin\clang-format.exe" -i --style=WebKit %%S
57
)
68
pause

file_plugins/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ link_directories(
6262
../libs${SUFFIX}
6363
)
6464

65-
#add_subdirectory(dxf)
66-
#add_subdirectory(excellon)
65+
add_subdirectory(dxf)
66+
add_subdirectory(excellon)
6767
add_subdirectory(gerber)
6868
#add_subdirectory(hpgl)
6969

file_plugins/dxf/entities/dxf_entity.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ std::tuple<QPointF, double, double, double> bulgeToArc(QPointF start_point, QPoi
343343
Tuple: (center, start_angle, end_angle, radius)
344344
*/
345345
double r = signedBulgeRadius(start_point, end_point, bulge);
346-
double a = angle(start_point, end_point) + (M_PI / 2.0 - atan(bulge) * 2.0);
346+
double a = angle(start_point, end_point) + (pi / 2.0 - atan(bulge) * 2.0);
347347
QPointF c = polar(start_point, a, r);
348348
if (bulge < 0.0)
349349
return { c, angle(c, end_point), angle(c, start_point), abs(r) };

file_plugins/dxf/entities/dxf_graphicobject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void GraphicObject::setScale(double scaleX, double scaleY)
7575
auto scale = [](Path& path, double sx, double sy, const IntPoint& center = {}) {
7676
const bool fl = Area(path) < 0;
7777
for (IntPoint& pt : path) {
78-
const double dAangle = (M_PI * 2) - center.angleRadTo(pt);
78+
const double dAangle = (pi * 2) - center.angleRadTo(pt);
7979
const double length = center.distTo(pt);
8080
pt = IntPoint(static_cast<cInt>(cos(dAangle) * length * sx), static_cast<cInt>(sin(dAangle) * length * sy));
8181
pt.X += center.X;

file_plugins/dxf/entities/dxf_spline.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ inline double qwtFastAtan2(double y, double x)
358358

359359
if (x < 0) {
360360
const double d = qwtFastAtan(y / x);
361-
return (y >= 0) ? d + M_PI : d - M_PI;
361+
return (y >= 0) ? d + pi : d - pi;
362362
}
363363

364364
if (y < 0.0)
@@ -373,13 +373,13 @@ inline double qwtFastAtan2(double y, double x)
373373
//! Translate degrees into radians
374374
inline double qwtRadians(double degrees)
375375
{
376-
return degrees * M_PI / 180.0;
376+
return degrees * pi / 180.0;
377377
}
378378

379379
//! Translate radians into degrees
380380
inline double qwtDegrees(double degrees)
381381
{
382-
return degrees * 180.0 / M_PI;
382+
return degrees * 180.0 / pi;
383383
}
384384

385385
inline double qwtGetMin(const double* array, int size)
@@ -418,9 +418,9 @@ inline double qwtGetMax(const double* array, int size)
418418
*/
419419
inline double qwtNormalizeRadians(double radians)
420420
{
421-
double a = ::fmod(radians, 2.0 * M_PI);
421+
double a = ::fmod(radians, 2.0 * pi);
422422
if (a < 0.0)
423-
a += 2.0 * M_PI;
423+
a += 2.0 * pi;
424424

425425
return a;
426426
}

file_plugins/excellon/excellon.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name" : "GCode",
3-
"Version" : "1.0",
3+
"Version" : "1.1",
44
"VendorAuthor" : "X-Ray aka Bakiev Damir",
55
"Info" : "Info"
66
}

file_plugins/excellon/exparser.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,17 @@ bool Parser::parsePos(const QString& line)
270270
if (!X.size() && !Y.size())
271271
return false;
272272

273-
if (X.size())
273+
if (X.size()) {
274274
m_state.rawPos.X = QString { CtreCapTo(X) };
275-
if (Y.size())
275+
parseNumber(CtreCapTo(X), m_state.pos.rx());
276+
}
277+
if (Y.size()) {
276278
m_state.rawPos.Y = QString { CtreCapTo(Y) };
279+
parseNumber(CtreCapTo(Y), m_state.pos.ry());
280+
}
277281
if (A.size())
278282
m_state.rawPos.A = QString { CtreCapTo(A) };
279283

280-
parseNumber(CtreCapTo(X), m_state.pos.rx());
281-
parseNumber(CtreCapTo(Y), m_state.pos.ry());
282-
283284
switch (m_state.wm) {
284285
case DrillMode:
285286
file->append(Hole(m_state, file));
@@ -492,12 +493,12 @@ QPolygonF Parser::arc(QPointF p1, QPointF p2, QPointF center)
492493
const int intSteps = App::settings().clpCircleSegments(radius * dScale); //MinStepsPerCircle;
493494

494495
if (m_state.gCode == G02 && stop >= start)
495-
stop -= 2.0 * M_PI;
496+
stop -= 2.0 * pi;
496497
else if (m_state.gCode == G03 && stop <= start)
497-
stop += 2.0 * M_PI;
498+
stop += 2.0 * pi;
498499

499500
double angle = qAbs(stop - start);
500-
double steps = qMax(static_cast<int>(ceil(angle / (2.0 * M_PI) * intSteps)), 2);
501+
double steps = qMax(static_cast<int>(ceil(angle / (2.0 * pi) * intSteps)), 2);
501502
double delta_angle = da_sign[m_state.gCode] * angle * 1.0 / steps;
502503
for (int i = 0; i < steps; i++) {
503504
double theta = start + delta_angle * (i + 1);

file_plugins/excellon/explugin.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131

3232
namespace Excellon {
3333

34-
#ifndef M_PI
35-
#define M_PI 3.1415926535897932384626433832795
36-
#endif
37-
38-
//const int id1 = qRegisterMetaType<Gerber::File*>("Gerber::GFile*");
39-
4034
Plugin::Plugin(QObject* parent)
4135
: QObject(parent)
4236
, Parser(this)

file_plugins/gerber/gbraperture.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ QString ApPolygon::name() const { return QString("P(Ø%1, N%2)").arg(m_diam).arg
341341

342342
ApertureType ApPolygon::type() const { return Polygon; }
343343

344-
bool ApPolygon::fit(double toolDiam) const { return m_diam * cos(M_PI / m_verticesCount) > toolDiam; }
344+
bool ApPolygon::fit(double toolDiam) const { return m_diam * cos(pi / m_verticesCount) > toolDiam; }
345345

346346
void ApPolygon::read(QDataStream& stream)
347347
{

file_plugins/gerber/gbrparser.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ mvector<QString> Parser::cleanAndFormatFile(QString data)
345345
double Parser::arcAngle(double start, double stop)
346346
{
347347
if (m_state.interpolation() == CounterclockwiseCircular && stop <= start)
348-
stop += 2.0 * M_PI;
348+
stop += 2.0 * pi;
349349
if (m_state.interpolation() == ClockwiseCircular && stop >= start)
350-
stop -= 2.0 * M_PI;
350+
stop -= 2.0 * pi;
351351
return qAbs(stop - start);
352352
}
353353

@@ -547,12 +547,12 @@ Path Parser::arc(const IntPoint& center, double radius, double start, double sto
547547
const int intSteps = App::settings().clpCircleSegments(radius * dScale); //MinStepsPerCircle;
548548

549549
if (m_state.interpolation() == ClockwiseCircular && stop >= start)
550-
stop -= 2.0 * M_PI;
550+
stop -= 2.0 * pi;
551551
else if (m_state.interpolation() == CounterclockwiseCircular && stop <= start)
552-
stop += 2.0 * M_PI;
552+
stop += 2.0 * pi;
553553

554554
double angle = qAbs(stop - start);
555-
double steps = qMax(static_cast<int>(ceil(angle / (2.0 * M_PI) * intSteps)), 2);
555+
double steps = qMax(static_cast<int>(ceil(angle / (2.0 * pi) * intSteps)), 2);
556556
double delta_angle = da_sign[m_state.interpolation()] * angle * 1.0 / steps;
557557
for (int i = 0; i < steps; i++) {
558558
double theta = start + delta_angle * (i + 1);
@@ -1025,7 +1025,7 @@ bool Parser::parseCircularInterpolation(const QString& gLine)
10251025
const double start = atan2(-j, -i);
10261026
const double stop = atan2(-centerPos[c].Y + y, -centerPos[c].X + x);
10271027
const double angle = arcAngle(start, stop);
1028-
if (angle < (M_PI + 1e-5) * 0.5) {
1028+
if (angle < (pi + 1e-5) * 0.5) {
10291029
arcPolygon = arc(IntPoint(centerPos[c].X, centerPos[c].Y), radius1, start, stop);
10301030
// Replace with exact values
10311031
m_state.setCurPos({ x, y });

file_plugins/gerber/gbrplugin.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535

3636
namespace Gerber {
3737

38-
#ifndef M_PI
39-
#define M_PI 3.1415926535897932384626433832795
40-
#endif
41-
4238
const int id1 = qRegisterMetaType<File*>("G::GFile*");
4339

4440
Plugin::Plugin(QObject* parent)
@@ -151,7 +147,7 @@ QJsonObject Plugin::info() const
151147
{
152148
return QJsonObject {
153149
{ "Name", "Gerber X3" },
154-
{ "Version", "1.0" },
150+
{ "Version", "1.1" },
155151
{ "VendorAuthor", "X-Ray aka Bakiev Damir" },
156152
{ "Info", "Opening GerberX3 files, with support for all kinds of aperture macros and components." },
157153
};
@@ -374,7 +370,7 @@ class ThermalPreviewItem final : public AbstractThermPrGi {
374370
const auto fp(sourcePath.toFillPolygons());
375371
for (int i = 0; i < m_node->count(); ++i) { // Gaps
376372
ClipperOffset offset;
377-
double angle = i * 2 * M_PI / m_node->count() + qDegreesToRadians(m_node->angle());
373+
double angle = i * 2 * pi / m_node->count() + qDegreesToRadians(m_node->angle());
378374
offset.AddPath({ center,
379375
IntPoint(
380376
static_cast<cInt>((cos(angle) * radius) + center.X),

file_plugins/gerber/gerber.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name" : "GCode",
3-
"Version" : "1.0",
3+
"Version" : "1.1",
44
"VendorAuthor" : "X-Ray aka Bakiev Damir",
55
"Info" : "Info"
66
}

shape_plugins/CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
2525
set(SUFFIX "_msvc")
2626
endif()
2727

28-
#if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
29-
#if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
3028
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
3129
set(SUFFIX "${SUFFIX}_x64")
32-
set(PLUGINS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../bin_x64/plugins")
30+
set(PLUGINS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../bin_x64")
3331
else()
3432
set(SUFFIX "${SUFFIX}_x32")
35-
set(PLUGINS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../bin_x32/plugins")
33+
set(PLUGINS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../bin_x32")
3634
endif()
3735

3836
if(CMAKE_BUILD_TYPE MATCHES Debug)

0 commit comments

Comments
 (0)