Skip to content

Commit

Permalink
Public-Auto-release: v2.12.1
Browse files Browse the repository at this point in the history
# Changed
* Windows: Only disable Protobuf-related warnings
* Python: Throw explicit error types in point cloud stream class
  • Loading branch information
blickfeld-lidar committed Sep 8, 2020
1 parent 9a32388 commit 63b7260
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ check_include_files (winsock.h HAVE_WINSOCK_H)
# Check for Windows Build
if(MSVC)
# Reduce warning level to hide protobuf warnings
add_compile_options(/W1 /EHsc)
add_compile_options(/EHsc)
endif(MSVC)
if(WIN32)
macro(get_WIN32_WINNT version)
Expand Down Expand Up @@ -240,6 +240,10 @@ if(WIN32)
target_compile_definitions(blickfeld-scanner PRIVATE "BF_DLLEXPORT=__declspec(dllexport)")
target_compile_definitions(blickfeld-scanner-static PUBLIC "BF_DLLEXPORT=__declspec(dllexport)")
endif()

# https://github.com/protocolbuffers/protobuf/blob/master/cmake/README.md#notes-on-compiler-warnings
target_compile_options(blickfeld-scanner PUBLIC "/wd4251")
target_compile_options(blickfeld-scanner-static PUBLIC "/wd4251" "/wd4244" "/wd4267")
endif(WIN32)

add_dependencies(blickfeld-scanner blickfeld-scanner-protocol)
Expand Down
6 changes: 6 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ influence the resulting point cloud.

### Removed

## [2.12.1] - 2020.09.08

### Changed
* Windows: Only disable Protobuf-related warnings
* Python: Throw explicit error types in point cloud stream class

## [2.12.0] - 2020.09.08

### Added
Expand Down
16 changes: 11 additions & 5 deletions protocol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,19 @@ endforeach()
add_library(blickfeld-scanner-protocol-static OBJECT ${PROTOBUF_GENERATED_CUSTOM} ${PROTOBUF_GENERATED_CPP})
target_include_directories(blickfeld-scanner-protocol-static PRIVATE ${LIBINCLUDEDIR_TOP})
target_link_libraries(blickfeld-scanner-protocol-static PUBLIC ${Protobuf_LIBRARY})
if(NOT BSL_STANDALONE)
target_compile_definitions(blickfeld-scanner-protocol-static PRIVATE "BF_DLLEXPORT=__declspec(dllexport)" "PROTOBUF_USE_DLLS")
else()
target_compile_definitions(blickfeld-scanner-protocol-static PRIVATE "BF_DLLEXPORT=__declspec(dllexport)")
endif()
set_property(TARGET blickfeld-scanner-protocol-static PROPERTY POSITION_INDEPENDENT_CODE ON)

if(WIN32)
if(NOT BSL_STANDALONE)
target_compile_definitions(blickfeld-scanner-protocol-static PRIVATE "BF_DLLEXPORT=__declspec(dllexport)" "PROTOBUF_USE_DLLS")
else()
target_compile_definitions(blickfeld-scanner-protocol-static PRIVATE "BF_DLLEXPORT=__declspec(dllexport)")
endif()

# https://github.com/protocolbuffers/protobuf/blob/master/cmake/README.md#notes-on-compiler-warnings
target_compile_options(blickfeld-scanner-protocol-static PRIVATE "/wd4251" "/wd4244" "/wd4267")
endif()

set(PROTOBUF_GENERATED_CPP ${PROTOBUF_GENERATED_CPP} PARENT_SCOPE)
set(PROTOBUF_GENERATED_PY_DIR ${PROTOBUF_GENERATED_PY_DIR} PARENT_SCOPE)
set(PROTOBUF_GENERATED_PY ${PROTOBUF_GENERATED_PY} PARENT_SCOPE)
Expand Down
6 changes: 3 additions & 3 deletions python/blickfeld_scanner/stream/point_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def recv_frame(self, fail_on_lost_frames=False):
frame = self._connection.recv().event.point_cloud.frame
else:
if self.end_of_stream():
raise Exception("Reached end of stream. Use end_of_stream() before calling recv_frame().")
raise ConnectionAbortedError("Reached end of stream. Use end_of_stream() before calling recv_frame().")
self._stream_buffered = False

frame = self._stream_data.frame
Expand All @@ -236,7 +236,7 @@ def recv_frame(self, fail_on_lost_frames=False):
if self._ofile:
ex_str += "\nReducing the compressions level in the record_to_file function could prevent frame losses."

raise Exception(ex_str)
raise RuntimeError(ex_str)
self._last_frame_id = frame.id

# Record frame to file
Expand Down Expand Up @@ -283,7 +283,7 @@ def record_to_file(self, file_name, compresslevel=1):
:param compresslevel: The compresslevel argument is an integer from 0 to 9 controlling the level of compression; 1 is fastest and produces the least compression, and 9 is slowest and produces the most compression. 0 is no compression. The default is 1. If frames are lost during the recording decrease the compression level.
"""
if self._ofile:
raise Exception("A recording was already started. Please stop the recording before starting another one (stop_recording)")
raise Exception("The output file has already been opened. To open another file, please call 'stop_recording' first to close the current output file.")
self._prev_scan_pattern_str = b""
self._metadata.ClearField("footer")
self._ofile = gzip.open(file_name, 'wb', compresslevel=compresslevel)
Expand Down

0 comments on commit 63b7260

Please sign in to comment.