Skip to content
Snippets Groups Projects
Commit 6da41722 authored by boa's avatar boa
Browse files

bug fixings

parent 7f649bb9
No related branches found
No related tags found
No related merge requests found
......@@ -151,3 +151,4 @@ README.md
Python/*.ipynb
Python/*.xml
*.ipynb
Python/control.py
......@@ -32,9 +32,9 @@ include_directories(lib/driver_header)
set(LIBS
wfmLib
AWGLib
baslerLib
imageProcLib
uniformLib
# baslerLib
# imageProcLib
# uniformLib
)
# executables
......
......@@ -27,6 +27,7 @@ void AWG::checkError() {
) {
//std::cout << "AWG error" << std::string(errorMsg)
// << "\ncard closed\n";
std::cout << std::string(errorMsg) << std::endl;
this->close();
throw CardException(errorMsg);
}
......@@ -38,7 +39,7 @@ void AWG::open(int openIndex) {
return;
}
auto openMsg = "dev/spcm" + std::to_string(openIndex);
auto openMsg = "/dev/spcm" + std::to_string(openIndex);
this->pCardHandle = spcm_hOpen(openMsg.c_str());
if (pCardHandle == nullptr) {
std::cout << "card open failed" << std::endl;
......@@ -338,13 +339,18 @@ int AWG::getTimeOut() {
void AWG::printCardStatus() {
if (!this->isOpen()) { return; }
this->checkError();
int32 status;
spcm_dwGetParam_i32(
this->pCardHandle,
SPC_M2STATUS,
&status
);
std::cout << STATUS_NAMES.at(status) << std::endl;
if (STATUS_NAMES.count(status)) {
std::cout << "status code: " << status << ", " << STATUS_NAMES.at(status) << std::endl;
} else {
std::cout << "status code: " << status << ", see manual for details" << std::endl;
}
}
void AWG::toggleTrigger(bool enable) {
......
......@@ -4,11 +4,17 @@ target_sources(AWGLib
PUBLIC
AWG.h
)
# add_library(driverLib STATIC IMPORTED)
add_library(driverLib SHARED IMPORTED)
set_target_properties(driverLib PROPERTIES
IMPORTED_LOCATION "/usr/lib/x86_64-linux-gnu/libspcm_linux.so"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/driver_header"
)
# set_target_properties(driverLib PROPERTIES
# IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/driver_header/spcm_win64_msvcpp.lib"
# INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/driver_header"
# )
target_link_libraries(AWGLib driverLib)
target_sources(baslerLib
PRIVATE
......
add_executable(example example.cpp)
target_link_libraries(example ${LIBS})
add_executable(test test.cpp)
target_link_libraries(test ${LIBS})
add_executable(run run.cpp)
target_link_libraries(run ${LIBS})
\ No newline at end of file
# add_executable(run run.cpp)
# target_link_libraries(run ${LIBS})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment