Skip to content

Commit

Permalink
merged dev900b in to dev
Browse files Browse the repository at this point in the history
  • Loading branch information
XRay3D committed Mar 26, 2024
2 parents 0365749 + 59e48cd commit 7a54b5d
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 30 deletions.
1 change: 1 addition & 0 deletions external_dependencies/ChaiScript
Submodule ChaiScript added at 693998
1 change: 1 addition & 0 deletions external_dependencies/Clipper2
Submodule Clipper2 added at d3fbd4
1 change: 1 addition & 0 deletions external_dependencies/compile-time-regular-expressions
Submodule compile-time-regular-expressions added at 903f8c
1 change: 1 addition & 0 deletions external_dependencies/pfr_non_boost
Submodule pfr_non_boost added at 266230
23 changes: 23 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,34 @@ else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${STATIC_LIBS_DIR})
endif()

set(Enable OFF)

# plugins shape
set(Enable_Circle OFF) #[["Enable_Circle"]]
set(Enable_Circlearc OFF) #[["Enable_Circlearc"]]
set(Enable_Polyline OFF) #[["Enable_Polyline"]]
set(Enable_Rectangle OFF) #[["Enable_Rectangle"]]
set(Enable_Text OFF) #[["Enable_Text"]]
add_subdirectory(shape)

# plugins file
set(Enable_Gerber ON) #[["Enable_Gerber"]]
set(Enable_Dxf OFF) #[["Enable_Dxf"]]
set(Enable_Excellon OFF) #[["Enable_Excellon"]]
add_subdirectory(file)

# plugins gcode
set(Enable_Drill OFF) #[["Enable_Drill"]]
set(Enable_Hatching OFF) #[["Enable_Hatching"]]
set(Enable_Pocketoffset OFF) #[["Enable_Pocketoffset"]]
set(Enable_Pocketraster OFF) #[["Enable_Pocketraster"]]
set(Enable_Profile OFF) #[["Enable_Profile"]]
set(Enable_Thermal OFF) #[["Enable_Thermal"]]
set(Enable_Voroni OFF) #[["Enable_Voroni"]]
add_subdirectory(gcode)






17 changes: 16 additions & 1 deletion plugins/file/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,28 @@ else()
qt5_add_translation(${QM_FILES} ${TS_FILES})
endif()


if(Enable_Gerber)
add_subdirectory(gerber)
endif()

if(Enable_Dxf)
add_subdirectory(dxf)
endif()

if(Enable_Excellon)
add_subdirectory(excellon)
endif()

# if(Enable_TopoR)
#add_subdirectory(TopoR)
# endif()

# if(Enable_File)
#add_subdirectory(file)
# endif()

# if(Enable_Hpgl)
#add_subdirectory(hpgl)
# endif()


18 changes: 16 additions & 2 deletions plugins/file/gerber/gbr_aperture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include <QDebug>
#include <QLineF>
#include <QtQml/QJSEngine>
#include <QtQml/QJSValue>

namespace Gerber {

Expand Down Expand Up @@ -394,6 +396,10 @@ void ApMacro::draw() {
try {
// for (int i = 0; i < modifiers_.size(); ++i) {
// QString var(modifiers_[i]);

QJSEngine js;
for(auto&& [name, value]: macroCoefficients)
js.globalObject().setProperty(name, value);
for(QString& var: modifiers_) {
if(var.at(0) == '0') // Skip Comment
continue;
Expand All @@ -403,12 +409,20 @@ void ApMacro::draw() {
if(var.contains('=')) {
QList<QString> stringList = var.split('=');
stringList.last().replace(QChar('x'), '*', Qt::CaseInsensitive);
macroCoefficients[stringList.first()] = MathParser(&macroCoefficients).parse(stringList.last());

auto val = js.evaluate(stringList.last());
if(val.errorType()) qWarning() << val.toString();
js.globalObject().setProperty(stringList.first(), val.toNumber());
continue;
} else {
for(auto&& var2: var.split(',')) {
var2.replace(QChar('x'), '*', Qt::CaseInsensitive);
mod.push_back(var2.contains('$') ? MathParser(&macroCoefficients).parse(var2) : var2.toDouble());
if(var2.contains('$')) {
auto val = js.evaluate(var2);
if(val.errorType()) qWarning() << val.toString();
mod.push_back(val.toNumber());
} else
mod.push_back(var2.toDouble());
}
}

Expand Down
6 changes: 6 additions & 0 deletions plugins/file/gerber/gbr_aperture.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
*******************************************************************************/
#pragma once
#include "gbr_types.h"
<<<<<<< HEAD
#define MT 3
#include "mathparser.h"
=======
// #define MT 1
// #include "mathparser.h"
>>>>>>> refs/heads/dev900b

#include <QtMath>
#include <numbers>
Expand Down Expand Up @@ -183,6 +188,7 @@ class ApPolygon final : public AbstractAperture {
/////////////////////////////////////////////////////
/// \brief The GAMacro class
///
using VarMap = std::map<QString, double>;
class ApMacro final : public AbstractAperture {
public:
ApMacro(const QString& macro, const QList<QString>& modifiers, const VarMap& coefficients, const File* file);
Expand Down
22 changes: 22 additions & 0 deletions plugins/gcode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,37 @@ else()
qt5_add_translation(${QM_FILES} ${TS_FILES})
endif()


if(Enable_Pocketoffset)
add_subdirectory(pocketoffset)
endif()

if(Enable_Profile)
add_subdirectory(profile)
endif()

if(Enable_Drill)
add_subdirectory(drill)
endif()

if(Enable_Hatching)
add_subdirectory(hatching)
endif()

if(Enable_Pocketraster)
add_subdirectory(pocketraster)
endif()

if(Enable_Voroni)
add_subdirectory(voroni)
endif()

if(Enable_Thermal)
add_subdirectory(thermal)
endif()

if(Enable_Thread)
# add_subdirectory(thread)
endif()


14 changes: 14 additions & 0 deletions plugins/shape/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,23 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets
)

if(Enable_Circle)
add_subdirectory(circle)
endif()

if(Enable_Circlearc)
add_subdirectory(circlearc)
endif()

if(Enable_Polyline)
add_subdirectory(polyline)
endif()

if(Enable_Rectangle)
add_subdirectory(rectangle)
endif()

if(Enable_Text)
add_subdirectory(text)
endif()

3 changes: 2 additions & 1 deletion static_libs/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets Qml REQUIRED)

file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
Expand All @@ -39,6 +39,7 @@ target_link_libraries(common PRIVATE
gi
graphicsview
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Qml
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
)
Expand Down
Loading

0 comments on commit 7a54b5d

Please sign in to comment.