diff --git a/.gitignore b/.gitignore index 835bb0fee..d6b920fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ doc/ **/process_full/ **/machine_full/ **/filament_full/ +**/.idea/ diff --git a/bbl/i18n/zh_cn/BambuStudio_zh_CN.po b/bbl/i18n/zh_cn/BambuStudio_zh_CN.po index 79cbe1fa6..741362d4e 100644 --- a/bbl/i18n/zh_cn/BambuStudio_zh_CN.po +++ b/bbl/i18n/zh_cn/BambuStudio_zh_CN.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Slic3rPE\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-04-24 10:10+0800\n" -"PO-Revision-Date: 2025-02-20 20:32+0800\n" +"PO-Revision-Date: 2025-06-03 17:26+0800\n" "Last-Translator: Jiang Yue \n" "Language-Team: \n" "Language: zh_CN\n" @@ -13140,8 +13140,7 @@ msgstr "" "分盘打印\n" "您知道吗?您可以把一个有很多零件的模型安排到多个独立的分盘,然后打印出来,这将简化对所有零件的管理。" -#: resources/data/hints.ini: [hint:Speed up your print with Adaptive Layer -#: Height] +#: resources/data/hints.ini: [hint:Speed up your print with Adaptive Layer Height] msgid "" "Speed up your print with Adaptive Layer Height\n" "Did you know that you can print a model even faster, by using the Adaptive Layer Height option? Check it out!" @@ -13213,8 +13212,7 @@ msgstr "" "提高强度\n" "您知道吗?你可以使用更多的墙层数和更高的疏散填充密度来提高模型的强度。" -#: resources/data/hints.ini: [hint:When need to print with the printer door -#: opened] +#: resources/data/hints.ini: [hint:When need to print with the printer door opened] msgid "" "When need to print with the printer door opened\n" "Did you know that opening the printer door can reduce the probability of extruder/hotend clogging when printing lower temperature filament with a higher enclosure temperature. More info about this in the Wiki." @@ -13230,6 +13228,23 @@ msgstr "" "避免翘曲\n" "您知道吗?打印ABS这类易翘曲材料时,适当提高热床温度可以降低翘曲的概率。" +msgid "Ui title" +msgstr "连续纤维复材打印路径规划软件" + +msgid "Default print speed" +msgstr "普通打印速度" + +msgid "Configuration" +msgstr "配置" + +msgid "Configuration settings" +msgstr "配置设置" + +msgid "Fiber Spiral" +msgstr "连续纤维-双线桥接螺旋填充" + + + #~ msgid "Prefer to use high performance GPU (Effective after manual restart Bambu Studio)" #~ msgstr "优先使用高性能显卡 (手动重启 Bambu Studio 后生效)" diff --git a/resources/i18n/zh_cn/BambuStudio.mo b/resources/i18n/zh_cn/BambuStudio.mo index 4fe48723c..c0f543eaf 100644 Binary files a/resources/i18n/zh_cn/BambuStudio.mo and b/resources/i18n/zh_cn/BambuStudio.mo differ diff --git a/resources/i18n/zh_cn/BambuStudio_bk.mo b/resources/i18n/zh_cn/BambuStudio_bk.mo new file mode 100644 index 000000000..4fe48723c Binary files /dev/null and b/resources/i18n/zh_cn/BambuStudio_bk.mo differ diff --git a/resources/images/machine_logo.svg b/resources/images/machine_logo.svg new file mode 100644 index 000000000..1c47ceaad --- /dev/null +++ b/resources/images/machine_logo.svg @@ -0,0 +1,8635 @@ + + + + diff --git a/resources/images/param_fiberspiral.svg b/resources/images/param_fiberspiral.svg new file mode 100644 index 000000000..4328ea5b4 --- /dev/null +++ b/resources/images/param_fiberspiral.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/resources/web/homepage3/home.html b/resources/web/homepage3/home.html index 10ad11efa..138d5239f 100644 --- a/resources/web/homepage3/home.html +++ b/resources/web/homepage3/home.html @@ -34,14 +34,14 @@ Create new project - + + + + + + + + @@ -97,227 +97,227 @@ -
-
-
- -
Online Models
-
-
MORE >
-
-
-
- -
Online Models
-
-
MORE >
-
-
- -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
-
-
- -
MakerLab
-
-
MORE >
-
-
- -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/resources/web/homepage3/left.html b/resources/web/homepage3/left.html index 9e291cbda..e2b25d26d 100644 --- a/resources/web/homepage3/left.html +++ b/resources/web/homepage3/left.html @@ -49,28 +49,28 @@
Recent
-
-
-
Online Models
-
New
-
-
-
-
MakerLab
-
New
-
-
-
-
Maker’s Supply
-
-
-
-
Print History
-
-
-
-
User Manual
-
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index e25a2586f..945ea6805 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -1364,6 +1364,7 @@ void AppConfig::reset_selections() it->second.erase("sla_material"); it->second.erase(PRESET_PRINTER_NAME); it->second.erase("physical_printer"); + it->second.erase(PRESET_CONFIG_NAME); m_dirty = true; } } diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 71cf247f7..e8c4f8fa2 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -80,6 +80,8 @@ set(lisbslic3r_sources FileParserError.hpp Fill/Fill.cpp Fill/Fill.hpp + Fill/Bridge.hpp + Fill/Bridge.cpp Fill/Fill3DHoneycomb.cpp Fill/Fill3DHoneycomb.hpp Fill/FillAdaptive.cpp diff --git a/src/libslic3r/Fill/Bridge.cpp b/src/libslic3r/Fill/Bridge.cpp new file mode 100644 index 000000000..7c1abb943 --- /dev/null +++ b/src/libslic3r/Fill/Bridge.cpp @@ -0,0 +1,1483 @@ +#include "../ClipperUtils.hpp" +#include "../ExPolygon.hpp" +#include "../Surface.hpp" +#include "../ShortestPath.hpp" + +#include "Bridge.hpp" + + +namespace Slic3r { + + Polylines Bridge::fill_surface(const Surface* surface, const FillParams& params) + { + Polylines polylines_out; + + //BoundingBox bounding_box = surface->expolygon.contour.bounding_box(); + Points points = surface->expolygon.contour.points; + Point first = points[0]; + points.push_back(first); + //Polygon outPolygon = bounding_box.polygon(); + Polygon_t polygon; + std::vector outerBoundary; + outerBoundary.reserve(points.size()); + int precision = 1e7; + for (Point one : points) { + double x = one.x(); + double y = one.y(); + //double x_result = x / 1000000.0 + 200; + //double y_result = y / 1000000.0 + 200; + //double stored_x = std::round(x_result * precision) / precision; + //double stored_y = std::round(y_result * precision) / precision; + //Point_t temp = { stored_x ,stored_y }; + Point_t temp = { x ,y }; + outerBoundary.push_back(temp); + } + bg::append(polygon.outer(), outerBoundary); + + //std::vector innerBoundary; + + //Polygons inPolygons = surface->expolygon.holes; + //for (Polygon one : inPolygons) { + // Ring innerRing; + // innerRing.reserve(one.points.size()); + // for (Point two : one.points) { + // double x = two.x(); + // double y = two.y(); + // Point_t temp = { x,y }; + // innerRing.push_back(temp); + // } + // polygon.inners().push_back(innerRing); + //} + //int inSize = polygon.inners().size(); + // Bridge bridge(polygon, float(scale_(this->overlap - 0.5 * this->spacing))); + this->polygon = polygon; + auto abc = float(scale_(this->overlap - 0.5 * this->spacing)); + if (abc < 0) { + abc = -abc; + } + //this->offset = abc/ 1000000.0; + this->offset = 400000; + printTree(); + int size = ringNodes.begin()->second.size(); + //第一个桥接边 + int b_size = bridges.size(); + BridgeMap bm = bridges[0]; + IdIndex parent(1, 1); + //遍历 + traverseRing(findNode(bm.from_ii), parent, bm.from, bm.from2, true); + //outputPaths(); + Point_t last = { bm.from.x(),bm.from.y() }; + path.emplace_back(last); + + for (size_t i = 0; i + 1 < path.size(); ++i) { + + //Point p1 = { (path[i].x()+200)* 1000000.0,(path[i].y()+200) * 1000000.0 }; + //Point p2 = { (path[i + 1].x()+200) * 1000000.0,(path[i + 1].y()+200) * 1000000.0 }; + Point p1 = { path[i].x(),path[i].y() }; + Point p2 = { path[i + 1].x() ,path[i + 1].y() }; + Polyline line = { p1, p2 }; + polylines_out.push_back(line); + } + + return polylines_out; + } + + //void Bridge::_fill_surface_single(const FillParams& params, unsigned int thickness_layers, const std::pair& direction, ExPolygon expolygon, Polylines& polylines_out) + //{ + // expolygon.rotate(-direction.first); + // + // this->_min_spacing = scale_(this->spacing); + // assert(params.density > 0.0001f && params.density <= 1.f); + // this->_line_spacing = coord_t(coordf_t(this->_min_spacing) / params.density); + // this->_diagonal_distance = this->_line_spacing * 2; + // this->_line_oscillation = this->_line_spacing - this->_min_spacing; // only for Line infill + // BoundingBox bounding_box = expolygon.contour.bounding_box(); + // + // // define flow spacing according to requested density + // if (params.density > 0.9999f && !params.dont_adjust) { + // this->_line_spacing = this->_adjust_solid_spacing(bounding_box.size()(0), this->_line_spacing); + // this->spacing = unscale(this->_line_spacing); + // } + // else { + // // extend bounding box so that our pattern will be aligned with other layers + // // Transform the reference point to the rotated coordinate system. + // bounding_box.merge(align_to_grid( + // bounding_box.min, + // Point(this->_line_spacing, this->_line_spacing), + // direction.second.rotated(-direction.first))); + // } + // Polygon outPolygon = bounding_box.polygon(); + // Polygon_t polygon; + // std::vector outerBoundary; + // outerBoundary.reserve(outPolygon.points.size()); + // for (Point one : outPolygon.points) { + // double x = one.x(); + // double y = one.y(); + // Point_t temp = { x,y }; + // outerBoundary.push_back(temp); + // } + // bg::append(polygon.outer(), outerBoundary); + // + // //std::vector innerBoundary; + // + // Polygons inPolygons = expolygon.holes; + // for (Polygon one :inPolygons) { + // Ring innerRing; + // for (Point two: one.points) { + // double x = two.x(); + // double y = two.y(); + // Point_t temp = { x,y }; + // innerRing.push_back(temp); + // } + // polygon.inners().push_back(innerRing); + // } + // this->polygon = polygon; + // this->offset = float(scale_(this->overlap - 0.5 * this->spacing)); + // printTree(); + // for (size_t i = 0; i + 1 < path.size(); ++i) { + // + // Point p1 = { path[i].x(),path[i].y()}; + // Point p2 = { path[i + 1].x(),path[i + 1].y()}; + // Polyline line = { p1, p2 }; + // polylines_out.push_back(line); + // } + //} + + /*void Bridge::_fill_surface_single(const FillParams& params, unsigned int thickness_layers, const std::pair& direction, ExPolygon expolygon, Polylines& polylines_out) + { + + + //this->_min_spacing = scale_(this->spacing); + //assert(params.density > 0.0001f && params.density <= 1.f); + //this->_line_spacing = coord_t(coordf_t(this->_min_spacing) / params.density); + //this->_diagonal_distance = this->_line_spacing * 2; + //this->_line_oscillation = this->_line_spacing - this->_min_spacing; // only for Line infill + //BoundingBox bounding_box = expolygon.contour.bounding_box(); + + //// define flow spacing according to requested density + ////根据要求的密度定义流间距 + //if (params.density > 0.9999f && !params.dont_adjust) { + // this->_line_spacing = this->_adjust_solid_spacing(bounding_box.size()(0), this->_line_spacing); + // this->spacing = unscale(this->_line_spacing); + //} + //else { + // // extend bounding box so that our pattern will be aligned with other layers + // // Transform the reference point to the rotated coordinate system. + // //扩展边界框,使我们的图案与其他层对齐 + // //将参考点变换到旋转坐标系。 + // bounding_box.merge(align_to_grid( + // bounding_box.min, + // Point(this->_line_spacing, this->_line_spacing), + // direction.second.rotated(-direction.first))); + //} + + BoundingBox bounding_box = expolygon.contour.bounding_box(); + Polygon outPolygon = bounding_box.polygon(); + Polygon_t polygon; + std::vector outerBoundary; + outerBoundary.reserve(outPolygon.points.size()); + for (Point one : outPolygon.points) { + double x = one.x(); + double y = one.y(); + Point_t temp = { x,y }; + outerBoundary.push_back(temp); + } + bg::append(polygon.outer(), outerBoundary); + + //std::vector innerBoundary; + + Polygons inPolygons = expolygon.holes; + for (Polygon one : inPolygons) { + Ring innerRing; + innerRing.reserve(one.points.size()); + for (Point two : one.points) { + double x = two.x(); + double y = two.y(); + Point_t temp = { x,y }; + innerRing.push_back(temp); + } + polygon.inners().push_back(innerRing); + } + int inSize = polygon.inners().size(); + // Bridge bridge(polygon, float(scale_(this->overlap - 0.5 * this->spacing))); + this->polygon = polygon; + this->offset = float(scale_(this->overlap - 0.5 * this->spacing)); + printTree(); + //outputPaths(); + + for (size_t i = 0; i + 1 < path.size(); ++i) { + + Point p1 = { path[i].x(),path[i].y()}; + Point p2 = { path[i + 1].x(),path[i + 1].y()}; + Polyline line = { p1, p2 }; + polylines_out.push_back(line); + } + }*/ + + + //判断两个点是否相等 +bool equal(Point_t p1, Point_t p2) { + return p1.x() == p2.x() && p1.y() == p2.y(); +} + +bool is_point_on_segment(const Point_t& p, const Segment& seg, double tolerance = 1e-6) { + // 计算点到线段的距离 + double dist = bg::distance(p, seg); + + // 检查距离是否在容差范围内 + if (dist > tolerance) { + return false; + } + + // 获取线段端点 + const Point_t& p1 = seg.first; + const Point_t& p2 = seg.second; + + // 检查点是否在线段的边界框内 + double min_x = std::min(p1.x(), p2.x()); + double max_x = std::max(p1.x(), p2.x()); + double min_y = std::min(p1.y(), p2.y()); + double max_y = std::max(p1.y(), p2.y()); + + // 考虑容差 + return (p.x() >= min_x - tolerance) && (p.x() <= max_x + tolerance) && + (p.y() >= min_y - tolerance) && (p.y() <= max_y + tolerance); +} + +// 计算点到原点的距离平方 +double distance_to_origin_sq(const Point_t& p) { + return bg::get<0>(p) * bg::get<0>(p) + bg::get<1>(p) * bg::get<1>(p); +} + +// 找到环中距离原点最近的点作为起点 +void reorder_ring_start_point(Ring& ring) { + + // 找到距离原点最近的点 + auto min_it = std::min_element(ring.begin(), ring.end(), + [](const Point_t& a, const Point_t& b) { + return distance_to_origin_sq(a) < distance_to_origin_sq(b); + }); + + // 旋转环使最近的点成为起点 + std::rotate(ring.begin(), min_it, ring.end() - 1); // end()-1 保留闭合点 + + // 确保环保持闭合 + if (!bg::equals(ring.front(), ring.back())) { + ring.back() = ring.front(); + } +} + + +//将节点加入处理节点集合中 +RingNode Bridge::formatNode(const size_t id, const size_t index, const Ring& ring, const int orientation) { + Ring ringNode; + ringNode.assign(ring.begin(), ring.end()); + RingNode node({ id, index }, ringNode, orientation); + return node; +} +void Bridge::addNode(RingNode& node) { + reorder_ring_start_point(node.ring); + // 检查键是否存在 + const auto it = ringNodes.find(node.id.id); + if (it != ringNodes.end()) { + // 键已存在,将新节点添加到对应向量的末尾 + it->second.emplace_back(node); + } + else { + // 键不存在,创建一个新的向量并插入到 map 中 + ringNodes[node.id.id] = { node }; + } +} + +void Bridge::removeNode(IdIndex id) { + auto it = ringNodes.find(id.id); + if (it != ringNodes.end()) { + std::vector& nodes = it->second; + nodes.erase(std::remove_if(nodes.begin(), nodes.end(), + [id](RingNode x) { return x.id.id == id.id && x.id.index == id.index; }), + nodes.end()); + } +} + +//查找节点 +RingNode& Bridge::findNode(const IdIndex ii) { + const auto it = ringNodes.find(ii.id); + std::vector& nodes = it->second; + const auto it1 = std::find_if(nodes.begin(), nodes.end(), [ii](const RingNode& node) { + return node.id.index == ii.index; + }); + return *it1; +} + + +//计算多边形的外边界和内边界 +void Bridge::computePolygonBoundaries(const Polygon_t& polygon) { + // 提取外边界 + boundaries.outerBoundary = bg::exterior_ring(polygon); + // 获取内边界 + const auto& interiors = bg::interior_rings(polygon); + for (const auto& inner : interiors) { + boundaries.innerBoundaries.push_back(inner); + } +} + +// 判断两个环是否相交(不包括包含关系) +bool Bridge::ringsIntersect(const Ring& ring1, const Ring& ring2) +{ + // 首先检查是否相交(包括边界相交) + if (!bg::intersects(ring1, ring2)) { + return false; + } + + // 然后排除包含关系 + bool ring1_inside_ring2 = bg::within(ring1, ring2); + bool ring2_inside_ring1 = bg::within(ring2, ring1); + + // 如果存在包含关系,则不算作相交 + if (ring1_inside_ring2 || ring2_inside_ring1) { + return false; + } + + return true; +} + + +//获取环偏移后的环(可能为空) +std::vector Bridge::offsetRing(const Ring& ring, const double distance) { + // 将环包装成多边形 + Polygon_t inputPolygon; + inputPolygon.outer() = ring; + // 修复几何数据 + bg::correct(inputPolygon); + + // 使用 multi_polygon 作为 buffer 的输出类型 + bg::model::multi_polygon result; + // 使用对称距离策略 + bg::buffer(inputPolygon, result, + bg::strategy::buffer::distance_symmetric(distance), + bg::strategy::buffer::side_straight(), + bg::strategy::buffer::join_round(), + bg::strategy::buffer::end_round(), + bg::strategy::buffer::point_circle()); + // 提取偏移后的环 + std::vector offsetRing; + for (const auto& poly : result) { + if (std::abs(bg::area(poly.outer())) > area_threshold) { + offsetRing.emplace_back(poly.outer()); + } + } + return offsetRing; +} + +// 查找环非邻边的相交点 +std::vector Bridge::findNonAdjacentIntersections(const Ring& ring) { + Polygon_t poly; + bg::append(poly.outer(), ring); + std::vector intersections; + std::vector> segments; + const size_t num_points = bg::num_points(poly.outer()); + + // 构建所有边的线段 + for (int i = 0; i < num_points - 1; ++i) { + segments.emplace_back(poly.outer()[i], poly.outer()[i + 1]); + } + + // 遍历所有非邻边对 + for (size_t i = 0; i < segments.size(); ++i) { + for (size_t j = i + 2; j < segments.size(); ++j) { + if ((i == 0 && j == segments.size() - 1)) continue; // 排除相邻边 + std::vector intersection_points; + bg::intersection(segments[i], segments[j], intersection_points); + + for (const auto& point : intersection_points) { + // 检查相交点是否为多边形的顶点 + bool is_vertex = false; + for (const auto& vertex : polygon.outer()) { + if (bg::equals(point, vertex)) { + is_vertex = true; + break; + } + } + if (!is_vertex) { + intersections.push_back(point); + } + } + } + } + return intersections; +} + +// 将环拆分成多个环 +std::vector Bridge::split(const Ring& ring, const std::vector& intersections) { + std::vector rings; + std::vector visited(ring.size(), false); + Ring extendedRing = ring; + + // 插入相交点到环中 + for (const auto& intersection : intersections) { + for (size_t i = 0; i < ring.size(); ++i) { + Segment seg(ring[i], ring[(i + 1) % ring.size()]); + if (bg::within(intersection, seg)) { + extendedRing.insert(extendedRing.begin() + i + 1, intersection); + break; + } + } + } + + std::vector newVisited(extendedRing.size(), false); + for (size_t i = 0; i < extendedRing.size(); ++i) { + if (newVisited[i]) continue; + + Ring newRing; + size_t current = i; + do { + newRing.push_back(extendedRing[current]); + newVisited[current] = true; + current = (current + 1) % extendedRing.size(); + } while (current != i); + + if (newRing.size() > 2) { + rings.push_back(newRing); + } + } + return rings; +} + + +// 在环的指定位置插入点 +void insert_point_in_ring(Ring& ring, const Point_t& point, size_t after_index) { + auto it = ring.begin(); + std::advance(it, after_index + 1); + ring.insert(it, point); +} + +// 找到环上应该插入交点的位置 +std::vector> find_insertion_points(const Ring& ring, const std::vector& intersections) { + std::vector> insertion_points; + + for (const auto& p : intersections) { + double min_dist = std::numeric_limits::max(); + size_t best_segment = 0; + + for (size_t i = 0; i < ring.size() - 1; ++i) { + Point_t seg_start = ring[i]; + Point_t seg_end = ring[i + 1]; + + // 计算点到线段的距离 + double dist = bg::distance(p, bg::model::segment(seg_start, seg_end)); + + if (dist < min_dist) { + min_dist = dist; + best_segment = i; + } + } + + if (min_dist < 1e-6) { // 使用小的容差值 + insertion_points.emplace_back(best_segment, p); + } + } + + // 按插入位置排序,从后往前插入 + std::sort(insertion_points.begin(), insertion_points.end(), + [](const auto& a, const auto& b) { return a.first > b.first; }); + + return insertion_points; +} + +// 合并两个环 +std::vector Bridge::merge(const RingNode& ring1, const RingNode& ring2) { + + // 将环转换为多边形 + Polygon_t poly1, poly2; + bg::append(poly1.outer(), ring1.ring); + bg::append(poly2.outer(), ring2.ring); + + bg::correct(poly1); // 确保多边形是有效的 + bg::correct(poly2); // 确保多边形是有效的 + + std::vector intersection_points; + bg::intersection(poly1, poly2, intersection_points); + + // 将交点插入到两个多边形中 + auto insertions1 = find_insertion_points(poly1.outer(), intersection_points); + for (const auto& ins : insertions1) { + insert_point_in_ring(poly1.outer(), ins.second, ins.first); + } + + auto insertions2 = find_insertion_points(poly2.outer(), intersection_points); + for (const auto& ins : insertions2) { + insert_point_in_ring(poly2.outer(), ins.second, ins.first); + } + + + // 计算多边形交、差布尔运算 + /* MultiPolygon mp0; + bg::intersection(poly1, poly2, mp0);*/ + + MultiPolygon mp1; + bg::difference(poly1, poly2, mp1); + + MultiPolygon mp2; + bg::difference(poly2, poly1, mp2); + + // 合并所有结果多边形 + MultiPolygon result; + //result.insert(result.end(), mp0.begin(), mp0.end()); + if (ring1.orientation == -1 && ring2.orientation == 1) { + result.insert(result.end(), mp1.begin(), mp1.end()); + } + else if (ring1.orientation == 1 && ring2.orientation == -1) { + result.insert(result.end(), mp2.begin(), mp2.end()); + } + else { + result.insert(result.end(), mp1.begin(), mp1.end()); + result.insert(result.end(), mp2.begin(), mp2.end()); + } + + std::vector allRings; + + for (const auto& poly : result) { + allRings.emplace_back(poly.outer()); + } + + //for (const auto& poly : result) { + // allRings.push_back(poly.outer()); + // for (const auto& inner : poly.inners()) { + // allRings.push_back(inner); + // } + //} + + //// 过滤掉被其他环完全包含的环 + std::vector disjointRings; + for (size_t i = 0; i < allRings.size(); ++i) { + bool isContained = false; + for (size_t j = 0; j < allRings.size(); ++j) { + if (i != j && bg::within(allRings[i], allRings[j])) { + isContained = true; + break; + } + } + if (!isContained) { + disjointRings.push_back(allRings[i]); + } + } + return allRings; +} + +//生成环集 +void Bridge::generateRings() { + //获取多边形的外边界和内边界 + computePolygonBoundaries(polygon); + + //外边界 + std::vector rings = offsetRing(boundaries.outerBoundary, -offset / 2); + for (auto& r : rings) { + RingNode node = formatNode(maxRid++, 1, r, -1); + nodeHandles.emplace_back(node); + addNode(node); + } + + //内边界 偏移 + std::map offRings; //存放待偏移的环 + for (auto& inner : boundaries.innerBoundaries) { + offRings.insert({ {maxRid++,1},inner }); + } + std::vector tempRings; + for (auto& r : offRings) { + std::vector _rings = offsetRing(r.second, offset / 2); + if (_rings.size() == 1) { + RingNode node1 = formatNode(r.first.id, r.first.index + 1, _rings[0], 1); + if (bg::area(node1.ring) > area_threshold) { + addNode(node1); + tempRings.emplace_back(node1); + } + } + else if (_rings.size() > 1) { + std::vector id_indices; + for (auto& r1 : _rings) { + RingNode node0 = formatNode(++maxRid, 1, r1, 1); + if (bg::area(node0.ring) > area_threshold) { + addNode(node0); + tempRings.emplace_back(node0); + IdIndex ii(maxRid, 1); + id_indices.emplace_back(ii); + } + } + //分裂映射 + offsetMap.insert(std::pair>({ r.first.id,r.first.index }, id_indices)); + } + } + nodeHandles.insert(nodeHandles.end(), tempRings.begin(), tempRings.end()); + + //遍历当前用于判断自/互交的节点集 + while (!nodeHandles.empty()) { + std::vector interNodes; //产生互交的节点集 + std::vector nodes; //互交后产生的节点 + for (auto it1 = nodeHandles.begin(); it1 != nodeHandles.end(); ++it1) { + //互交判断&处理 + auto it2 = std::next(it1); + for (; it2 != nodeHandles.end(); ++it2) { + if (ringsIntersect(it1->ring, it2->ring)) { + //合并 + std::vector rings = merge(*it1, *it2); + std::vector id_indices; + for (const auto& ring2 : rings) { + // 外与内 外与外 -> 向内; 内与内 -> 向外 + const int orientation = (it1->orientation + it2->orientation) <= 0 ? -1 : 1; + RingNode node1 = formatNode(++maxRid, 1, ring2, orientation); + if (bg::area(node1.ring) > area_threshold) { + nodes.emplace_back(node1); + addNode(node1); + IdIndex _ii(maxRid, 1); + id_indices.emplace_back(_ii); + } + } + MergeMap mm(it1->id, it2->id, id_indices); + mergeMap.emplace_back(mm); + interNodes.emplace_back(*it1); + interNodes.emplace_back(*it2); + it1++; + break; + } + } + } + //删除互交节点 + for (auto& n : interNodes) { + nodeHandles.erase(std::remove(nodeHandles.begin(), nodeHandles.end(), n), nodeHandles.end()); + } + + //是否存在互交 + if (!nodes.empty()) { + for (auto& n : nodes) { + nodeHandles.emplace_back(n); + } + } + std::vector offsetNodes; + //偏移 + for (auto& node : nodeHandles) { + //if (node.orientation == 1) continue; + std::vector ring0 = offsetRing(node.ring, static_cast(node.orientation) * offset); + if (ring0.size() == 1) { + RingNode node0 = formatNode(node.id.id, ++node.id.index, ring0[0], node.orientation); + if (bg::area(node0.ring) > area_threshold) { + addNode(node0); + offsetNodes.emplace_back(node0); + } + } + else if (ring0.size() > 1) { + std::vector id_indices; + for (auto& r : ring0) { + RingNode node0 = formatNode(++maxRid, 1, r, node.orientation); + if (bg::area(node0.ring) > area_threshold) { + addNode(node0); + offsetNodes.emplace_back(node0); + IdIndex ii(maxRid, 1); + id_indices.emplace_back(ii); + } + } + //分裂映射 + offsetMap.insert(std::pair>({ node.id.id,node.id.index }, id_indices)); + } + } + //清空 + nodeHandles.clear(); + if (!offsetNodes.empty()) { + //重填 + nodeHandles.insert(nodeHandles.end(), offsetNodes.begin(), offsetNodes.end()); + } + } +} + +//形成树 +void Bridge::formatTree() { + //遍历不同环类型的节点集合 + for (auto& ringNode : ringNodes) { + // 使用反向迭代器进行反序遍历 + std::vector& vec = ringNode.second; + const auto it0 = ringNode.second.begin(); + if (it0->orientation == 1) { // 向外 倒序 + for (size_t i = ringNode.second.size() - 1; i > 0; i--) { + ringNode.second[i].children.emplace_back(ringNode.second[i - 1]); + ringNode.second[i - 1].parent = &ringNode.second[i]; + } + } + else { //向内 正序 + for (int i = 0; i < vec.size() - 1; i++) { + ringNode.second[i].children.emplace_back(ringNode.second[i + 1]); + ringNode.second[i + 1].parent = &ringNode.second[i]; + } + } + } + + //遍历分裂/合并映射 + for (auto& map : offsetMap) { //偏移产生的分裂 + RingNode& it1 = findNode(map.first); + for (const auto& ii : map.second) { + RingNode& it2 = findNode(ii); + it1.children.emplace_back(it2); + } + } + for (auto& map : mergeMap) { //合并 + RingNode& it1 = findNode(map.ii1); + RingNode& it2 = findNode(map.ii2); + for (const auto& ii : map.nodes) { + RingNode& it = findNode(ii); + + if (it.orientation == -1) { //向内 + //内 外 + if (it1.orientation == -1 && it2.orientation == 1) { + it1.parent->children.emplace_back(it); + it.parent = it1.parent; + IdIndex _ii = it1.id; + + //将it1从父节点的子节点集中移除 + it1.parent->children.erase(std::remove_if(it1.parent->children.begin(), it1.parent->children.end(), + [_ii](RingNode x) { return x.id.id == _ii.id && x.id.index == _ii.index; }), + it1.parent->children.end()); + //it作为it2子节点的父节点 + for (auto& c : it2.children) { + c.parent = ⁢ + } + it.children.insert(it.children.end(), it2.children.begin(), it2.children.end()); + } + else if (it1.orientation == 1 && it2.orientation == -1) //外 内 + { + it2.parent->children.emplace_back(it); + it.parent = it2.parent; + IdIndex _ii = it2.id; + //将it2从父节点的子节点集中移除 + it2.parent->children.erase(std::remove_if(it2.parent->children.begin(), it2.parent->children.end(), + [_ii](RingNode x) { return x.id.id == _ii.id && x.id.index == _ii.index; }), + it2.parent->children.end()); + //it作为it1子节点的父节点 + for (auto& c : it1.children) { + c.parent = ⁢ + } + it.children.insert(it.children.end(), it1.children.begin(), it1.children.end()); + } + else if (it1.orientation == 1 && it2.orientation == 1) { //外 外 + //it作为it1子节点的父节点 + for (auto& c : it1.children) { + c.parent = ⁢ + } + it.children.insert(it.children.end(), it1.children.begin(), it1.children.end()); + //it作为it2子节点的父节点 + for (auto& c : it2.children) { + c.parent = ⁢ + } + it.children.insert(it.children.end(), it2.children.begin(), it2.children.end()); + } + else if (it1.orientation == -1 && it2.orientation == -1) {// 内 内 + it1.parent->children.emplace_back(it); + //it.parent = it1.parent; + IdIndex _ii = it1.id; + //将it1从父节点的子节点集中移除 + it1.parent->children.erase(std::remove_if(it1.parent->children.begin(), it1.parent->children.end(), + [_ii](RingNode x) { return x.id.id == _ii.id && x.id.index == _ii.index; }), + it1.parent->children.end()); + + it2.parent->children.emplace_back(it); + //it.parent = it2.parent; + IdIndex _ii2 = it2.id; + //将it2从父节点的子节点集中移除 + it2.parent->children.erase(std::remove_if(it2.parent->children.begin(), it2.parent->children.end(), + [_ii2](RingNode x) { return x.id.id == _ii2.id && x.id.index == _ii2.index; }), + it2.parent->children.end()); + } + } + else { //向外 + //it1.parent = ⁢ + //将it1的子节点作为it的子节点 + it.children.insert(it.children.end(), it1.children.begin(), it1.children.end()); + it1.children.clear(); //清空it1的子节点集 + //it2.parent = ⁢ + it.children.insert(it.children.end(), it2.children.begin(), it2.children.end()); + it2.children.clear(); + } + + RingNode* it_parent = it.parent; + //判断是否互交 + if (ringsIntersect(it.ring, it_parent->ring)) { + //合并 + std::vector rings = merge(it1, *it1.parent); + const int orientation = (it1.orientation + it1.parent->orientation) <= 0 ? -1 : 1; + RingNode node1 = formatNode(++maxRid, 1, rings[0], orientation); + if (bg::area(node1.ring) > area_threshold) { + addNode(node1); + + findNode(node1.id).children.insert(findNode(node1.id).children.end(), it1.children.begin(), it1.children.end()); + if (it_parent->parent != nullptr) { + IdIndex ii = it_parent->id; + it_parent->parent->children.erase(std::remove_if(it_parent->parent->children.begin(), it_parent->parent->children.end(), + [ii](RingNode x) { return x.id.id == ii.id && x.id.index == ii.index; }), + it_parent->parent->children.end()); + it_parent->parent->children.emplace_back(node1); + } + } + } + } + } +} + +//树遍历 +void Bridge::dfs(RingNode& node, std::vector& visited, size_t& edge) { + auto& it = std::find_if(visited.begin(), visited.end(), [node](const IdIndex& ii) { + return ii.id == node.id.id && ii.index == node.id.index; + }); + if (it != visited.end()) { + return; + } + visited.emplace_back(node.id); + edge++; + // 处理当前节点 + std::cout << "rId: " << node.id.id << ", rIndex: " << node.id.index + << ", orientation: " << node.orientation + << ", isHide: " << (node.isHide ? "true" : "false") << std::endl; + + Polygon_t poly; + bg::assign(poly, node.ring); + //verteies.push_back(convertToSFML(poly, sf::Color::Red)); + + // 递归遍历子节点 + for (auto& child : node.children) { + handleBridge(node.id, child.id, offset); + dfs(findNode(child.id), visited, edge); + } +} + + +//找到多边形环第 N 条边的中心点 +Point_t Bridge::findCenterPointOnEdge(Ring& ring, size_t N, double d0, size_t& e_index) { + + // 获取第 N 条边的两个端点 + const Point_t start = ring[N]; + const Point_t end = ring[N + 1]; + // 计算中点 + const double mid_x = (start.x() + end.x()) / 2; + const double mid_y = (start.y() + end.y()) / 2; + + Point_t p(mid_x, mid_y); + if (d0 > 0) { + std::size_t n = ring.size() - 1; // 环的边数 + double remainingDist = d0; + + // 计算 p0 到边终点(顺时针方向下一点)的距离 + double distToEnd = bg::distance(p, ring[N + 1]); + + // 如果 d0 小于等于到边终点的距离,直接在当前边上计算 + if (remainingDist <= distToEnd) { + // 计算从 p0 到边终点的方向向量 + double dx = bg::get<0>(ring[N + 1]) - bg::get<0>(p); + double dy = bg::get<1>(ring[N + 1]) - bg::get<1>(p); + double length = std::sqrt(dx * dx + dy * dy); + + if (length < 1e-9) { + // 特殊情况:p0 几乎是边的终点 + return ring[N + 1]; + } + // 归一化方向向量 + double unitDx = dx / length; + double unitDy = dy / length; + + // 计算新点坐标 + double newX = bg::get<0>(p) + unitDx * remainingDist; + double newY = bg::get<1>(p) + unitDy * remainingDist; + + Point_t p0(newX, newY); + e_index = N; + return p0; + } + + // 剩余距离超过当前边,需要继续到下一条边 + remainingDist -= distToEnd; + + // 沿顺时针方向继续搜索后续边 + for (std::size_t i = 2; i < n; ++i) { + std::size_t currentIndex = (N + i) % n; + Segment edge(ring[currentIndex], ring[currentIndex + 1]); + double edgeLength = bg::distance(edge.first, edge.second); + + // 如果剩余距离小于等于当前边长度,在当前边上计算 + if (remainingDist <= edgeLength) { + // 计算边的方向向量 + double dx = bg::get<0>(edge.second) - bg::get<0>(edge.first); + double dy = bg::get<1>(edge.second) - bg::get<1>(edge.first); + double length = std::sqrt(dx * dx + dy * dy); + + if (length < 1e-9) { + // 边长度几乎为零 + const auto insertPos = ring.begin() + currentIndex + 1; + ring.insert(insertPos, edge.first); + bg::correct(ring); //调整方向为顺时针 + return edge.first; + } + + // 归一化方向向量 + double unitDx = dx / length; + double unitDy = dy / length; + + // 计算新点坐标 + double newX = bg::get<0>(edge.first) + unitDx * remainingDist; + double newY = bg::get<1>(edge.first) + unitDy * remainingDist; + Point_t p0(newX, newY); + e_index = currentIndex; + return p0; + } + // 否则继续到下一条边 + remainingDist -= edgeLength; + } + } + else { + e_index = N; + } + return p; +} + + +// 计算点到线段的最近点 +Point_t closest_point_on_segment(const Point_t& p, const Point_t& seg_start, const Point_t& seg_end) { + const double x = bg::get<0>(p); + const double y = bg::get<1>(p); + const double x1 = bg::get<0>(seg_start); + const double y1 = bg::get<1>(seg_start); + const double x2 = bg::get<0>(seg_end); + const double y2 = bg::get<1>(seg_end); + + // 线段向量 + const double dx = x2 - x1; + const double dy = y2 - y1; + + // 如果线段长度为零,返回起点 + if (dx == 0 && dy == 0) { + return seg_start; + } + + // 计算投影参数t + const double t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy); + + // 根据t值确定最近点 + if (t <= 0.0) { + return seg_start; + } + else if (t >= 1.0) { + return seg_end; + } + else { + return Point_t(x1 + t * dx, y1 + t * dy); + } +} + +// 在环的边上查找离给定点最近的点 +Point_t find_closest_point_on_ring_edges(Ring& ring, const Point_t& p0, size_t& e_index1) { + // 验证环是否闭合 + if (ring.size() < 2 || !bg::equals(ring.front(), ring.back())) { + throw std::runtime_error("Ring is not closed"); + } + + Point_t closest_point; + double min_distance = std::numeric_limits::max(); + + size_t e_index = 0; + // 遍历环的所有边 + for (size_t i = 0; i < ring.size() - 1; ++i) { + const Point_t& p1 = ring[i]; + const Point_t& p2 = ring[i + 1]; + + // 计算线段上的最近点 + Point_t projected_point = closest_point_on_segment(p0, p1, p2); + + // 计算距离 + double distance = bg::distance(p0, projected_point); + + // 更新最近点 + if (distance < min_distance) { + min_distance = distance; + closest_point = projected_point; + e_index = i; + } + } + e_index1 = e_index; + //插入 + //ring.insert(ring.begin() + e_index + 1, closest_point); + + //bg::correct(ring); //调整方向为顺时针 + return closest_point; +} + +// 找到点所在的边(返回边起点索引) +std::pair find_edge_containing_point(const Ring& ring, const Point_t& point) { + for (size_t i = 0; i < ring.size() - 1; ++i) { + const Point_t& p1 = ring[i]; + const Point_t& p2 = ring[i + 1]; + + // 计算点到线段的距离 + double seg_length = bg::distance(p1, p2); + if (seg_length == 0) continue; // 忽略零长度边 + + // 计算点在边上的投影参数t + double t = ((bg::get<0>(point) - bg::get<0>(p1)) * (bg::get<0>(p2) - bg::get<0>(p1)) + + (bg::get<1>(point) - bg::get<1>(p1)) * (bg::get<1>(p2) - bg::get<1>(p1))) / + (seg_length * seg_length); + + // 如果点在当前边上 + if (t >= 0.0 && t <= 1.0) { + Point_t proj( + bg::get<0>(p1) + t * (bg::get<0>(p2) - bg::get<0>(p1)), + bg::get<1>(p1) + t * (bg::get<1>(p2) - bg::get<1>(p1)) + ); + + // 检查投影点与实际点的距离是否足够近 + if (bg::distance(point, proj) < 1e-6) { + return { i, t }; + } + } + } +} + + +Point_t Bridge::find_point_at_distance_clockwise(Ring& ring, const Point_t& start_point, double d, size_t& e_index) +{ + // 1. 找到起点所在的边 + std::pair p = find_edge_containing_point(ring, start_point); + size_t edge_index = p.first; + double t = p.second; + // 计算从起点到当前边终点的剩余距离 + const Point_t& p1 = ring[edge_index]; + const Point_t& p2 = ring[(edge_index + 1) % ring.size()]; + double remaining_on_edge = (1.0 - t) * bg::distance(p1, p2); + + // 3. 如果剩余距离足够 + if (remaining_on_edge >= d) { + double new_t = t + d / bg::distance(p1, p2); + Point_t p(bg::get<0>(p1) + new_t * (bg::get<0>(p2) - bg::get<0>(p1)), + bg::get<1>(p1) + new_t * (bg::get<1>(p2) - bg::get<1>(p1))); + e_index = edge_index; + //auto insertPos = ring.begin() + edge_index + 1; + //ring.insert(insertPos, p); + //bg::correct(ring); //调整方向为顺时针 + return p; + } + + // 4. 否则继续遍历后续边 + double accumulated_distance = remaining_on_edge; + size_t current_index = (edge_index + 1) % (ring.size() - 1); + + while (accumulated_distance < d) { + const Point_t& p1 = ring[current_index]; + const Point_t& p2 = ring[(current_index + 1) % (ring.size() - 1)]; + double segment_length = bg::distance(p1, p2); + + if (accumulated_distance + segment_length >= d) { + double ratio = (d - accumulated_distance) / segment_length; + //在current_index 插入 + Point_t p(bg::get<0>(p1) + ratio * (bg::get<0>(p2) - bg::get<0>(p1)), + bg::get<1>(p1) + ratio * (bg::get<1>(p2) - bg::get<1>(p1))); + e_index = current_index; + //auto insertPos = ring.begin() + current_index + 1; + //ring.insert(insertPos, p); + //bg::correct(ring); //调整方向为顺时针 + return p; + } + accumulated_distance += segment_length; + current_index = (current_index + 1) % (ring.size() - 1); + } + return Point_t(); +} + + +// 判断点是否在线段内部(非端点) +bool is_point_inside_segment(const Point_t& p, const Segment& seg) { + double x = bg::get<0>(p); + double y = bg::get<1>(p); + double x1 = bg::get<0>(seg.first); + double y1 = bg::get<1>(seg.first); + double x2 = bg::get<0>(seg.second); + double y2 = bg::get<1>(seg.second); + + // 检查点是否在线段的包围盒内 + if ((x < std::min(x1, x2) - 1e-6) || (x > std::max(x1, x2) + 1e-6) || + (y < std::min(y1, y2) - 1e-6) || (y > std::max(y1, y2) + 1e-6)) { + return false; + } + + // 向量叉积判断共线(可跳过,因为 intersects 已保证相交) + double cross = (x - x1) * (y2 - y1) - (y - y1) * (x2 - x1); + if (std::abs(cross) > 1e-6) return false; + + return true; +} + +// 判断两线段是否在内部相交(排除端点接触) +bool segments_cross(const Segment& seg1, const Segment& seg2) { + if (!bg::intersects(seg1, seg2)) return false; + + std::vector points; + bg::intersection(seg1, seg2, points); + + if (points.empty()) return false; + + // 检查交点是否在两条线段的内部 + for (const auto& p : points) { + if (is_point_inside_segment(p, seg1) && is_point_inside_segment(p, seg2)) { + return true; + } + } + return false; +} + +//在环上寻找长度最大的边索引 +size_t Bridge::findLongestEdgeIndex(const Ring& ring) { + if (ring.size() < 4) { + throw std::invalid_argument("Ring must have at least 4 points"); + } + + std::vector max_indices; + double max_length = 0.0; + const size_t n = ring.size(); + + // 遍历所有边,收集最大长度边的索引 + for (size_t i = 0; i < n - 1; ++i) { + const auto& p1 = ring[i]; + const auto& p2 = ring[i + 1]; + const double current_length = bg::distance(p1, p2); + + if (current_length > max_length) { + max_length = current_length; + max_indices.clear(); + max_indices.push_back(i); + } + else if (current_length == max_length) { + max_indices.push_back(i); + } + } + isFront = !isFront; + if (max_indices.size() > 1) { + sel_edge_index = isFront ? max_indices[0] : max_indices[max_indices.size() - 1]; + } + else { + sel_edge_index = isFront ? (max_indices[0] + 1) % (n - 1) : (max_indices[0] - 1 + n) % (n - 1); + } + return sel_edge_index; + +} + + +//点在环上的位置索引 +int findPointIndex(const Ring& ring, const Point_t& p0) { + for (size_t i = 0; i < ring.size(); ++i) { + if (ring[i].x() == p0.x() && ring[i].y() == p0.y()) { + return static_cast(i); + } + } + return -1; // 未找到 +} + +// 判断点是否靠近顶点(距离小于阈值) +bool is_point_near_vertices(const Point_t& p4, const std::vector& vertices, double epsilon = 0.1) { + for (const auto& v : vertices) { + double dx = bg::get<0>(p4) - bg::get<0>(v); + double dy = bg::get<1>(p4) - bg::get<1>(v); + if (dx * dx + dy * dy < epsilon * epsilon) { + return true; + } + } + return false; +} + +void insert_point_on_ring(Ring& ring, Point_t& point, size_t index) { + const auto insertPos = ring.begin() + index + 1; + ring.insert(insertPos, point); + bg::correct(ring); //调整方向为顺时针 +} + + +//在第N条边上进行内外环桥接,并插入桥接点 +void Bridge::handleBridge(IdIndex o_ii, IdIndex i_ii, double _offset2) +{ + //判断环上是否存在桥接 + bool isExist = false; + for (auto& b : bridges) { + if (b.to_ii == i_ii) { + isExist = true; + break; + } + } + if (isExist) true; + + RingNode& inner = findNode(i_ii); + RingNode& outer = findNode(o_ii); + + Ring i_ring; + bg::assign(i_ring, inner.ring); + Ring o_ring; + bg::assign(o_ring, outer.ring); + + size_t edge_index_inner = findLongestEdgeIndex(inner.ring); + size_t edge_index_outer = findLongestEdgeIndex(outer.ring); + + double _offset = 0; + Point_t p0, p1, p2, p3; + size_t p0_index = 0, p0_index_1 = 0, p1_index = 0, p2_index = 0, p2_index_1 = 0, p3_index = 0; + bool _f = false; + do { + //从内到外 + p0 = findCenterPointOnEdge(inner.ring, edge_index_inner, _offset, p0_index); + Point_t p0_o = find_closest_point_on_ring_edges(outer.ring, p0, p0_index_1); + //从外到内 + p2 = findCenterPointOnEdge(outer.ring, edge_index_outer, _offset, p2_index); + Point_t p2_i = find_closest_point_on_ring_edges(inner.ring, p2, p2_index_1); + if (bg::distance(p0, p0_o) < bg::distance(p2, p2_i)) { + //从内到外 + p2 = p0_o; + p2_index = p0_index_1; + } + else { + p0 = p2_i; + p0_index = p2_index_1; + } + p1 = find_point_at_distance_clockwise(inner.ring, p0, offset, p1_index); + p3 = find_point_at_distance_clockwise(outer.ring, p2, offset, p3_index); + if (!bridges.empty()) { + BridgeMap bm = bridges.back(); + if (bg::distance(bm.to, p2) < offset || bg::distance(bm.to2, p2) < offset + || bg::distance(bm.to, p3) < offset || bg::distance(bm.to2, p3) < offset) { + _offset += offset; + _f = true; + } + else { + _f = false; + } + } + + } while (_f); + + Segment seg1(p2, p1); + Segment seg2(p3, p0); + + insert_point_on_ring(inner.ring, p1, p1_index); + insert_point_on_ring(inner.ring, p0, p0_index); + insert_point_on_ring(outer.ring, p3, p3_index); + insert_point_on_ring(outer.ring, p2, p2_index); + + if (bg::intersects(seg1, seg2)) { + BridgeMap edge(p2, p1, p3, p0, o_ii, i_ii, edge_index_inner); + bridges.push_back(edge); + } + else { + BridgeMap edge(p2, p0, p3, p1, o_ii, i_ii, edge_index_inner); + bridges.push_back(edge); + } + +} + + +//输出所有环 +void Bridge::printRings() { + generateRings(); + // 输出环中的点信息 + std::cout << "Points in the ring:" << std::endl; + for (const auto& map : ringNodes) { + std::cout << "(" << map.first << std::endl; + for (const auto& node : map.second) { + std::cout << "{" << node.id.id << "," << node.id.index << "," << node.orientation << std::endl; + for (const auto& point : node.ring) { + std::cout << "(" << bg::get<0>(point) << "," << bg::get<1>(point) << ")"; + } + std::cout << "}" << std::endl; + } + std::cout << ")" << std::endl; + } +} + +//输出树结构 +void Bridge::printTree() { + generateRings(); + formatTree(); + // 用于记录已访问的节点 + //std::unordered_set> visited; + std::vector visited; + size_t edge = 1; + dfs(findNode({ 1,1 }), visited, edge); +} + + + + +int findIndex(std::vector points, const Point_t& p0) { + for (int i = 0; i < points.size(); ++i) { + if (equal(points[i], p0)) { + return static_cast(i); + } + } + return -1; // 未找到 +} + + + +//递归遍历环 +void Bridge::traverseRing( + RingNode& node, + IdIndex parent, + Point_t& start, + Point_t& end, + bool isOutermostLayer +) { + //得到start点在环ring上的索引位置 + int size = node.ring.size(); + int s_index = findPointIndex(node.ring, start); + int e_index = findPointIndex(node.ring, end); + std::vector c_points; + std::vector cc_points; + std::vector points; + for (int i = s_index; !equal(node.ring[i], end); i = (i + 1) % size) { + c_points.emplace_back(node.ring[i]); + } + c_points.emplace_back(end); + for (int i = s_index; !equal(node.ring[i], end); i = (i - 1 + size) % size) { + cc_points.emplace_back(node.ring[i]); + } + cc_points.emplace_back(end); + + if (cc_points.size() > c_points.size()) { + points.assign(cc_points.begin(), cc_points.end()); + } + else + { + points.assign(c_points.begin(), c_points.end()); + } + int index = 0; + do { + //转换成SFML 顶点 + /*path.emplace_back(sf::Vertex( + sf::Vector2f(static_cast(points[index].x()), + static_cast(points[index].y())), + sf::Color::Red + ));*/ + path.emplace_back(points[index]); + + BridgeMap* bridge = nullptr; + //判断该点是否为桥接点 + for (auto& bm : bridges) { + if (equal(bm.from, points[index]) || equal(bm.from2, points[index])) { + bridge = &bm; + break; + } + } + if (bridge != nullptr) { + RingNode& rn = findNode(bridge->to_ii); //to 环 + if (equal(bridge->from, points[index])) { + traverseRing(rn, node.id, bridge->to, bridge->to2, false); + index = findIndex(points, bridge->from2); + } + else if (equal(bridge->from2, points[index])) { + traverseRing(rn, node.id, bridge->to2, bridge->to, false); + index = findIndex(points, bridge->from); + } + if (index == -1) + break; + /* path.emplace_back(sf::Vertex( + sf::Vector2f(static_cast(points[index].x()), + static_cast(points[index].y())), + sf::Color::Red + ));*/ + path.emplace_back(points[index]); + } + index += isOutermostLayer ? -1 : 1; + } while (index > 0 && index < points.size()); + + +} + +//画路径 SFML顶点数组集 +//std::vector Bridge::outputPaths() +//{ +// printTree(); +// //第一个桥接边 +// BridgeMap bm = bridges[0]; +// IdIndex parent(1, 1); +// //遍历 +// traverseRing(findNode(bm.from_ii), parent, bm.from, bm.from2, true); +// //形成闭环 +// path.emplace_back(sf::Vertex( +// sf::Vector2f(static_cast(bm.from.x()), +// static_cast(bm.from.y())), +// sf::Color::Red +// )); +// return path; +// +//} + +// 将 Boost 多边形转换为 SFML 顶点数组 +//sf::VertexArray Bridge::convertToSFML(const Polygon_t& poly, const sf::Color& color) +//{ +// sf::VertexArray vertices(sf::LineStrip); +// +// // 外环 +// for (const auto& pt : poly.outer()) { +// vertices.append(sf::Vertex( +// sf::Vector2f(static_cast(pt.x()), +// static_cast(pt.y())), +// color +// )); +// } +// return vertices; +//} + +//所有环转换成顶点数组集 +//std::vector Bridge::convert2vertex() +//{ +// std::vector verteies; +// for (const auto& map : ringNodes) { +// for (const auto& m : map.second) { +// if (m.isHide) continue; +// Polygon_t poly; +// bg::assign(poly, m.ring); +// verteies.push_back(convertToSFML(poly, sf::Color::Red)); +// } +// } +// return verteies; +//} + +//std::vector Bridge::convertBridge() +//{ +// std::vector verteies; +// for (const auto& map : bridges) { +// sf::VertexArray arr(sf::LineStrip); +// arr.append(sf::Vertex( +// sf::Vector2f(static_cast(map.from.x()), +// static_cast(map.from.y())), +// sf::Color::White +// )); +// arr.append(sf::Vertex( +// sf::Vector2f(static_cast(map.to.x()), +// static_cast(map.to.y())), +// sf::Color::White +// )); +// sf::VertexArray arr1(sf::LineStrip); +// arr1.append(sf::Vertex( +// sf::Vector2f(static_cast(map.from2.x()), +// static_cast(map.from2.y())), +// sf::Color::White +// )); +// arr1.append(sf::Vertex( +// sf::Vector2f(static_cast(map.to2.x()), +// static_cast(map.to2.y())), +// sf::Color::White +// )); +// verteies.push_back(arr); +// verteies.push_back(arr1); +// } +// return verteies; +//} + + + + + + + + + +} // namespace Slic3r + + diff --git a/src/libslic3r/Fill/Bridge.hpp b/src/libslic3r/Fill/Bridge.hpp new file mode 100644 index 000000000..4ca04c6fa --- /dev/null +++ b/src/libslic3r/Fill/Bridge.hpp @@ -0,0 +1,230 @@ +// +// Created by ylzha on 2025/2/25. +// +#ifndef slic3r_Bridge_hpp_ +#define slic3r_Bridge_hpp_ + +#include "../libslic3r.h" +#include + +#include "FillBase.hpp" + +namespace bg = boost::geometry; + +namespace Slic3r{ + +class Surface; + +// 定义点类型 +typedef bg::model::d2::point_xy Point_t; + +//定义线段 +typedef bg::model::segment Segment; + +// 定义多边形类型 +typedef bg::model::polygon Polygon_t; + +// 多边形集合 +typedef bg::model::multi_polygon MultiPolygon; + +// 定义环类型 +typedef bg::model::ring Ring; + +// 定义折线类型(用于表示直线) +typedef bg::model::linestring Linestring; + + +// 定义多边形的外边界和内边界 +struct PolygonBoundaries { + Ring outerBoundary; // 外边界 + std::vector innerBoundaries; // 内边界(可能有多个) +}; + +struct IdIndex { + size_t id{}; + size_t index{}; + // 定义小于运算符 + bool operator<(const IdIndex& other) const { + return id < other.id; + } + IdIndex(const size_t id, const size_t index) : id(id), index(index) {} + + bool operator==(const IdIndex& ii) const { + return id == ii.id && index == ii.index; + } +}; + +//环路径树结构中节点类型 +struct RingNode { + IdIndex id; + Ring ring; //当前环 + int orientation{}; //方向 -1 向内 1 向外 + std::vector children; //子节点集 + RingNode* parent; //父节点 + bool isHide{ false }; //在最终路径中是否呈现 false 呈现 true 不呈现 + + // 构造函数,方便初始化 + RingNode(const IdIndex id, const Ring& ring, const int orientation = 0) + : id(id), ring(ring), orientation(orientation), parent(nullptr) { + } + + // 重载==运算符方便比较 + bool operator==(const RingNode& other) const { + return id.id == other.id.id && id.index == other.id.index; + } + +}; + +//桥接映射 +struct BridgeMap { + Point_t from; + Point_t to; + Point_t from2; + Point_t to2; + IdIndex from_ii; + IdIndex to_ii; + size_t edge_index; + BridgeMap(Point_t from, Point_t to, Point_t from2, Point_t to2, IdIndex from_ii, IdIndex to_ii, size_t edge_index) : + from(from), to(to), from2(from2), to2(to2), from_ii(from_ii), to_ii(to_ii), edge_index(edge_index) { } +}; + +//合并映射 +struct MergeMap { + IdIndex ii1; //环1 + IdIndex ii2; //环2 + std::vector nodes; //产生的环集 + // 构造函数 + MergeMap(const IdIndex& i1, const IdIndex& i2, const std::vector& nodeList) + : ii1(i1), ii2(i2), nodes(nodeList) { + } +}; + + +//struct PointHash { +// std::size_t operator()(const Point_t& p) const { +// std::size_t seed = 0; +// boost::hash_combine(seed, bg::get<0>(p)); +// boost::hash_combine(seed, bg::get<1>(p)); +// return seed; +// } +//}; + +//struct PointEqual { +// bool operator()(const Point_t& a, const Point_t& b) const { +// return bg::equals(a, b); +// } +//}; + +struct PointIndex { + size_t index0; + size_t index1; + Point_t point0; + Point_t point1; + + PointIndex(const size_t index0, const size_t index1, const Point_t point0, const Point_t point1) : + index0(index0), index1(index1), point0(point0), point1(point1) { } +}; + +class Bridge : public Fill { +public: + ~Bridge() override = default; + bool is_self_crossing() override { return false; } +protected: + Fill* clone() const override { return new Bridge(*this); } + Polylines fill_surface(const Surface* surface, const FillParams& params) override; +private: + //计算多边形的外边界和内边界 + void computePolygonBoundaries(const Polygon_t& polygon); + + // 判断两个环是否相交(不包括包含关系) + bool ringsIntersect(const Ring& ring1, const Ring& ring2); + + //获取环偏移后的环(可能为空) + std::vector offsetRing(const Ring& ring, double distance); + + // 查找环非邻边的相交点 + std::vector findNonAdjacentIntersections(const Ring& ring); + // 将环拆分成多个环 + std::vector split(const Ring& ring, const std::vector& intersections); + // 合并两个环 + std::vector merge(const RingNode& ring1, const RingNode& ring2); + //生成环集 + void generateRings(); + //形成节点 + RingNode formatNode(size_t id, size_t index, const Ring& ring, int orientation); + void addNode(RingNode& node); + void removeNode(IdIndex id); + //查找节点 + RingNode& findNode(IdIndex ii); + //形成树 + void formatTree(); + // 深度优先搜索遍历树 + void dfs(RingNode& node, std::vector& visited, size_t& edge); + + //找到多边形环第 N 条边的中心点 + Point_t findCenterPointOnEdge(Ring& ring, size_t N, double d0, size_t& e_index); + + // 在环上按顺时针方向查找距离给定点d的另一个点 + Point_t find_point_at_distance_clockwise(Ring& ring, const Point_t& start_point, double d, size_t& e_index); + + size_t findLongestEdgeIndex(const Ring& ring); + + //在第N条边上进行内外环桥接,并插入桥接点 + //o_ii 外环IdIndex i_ii 内环IdIndex + void handleBridge(IdIndex o_ii, IdIndex i_ii, double _offset); + + //递归遍历环 + void traverseRing( + RingNode& node, + IdIndex parent, + Point_t& start, + Point_t& end, + bool isOutermostLayer //是否最外层 + ); + + //输出所有环 + void printRings(); + + //sf::VertexArray convertToSFML(const Polygon_t& poly, const sf::Color& color); + + + + + +public: + + //输出树结构 + void printTree(); + //画路径 SFML顶点数组集 + //std::vector outputPaths(); + + //std::vector convert2vertex(); + //std::vector verteies; + //std::vector convertBridge(); + + +private: + + size_t maxRid = 1; //最大环类型ID值 + double offset; //偏移距离 + Polygon_t polygon; //2D多边形 + double area_threshold; //面积阈值 + + PolygonBoundaries boundaries; //外/内边界 + std::map> ringNodes; //存储不同环类型的节点集合 size_t 环类型id + std::vector nodeHandles; //当前需进行自交或互交处理的节点集合 + std::map> splitMap; //分裂映射集 + std::vector mergeMap; //合并映射集 + std::map> offsetMap; //偏移后产生的分裂映射集 + + std::vector bridges; //桥接映射 + + //std::vector path; // 路径 + std::vector path; // 路径 + bool isFront{ false }; + size_t sel_edge_index{ 1 }; //选择桥接边的索引 + + +}; +}; // namespace Slic3r +#endif // slic3r_Bridge_hpp_ diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 4804107cd..612fc87c3 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -684,7 +684,9 @@ Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Oc case ipArchimedeanChords: case ipOctagramSpiral: case ipZigZag: - case ipCrossZag: break; + case ipCrossZag: + case ipFiberSpiral: + break; } // Create the filler object. diff --git a/src/libslic3r/Fill/FillBase.cpp b/src/libslic3r/Fill/FillBase.cpp index d0e8efb95..349b836c1 100644 --- a/src/libslic3r/Fill/FillBase.cpp +++ b/src/libslic3r/Fill/FillBase.cpp @@ -25,6 +25,7 @@ #include "FillConcentricInternal.hpp" #include "FillCrossHatch.hpp" #include "FillFloatingConcentric.hpp" +#include "Bridge.hpp" // #define INFILL_DEBUG_OUTPUT @@ -60,6 +61,7 @@ Fill* Fill::new_from_type(const InfillPattern type) case ipZigZag: return new FillZigZag(); case ipCrossZag: return new FillCrossZag(); case ipFloatingConcentric: return new FillFloatingConcentric(); + case ipFiberSpiral: return new FillLine(); default: throw Slic3r::InvalidArgument("unknown type"); } } diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index da117e178..520fa150c 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4655,7 +4655,7 @@ double GCode::get_path_speed(const ExtrusionPath &path) // cap speed with max_volumetric_speed anyway (even if user is not using autospeed) speed = std::min(speed, extrude_speed); } - + //speed = m_config.get_abs_value("default_print_speed"); return speed; } @@ -5799,6 +5799,9 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string // No extra movements emitted by avoid_crossing_perimeters, simply move to the end point with z change const auto &dest2d = this->point_to_gcode(travel.points.back()); Vec3d dest3d(dest2d(0), dest2d(1), z == DBL_MAX ? m_nominal_z : z); + //zheli**************************************************************************** + //******************************************************************************* + //auto dE = m_extruder->E(); gcode += m_writer.travel_to_xyz(dest3d, comment); } else { // Extra movements emitted by avoid_crossing_perimeters, lift the z to normal height at the beginning, then apply the z diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 771445d2e..127369743 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -551,6 +551,7 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co m_lifted = 0.; //BBS this->set_current_position_clear(true); + //return this->travel_to_xy_test(to_2d(point)); return this->travel_to_xy(to_2d(point)); } else { diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index c8e53fc0a..0e37d0b39 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -381,6 +381,8 @@ std::string Preset::get_type_string(Preset::Type type) return "physical_printer"; case Preset::Type::TYPE_INVALID: return "invalid"; + case Preset::Type::TYPE_CONFIG: + return PRESET_CONFIG_NAME; default: return "invalid"; } @@ -859,7 +861,7 @@ static std::vector s_Preset_print_options { #endif /* HAS_PRESSURE_EQUALIZER */ "inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed", "top_surface_speed", "support_speed", "support_object_xy_distance", "support_object_first_layer_gap","support_interface_speed", - "bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration", + "bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration","default_print_speed", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "travel_acceleration", "initial_layer_travel_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration", "accel_to_decel_enable", "accel_to_decel_factor", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield", @@ -1058,6 +1060,9 @@ static std::vector s_Preset_sla_printer_options { "min_initial_exposure_time", "max_initial_exposure_time", "inherits" }; +static std::vector s_Preset_config_options{ + "initial_layer_line_width","outer_wall_line_width","inner_wall_line_width","top_surface_line_width","sparse_infill_line_width","support_line_width","resolution","wall_sequence" +}; const std::vector& Preset::print_options() { return s_Preset_print_options; } const std::vector& Preset::filament_options() { return s_Preset_filament_options; } @@ -1068,6 +1073,7 @@ const std::vector& Preset::nozzle_options() { return print_ const std::vector& Preset::sla_print_options() { return s_Preset_sla_print_options; } const std::vector& Preset::sla_material_options() { return s_Preset_sla_material_options; } const std::vector& Preset::sla_printer_options() { return s_Preset_sla_printer_options; } +const std::vector& Preset::config_options() { return s_Preset_print_options; } const std::vector& Preset::printer_options() { @@ -3116,6 +3122,7 @@ std::string PresetCollection::name() const //case Preset::TYPE_SLA_PRINT: return L("SLA print"); //case Preset::TYPE_SLA_MATERIAL: return L("SLA material"); case Preset::TYPE_PRINTER: return L(PRESET_PRINTER_NAME); + case Preset::TYPE_CONFIG: return L(PRESET_CONFIG_NAME); default: return "invalid"; } } @@ -3129,6 +3136,7 @@ std::string PresetCollection::section_name() const //case Preset::TYPE_SLA_PRINT: return PRESET_SLA_PRINT_NAME; //case Preset::TYPE_SLA_MATERIAL: return PRESET_SLA_MATERIALS_NAME; case Preset::TYPE_PRINTER: return PRESET_PRINTER_NAME; + case Preset::TYPE_CONFIG: return PRESET_CONFIG_NAME; default: return "invalid"; } } diff --git a/src/libslic3r/Preset.hpp b/src/libslic3r/Preset.hpp index abcfc2368..ffa53db77 100644 --- a/src/libslic3r/Preset.hpp +++ b/src/libslic3r/Preset.hpp @@ -26,11 +26,14 @@ #define PRESET_PROFILES_TEMOLATE_DIR "profiles_template" #define PRESET_TEMPLATE_DIR "Template" #define PRESET_CUSTOM_VENDOR "Custom" +#define PRESET_CONFIG_NAME "config" + //BBS: iot preset type strings #define PRESET_IOT_PRINTER_TYPE "printer" #define PRESET_IOT_FILAMENT_TYPE "filament" #define PRESET_IOT_PRINT_TYPE "print" +#define PRESET_IOT_CONFIG_TYPE "config" //BBS: add json support @@ -180,6 +183,7 @@ public: TYPE_FILAMENT, TYPE_SLA_MATERIAL, TYPE_PRINTER, + TYPE_CONFIG, TYPE_COUNT, // This type is here to support PresetConfigSubstitutions for physical printers, however it does not belong to the Preset class, // PhysicalPrinter class is used instead. @@ -340,6 +344,7 @@ public: static const std::vector& sla_printer_options(); static const std::vector& sla_material_options(); static const std::vector& sla_print_options(); + static const std::vector& config_options(); static void update_suffix_modified(const std::string& new_suffix_modified); static const std::string& suffix_modified(); diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index a14fba8b9..d75d48885 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -61,6 +61,7 @@ PresetBundle::PresetBundle() , sla_materials(Preset::TYPE_SLA_MATERIAL, Preset::sla_material_options(), static_cast(SLAFullPrintConfig::defaults())) , sla_prints(Preset::TYPE_SLA_PRINT, Preset::sla_print_options(), static_cast(SLAFullPrintConfig::defaults())) , printers(Preset::TYPE_PRINTER, Preset::printer_options(), static_cast(FullPrintConfig::defaults()), "Default Printer") + , configs(Preset::TYPE_CONFIG, Preset::config_options(), static_cast(FullPrintConfig::defaults()), "Default Config") , physical_printers(PhysicalPrinter::printer_options()) { // The following keys are handled by the UI, they do not have a counterpart in any StaticPrintConfig derived classes, @@ -114,7 +115,7 @@ PresetBundle::PresetBundle() this->filaments.select_preset(0); this->sla_materials.select_preset(0); this->printers.select_preset(0); - + this->configs.select_preset(0); this->project_config.apply_only(FullPrintConfig::defaults(), s_project_options); } @@ -131,6 +132,7 @@ PresetBundle& PresetBundle::operator=(const PresetBundle &rhs) sla_materials = rhs.sla_materials; printers = rhs.printers; physical_printers = rhs.physical_printers; + configs = rhs.configs; filament_presets = rhs.filament_presets; project_config = rhs.project_config; @@ -143,6 +145,7 @@ PresetBundle& PresetBundle::operator=(const PresetBundle &rhs) filaments .update_vendor_ptrs_after_copy(this->vendors); sla_materials.update_vendor_ptrs_after_copy(this->vendors); printers .update_vendor_ptrs_after_copy(this->vendors); + configs.update_vendor_ptrs_after_copy(this->vendors); return *this; } @@ -156,6 +159,7 @@ void PresetBundle::reset(bool delete_files) this->filaments .reset(delete_files); this->sla_materials.reset(delete_files); this->printers .reset(delete_files); + this->configs.reset(delete_files); // BBS: filament_presets is load from project config, not handled here //this->filament_presets.clear(); if (this->filament_presets.empty()) @@ -165,6 +169,7 @@ void PresetBundle::reset(bool delete_files) this->obsolete_presets.filaments.clear(); this->obsolete_presets.sla_materials.clear(); this->obsolete_presets.printers.clear(); + this->obsolete_presets.configs.clear(); } void PresetBundle::setup_directories() @@ -228,7 +233,8 @@ void PresetBundle::copy_files(const std::string& from) // Store the print/filament/printer presets at the same location as the upstream Slic3r. from_data_dir / PRESET_PRINT_NAME, from_data_dir / PRESET_FILAMENT_NAME, - from_data_dir / PRESET_PRINTER_NAME + from_data_dir / PRESET_PRINTER_NAME, + from_data_dir / PRESET_CONFIG_NAME }; // copy recursively all files //BBS: change directoties by design @@ -287,6 +293,9 @@ Preset* PresetBundle::get_preset_differed_for_save(Preset& preset) case Preset::TYPE_FILAMENT: preset_collection = &(this->filaments); break; + case Preset::TYPE_CONFIG: + preset_collection = &(this->configs); + break; default: BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" invalid type %1%, return directly")%preset.type; return nullptr; @@ -309,6 +318,9 @@ int PresetBundle::get_differed_values_to_update(Preset& preset, std::mapfilaments); break; + case Preset::TYPE_CONFIG: + preset_collection = &(this->configs); + break; default: BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" invalid type %1%, return directly")%preset.type; return -1; @@ -385,6 +397,12 @@ PresetsConfigSubstitutions PresetBundle::load_project_embedded_presets(std::vect } catch (const std::runtime_error &err) { errors_cummulative += err.what(); } + try { + this->configs.load_project_embedded_presets(project_presets, PRESET_CONFIG_NAME, substitutions, substitution_rule); + } + catch (const std::runtime_error& err) { + errors_cummulative += err.what(); + } //this->update_multi_material_filament_presets(); //this->update_compatible(PresetSelectCompatibleType::Never); @@ -410,6 +428,9 @@ std::vector PresetBundle::get_current_project_embedded_presets() auto printer_presets = this->printers.get_project_embedded_presets(); if (!printer_presets.empty()) std::copy(printer_presets.begin(), printer_presets.end(), std::back_inserter(project_presets)); + auto config_presets = this->configs.get_project_embedded_presets(); + if (!config_presets.empty()) + std::copy(config_presets.begin(), config_presets.end(), std::back_inserter(project_presets)); BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" finished, returned project_presets count %1%")%project_presets.size(); return project_presets; @@ -428,6 +449,7 @@ void PresetBundle::reset_project_embedded_presets() bool printer_reselect = this->printers.reset_project_embedded_presets(); bool filament_reselect = this->filaments.reset_project_embedded_presets(); bool print_reselect = this->prints.reset_project_embedded_presets(); + bool config_reselect = this->configs.reset_project_embedded_presets(); if (printer_reselect) { if (!prefer_printer.empty()) @@ -438,7 +460,7 @@ void PresetBundle::reset_project_embedded_presets() //this->update_multi_material_filament_presets(); this->update_compatible(PresetSelectCompatibleType::Never); } - else if (filament_reselect || print_reselect) { + else if (filament_reselect || print_reselect || config_reselect) { //Preset& current_printer = this->printers.get_selected_preset(); /*if (filament_reselect) { const std::vector &prefered_filament_profiles = current_printer.config.option("default_filament_profile")->values; @@ -592,6 +614,14 @@ PresetsConfigSubstitutions PresetBundle::load_user_presets(std::string user, For } catch (const std::runtime_error &err) { errors_cummulative += err.what(); } + try { + std::string config_selected_preset_name = configs.get_selected_preset().name; + this->configs.load_presets(dir_user_presets, PRESET_CONFIG_NAME, substitutions, substitution_rule); + configs.select_preset_by_name(config_selected_preset_name, false); + } + catch (const std::runtime_error& err) { + errors_cummulative += err.what(); + } if (!errors_cummulative.empty()) throw Slic3r::RuntimeError(errors_cummulative); this->update_multi_material_filament_presets(); this->update_compatible(PresetSelectCompatibleType::Never); @@ -608,7 +638,7 @@ PresetsConfigSubstitutions PresetBundle::load_user_presets(AppConfig & // First load the vendor specific system presets. PresetsConfigSubstitutions substitutions; std::string errors_cummulative; - bool process_added = false, filament_added = false, machine_added = false; + bool process_added = false, filament_added = false, machine_added = false, config_added = false; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" enter, substitution_rule %1%, preset toltal count %2%")%substitution_rule%my_presets.size(); BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" print's selected_idx %1%, selected_name %2%") %prints.get_selected_idx() %prints.get_selected_preset_name(); @@ -648,6 +678,10 @@ PresetsConfigSubstitutions PresetBundle::load_user_presets(AppConfig & preset_collection = &(this->printers); machine_added |= preset_collection->load_user_preset(name, value_map, substitutions, substitution_rule); } + else if (type_iter->second == PRESET_IOT_CONFIG_TYPE) { + preset_collection = &(this->configs); + config_added |= preset_collection->load_user_preset(name, value_map, substitutions, substitution_rule); + } else { BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format("invalid type %1% for setting %2%") %type_iter->second %name; continue; @@ -890,6 +924,7 @@ void PresetBundle::save_user_presets(AppConfig& config, std::vector this->prints.save_user_presets(dir_user_presets, PRESET_PRINT_NAME, need_to_delete_list); this->filaments.save_user_presets(dir_user_presets, PRESET_FILAMENT_NAME, need_to_delete_list); this->printers.save_user_presets(dir_user_presets, PRESET_PRINTER_NAME, need_to_delete_list); + this->configs.save_user_presets(dir_user_presets, PRESET_CONFIG_NAME, need_to_delete_list); BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" finished"); } @@ -912,6 +947,7 @@ void PresetBundle::update_user_presets_directory(const std::string preset_folder this->prints.update_user_presets_directory(dir_user_presets, PRESET_PRINT_NAME); this->filaments.update_user_presets_directory(dir_user_presets, PRESET_FILAMENT_NAME); this->printers.update_user_presets_directory(dir_user_presets, PRESET_PRINTER_NAME); + this->configs.update_user_presets_directory(dir_user_presets, PRESET_CONFIG_NAME); BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" finished"); } @@ -1401,15 +1437,18 @@ std::vector PresetBundle::merge_presets(PresetBundle &&other) std::vector duplicate_filaments = this->filaments .merge_presets(std::move(other.filaments), this->vendors); std::vector duplicate_sla_materials = this->sla_materials.merge_presets(std::move(other.sla_materials), this->vendors); std::vector duplicate_printers = this->printers .merge_presets(std::move(other.printers), this->vendors); + std::vector duplicate_configs = this->configs.merge_presets(std::move(other.configs), this->vendors); append(this->obsolete_presets.prints, std::move(other.obsolete_presets.prints)); append(this->obsolete_presets.sla_prints, std::move(other.obsolete_presets.sla_prints)); append(this->obsolete_presets.filaments, std::move(other.obsolete_presets.filaments)); append(this->obsolete_presets.sla_materials, std::move(other.obsolete_presets.sla_materials)); append(this->obsolete_presets.printers, std::move(other.obsolete_presets.printers)); + append(this->obsolete_presets.configs, std::move(other.obsolete_presets.configs)); append(duplicate_prints, std::move(duplicate_sla_prints)); append(duplicate_prints, std::move(duplicate_filaments)); append(duplicate_prints, std::move(duplicate_sla_materials)); append(duplicate_prints, std::move(duplicate_printers)); + append(duplicate_configs, std::move(duplicate_configs)); return duplicate_prints; } @@ -1421,10 +1460,13 @@ void PresetBundle::update_system_maps() this->sla_materials.update_map_system_profile_renamed(); this->printers .update_map_system_profile_renamed(); + this->configs .update_map_system_profile_renamed(); + this->prints .update_map_alias_to_profile_name(); this->sla_prints .update_map_alias_to_profile_name(); this->filaments .update_map_alias_to_profile_name(); this->sla_materials.update_map_alias_to_profile_name(); + this->configs.update_map_alias_to_profile_name(); } static inline std::string remove_ini_suffix(const std::string &name) @@ -1444,7 +1486,12 @@ void PresetBundle::load_installed_printers(const AppConfig &config) for (auto &preset : printers) preset.set_visible_from_appconfig(config); } - +void PresetBundle::load_installed_configs(const AppConfig& config) +{ + this->update_system_maps(); + for (auto& preset : configs) + preset.set_visible_from_appconfig(config); +} const std::string& PresetBundle::get_preset_name_by_alias( const Preset::Type& preset_type, const std::string& alias) const { // there are not aliases for Printers profiles @@ -1454,6 +1501,7 @@ const std::string& PresetBundle::get_preset_name_by_alias( const Preset::Type& p const PresetCollection& presets = preset_type == Preset::TYPE_PRINT ? prints : preset_type == Preset::TYPE_SLA_PRINT ? sla_prints : preset_type == Preset::TYPE_FILAMENT ? filaments : + preset_type == Preset::TYPE_CONFIG ? configs : sla_materials; return presets.get_preset_name_by_alias(alias); @@ -1488,7 +1536,8 @@ void PresetBundle::save_changes_for_preset(const std::string& new_name, Preset:: PresetCollection& presets = type == Preset::TYPE_PRINT ? prints : type == Preset::TYPE_SLA_PRINT ? sla_prints : type == Preset::TYPE_FILAMENT ? filaments : - type == Preset::TYPE_SLA_MATERIAL ? sla_materials : printers; + type == Preset::TYPE_SLA_MATERIAL ? sla_materials : + type == Preset::TYPE_CONFIG ? configs : printers; // if we want to save just some from selected options if (!unselected_options.empty()) { @@ -1604,6 +1653,7 @@ void PresetBundle::load_selections(AppConfig &config, const PresetPreferences& p // Update visibility of filament and sla material presets this->load_installed_filaments(config); this->load_installed_sla_materials(config); + this->load_installed_configs(config); // Parse the initial print / filament / printer profile names. std::string initial_print_profile_name = remove_ini_suffix(config.get("presets", PRESET_PRINT_NAME)); @@ -1611,6 +1661,7 @@ void PresetBundle::load_selections(AppConfig &config, const PresetPreferences& p std::string initial_filament_profile_name = remove_ini_suffix(config.get("presets", PRESET_FILAMENT_NAME)); std::string initial_sla_material_profile_name = remove_ini_suffix(config.get("presets", PRESET_SLA_MATERIALS_NAME)); std::string initial_printer_profile_name = remove_ini_suffix(config.get("presets", PRESET_PRINTER_NAME)); + std::string initial_config_profile_name = remove_ini_suffix(config.get("presets", PRESET_CONFIG_NAME)); // Activate print / filament / printer profiles from either the config, // or from the preferred_model_id suggestion passed in by ConfigWizard. @@ -1641,6 +1692,7 @@ void PresetBundle::load_selections(AppConfig &config, const PresetPreferences& p filaments.select_preset_by_name_strict(initial_filament_profile_name); sla_prints.select_preset_by_name_strict(initial_sla_print_profile_name); sla_materials.select_preset_by_name_strict(initial_sla_material_profile_name); + configs.select_preset_by_name_strict(initial_config_profile_name); // Load the names of the other filament profiles selected for a multi-material printer. // Load it even if the current printer technology is SLA. @@ -2404,6 +2456,7 @@ DynamicPrintConfig PresetBundle::full_fff_config(bool apply_extruder, std::optio // Add the default filament preset to have the "filament_preset_id" defined. out.apply(this->filaments.default_preset().config); out.apply(this->printers.get_edited_preset().config); + out.apply(this->configs.get_edited_preset().config); out.apply(this->project_config); // BBS diff --git a/src/libslic3r/PresetBundle.hpp b/src/libslic3r/PresetBundle.hpp index 10b0c79c9..3c99fcf50 100644 --- a/src/libslic3r/PresetBundle.hpp +++ b/src/libslic3r/PresetBundle.hpp @@ -166,6 +166,7 @@ public: PresetCollection prints; PresetCollection sla_prints; PresetCollection filaments; + PresetCollection configs; PresetCollection sla_materials; PresetCollection& materials(PrinterTechnology pt) { return pt == ptFFF ? this->filaments : this->sla_materials; } const PresetCollection& materials(PrinterTechnology pt) const { return pt == ptFFF ? this->filaments : this->sla_materials; } @@ -199,11 +200,12 @@ public: std::vector filaments; std::vector sla_materials; std::vector printers; + std::vector configs; }; ObsoletePresets obsolete_presets; bool has_defauls_only() const - { return prints.has_defaults_only() && filaments.has_defaults_only() && printers.has_defaults_only(); } + { return prints.has_defaults_only() && filaments.has_defaults_only() && printers.has_defaults_only() && configs.has_defaults_only();} DynamicPrintConfig full_config(bool apply_extruder = true, std::optional>filament_maps = std::nullopt) const; // full_config() with the some "useless" config removed. @@ -287,6 +289,7 @@ public: // based on the user configuration. // If the "vendor" section is missing, enable all models and variants of the particular vendor. void load_installed_printers(const AppConfig &config); + void load_installed_configs(const AppConfig& config); const std::string& get_preset_name_by_alias(const Preset::Type& preset_type, const std::string& alias) const; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 4b48dc339..0cc855577 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -157,7 +157,9 @@ static t_config_enum_values s_keys_map_InfillPattern { { "lightning", ipLightning }, { "crosshatch", ipCrossHatch}, { "zigzag", ipZigZag }, - { "crosszag", ipCrossZag } + { "crosszag", ipCrossZag }, + //xiamian+ + { "fiberspiral", ipFiberSpiral } }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(InfillPattern) @@ -1155,7 +1157,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.emplace_back(L("No-brim")); def->mode = comSimple; - def->set_default_value(new ConfigOptionEnum(btAutoBrim)); + def->set_default_value(new ConfigOptionEnum(btOuterOnly)); def = this->add("brim_object_gap", coFloat); def->label = L("Brim-object gap"); @@ -1425,6 +1427,7 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("hilbertcurve"); def->enum_values.push_back("archimedeanchords"); def->enum_values.push_back("octagramspiral"); + def->enum_values.push_back("fiberspiral"); def->enum_labels.push_back(L("Concentric")); def->enum_labels.push_back(L("Rectilinear")); def->enum_labels.push_back(L("Monotonic")); @@ -1433,6 +1436,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Hilbert Curve")); def->enum_labels.push_back(L("Archimedean Chords")); def->enum_labels.push_back(L("Octagram Spiral")); + def->enum_labels.push_back(L("Fiber Spiral")); def->set_default_value(new ConfigOptionEnum(ipRectilinear)); def = this->add("bottom_surface_pattern", coEnum); @@ -2060,6 +2064,7 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("crosshatch"); def->enum_values.push_back("zigzag"); def->enum_values.push_back("crosszag"); + def->enum_values.push_back("fiberspiral"); def->enum_labels.push_back(L("Concentric")); def->enum_labels.push_back(L("Rectilinear")); def->enum_labels.push_back(L("Grid")); @@ -2080,6 +2085,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Cross Hatch")); def->enum_labels.push_back(L("Zig Zag")); def->enum_labels.push_back(L("Cross Zag")); + def->enum_labels.push_back(L("Fiber Spiral")); def->set_default_value(new ConfigOptionEnum(ipCubic)); def = this->add("top_surface_acceleration", coFloats); @@ -2224,6 +2230,14 @@ void PrintConfigDef::init_fff_params() // "Note that this option only takes effect if no prime tower is generated in current plate."); //def->set_default_value(new ConfigOptionBool(0)); + def = this->add("default_print_speed", coFloat); + def->label = L("Default print speed"); + //def->tooltip = L("Speed of initial layer except the solid infill part"); + def->sidetext = L("mm/s"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(30)); + def = this->add("initial_layer_speed", coFloats); def->label = L("Initial layer"); def->tooltip = L("Speed of initial layer except the solid infill part"); @@ -3613,7 +3627,7 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->max = 10; def->mode = comSimple; - def->set_default_value(new ConfigOptionInt(1)); + def->set_default_value(new ConfigOptionInt(2)); def = this->add("slow_down_layer_time", coInts); def->label = L("Layer time"); @@ -5488,6 +5502,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va } else if (opt_key == "support_material_enforce_layers") { opt_key = "enforce_support_layers"; } else if ((opt_key == "initial_layer_print_height" || + opt_key == "default_print_speed" || opt_key == "initial_layer_speed" || opt_key == "internal_solid_infill_speed" || opt_key == "top_surface_speed" || diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index a3065a28d..20a90d9fc 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -56,6 +56,8 @@ enum InfillPattern : int { ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipSupportCubic, ipSupportBase, ipConcentricInternal, ipLightning, ipCrossHatch, ipZigZag, ipCrossZag,ipFloatingConcentric, ipCount, + //xiamian+ + ipFiberSpiral }; enum EnsureVerticalThicknessLevel{ @@ -1180,6 +1182,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, initial_layer_line_width)) ((ConfigOptionFloat, initial_layer_print_height)) ((ConfigOptionFloatsNullable, initial_layer_speed)) + ((ConfigOptionFloat, default_print_speed)) //BBS ((ConfigOptionFloatsNullable, initial_layer_infill_speed)) ((ConfigOptionIntsNullable, nozzle_temperature_initial_layer)) diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index 8749acea5..0252b5a5e 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -47,9 +47,11 @@ void AMSMaterialsSetting::create() m_button_confirm = new Button(this, _L("Confirm")); m_btn_bg_green = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_confirm->SetBackgroundColor(m_btn_bg_green); - m_button_confirm->SetBorderColor(wxColour(0, 174, 66)); + //m_button_confirm->SetBorderColor(wxColour(0x9A5F21)); + m_button_confirm->SetBorderColor(wxColour(0x9A5F21)); m_button_confirm->SetTextColor(wxColour("#FFFFFE")); m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE); m_button_confirm->SetCornerRadius(FromDIP(12)); @@ -151,7 +153,8 @@ void AMSMaterialsSetting::create_panel_normal(wxWindow* parent) // make the style the same with disable m_input_k_val, FIXME m_readonly_filament = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, AMS_MATERIALS_SETTING_COMBOX_WIDTH, wxTE_CENTRE | wxTE_PROCESS_ENTER); - m_readonly_filament->SetBorderColor(StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Focused), std::make_pair(0x00AE42, (int)StateColor::Hovered), + //m_readonly_filament->SetBorderColor(StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Focused), std::make_pair(0x00AE42, (int)StateColor::Hovered), + m_readonly_filament->SetBorderColor(StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Focused), std::make_pair(0x215F9A, (int)StateColor::Hovered), std::make_pair(0xDBDBDB, (int)StateColor::Normal))); m_readonly_filament->SetFont(::Label::Body_14); m_readonly_filament->SetLabelColor(AMS_MATERIALS_SETTING_GREY800); @@ -1182,7 +1185,8 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt) } else { m_button_confirm->SetBackgroundColor(m_btn_bg_green); - m_button_confirm->SetBorderColor(wxColour(0, 174, 66)); + //m_button_confirm->SetBorderColor(wxColour(0x9A5F21)); + m_button_confirm->SetBorderColor(wxColour(0x9A5F21)); m_button_confirm->SetTextColor(wxColour("#FFFFFE")); m_button_confirm->Enable(true); } diff --git a/src/slic3r/GUI/AmsMappingPopup.cpp b/src/slic3r/GUI/AmsMappingPopup.cpp index a85430b2b..b2d79d401 100644 --- a/src/slic3r/GUI/AmsMappingPopup.cpp +++ b/src/slic3r/GUI/AmsMappingPopup.cpp @@ -2194,7 +2194,8 @@ void AmsReplaceMaterialDialog::create() std::pair(wxColour(38, 46, 48), StateColor::Enabled)); - StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Normal)); + StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_sizer->Add( 0, 0, 1, wxEXPAND, 0 ); m_main_sizer->Add(0,0,0, wxTOP, FromDIP(12)); diff --git a/src/slic3r/GUI/Auxiliary.hpp b/src/slic3r/GUI/Auxiliary.hpp index 731c61225..92d21a466 100644 --- a/src/slic3r/GUI/Auxiliary.hpp +++ b/src/slic3r/GUI/Auxiliary.hpp @@ -51,7 +51,8 @@ #define AUFILE_GREY500 wxColour(158, 158, 158) #define AUFILE_GREY300 wxColour(238, 238, 238) #define AUFILE_GREY200 wxColour(248, 248, 248) -#define AUFILE_BRAND wxColour(0, 174, 66) +//#define AUFILE_BRAND wxColour(0x9A5F21) +#define AUFILE_BRAND wxColour(0x9A5F21) #define AUFILE_BRAND_TRANSPARENT wxColour(215, 232, 222) //#define AUFILE_PICTURES_SIZE wxSize(FromDIP(300), FromDIP(300)) //#define AUFILE_PICTURES_PANEL_SIZE wxSize(FromDIP(300), FromDIP(340)) diff --git a/src/slic3r/GUI/BBLStatusBarPrint.cpp b/src/slic3r/GUI/BBLStatusBarPrint.cpp index 6d1c40a7a..e480b4ab5 100644 --- a/src/slic3r/GUI/BBLStatusBarPrint.cpp +++ b/src/slic3r/GUI/BBLStatusBarPrint.cpp @@ -71,7 +71,7 @@ BBLStatusBarPrint::BBLStatusBarPrint(wxWindow *parent, int id) m_sizer_status_text = new wxBoxSizer(wxHORIZONTAL); m_link_show_error = new Label(top_panel, _L("Check the reason")); - m_link_show_error->SetForegroundColour(wxColour(0x00ae42)); + m_link_show_error->SetForegroundColour(wxColour(0x9A5F21)); m_link_show_error->SetFont(::Label::Head_13); m_link_show_error->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { this->m_self->SetCursor(wxCURSOR_HAND); }); m_link_show_error->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { this->m_self->SetCursor(wxCURSOR_ARROW); }); diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index 631de921a..3e7eef62c 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -139,7 +139,8 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/) StateColor btn_bg_green(std::pair(wxColour(206, 206, 206), StateColor::Disabled), std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_bind->SetBackgroundColor(btn_bg_green); m_button_bind->SetBorderColor(*wxWHITE); m_button_bind->SetTextColor(wxColour("#FFFFFE")); @@ -480,7 +481,8 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_Terms_title->SetFont(Label::Head_13); m_link_Terms_title->SetMaxSize(wxSize(FromDIP(450), -1)); m_link_Terms_title->Wrap(FromDIP(450)); - m_link_Terms_title->SetForegroundColour(wxColour(0x00AE42)); + //m_link_Terms_title->SetForegroundColour(wxColour(0x9A5F21)); + m_link_Terms_title->SetForegroundColour(wxColour(0x9A5F21)); m_link_Terms_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { wxString txt = _L("Thank you for purchasing a Bambu Lab device.Before using your Bambu Lab device, please read the termsand conditions.By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of Use(collectively, the \"Terms\"). If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services."); ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM); @@ -499,7 +501,8 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_privacy_title->SetFont(Label::Head_13); m_link_privacy_title->SetMaxSize(wxSize(FromDIP(450), -1)); m_link_privacy_title->Wrap(FromDIP(450)); - m_link_privacy_title->SetForegroundColour(wxColour(0x00AE42)); + //m_link_privacy_title->SetForegroundColour(wxColour(0x9A5F21)); + m_link_privacy_title->SetForegroundColour(wxColour(0x9A5F21)); m_link_privacy_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { std::string url; std::string country_code = Slic3r::GUI::wxGetApp().app_config->get_country_code(); @@ -539,7 +542,8 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_notice_title->SetFont(Label::Head_13); m_link_notice_title->SetMaxSize(wxSize(FromDIP(450), -1)); m_link_notice_title->Wrap(FromDIP(450)); - m_link_notice_title->SetForegroundColour(wxColour(0x00AE42)); + //m_link_notice_title->SetForegroundColour(wxColour(0x9A5F21)); + m_link_notice_title->SetForegroundColour(wxColour(0x9A5F21)); m_link_notice_title->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); }); m_link_notice_title->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); }); m_link_notice_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { @@ -678,7 +682,8 @@ PingCodeBindDialog::~PingCodeBindDialog() { StateColor btn_bg_green(std::pair(wxColour(206, 206, 206), StateColor::Disabled), std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_bind->SetBackgroundColor(btn_bg_green); m_button_bind->SetBorderColor(*wxWHITE); m_button_bind->SetTextColor(wxColour("#FFFFFE")); @@ -1032,9 +1037,11 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/) m_sizer_button->Add(0, 0, 1, wxEXPAND, 5); m_button_unbind = new Button(this, _L("Confirm")); StateColor btn_bg_green(std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_unbind->SetBackgroundColor(btn_bg_green); - m_button_unbind->SetBorderColor(wxColour(0, 174, 66)); + //m_button_unbind->SetBorderColor(wxColour(0x9A5F21)); + m_button_unbind->SetBorderColor(wxColour(0x9A5F21)); m_button_unbind->SetTextColor(wxColour("#FFFFFE")); m_button_unbind->SetSize(BIND_DIALOG_BUTTON_SIZE); m_button_unbind->SetMinSize(BIND_DIALOG_BUTTON_SIZE); diff --git a/src/slic3r/GUI/BonjourDialog.cpp b/src/slic3r/GUI/BonjourDialog.cpp index 123f45677..8a152c373 100644 --- a/src/slic3r/GUI/BonjourDialog.cpp +++ b/src/slic3r/GUI/BonjourDialog.cpp @@ -85,7 +85,8 @@ BonjourDialog::BonjourDialog(wxWindow *parent, Slic3r::PrinterTechnology tech) auto button_sizer = new wxBoxSizer(wxHORIZONTAL); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(*wxWHITE, StateColor::Normal)); diff --git a/src/slic3r/GUI/CaliHistoryDialog.cpp b/src/slic3r/GUI/CaliHistoryDialog.cpp index 7da441950..509a8d390 100644 --- a/src/slic3r/GUI/CaliHistoryDialog.cpp +++ b/src/slic3r/GUI/CaliHistoryDialog.cpp @@ -94,10 +94,12 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector& Button * mew_btn = new Button(scroll_window, _L("New")); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); mew_btn->SetBackgroundColour(*wxWHITE); mew_btn->SetBackgroundColor(btn_bg_green); - mew_btn->SetBorderColor(wxColour(0, 174, 66)); + //mew_btn->SetBorderColor(wxColour(0x9A5F21)); + mew_btn->SetBorderColor(wxColour(0x9A5F21)); mew_btn->SetTextColor(wxColour("#FFFFFE")); mew_btn->SetMinSize(wxSize(FromDIP(100), FromDIP(24))); mew_btn->SetMaxSize(wxSize(FromDIP(100), FromDIP(24))); @@ -108,7 +110,7 @@ HistoryWindow::HistoryWindow(wxWindow* parent, const std::vector& scroll_sizer->AddSpacer(FromDIP(15)); m_extruder_switch_btn = new SwitchButton(scroll_window); - m_extruder_switch_btn->SetBackgroundColour(wxColour(0, 174, 66)); + m_extruder_switch_btn->SetBackgroundColour(wxColour(0x9A5F21)); m_extruder_switch_btn->SetMinSize(wxSize(FromDIP(120), FromDIP(24))); m_extruder_switch_btn->SetMaxSize(wxSize(FromDIP(120), FromDIP(24))); m_extruder_switch_btn->SetLabels(_L("Left Nozzle"), _L("Right Nozzle")); @@ -395,10 +397,12 @@ void HistoryWindow::sync_history_data() { auto edit_button = new Button(m_history_data_panel, _L("Edit")); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); edit_button->SetBackgroundColour(*wxWHITE); edit_button->SetBackgroundColor(btn_bg_green); - edit_button->SetBorderColor(wxColour(0, 174, 66)); + //edit_button->SetBorderColor(wxColour(0x9A5F21)); + edit_button->SetBorderColor(wxColour(0x9A5F21)); edit_button->SetTextColor(wxColour("#FFFFFE")); edit_button->SetMinSize(wxSize(-1, FromDIP(24))); edit_button->SetCornerRadius(FromDIP(12)); @@ -564,10 +568,12 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow Button* save_btn = new Button(top_panel, _L("Save")); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); save_btn->SetBackgroundColour(*wxWHITE); save_btn->SetBackgroundColor(btn_bg_green); - save_btn->SetBorderColor(wxColour(0, 174, 66)); + //save_btn->SetBorderColor(wxColour(0x9A5F21)); + save_btn->SetBorderColor(wxColour(0x9A5F21)); save_btn->SetTextColor(wxColour("#FFFFFE")); save_btn->SetMinSize(wxSize(-1, FromDIP(24))); save_btn->SetCornerRadius(FromDIP(12)); @@ -824,10 +830,12 @@ NewCalibrationHistoryDialog::NewCalibrationHistoryDialog(wxWindow *parent, const auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); Button * ok_btn = new Button(top_panel, _L("Ok")); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); ok_btn->SetBackgroundColour(*wxWHITE); ok_btn->SetBackgroundColor(btn_bg_green); - ok_btn->SetBorderColor(wxColour(0, 174, 66)); + //ok_btn->SetBorderColor(wxColour(0x9A5F21)); + ok_btn->SetBorderColor(wxColour(0x9A5F21)); ok_btn->SetTextColor(wxColour("#FFFFFE")); ok_btn->SetMinSize(wxSize(-1, FromDIP(24))); ok_btn->SetCornerRadius(FromDIP(12)); diff --git a/src/slic3r/GUI/CalibrationWizardPage.cpp b/src/slic3r/GUI/CalibrationWizardPage.cpp index 6ed1592ed..d79979aec 100644 --- a/src/slic3r/GUI/CalibrationWizardPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPage.cpp @@ -149,7 +149,8 @@ CaliPageButton::CaliPageButton(wxWindow* parent, CaliPageActionType type, wxStri StateColor btn_bg_green(std::pair(wxColour(206, 206, 206), StateColor::Disabled), std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //std::pair(wxColour(0x9A5F21), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Disabled), std::pair(wxColour(206, 206, 206), StateColor::Pressed), @@ -157,7 +158,8 @@ CaliPageButton::CaliPageButton(wxWindow* parent, CaliPageActionType type, wxStri std::pair(wxColour(255, 255, 255), StateColor::Normal)); StateColor btn_bd_green(std::pair(wxColour(255, 255, 254), StateColor::Disabled), - std::pair(wxColour(0, 174, 66), StateColor::Enabled)); + //std::pair(wxColour(0x9A5F21), StateColor::Enabled)); + std::pair(wxColour(0x9A5F21), StateColor::Enabled)); StateColor btn_bd_white(std::pair(wxColour(255, 255, 254), StateColor::Disabled), std::pair(wxColour(38, 46, 48), StateColor::Enabled)); diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index ea0464190..30bc386c3 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -565,7 +565,7 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent) m_btn_sync->SetCornerRadius(8); StateColor btn_sync_bg_col(std::pair(wxColour(0xCECECE), StateColor::Pressed), std::pair(wxColour(0xF8F8F8), StateColor::Hovered), std::pair(wxColour(0xF8F8F8), StateColor::Normal)); - StateColor btn_sync_bd_col(std::pair(wxColour(0x00AE42), StateColor::Pressed), std::pair(wxColour(0x00AE42), StateColor::Hovered), + StateColor btn_sync_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(0xEEEEEE), StateColor::Normal)); m_btn_sync->SetBackgroundColor(btn_sync_bg_col); m_btn_sync->SetBorderColor(btn_sync_bd_col); diff --git a/src/slic3r/GUI/ConfigWizard.hpp b/src/slic3r/GUI/ConfigWizard.hpp index f929a3aaa..4918e34f6 100644 --- a/src/slic3r/GUI/ConfigWizard.hpp +++ b/src/slic3r/GUI/ConfigWizard.hpp @@ -33,6 +33,7 @@ public: SP_FILAMENTS, SP_MATERIALS, SP_CUSTOM, + SP_CONFIGS }; ConfigWizard(wxWindow *parent); diff --git a/src/slic3r/GUI/ConnectPrinter.cpp b/src/slic3r/GUI/ConnectPrinter.cpp index 187ced8d6..fff726cfc 100644 --- a/src/slic3r/GUI/ConnectPrinter.cpp +++ b/src/slic3r/GUI/ConnectPrinter.cpp @@ -55,10 +55,12 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons StateColor btn_bg( std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + //std::pair(wxColour(0x9A5F21), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); - StateColor btn_bd(std::pair(wxColour(0, 174, 66), StateColor::Normal)); + //StateColor btn_bd(std::pair(wxColour(0x9A5F21), StateColor::Normal)); + StateColor btn_bd(std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_text(std::pair(wxColour(255, 255, 255), StateColor::Normal)); diff --git a/src/slic3r/GUI/CreatePresetsDialog.cpp b/src/slic3r/GUI/CreatePresetsDialog.cpp index 3a8e0eecd..9988c868e 100644 --- a/src/slic3r/GUI/CreatePresetsDialog.cpp +++ b/src/slic3r/GUI/CreatePresetsDialog.cpp @@ -30,7 +30,8 @@ #define STATIC_TEXT_COLOUR wxColour("#363636") #define PRINTER_LIST_COLOUR wxColour("#EEEEEE") #define FILAMENT_OPTION_COLOUR wxColour("#D9D9D9") -#define SELECT_ALL_OPTION_COLOUR wxColour("#00AE42") +//#define SELECT_ALL_OPTION_COLOUR wxColour("#00AE42") +#define SELECT_ALL_OPTION_COLOUR wxColour("#009FF3") #define DEFAULT_PROMPT_TEXT_COLOUR wxColour("#ACACAC") namespace Slic3r { @@ -923,7 +924,8 @@ wxBoxSizer *CreateFilamentPresetDialog::create_button_item() bSizer_button->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); + m_button_create = new Button(this, _L("Create")); m_button_create->SetBackgroundColor(btn_bg_green); @@ -1911,7 +1913,8 @@ wxBoxSizer *CreatePrinterPresetDialog::create_hot_bed_stl_item(wxWindow *parent) StateColor flush_bg_col(std::pair(wxColour(219, 253, 231), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(wxColour(238, 238, 238), StateColor::Normal)); - StateColor flush_bd_col(std::pair(wxColour(0, 174, 66), StateColor::Pressed), std::pair(wxColour(0, 174, 66), StateColor::Hovered), + //StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), + StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(172, 172, 172), StateColor::Normal)); m_button_bed_stl = new Button(parent, _L("Load stl")); @@ -1948,7 +1951,8 @@ wxBoxSizer *CreatePrinterPresetDialog::create_hot_bed_svg_item(wxWindow *parent) StateColor flush_bg_col(std::pair(wxColour(219, 253, 231), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(wxColour(238, 238, 238), StateColor::Normal)); - StateColor flush_bd_col(std::pair(wxColour(0, 174, 66), StateColor::Pressed), std::pair(wxColour(0, 174, 66), StateColor::Hovered), + //StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), + StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(172, 172, 172), StateColor::Normal)); m_button_bed_svg = new Button(parent, _L("Load svg")); @@ -1996,7 +2000,7 @@ wxBoxSizer *CreatePrinterPresetDialog::create_page1_btns_item(wxWindow *parent) bSizer_button->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_OK = new Button(parent, _L("OK")); m_button_OK->SetBackgroundColor(btn_bg_green); @@ -2667,7 +2671,7 @@ wxBoxSizer *CreatePrinterPresetDialog::create_page2_btns_item(wxWindow *parent) bSizer_button->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(*wxWHITE, StateColor::Normal)); @@ -3440,7 +3444,7 @@ CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(wxWindow *parent, con break; } StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(*wxWHITE, StateColor::Normal)); @@ -4309,7 +4313,7 @@ wxBoxSizer *ExportConfigsDialog::create_button_item(wxWindow* parent) bSizer_button->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_ok = new Button(this, _L("OK")); m_button_ok->SetBackgroundColor(btn_bg_green); @@ -4818,7 +4822,8 @@ wxBoxSizer *EditFilamentPresetDialog::create_add_filament_btn() StateColor flush_fg_col(std::pair(wxColour(107, 107, 106), StateColor::Pressed), std::pair(wxColour(107, 107, 106), StateColor::Hovered), std::pair(wxColour(107, 107, 106), StateColor::Normal)); - StateColor flush_bd_col(std::pair(wxColour(0, 174, 66), StateColor::Pressed), std::pair(wxColour(0, 174, 66), StateColor::Hovered), + //StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), + StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(172, 172, 172), StateColor::Normal)); m_add_filament_btn->SetBackgroundColor(flush_bg_col); @@ -4878,7 +4883,7 @@ wxBoxSizer *EditFilamentPresetDialog::create_button_sizer() bSizer_button->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_ok_btn = new Button(this, _L("OK")); m_ok_btn->SetBackgroundColor(btn_bg_green); @@ -5078,7 +5083,7 @@ wxBoxSizer *CreatePresetForPrinterDialog::create_button_sizer() bSizer_button->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_ok_btn = new Button(this, _L("OK")); m_ok_btn->SetBackgroundColor(btn_bg_green); @@ -5224,11 +5229,11 @@ wxPanel *PresetTree::get_child_item(wxPanel *parent, std::shared_ptr pre StateColor flush_fg_col(std::pair(wxColour(107, 107, 106), StateColor::Pressed), std::pair(wxColour(107, 107, 106), StateColor::Hovered), std::pair(wxColour(107, 107, 106), StateColor::Normal)); - StateColor flush_bd_col(std::pair(wxColour(0, 174, 66), StateColor::Pressed), std::pair(wxColour(0, 174, 66), StateColor::Hovered), + StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(172, 172, 172), StateColor::Normal)); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); Button *edit_preset_btn = new Button(panel, _L("Edit Preset")); edit_preset_btn->SetFont(Label::Body_10); diff --git a/src/slic3r/GUI/DailyTips.cpp b/src/slic3r/GUI/DailyTips.cpp index 5aba7762f..7d07ca99b 100644 --- a/src/slic3r/GUI/DailyTips.cpp +++ b/src/slic3r/GUI/DailyTips.cpp @@ -485,7 +485,8 @@ void DailyTipsPanel::render_controller_buttons(const ImVec2& pos, const ImVec2& button_text = ImGui::PrevArrowBtnIcon; if (ImGui::IsMouseHoveringRect(prev_button_pos, prev_button_pos + button_size, true)) { - button_text_color = ImColor(0, 174, 66, (int)(255 * m_fade_opacity)); + //button_text_color = ImColor(33, 95, 154, (int)(255 * m_fade_opacity)); + button_text_color = ImColor(33, 95, 154, (int)(255 * m_fade_opacity)); if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) retrieve_data_from_hint_database(HintDataNavigation::Prev); } @@ -500,7 +501,8 @@ void DailyTipsPanel::render_controller_buttons(const ImVec2& pos, const ImVec2& button_text = ImGui::NextArrowBtnIcon; if (ImGui::IsMouseHoveringRect(next_button_pos, next_button_pos + button_size, true)) { - button_text_color = ImColor(0, 174, 66, (int)(255 * m_fade_opacity)); + //button_text_color = ImColor(33, 95, 154, (int)(255 * m_fade_opacity)); + button_text_color = ImColor(33, 95, 154, (int)(255 * m_fade_opacity)); if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) retrieve_data_from_hint_database(HintDataNavigation::Next); } diff --git a/src/slic3r/GUI/ExtrusionCalibration.cpp b/src/slic3r/GUI/ExtrusionCalibration.cpp index 6b3c9f8e4..15a18e7d6 100644 --- a/src/slic3r/GUI/ExtrusionCalibration.cpp +++ b/src/slic3r/GUI/ExtrusionCalibration.cpp @@ -172,10 +172,10 @@ void ExtrusionCalibration::create() m_button_cali = new Button(m_step_1_panel, _L("Start calibration")); m_btn_bg_green = StateColor(std::pair(wxColour(238, 238, 238), StateColor::Disabled), std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_cali->SetBackgroundColor(m_btn_bg_green); m_button_cali->SetFont(Label::Body_13); - m_button_cali->SetBorderColor({ std::pair(wxColour(238, 238, 238), StateColor::Disabled), std::pair(wxColour(0, 174, 66), StateColor::Enabled) }); + m_button_cali->SetBorderColor({ std::pair(wxColour(238, 238, 238), StateColor::Disabled), std::pair(wxColour(0x9A5F21), StateColor::Enabled) }); m_button_cali->SetTextColor({ std::pair(wxColour(172, 172, 172), StateColor::Disabled), std::pair(EXTRUSION_CALIBRATION_GREY200, StateColor::Enabled) }); m_button_cali->SetCornerRadius(FromDIP(12)); m_button_cali->SetMinSize(wxSize(-1, FromDIP(24))); @@ -183,9 +183,9 @@ void ExtrusionCalibration::create() m_cali_cancel = new Button(m_step_1_panel, _L("Cancel")); m_btn_bg_green = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_cali_cancel->SetBackgroundColor(m_btn_bg_green); - m_cali_cancel->SetBorderColor(wxColour(0, 174, 66)); + m_cali_cancel->SetBorderColor(wxColour(0x9A5F21)); m_cali_cancel->SetTextColor(EXTRUSION_CALIBRATION_GREY200); m_cali_cancel->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE); m_cali_cancel->SetCornerRadius(FromDIP(12)); @@ -258,10 +258,10 @@ void ExtrusionCalibration::create() // save button m_button_save_result = new Button(m_step_2_panel, _L("Save")); m_btn_bg_green = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_save_result->SetBackgroundColor(m_btn_bg_green); m_button_save_result->SetFont(Label::Body_13); - m_button_save_result->SetBorderColor(wxColour(0, 174, 66)); + m_button_save_result->SetBorderColor(wxColour(0x9A5F21)); m_button_save_result->SetTextColor(EXTRUSION_CALIBRATION_GREY200); m_button_save_result->SetMinSize(EXTRUSION_CALIBRATION_BUTTON_SIZE); m_button_save_result->SetCornerRadius(FromDIP(12)); diff --git a/src/slic3r/GUI/FilamentMapDialog.cpp b/src/slic3r/GUI/FilamentMapDialog.cpp index 37812b5a9..d40c5d9d8 100644 --- a/src/slic3r/GUI/FilamentMapDialog.cpp +++ b/src/slic3r/GUI/FilamentMapDialog.cpp @@ -112,9 +112,9 @@ bool try_pop_up_before_slice(bool is_slice_all, Plater* plater_ref, PartPlate* p static const StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); -static const StateColor btn_bd_green(std::pair(wxColour(0, 174, 66), StateColor::Normal)); +static const StateColor btn_bd_green(std::pair(wxColour(0x9A5F21), StateColor::Normal)); static const StateColor btn_text_green(std::pair(wxColour(255, 255, 254), StateColor::Normal)); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index f89079331..5ae29a86e 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -594,8 +594,10 @@ void GCodeViewer::SequentialView::GCodeWindow::render(float top, float bottom, f return ret; }; - static const ImVec4 LINE_NUMBER_COLOR = { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }; - static const ImVec4 SELECTION_RECT_COLOR = { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }; + //static const ImVec4 LINE_NUMBER_COLOR = { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }; + static const ImVec4 LINE_NUMBER_COLOR = { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }; + //static const ImVec4 SELECTION_RECT_COLOR = { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }; + static const ImVec4 SELECTION_RECT_COLOR = { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }; static const ImVec4 COMMAND_COLOR = m_is_dark ? ImVec4( 240.0f / 255.0f, 240.0f / 255.0f, 240.0f / 255.0f, 1.0f ) : ImVec4( 1.0f, 1.0f, 1.0f, 1.0f ); static const ImVec4 PARAMETERS_COLOR = m_is_dark ? ImVec4( 179.0f / 255.0f, 179.0f / 255.0f, 179.0f / 255.0f, 1.0f ) : ImVec4( 206.0f / 255.0f, 206.0f / 255.0f, 206.0f / 255.0f, 1.0f ); static const ImVec4 COMMENT_COLOR = m_is_dark ? ImVec4(129.0f / 255.0f, 129.0f / 255.0f, 129.0f / 255.0f, 1.0f) : ImVec4( 172.0f / 255.0f, 172.0f / 255.0f, 172.0f / 255.0f, 1.0f ); @@ -4675,7 +4677,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding) auto link_text = [&](const std::string &label) { ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str()); - ImColor HyperColor = ImColor(0, 174, 66, 255).Value; + ImColor HyperColor = ImColor(33, 95, 154, 255).Value; ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value); imgui.text(label.c_str()); ImGui::PopStyleColor(); @@ -4701,7 +4703,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding) auto link_text_set_to_optional = [&](const std::string &label) { ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str()); - ImColor HyperColor = ImColor(0, 174, 66, 255).Value; + ImColor HyperColor = ImColor(33, 95, 154, 255).Value; ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value); imgui.text(label.c_str()); ImGui::PopStyleColor(); @@ -4729,7 +4731,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding) auto link_filament_group_wiki = [&](const std::string& label) { ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str()); - ImColor HyperColor = ImColor(0, 174, 66, 255).Value; + ImColor HyperColor = ImColor(33, 95, 154, 255).Value; ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value); imgui.text(label.c_str()); ImGui::PopStyleColor(); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 47ba5a966..e1ede21af 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -277,6 +277,7 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(const GLCanv ImGuiWrapper& imgui = *wxGetApp().imgui(); const Size& cnv_size = canvas.get_canvas_size(); float zoom = (float)wxGetApp().plater()->get_camera().get_zoom(); + // todo float left_pos = canvas.m_main_toolbar.get_item("layersediting")->render_left_pos; float x = 0.5 * cnv_size.get_width() + left_pos * zoom; diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index 6f1ea0c69..cb691fb64 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -97,6 +97,7 @@ GLToolbarItem::GLToolbarItem(GLToolbarItem::EType type, const GLToolbarItem::Dat , m_highlight_state(NotHighlighted) { render_left_pos = 0.0f; + render_top_pos = 0.0f; } void GLToolbarItem::set_state(EState state) @@ -1467,6 +1468,7 @@ void GLToolbar::render_horizontal(const GLCanvas3D& parent,GLToolbarItem::EType left += separator_stride; else { + item->render_top_pos = top; //BBS GUI refactor item->render_left_pos = left; if (!item->is_action_with_text_image()) { @@ -1522,6 +1524,8 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent) if (item->is_separator()) top -= separator_stride; else { + item->render_left_pos = left; + item->render_top_pos = top; unsigned int tex_id; int tex_width, tex_height; if (item->is_action_with_text_image()) { diff --git a/src/slic3r/GUI/GLToolbar.hpp b/src/slic3r/GUI/GLToolbar.hpp index 5a686bca5..3ab207c3f 100644 --- a/src/slic3r/GUI/GLToolbar.hpp +++ b/src/slic3r/GUI/GLToolbar.hpp @@ -184,6 +184,8 @@ public: // remember left position for rendering menu mutable float render_left_pos; + mutable float render_top_pos; + std::chrono::system_clock::time_point get_start_time_point() const { return start; } GLToolbarItem(EType type, const Data& data); diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 0e8478d6d..b7626c386 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -374,6 +374,7 @@ void show_substitutions_info(const PresetsConfigSubstitutions& presets_config_su case Preset::TYPE_FILAMENT: return _L("Filament"); // BBS: remove TYPE_SLA_MATERIAL case Preset::TYPE_PRINTER: return _L("Machine"); + case Preset::TYPE_CONFIG: return _L("Configuration"); // BBS: remove TYPE_PHYSICAL_PRINTER default: assert(false); return wxString(); } diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index a935a5754..6339e8e21 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -345,12 +345,15 @@ public: wxRect title_rect(wxPoint(0, top_margin), wxPoint(split_width - text_padding, top_margin + title_height)); memDc.SetTextForeground(StateColor::darkModeColorFor(wxColour(38, 46, 48))); memDc.SetFont(m_constant_text.title_font); - memDc.DrawLabel(m_constant_text.title, title_rect, wxALIGN_RIGHT | wxALIGN_BOTTOM); + //memDc.DrawLabel(m_constant_text.title, title_rect, wxALIGN_RIGHT | wxALIGN_BOTTOM); + memDc.DrawLabel(_L("Ui title"), title_rect, wxALIGN_CENTER_VERTICAL); //BBS align bottom of title and version text - wxRect version_rect(wxPoint(split_width + text_padding, top_margin), wxPoint(width, top_margin + title_height - text_padding)); + //wxRect version_rect(wxPoint(split_width + text_padding, top_margin), wxPoint(width, top_margin + title_height - text_padding)); + wxRect version_rect(wxPoint(split_width + text_padding, top_margin + 10), wxPoint(width + 10, top_margin + title_height - text_padding)); memDc.SetFont(m_constant_text.version_font); memDc.SetTextForeground(StateColor::darkModeColorFor(wxColor(134, 134, 134))); - memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM); + //memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM); + //memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_TOP | wxALIGN_LEFT); #if BBL_INTERNAL_TESTING wxString versionText = BBL_INTERNAL_TESTING == 1 ? _L("Internal Version") : _L("Beta Version"); @@ -367,7 +370,8 @@ public: int logo_margin = FromDIP(72 * m_scale); int logo_size = FromDIP(122 * m_scale); int logo_width = FromDIP(94 * m_scale); - wxBitmap logo_bmp = *bmp_cache.load_svg("splash_logo", logo_size, logo_size); + //wxBitmap logo_bmp = *bmp_cache.load_svg("splash_logo", logo_size, logo_size); + wxBitmap logo_bmp = *bmp_cache.load_svg("machine_logo", logo_size, logo_size); int logo_y = top_margin + title_rect.GetHeight() + logo_margin; memDc.DrawBitmap(logo_bmp, (width - logo_width) / 2, logo_y, true); @@ -802,7 +806,7 @@ static const FileWildcards file_wildcards_by_type[FT_SIZE] = { /* FT_MODEL */ {"Supported files"sv, {".3mf"sv, ".stl"sv, ".oltp"sv, ".stp"sv, ".step"sv, ".svg"sv, ".amf"sv, ".obj"sv}}, #endif - /* FT_PROJECT */ { "Project files"sv, { ".3mf"sv} }, + /* FT_PROJECT */ { "Project files"sv, { ".3mf"sv, ".stl"sv} }, /* FT_GALLERY */ { "Known files"sv, { ".stl"sv, ".obj"sv } }, /* FT_INI */ { "INI files"sv, { ".ini"sv } }, diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp b/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp index f29600189..fe73b9b0b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp @@ -648,7 +648,7 @@ void GLGizmoBrimEars::on_render_input_window(float x, float y, float bottom_limi if (glb_cfg.opt_enum("brim_type") != btBrimEars) { ImGui::SameLine(); auto link_text = [&]() { - ImColor HyperColor = m_link_text_hover ? ImColor(0, 240, 91).Value : ImColor(0, 174, 66).Value; + ImColor HyperColor = m_link_text_hover ? ImColor(0, 240, 91).Value : ImColor(33, 95, 154).Value; ImGui::PushStyleColor(ImGuiCol_Text, ImGuiWrapper::to_ImVec4(ColorRGB::WARNING())); float parent_width = ImGui::GetContentRegionAvail().x; m_imgui->text_wrapped(_L("Warning: The brim type is not set to \"painted\",the brim ears will not take effect !"), parent_width); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 23efa97d5..99ece8185 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -2031,7 +2031,8 @@ void GLGizmoMeasure::show_face_face_assembly_common() { m_imgui->disabled_begin(!(action.can_set_to_center_coincidence)); { ImGui::PushItemWidth(set_to_center_coincidence_size); - ImGui::PushStyleColor(ImGuiCol_Button, m_is_dark_mode ? ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0) : ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0)); + //ImGui::PushStyleColor(ImGuiCol_Button, m_is_dark_mode ? ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0) : ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0)); + ImGui::PushStyleColor(ImGuiCol_Button, m_is_dark_mode ? ImVec4(33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0) : ImVec4(33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, m_is_dark_mode ? ImVec4(50 / 255.0f, 238 / 255.0f, 61 / 255.0f, 1.00f) : ImVec4(50 / 255.0f, 238 / 255.0f, 61 / 255.0f, 1.00f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp index c66d20a2a..816484960 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp @@ -247,13 +247,21 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l if (selected || hovered) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_Button, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + /*ImGui::PushStyleColor(ImGuiCol_Button, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });*/ + //ImGui::PushStyleColor(ImGuiCol_Button, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + ImGui::PushStyleColor(ImGuiCol_Button, { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }); + //ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }); + //ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }); } else { - ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + //ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }); + //ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f }); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 33.0f / 255.0f, 95.0f / 255.0f, 154.0f / 255.0f, 1.0f }); } bool res = ImGui::Button(label.c_str(), size_arg); diff --git a/src/slic3r/GUI/IMSlider.cpp b/src/slic3r/GUI/IMSlider.cpp index 283b5b2a1..acdceae6c 100644 --- a/src/slic3r/GUI/IMSlider.cpp +++ b/src/slic3r/GUI/IMSlider.cpp @@ -25,7 +25,8 @@ static const ImU32 BACKGROUND_COLOR_DARK = IM_COL32(65, 65, 71, 255); static const ImU32 BACKGROUND_COLOR_LIGHT = IM_COL32(255, 255, 255, 255); static const ImU32 GROOVE_COLOR_DARK = IM_COL32(45, 45, 49, 255); static const ImU32 GROOVE_COLOR_LIGHT = IM_COL32(206, 206, 206, 255); -static const ImU32 BRAND_COLOR = IM_COL32(0, 174, 66, 255); +//static const ImU32 BRAND_COLOR = IM_COL32(0, 174, 66, 255); +static const ImU32 BRAND_COLOR = IM_COL32(33, 95, 154, 255); static int m_tick_value = -1; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 030494eda..776a19670 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1349,6 +1349,8 @@ void MainFrame::create_preset_tabs() //add_created_tab(new TabSLAPrint(m_param_panel)); //add_created_tab(new TabSLAMaterial(m_param_panel)); add_created_tab(new TabPrinter(m_param_dialog->panel()), "printer"); + //todo + //add_created_tab(new TabConfig(m_param_dialog->panel()), "config"); m_param_panel->rebuild_panels(); m_param_dialog->panel()->rebuild_panels(); @@ -1765,12 +1767,12 @@ wxBoxSizer* MainFrame::create_side_tools() if(m_slice_option_pop_up) delete m_slice_option_pop_up; m_slice_option_pop_up = new SidePopup(this); - SideButton* slice_all_btn = new SideButton(m_slice_option_pop_up, _L("Slice all"), ""); - slice_all_btn->SetCornerRadius(0); + //SideButton* slice_all_btn = new SideButton(m_slice_option_pop_up, _L("Slice all"), ""); + //slice_all_btn->SetCornerRadius(0); SideButton* slice_plate_btn = new SideButton(m_slice_option_pop_up, _L("Slice plate"), ""); slice_plate_btn->SetCornerRadius(0); - slice_all_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { + /*slice_all_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { m_slice_btn->SetLabel(_L("Slice all")); m_slice_select = eSliceAll; m_slice_enable = get_enable_slice_status(); @@ -1778,7 +1780,7 @@ wxBoxSizer* MainFrame::create_side_tools() this->Layout(); if(m_slice_option_pop_up) m_slice_option_pop_up->Dismiss(); - }); + });*/ slice_plate_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { m_slice_btn->SetLabel(_L("Slice plate")); @@ -1789,7 +1791,7 @@ wxBoxSizer* MainFrame::create_side_tools() if(m_slice_option_pop_up) m_slice_option_pop_up->Dismiss(); }); - m_slice_option_pop_up->append_button(slice_all_btn); + //m_slice_option_pop_up->append_button(slice_all_btn); m_slice_option_pop_up->append_button(slice_plate_btn); m_slice_option_pop_up->Popup(m_slice_btn); } @@ -1837,25 +1839,25 @@ wxBoxSizer* MainFrame::create_side_tools() p->Dismiss(); });*/ - p->append_button(send_gcode_btn); + //p->append_button(send_gcode_btn); //p->append_button(upload_gcode_btn); p->append_button(export_gcode_btn); } else { //Bambu Studio Buttons - SideButton* print_plate_btn = new SideButton(p, _L("Print plate"), ""); - print_plate_btn->SetCornerRadius(0); + //SideButton* print_plate_btn = new SideButton(p, _L("Print plate"), ""); + //print_plate_btn->SetCornerRadius(0); - SideButton* send_to_printer_btn = new SideButton(p, _L("Send"), ""); - send_to_printer_btn->SetCornerRadius(0); + //SideButton* send_to_printer_btn = new SideButton(p, _L("Send"), ""); + //send_to_printer_btn->SetCornerRadius(0); - SideButton* export_sliced_file_btn = new SideButton(p, _L("Export plate sliced file"), ""); - export_sliced_file_btn->SetCornerRadius(0); + //SideButton* export_sliced_file_btn = new SideButton(p, _L("Export plate sliced file"), ""); + //export_sliced_file_btn->SetCornerRadius(0); - SideButton* export_all_sliced_file_btn = new SideButton(p, _L("Export all sliced file"), ""); - export_all_sliced_file_btn->SetCornerRadius(0); + //SideButton* export_all_sliced_file_btn = new SideButton(p, _L("Export all sliced file"), ""); + //export_all_sliced_file_btn->SetCornerRadius(0); - print_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) { + /*print_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) { m_print_btn->SetLabel(_L("Print plate")); m_print_select = ePrintPlate; m_print_enable = get_enable_print_status(); @@ -1911,17 +1913,26 @@ wxBoxSizer* MainFrame::create_side_tools() m_print_btn->Enable(m_print_enable); this->Layout(); p->Dismiss(); + });*/ + SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), ""); + export_gcode_btn->SetCornerRadius(0); + export_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) { + m_print_btn->SetLabel(_L("Export G-code file")); + m_print_select = eExportGcode; + m_print_enable = get_enable_print_status(); + m_print_btn->Enable(m_print_enable); + this->Layout(); + p->Dismiss(); }); - - p->append_button(print_plate_btn); + /* p->append_button(print_plate_btn); p->append_button(print_all_btn); p->append_button(send_to_printer_btn); p->append_button(send_to_printer_all_btn); p->append_button(export_sliced_file_btn); - p->append_button(export_all_sliced_file_btn); + p->append_button(export_all_sliced_file_btn);*/ + p->append_button(export_gcode_btn); - - if (check_bbl_farm_client_installed()) { + /* if (check_bbl_farm_client_installed()) { SideButton *send_to_multi_app_btn = new SideButton(p, _L("Send to Bambu Farm Manager Client"), ""); send_to_multi_app_btn->SetCornerRadius(0); p->append_button(send_to_multi_app_btn); @@ -1949,7 +1960,7 @@ wxBoxSizer* MainFrame::create_side_tools() p->Dismiss(); }); p->append_button(print_multi_machine_btn); - } + }*/ } p->Popup(m_print_btn); @@ -2123,8 +2134,10 @@ void MainFrame::update_side_button_style() m_slice_btn->SetBottomColour(wxColour(0x3B4446));*/ StateColor m_btn_bg_enable = StateColor( std::pair(wxColour(27, 136, 68), StateColor::Pressed), - std::pair(wxColour(48, 221, 112), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + //std::pair(wxColour(48, 221, 112), StateColor::Hovered), + std::pair(0x0073BC, StateColor::Hovered), + //std::pair(wxColour(0x9A5F21), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); m_slice_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Left, FromDIP(15)); @@ -3754,24 +3767,30 @@ void MainFrame::on_config_changed(DynamicPrintConfig* config) const void MainFrame::set_print_button_to_default(PrintSelectType select_type) { - if (select_type == PrintSelectType::ePrintPlate) { - m_print_btn->SetLabel(_L("Print plate")); - m_print_select = ePrintPlate; - if (m_print_enable) - m_print_enable = get_enable_print_status(); - m_print_btn->Enable(m_print_enable); - this->Layout(); - } else if (select_type == PrintSelectType::eSendGcode) { - m_print_btn->SetLabel(_L("Print")); - m_print_select = eSendGcode; - if (m_print_enable) - m_print_enable = get_enable_print_status() && can_send_gcode(); - m_print_btn->Enable(m_print_enable); - this->Layout(); - } else { - //unsupport - return; - } + //if (select_type == PrintSelectType::ePrintPlate) { + // m_print_btn->SetLabel(_L("Print plate")); + // m_print_select = ePrintPlate; + // if (m_print_enable) + // m_print_enable = get_enable_print_status(); + // m_print_btn->Enable(m_print_enable); + // this->Layout(); + //} else if (select_type == PrintSelectType::eSendGcode) { + // m_print_btn->SetLabel(_L("Print")); + // m_print_select = eSendGcode; + // if (m_print_enable) + // m_print_enable = get_enable_print_status() && can_send_gcode(); + // m_print_btn->Enable(m_print_enable); + // this->Layout(); + //} else { + // //unsupport + // return; + //} + m_print_btn->SetLabel(_L("Export G-code file")); + m_print_select = eExportGcode; + if (m_print_enable) + m_print_enable = get_enable_print_status(); + m_print_btn->Enable(m_print_enable); + this->Layout(); } void MainFrame::add_to_recent_projects(const wxString& filename) @@ -4035,6 +4054,8 @@ void MainFrame::update_side_preset_ui() //BBS: update the preset m_plater->sidebar().update_presets(Preset::TYPE_PRINTER); m_plater->sidebar().update_presets(Preset::TYPE_FILAMENT); + //todo + //m_plater->sidebar().update_presets(Preset::TYPE_CONFIG); //take off multi machine diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index ddf94ac3c..aa8bfd31e 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -152,11 +152,11 @@ Button* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, con StateColor btn_bg_green( std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); StateColor btn_bd_green( - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); StateColor btn_text_green( @@ -606,7 +606,7 @@ wxBoxSizer *Newer3mfVersionDialog::get_btn_sizer() wxBoxSizer *horizontal_sizer = new wxBoxSizer(wxHORIZONTAL); horizontal_sizer->Add(0, 0, 1, wxEXPAND, 0); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(*wxWHITE, StateColor::Normal)); bool file_version_newer = (*m_file_version) > (*m_cloud_version); @@ -724,7 +724,7 @@ NetworkErrorDialog::NetworkErrorDialog(wxWindow* parent) }); auto bt_enable = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_confirm = new Button(this, _L("Confirm")); m_button_confirm->SetBackgroundColor(bt_enable); diff --git a/src/slic3r/GUI/MultiMachineManagerPage.cpp b/src/slic3r/GUI/MultiMachineManagerPage.cpp index f386b60d5..fe7fd36cc 100644 --- a/src/slic3r/GUI/MultiMachineManagerPage.cpp +++ b/src/slic3r/GUI/MultiMachineManagerPage.cpp @@ -186,7 +186,7 @@ void MultiMachineItem::doRender(wxDC& dc) } else if (state_device > 2 && state_device < 7) { dc.SetFont(Label::Body_12); - dc.SetTextForeground(wxColour(0, 174, 66)); + dc.SetTextForeground(wxColour(0x9A5F21)); if (obj_->get_curr_stage().IsEmpty() && obj_->subtask_) { //wxString layer_info = wxString::Format(_L("Layer: %d/%d"), obj_->curr_layer, obj_->total_layers); wxString progress_info = wxString::Format("%d", obj_->subtask_->task_progress); @@ -199,8 +199,8 @@ void MultiMachineItem::doRender(wxDC& dc) dc.SetBrush(wxBrush(wxColour(233,233,233))); dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(DEVICE_LEFT_PRO_INFO), FromDIP(10), 2); - dc.SetPen(wxPen(wxColour(0, 174, 66))); - dc.SetBrush(wxBrush(wxColour(0, 174, 66))); + dc.SetPen(wxPen(wxColour(0x9A5F21))); + dc.SetBrush(wxBrush(wxColour(0x9A5F21))); dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(DEVICE_LEFT_PRO_INFO) * (static_cast(obj_->subtask_->task_progress) / 100.0f), FromDIP(10), 2); } else { @@ -226,7 +226,7 @@ void MultiMachineItem::doRender(wxDC& dc) } if (m_hover) { - dc.SetPen(wxPen(wxColour(0, 174, 66))); + dc.SetPen(wxPen(wxColour(0x9A5F21))); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRoundedRectangle(0, 0, size.x, size.y, 3); } @@ -283,7 +283,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent) auto m_btn_bg_enable = StateColor( std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); diff --git a/src/slic3r/GUI/MultiTaskManagerPage.cpp b/src/slic3r/GUI/MultiTaskManagerPage.cpp index 6a311f363..69eaf3e91 100644 --- a/src/slic3r/GUI/MultiTaskManagerPage.cpp +++ b/src/slic3r/GUI/MultiTaskManagerPage.cpp @@ -36,7 +36,7 @@ MultiTaskItem::MultiTaskItem(wxWindow* parent, MachineObject* obj, int type) auto m_btn_bg_enable = StateColor( std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); m_button_resume = new Button(this, _L("Resume")); @@ -376,7 +376,7 @@ void MultiTaskItem::doRender(wxDC& dc) DrawTextWithEllipsis(dc, get_state_device(), FromDIP(DEVICE_LEFT_PRO_INFO), left); } else if (state_device == 1) { - dc.SetTextForeground(wxColour(0, 174, 66)); + dc.SetTextForeground(wxColour(0x9A5F21)); DrawTextWithEllipsis(dc, get_state_device(), FromDIP(DEVICE_LEFT_PRO_INFO), left); } else if (state_device == 2) @@ -386,7 +386,7 @@ void MultiTaskItem::doRender(wxDC& dc) } else if (state_device > 2 && state_device < 7) { dc.SetFont(Label::Body_12); - dc.SetTextForeground(wxColour(0, 174, 66)); + dc.SetTextForeground(wxColour(0x9A5F21)); if (obj_->get_curr_stage().IsEmpty()) { //wxString layer_info = wxString::Format(_L("Layer: %d/%d"), obj_->curr_layer, obj_->total_layers); wxString progress_info = wxString::Format("%d", obj_->subtask_->task_progress); @@ -398,8 +398,8 @@ void MultiTaskItem::doRender(wxDC& dc) dc.SetBrush(wxBrush(wxColour(233, 233, 233))); dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(TASK_LEFT_PRO_INFO), FromDIP(10), 2); - dc.SetPen(wxPen(wxColour(0, 174, 66))); - dc.SetBrush(wxBrush(wxColour(0, 174, 66))); + dc.SetPen(wxPen(wxColour(0x9A5F21))); + dc.SetBrush(wxBrush(wxColour(0x9A5F21))); dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(TASK_LEFT_PRO_INFO) * (static_cast(obj_->subtask_->task_progress) / 100.0f), FromDIP(10), 2); } else { @@ -422,8 +422,8 @@ void MultiTaskItem::doRender(wxDC& dc) dc.SetBrush(wxBrush(wxColour(233, 233, 233))); dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(TASK_LEFT_PRO_INFO), FromDIP(10), 2); - dc.SetPen(wxPen(wxColour(0, 174, 66))); - dc.SetBrush(wxBrush(wxColour(0, 174, 66))); + dc.SetPen(wxPen(wxColour(0x9A5F21))); + dc.SetBrush(wxBrush(wxColour(0x9A5F21))); dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(TASK_LEFT_PRO_INFO) * (static_cast(m_sending_percent) / 100.0f), FromDIP(10), 2); } /*else { @@ -449,7 +449,7 @@ void MultiTaskItem::doRender(wxDC& dc) left += FromDIP(TASK_LEFT_SEND_TIME); if (m_hover) { - dc.SetPen(wxPen(wxColour(0, 174, 66))); + dc.SetPen(wxPen(wxColour(0x9A5F21))); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRoundedRectangle(0, 0, size.x, size.y, 3); } diff --git a/src/slic3r/GUI/Notebook.cpp b/src/slic3r/GUI/Notebook.cpp index a6bec54be..62666f22d 100644 --- a/src/slic3r/GUI/Notebook.cpp +++ b/src/slic3r/GUI/Notebook.cpp @@ -157,7 +157,7 @@ void ButtonsListCtrl::SetSelection(int sel) m_selection = sel; StateColor bg_color = StateColor( - std::pair{wxColour(0, 174, 66), (int) StateColor::Hovered}, + std::pair{wxColour(0x9A5F21), (int) StateColor::Hovered}, std::pair{wxColour(0,174, 66), (int) StateColor::Normal}); m_pageButtons[m_selection]->SetBackgroundColor(bg_color); diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index 9be8f70ff..0e17405e1 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -865,13 +865,13 @@ private: // non-static so its not loaded too early. If static, the translations wont load correctly. const std::vector basic_notifications = { NotificationData{NotificationType::Mouse3dDisconnected, NotificationLevel::RegularNotificationLevel, 10, _u8L("3D Mouse disconnected.")}, - NotificationData{NotificationType::PresetUpdateAvailable, NotificationLevel::ImportantNotificationLevel, BBL_NOTICE_MAX_INTERVAL, _u8L("Configuration can update now."), _u8L("Detail."), - [](wxEvtHandler* evnthndlr) { - if (evnthndlr != nullptr) - wxPostEvent(evnthndlr, PresetUpdateAvailableClickedEvent(EVT_PRESET_UPDATE_AVAILABLE_CLICKED)); - return true; - } - }, + // NotificationData{NotificationType::PresetUpdateAvailable, NotificationLevel::ImportantNotificationLevel, BBL_NOTICE_MAX_INTERVAL, _u8L("Configuration can update now."), _u8L("Detail."), + // [](wxEvtHandler* evnthndlr) { + // if (evnthndlr != nullptr) + // wxPostEvent(evnthndlr, PresetUpdateAvailableClickedEvent(EVT_PRESET_UPDATE_AVAILABLE_CLICKED)); + // return true; + // } + // }, NotificationData{NotificationType::EmptyColorChangeCode, NotificationLevel::PrintInfoNotificationLevel, 10, std::string(_devL("value can not be empty when you add a G-code for color change.\nPlease check the \"Color Change G-code\" in \"Printer Settings > Custom G-code\"").mb_str())}, NotificationData{NotificationType::EmptyAutoColorChange, NotificationLevel::PrintInfoNotificationLevel, 10, diff --git a/src/slic3r/GUI/ObjColorDialog.cpp b/src/slic3r/GUI/ObjColorDialog.cpp index fcd284fc2..cac9c133e 100644 --- a/src/slic3r/GUI/ObjColorDialog.cpp +++ b/src/slic3r/GUI/ObjColorDialog.cpp @@ -42,7 +42,7 @@ static const char g_min_cluster_color = 1; static const char g_max_color = (int) EnforcerBlockerType::ExtruderMax; const StateColor ok_btn_bg(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); const StateColor ok_btn_disable_bg(std::pair(wxColour(205, 201, 201), StateColor::Pressed), std::pair(wxColour(205, 201, 201), StateColor::Hovered), std::pair(wxColour(205, 201, 201), StateColor::Normal)); @@ -72,7 +72,7 @@ wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error) btn_sizer->AddStretchSpacer(); StateColor ok_btn_bd( - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); StateColor ok_btn_text( std::pair(wxColour(255, 255, 254), StateColor::Normal) @@ -91,10 +91,10 @@ wxBoxSizer* ObjColorDialog::create_btn_sizer(long flags,bool exist_error) StateColor calc_btn_bg( std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); StateColor calc_btn_bd( - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); StateColor calc_btn_text( std::pair(wxColour(255, 255, 254), StateColor::Normal) @@ -558,8 +558,8 @@ wxBoxSizer *ObjColorPanel::create_approximate_match_btn_sizer(wxWindow *parent) { auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); StateColor calc_btn_bg(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); - StateColor calc_btn_bd(std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); + StateColor calc_btn_bd(std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor calc_btn_text(std::pair(wxColour(255, 255, 254), StateColor::Normal)); //create btn m_quick_approximate_match_btn = new Button(parent, _L("Color match")); @@ -584,8 +584,8 @@ wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent) { auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); StateColor calc_btn_bg(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); - StateColor calc_btn_bd(std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); + StateColor calc_btn_bd(std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor calc_btn_text(std::pair(wxColour(255, 255, 254), StateColor::Normal)); // create btn m_quick_add_btn = new Button(parent, _L("Append")); @@ -610,8 +610,8 @@ wxBoxSizer *ObjColorPanel::create_reset_btn_sizer(wxWindow *parent) { auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); StateColor calc_btn_bg(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); - StateColor calc_btn_bd(std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); + StateColor calc_btn_bd(std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor calc_btn_text(std::pair(wxColour(255, 255, 254), StateColor::Normal)); // create btn m_quick_reset_btn = new Button(parent, _L("Reset")); diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index e044cc60c..18dfd436c 100644 --- a/src/slic3r/GUI/ParamsPanel.cpp +++ b/src/slic3r/GUI/ParamsPanel.cpp @@ -133,9 +133,9 @@ Button *TipsDialog::add_button(wxWindowID btn_id, const wxString &label, bool se Button* btn = new Button(this, label, "", 0, 0, btn_id); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); - StateColor btn_bd_green(std::pair(wxColour(0, 174, 66), StateColor::Normal)); + StateColor btn_bd_green(std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_text_green(std::pair(wxColour(255, 255, 254), StateColor::Normal)); @@ -276,21 +276,23 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c m_top_panel->SetBackgroundColor2(0xF1F1F1); m_process_icon = new ScalableButton(m_top_panel, wxID_ANY, "process"); - + m_process_icon->Hide(); m_title_label = new Label(m_top_panel, _L("Process")); - + m_title_label->Hide(); //int width, height; // BBS: new layout m_mode_region = new SwitchButton(m_top_panel); m_mode_region->SetMaxSize({em_unit(this) * 12, -1}); m_mode_region->SetLabels(_L("Global"), _L("Objects")); + //m_mode_region->Hide(); //m_mode_region->GetSize(&width, &height); m_tips_arrow = new ScalableButton(m_top_panel, wxID_ANY, "tips_arrow"); m_tips_arrow->Hide(); m_title_view = new Label(m_top_panel, _L("Advance")); m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT); - + m_title_view->Hide(); + m_mode_view->Hide(); // BBS: new layout //m_search_btn = new ScalableButton(m_top_panel, wxID_ANY, "search", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true); //m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), "Ctrl+F")); @@ -299,11 +301,11 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c m_compare_btn = new ScalableButton(m_top_panel, wxID_ANY, "compare", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true); m_compare_btn->SetToolTip(_L("Compare presets")); m_compare_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { wxGetApp().mainframe->diff_dialog.show(); })); - + m_compare_btn->Hide(); m_setting_btn = new ScalableButton(m_top_panel, wxID_ANY, "table", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true); m_setting_btn->SetToolTip(_L("View all object's settings")); m_setting_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().plater()->PopupObjectTable(-1, -1, {0, 0}); }); - + m_setting_btn->Hide(); m_highlighter.set_timer_owner(this, 0); this->Bind(wxEVT_TIMER, [this](wxTimerEvent &) { @@ -422,21 +424,21 @@ void ParamsPanel::create_layout() if (m_top_panel) { m_mode_sizer = new wxBoxSizer( wxHORIZONTAL ); m_mode_sizer->AddSpacer(FromDIP(10)); - m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER); - m_mode_sizer->AddSpacer(FromDIP(10)); - m_mode_sizer->Add( m_title_label, 0, wxALIGN_CENTER ); - m_mode_sizer->AddStretchSpacer(2); + //m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER); + //m_mode_sizer->AddSpacer(FromDIP(10)); + //m_mode_sizer->Add( m_title_label, 0, wxALIGN_CENTER ); + //m_mode_sizer->AddStretchSpacer(2); m_mode_sizer->Add(m_mode_region, 0, wxALIGN_CENTER); m_mode_sizer->AddStretchSpacer(1); - m_mode_sizer->Add(m_tips_arrow, 0, wxALIGN_CENTER); - m_mode_sizer->AddStretchSpacer(12); - m_mode_sizer->Add( m_title_view, 0, wxALIGN_CENTER ); - m_mode_sizer->AddSpacer(FromDIP(2)); - m_mode_sizer->Add(m_mode_view, 0, wxALIGN_CENTER); - m_mode_sizer->AddSpacer(FromDIP(10)); - m_mode_sizer->Add(m_setting_btn, 0, wxALIGN_CENTER); - m_mode_sizer->AddSpacer(FromDIP(12)); - m_mode_sizer->Add(m_compare_btn, 0, wxALIGN_CENTER); + //m_mode_sizer->Add(m_tips_arrow, 0, wxALIGN_CENTER); + //m_mode_sizer->AddStretchSpacer(12); + //m_mode_sizer->Add( m_title_view, 0, wxALIGN_CENTER ); + //m_mode_sizer->AddSpacer(FromDIP(2)); + //m_mode_sizer->Add(m_mode_view, 0, wxALIGN_CENTER); + //m_mode_sizer->AddSpacer(FromDIP(10)); + //m_mode_sizer->Add(m_setting_btn, 0, wxALIGN_CENTER); + //m_mode_sizer->AddSpacer(FromDIP(12)); + //m_mode_sizer->Add(m_compare_btn, 0, wxALIGN_CENTER); m_mode_sizer->AddSpacer(FromDIP(16)); //m_mode_sizer->Add( m_search_btn, 0, wxALIGN_CENTER ); //m_mode_sizer->AddSpacer(16); @@ -467,6 +469,9 @@ void ParamsPanel::create_layout() if (m_tab_print_layer) { m_left_sizer->Add(m_tab_print_layer, 0, wxEXPAND); } + if (m_tab_config) { + m_left_sizer->Add(m_tab_config, 0, wxEXPAND); + } if (m_tab_filament) { //m_filament_sizer = new wxBoxSizer( wxVERTICAL ); @@ -541,6 +546,9 @@ void ParamsPanel::refresh_tabs() case Preset::TYPE_PRINTER: m_tab_printer = tab; break; + case Preset::TYPE_CONFIG: + m_tab_config = tab; + break; default: break; } @@ -569,7 +577,7 @@ void ParamsPanel::OnActivate() BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": first time opened, set current tab to print"); // BBS: open/close tab //m_current_tab = m_tab_print; - set_active_tab(m_tab_print ? m_tab_print : m_tab_filament); + set_active_tab(m_tab_print ? m_tab_print : m_tab_filament ? m_tab_filament : m_tab_config); } Tab* cur_tab = dynamic_cast (m_current_tab); if (cur_tab) @@ -647,7 +655,8 @@ void ParamsPanel::set_active_tab(wxPanel* tab) {m_tab_print_layer, nullptr}, {m_tab_print_plate, nullptr}, {m_tab_filament, m_staticline_filament}, - {m_tab_printer, m_staticline_printer}})) { + {m_tab_printer, m_staticline_printer}, + {m_tab_config, m_staticline_config} })) { if (!t.first) continue; t.first->Show(tab == t.first); if (!t.second) continue; @@ -656,7 +665,16 @@ void ParamsPanel::set_active_tab(wxPanel* tab) } m_left_sizer->Layout(); if (auto dialog = dynamic_cast(GetParent())) { - wxString title = cur_tab->type() == Preset::TYPE_FILAMENT ? _L("Filament settings") : _L("Printer settings"); + wxString title; + if (cur_tab->type() == Preset::TYPE_FILAMENT) { + title = _L("Filament settings"); + } + else if (cur_tab->type() == Preset::TYPE_PRINTER) { + title = _L("Printer settings"); + } + else { + title = _L("Configuration settings"); + } dialog->SetTitle(title); } } @@ -709,7 +727,7 @@ void ParamsPanel::msw_rescale() ((SwitchButton* )m_mode_region)->Rescale(); if (m_mode_view) ((SwitchButton* )m_mode_view)->Rescale(); - for (auto tab : {m_tab_print, m_tab_print_plate, m_tab_print_object, m_tab_print_part, m_tab_print_layer, m_tab_filament, m_tab_printer}) { + for (auto tab : {m_tab_print, m_tab_print_plate, m_tab_print_object, m_tab_print_part, m_tab_print_layer, m_tab_filament, m_tab_printer, m_tab_config}) { if (tab) dynamic_cast(tab)->msw_rescale(); } //((Button*)m_export_to_file)->Rescale(); @@ -831,6 +849,11 @@ void ParamsPanel::delete_subwindows() delete m_staticline_print_part; m_staticline_print_part = nullptr; } + if (m_staticline_config) + { + delete m_staticline_config; + m_staticline_config = nullptr; + } if (m_staticline_print_object) { diff --git a/src/slic3r/GUI/ParamsPanel.hpp b/src/slic3r/GUI/ParamsPanel.hpp index 4e286c270..55367230f 100644 --- a/src/slic3r/GUI/ParamsPanel.hpp +++ b/src/slic3r/GUI/ParamsPanel.hpp @@ -104,6 +104,8 @@ class ParamsPanel : public wxPanel wxStaticLine* m_staticline_printer { nullptr }; //wxBoxSizer* m_printer_sizer { nullptr }; wxPanel* m_tab_printer { nullptr }; + wxStaticLine* m_staticline_config{ nullptr }; + wxPanel* m_tab_config{ nullptr }; //wxStaticLine* m_staticline_buttons { nullptr }; // BBS: new layout wxBoxSizer* m_button_sizer { nullptr }; diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index 1ab467214..b87adfa63 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -369,7 +369,7 @@ void PhysicalPrinterDialog::update_preset_input() { } if (m_valid_type == Valid && - (m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer")) { + (m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer" || m_preset_name == "Default Config")) { info_line = _L("Name is unavailable."); m_valid_type = NoValid; } diff --git a/src/slic3r/GUI/PlateSettingsDialog.cpp b/src/slic3r/GUI/PlateSettingsDialog.cpp index 8db2104f7..f22ea2fff 100644 --- a/src/slic3r/GUI/PlateSettingsDialog.cpp +++ b/src/slic3r/GUI/PlateSettingsDialog.cpp @@ -451,7 +451,7 @@ PlateSettingsDialog::PlateSettingsDialog(wxWindow* parent, const wxString& title auto sizer_button = new wxBoxSizer(wxHORIZONTAL); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(*wxWHITE, StateColor::Normal)); @@ -656,7 +656,7 @@ PlateNameEditDialog::PlateNameEditDialog(wxWindow *parent, wxWindowID id, const auto sizer_button = new wxBoxSizer(wxHORIZONTAL); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), std::pair(*wxWHITE, StateColor::Normal)); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 64f2f1366..224f970b8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1534,8 +1534,8 @@ Sidebar::Sidebar(Plater *parent) p->m_panel_printer_content = new wxPanel(p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); p->m_panel_printer_content->SetBackgroundColour(wxColour(255, 255, 255)); - StateColor panel_bd_col(std::pair(wxColour(0x00AE42), StateColor::Pressed), - std::pair(wxColour(0x00AE42), StateColor::Hovered), + StateColor panel_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), + std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(0xEEEEEE), StateColor::Normal)); p->panel_printer_preset = new StaticBox(p->m_panel_printer_content); @@ -1679,8 +1679,8 @@ Sidebar::Sidebar(Plater *parent) std::pair(wxColour(0xF8F8F8), StateColor::Hovered), std::pair(wxColour(0xF8F8F8), StateColor::Normal)); StateColor btn_sync_bd_col( - std::pair(wxColour(0x00AE42), StateColor::Pressed), - std::pair(wxColour(0x00AE42), StateColor::Hovered), + std::pair(wxColour(0x9A5F21), StateColor::Pressed), + std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(0xEEEEEE), StateColor::Normal)); btn_sync->SetBackgroundColor(btn_sync_bg_col); btn_sync->SetBorderColor(btn_sync_bd_col); @@ -1774,8 +1774,8 @@ Sidebar::Sidebar(Plater *parent) std::pair(wxColour(107, 107, 106), StateColor::Hovered), std::pair(wxColour(107, 107, 106), StateColor::Normal)); - StateColor flush_bd_col(std::pair(wxColour(0, 174, 66), StateColor::Pressed), - std::pair(wxColour(0, 174, 66), StateColor::Hovered), + StateColor flush_bd_col(std::pair(wxColour(0x9A5F21), StateColor::Pressed), + std::pair(wxColour(0x9A5F21), StateColor::Hovered), std::pair(wxColour(172, 172, 172), StateColor::Normal)); p->m_flushing_volume_btn->SetBackgroundColor(flush_bg_col); @@ -2208,6 +2208,10 @@ void Sidebar::update_all_preset_comboboxes() p->combo_printer->update(); update_printer_thumbnail(); } + + //todo + /*if (p->combo_config) + p->combo_config->update();*/ } void Sidebar::update_presets(Preset::Type preset_type) @@ -2256,6 +2260,18 @@ void Sidebar::update_presets(Preset::Type preset_type) } break; } + case Preset::TYPE_CONFIG: + //wxGetApp().mainframe->m_param_panel; + //p->combo_print->update(); + { + /* Tab* config_tab = wxGetApp().get_tab(Preset::TYPE_CONFIG); + if (config_tab) { + config_tab->get_combo_box()->update(); + }*/ + // todo + //p->combo_config->update(); + break; + } case Preset::TYPE_SLA_PRINT: ;// p->combo_sla_print->update(); break; @@ -4406,7 +4422,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) panel_sizer->Add(preview, 1, wxEXPAND | wxALL, 0); panel_sizer->Add(assemble_view, 1, wxEXPAND | wxALL, 0); vsizer->Add(panel_sizer, 1, wxEXPAND | wxALL, 0); - hsizer->Add(vsizer, 1, wxEXPAND | wxALL, 0); + //hsizer->Add(vsizer, 1, wxEXPAND | wxALL, 0); + hsizer->Insert(0, vsizer, 1, wxEXPAND | wxALL, 0); q->SetSizer(hsizer); @@ -11651,6 +11668,8 @@ void Plater::_calib_pa_pattern(const Calib_Params ¶ms) wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->reload_config(); const DynamicPrintConfig full_config = wxGetApp().preset_bundle->full_config(); PresetBundle * preset_bundle = wxGetApp().preset_bundle; @@ -11706,6 +11725,8 @@ void Plater::_calib_pa_tower(const Calib_Params ¶ms) wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_PRINTER)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->reload_config(); auto new_height = std::ceil((params.end - params.start) / params.step) + 1; auto obj_bb = model().objects[0]->bounding_box(); @@ -11820,6 +11841,8 @@ void Plater::calib_flowrate(int pass) wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_PRINTER)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->reload_config(); try { json js; @@ -11873,6 +11896,8 @@ void Plater::calib_temp(const Calib_Params ¶ms) wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->reload_config(); // cut upper auto obj_bb = model().objects[0]->bounding_box(); @@ -11963,6 +11988,8 @@ void Plater::calib_max_vol_speed(const Calib_Params ¶ms) wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); wxGetApp().get_tab(Preset::TYPE_PRINTER)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->reload_config(); // cut upper auto obj_bb = obj->bounding_box(); @@ -12070,6 +12097,8 @@ void Plater::calib_VFA(const Calib_Params ¶ms) wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_CONFIG)->update_ui_from_settings(); // cut upper auto obj_bb = model().objects[0]->bounding_box(); @@ -12444,10 +12473,10 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename) m_confirm = new Button(this, _L("OK")); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_confirm->SetBackgroundColor(btn_bg_green); - m_confirm->SetBorderColor(wxColour(0, 174, 66)); + m_confirm->SetBorderColor(wxColour(0x9A5F21)); m_confirm->SetTextColor(wxColour("#FFFFFE")); m_confirm->SetSize(PROJECT_DROP_DIALOG_BUTTON_SIZE); m_confirm->SetMinSize(PROJECT_DROP_DIALOG_BUTTON_SIZE); diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 3ff702990..e747a1611 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -109,6 +109,11 @@ PresetComboBox::PresetComboBox(wxWindow* parent, Preset::Type preset_type, const m_main_bitmap_name = "printer"; break; } + case Preset::TYPE_CONFIG: { + m_collection = &m_preset_bundle->configs; + m_main_bitmap_name = "config"; + break; + } default: break; } @@ -852,6 +857,15 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset } }); } + else if (m_type == Preset::TYPE_CONFIG) { + edit_btn = new ScalableButton(parent, wxID_ANY, "config"); + edit_btn->SetToolTip(_L("Click to edit preset")); + + edit_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent) + { + show_edit_menu(); + }); + } else { edit_btn = new ScalableButton(parent, wxID_ANY, "cog"); edit_btn->SetToolTip(_L("Click to edit preset")); @@ -1296,7 +1310,7 @@ void PlaterPresetComboBox::update() } }*/ - if (m_type == Preset::TYPE_PRINTER || m_type == Preset::TYPE_FILAMENT || m_type == Preset::TYPE_SLA_MATERIAL) { + if (m_type == Preset::TYPE_PRINTER || m_type == Preset::TYPE_FILAMENT || m_type == Preset::TYPE_SLA_MATERIAL || m_type == Preset::TYPE_CONFIG) { wxBitmap* bmp = get_bmp("edit_preset_list", wide_icons, "edit_uni"); assert(bmp); @@ -1304,6 +1318,8 @@ void PlaterPresetComboBox::update() set_label_marker(Append(separator(L("Add/Remove filaments")), *bmp), LABEL_ITEM_WIZARD_FILAMENTS); else if (m_type == Preset::TYPE_SLA_MATERIAL) set_label_marker(Append(separator(L("Add/Remove materials")), *bmp), LABEL_ITEM_WIZARD_MATERIALS); + else if (m_type == Preset::TYPE_CONFIG) + set_label_marker(Append(separator(L("Add/Remove filaments")), *bmp), LABEL_ITEM_WIZARD_FILAMENTS); else { set_label_marker(Append(separator(L("Select/Remove printers(system presets)")), *bmp), LABEL_ITEM_WIZARD_PRINTERS); set_label_marker(Append(separator(L("Create printer")), *bmp), LABEL_ITEM_WIZARD_ADD_PRINTERS); diff --git a/src/slic3r/GUI/PresetComboBoxes.hpp b/src/slic3r/GUI/PresetComboBoxes.hpp index fb92adf03..0c9c365a9 100644 --- a/src/slic3r/GUI/PresetComboBoxes.hpp +++ b/src/slic3r/GUI/PresetComboBoxes.hpp @@ -48,7 +48,7 @@ public: LABEL_ITEM_WIZARD_FILAMENTS, LABEL_ITEM_WIZARD_MATERIALS, LABEL_ITEM_WIZARD_ADD_PRINTERS, - + LABEL_ITEM_WIZARD_CONFIGS, LABEL_ITEM_MAX, }; diff --git a/src/slic3r/GUI/PrivacyUpdateDialog.cpp b/src/slic3r/GUI/PrivacyUpdateDialog.cpp index c04896236..8e639f2da 100644 --- a/src/slic3r/GUI/PrivacyUpdateDialog.cpp +++ b/src/slic3r/GUI/PrivacyUpdateDialog.cpp @@ -67,7 +67,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const auto sizer_button = new wxBoxSizer(wxHORIZONTAL); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(220, 220, 220), StateColor::Hovered), std::pair(wxColour(238, 238, 238), StateColor::Normal)); diff --git a/src/slic3r/GUI/Project.hpp b/src/slic3r/GUI/Project.hpp index 6e594b7be..37283d725 100644 --- a/src/slic3r/GUI/Project.hpp +++ b/src/slic3r/GUI/Project.hpp @@ -37,7 +37,7 @@ #define AUFILE_GREY500 wxColour(158, 158, 158) #define AUFILE_GREY300 wxColour(238, 238, 238) #define AUFILE_GREY200 wxColour(248, 248, 248) -#define AUFILE_BRAND wxColour(0, 174, 66) +#define AUFILE_BRAND wxColour(0x9A5F21) #define AUFILE_BRAND_TRANSPARENT wxColour(215, 232, 222) //#define AUFILE_PICTURES_SIZE wxSize(FromDIP(300), FromDIP(300)) //#define AUFILE_PICTURES_PANEL_SIZE wxSize(FromDIP(300), FromDIP(340)) diff --git a/src/slic3r/GUI/PublishDialog.cpp b/src/slic3r/GUI/PublishDialog.cpp index 7a7f6f136..2a2656f33 100644 --- a/src/slic3r/GUI/PublishDialog.cpp +++ b/src/slic3r/GUI/PublishDialog.cpp @@ -95,7 +95,7 @@ PublishDialog::PublishDialog(Plater *plater) std::pair(TEXT_LIGHT_GRAY, StateColor::Normal)); m_btn_cancel->SetFont(Label::Body_12); m_btn_cancel->SetBackgroundColor(btn_bg_green); - m_btn_cancel->SetBorderColor(wxColour(0, 174, 66)); + m_btn_cancel->SetBorderColor(wxColour(0x9A5F21)); m_btn_cancel->SetTextColor(text_color); m_btn_cancel->SetSize(wxSize(FromDIP(60), FromDIP(20))); m_btn_cancel->SetMinSize(wxSize(FromDIP(60), FromDIP(20))); diff --git a/src/slic3r/GUI/RecenterDialog.cpp b/src/slic3r/GUI/RecenterDialog.cpp index 5e7b46cb9..f49fc1ee2 100644 --- a/src/slic3r/GUI/RecenterDialog.cpp +++ b/src/slic3r/GUI/RecenterDialog.cpp @@ -35,9 +35,9 @@ RecenterDialog::RecenterDialog(wxWindow* parent, wxWindowID id, const wxString& m_button_confirm->SetMinSize(wxSize(-1, FromDIP(24))); m_button_confirm->SetCornerRadius(FromDIP(12)); StateColor confirm_btn_bg(std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_confirm->SetBackgroundColor(confirm_btn_bg); - m_button_confirm->SetBorderColor(wxColour(0, 174, 66)); + m_button_confirm->SetBorderColor(wxColour(0x9A5F21)); m_button_confirm->SetTextColor(*wxWHITE); m_button_close = new Button(this, _L("Close")); diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 01565c2b7..a1ddb893a 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -1562,7 +1562,7 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow *parent) comfirm_last_enter_text = _L("3. Please obtain the device SN from the printer side; it is usually found in the device information on the printer screen."); Label *wiki = new Label(this, ::Label::Body_13, _L("View wiki"), LB_AUTO_WRAP); - wiki->SetForegroundColour(wxColour(0, 174, 66)); + wiki->SetForegroundColour(wxColour(0x9A5F21)); wiki->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {SetCursor(wxCURSOR_HAND);}); wiki->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {SetCursor(wxCURSOR_ARROW);}); wiki->Bind(wxEVT_LEFT_DOWN, [this](auto &e) { diff --git a/src/slic3r/GUI/SavePresetDialog.cpp b/src/slic3r/GUI/SavePresetDialog.cpp index 26310e3c7..c8a1b2771 100644 --- a/src/slic3r/GUI/SavePresetDialog.cpp +++ b/src/slic3r/GUI/SavePresetDialog.cpp @@ -202,7 +202,7 @@ void SavePresetDialog::Item::update() } if (m_valid_type == Valid && - (m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer")) { + (m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer" || m_preset_name == "Default Config")) { info_line = _L("Name is unavailable."); m_valid_type = NoValid; } @@ -352,9 +352,9 @@ void SavePresetDialog::build(std::vector types, std::string suffix StateColor btn_bg_green(std::pair(wxColour(144, 144, 144), StateColor::Disabled), std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); StateColor btn_br_green(std::pair(wxColour(144, 144, 144), StateColor::Disabled), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_confirm->SetBackgroundColor(btn_bg_green); m_confirm->SetBorderColor(btn_br_green); m_confirm->SetTextColor(wxColour("#FFFFFE")); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index f8cb52e9a..8a61d8663 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -330,7 +330,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) // if (m_print_type != PrintFromType::FROM_SDCARD_VIEW) {e.Skip();} //}); m_btn_bg_enable = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_refresh = new ScalableButton(printer_staticbox, wxID_ANY, "refresh_printer", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,true); m_button_refresh->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_refresh, this); @@ -425,7 +425,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) m_sizer_autorefill = new wxBoxSizer(wxHORIZONTAL); m_ams_backup_tip = new Label(m_scroll_area, _L("Auto Refill")); m_ams_backup_tip->SetFont(::Label::Head_12); - m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42)); + m_ams_backup_tip->SetForegroundColour(wxColour(0x9A5F21)); m_ams_backup_tip->SetBackgroundColour(*wxWHITE); img_ams_backup = new wxStaticBitmap(m_scroll_area, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0); img_ams_backup->SetBackgroundColour(*wxWHITE); @@ -699,7 +699,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) m_statictext_finish = new wxStaticText(m_panel_finish, wxID_ANY, L("send completed"), wxDefaultPosition, wxDefaultSize, 0); m_statictext_finish->Wrap(-1); - m_statictext_finish->SetForegroundColour(wxColour(0, 174, 66)); + m_statictext_finish->SetForegroundColour(wxColour(0x9A5F21)); m_sizer_finish_h->Add(m_statictext_finish, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); m_sizer_finish_v->Add(m_sizer_finish_h, 1, wxALIGN_CENTER, 0); @@ -2494,7 +2494,7 @@ void SelectMachineDialog::save_option_vals(MachineObject *obj) { void SelectMachineDialog::Enable_Auto_Refill(bool enable) { if (enable) { - m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42)); + m_ams_backup_tip->SetForegroundColour(wxColour(0x9A5F21)); } else { m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90)); diff --git a/src/slic3r/GUI/SelectMachinePop.cpp b/src/slic3r/GUI/SelectMachinePop.cpp index 34049f0af..f94aa98d2 100644 --- a/src/slic3r/GUI/SelectMachinePop.cpp +++ b/src/slic3r/GUI/SelectMachinePop.cpp @@ -883,9 +883,9 @@ EditDevNameDialog::EditDevNameDialog(Plater *plater /*= nullptr*/) m_button_confirm = new Button(this, _L("Confirm")); - StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(0, 174, 66), StateColor::Normal)); + StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_confirm->SetBackgroundColor(btn_bg_green); - m_button_confirm->SetBorderColor(wxColour(0, 174, 66)); + m_button_confirm->SetBorderColor(wxColour(0x9A5F21)); m_button_confirm->SetTextColor(wxColour(255, 255, 255)); m_button_confirm->SetSize(wxSize(FromDIP(72), FromDIP(24))); m_button_confirm->SetMinSize(wxSize(FromDIP(72), FromDIP(24))); diff --git a/src/slic3r/GUI/SelectMachinePop.hpp b/src/slic3r/GUI/SelectMachinePop.hpp index 854c40834..2cab29566 100644 --- a/src/slic3r/GUI/SelectMachinePop.hpp +++ b/src/slic3r/GUI/SelectMachinePop.hpp @@ -71,7 +71,7 @@ wxDECLARE_EVENT(EVT_BIND_MACHINE, wxCommandEvent); #define SELECT_MACHINE_GREY900 wxColour(38, 46, 48) #define SELECT_MACHINE_GREY600 wxColour(144, 144, 144) #define SELECT_MACHINE_GREY400 wxColour(206, 206, 206) -#define SELECT_MACHINE_BRAND wxColour(0, 174, 66) +#define SELECT_MACHINE_BRAND wxColour(0x9A5F21) #define SELECT_MACHINE_REMIND wxColour(255, 111, 0) #define SELECT_MACHINE_LIGHT_GREEN wxColour(219, 253, 231) diff --git a/src/slic3r/GUI/SendMultiMachinePage.cpp b/src/slic3r/GUI/SendMultiMachinePage.cpp index 900194f1a..64742b46f 100644 --- a/src/slic3r/GUI/SendMultiMachinePage.cpp +++ b/src/slic3r/GUI/SendMultiMachinePage.cpp @@ -208,7 +208,7 @@ void SendDeviceItem::doRender(wxDC& dc) //device state if (state_printable <= 2) { - dc.SetTextForeground(wxColour(0, 174, 66)); + dc.SetTextForeground(wxColour(0x9A5F21)); } else { dc.SetTextForeground(wxColour(208, 27, 27)); @@ -233,7 +233,7 @@ void SendDeviceItem::doRender(wxDC& dc) } if (m_hover) { - dc.SetPen(wxPen(wxColour(0, 174, 66))); + dc.SetPen(wxPen(wxColour(0x9A5F21))); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRoundedRectangle(0, 0, size.x, size.y, 3); } @@ -1323,7 +1323,7 @@ wxPanel* SendMultiMachinePage::create_page() auto m_btn_bg_enable = StateColor( std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal) + std::pair(wxColour(0x9A5F21), StateColor::Normal) ); m_button_add = new Button(main_page, _L("Add")); @@ -1384,7 +1384,7 @@ wxPanel* SendMultiMachinePage::create_page() // add send button btn_bg_enable = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_send = new Button(main_page, _L("Send")); m_button_send->SetBackgroundColor(btn_bg_enable); diff --git a/src/slic3r/GUI/SendToPrinter.cpp b/src/slic3r/GUI/SendToPrinter.cpp index 0fd34db87..0b9db72b8 100644 --- a/src/slic3r/GUI/SendToPrinter.cpp +++ b/src/slic3r/GUI/SendToPrinter.cpp @@ -258,7 +258,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater) m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5)); btn_bg_enable = StateColor(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); m_button_refresh = new Button(this, _L("Refresh")); m_button_refresh->SetBackgroundColor(btn_bg_enable); @@ -330,7 +330,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater) m_statictext_finish = new wxStaticText(m_panel_finish, wxID_ANY, L("send completed"), wxDefaultPosition, wxDefaultSize, 0); m_statictext_finish->Wrap(-1); - m_statictext_finish->SetForegroundColour(wxColour(0, 174, 66)); + m_statictext_finish->SetForegroundColour(wxColour(0x9A5F21)); m_sizer_finish_h->Add(m_statictext_finish, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); m_sizer_finish_v->Add(m_sizer_finish_h, 1, wxALIGN_CENTER, 0); diff --git a/src/slic3r/GUI/SlicingProgressNotification.cpp b/src/slic3r/GUI/SlicingProgressNotification.cpp index 7ddd974f6..c525fc46f 100644 --- a/src/slic3r/GUI/SlicingProgressNotification.cpp +++ b/src/slic3r/GUI/SlicingProgressNotification.cpp @@ -366,7 +366,7 @@ void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_bar(c ImGuiWrapper& imgui = *wxGetApp().imgui(); - ImColor progress_color = ImColor(0, 174, 66, (int)(255 * m_current_fade_opacity)); + ImColor progress_color = ImColor(33, 95, 154, (int)(255 * m_current_fade_opacity)); ImColor bg_color = ImColor(217, 217, 217, (int)(255 * m_current_fade_opacity)); ImVec2 lineStart = pos; diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 99ad012f4..7aec76125 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -46,13 +46,13 @@ static const wxColour STATIC_BOX_LINE_COL = wxColour(238, 238, 238); static const wxColour BUTTON_NORMAL1_COL = wxColour(238, 238, 238); static const wxColour BUTTON_NORMAL2_COL = wxColour(206, 206, 206); static const wxColour BUTTON_PRESS_COL = wxColour(172, 172, 172); -static const wxColour BUTTON_HOVER_COL = wxColour(0, 174, 66); +static const wxColour BUTTON_HOVER_COL = wxColour(0x9A5F21); static const wxColour DISCONNECT_TEXT_COL = wxColour(171, 172, 172); static const wxColour NORMAL_TEXT_COL = wxColour(48,58,60); static const wxColour NORMAL_FAN_TEXT_COL = wxColour(107, 107, 107); static const wxColour WARNING_INFO_BG_COL = wxColour(255, 111, 0); -static const wxColour STAGE_TEXT_COL = wxColour(0, 174, 66); +static const wxColour STAGE_TEXT_COL = wxColour(0x9A5F21); static const wxColour GROUP_STATIC_LINE_COL = wxColour(206, 206, 206); @@ -715,12 +715,12 @@ void PrintingTaskPanel::create_panel(wxWindow* parent) m_staticText_progress_percent = new wxStaticText(penel_text, wxID_ANY, "0", wxDefaultPosition, wxDefaultSize, 0); m_staticText_progress_percent->SetFont(::Label::Head_18); m_staticText_progress_percent->SetMaxSize(wxSize(-1, FromDIP(20))); - m_staticText_progress_percent->SetForegroundColour(wxColour(0, 174, 66)); + m_staticText_progress_percent->SetForegroundColour(wxColour(0x9A5F21)); m_staticText_progress_percent_icon = new wxStaticText(penel_text, wxID_ANY, "%", wxDefaultPosition, wxDefaultSize, 0); m_staticText_progress_percent_icon->SetFont(::Label::Body_11); m_staticText_progress_percent_icon->SetMaxSize(wxSize(-1, FromDIP(13))); - m_staticText_progress_percent_icon->SetForegroundColour(wxColour(0, 174, 66)); + m_staticText_progress_percent_icon->SetForegroundColour(wxColour(0x9A5F21)); sizer_percent->Add(m_staticText_progress_percent, 0, 0, 0); @@ -1705,7 +1705,7 @@ wxBoxSizer *StatusBasePanel::create_misc_control(wxWindow *parent) StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int)StateColor::Disabled), std::make_pair(NORMAL_FAN_TEXT_COL, (int)StateColor::Normal))); m_switch_fan->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) { - m_fan_panel->SetBackgroundColor(wxColour(0, 174, 66)); + m_fan_panel->SetBackgroundColor(wxColour(0x9A5F21)); }); m_switch_fan->Bind(wxEVT_LEAVE_WINDOW, [this, parent](auto& e) { diff --git a/src/slic3r/GUI/StepMeshDialog.cpp b/src/slic3r/GUI/StepMeshDialog.cpp index 41f24608e..fd4dadf99 100644 --- a/src/slic3r/GUI/StepMeshDialog.cpp +++ b/src/slic3r/GUI/StepMeshDialog.cpp @@ -123,7 +123,7 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line wxStaticText *tips = new wxStaticText(this, wxID_ANY, _L("View Wiki for more information")); wxFont font(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false); font.SetUnderlined(true); - tips->SetForegroundColour(StateColor::darkModeColorFor(wxColour(0, 174, 66))); + tips->SetForegroundColour(StateColor::darkModeColorFor(wxColour(0x9A5F21))); tips->SetFont(font); tips->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/software/bambu-studio/step"); diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index d02d1730f..8854fdd65 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -2101,7 +2101,7 @@ void SyncAmsInfoDialog::Enable_Auto_Refill(bool enable) { if (!m_ams_backup_tip) { return; } if (enable) { - m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42)); + m_ams_backup_tip->SetForegroundColour(wxColour(0x9A5F21)); } else { m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90)); } diff --git a/src/slic3r/GUI/TabButton.cpp b/src/slic3r/GUI/TabButton.cpp index d4e22c0b5..c95a5f0d1 100644 --- a/src/slic3r/GUI/TabButton.cpp +++ b/src/slic3r/GUI/TabButton.cpp @@ -14,7 +14,7 @@ EVT_PAINT(TabButton::paintEvent) END_EVENT_TABLE() -static wxColour BORDER_HOVER_COL = wxColour(0, 174, 66); +static wxColour BORDER_HOVER_COL = wxColour(0x9A5F21); const static wxColour TAB_BUTTON_BG = wxColour("#FEFFFF"); const static wxColour TAB_BUTTON_SEL = wxColour(219, 253, 213, 255); diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 3d4b63e13..18e968603 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1011,7 +1011,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ // Add Buttons wxFont btn_font = this->GetFont().Scaled(1.4f); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); auto add_btn = [this, m_sizer_button, btn_font, dependent_presets, btn_bg_green](Button **btn, int &btn_id, Action close_act, const wxString &label, bool focus, bool process_enable = true) { @@ -1019,7 +1019,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ if (focus) { (*btn)->SetBackgroundColor(btn_bg_green); - (*btn)->SetBorderColor(wxColour(0, 174, 66)); + (*btn)->SetBorderColor(wxColour(0x9A5F21)); (*btn)->SetTextColor(wxColour("#FFFFFE")); } else { (*btn)->SetTextColor(wxColour(107, 107, 107)); diff --git a/src/slic3r/GUI/UpgradePanel.cpp b/src/slic3r/GUI/UpgradePanel.cpp index 4c28a9712..e17c681f2 100644 --- a/src/slic3r/GUI/UpgradePanel.cpp +++ b/src/slic3r/GUI/UpgradePanel.cpp @@ -11,7 +11,7 @@ namespace Slic3r { namespace GUI { -static const wxColour TEXT_NORMAL_CLR = wxColour(0, 174, 66); +static const wxColour TEXT_NORMAL_CLR = wxColour(0x9A5F21); static const wxColour TEXT_FAILED_CLR = wxColour(255, 111, 0); static const std::unordered_map ACCESSORY_DISPLAY_STR = { @@ -224,9 +224,12 @@ MachineInfoPanel::MachineInfoPanel(wxWindow* parent, wxWindowID id, const wxPoin m_button_upgrade_firmware = new Button(this, _L("Update firmware")); StateColor btn_bg(std::pair(wxColour(255, 255, 255), StateColor::Disabled), std::pair(wxColour(27, 136, 68), StateColor::Pressed), - std::pair(wxColour(61, 203, 115), StateColor::Hovered), std::pair(wxColour(0, 174, 66), StateColor::Enabled), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); - StateColor btn_bd(std::pair(wxColour(144, 144, 144), StateColor::Disabled), std::pair(wxColour(0, 174, 66), StateColor::Enabled)); + //std::pair(wxColour(61, 203, 115), StateColor::Hovered), std::pair(wxColour(0, 174, 66), StateColor::Enabled), + std::pair(wxColour(61, 203, 115), StateColor::Hovered), std::pair(wxColour(0x9A5F21), StateColor::Enabled), + //std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); + //StateColor btn_bd(std::pair(wxColour(144, 144, 144), StateColor::Disabled), std::pair(wxColour(0, 174, 66), StateColor::Enabled)); + StateColor btn_bd(std::pair(wxColour(144, 144, 144), StateColor::Disabled), std::pair(wxColour(0x9A5F21), StateColor::Enabled)); StateColor btn_text(std::pair(wxColour(144, 144, 144), StateColor::Disabled), std::pair(wxColour(255, 255, 255), StateColor::Enabled)); m_button_upgrade_firmware->SetBackgroundColor(btn_bg); m_button_upgrade_firmware->SetBorderColor(btn_bd); diff --git a/src/slic3r/GUI/Widgets/AMSItem.hpp b/src/slic3r/GUI/Widgets/AMSItem.hpp index 94daf20fa..9e344f642 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.hpp +++ b/src/slic3r/GUI/Widgets/AMSItem.hpp @@ -14,7 +14,7 @@ #include -#define AMS_CONTROL_BRAND_COLOUR wxColour(0, 174, 66) +#define AMS_CONTROL_BRAND_COLOUR wxColour(0x9A5F21) #define AMS_CONTROL_GRAY700 wxColour(107, 107, 107) #define AMS_CONTROL_GRAY800 wxColour(50, 58, 61) #define AMS_CONTROL_GRAY500 wxColour(172, 172, 172) diff --git a/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp b/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp index 737fe79c5..27ed3287a 100644 --- a/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp +++ b/src/slic3r/GUI/Widgets/AxisCtrlButton.cpp @@ -9,7 +9,8 @@ StateColor blank_bg(StateColor(std::make_pair(wxColour("#FFFFFF"), (int)StateCol static const wxColour BUTTON_BG_COL = wxColour("#EEEEEE"); static const wxColour BUTTON_IN_BG_COL = wxColour("#CECECE"); -static const wxColour bd = wxColour(0, 174, 66); +//static const wxColour bd = wxColour(0x9A5F21); +static const wxColour bd = wxColour(0x9A5F21); static const wxColour text_num_color = wxColour(0x898989); static const wxColour BUTTON_PRESS_COL = wxColour(172, 172, 172); static const double sqrt2 = std::sqrt(2); diff --git a/src/slic3r/GUI/Widgets/Button.cpp b/src/slic3r/GUI/Widgets/Button.cpp index 2c8cba910..01c2b629f 100644 --- a/src/slic3r/GUI/Widgets/Button.cpp +++ b/src/slic3r/GUI/Widgets/Button.cpp @@ -31,7 +31,8 @@ Button::Button() background_color = StateColor( std::make_pair(0xF0F0F1, (int) StateColor::Disabled), std::make_pair(0x37EE7C, (int) StateColor::Hovered | StateColor::Checked), - std::make_pair(0x00AE42, (int) StateColor::Checked), + //std::make_pair(0x00AE42, (int) StateColor::Checked), + std::make_pair(0x215F9A, (int)StateColor::Checked), std::make_pair(*wxLIGHT_GREY, (int) StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)); text_color = StateColor( diff --git a/src/slic3r/GUI/Widgets/ComboBox.cpp b/src/slic3r/GUI/Widgets/ComboBox.cpp index ca453e419..152eaccc3 100644 --- a/src/slic3r/GUI/Widgets/ComboBox.cpp +++ b/src/slic3r/GUI/Widgets/ComboBox.cpp @@ -52,7 +52,8 @@ ComboBox::ComboBox(wxWindow *parent, GetTextCtrl()->Hide(); TextInput::SetFont(Label::Body_14); TextInput::SetBorderColor(StateColor(std::make_pair(0xDBDBDB, (int) StateColor::Disabled), - std::make_pair(0x00AE42, (int) StateColor::Hovered), + //std::make_pair(0x00AE42, (int) StateColor::Hovered), + std::make_pair(0x215F9A, (int)StateColor::Hovered), std::make_pair(0xDBDBDB, (int) StateColor::Normal))); TextInput::SetBackgroundColor(StateColor(std::make_pair(0xF0F0F1, (int) StateColor::Disabled), std::make_pair(0xEDFAF2, (int) StateColor::Focused), diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index 04954229c..1589f7554 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -37,7 +37,8 @@ DropDown::DropDown(std::vector &items) , state_handler(this) , border_color(0xDBDBDB) , text_color(0x363636) - , selector_border_color(std::make_pair(0x00AE42, (int) StateColor::Hovered), + //, selector_border_color(std::make_pair(0x00AE42, (int) StateColor::Hovered), + , selector_border_color(std::make_pair(0x215F9A, (int)StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)) , selector_background_color(std::make_pair(0xEDFAF2, (int) StateColor::Checked), std::make_pair(*wxWHITE, (int) StateColor::Normal)) diff --git a/src/slic3r/GUI/Widgets/FanControl.cpp b/src/slic3r/GUI/Widgets/FanControl.cpp index fd3761077..95145748b 100644 --- a/src/slic3r/GUI/Widgets/FanControl.cpp +++ b/src/slic3r/GUI/Widgets/FanControl.cpp @@ -375,7 +375,7 @@ FanControlNew::FanControlNew(wxWindow *parent, const AirDuctData &fan_data, int sizer_control->Add(sizer_control_top, 0, wxEXPAND, 0); m_static_status_name = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END | wxALIGN_CENTER_HORIZONTAL); - m_static_status_name->SetForegroundColour(wxColour(0x00AE42)); + m_static_status_name->SetForegroundColour(wxColour(0x9A5F21)); m_static_status_name->SetBackgroundColour(wxColour(248, 248, 248)); m_static_status_name->SetFont(Label::Head_18); m_static_status_name->SetMinSize(wxSize(FromDIP(100), -1)); diff --git a/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp b/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp index 292edaa5f..09b49fbc4 100644 --- a/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp +++ b/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp @@ -27,7 +27,8 @@ EVT_PAINT(FanSwitchButton::paintEvent) END_EVENT_TABLE() -static const wxColour DEFAULT_HOVER_COL = wxColour(0, 174, 66); +//static const wxColour DEFAULT_HOVER_COL = wxColour(0x9A5F21); +static const wxColour DEFAULT_HOVER_COL = wxColour(0x9A5F21); static const wxColour DEFAULT_PRESS_COL = wxColour(238, 238, 238); ImageSwitchButton::ImageSwitchButton(wxWindow *parent, ScalableBitmap &img_on, ScalableBitmap &img_off, long style) diff --git a/src/slic3r/GUI/Widgets/ProgressBar.cpp b/src/slic3r/GUI/Widgets/ProgressBar.cpp index a5ac91330..3265964ac 100644 --- a/src/slic3r/GUI/Widgets/ProgressBar.cpp +++ b/src/slic3r/GUI/Widgets/ProgressBar.cpp @@ -45,7 +45,7 @@ void ProgressBar::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, w auto m_progress_bk = new StaticBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); m_progress_bk->SetBackgroundColour(wxColour(238, 130, 238)); StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), - std::pair(wxColour(0, 174, 66), StateColor::Normal)); + std::pair(wxColour(0x9A5F21), StateColor::Normal)); wxBoxSizer *m_sizer_progress= new wxBoxSizer(wxHORIZONTAL); diff --git a/src/slic3r/GUI/Widgets/ProgressBar.hpp b/src/slic3r/GUI/Widgets/ProgressBar.hpp index f6121708d..ae43c3870 100644 --- a/src/slic3r/GUI/Widgets/ProgressBar.hpp +++ b/src/slic3r/GUI/Widgets/ProgressBar.hpp @@ -30,7 +30,8 @@ public: double m_radius = {7}; double m_proportion = {0}; wxColour m_progress_background_colour = {233, 233, 233}; - wxColour m_progress_colour = {0, 174, 66}; + //wxColour m_progress_colour = {0, 174, 66}; + wxColour m_progress_colour = { 33, 95, 154 }; wxColour m_progress_colour_disable = {255, 111, 0}; wxString m_disable_text; diff --git a/src/slic3r/GUI/Widgets/SideButton.cpp b/src/slic3r/GUI/Widgets/SideButton.cpp index e14cf7cb9..720937780 100644 --- a/src/slic3r/GUI/Widgets/SideButton.cpp +++ b/src/slic3r/GUI/Widgets/SideButton.cpp @@ -28,8 +28,10 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly border_color.append(0x6B6B6B, StateColor::Disabled); border_color.append(wxColour(23, 129, 63), StateColor::Pressed); - border_color.append(wxColour(48,221,112), StateColor::Hovered); - border_color.append(0x00AE42, StateColor::Normal); + //border_color.append(wxColour(48,221,112), StateColor::Hovered); + border_color.append(0x0073BC, StateColor::Hovered); + //border_color.append(0x00AE42, StateColor::Normal); + border_color.append(0x215F9A, StateColor::Normal); border_color.setTakeFocusedAsHovered(false); text_color.append(0xACACAC, StateColor::Disabled); @@ -39,8 +41,12 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly background_color.append(0x6B6B6B, StateColor::Disabled); background_color.append(wxColour(23, 129, 63), StateColor::Pressed); - background_color.append(wxColour(48, 221, 112), StateColor::Hovered); - background_color.append(0x00AE42, StateColor::Normal); + /*background_color.append(wxColour(48, 221, 112), StateColor::Hovered); + background_color.append(0x00AE42, StateColor::Normal);*/ + //background_color.append(wxColour(48, 221, 112), StateColor::Hovered); + background_color.append(0x0073BC, StateColor::Hovered); + //background_color.append(0x00AE42, StateColor::Normal); + background_color.append(0x215F9A, StateColor::Normal); background_color.setTakeFocusedAsHovered(false); SetBottomColour(wxColour("#3B4446")); diff --git a/src/slic3r/GUI/Widgets/SideTools.cpp b/src/slic3r/GUI/Widgets/SideTools.cpp index 13373bf7d..ebc0a96f0 100644 --- a/src/slic3r/GUI/Widgets/SideTools.cpp +++ b/src/slic3r/GUI/Widgets/SideTools.cpp @@ -528,8 +528,10 @@ void SideTools::show_status(int status) else if ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0) { m_hyperlink->Hide(); m_connection_info->SetLabel(_L("Connecting...")); - m_connection_info->SetBackgroundColor(0x00AE42); - m_connection_info->SetBorderColor(0x00AE42); + //m_connection_info->SetBackgroundColor(0x00AE42); + m_connection_info->SetBackgroundColor(0x9A5F21); + //m_connection_info->SetBorderColor(0x00AE42); + m_connection_info->SetBorderColor(0x9A5F21); m_connection_info->Show(); m_more_button->Hide(); m_side_error_panel->Hide(); diff --git a/src/slic3r/GUI/Widgets/SideTools.hpp b/src/slic3r/GUI/Widgets/SideTools.hpp index 433bdc2e6..2c9737212 100644 --- a/src/slic3r/GUI/Widgets/SideTools.hpp +++ b/src/slic3r/GUI/Widgets/SideTools.hpp @@ -14,7 +14,8 @@ #define SIDE_TOOLS_GREY900 wxColour(38, 46, 48) #define SIDE_TOOLS_GREY600 wxColour(144, 144, 144) #define SIDE_TOOLS_GREY400 wxColour(206, 206, 206) -#define SIDE_TOOLS_BRAND wxColour(0, 174, 66) +//#define SIDE_TOOLS_BRAND wxColour(0x9A5F21) +#define SIDE_TOOLS_BRAND wxColour(0x9A5F21) #define SIDE_TOOLS_LIGHT_GREEN wxColour(219, 253, 231) enum WifiSignal { diff --git a/src/slic3r/GUI/Widgets/SpinInput.cpp b/src/slic3r/GUI/Widgets/SpinInput.cpp index 3f089953f..3baa54d36 100644 --- a/src/slic3r/GUI/Widgets/SpinInput.cpp +++ b/src/slic3r/GUI/Widgets/SpinInput.cpp @@ -26,7 +26,8 @@ SpinInput::SpinInput() { radius = 0; border_width = 1; - border_color = StateColor(std::make_pair(0xDBDBDB, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Hovered), + //border_color = StateColor(std::make_pair(0xDBDBDB, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Hovered), + border_color = StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Disabled), std::make_pair(0x0073BC, (int)StateColor::Hovered), std::make_pair(0xDBDBDB, (int) StateColor::Normal)); background_color = StateColor(std::make_pair(0xF0F0F1, (int) StateColor::Disabled), std::make_pair(*wxWHITE, (int) StateColor::Normal)); } diff --git a/src/slic3r/GUI/Widgets/StepCtrl.cpp b/src/slic3r/GUI/Widgets/StepCtrl.cpp index c5a45293a..d1042a818 100644 --- a/src/slic3r/GUI/Widgets/StepCtrl.cpp +++ b/src/slic3r/GUI/Widgets/StepCtrl.cpp @@ -23,7 +23,8 @@ StepCtrlBase::StepCtrlBase(wxWindow * parent, , font_tip(Label::Body_14) , clr_bar(0xACACAC) , clr_step(0xACACAC) - , clr_text(std::make_pair(0x00AE42, (int) StateColor::Checked), + //, clr_text(std::make_pair(0x00AE42, (int) StateColor::Checked), + , clr_text(std::make_pair(0x215F9A, (int)StateColor::Checked), std::make_pair(0x6B6B6B, (int) StateColor::Normal)) , clr_tip(0x828280) { @@ -256,7 +257,8 @@ StepIndicator::StepIndicator(wxWindow *parent, wxWindowID id, const wxPoint &pos clr_bar = 0xE1E1E1; clr_step = StateColor( std::make_pair(0xACACAC, (int) StateColor::Disabled), - std::make_pair(0x00AE42, 0)); + //std::make_pair(0x00AE42, 0)); + std::make_pair(0x215F9A, 0)); clr_text = StateColor( std::make_pair(0xACACAC, (int) StateColor::Disabled), std::make_pair(0x323A3D, (int) StateColor::Checked), @@ -404,7 +406,7 @@ void FilamentStepIndicator::doRender(wxDC& dc) } dc.SetFont(::Label::Head_16); - dc.SetTextForeground(wxColour(0, 174, 66)); + dc.SetTextForeground(wxColour(0x9A5F21)); int circleX = 20; int circleY = 20; wxSize sz = dc.GetTextExtent(L"Loading"); diff --git a/src/slic3r/GUI/Widgets/SwitchButton.cpp b/src/slic3r/GUI/Widgets/SwitchButton.cpp index 099bf31b3..205f9587b 100644 --- a/src/slic3r/GUI/Widgets/SwitchButton.cpp +++ b/src/slic3r/GUI/Widgets/SwitchButton.cpp @@ -21,7 +21,7 @@ SwitchButton::SwitchButton(wxWindow* parent, wxWindowID id) , m_off(this, "toggle_off", 16) , text_color(std::pair{0xfffffe, (int) StateColor::Checked}, std::pair{0x6B6B6B, (int) StateColor::Normal}) , track_color(0xD9D9D9) - , thumb_color(std::pair{0x00AE42, (int) StateColor::Checked}, std::pair{0xD9D9D9, (int) StateColor::Normal}) + , thumb_color(std::pair{0x009FF3, (int) StateColor::Checked}, std::pair{0xD9D9D9, (int) StateColor::Normal}) { SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent)); Bind(wxEVT_TOGGLEBUTTON, [this](auto& e) { update(); e.Skip(); }); @@ -251,7 +251,7 @@ void SwitchBoard::doRender(wxDC &dc) /*left*/ if (switch_left) { - is_enable ? dc.SetBrush(wxBrush(wxColour(0, 174, 66))) : dc.SetBrush(disable_color); + is_enable ? dc.SetBrush(wxBrush(wxColour(0x9A5F21))) : dc.SetBrush(disable_color); dc.DrawRoundedRectangle(0, 0, GetSize().x / 2, GetSize().y, 8); } @@ -269,7 +269,7 @@ void SwitchBoard::doRender(wxDC &dc) /*right*/ if (switch_right) { - if (is_enable) {dc.SetBrush(wxBrush(wxColour(0, 174, 66))); + if (is_enable) {dc.SetBrush(wxBrush(wxColour(0x9A5F21))); } else {dc.SetBrush(disable_color);} dc.DrawRoundedRectangle(GetSize().x / 2, 0, GetSize().x / 2, GetSize().y, 8); } diff --git a/src/slic3r/GUI/Widgets/TabCtrl.cpp b/src/slic3r/GUI/Widgets/TabCtrl.cpp index bbc7f7aac..8613e78d9 100644 --- a/src/slic3r/GUI/Widgets/TabCtrl.cpp +++ b/src/slic3r/GUI/Widgets/TabCtrl.cpp @@ -305,7 +305,8 @@ void TabCtrl::doRender(wxDC& dc) #else dc.SetPen(wxPen(border_color.colorForStates(states), border_width)); dc.DrawLine(0, size.y - BS2, size.x, size.y - BS2); - wxColor c(0x42AE00); + //wxColor c(0x42AE00); + wxColor c(0x9A5F21); dc.SetPen(wxPen(c, 1)); dc.SetBrush(c); dc.DrawRoundedRectangle(x1 - radius, size.y - BS2 - border_width * 3, x2 + radius * 2 - x1, border_width * 3, radius); diff --git a/src/slic3r/GUI/Widgets/TempInput.cpp b/src/slic3r/GUI/Widgets/TempInput.cpp index fa836e52f..ec65b939e 100644 --- a/src/slic3r/GUI/Widgets/TempInput.cpp +++ b/src/slic3r/GUI/Widgets/TempInput.cpp @@ -25,7 +25,8 @@ TempInput::TempInput() { hover = false; radius = 0; - border_color = StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Focused), std::make_pair(0x00AE42, (int) StateColor::Hovered), + //border_color = StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Focused), std::make_pair(0x00AE42, (int) StateColor::Hovered), + border_color = StateColor(std::make_pair(*wxWHITE, (int)StateColor::Disabled), std::make_pair(0x215F9A, (int)StateColor::Focused), std::make_pair(0x215F9A, (int)StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)); background_color = StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(*wxWHITE, (int) StateColor::Normal)); SetFont(Label::Body_12); @@ -426,8 +427,10 @@ void TempInput::render(wxDC &dc) if (warning_mode) { border_color = wxColour(255, 111, 0); } else { - border_color = StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Focused), - std::make_pair(0x00AE42, (int) StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)); + //border_color = StateColor(std::make_pair(*wxWHITE, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Focused), + border_color = StateColor(std::make_pair(*wxWHITE, (int)StateColor::Disabled), std::make_pair(0x215F9A, (int)StateColor::Focused), + //std::make_pair(0x00AE42, (int) StateColor::Hovered), std::make_pair(*wxWHITE, (int) StateColor::Normal)); + std::make_pair(0x215F9A, (int)StateColor::Hovered), std::make_pair(*wxWHITE, (int)StateColor::Normal)); } dc.SetBrush(*wxTRANSPARENT_BRUSH); diff --git a/src/slic3r/GUI/Widgets/TextInput.cpp b/src/slic3r/GUI/Widgets/TextInput.cpp index 58d7af51e..b6fd657f1 100644 --- a/src/slic3r/GUI/Widgets/TextInput.cpp +++ b/src/slic3r/GUI/Widgets/TextInput.cpp @@ -25,7 +25,8 @@ TextInput::TextInput() { radius = 0; border_width = 1; - border_color = StateColor(std::make_pair(0xDBDBDB, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Hovered), + //border_color = StateColor(std::make_pair(0xDBDBDB, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Hovered), + border_color = StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Disabled), std::make_pair(0x215F9A, (int)StateColor::Hovered), std::make_pair(0xDBDBDB, (int) StateColor::Normal)); background_color = StateColor(std::make_pair(0xF0F0F1, (int) StateColor::Disabled), std::make_pair(*wxWHITE, (int) StateColor::Normal)); SetFont(Label::Body_12); diff --git a/src/slic3r/GUI/calib_dlg.cpp b/src/slic3r/GUI/calib_dlg.cpp index f0900d629..1fe56aab6 100644 --- a/src/slic3r/GUI/calib_dlg.cpp +++ b/src/slic3r/GUI/calib_dlg.cpp @@ -108,8 +108,10 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater* m_btnStart = new Button(this, _L("OK")); StateColor btn_bg_green(std::pair(wxColour(23, 129, 63), StateColor::Pressed), - std::pair(wxColour(48, 221, 112), StateColor::Hovered), - std::pair(0x00AE42, StateColor::Normal)); + //std::pair(wxColour(48, 221, 112), StateColor::Hovered), + std::pair(0x0073BC, StateColor::Hovered), + //std::pair(0x00AE42, StateColor::Normal)); + std::pair(0x215F9A, StateColor::Normal)); m_btnStart->SetBackgroundColor(btn_bg_green); m_btnStart->SetBorderColor(wxColour(0, 150, 136)); @@ -317,8 +319,10 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5); m_btnStart = new Button(this, _L("OK")); StateColor btn_bg_green(std::pair(wxColour(23, 129, 63), StateColor::Pressed), - std::pair(wxColour(48, 221, 112), StateColor::Hovered), - std::pair(0x00AE42, StateColor::Normal)); + //std::pair(wxColour(48, 221, 112), StateColor::Hovered), + std::pair(0x0073BC, StateColor::Hovered), + //std::pair(0x00AE42, StateColor::Normal)); + std::pair(0x215F9A, StateColor::Normal)); m_btnStart->SetBackgroundColor(btn_bg_green); m_btnStart->SetBorderColor(wxColour(0, 150, 136)); @@ -489,8 +493,10 @@ MaxVolumetricSpeed_Test_Dlg::MaxVolumetricSpeed_Test_Dlg(wxWindow* parent, wxWin v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5); m_btnStart = new Button(this, _L("OK")); StateColor btn_bg_green(std::pair(wxColour(23, 129, 63), StateColor::Pressed), - std::pair(wxColour(48, 221, 112), StateColor::Hovered), - std::pair(0x00AE42, StateColor::Normal)); + //std::pair(wxColour(48, 221, 112), StateColor::Hovered), + std::pair(0x0073BC, StateColor::Hovered), + //std::pair(0x00AE42, StateColor::Normal)); + std::pair(0x215F9A, StateColor::Normal)); m_btnStart->SetBackgroundColor(btn_bg_green); m_btnStart->SetBorderColor(wxColour(0, 150, 136)); @@ -594,8 +600,10 @@ VFA_Test_Dlg::VFA_Test_Dlg(wxWindow* parent, wxWindowID id, Plater* plater) v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5); m_btnStart = new Button(this, _L("OK")); StateColor btn_bg_green(std::pair(wxColour(23, 129, 63), StateColor::Pressed), - std::pair(wxColour(48, 221, 112), StateColor::Hovered), - std::pair(0x00AE42, StateColor::Normal)); + //std::pair(wxColour(48, 221, 112), StateColor::Hovered), + std::pair(0x0073BC, StateColor::Hovered), + //std::pair(0x00AE42, StateColor::Normal)); + std::pair(0x215F9A, StateColor::Normal)); m_btnStart->SetBackgroundColor(btn_bg_green); m_btnStart->SetBorderColor(wxColour(0, 150, 136)); @@ -700,8 +708,10 @@ Retraction_Test_Dlg::Retraction_Test_Dlg(wxWindow* parent, wxWindowID id, Plater v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5); m_btnStart = new Button(this, _L("OK")); StateColor btn_bg_green(std::pair(wxColour(23, 129, 63), StateColor::Pressed), - std::pair(wxColour(48, 221, 112), StateColor::Hovered), - std::pair(0x00AE42, StateColor::Normal)); + //std::pair(wxColour(48, 221, 112), StateColor::Hovered), + std::pair(0x0073BC, StateColor::Hovered), + //std::pair(0x00AE42, StateColor::Normal)); + std::pair(0x215F9A, StateColor::Normal)); m_btnStart->SetBackgroundColor(btn_bg_green); m_btnStart->SetBorderColor(wxColour(0, 150, 136)); diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index bb85f315f..57bb084f3 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -609,6 +609,7 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString DynamicPrintConfig print_config = calib_info.print_prest->config; DynamicPrintConfig filament_config = calib_info.filament_prest->config; DynamicPrintConfig printer_config = calib_info.printer_prest->config; + DynamicConfig config_config = calib_info.config_prest->config; /// --- scale --- // model is created for a 0.4 nozzle, scale z with nozzle size. diff --git a/src/slic3r/Utils/CalibUtils.hpp b/src/slic3r/Utils/CalibUtils.hpp index 58bb030a7..7237e6987 100644 --- a/src/slic3r/Utils/CalibUtils.hpp +++ b/src/slic3r/Utils/CalibUtils.hpp @@ -24,6 +24,7 @@ public: Preset* printer_prest; Preset* filament_prest; Preset* print_prest; + Preset* config_prest; BedType bed_type; std::string dev_id; std::string select_ams;