Skip to content

Commit

Permalink
Update grpc-device to have support for Add Offset Nulling Calibration (
Browse files Browse the repository at this point in the history
  • Loading branch information
DeborahOoi96 authored Jan 20, 2024
1 parent d34bbe8 commit cbf3f28
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 17 deletions.
22 changes: 22 additions & 0 deletions generated/nidaqmx/nidaqmx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ service NiDAQmx {
rpc GetWriteAttributeUInt64(GetWriteAttributeUInt64Request) returns (GetWriteAttributeUInt64Response);
rpc IsTaskDone(IsTaskDoneRequest) returns (IsTaskDoneResponse);
rpc LoadTask(LoadTaskRequest) returns (LoadTaskResponse);
rpc PerformBridgeOffsetNullingCalEx(PerformBridgeOffsetNullingCalExRequest) returns (PerformBridgeOffsetNullingCalExResponse);
rpc PerformBridgeShuntCalEx(PerformBridgeShuntCalExRequest) returns (PerformBridgeShuntCalExResponse);
rpc PerformStrainShuntCalEx(PerformStrainShuntCalExRequest) returns (PerformStrainShuntCalExResponse);
rpc PerformThrmcplLeadOffsetNullingCal(PerformThrmcplLeadOffsetNullingCalRequest) returns (PerformThrmcplLeadOffsetNullingCalResponse);
rpc ReadAnalogF64(ReadAnalogF64Request) returns (ReadAnalogF64Response);
rpc ReadAnalogScalarF64(ReadAnalogScalarF64Request) returns (ReadAnalogScalarF64Response);
rpc ReadBinaryI16(ReadBinaryI16Request) returns (ReadBinaryI16Response);
Expand Down Expand Up @@ -8333,6 +8335,16 @@ message LoadTaskResponse {
bool new_session_initialized = 3;
}

message PerformBridgeOffsetNullingCalExRequest {
nidevice_grpc.Session task = 1;
string channel = 2;
bool skip_unsupported_channels = 3;
}

message PerformBridgeOffsetNullingCalExResponse {
int32 status = 1;
}

message PerformBridgeShuntCalExRequest {
nidevice_grpc.Session task = 1;
string channel = 2;
Expand Down Expand Up @@ -8380,6 +8392,16 @@ message PerformStrainShuntCalExResponse {
int32 status = 1;
}

message PerformThrmcplLeadOffsetNullingCalRequest {
nidevice_grpc.Session task = 1;
string channel = 2;
bool skip_unsupported_channels = 3;
}

message PerformThrmcplLeadOffsetNullingCalResponse {
int32 status = 1;
}

message ReadAnalogF64Request {
nidevice_grpc.Session task = 1;
int32 num_samps_per_chan = 2;
Expand Down
38 changes: 38 additions & 0 deletions generated/nidaqmx/nidaqmx_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7337,6 +7337,25 @@ load_task(const StubPtr& stub, const std::string& session_name, const nidevice_g
return response;
}

PerformBridgeOffsetNullingCalExResponse
perform_bridge_offset_nulling_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const bool& skip_unsupported_channels)
{
::grpc::ClientContext context;

auto request = PerformBridgeOffsetNullingCalExRequest{};
request.mutable_task()->CopyFrom(task);
request.set_channel(channel);
request.set_skip_unsupported_channels(skip_unsupported_channels);

auto response = PerformBridgeOffsetNullingCalExResponse{};

raise_if_error(
stub->PerformBridgeOffsetNullingCalEx(&context, request, &response),
context);

return response;
}

PerformBridgeShuntCalExResponse
perform_bridge_shunt_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const double& shunt_resistor_value, const simple_variant<ShuntElementLocation, pb::int32>& shunt_resistor_location, const simple_variant<ShuntCalSelect, pb::int32>& shunt_resistor_select, const simple_variant<ShuntCalSource, pb::int32>& shunt_resistor_source, const double& bridge_resistance, const bool& skip_unsupported_channels)
{
Expand Down Expand Up @@ -7426,6 +7445,25 @@ perform_strain_shunt_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& t
return response;
}

PerformThrmcplLeadOffsetNullingCalResponse
perform_thrmcpl_lead_offset_nulling_cal(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const bool& skip_unsupported_channels)
{
::grpc::ClientContext context;

auto request = PerformThrmcplLeadOffsetNullingCalRequest{};
request.mutable_task()->CopyFrom(task);
request.set_channel(channel);
request.set_skip_unsupported_channels(skip_unsupported_channels);

auto response = PerformThrmcplLeadOffsetNullingCalResponse{};

raise_if_error(
stub->PerformThrmcplLeadOffsetNullingCal(&context, request, &response),
context);

return response;
}

ReadAnalogF64Response
read_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<GroupBy, pb::int32>& fill_mode, const pb::uint32& array_size_in_samps)
{
Expand Down
2 changes: 2 additions & 0 deletions generated/nidaqmx/nidaqmx_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,10 @@ GetWriteAttributeUInt32Response get_write_attribute_uint32(const StubPtr& stub,
GetWriteAttributeUInt64Response get_write_attribute_uint64(const StubPtr& stub, const nidevice_grpc::Session& task, const simple_variant<WriteUInt64Attribute, pb::int32>& attribute);
IsTaskDoneResponse is_task_done(const StubPtr& stub, const nidevice_grpc::Session& task);
LoadTaskResponse load_task(const StubPtr& stub, const std::string& session_name, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED);
PerformBridgeOffsetNullingCalExResponse perform_bridge_offset_nulling_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const bool& skip_unsupported_channels);
PerformBridgeShuntCalExResponse perform_bridge_shunt_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const double& shunt_resistor_value, const simple_variant<ShuntElementLocation, pb::int32>& shunt_resistor_location, const simple_variant<ShuntCalSelect, pb::int32>& shunt_resistor_select, const simple_variant<ShuntCalSource, pb::int32>& shunt_resistor_source, const double& bridge_resistance, const bool& skip_unsupported_channels);
PerformStrainShuntCalExResponse perform_strain_shunt_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const double& shunt_resistor_value, const simple_variant<ShuntElementLocation, pb::int32>& shunt_resistor_location, const simple_variant<ShuntCalSelect, pb::int32>& shunt_resistor_select, const simple_variant<ShuntCalSource, pb::int32>& shunt_resistor_source, const bool& skip_unsupported_channels);
PerformThrmcplLeadOffsetNullingCalResponse perform_thrmcpl_lead_offset_nulling_cal(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const bool& skip_unsupported_channels);
ReadAnalogF64Response read_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<GroupBy, pb::int32>& fill_mode, const pb::uint32& array_size_in_samps);
ReadAnalogScalarF64Response read_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout);
ReadBinaryI16Response read_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant<GroupBy, pb::int32>& fill_mode, const pb::uint32& array_size_in_samps);
Expand Down
10 changes: 10 additions & 0 deletions generated/nidaqmx/nidaqmx_compilation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,11 @@ int32 LoadTask(const char sessionName[], TaskHandle* task)
return DAQmxLoadTask(sessionName, task);
}

