mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 18:55:59 +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_fill.cpp
|
||||||
${TESTDIR}/libslic3r/test_flow.cpp
|
${TESTDIR}/libslic3r/test_flow.cpp
|
||||||
${TESTDIR}/libslic3r/test_gcodewriter.cpp
|
${TESTDIR}/libslic3r/test_gcodewriter.cpp
|
||||||
|
${TESTDIR}/libslic3r/test_gcode.cpp
|
||||||
${TESTDIR}/libslic3r/test_geometry.cpp
|
${TESTDIR}/libslic3r/test_geometry.cpp
|
||||||
${TESTDIR}/libslic3r/test_log.cpp
|
${TESTDIR}/libslic3r/test_log.cpp
|
||||||
${TESTDIR}/libslic3r/test_model.cpp
|
${TESTDIR}/libslic3r/test_model.cpp
|
||||||
@ -544,6 +545,7 @@ if (SLIC3R_BUILD_TESTS)
|
|||||||
endif()
|
endif()
|
||||||
configure_file("${TESTDIR}/test_options.hpp.in" "${TESTDIR}/test_options.hpp")
|
configure_file("${TESTDIR}/test_options.hpp.in" "${TESTDIR}/test_options.hpp")
|
||||||
add_executable(slic3r_test ${SLIC3R_TEST_SOURCES})
|
add_executable(slic3r_test ${SLIC3R_TEST_SOURCES})
|
||||||
|
target_compile_options(slic3r_test PUBLIC -DSLIC3R_TEST)
|
||||||
add_test(NAME TestSlic3r COMMAND slic3r_test)
|
add_test(NAME TestSlic3r COMMAND slic3r_test)
|
||||||
target_compile_features(slic3r_test PUBLIC cxx_std_14)
|
target_compile_features(slic3r_test PUBLIC cxx_std_14)
|
||||||
target_include_directories(slic3r_test PUBLIC cxx_std_14 ${SLIC3R_INCLUDES})
|
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
|
// replace speed in string
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << speed;
|
oss.precision(3);
|
||||||
|
oss << std::fixed << speed;
|
||||||
line.replace(pos+1, (last_pos-pos), oss.str());
|
line.replace(pos+1, (last_pos-pos), oss.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,10 @@ class CoolingBuffer {
|
|||||||
float _min_print_speed;
|
float _min_print_speed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef SLIC3R_TEST
|
||||||
|
void apply_speed_factor(std::string &line, float speed_factor, float min_print_speed);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user