mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-30 16:38:41 +03:00
update deps
This commit is contained in:
@@ -2,30 +2,35 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.qiditech.qidi-studio</string>
|
<string>com.qiditech.qidi-studio</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleLongVersionString</key>
|
<key>CFBundleLongVersionString</key>
|
||||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
|
|||||||
2
deps/Boost/Boost.cmake
vendored
2
deps/Boost/Boost.cmake
vendored
@@ -129,7 +129,7 @@ list(APPEND _patch_command COMMAND git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST
|
|||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
dep_Boost
|
dep_Boost
|
||||||
#URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
|
#URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
|
||||||
URL "https://github.com/qiditech/boost/releases/download/1.78.0/boost_1_78_0.zip"
|
URL "https://github.com/bambulab/boost/releases/download/1.78.0/boost_1_78_0.zip"
|
||||||
URL_HASH SHA256=f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3
|
URL_HASH SHA256=f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3
|
||||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
|
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
|
||||||
CONFIGURE_COMMAND "${_bootstrap_cmd}"
|
CONFIGURE_COMMAND "${_bootstrap_cmd}"
|
||||||
|
|||||||
2
deps/FFMPEG/FFMPEG.cmake
vendored
2
deps/FFMPEG/FFMPEG.cmake
vendored
@@ -4,7 +4,7 @@ if (MSVC)
|
|||||||
set(_dstdir ${DESTDIR}/usr/local)
|
set(_dstdir ${DESTDIR}/usr/local)
|
||||||
set(_source_dir "${CMAKE_BINARY_DIR}/dep_FFMPEG-prefix/src/dep_FFMPEG")
|
set(_source_dir "${CMAKE_BINARY_DIR}/dep_FFMPEG-prefix/src/dep_FFMPEG")
|
||||||
ExternalProject_Add(dep_FFMPEG
|
ExternalProject_Add(dep_FFMPEG
|
||||||
URL https://github.com/qiditech/ffmpeg_prebuilts/releases/download/7.0.2/7.0.2_msvc.zip
|
URL https://github.com/bambulab/ffmpeg_prebuilts/releases/download/7.0.2/7.0.2_msvc.zip
|
||||||
URL_HASH SHA256=DF44AE6B97CE84C720695AE7F151B4A9654915D1841C68F10D62A1189E0E7181
|
URL_HASH SHA256=DF44AE6B97CE84C720695AE7F151B4A9654915D1841C68F10D62A1189E0E7181
|
||||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG
|
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
|
|||||||
2
deps/GMP/GMP.cmake
vendored
2
deps/GMP/GMP.cmake
vendored
@@ -43,7 +43,7 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
ExternalProject_Add(dep_GMP
|
ExternalProject_Add(dep_GMP
|
||||||
URL https://github.com/qiditech/gmp/archive/refs/tags/6.2.1.tar.gz
|
URL https://github.com/bambulab/gmp/archive/refs/tags/6.2.1.tar.gz
|
||||||
URL_HASH SHA256=705ae57ee2014b2c6fc0f572c85ee43276b99b6b256ee16c1a9d3a8c4e3609d5
|
URL_HASH SHA256=705ae57ee2014b2c6fc0f572c85ee43276b99b6b256ee16c1a9d3a8c4e3609d5
|
||||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
|
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
|
||||||
BUILD_IN_SOURCE ON
|
BUILD_IN_SOURCE ON
|
||||||
|
|||||||
24
deps/OCCT/0001-OCCT-fix.patch
vendored
24
deps/OCCT/0001-OCCT-fix.patch
vendored
@@ -195,3 +195,27 @@ index 5ae9899f..0a17372b 100644
|
|||||||
|
|
||||||
if (!myFTLib->IsValid())
|
if (!myFTLib->IsValid())
|
||||||
{
|
{
|
||||||
|
From 7236e83dcc1e7284e66dc61e612154617ef715d6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: dpasukhi <dpasukhi@opencascade.com>
|
||||||
|
Date: Tue, 27 Aug 2024 11:33:29 +0100
|
||||||
|
Subject: [PATCH] 0033808: Coding - FreeType Use unsigned point and contour
|
||||||
|
indexing in `FT_Outline`
|
||||||
|
|
||||||
|
Changes to auto instead of specific type
|
||||||
|
---
|
||||||
|
src/StdPrs/StdPrs_BRepFont.cxx | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/StdPrs/StdPrs_BRepFont.cxx b/src/StdPrs/StdPrs_BRepFont.cxx
|
||||||
|
index ab2d9b3c9f..cd701879b1 100644
|
||||||
|
--- a/src/StdPrs/StdPrs_BRepFont.cxx
|
||||||
|
+++ b/src/StdPrs/StdPrs_BRepFont.cxx
|
||||||
|
@@ -457,7 +457,7 @@ Standard_Boolean StdPrs_BRepFont::renderGlyph (const Standard_Utf32Char theChar,
|
||||||
|
for (short aContour = 0, aStartIndex = 0; aContour < anOutline->n_contours; ++aContour)
|
||||||
|
{
|
||||||
|
const FT_Vector* aPntList = &anOutline->points[aStartIndex];
|
||||||
|
- const char* aTags = &anOutline->tags[aStartIndex];
|
||||||
|
+ const auto* aTags = &anOutline->tags[aStartIndex];
|
||||||
|
const short anEndIndex = anOutline->contours[aContour];
|
||||||
|
const short aPntsNb = (anEndIndex - aStartIndex) + 1;
|
||||||
|
aStartIndex = anEndIndex + 1;
|
||||||
2
deps/OCCT/OCCT.cmake
vendored
2
deps/OCCT/OCCT.cmake
vendored
@@ -8,7 +8,7 @@ qidistudio_add_cmake_project(OCCT
|
|||||||
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
|
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
|
||||||
URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
|
URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
|
||||||
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
||||||
PATCH_COMMAND ${GIT_EXECUTABLE} apply --directory deps/build/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
PATCH_COMMAND ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
||||||
#DEPENDS dep_Boost
|
#DEPENDS dep_Boost
|
||||||
#DEPENDS dep_FREETYPE
|
#DEPENDS dep_FREETYPE
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
|
|||||||
2
deps/OpenCV/OpenCV.cmake
vendored
2
deps/OpenCV/OpenCV.cmake
vendored
@@ -7,7 +7,7 @@ endif ()
|
|||||||
qidistudio_add_cmake_project(OpenCV
|
qidistudio_add_cmake_project(OpenCV
|
||||||
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
|
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
|
||||||
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
|
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
|
||||||
PATCH_COMMAND ${GIT_EXECUTABLE} apply --directory deps/build/dep_OpenCV-prefix/src/dep_OpenCV --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OpenCV-fix.patch
|
PATCH_COMMAND ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OpenCV-fix.patch
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DBUILD_SHARED_LIBS=0
|
-DBUILD_SHARED_LIBS=0
|
||||||
-DBUILD_PERE_TESTS=OFF
|
-DBUILD_PERE_TESTS=OFF
|
||||||
|
|||||||
2
deps/wxWidgets/wxWidgets.cmake
vendored
2
deps/wxWidgets/wxWidgets.cmake
vendored
@@ -23,7 +23,7 @@ endif ()
|
|||||||
# endif ()
|
# endif ()
|
||||||
|
|
||||||
qidistudio_add_cmake_project(wxWidgets
|
qidistudio_add_cmake_project(wxWidgets
|
||||||
GIT_REPOSITORY "https://github.com/qiditech/wxWidgets"
|
GIT_REPOSITORY "https://github.com/bambulab/wxWidgets"
|
||||||
GIT_TAG master
|
GIT_TAG master
|
||||||
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${TIFF_PKG} ${JPEG_PKG}
|
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${TIFF_PKG} ${JPEG_PKG}
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ namespace QIDIStudio {
|
|||||||
|
|
||||||
//QDS: only check wodth when dE is longer than this value
|
//QDS: only check wodth when dE is longer than this value
|
||||||
const double CHECK_WIDTH_E_THRESHOLD = 0.0025;
|
const double CHECK_WIDTH_E_THRESHOLD = 0.0025;
|
||||||
const double WIDTH_THRESHOLD = 0.02;
|
const double WIDTH_THRESHOLD = 0.05;
|
||||||
const double RADIUS_THRESHOLD = 0.005;
|
const double RADIUS_THRESHOLD = 0.005;
|
||||||
|
const double MULTI_NOZZLE_TEMP_THRESHOLD = 100;
|
||||||
|
|
||||||
const double filament_diameter = 1.75;
|
const double filament_diameter = 1.75;
|
||||||
const double Pi = 3.14159265358979323846;
|
const double Pi = 3.14159265358979323846;
|
||||||
@@ -28,6 +29,8 @@ const std::string nozzle_temperature_initial_layer_Tag = " nozzle_temperature_i
|
|||||||
const std::string Z_HEIGHT_TAG = " Z_HEIGHT: ";
|
const std::string Z_HEIGHT_TAG = " Z_HEIGHT: ";
|
||||||
const std::string Initial_Layer_Ptint_Height_Tag = " initial_layer_print_height =";
|
const std::string Initial_Layer_Ptint_Height_Tag = " initial_layer_print_height =";
|
||||||
const std::string Line_Width_Tag = " line_width =";
|
const std::string Line_Width_Tag = " line_width =";
|
||||||
|
const std::string Filament_Map_Tag = " filament_map =";
|
||||||
|
const std::string Physical_Extruder_Map_Tag = " physical_extruder_map =";
|
||||||
|
|
||||||
GCodeCheckResult GCodeChecker::parse_file(const std::string& path)
|
GCodeCheckResult GCodeChecker::parse_file(const std::string& path)
|
||||||
{
|
{
|
||||||
@@ -38,7 +41,11 @@ GCodeCheckResult GCodeChecker::parse_file(const std::string& path)
|
|||||||
}
|
}
|
||||||
std::string line_raw;
|
std::string line_raw;
|
||||||
std::string line;
|
std::string line;
|
||||||
|
int line_number = 0;
|
||||||
|
|
||||||
|
|
||||||
while (std::getline(file, line_raw)) {
|
while (std::getline(file, line_raw)) {
|
||||||
|
line_number++;
|
||||||
const char *c = line_raw.c_str();
|
const char *c = line_raw.c_str();
|
||||||
c = skip_whitespaces(c);
|
c = skip_whitespaces(c);
|
||||||
if (std::toupper(*c) == 'N')
|
if (std::toupper(*c) == 'N')
|
||||||
@@ -46,7 +53,8 @@ GCodeCheckResult GCodeChecker::parse_file(const std::string& path)
|
|||||||
c = skip_whitespaces(c);
|
c = skip_whitespaces(c);
|
||||||
line = c;
|
line = c;
|
||||||
if (parse_line(line) != GCodeCheckResult::Success) {
|
if (parse_line(line) != GCodeCheckResult::Success) {
|
||||||
std::cout << "Failed to parse line " << line_raw << std::endl;
|
std::cerr << "Failed to parse line " << line_number
|
||||||
|
<< ": " << line_raw << std::endl;
|
||||||
return GCodeCheckResult::ParseFailed;
|
return GCodeCheckResult::ParseFailed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,17 +123,39 @@ GCodeCheckResult GCodeChecker::parse_comment(GCodeLine& line)
|
|||||||
if (starts_with(comment, Extrusion_Role_Tag)) {
|
if (starts_with(comment, Extrusion_Role_Tag)) {
|
||||||
m_role = string_to_role(comment.substr(Extrusion_Role_Tag.length()));
|
m_role = string_to_role(comment.substr(Extrusion_Role_Tag.length()));
|
||||||
check_gap_infill_width = false;
|
check_gap_infill_width = false;
|
||||||
if (m_role == erExternalPerimeter) {
|
|
||||||
if (z_height == initial_layer_height && nozzle_temp != nozzle_temperature_initial_layer[filament_id]) {
|
|
||||||
std::cout << "invalid filament nozzle initial layer temperature comment with invalid value!" << std::endl;
|
|
||||||
return GCodeCheckResult::ParseFailed;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (z_height != initial_layer_height && nozzle_temp != nozzle_temperature[filament_id]) {
|
double check_nozzle_temp = 0.0f;
|
||||||
std::cout << "invalid filament nozzle temperature comment with invalid value!" << std::endl;
|
if (is_multi_nozzle == true) {
|
||||||
return GCodeCheckResult::ParseFailed;
|
check_nozzle_temp = multi_nozzle_temp[current_nozzle_id];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
check_nozzle_temp = nozzle_temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_role == erExternalPerimeter) {
|
||||||
|
if (z_height != initial_layer_height) {
|
||||||
|
if (is_multi_nozzle) {
|
||||||
|
double expected_temp = nozzle_temperature[filament_id];
|
||||||
|
if (std::abs(check_nozzle_temp - expected_temp) > MULTI_NOZZLE_TEMP_THRESHOLD) {
|
||||||
|
std::cout << "Multi-nozzle: Invalid filament nozzle temperature! Expected: "
|
||||||
|
<< expected_temp
|
||||||
|
<< ", but got: " << check_nozzle_temp
|
||||||
|
<< " (Threshold: ±100)." << std::endl;
|
||||||
|
return GCodeCheckResult::ParseFailed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (check_nozzle_temp != nozzle_temperature[filament_id]) {
|
||||||
|
std::cout << "Invalid filament nozzle temperature! Expected: "
|
||||||
|
<< nozzle_temperature[filament_id]
|
||||||
|
<< ", but got: " << check_nozzle_temp << "." << std::endl;
|
||||||
|
return GCodeCheckResult::ParseFailed;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (m_role == erGapFill) {
|
}
|
||||||
|
else if (m_role == erGapFill) {
|
||||||
check_gap_infill_width = true;
|
check_gap_infill_width = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +219,36 @@ GCodeCheckResult GCodeChecker::parse_comment(GCodeLine& line)
|
|||||||
std::cout << "invalid nozzle temperature initial layer comment with invalid value!" << std::endl;
|
std::cout << "invalid nozzle temperature initial layer comment with invalid value!" << std::endl;
|
||||||
return GCodeCheckResult::ParseFailed;
|
return GCodeCheckResult::ParseFailed;
|
||||||
}
|
}
|
||||||
} else if (starts_with(comment, Z_HEIGHT_TAG)) {
|
}
|
||||||
|
else if (starts_with(comment, Filament_Map_Tag)) {
|
||||||
|
std::string str = comment.substr(Filament_Map_Tag.size() + 1);
|
||||||
|
if (!parse_double_from_str(str, filament_map)) {
|
||||||
|
std::cout << "invalid filament map comment with invalid value!" << std::endl;
|
||||||
|
return GCodeCheckResult::ParseFailed;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (size_t i = 0; i < filament_map.size(); ++i) {
|
||||||
|
filament_map[i] -= 1;
|
||||||
|
}
|
||||||
|
is_multi_nozzle = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (starts_with(comment, Physical_Extruder_Map_Tag)) {
|
||||||
|
std::string str = comment.substr(Physical_Extruder_Map_Tag.size() + 1);
|
||||||
|
std::vector<double>tmp;
|
||||||
|
|
||||||
|
if (!parse_double_from_str(str, tmp)){
|
||||||
|
std::cout << "invalid physical extruder map comment with invalid value!" << std::endl;
|
||||||
|
return GCodeCheckResult::ParseFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t idx = 0; idx < tmp.size(); ++idx) {
|
||||||
|
physical_to_logic_extruder_map[(int)(tmp[idx])]= idx;
|
||||||
|
logic_to_physical_extruder_map[idx] = (int)(tmp[idx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (starts_with(comment, Z_HEIGHT_TAG)) {
|
||||||
std::string str = comment.substr(Z_HEIGHT_TAG.size());
|
std::string str = comment.substr(Z_HEIGHT_TAG.size());
|
||||||
if (!parse_double_from_str(str, z_height)) {
|
if (!parse_double_from_str(str, z_height)) {
|
||||||
std::cout << "invalid z height comment with invalid value!" << std::endl;
|
std::cout << "invalid z height comment with invalid value!" << std::endl;
|
||||||
@@ -257,7 +316,7 @@ GCodeCheckResult GCodeChecker::parse_command(GCodeLine& gcode_line)
|
|||||||
case 'T':{
|
case 'T':{
|
||||||
|
|
||||||
int pt = ::atoi(&cmd[1]);
|
int pt = ::atoi(&cmd[1]);
|
||||||
if (pt == 1000 || pt == 1100 || pt == 255) {
|
if (pt == 1000 || pt == 1100 || pt == 255 || pt == 1001 || pt == 65535 || pt == 65279) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,9 +326,24 @@ GCodeCheckResult GCodeChecker::parse_command(GCodeLine& gcode_line)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
filament_id = pt;
|
filament_id = pt;
|
||||||
|
|
||||||
|
if (is_multi_nozzle == true) {
|
||||||
|
set_current_nozzle(pt);
|
||||||
|
}
|
||||||
|
|
||||||
flow_ratio = filament_flow_ratio[pt];
|
flow_ratio = filament_flow_ratio[pt];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'S': {
|
||||||
|
if (cmd.compare(0, 4, "SYNC") == 0) {
|
||||||
|
// Valid SYNC command
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Invalid SYNC command
|
||||||
|
ret = GCodeCheckResult::ParseFailed;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
//QDS: other g command? impossible! must be invalid
|
//QDS: other g command? impossible! must be invalid
|
||||||
ret = GCodeCheckResult::ParseFailed;
|
ret = GCodeCheckResult::ParseFailed;
|
||||||
@@ -484,16 +558,39 @@ GCodeCheckResult GCodeChecker::parse_M104_M109(const GCodeLine &gcode_line)
|
|||||||
const char *c = gcode_line.m_raw.c_str();
|
const char *c = gcode_line.m_raw.c_str();
|
||||||
const char *rs = strchr(c,'S');
|
const char *rs = strchr(c,'S');
|
||||||
|
|
||||||
std::string str=rs;
|
std::string strS = rs;
|
||||||
str = str.substr(1);
|
strS = strS.substr(1);
|
||||||
for (int i = 0; i < str.size(); i++) {
|
for (int i = 0; i < strS.size(); i++) {
|
||||||
if (str[i] == ' ')
|
if (strS[i] == ' ')
|
||||||
str=str.substr(0,i);
|
strS = strS.substr(0,i);
|
||||||
}
|
}
|
||||||
if (!parse_double_from_str(str, nozzle_temp)) {
|
double temp_nozzle_temp;
|
||||||
|
|
||||||
|
if (!parse_double_from_str(strS, temp_nozzle_temp)) {
|
||||||
std::cout << "invalid nozzle temperature comment with invalid value!" << std::endl;
|
std::cout << "invalid nozzle temperature comment with invalid value!" << std::endl;
|
||||||
return GCodeCheckResult::ParseFailed;
|
return GCodeCheckResult::ParseFailed;
|
||||||
}
|
}
|
||||||
|
if (is_multi_nozzle == true) {
|
||||||
|
const char* rt = strchr(c, 'T');
|
||||||
|
if (rt) {
|
||||||
|
std::string strT = rt + 1; // 跳过 'T'
|
||||||
|
for (size_t i = 0; i < strT.size(); i++) {
|
||||||
|
if (strT[i] == ' ') {
|
||||||
|
strT = strT.substr(0, i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int logic_nozzle_id = physical_to_logic_extruder_map[std::stoi(strT)];
|
||||||
|
multi_nozzle_temp[logic_nozzle_id] = temp_nozzle_temp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
multi_nozzle_temp[current_nozzle_id] = temp_nozzle_temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nozzle_temp = temp_nozzle_temp;
|
||||||
|
}
|
||||||
|
|
||||||
return GCodeCheckResult::Success;
|
return GCodeCheckResult::Success;
|
||||||
}
|
}
|
||||||
@@ -689,6 +786,16 @@ GCodeCheckResult GCodeChecker::check_G0_G1_width(const GCodeLine& line)
|
|||||||
return GCodeCheckResult::Success;
|
return GCodeCheckResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GCodeChecker::set_current_nozzle(int filament_id) {
|
||||||
|
if (filament_id >= 0 && filament_id < static_cast<int>(filament_map.size())) {
|
||||||
|
current_nozzle_id = filament_map[filament_id];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::cerr << "Error: filament_id is out of range!" << std::endl;
|
||||||
|
current_nozzle_id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GCodeCheckResult GCodeChecker::check_G2_G3_width(const GCodeLine& line)
|
GCodeCheckResult GCodeChecker::check_G2_G3_width(const GCodeLine& line)
|
||||||
{
|
{
|
||||||
auto absolute_position = [this](Axis axis, const GCodeLine& lineG2_3) {
|
auto absolute_position = [this](Axis axis, const GCodeLine& lineG2_3) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
namespace QIDIStudio {
|
namespace QIDIStudio {
|
||||||
|
|
||||||
@@ -116,6 +117,7 @@ private:
|
|||||||
GCodeCheckResult check_line_width(const GCodeLine& gcode_line);
|
GCodeCheckResult check_line_width(const GCodeLine& gcode_line);
|
||||||
GCodeCheckResult check_G0_G1_width(const GCodeLine& gcode_line);
|
GCodeCheckResult check_G0_G1_width(const GCodeLine& gcode_line);
|
||||||
GCodeCheckResult check_G2_G3_width(const GCodeLine& gcode_line);
|
GCodeCheckResult check_G2_G3_width(const GCodeLine& gcode_line);
|
||||||
|
void set_current_nozzle(int id);
|
||||||
|
|
||||||
double calculate_G1_width(const std::array<double, 3>& source,
|
double calculate_G1_width(const std::array<double, 3>& source,
|
||||||
const std::array<double, 3>& target,
|
const std::array<double, 3>& target,
|
||||||
@@ -214,12 +216,22 @@ private:
|
|||||||
bool check_gap_infill_width = false;
|
bool check_gap_infill_width = false;
|
||||||
int filament_id;
|
int filament_id;
|
||||||
double flow_ratio = 0;
|
double flow_ratio = 0;
|
||||||
|
|
||||||
double nozzle_temp = 0.0f;
|
double nozzle_temp = 0.0f;
|
||||||
|
std::array<double, 2> multi_nozzle_temp = { 0.0, 0.0 };
|
||||||
|
int current_nozzle_id = 0;
|
||||||
|
|
||||||
|
std::vector<double> filament_map;
|
||||||
|
|
||||||
|
std::map<int, int> physical_to_logic_extruder_map;
|
||||||
|
std::map<int, int> logic_to_physical_extruder_map;
|
||||||
std::vector<double> filament_flow_ratio;
|
std::vector<double> filament_flow_ratio;
|
||||||
std::vector<double> nozzle_temperature;
|
std::vector<double> nozzle_temperature;
|
||||||
std::vector<double> nozzle_temperature_initial_layer;
|
std::vector<double> nozzle_temperature_initial_layer;
|
||||||
|
|
||||||
bool has_scarf_joint_seam = false;
|
bool has_scarf_joint_seam = false;
|
||||||
bool is_wipe_tower = false;
|
bool is_wipe_tower = false;
|
||||||
|
bool is_multi_nozzle = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user