int32 PerformBridgeOffsetNullingCalEx(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels)
{
return DAQmxPerformBridgeOffsetNullingCalEx(task, channel, skipUnsupportedChannels);
}

int32 PerformBridgeShuntCalEx(TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, float64 bridgeResistance, bool32 skipUnsupportedChannels)
{
return DAQmxPerformBridgeShuntCalEx(task, channel, shuntResistorValue, shuntResistorLocation, shuntResistorSelect, shuntResistorSource, bridgeResistance, skipUnsupportedChannels);
Expand All @@ -1222,6 +1227,11 @@ int32 PerformStrainShuntCalEx(TaskHandle task, const char channel[], float64 shu
return DAQmxPerformStrainShuntCalEx(task, channel, shuntResistorValue, shuntResistorLocation, shuntResistorSelect, shuntResistorSource, skipUnsupportedChannels);
}

int32 PerformThrmcplLeadOffsetNullingCal(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels)
{
return DAQmxPerformThrmcplLeadOffsetNullingCal(task, channel, skipUnsupportedChannels);
}

int32 ReadAnalogF64(TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved)
{
return DAQmxReadAnalogF64(task, numSampsPerChan, timeout, fillMode, readArray, arraySizeInSamps, sampsPerChanRead, reserved);
Expand Down
18 changes: 18 additions & 0 deletions generated/nidaqmx/nidaqmx_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ NiDAQmxLibrary::NiDAQmxLibrary(std::shared_ptr<nidevice_grpc::SharedLibraryInter
function_pointers_.GetWriteAttributeUInt64 = reinterpret_cast<GetWriteAttributeUInt64Ptr>(shared_library_->get_function_pointer("DAQmxGetWriteAttribute"));
function_pointers_.IsTaskDone = reinterpret_cast<IsTaskDonePtr>(shared_library_->get_function_pointer("DAQmxIsTaskDone"));
function_pointers_.LoadTask = reinterpret_cast<LoadTaskPtr>(shared_library_->get_function_pointer("DAQmxLoadTask"));
function_pointers_.PerformBridgeOffsetNullingCalEx = reinterpret_cast<PerformBridgeOffsetNullingCalExPtr>(shared_library_->get_function_pointer("DAQmxPerformBridgeOffsetNullingCalEx"));
function_pointers_.PerformBridgeShuntCalEx = reinterpret_cast<PerformBridgeShuntCalExPtr>(shared_library_->get_function_pointer("DAQmxPerformBridgeShuntCalEx"));
function_pointers_.PerformStrainShuntCalEx = reinterpret_cast<PerformStrainShuntCalExPtr>(shared_library_->get_function_pointer("DAQmxPerformStrainShuntCalEx"));
function_pointers_.PerformThrmcplLeadOffsetNullingCal = reinterpret_cast<PerformThrmcplLeadOffsetNullingCalPtr>(shared_library_->get_function_pointer("DAQmxPerformThrmcplLeadOffsetNullingCal"));
function_pointers_.ReadAnalogF64 = reinterpret_cast<ReadAnalogF64Ptr>(shared_library_->get_function_pointer("DAQmxReadAnalogF64"));
function_pointers_.ReadAnalogScalarF64 = reinterpret_cast<ReadAnalogScalarF64Ptr>(shared_library_->get_function_pointer("DAQmxReadAnalogScalarF64"));
function_pointers_.ReadBinaryI16 = reinterpret_cast<ReadBinaryI16Ptr>(shared_library_->get_function_pointer("DAQmxReadBinaryI16"));
Expand Down Expand Up @@ -2373,6 +2375,14 @@ int32 NiDAQmxLibrary::LoadTask(const char sessionName[], TaskHandle* task)
return function_pointers_.LoadTask(sessionName, task);
}

int32 NiDAQmxLibrary::PerformBridgeOffsetNullingCalEx(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels)
{
if (!function_pointers_.PerformBridgeOffsetNullingCalEx) {
throw nidevice_grpc::LibraryLoadException("Could not find DAQmxPerformBridgeOffsetNullingCalEx.");
}
return function_pointers_.PerformBridgeOffsetNullingCalEx(task, channel, skipUnsupportedChannels);
}

int32 NiDAQmxLibrary::PerformBridgeShuntCalEx(TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, float64 bridgeResistance, bool32 skipUnsupportedChannels)
{
if (!function_pointers_.PerformBridgeShuntCalEx) {
Expand All @@ -2389,6 +2399,14 @@ int32 NiDAQmxLibrary::PerformStrainShuntCalEx(TaskHandle task, const char channe
return function_pointers_.PerformStrainShuntCalEx(task, channel, shuntResistorValue, shuntResistorLocation, shuntResistorSelect, shuntResistorSource, skipUnsupportedChannels);
}

int32 NiDAQmxLibrary::PerformThrmcplLeadOffsetNullingCal(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels)
{
if (!function_pointers_.PerformThrmcplLeadOffsetNullingCal) {
throw nidevice_grpc::LibraryLoadException("Could not find DAQmxPerformThrmcplLeadOffsetNullingCal.");
}
return function_pointers_.PerformThrmcplLeadOffsetNullingCal(task, channel, skipUnsupportedChannels);
}

int32 NiDAQmxLibrary::ReadAnalogF64(TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved)
{
if (!function_pointers_.ReadAnalogF64) {
Expand Down
6 changes: 6 additions & 0 deletions generated/nidaqmx/nidaqmx_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,10 @@ class NiDAQmxLibrary : public nidaqmx_grpc::NiDAQmxLibraryInterface {
int32 GetWriteAttributeUInt64(TaskHandle task, int32 attribute, uInt64* value) override;
int32 IsTaskDone(TaskHandle task, bool32* isTaskDone) override;
int32 LoadTask(const char sessionName[], TaskHandle* task) override;
int32 PerformBridgeOffsetNullingCalEx(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels) override;
int32 PerformBridgeShuntCalEx(TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, float64 bridgeResistance, bool32 skipUnsupportedChannels) override;
int32 PerformStrainShuntCalEx(TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, bool32 skipUnsupportedChannels) override;
int32 PerformThrmcplLeadOffsetNullingCal(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels) override;
int32 ReadAnalogF64(TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved) override;
int32 ReadAnalogScalarF64(TaskHandle task, float64 timeout, float64* value, bool32* reserved) override;
int32 ReadBinaryI16(TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, int16 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved) override;
Expand Down Expand Up @@ -662,8 +664,10 @@ class NiDAQmxLibrary : public nidaqmx_grpc::NiDAQmxLibraryInterface {
using GetWriteAttributeUInt64Ptr = decltype(&DAQmxGetWriteAttribute);
using IsTaskDonePtr = decltype(&DAQmxIsTaskDone);
using LoadTaskPtr = decltype(&DAQmxLoadTask);
using PerformBridgeOffsetNullingCalExPtr = decltype(&DAQmxPerformBridgeOffsetNullingCalEx);
using PerformBridgeShuntCalExPtr = decltype(&DAQmxPerformBridgeShuntCalEx);
using PerformStrainShuntCalExPtr = decltype(&DAQmxPerformStrainShuntCalEx);
using PerformThrmcplLeadOffsetNullingCalPtr = decltype(&DAQmxPerformThrmcplLeadOffsetNullingCal);
using ReadAnalogF64Ptr = decltype(&DAQmxReadAnalogF64);
using ReadAnalogScalarF64Ptr = decltype(&DAQmxReadAnalogScalarF64);
using ReadBinaryI16Ptr = decltype(&DAQmxReadBinaryI16);
Expand Down Expand Up @@ -1061,8 +1065,10 @@ class NiDAQmxLibrary : public nidaqmx_grpc::NiDAQmxLibraryInterface {
GetWriteAttributeUInt64Ptr GetWriteAttributeUInt64;
IsTaskDonePtr IsTaskDone;
LoadTaskPtr LoadTask;
PerformBridgeOffsetNullingCalExPtr PerformBridgeOffsetNullingCalEx;
PerformBridgeShuntCalExPtr PerformBridgeShuntCalEx;
PerformStrainShuntCalExPtr PerformStrainShuntCalEx;
PerformThrmcplLeadOffsetNullingCalPtr PerformThrmcplLeadOffsetNullingCal;
ReadAnalogF64Ptr ReadAnalogF64;
ReadAnalogScalarF64Ptr ReadAnalogScalarF64;
ReadBinaryI16Ptr ReadBinaryI16;
Expand Down
2 changes: 2 additions & 0 deletions generated/nidaqmx/nidaqmx_library_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ class NiDAQmxLibraryInterface {
virtual int32 GetWriteAttributeUInt64(TaskHandle task, int32 attribute, uInt64* value) = 0;
virtual int32 IsTaskDone(TaskHandle task, bool32* isTaskDone) = 0;
virtual int32 LoadTask(const char sessionName[], TaskHandle* task) = 0;
virtual int32 PerformBridgeOffsetNullingCalEx(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels) = 0;
virtual int32 PerformBridgeShuntCalEx(TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, float64 bridgeResistance, bool32 skipUnsupportedChannels) = 0;
virtual int32 PerformStrainShuntCalEx(TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, bool32 skipUnsupportedChannels) = 0;
virtual int32 PerformThrmcplLeadOffsetNullingCal(TaskHandle task, const char channel[], bool32 skipUnsupportedChannels) = 0;
virtual int32 ReadAnalogF64(TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved) = 0;
virtual int32 ReadAnalogScalarF64(TaskHandle task, float64 timeout, float64* value, bool32* reserved) = 0;
virtual int32 ReadBinaryI16(TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, int16 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved) = 0;
Expand Down
2 changes: 2 additions & 0 deletions generated/nidaqmx/nidaqmx_mock_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ class NiDAQmxMockLibrary : public nidaqmx_grpc::NiDAQmxLibraryInterface {
MOCK_METHOD(int32, GetWriteAttributeUInt64, (TaskHandle task, int32 attribute, uInt64* value), (override));
MOCK_METHOD(int32, IsTaskDone, (TaskHandle task, bool32* isTaskDone), (override));
MOCK_METHOD(int32, LoadTask, (const char sessionName[], TaskHandle* task), (override));
MOCK_METHOD(int32, PerformBridgeOffsetNullingCalEx, (TaskHandle task, const char channel[], bool32 skipUnsupportedChannels), (override));
MOCK_METHOD(int32, PerformBridgeShuntCalEx, (TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, float64 bridgeResistance, bool32 skipUnsupportedChannels), (override));
MOCK_METHOD(int32, PerformStrainShuntCalEx, (TaskHandle task, const char channel[], float64 shuntResistorValue, int32 shuntResistorLocation, int32 shuntResistorSelect, int32 shuntResistorSource, bool32 skipUnsupportedChannels), (override));
MOCK_METHOD(int32, PerformThrmcplLeadOffsetNullingCal, (TaskHandle task, const char channel[], bool32 skipUnsupportedChannels), (override));
MOCK_METHOD(int32, ReadAnalogF64, (TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved), (override));
MOCK_METHOD(int32, ReadAnalogScalarF64, (TaskHandle task, float64 timeout, float64* value, bool32* reserved), (override));
MOCK_METHOD(int32, ReadBinaryI16, (TaskHandle task, int32 numSampsPerChan, float64 timeout, int32 fillMode, int16 readArray[], uInt32 arraySizeInSamps, int32* sampsPerChanRead, bool32* reserved), (override));
Expand Down
Loading

0 comments on commit cbf3f28

Please sign in to comment.