mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_splitted_vbuffer
This commit is contained in:
commit
250adabd5c
15 changed files with 704 additions and 99 deletions
|
@ -134,7 +134,7 @@ GCodeSender::set_baud_rate(unsigned int baud_rate)
|
|||
speed_t newSpeed = baud_rate;
|
||||
ioctl(handle, IOSSIOSPEED, &newSpeed);
|
||||
::tcsetattr(handle, TCSANOW, &ios);
|
||||
#elif __linux
|
||||
#elif __linux__
|
||||
termios2 ios;
|
||||
if (ioctl(handle, TCGETS2, &ios))
|
||||
printf("Error in TCGETS2: %s\n", strerror(errno));
|
||||
|
|
|
@ -2004,10 +2004,9 @@ end:
|
|||
layer->make_slices();
|
||||
}
|
||||
});
|
||||
if (elephant_foot_compensation_scaled > 0.f) {
|
||||
if (elephant_foot_compensation_scaled > 0.f && ! m_layers.empty()) {
|
||||
// The Elephant foot has been compensated, therefore the 1st layer's lslices are shrank with the Elephant foot compensation value.
|
||||
// Store the uncompensated value there.
|
||||
assert(! m_layers.empty());
|
||||
assert(m_layers.front()->id() == 0);
|
||||
m_layers.front()->lslices = std::move(lslices_1st_layer);
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
|
||||
#if defined(__linux) || defined(__GNUC__ )
|
||||
#if defined(__linux__) || defined(__GNUC__ )
|
||||
#include <strings.h>
|
||||
#endif /* __linux */
|
||||
#endif /* __linux__ */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define strcasecmp _stricmp
|
||||
|
|
|
@ -257,10 +257,10 @@ if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
|
|||
endif ()
|
||||
|
||||
# We need to implement some hacks for wxWidgets and touch the underlying GTK
|
||||
# layer and sub-libraries. This forces us to use the include locations of these
|
||||
# libraries. No need to link to them, wxWidgets does that already.
|
||||
# See PresetComboBox.cpp for the includes and subsequent workarounds.
|
||||
# layer and sub-libraries. This forces us to use the include locations and
|
||||
# link these libraries.
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(GTK${SLIC3R_GTK} REQUIRED)
|
||||
target_include_directories(libslic3r_gui PRIVATE ${GTK${SLIC3R_GTK}_INCLUDE_DIRS})
|
||||
target_link_libraries(libslic3r_gui ${GTK${SLIC3R_GTK}_LIBRARIES})
|
||||
endif ()
|
||||
|
|
|
@ -611,7 +611,7 @@ struct _3DScene
|
|||
static void point3_to_verts(const Vec3crd& point, double width, double height, GLVolume& volume);
|
||||
};
|
||||
|
||||
static constexpr float BedEpsilon = float(EPSILON);
|
||||
static constexpr float BedEpsilon = 3.f * float(EPSILON);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ void Preview::reload_print(bool keep_volumes)
|
|||
m_volumes_cleanup_required = !keep_volumes;
|
||||
return;
|
||||
}
|
||||
#endif /* __linux __ */
|
||||
#endif /* __linux__ */
|
||||
if (
|
||||
#ifdef __linux__
|
||||
m_volumes_cleanup_required ||
|
||||
|
|
|
@ -252,14 +252,31 @@ namespace instance_check_internal
|
|||
|
||||
bool instance_check(int argc, char** argv, bool app_config_single_instance)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
boost::system::error_code ec;
|
||||
#endif
|
||||
std::size_t hashed_path =
|
||||
std::size_t hashed_path;
|
||||
#ifdef _WIN32
|
||||
std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
hashed_path = std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
#else
|
||||
std::hash<std::string>{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]), ec).string());
|
||||
boost::system::error_code ec;
|
||||
#ifdef __linux__
|
||||
// If executed by an AppImage, start the AppImage, not the main process.
|
||||
// see https://docs.appimage.org/packaging-guide/environment-variables.html#id2
|
||||
const char *appimage_env = std::getenv("APPIMAGE");
|
||||
bool appimage_env_valid = false;
|
||||
if (appimage_env) {
|
||||
try {
|
||||
auto appimage_path = boost::filesystem::canonical(boost::filesystem::path(appimage_env));
|
||||
if (boost::filesystem::exists(appimage_path)) {
|
||||
hashed_path = std::hash<std::string>{}(appimage_path.string());
|
||||
appimage_env_valid = true;
|
||||
}
|
||||
} catch (std::exception &) {
|
||||
}
|
||||
if (! appimage_env_valid)
|
||||
BOOST_LOG_TRIVIAL(error) << "APPIMAGE environment variable was set, but it does not point to a valid file: " << appimage_env;
|
||||
}
|
||||
if (! appimage_env_valid)
|
||||
#endif // __linux__
|
||||
hashed_path = std::hash<std::string>{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]), ec).string());
|
||||
if (ec.value() > 0) { // canonical was not able to find the executable (can happen with appimage on some systems. Does it fail on Fuse file systems?)
|
||||
ec.clear();
|
||||
// Compose path with boost canonical of folder and filename
|
||||
|
@ -269,7 +286,7 @@ bool instance_check(int argc, char** argv, bool app_config_single_instance)
|
|||
hashed_path = std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
}
|
||||
}
|
||||
#endif // win32
|
||||
#endif // _WIN32
|
||||
|
||||
std::string lock_name = std::to_string(hashed_path);
|
||||
GUI::wxGetApp().set_instance_hash(hashed_path);
|
||||
|
|
|
@ -309,6 +309,13 @@ void Tab::create_preset_tab()
|
|||
// This helps to process all the cursor key events on Windows in the tree control,
|
||||
// so that the cursor jumps to the last item.
|
||||
m_treectrl->Bind(wxEVT_TREE_SEL_CHANGED, [this](wxTreeEvent&) {
|
||||
#ifdef __linux__
|
||||
// Events queue is opposite On Linux. wxEVT_SET_FOCUS invokes after wxEVT_TREE_SEL_CHANGED,
|
||||
// and a result wxEVT_KILL_FOCUS doesn't invoke for the TextCtrls.
|
||||
// see https://github.com/prusa3d/PrusaSlicer/issues/5720
|
||||
// So, call SetFocus explicitly for this control before changing of the selection
|
||||
m_treectrl->SetFocus();
|
||||
#endif
|
||||
if (!m_disable_tree_sel_changed_event && !m_pages.empty()) {
|
||||
if (m_page_switch_running)
|
||||
m_page_switch_planned = true;
|
||||
|
|
|
@ -93,7 +93,7 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
|
|||
{
|
||||
std::vector<const char*> args;
|
||||
args.reserve(3);
|
||||
#ifdef __linux
|
||||
#ifdef __linux__
|
||||
static const char* gcodeviewer_param = "--gcodeviewer";
|
||||
{
|
||||
// If executed by an AppImage, start the AppImage, not the main process.
|
||||
|
@ -105,7 +105,7 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
|
|||
args.emplace_back(gcodeviewer_param);
|
||||
}
|
||||
}
|
||||
#endif // __linux
|
||||
#endif // __linux__
|
||||
std::string my_path;
|
||||
if (args.empty()) {
|
||||
// Binary path was not set to the AppImage in the Linux specific block above, call the application directly.
|
||||
|
|
|
@ -313,7 +313,7 @@ void Serial::set_baud_rate(unsigned baud_rate)
|
|||
speed_t newSpeed = baud_rate;
|
||||
handle_errno(::ioctl(handle, IOSSIOSPEED, &newSpeed));
|
||||
handle_errno(::tcsetattr(handle, TCSANOW, &ios));
|
||||
#elif __linux
|
||||
#elif __linux__
|
||||
|
||||
/* The following definitions are kindly borrowed from:
|
||||
/usr/include/asm-generic/termbits.h
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue