diff --git a/generated/nirfmxinstr/nirfmxinstr.proto b/generated/nirfmxinstr/nirfmxinstr.proto index c9bdb48a8..d3da76e12 100644 --- a/generated/nirfmxinstr/nirfmxinstr.proto +++ b/generated/nirfmxinstr/nirfmxinstr.proto @@ -74,7 +74,6 @@ service NiRFmxInstr { rpc GetSelfCalibrateLastTemperature(GetSelfCalibrateLastTemperatureRequest) returns (GetSelfCalibrateLastTemperatureResponse); rpc GetSignalConfigurationNames(GetSignalConfigurationNamesRequest) returns (GetSignalConfigurationNamesResponse); rpc Initialize(InitializeRequest) returns (InitializeResponse); - rpc InitializeWithChannel(InitializeWithChannelRequest) returns (InitializeWithChannelResponse); rpc InitializeFromNIRFSASession(InitializeFromNIRFSASessionRequest) returns (InitializeFromNIRFSASessionResponse); rpc InitializeFromNIRFSASessionArray(InitializeFromNIRFSASessionArrayRequest) returns (InitializeFromNIRFSASessionArrayResponse); rpc IsSelfCalibrateValid(IsSelfCalibrateValidRequest) returns (IsSelfCalibrateValidResponse); @@ -1087,22 +1086,6 @@ message InitializeResponse { bool new_session_initialized = 5; } -message InitializeWithChannelRequest { - string session_name = 1; - string resource_name = 2; - string option_string = 3; - string channel_name = 4; - nidevice_grpc.SessionInitializationBehavior initialization_behavior = 5; -} - -message InitializeWithChannelResponse { - int32 status = 1; - nidevice_grpc.Session instrument = 2; - int32 is_new_session = 3; - string error_message = 4 [deprecated = true]; - bool new_session_initialized = 5; -} - message InitializeFromNIRFSASessionRequest { string session_name = 1; nidevice_grpc.Session nirfsa_session = 2; diff --git a/generated/nirfmxinstr/nirfmxinstr_client.cpp b/generated/nirfmxinstr/nirfmxinstr_client.cpp index b5d8766f7..5f70a02f1 100644 --- a/generated/nirfmxinstr/nirfmxinstr_client.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_client.cpp @@ -1152,26 +1152,6 @@ initialize(const StubPtr& stub, const std::string& resource_name, const std::str return response; } -InitializeWithChannelResponse -initialize_with_channel(const StubPtr& stub, const std::string& resource_name, const std::string& option_string, const std::string& channel_name, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior) -{ - ::grpc::ClientContext context; - - auto request = InitializeWithChannelRequest{}; - request.set_resource_name(resource_name); - request.set_option_string(option_string); - request.set_channel_name(channel_name); - request.set_initialization_behavior(initialization_behavior); - - auto response = InitializeWithChannelResponse{}; - - raise_if_error( - stub->InitializeWithChannel(&context, request, &response), - context); - - return response; -} - InitializeFromNIRFSASessionResponse initialize_from_nirfsa_session(const StubPtr& stub, const nidevice_grpc::Session& nirfsa_session, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior) { diff --git a/generated/nirfmxinstr/nirfmxinstr_client.h b/generated/nirfmxinstr/nirfmxinstr_client.h index 38244c13d..ee67d559a 100644 --- a/generated/nirfmxinstr/nirfmxinstr_client.h +++ b/generated/nirfmxinstr/nirfmxinstr_client.h @@ -78,7 +78,6 @@ GetSelfCalibrateLastDateAndTimeResponse get_self_calibrate_last_date_and_time(co GetSelfCalibrateLastTemperatureResponse get_self_calibrate_last_temperature(const StubPtr& stub, const nidevice_grpc::Session& instrument, const std::string& selector_string, const simple_variant& self_calibrate_step); GetSignalConfigurationNamesResponse get_signal_configuration_names(const StubPtr& stub, const nidevice_grpc::Session& instrument, const std::string& selector_string, const simple_variant& personality_filter); InitializeResponse initialize(const StubPtr& stub, const std::string& resource_name, const std::string& option_string, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED); -InitializeWithChannelResponse initialize_with_channel(const StubPtr& stub, const std::string& resource_name, const std::string& option_string, const std::string& channel_name, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED); InitializeFromNIRFSASessionResponse initialize_from_nirfsa_session(const StubPtr& stub, const nidevice_grpc::Session& nirfsa_session, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED); InitializeFromNIRFSASessionArrayResponse initialize_from_nirfsa_session_array(const StubPtr& stub, const std::vector& nirfsa_sessions, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED); IsSelfCalibrateValidResponse is_self_calibrate_valid(const StubPtr& stub, const nidevice_grpc::Session& instrument, const std::string& selector_string); diff --git a/generated/nirfmxinstr/nirfmxinstr_compilation_test.cpp b/generated/nirfmxinstr/nirfmxinstr_compilation_test.cpp index 85ccb897d..3d7ac1ec4 100644 --- a/generated/nirfmxinstr/nirfmxinstr_compilation_test.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_compilation_test.cpp @@ -287,11 +287,6 @@ int32 Initialize(char resourceName[], char optionString[], niRFmxInstrHandle* ha return RFmxInstr_Initialize(resourceName, optionString, handleOut, isNewSession); } -int32 InitializeWithChannel(char resourceName[], char optionString[], char channelName[], niRFmxInstrHandle* handleOut, int32* isNewSession) -{ - return RFmxInstr_InitializeWithChannel(resourceName, optionString, channelName, handleOut, isNewSession); -} - int32 InitializeFromNIRFSASession(uInt32 nirfsaSession, niRFmxInstrHandle* handleOut) { return RFmxInstr_InitializeFromNIRFSASession(nirfsaSession, handleOut); diff --git a/generated/nirfmxinstr/nirfmxinstr_library.cpp b/generated/nirfmxinstr/nirfmxinstr_library.cpp index c6888c2c7..94b807c27 100644 --- a/generated/nirfmxinstr/nirfmxinstr_library.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_library.cpp @@ -83,7 +83,6 @@ NiRFmxInstrLibrary::NiRFmxInstrLibrary(std::shared_ptr(shared_library_->get_function_pointer("RFmxInstr_GetSelfCalibrateLastTemperature")); function_pointers_.GetSignalConfigurationNames = reinterpret_cast(shared_library_->get_function_pointer("RFmxInstr_GetSignalConfigurationNames")); function_pointers_.Initialize = reinterpret_cast(shared_library_->get_function_pointer("RFmxInstr_Initialize")); - function_pointers_.InitializeWithChannel = reinterpret_cast(shared_library_->get_function_pointer("RFmxInstr_InitializeWithChannel")); function_pointers_.InitializeFromNIRFSASession = reinterpret_cast(shared_library_->get_function_pointer("RFmxInstr_InitializeFromNIRFSASession")); function_pointers_.InitializeFromNIRFSASessionArray = reinterpret_cast(shared_library_->get_function_pointer("RFmxInstr_InitializeFromNIRFSASessionArray")); function_pointers_.IsSelfCalibrateValid = reinterpret_cast(shared_library_->get_function_pointer("RFmxInstr_IsSelfCalibrateValid")); @@ -584,14 +583,6 @@ int32 NiRFmxInstrLibrary::Initialize(char resourceName[], char optionString[], n return function_pointers_.Initialize(resourceName, optionString, handleOut, isNewSession); } -int32 NiRFmxInstrLibrary::InitializeWithChannel(char resourceName[], char optionString[], char channelName[], niRFmxInstrHandle* handleOut, int32* isNewSession) -{ - if (!function_pointers_.InitializeWithChannel) { - throw nidevice_grpc::LibraryLoadException("Could not find RFmxInstr_InitializeWithChannel."); - } - return function_pointers_.InitializeWithChannel(resourceName, optionString, channelName, handleOut, isNewSession); -} - int32 NiRFmxInstrLibrary::InitializeFromNIRFSASession(uInt32 nirfsaSession, niRFmxInstrHandle* handleOut) { if (!function_pointers_.InitializeFromNIRFSASession) { diff --git a/generated/nirfmxinstr/nirfmxinstr_library.h b/generated/nirfmxinstr/nirfmxinstr_library.h index 25a017aa9..37ab7d835 100644 --- a/generated/nirfmxinstr/nirfmxinstr_library.h +++ b/generated/nirfmxinstr/nirfmxinstr_library.h @@ -77,7 +77,6 @@ class NiRFmxInstrLibrary : public nirfmxinstr_grpc::NiRFmxInstrLibraryInterface int32 GetSelfCalibrateLastTemperature(niRFmxInstrHandle instrumentHandle, char selectorString[], int64 selfCalibrateStep, float64* temperature) override; int32 GetSignalConfigurationNames(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 personalityFilter, char signalNames[], int32 signalNamesSize, int32* actualSignalNamesSize, int32 personality[], int32 personalityArraySize, int32* actualPersonalityArraySize) override; int32 Initialize(char resourceName[], char optionString[], niRFmxInstrHandle* handleOut, int32* isNewSession) override; - int32 InitializeWithChannel(char resourceName[], char optionString[], char channelName[], niRFmxInstrHandle* handleOut, int32* isNewSession) override; int32 InitializeFromNIRFSASession(uInt32 nirfsaSession, niRFmxInstrHandle* handleOut) override; int32 InitializeFromNIRFSASessionArray(uInt32 nirfsaSessions[], int32 numberOfNIRFSASessions, niRFmxInstrHandle* handleOut) override; int32 IsSelfCalibrateValid(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* selfCalibrateValid, int32* validSteps) override; @@ -175,7 +174,6 @@ class NiRFmxInstrLibrary : public nirfmxinstr_grpc::NiRFmxInstrLibraryInterface using GetSelfCalibrateLastTemperaturePtr = decltype(&RFmxInstr_GetSelfCalibrateLastTemperature); using GetSignalConfigurationNamesPtr = decltype(&RFmxInstr_GetSignalConfigurationNames); using InitializePtr = decltype(&RFmxInstr_Initialize); - using InitializeWithChannelPtr = decltype(&RFmxInstr_InitializeWithChannel); using InitializeFromNIRFSASessionPtr = decltype(&RFmxInstr_InitializeFromNIRFSASession); using InitializeFromNIRFSASessionArrayPtr = decltype(&RFmxInstr_InitializeFromNIRFSASessionArray); using IsSelfCalibrateValidPtr = decltype(&RFmxInstr_IsSelfCalibrateValid); @@ -273,7 +271,6 @@ class NiRFmxInstrLibrary : public nirfmxinstr_grpc::NiRFmxInstrLibraryInterface GetSelfCalibrateLastTemperaturePtr GetSelfCalibrateLastTemperature; GetSignalConfigurationNamesPtr GetSignalConfigurationNames; InitializePtr Initialize; - InitializeWithChannelPtr InitializeWithChannel; InitializeFromNIRFSASessionPtr InitializeFromNIRFSASession; InitializeFromNIRFSASessionArrayPtr InitializeFromNIRFSASessionArray; IsSelfCalibrateValidPtr IsSelfCalibrateValid; diff --git a/generated/nirfmxinstr/nirfmxinstr_library_interface.h b/generated/nirfmxinstr/nirfmxinstr_library_interface.h index 9177a3889..84dc46bc7 100644 --- a/generated/nirfmxinstr/nirfmxinstr_library_interface.h +++ b/generated/nirfmxinstr/nirfmxinstr_library_interface.h @@ -71,7 +71,6 @@ class NiRFmxInstrLibraryInterface { virtual int32 GetSelfCalibrateLastTemperature(niRFmxInstrHandle instrumentHandle, char selectorString[], int64 selfCalibrateStep, float64* temperature) = 0; virtual int32 GetSignalConfigurationNames(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 personalityFilter, char signalNames[], int32 signalNamesSize, int32* actualSignalNamesSize, int32 personality[], int32 personalityArraySize, int32* actualPersonalityArraySize) = 0; virtual int32 Initialize(char resourceName[], char optionString[], niRFmxInstrHandle* handleOut, int32* isNewSession) = 0; - virtual int32 InitializeWithChannel(char resourceName[], char optionString[], char channelName[], niRFmxInstrHandle* handleOut, int32* isNewSession) = 0; virtual int32 InitializeFromNIRFSASession(uInt32 nirfsaSession, niRFmxInstrHandle* handleOut) = 0; virtual int32 InitializeFromNIRFSASessionArray(uInt32 nirfsaSessions[], int32 numberOfNIRFSASessions, niRFmxInstrHandle* handleOut) = 0; virtual int32 IsSelfCalibrateValid(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* selfCalibrateValid, int32* validSteps) = 0; diff --git a/generated/nirfmxinstr/nirfmxinstr_mock_library.h b/generated/nirfmxinstr/nirfmxinstr_mock_library.h index 4541d9d3a..41416fb15 100644 --- a/generated/nirfmxinstr/nirfmxinstr_mock_library.h +++ b/generated/nirfmxinstr/nirfmxinstr_mock_library.h @@ -73,7 +73,6 @@ class NiRFmxInstrMockLibrary : public nirfmxinstr_grpc::NiRFmxInstrLibraryInterf MOCK_METHOD(int32, GetSelfCalibrateLastTemperature, (niRFmxInstrHandle instrumentHandle, char selectorString[], int64 selfCalibrateStep, float64* temperature), (override)); MOCK_METHOD(int32, GetSignalConfigurationNames, (niRFmxInstrHandle instrumentHandle, char selectorString[], int32 personalityFilter, char signalNames[], int32 signalNamesSize, int32* actualSignalNamesSize, int32 personality[], int32 personalityArraySize, int32* actualPersonalityArraySize), (override)); MOCK_METHOD(int32, Initialize, (char resourceName[], char optionString[], niRFmxInstrHandle* handleOut, int32* isNewSession), (override)); - MOCK_METHOD(int32, InitializeWithChannel, (char resourceName[], char optionString[], char channelName[], niRFmxInstrHandle* handleOut, int32* isNewSession), (override)); MOCK_METHOD(int32, InitializeFromNIRFSASession, (uInt32 nirfsaSession, niRFmxInstrHandle* handleOut), (override)); MOCK_METHOD(int32, InitializeFromNIRFSASessionArray, (uInt32 nirfsaSessions[], int32 numberOfNIRFSASessions, niRFmxInstrHandle* handleOut), (override)); MOCK_METHOD(int32, IsSelfCalibrateValid, (niRFmxInstrHandle instrumentHandle, char selectorString[], int32* selfCalibrateValid, int32* validSteps), (override)); diff --git a/generated/nirfmxinstr/nirfmxinstr_service.cpp b/generated/nirfmxinstr/nirfmxinstr_service.cpp index 62196a6c4..7ff373fee 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_service.cpp @@ -2110,48 +2110,6 @@ namespace nirfmxinstr_grpc { } } - //--------------------------------------------------------------------- - //--------------------------------------------------------------------- - ::grpc::Status NiRFmxInstrService::InitializeWithChannel(::grpc::ServerContext* context, const InitializeWithChannelRequest* request, InitializeWithChannelResponse* response) - { - if (context->IsCancelled()) { - return ::grpc::Status::CANCELLED; - } - try { - auto resource_name_mbcs = convert_from_grpc(request->resource_name()); - char* resource_name = (char*)resource_name_mbcs.c_str(); - auto option_string_mbcs = convert_from_grpc(request->option_string()); - char* option_string = (char*)option_string_mbcs.c_str(); - auto channel_name_mbcs = convert_from_grpc(request->channel_name()); - char* channel_name = (char*)channel_name_mbcs.c_str(); - auto initialization_behavior = request->initialization_behavior(); - - int32 is_new_session {}; - bool new_session_initialized {}; - auto init_lambda = [&] () { - niRFmxInstrHandle instrument; - auto status = library_->InitializeWithChannel(resource_name, option_string, channel_name, &instrument, &is_new_session); - return std::make_tuple(status, instrument); - }; - std::string grpc_device_session_name = request->session_name(); - // Capture the library shared_ptr by value. Do not capture `this` or any references. - LibrarySharedPtr library = library_; - auto cleanup_lambda = [library] (niRFmxInstrHandle id) { library->Close(id, RFMXINSTR_VAL_FALSE); }; - int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, initialization_behavior, &new_session_initialized); - if (!status_ok(status)) { - return ConvertApiErrorStatusForNiRFmxInstrHandle(context, status, 0); - } - response->set_status(status); - response->mutable_instrument()->set_name(grpc_device_session_name); - response->set_is_new_session(is_new_session); - response->set_new_session_initialized(new_session_initialized); - return ::grpc::Status::OK; - } - catch (nidevice_grpc::NonDriverException& ex) { - return ex.GetStatus(); - } - } - //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiRFmxInstrService::InitializeFromNIRFSASession(::grpc::ServerContext* context, const InitializeFromNIRFSASessionRequest* request, InitializeFromNIRFSASessionResponse* response) diff --git a/generated/nirfmxinstr/nirfmxinstr_service.h b/generated/nirfmxinstr/nirfmxinstr_service.h index fa3be1b3d..a2b28dc51 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.h +++ b/generated/nirfmxinstr/nirfmxinstr_service.h @@ -100,7 +100,6 @@ class NiRFmxInstrService final : public NiRFmxInstr::Service { ::grpc::Status GetSelfCalibrateLastTemperature(::grpc::ServerContext* context, const GetSelfCalibrateLastTemperatureRequest* request, GetSelfCalibrateLastTemperatureResponse* response) override; ::grpc::Status GetSignalConfigurationNames(::grpc::ServerContext* context, const GetSignalConfigurationNamesRequest* request, GetSignalConfigurationNamesResponse* response) override; ::grpc::Status Initialize(::grpc::ServerContext* context, const InitializeRequest* request, InitializeResponse* response) override; - ::grpc::Status InitializeWithChannel(::grpc::ServerContext* context, const InitializeWithChannelRequest* request, InitializeWithChannelResponse* response) override; ::grpc::Status InitializeFromNIRFSASession(::grpc::ServerContext* context, const InitializeFromNIRFSASessionRequest* request, InitializeFromNIRFSASessionResponse* response) override; ::grpc::Status InitializeFromNIRFSASessionArray(::grpc::ServerContext* context, const InitializeFromNIRFSASessionArrayRequest* request, InitializeFromNIRFSASessionArrayResponse* response) override; ::grpc::Status IsSelfCalibrateValid(::grpc::ServerContext* context, const IsSelfCalibrateValidRequest* request, IsSelfCalibrateValidResponse* response) override; diff --git a/imports/include/niRFmxInstr.h b/imports/include/niRFmxInstr.h index 67b11d0f0..ed7cbd666 100644 --- a/imports/include/niRFmxInstr.h +++ b/imports/include/niRFmxInstr.h @@ -476,13 +476,6 @@ extern "C" char optionString[], niRFmxInstrHandle *handleOut, int32 *isNewSession); - - int32 __stdcall RFmxInstr_InitializeWithChannel( - char resourceName[], - char optionString[], - char channelName[], - niRFmxInstrHandle* handleOut, - int32* isNewSession); int32 __stdcall RFmxInstr_InitializeFromNIRFSASession( uInt32 NIRFSASession, diff --git a/source/codegen/metadata/nirfmxinstr/functions.py b/source/codegen/metadata/nirfmxinstr/functions.py index 604ab2781..3bdb93d79 100644 --- a/source/codegen/metadata/nirfmxinstr/functions.py +++ b/source/codegen/metadata/nirfmxinstr/functions.py @@ -1760,61 +1760,6 @@ } ], 'returns': 'int32' - }, - 'InitializeWithChannel': { - 'custom_close': 'Close(id, RFMXINSTR_VAL_FALSE)', - 'init_method': True, - 'parameters': [ - { - 'direction': 'in', - 'name': 'resourceName', - 'type': 'char[]' - }, - { - 'direction': 'in', - 'name': 'optionString', - 'type': 'char[]' - }, - { - 'direction': 'in', - 'name': 'channelName', - 'type': 'char[]' - }, - { - 'direction': 'out', - 'grpc_name': 'instrument', - 'name': 'handleOut', - 'type': 'niRFmxInstrHandle' - }, - { - 'direction': 'out', - 'name': 'isNewSession', - 'type': 'int32' - }, - { - 'direction': 'out', - 'get_last_error': 'deprecated', - 'name': 'errorMessage', - 'type': 'char[]' - }, - { - 'cppName': 'initializationBehavior', - 'direction': 'in', - 'grpc_type': 'nidevice_grpc.SessionInitializationBehavior', - 'name': 'initializationBehavior', - 'proto_only': True, - 'type': 'int32' - }, - { - 'cppName': 'newSessionInitialized', - 'direction': 'out', - 'grpc_type': 'bool', - 'name': 'newSessionInitialized', - 'proto_only': True, - 'type': 'bool' - } - ], - 'returns': 'int32' }, 'InitializeFromNIRFSASession': { 'custom_close': 'Close(id, RFMXINSTR_VAL_FALSE)',