Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/cad/OrcaSlicer/files/patch-src_OrcaSlicer.cpp
34610 views
1
--- src/OrcaSlicer.cpp.orig 2025-10-02 17:32:12 UTC
2
+++ src/OrcaSlicer.cpp
3
@@ -23,7 +23,7 @@
4
#include <iostream>
5
#include <math.h>
6
7
-#if defined(__linux__) || defined(__LINUX__)
8
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
9
#include <condition_variable>
10
#include <mutex>
11
#include <boost/thread.hpp>
12
@@ -166,7 +166,7 @@ std::vector<PrintBase::SlicingStatus> g_slicing_warnin
13
}sliced_info_t;
14
std::vector<PrintBase::SlicingStatus> g_slicing_warnings;
15
16
-#if defined(__linux__) || defined(__LINUX__)
17
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
18
#define PIPE_BUFFER_SIZE 512
19
20
typedef struct _cli_callback_mgr {
21
@@ -379,7 +379,7 @@ static PrinterTechnology get_printer_technology(const
22
}
23
24
//BBS: add flush and exit
25
-#if defined(__linux__) || defined(__LINUX__)
26
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
27
#define flush_and_exit(ret) { boost::nowide::cout << __FUNCTION__ << " found error, return "<<ret<<", exit..." << std::endl;\
28
g_cli_callback_mgr.stop();\
29
boost::nowide::cout.flush();\
30
@@ -400,7 +400,7 @@ void record_exit_reson(std::string outputdir, int code
31
32
void record_exit_reson(std::string outputdir, int code, int plate_id, std::string error_message, sliced_info_t& sliced_info, std::map<std::string, std::string> key_values = std::map<std::string, std::string>())
33
{
34
-#if defined(__linux__) || defined(__LINUX__)
35
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
36
std::string result_file;
37
38
if (!outputdir.empty())
39
@@ -1262,7 +1262,7 @@ int CLI::run(int argc, char **argv)
40
pipe_name = pipe_option->value;
41
if (!pipe_name.empty()) {
42
BOOST_LOG_TRIVIAL(info) << boost::format("Will use pipe %1%")%pipe_name;
43
-#if defined(__linux__) || defined(__LINUX__)
44
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
45
g_cli_callback_mgr.start(pipe_name);
46
PrintBase::SlicingStatus slicing_status{1, "Start to load files"};
47
cli_status_callback(slicing_status);
48
@@ -3396,7 +3396,7 @@ int CLI::run(int argc, char **argv)
49
ArrangeParams arrange_cfg;
50
51
BOOST_LOG_TRIVIAL(info) << "will start transforms, commands count " << m_transforms.size() << "\n";
52
-#if defined(__linux__) || defined(__LINUX__)
53
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
54
if (g_cli_callback_mgr.is_started()) {
55
PrintBase::SlicingStatus slicing_status{2, "Loading files finished"};
56
cli_status_callback(slicing_status);
57
@@ -4735,7 +4735,7 @@ int CLI::run(int argc, char **argv)
58
flush_and_exit(1);
59
}*/
60
BOOST_LOG_TRIVIAL(info) << "Need to slice for plate "<<plate_to_slice <<", total plate count "<<partplate_list.get_plate_count()<<" partplates!" << std::endl;
61
-#if defined(__linux__) || defined(__LINUX__)
62
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
63
if (g_cli_callback_mgr.is_started()) {
64
PrintBase::SlicingStatus slicing_status{3, "Prepare slicing"};
65
cli_status_callback(slicing_status);
66
@@ -4947,7 +4947,7 @@ int CLI::run(int argc, char **argv)
67
try {
68
std::string outfile_final;
69
BOOST_LOG_TRIVIAL(info) << "start Print::process for partplate "<<index+1 << std::endl;
70
-#if defined(__linux__) || defined(__LINUX__)
71
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
72
BOOST_LOG_TRIVIAL(info) << "cli callback mgr started: "<<g_cli_callback_mgr.m_started << std::endl;
73
if (g_cli_callback_mgr.is_started()) {
74
BOOST_LOG_TRIVIAL(info) << "set print's callback to cli_status_callback.";
75
@@ -5001,7 +5001,7 @@ int CLI::run(int argc, char **argv)
76
}
77
else {
78
BOOST_LOG_TRIVIAL(info) << "plate "<< index+1<< ": load cached data success, go on.";
79
-#if defined(__linux__) || defined(__LINUX__)
80
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
81
if (g_cli_callback_mgr.is_started()) {
82
PrintBase::SlicingStatus slicing_status{69, "Cache data loaded"};
83
cli_status_callback(slicing_status);
84
@@ -5090,7 +5090,7 @@ int CLI::run(int argc, char **argv)
85
//run_post_process_scripts(outfile, print->full_print_config());
86
BOOST_LOG_TRIVIAL(info) << "Slicing result exported to " << outfile << std::endl;
87
part_plate->update_slice_result_valid_state(true);
88
-#if defined(__linux__) || defined(__LINUX__)
89
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
90
if (g_cli_callback_mgr.is_started()) {
91
PrintBase::SlicingStatus slicing_status{100, "Slicing finished"};
92
cli_status_callback(slicing_status);
93
@@ -5140,7 +5140,7 @@ int CLI::run(int argc, char **argv)
94
finished = true;
95
}//end for partplate
96
97
-#if defined(__linux__) || defined(__LINUX__)
98
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
99
if (g_cli_callback_mgr.is_started()) {
100
int plate_count = (plate_to_slice== 0)?partplate_list.get_plate_count():1;
101
g_cli_callback_mgr.set_plate_info(0, plate_count);
102
@@ -5218,7 +5218,7 @@ int CLI::run(int argc, char **argv)
103
export_3mf_file = outfile_dir + "/"+export_3mf_file;
104
}
105
106
-#if defined(__linux__) || defined(__LINUX__)
107
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
108
if (g_cli_callback_mgr.is_started()) {
109
PrintBase::SlicingStatus slicing_status{94, "Generate thumbnails"};
110
cli_status_callback(slicing_status);
111
@@ -5375,7 +5375,7 @@ int CLI::run(int argc, char **argv)
112
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);
113
#endif
114
115
-#ifdef __linux__
116
+#if defined(__linux__) || defined(__FreeBSD__)
117
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_OSMESA_CONTEXT_API);
118
#endif
119
120
@@ -5850,7 +5850,7 @@ int CLI::run(int argc, char **argv)
121
}
122
123
124
-#if defined(__linux__) || defined(__LINUX__)
125
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
126
if (g_cli_callback_mgr.is_started()) {
127
PrintBase::SlicingStatus slicing_status{97, "Exporting 3mf"};
128
cli_status_callback(slicing_status);
129
@@ -5908,7 +5908,7 @@ int CLI::run(int argc, char **argv)
130
release_PlateData_list(plate_data_src);
131
}
132
133
-#if defined(__linux__) || defined(__LINUX__)
134
+#if defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
135
if (g_cli_callback_mgr.is_started()) {
136
PrintBase::SlicingStatus slicing_status{100, "All done, Success"};
137
cli_status_callback(slicing_status);
138
139