From 5005a1df1bf14ac332e2a1d57dd02f8092c70088 Mon Sep 17 00:00:00 2001
From: QIDI TECH <893239786@qq.com>
Date: Fri, 26 Jul 2024 14:02:02 +0800
Subject: [PATCH] Update device
---
...ine_list.svg => add_machine_list_able.svg} | 0
resources/icons/add_machine_list_disable.svg | 6 +
..._list.svg => delete_machine_list_able.svg} | 0
.../icons/delete_machine_list_disable.svg | 6 +
resources/icons/edit_machine_list_able.svg | 7 +
...list.svg => edit_machine_list_disable.svg} | 0
resources/icons/refresh_machine_list_able.svg | 8 +
...e.svg => refresh_machine_list_disable.svg} | 0
resources/icons/user_dark.png | Bin 0 -> 4349 bytes
src/QIDISlicer.cpp | 2 +
src/libslic3r/AppConfig.cpp | 16 +-
src/libslic3r/libslic3r_version.h.in | 2 +
src/nlohmann/adl_serializer.hpp | 73 +
src/nlohmann/byte_container_with_subtype.hpp | 169 +
src/nlohmann/detail/conversions/from_json.hpp | 482 +
src/nlohmann/detail/conversions/to_chars.hpp | 1110 ++
src/nlohmann/detail/conversions/to_json.hpp | 420 +
src/nlohmann/detail/exceptions.hpp | 429 +
src/nlohmann/detail/hash.hpp | 122 +
src/nlohmann/detail/input/binary_reader.hpp | 2524 +++++
src/nlohmann/detail/input/input_adapters.hpp | 483 +
src/nlohmann/detail/input/json_sax.hpp | 711 ++
src/nlohmann/detail/input/lexer.hpp | 1623 +++
src/nlohmann/detail/input/parser.hpp | 499 +
src/nlohmann/detail/input/position_t.hpp | 27 +
.../detail/iterators/internal_iterator.hpp | 25 +
src/nlohmann/detail/iterators/iter_impl.hpp | 739 ++
.../detail/iterators/iteration_proxy.hpp | 189 +
.../detail/iterators/iterator_traits.hpp | 51 +
.../iterators/json_reverse_iterator.hpp | 119 +
.../detail/iterators/primitive_iterator.hpp | 123 +
src/nlohmann/detail/json_pointer.hpp | 989 ++
src/nlohmann/detail/json_ref.hpp | 68 +
src/nlohmann/detail/macro_scope.hpp | 347 +
src/nlohmann/detail/macro_unscope.hpp | 24 +
src/nlohmann/detail/meta/call_std/begin.hpp | 8 +
src/nlohmann/detail/meta/call_std/end.hpp | 8 +
src/nlohmann/detail/meta/cpp_future.hpp | 154 +
src/nlohmann/detail/meta/detected.hpp | 61 +
src/nlohmann/detail/meta/identity_tag.hpp | 10 +
src/nlohmann/detail/meta/is_sax.hpp | 149 +
src/nlohmann/detail/meta/type_traits.hpp | 474 +
src/nlohmann/detail/meta/void_t.hpp | 13 +
src/nlohmann/detail/output/binary_writer.hpp | 1635 +++
.../detail/output/output_adapters.hpp | 138 +
src/nlohmann/detail/output/serializer.hpp | 956 ++
src/nlohmann/detail/string_escape.hpp | 63 +
src/nlohmann/detail/value_t.hpp | 81 +
src/nlohmann/json.hpp | 9076 +++++++++++++++++
src/nlohmann/json_fwd.hpp | 78 +
src/nlohmann/ordered_map.hpp | 190 +
src/nlohmann/thirdparty/hedley/hedley.hpp | 2044 ++++
.../thirdparty/hedley/hedley_undef.hpp | 150 +
src/slic3r/CMakeLists.txt | 6 +
src/slic3r/GUI/GUI_App.cpp | 32 +-
src/slic3r/GUI/GUI_App.hpp | 19 +
src/slic3r/GUI/MainFrame.cpp | 153 +-
src/slic3r/GUI/NotificationManager.cpp | 53 +
src/slic3r/GUI/NotificationManager.hpp | 10 +-
src/slic3r/GUI/PhysicalPrinterDialog.cpp | 2 +
src/slic3r/GUI/Plater.cpp | 88 +-
src/slic3r/GUI/Plater.hpp | 5 +
src/slic3r/GUI/PrintHostDialogs.cpp | 357 +-
src/slic3r/GUI/PrintHostDialogs.hpp | 20 +-
src/slic3r/GUI/PrinterWebView.cpp | 1376 +--
src/slic3r/GUI/PrinterWebView.hpp | 280 +-
src/slic3r/GUI/WebUserLoginDialog.cpp | 333 +
src/slic3r/GUI/WebUserLoginDialog.hpp | 91 +
src/slic3r/GUI/Widgets/DeviceButton.cpp | 419 +
src/slic3r/GUI/Widgets/DeviceButton.hpp | 112 +
src/slic3r/GUI/Widgets/SwitchButton.cpp | 53 +-
src/slic3r/GUI/Widgets/SwitchButton.hpp | 7 +
src/slic3r/Utils/AstroBox.cpp | 9 +
src/slic3r/Utils/Moonraker.cpp | 39 +-
src/slic3r/Utils/Moonraker.hpp | 6 +-
src/slic3r/Utils/PrintHost.cpp | 88 +
src/slic3r/Utils/PrintHost.hpp | 17 +
src/slic3r/Utils/QIDINetwork.cpp | 0
src/slic3r/Utils/QIDINetwork.hpp | 0
79 files changed, 29198 insertions(+), 1058 deletions(-)
rename resources/icons/{add_machine_list.svg => add_machine_list_able.svg} (100%)
create mode 100644 resources/icons/add_machine_list_disable.svg
rename resources/icons/{delete_machine_list.svg => delete_machine_list_able.svg} (100%)
create mode 100644 resources/icons/delete_machine_list_disable.svg
create mode 100644 resources/icons/edit_machine_list_able.svg
rename resources/icons/{edit_machine_list.svg => edit_machine_list_disable.svg} (100%)
create mode 100644 resources/icons/refresh_machine_list_able.svg
rename resources/icons/{refresh-line.svg => refresh_machine_list_disable.svg} (100%)
create mode 100644 resources/icons/user_dark.png
create mode 100644 src/nlohmann/adl_serializer.hpp
create mode 100644 src/nlohmann/byte_container_with_subtype.hpp
create mode 100644 src/nlohmann/detail/conversions/from_json.hpp
create mode 100644 src/nlohmann/detail/conversions/to_chars.hpp
create mode 100644 src/nlohmann/detail/conversions/to_json.hpp
create mode 100644 src/nlohmann/detail/exceptions.hpp
create mode 100644 src/nlohmann/detail/hash.hpp
create mode 100644 src/nlohmann/detail/input/binary_reader.hpp
create mode 100644 src/nlohmann/detail/input/input_adapters.hpp
create mode 100644 src/nlohmann/detail/input/json_sax.hpp
create mode 100644 src/nlohmann/detail/input/lexer.hpp
create mode 100644 src/nlohmann/detail/input/parser.hpp
create mode 100644 src/nlohmann/detail/input/position_t.hpp
create mode 100644 src/nlohmann/detail/iterators/internal_iterator.hpp
create mode 100644 src/nlohmann/detail/iterators/iter_impl.hpp
create mode 100644 src/nlohmann/detail/iterators/iteration_proxy.hpp
create mode 100644 src/nlohmann/detail/iterators/iterator_traits.hpp
create mode 100644 src/nlohmann/detail/iterators/json_reverse_iterator.hpp
create mode 100644 src/nlohmann/detail/iterators/primitive_iterator.hpp
create mode 100644 src/nlohmann/detail/json_pointer.hpp
create mode 100644 src/nlohmann/detail/json_ref.hpp
create mode 100644 src/nlohmann/detail/macro_scope.hpp
create mode 100644 src/nlohmann/detail/macro_unscope.hpp
create mode 100644 src/nlohmann/detail/meta/call_std/begin.hpp
create mode 100644 src/nlohmann/detail/meta/call_std/end.hpp
create mode 100644 src/nlohmann/detail/meta/cpp_future.hpp
create mode 100644 src/nlohmann/detail/meta/detected.hpp
create mode 100644 src/nlohmann/detail/meta/identity_tag.hpp
create mode 100644 src/nlohmann/detail/meta/is_sax.hpp
create mode 100644 src/nlohmann/detail/meta/type_traits.hpp
create mode 100644 src/nlohmann/detail/meta/void_t.hpp
create mode 100644 src/nlohmann/detail/output/binary_writer.hpp
create mode 100644 src/nlohmann/detail/output/output_adapters.hpp
create mode 100644 src/nlohmann/detail/output/serializer.hpp
create mode 100644 src/nlohmann/detail/string_escape.hpp
create mode 100644 src/nlohmann/detail/value_t.hpp
create mode 100644 src/nlohmann/json.hpp
create mode 100644 src/nlohmann/json_fwd.hpp
create mode 100644 src/nlohmann/ordered_map.hpp
create mode 100644 src/nlohmann/thirdparty/hedley/hedley.hpp
create mode 100644 src/nlohmann/thirdparty/hedley/hedley_undef.hpp
create mode 100644 src/slic3r/GUI/WebUserLoginDialog.cpp
create mode 100644 src/slic3r/GUI/WebUserLoginDialog.hpp
create mode 100644 src/slic3r/GUI/Widgets/DeviceButton.cpp
create mode 100644 src/slic3r/GUI/Widgets/DeviceButton.hpp
create mode 100644 src/slic3r/Utils/QIDINetwork.cpp
create mode 100644 src/slic3r/Utils/QIDINetwork.hpp
diff --git a/resources/icons/add_machine_list.svg b/resources/icons/add_machine_list_able.svg
similarity index 100%
rename from resources/icons/add_machine_list.svg
rename to resources/icons/add_machine_list_able.svg
diff --git a/resources/icons/add_machine_list_disable.svg b/resources/icons/add_machine_list_disable.svg
new file mode 100644
index 0000000..b5cb4f1
--- /dev/null
+++ b/resources/icons/add_machine_list_disable.svg
@@ -0,0 +1,6 @@
+
+
+
diff --git a/resources/icons/delete_machine_list.svg b/resources/icons/delete_machine_list_able.svg
similarity index 100%
rename from resources/icons/delete_machine_list.svg
rename to resources/icons/delete_machine_list_able.svg
diff --git a/resources/icons/delete_machine_list_disable.svg b/resources/icons/delete_machine_list_disable.svg
new file mode 100644
index 0000000..8f086b0
--- /dev/null
+++ b/resources/icons/delete_machine_list_disable.svg
@@ -0,0 +1,6 @@
+
+
+
diff --git a/resources/icons/edit_machine_list_able.svg b/resources/icons/edit_machine_list_able.svg
new file mode 100644
index 0000000..603c251
--- /dev/null
+++ b/resources/icons/edit_machine_list_able.svg
@@ -0,0 +1,7 @@
+
+
+
diff --git a/resources/icons/edit_machine_list.svg b/resources/icons/edit_machine_list_disable.svg
similarity index 100%
rename from resources/icons/edit_machine_list.svg
rename to resources/icons/edit_machine_list_disable.svg
diff --git a/resources/icons/refresh_machine_list_able.svg b/resources/icons/refresh_machine_list_able.svg
new file mode 100644
index 0000000..dad967f
--- /dev/null
+++ b/resources/icons/refresh_machine_list_able.svg
@@ -0,0 +1,8 @@
+
+
+
diff --git a/resources/icons/refresh-line.svg b/resources/icons/refresh_machine_list_disable.svg
similarity index 100%
rename from resources/icons/refresh-line.svg
rename to resources/icons/refresh_machine_list_disable.svg
diff --git a/resources/icons/user_dark.png b/resources/icons/user_dark.png
new file mode 100644
index 0000000000000000000000000000000000000000..f563142e0d585f1b89776b3828a493671cb74ec4
GIT binary patch
literal 4349
zcmai2XEYm**QQjB+AH>^{TZoV=HPT
zl-jDLZ-4KH|NHU1=ehT}_nhb4bH6?}%?zqXOU+45LPA1ops#K5mw)`5lw^M^RR%}p
zUurTlw$hQ6Rgsld0E6XaWd0w>$}0Y^M()2#Fj(QgJqYx7iR|AI1p14AmEeElU$KUU
z4isu`Z|@Ws7!n!^kBmelCMKn(KF!F;%*n~k&oA)v3otY^k&{zYRn_$J@6ri>d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Wj#V)OQMmI8PmlV;+Ub(^?hTSo
zF^~HH%q$3gc2E|;Uq$PG(3HqG+NhfMm%~QD077Qo@>n0poJnSmkVn6`D^4V2!HMi4
zOI_sgO?w9KlQrv#j|a_jYmq#MrpFHc>{5Ta#M_>%)ezKlUcVN&OuaArR?}ffsDBjD
z`W%#r$D#SAVE^wdKrEo7^-j(n7@ue$n6CxnlDYwL@4S%d3(MWH6d>1+f(gpW8~gI7S
#include
#include
+//B64
+#include "nlohmann/json.hpp"
#include
#include
#include
diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp
index 822fce9..12e5ca6 100644
--- a/src/libslic3r/AppConfig.cpp
+++ b/src/libslic3r/AppConfig.cpp
@@ -211,12 +211,26 @@ void AppConfig::set_defaults()
if (get("sys_menu_enabled").empty())
set("sys_menu_enabled", "1");
-#endif // _WIN32
+#endif // _WIN32
// B45
if (get("machine_list_minification").empty())
set("machine_list_minification", "1");
+ //B64
+ if (get("user_token").empty())
+ set("user_token", "");
+
+ if (get("sending_interval").empty()) {
+ set("sending_interval", "5");
+ }
+
+ if (get("max_send").empty()) {
+ set("max_send", "3");
+ }
+
+ if (get("machine_list_net").empty())
+ set("machine_list_net", "0");
// Remove legacy window positions/sizes
erase("", "main_frame_maximized");
erase("", "main_frame_pos");
diff --git a/src/libslic3r/libslic3r_version.h.in b/src/libslic3r/libslic3r_version.h.in
index 26a6736..db72d6a 100644
--- a/src/libslic3r/libslic3r_version.h.in
+++ b/src/libslic3r/libslic3r_version.h.in
@@ -6,4 +6,6 @@
#define SLIC3R_VERSION "@SLIC3R_VERSION@"
#define SLIC3R_BUILD_ID "@SLIC3R_BUILD_ID@"
+//B64
+#define QDT_RELEASE_TO_PUBLIC @QDT_RELEASE_TO_PUBLIC@
#endif /* __SLIC3R_VERSION_H */
diff --git a/src/nlohmann/adl_serializer.hpp b/src/nlohmann/adl_serializer.hpp
new file mode 100644
index 0000000..f967612
--- /dev/null
+++ b/src/nlohmann/adl_serializer.hpp
@@ -0,0 +1,73 @@
+#pragma once
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+namespace nlohmann
+{
+
+template
+struct adl_serializer
+{
+ /*!
+ @brief convert a JSON value to any value type
+
+ This function is usually called by the `get()` function of the
+ @ref basic_json class (either explicit or via conversion operators).
+
+ @note This function is chosen for default-constructible value types.
+
+ @param[in] j JSON value to read from
+ @param[in,out] val value to write to
+ */
+ template
+ static auto from_json(BasicJsonType && j, TargetType& val) noexcept(
+ noexcept(::nlohmann::from_json(std::forward(j), val)))
+ -> decltype(::nlohmann::from_json(std::forward(j), val), void())
+ {
+ ::nlohmann::from_json(std::forward(j), val);
+ }
+
+ /*!
+ @brief convert a JSON value to any value type
+
+ This function is usually called by the `get()` function of the
+ @ref basic_json class (either explicit or via conversion operators).
+
+ @note This function is chosen for value types which are not default-constructible.
+
+ @param[in] j JSON value to read from
+
+ @return copy of the JSON value, converted to @a ValueType
+ */
+ template
+ static auto from_json(BasicJsonType && j) noexcept(
+ noexcept(::nlohmann::from_json(std::forward(j), detail::identity_tag {})))
+ -> decltype(::nlohmann::from_json(std::forward(j), detail::identity_tag {}))
+ {
+ return ::nlohmann::from_json(std::forward(j), detail::identity_tag {});
+ }
+
+ /*!
+ @brief convert any value type to a JSON value
+
+ This function is usually called by the constructors of the @ref basic_json
+ class.
+
+ @param[in,out] j JSON value to write to
+ @param[in] val value to read from
+ */
+ template
+ static auto to_json(BasicJsonType& j, TargetType && val) noexcept(
+ noexcept(::nlohmann::to_json(j, std::forward(val))))
+ -> decltype(::nlohmann::to_json(j, std::forward(val)), void())
+ {
+ ::nlohmann::to_json(j, std::forward(val));
+ }
+};
+} // namespace nlohmann
diff --git a/src/nlohmann/byte_container_with_subtype.hpp b/src/nlohmann/byte_container_with_subtype.hpp
new file mode 100644
index 0000000..4086e08
--- /dev/null
+++ b/src/nlohmann/byte_container_with_subtype.hpp
@@ -0,0 +1,169 @@
+#pragma once
+
+#include // uint8_t, uint64_t
+#include // tie
+#include // move
+
+namespace nlohmann
+{
+
+/*!
+@brief an internal type for a backed binary type
+
+This type extends the template parameter @a BinaryType provided to `basic_json`
+with a subtype used by BSON and MessagePack. This type exists so that the user
+does not have to specify a type themselves with a specific naming scheme in
+order to override the binary type.
+
+@tparam BinaryType container to store bytes (`std::vector` by
+ default)
+
+@since version 3.8.0; changed type of subtypes to std::uint64_t in 3.10.0.
+*/
+template
+class byte_container_with_subtype : public BinaryType
+{
+ public:
+ /// the type of the underlying container
+ using container_type = BinaryType;
+ /// the type of the subtype
+ using subtype_type = std::uint64_t;
+
+ byte_container_with_subtype() noexcept(noexcept(container_type()))
+ : container_type()
+ {}
+
+ byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b)))
+ : container_type(b)
+ {}
+
+ byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))))
+ : container_type(std::move(b))
+ {}
+
+ byte_container_with_subtype(const container_type& b, subtype_type subtype_) noexcept(noexcept(container_type(b)))
+ : container_type(b)
+ , m_subtype(subtype_)
+ , m_has_subtype(true)
+ {}
+
+ byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))))
+ : container_type(std::move(b))
+ , m_subtype(subtype_)
+ , m_has_subtype(true)
+ {}
+
+ bool operator==(const byte_container_with_subtype& rhs) const
+ {
+ return std::tie(static_cast(*this), m_subtype, m_has_subtype) ==
+ std::tie(static_cast(rhs), rhs.m_subtype, rhs.m_has_subtype);
+ }
+
+ bool operator!=(const byte_container_with_subtype& rhs) const
+ {
+ return !(rhs == *this);
+ }
+
+ /*!
+ @brief sets the binary subtype
+
+ Sets the binary subtype of the value, also flags a binary JSON value as
+ having a subtype, which has implications for serialization.
+
+ @complexity Constant.
+
+ @exceptionsafety No-throw guarantee: this member function never throws
+ exceptions.
+
+ @sa see @ref subtype() -- return the binary subtype
+ @sa see @ref clear_subtype() -- clears the binary subtype
+ @sa see @ref has_subtype() -- returns whether or not the binary value has a
+ subtype
+
+ @since version 3.8.0
+ */
+ void set_subtype(subtype_type subtype_) noexcept
+ {
+ m_subtype = subtype_;
+ m_has_subtype = true;
+ }
+
+ /*!
+ @brief return the binary subtype
+
+ Returns the numerical subtype of the value if it has a subtype. If it does
+ not have a subtype, this function will return subtype_type(-1) as a sentinel
+ value.
+
+ @return the numerical subtype of the binary value
+
+ @complexity Constant.
+
+ @exceptionsafety No-throw guarantee: this member function never throws
+ exceptions.
+
+ @sa see @ref set_subtype() -- sets the binary subtype
+ @sa see @ref clear_subtype() -- clears the binary subtype
+ @sa see @ref has_subtype() -- returns whether or not the binary value has a
+ subtype
+
+ @since version 3.8.0; fixed return value to properly return
+ subtype_type(-1) as documented in version 3.10.0
+ */
+ constexpr subtype_type subtype() const noexcept
+ {
+ return m_has_subtype ? m_subtype : subtype_type(-1);
+ }
+
+ /*!
+ @brief return whether the value has a subtype
+
+ @return whether the value has a subtype
+
+ @complexity Constant.
+
+ @exceptionsafety No-throw guarantee: this member function never throws
+ exceptions.
+
+ @sa see @ref subtype() -- return the binary subtype
+ @sa see @ref set_subtype() -- sets the binary subtype
+ @sa see @ref clear_subtype() -- clears the binary subtype
+
+ @since version 3.8.0
+ */
+ constexpr bool has_subtype() const noexcept
+ {
+ return m_has_subtype;
+ }
+
+ /*!
+ @brief clears the binary subtype
+
+ Clears the binary subtype and flags the value as not having a subtype, which
+ has implications for serialization; for instance MessagePack will prefer the
+ bin family over the ext family.
+
+ @complexity Constant.
+
+ @exceptionsafety No-throw guarantee: this member function never throws
+ exceptions.
+
+ @sa see @ref subtype() -- return the binary subtype
+ @sa see @ref set_subtype() -- sets the binary subtype
+ @sa see @ref has_subtype() -- returns whether or not the binary value has a
+ subtype
+
+ @since version 3.8.0
+ */
+ void clear_subtype() noexcept
+ {
+ m_subtype = 0;
+ m_has_subtype = false;
+ }
+
+ private:
+ subtype_type m_subtype = 0;
+ bool m_has_subtype = false;
+};
+
+} // namespace nlohmann
diff --git a/src/nlohmann/detail/conversions/from_json.hpp b/src/nlohmann/detail/conversions/from_json.hpp
new file mode 100644
index 0000000..71e32aa
--- /dev/null
+++ b/src/nlohmann/detail/conversions/from_json.hpp
@@ -0,0 +1,482 @@
+#pragma once
+
+#include // transform
+#include // array
+#include // forward_list
+#include // inserter, front_inserter, end
+#include