diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 5eaa0e522..7aacd1fd9 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -168,7 +168,7 @@ sub thread_cleanup { *Slic3r::GUI::TabIface::DESTROY = sub {}; *Slic3r::OctoPrint::DESTROY = sub {}; *Slic3r::Duet::DESTROY = sub {}; - *Slic3r::PrintHostFactory::DESTROY = sub {}; + *Slic3r::PrintHostFactory::DESTROY = sub {}; *Slic3r::PresetUpdater::DESTROY = sub {}; return undef; # this prevents a "Scalars leaked" warning } diff --git a/xs/CMakeLists.txt b/xs/CMakeLists.txt index 998d44cb0..3558b6d3c 100644 --- a/xs/CMakeLists.txt +++ b/xs/CMakeLists.txt @@ -255,10 +255,10 @@ add_library(libslic3r_gui STATIC ${LIBDIR}/slic3r/Utils/PrintHostSendDialog.hpp ${LIBDIR}/slic3r/Utils/OctoPrint.cpp ${LIBDIR}/slic3r/Utils/OctoPrint.hpp - ${LIBDIR}/slic3r/Utils/Duet.cpp - ${LIBDIR}/slic3r/Utils/Duet.hpp - ${LIBDIR}/slic3r/Utils/PrintHostFactory.cpp - ${LIBDIR}/slic3r/Utils/PrintHostFactory.hpp + ${LIBDIR}/slic3r/Utils/Duet.cpp + ${LIBDIR}/slic3r/Utils/Duet.hpp + ${LIBDIR}/slic3r/Utils/PrintHostFactory.cpp + ${LIBDIR}/slic3r/Utils/PrintHostFactory.hpp ${LIBDIR}/slic3r/Utils/Bonjour.cpp ${LIBDIR}/slic3r/Utils/Bonjour.hpp ${LIBDIR}/slic3r/Utils/PresetUpdater.cpp @@ -417,8 +417,8 @@ set(XS_XSP_FILES ${XSP_DIR}/Surface.xsp ${XSP_DIR}/SurfaceCollection.xsp ${XSP_DIR}/TriangleMesh.xsp - ${XSP_DIR}/Utils_PrintHostFactory.xsp - ${XSP_DIR}/Utils_PrintHost.xsp + ${XSP_DIR}/Utils_PrintHostFactory.xsp + ${XSP_DIR}/Utils_PrintHost.xsp ${XSP_DIR}/Utils_PresetUpdater.xsp ${XSP_DIR}/AppController.xsp ${XSP_DIR}/XS.xsp diff --git a/xs/src/slic3r/Utils/Duet.cpp b/xs/src/slic3r/Utils/Duet.cpp index aabc8eb40..86573ff30 100644 --- a/xs/src/slic3r/Utils/Duet.cpp +++ b/xs/src/slic3r/Utils/Duet.cpp @@ -82,7 +82,6 @@ bool Duet::send_gcode(const std::string &filename) const bool res = true; - auto upload_cmd = get_upload_url(upload_filepath.string()); BOOST_LOG_TRIVIAL(info) << boost::format("Duet: Uploading file %1%, filename: %2%, path: %3%, print: %4%, command: %5%") % filepath.string() @@ -196,7 +195,6 @@ void Duet::disconnect() const BOOST_LOG_TRIVIAL(error) << boost::format("Duet: Error disconnecting: %1%, HTTP %2%, body: `%3%`") % error % status % body; }) .perform_sync(); - } std::string Duet::get_upload_url(const std::string &filename) const @@ -231,8 +229,8 @@ std::string Duet::get_base_url() const std::string Duet::timestamp_str() const { auto t = std::time(nullptr); - auto tm = *std::localtime(&t); - std::stringstream ss; + auto tm = *std::localtime(&t); + std::stringstream ss; ss << "time=" << std::put_time(&tm, "%Y-%d-%mT%H:%M:%S"); return ss.str(); @@ -248,7 +246,8 @@ wxString Duet::format_error(const std::string &body, const std::string &error, u } } -bool Duet::start_print(wxString &msg, const std::string &filename) const { +bool Duet::start_print(wxString &msg, const std::string &filename) const +{ bool res = false; auto url = (boost::format("%1%rr_gcode?gcode=M32%%20\"%2%\"") % get_base_url()