mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 23:35:57 +08:00
Also apply precision and fixed to speed rewrite.
This commit is contained in:
parent
205cb02efa
commit
8cf8736516
@ -303,6 +303,7 @@ set(SLIC3R_TEST_SOURCES
|
||||
${TESTDIR}/libslic3r/test_fill.cpp
|
||||
${TESTDIR}/libslic3r/test_flow.cpp
|
||||
${TESTDIR}/libslic3r/test_gcodewriter.cpp
|
||||
${TESTDIR}/libslic3r/test_gcode.cpp
|
||||
${TESTDIR}/libslic3r/test_geometry.cpp
|
||||
${TESTDIR}/libslic3r/test_log.cpp
|
||||
${TESTDIR}/libslic3r/test_model.cpp
|
||||
@ -544,6 +545,7 @@ if (SLIC3R_BUILD_TESTS)
|
||||
endif()
|
||||
configure_file("${TESTDIR}/test_options.hpp.in" "${TESTDIR}/test_options.hpp")
|
||||
add_executable(slic3r_test ${SLIC3R_TEST_SOURCES})
|
||||
target_compile_options(slic3r_test PUBLIC -DSLIC3R_TEST)
|
||||
add_test(NAME TestSlic3r COMMAND slic3r_test)
|
||||
target_compile_features(slic3r_test PUBLIC cxx_std_14)
|
||||
target_include_directories(slic3r_test PUBLIC cxx_std_14 ${SLIC3R_INCLUDES})
|
||||
|
@ -50,7 +50,8 @@ apply_speed_factor(std::string &line, float speed_factor, float min_print_speed)
|
||||
// replace speed in string
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << speed;
|
||||
oss.precision(3);
|
||||
oss << std::fixed << speed;
|
||||
line.replace(pos+1, (last_pos-pos), oss.str());
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,10 @@ class CoolingBuffer {
|
||||
float _min_print_speed;
|
||||
};
|
||||
|
||||
#ifdef SLIC3R_TEST
|
||||
void apply_speed_factor(std::string &line, float speed_factor, float min_print_speed);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user