1、添加函数:test_nonlinearity_coeffs_feature;
2、优化项目结构;
This commit is contained in:
83
.gitignore
vendored
83
.gitignore
vendored
@ -1,2 +1,81 @@
|
|||||||
/ocean_lib/build
|
# tc
|
||||||
/ocean_lib/.idea
|
/.idea/*
|
||||||
|
/build/*
|
||||||
|
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/**/usage.statistics.xml
|
||||||
|
.idea/**/dictionaries
|
||||||
|
.idea/**/shelf
|
||||||
|
|
||||||
|
# AWS User-specific
|
||||||
|
.idea/**/aws.xml
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# Gradle and Maven with auto-import
|
||||||
|
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||||
|
# since they will be recreated, and may cause churn. Uncomment if using
|
||||||
|
# auto-import.
|
||||||
|
# .idea/artifacts
|
||||||
|
# .idea/compiler.xml
|
||||||
|
# .idea/jarRepositories.xml
|
||||||
|
# .idea/modules.xml
|
||||||
|
# .idea/*.iml
|
||||||
|
# .idea/modules
|
||||||
|
# *.iml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# SonarLint plugin
|
||||||
|
.idea/sonarlint/
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 14)
|
|||||||
include_directories(/home/iris-xport/projects/ocean/seabreeze-3.0.11/SeaBreeze/include/)
|
include_directories(/home/iris-xport/projects/ocean/seabreeze-3.0.11/SeaBreeze/include/)
|
||||||
LINK_DIRECTORIES(/home/iris-xport/projects/ocean/seabreeze-3.0.11/SeaBreeze/lib/)
|
LINK_DIRECTORIES(/home/iris-xport/projects/ocean/seabreeze-3.0.11/SeaBreeze/lib/)
|
||||||
|
|
||||||
include_directories(.)#包含头文件
|
include_directories(ocean_lib)#包含头文件
|
||||||
#file(GLOB_RECURSE SRC_H ./*.h)
|
#file(GLOB_RECURSE SRC_H ./*.h)
|
||||||
file(GLOB_RECURSE SRC_CPP ./*.cpp)
|
file(GLOB_RECURSE SRC_CPP ./*.cpp)
|
||||||
|
|
||||||
@ -25,8 +25,8 @@ file(GLOB_RECURSE SRC_CPP ./*.cpp)
|
|||||||
# )
|
# )
|
||||||
|
|
||||||
add_executable(${CMAKE_PROJECT_NAME}
|
add_executable(${CMAKE_PROJECT_NAME}
|
||||||
library.cpp
|
ocean_lib/library.cpp
|
||||||
main.cpp
|
ocean_lib/main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${CMAKE_PROJECT_NAME}
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
@ -518,6 +518,61 @@ const char* OceanOptics_lib::get_error_string(int error)
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OceanOptics_lib::test_nonlinearity_coeffs_feature()
|
||||||
|
{
|
||||||
|
int error = 0;
|
||||||
|
int number_of_nonlinearity_coeff_features;
|
||||||
|
long *nonlinearity_coeff_feature_ids = 0;
|
||||||
|
double buffer[10];
|
||||||
|
int i;
|
||||||
|
int length;
|
||||||
|
|
||||||
|
printf("\n\tTesting nonlinearity coefficient features:\n");
|
||||||
|
|
||||||
|
printf("\t\tGetting number of nonlinearity coefficient features:\n");
|
||||||
|
number_of_nonlinearity_coeff_features =
|
||||||
|
sbapi_get_number_of_nonlinearity_coeffs_features(m_iSpectralmeterHandle, &error);
|
||||||
|
printf("\t\t\tResult is %d [%s]\n", number_of_nonlinearity_coeff_features,
|
||||||
|
sbapi_get_error_string(error));
|
||||||
|
|
||||||
|
if(0 == number_of_nonlinearity_coeff_features) {
|
||||||
|
printf("\tNo nonlinearity coefficient capabilities found.\n");
|
||||||
|
// tallyUnsupportedFeatures(unsupportedFeatureCount);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nonlinearity_coeff_feature_ids =
|
||||||
|
(long *)calloc(number_of_nonlinearity_coeff_features, sizeof(long));
|
||||||
|
printf("\t\tGetting nonlinearity coefficient feature IDs...\n");
|
||||||
|
number_of_nonlinearity_coeff_features = sbapi_get_nonlinearity_coeffs_features(
|
||||||
|
m_iSpectralmeterHandle, &error, nonlinearity_coeff_feature_ids,
|
||||||
|
number_of_nonlinearity_coeff_features);
|
||||||
|
printf("\t\t\tResult is %d [%s]\n", number_of_nonlinearity_coeff_features,
|
||||||
|
sbapi_get_error_string(error));
|
||||||
|
|
||||||
|
for(i = 0; i < number_of_nonlinearity_coeff_features; i++) {
|
||||||
|
printf("\t\t%d: Testing device 0x%02lX, nonlinearity coeffs 0x%02lX\n",
|
||||||
|
i, m_iSpectralmeterHandle, nonlinearity_coeff_feature_ids[i]);
|
||||||
|
|
||||||
|
printf("\t\t\tAttempting to get nonlinearity coefficients...\n");
|
||||||
|
memset(buffer, (int)0, sizeof(buffer));
|
||||||
|
length = sbapi_nonlinearity_coeffs_get(m_iSpectralmeterHandle,
|
||||||
|
nonlinearity_coeff_feature_ids[i], &error, buffer, 10);
|
||||||
|
printf("\t\t\t\tResult is %d [%s]\n", length, sbapi_get_error_string(error));
|
||||||
|
|
||||||
|
if(0 == error && length > 0) {
|
||||||
|
printf("\t\t\t\tFirst calibration term: %1.2e\n", buffer[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\t\t%d: Finished testing device 0x%02lX, nonlinearity coeffs 0x%02lX\n",
|
||||||
|
i, m_iSpectralmeterHandle, nonlinearity_coeff_feature_ids[i]);
|
||||||
|
}
|
||||||
|
free(nonlinearity_coeff_feature_ids);
|
||||||
|
|
||||||
|
printf("\tFinished testing nonlinearity coefficient capabilities.\n");
|
||||||
|
}
|
||||||
|
|
||||||
string OceanOptics_lib::GetDeviceType(int index)
|
string OceanOptics_lib::GetDeviceType(int index)
|
||||||
{
|
{
|
||||||
char type[16];
|
char type[16];
|
||||||
|
@ -53,6 +53,7 @@ public:
|
|||||||
|
|
||||||
//tc
|
//tc
|
||||||
static const char* get_error_string(int error);
|
static const char* get_error_string(int error);
|
||||||
|
void test_nonlinearity_coeffs_feature();
|
||||||
private:
|
private:
|
||||||
int m_iSpectralmeterHandle;
|
int m_iSpectralmeterHandle;
|
||||||
DeviceInfo m_deviceInfo;
|
DeviceInfo m_deviceInfo;
|
||||||
|
Reference in New Issue
Block a user