Skip to content

Commit

Permalink
Add parameter pointDelay to python object pickle method
Browse files Browse the repository at this point in the history
  • Loading branch information
drlukeparry committed Feb 7, 2022
1 parent e59c4bb commit a8b628d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if(WIN32)
# Remove Security definitions for the library
# Remove run time checks for windows
IF(MSVC)

set(COMMON_LANGUAGE_RUNTIME "")
set(EIGEN3_INCLUDE_DIR External/eigen)

Expand All @@ -37,7 +37,7 @@ if(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

else(WIN32)
else(WIN32)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

Expand Down Expand Up @@ -162,7 +162,7 @@ if(BUILD_PYTHON)
else()

add_executable(main ${App_SRCS})
target_link_libraries(main SLM EOS MTT Realizer SLMSol)
target_link_libraries(main SLM EOS MTT Realizer SLMSol)

endif(BUILD_PYTHON)

Expand Down
11 changes: 7 additions & 4 deletions python/libSLM/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ PYBIND11_MODULE(slm, m) {
self.attr("pointDistance"), self.attr("pointExposureTime"),
self.attr("laserId"), self.attr("laserMode"),
self.attr("name"), self.attr("description"),
self.attr("pointDelay"),
self.attr("jumpDelay"), self.attr("jumpSpeed"),
self.attr("description"),
self.attr("__dict__"));
Expand All @@ -328,18 +329,20 @@ PYBIND11_MODULE(slm, m) {
p->laserMode = t[7].cast<slm::LaserMode>();
p->name = t[8].cast<std::u16string>();
p->description = t[9].cast<std::u16string>();
p->jumpDelay = t[10].cast<int>();
p->jumpSpeed = t[11].cast<int>();
p->description = t[12].cast<std::u16string>();
p->pointDelay = t[10].cast<int>();
p->jumpDelay = t[11].cast<int>();
p->jumpSpeed = t[12].cast<int>();
p->description = t[13].cast<std::u16string>();

auto py_state = t[13].cast<py::dict>();
auto py_state = t[14].cast<py::dict>();
return std::make_pair(p, py_state);

}
));

py::class_<slm::Model, std::shared_ptr<slm::Model>>(m, "Model", py::dynamic_attr())
.def(py::init())
.def(py::init<uint64_t, uint64_t>(), py::arg("mid"), py::arg("topSliceNum"))
.def_property("mid", &Model::getId, &Model::setId)
.def("__len__", [](const Model &s ) { return s.getBuildStyles().size(); })
.def_property("buildStyles",py::cpp_function(&slm::Model::buildStylesRef,py::return_value_policy::reference, py::keep_alive<1,0>()),
Expand Down

0 comments on commit a8b628d

Please sign in to comment.