From 2189f956e1d9e61a48b0b94867d8e0bb08997bbc Mon Sep 17 00:00:00 2001 From: fredzo Date: Fri, 6 Feb 2026 16:14:53 +0100 Subject: [PATCH 1/8] Enumerate UART WIP --- lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib b/lib index d12c1405..4f572c3f 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit d12c14057c3269f2f4825055b70cef9493881a44 +Subproject commit 4f572c3f7c2e3ae93d1775581ee1d2e8a5d2e027 From 88aac8db65f91692a85cef89247f96f06a1eaddf Mon Sep 17 00:00:00 2001 From: Frederic Borry Date: Sat, 7 Feb 2026 12:45:14 +0100 Subject: [PATCH 2/8] WIP transport endpoints. --- lib | 2 +- src/ngscopeclient/AddInstrumentDialog.cpp | 8 ++++++++ src/ngscopeclient/AddInstrumentDialog.h | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib b/lib index 4f572c3f..49c553d3 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 4f572c3f7c2e3ae93d1775581ee1d2e8a5d2e027 +Subproject commit 49c553d32f68ae9c492ed30e72bb79c813554b2a diff --git a/src/ngscopeclient/AddInstrumentDialog.cpp b/src/ngscopeclient/AddInstrumentDialog.cpp index b2893deb..bed71b0b 100644 --- a/src/ngscopeclient/AddInstrumentDialog.cpp +++ b/src/ngscopeclient/AddInstrumentDialog.cpp @@ -60,6 +60,7 @@ AddInstrumentDialog::AddInstrumentDialog( , m_nickname(nickname) , m_selectedDriver(0) , m_selectedTransport(0) + , m_selectedEndpoint(0) , m_selectedModel(0) , m_path(path) { @@ -291,6 +292,7 @@ void AddInstrumentDialog::UpdateCombos() { m_models.clear(); m_transports.clear(); + m_endpoits.clear(); int modelIndex = 0; auto selectedModel = supportedModels[0]; // Model list @@ -332,6 +334,12 @@ void AddInstrumentDialog::UpdateCombos() if(!m_pathEdited) m_path = ""; } + // Update endpoint list + auto endpoints = SCPITransport::EnumEndpoints(m_transports[m_selectedTransport]); + for(auto endpoint : endpoints) + { + m_endpoits.push_back(endpoint); + } } else { // Supported transports not provided => add all transports diff --git a/src/ngscopeclient/AddInstrumentDialog.h b/src/ngscopeclient/AddInstrumentDialog.h index 10cddc6a..65c84c86 100644 --- a/src/ngscopeclient/AddInstrumentDialog.h +++ b/src/ngscopeclient/AddInstrumentDialog.h @@ -70,6 +70,8 @@ class AddInstrumentDialog : public Dialog std::vector m_drivers; int m_selectedTransport; std::vector m_transports; + int m_selectedEndpoint; + std::vector m_endpoits; int m_selectedModel; std::vector m_models; std::unordered_set m_supportedTransports; From 6b90256deab3e80ad6755ab6501b70f37153347c Mon Sep 17 00:00:00 2001 From: Frederic Borry Date: Sun, 8 Feb 2026 12:07:02 +0100 Subject: [PATCH 3/8] Added endpoint selection + path update in AddInstrumentDialog. --- src/ngscopeclient/AddInstrumentDialog.cpp | 29 ++++++++++++++++++++--- src/ngscopeclient/AddInstrumentDialog.h | 6 ++++- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/ngscopeclient/AddInstrumentDialog.cpp b/src/ngscopeclient/AddInstrumentDialog.cpp index bed71b0b..6f379da1 100644 --- a/src/ngscopeclient/AddInstrumentDialog.cpp +++ b/src/ngscopeclient/AddInstrumentDialog.cpp @@ -54,7 +54,7 @@ AddInstrumentDialog::AddInstrumentDialog( : Dialog( title, string("AddInstrument") + to_string_hex(reinterpret_cast(this)), - ImVec2(600, 180), + ImVec2(600, 200), session, parent) , m_nickname(nickname) @@ -200,6 +200,14 @@ bool AddInstrumentDialog::DoRender() else if(dropdownOpen) //suppress further bubbles if dropdown is active showedBubble = true; + if(!m_endpoints.empty()) + { // Endpoint discovery available: create endpoint combo + if(Combo("Endpoint", m_endpointNames, m_selectedEndpoint, &dropdownOpen)) + { + UpdatePath(); + } + HelpMarker("Select the transport endpoint from the list and/or edit the path manually."); + } if(ImGui::InputText("Path", &m_path)) m_pathEdited = !(m_path.empty() || (m_path == m_defaultPath)); HelpMarker( @@ -283,16 +291,24 @@ bool AddInstrumentDialog::DoConnect(SCPITransport* transport) return m_session->CreateAndAddInstrument(m_drivers[m_selectedDriver], transport, m_nickname); } +void AddInstrumentDialog::UpdatePath() +{ + size_t pos = m_path.find(':'); + string suffix = (pos == std::string::npos) ? "" : m_path.substr(pos); + m_path = m_endpoints[m_selectedEndpoint].path + suffix; +} + void AddInstrumentDialog::UpdateCombos() { // Update transoport list according to selected driver an connection string according to transport string driver = m_drivers[m_selectedDriver]; auto supportedModels = SCPIInstrument::GetSupportedModels(driver); + m_endpoints.clear(); + m_endpointNames.clear(); if(!supportedModels.empty()) { m_models.clear(); m_transports.clear(); - m_endpoits.clear(); int modelIndex = 0; auto selectedModel = supportedModels[0]; // Model list @@ -338,8 +354,15 @@ void AddInstrumentDialog::UpdateCombos() auto endpoints = SCPITransport::EnumEndpoints(m_transports[m_selectedTransport]); for(auto endpoint : endpoints) { - m_endpoits.push_back(endpoint); + m_endpoints.push_back(endpoint); + m_endpointNames.push_back(endpoint.path + " ("+ endpoint.description +")"); + } + if(m_selectedEndpoint >= (int)m_endpoints.size()) + { + m_selectedEndpoint = 0; } + if(m_endpoints.size()>0) + UpdatePath(); } else { // Supported transports not provided => add all transports diff --git a/src/ngscopeclient/AddInstrumentDialog.h b/src/ngscopeclient/AddInstrumentDialog.h index 65c84c86..6d2af289 100644 --- a/src/ngscopeclient/AddInstrumentDialog.h +++ b/src/ngscopeclient/AddInstrumentDialog.h @@ -61,6 +61,9 @@ class AddInstrumentDialog : public Dialog virtual bool DoConnect(SCPITransport* transport); void UpdateCombos(); + + void UpdatePath(); + //GUI widget values std::string m_nickname; std::string m_originalNickname; @@ -71,7 +74,8 @@ class AddInstrumentDialog : public Dialog int m_selectedTransport; std::vector m_transports; int m_selectedEndpoint; - std::vector m_endpoits; + std::vector m_endpoints; + std::vector m_endpointNames; int m_selectedModel; std::vector m_models; std::unordered_set m_supportedTransports; From 99b82b11f7f0bbafafbf4b32227b4cc3494a9848 Mon Sep 17 00:00:00 2001 From: Frederic Borry Date: Mon, 9 Feb 2026 00:07:52 +0100 Subject: [PATCH 4/8] WIP addning HID devices enumeration. --- lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib b/lib index 49c553d3..aa45b4cd 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 49c553d32f68ae9c492ed30e72bb79c813554b2a +Subproject commit aa45b4cd1c479aa431157fc6c6c078f06844fbf4 From 08262ef48cb31e01de86982565c5c690aa50a9f5 Mon Sep 17 00:00:00 2001 From: fredzo Date: Mon, 9 Feb 2026 11:57:52 +0100 Subject: [PATCH 5/8] Added HID endpoint support. --- lib | 2 +- src/ngscopeclient/AddInstrumentDialog.cpp | 32 ++++++++++++++++++----- src/ngscopeclient/AddInstrumentDialog.h | 1 + 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/lib b/lib index aa45b4cd..bebf21c3 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit aa45b4cd1c479aa431157fc6c6c078f06844fbf4 +Subproject commit bebf21c36fb72d43f5c8886dca2cbec4b66a4efb diff --git a/src/ngscopeclient/AddInstrumentDialog.cpp b/src/ngscopeclient/AddInstrumentDialog.cpp index 6f379da1..06ad1ae8 100644 --- a/src/ngscopeclient/AddInstrumentDialog.cpp +++ b/src/ngscopeclient/AddInstrumentDialog.cpp @@ -60,6 +60,7 @@ AddInstrumentDialog::AddInstrumentDialog( , m_nickname(nickname) , m_selectedDriver(0) , m_selectedTransport(0) + , m_selectedTransportType(SCPITransportType::TRANSPORT_HID) , m_selectedEndpoint(0) , m_selectedModel(0) , m_path(path) @@ -293,9 +294,16 @@ bool AddInstrumentDialog::DoConnect(SCPITransport* transport) void AddInstrumentDialog::UpdatePath() { - size_t pos = m_path.find(':'); - string suffix = (pos == std::string::npos) ? "" : m_path.substr(pos); - m_path = m_endpoints[m_selectedEndpoint].path + suffix; + if(m_selectedTransportType == SCPITransportType::TRANSPORT_HID) + { // Special handling for HID transport: replace the whole path with endpoint value + m_path = m_endpoints[m_selectedEndpoint].path; + } + else + { + size_t pos = m_path.find(':'); + string suffix = (pos == std::string::npos) ? "" : m_path.substr(pos); + m_path = m_endpoints[m_selectedEndpoint].path + suffix; + } } void AddInstrumentDialog::UpdateCombos() @@ -333,13 +341,19 @@ void AddInstrumentDialog::UpdateCombos() for(auto transport : selectedModel.supportedTransports) { string transportName = to_string(transport.transportType); + // Prepare transport type for default value + if(transportIndex == 0) m_selectedTransportType = transport.transportType; if(m_supportedTransports.find(transportName) != m_supportedTransports.end()) { m_transports.push_back(transportName); - if(transportIndex == m_selectedTransport && !m_pathEdited) + if(transportIndex == m_selectedTransport) { - m_path = transport.connectionString; - m_defaultPath = m_path; + m_selectedTransportType = transport.transportType; + if(!m_pathEdited) + { + m_path = transport.connectionString; + m_defaultPath = m_path; + } } transportIndex++; } @@ -352,10 +366,16 @@ void AddInstrumentDialog::UpdateCombos() } // Update endpoint list auto endpoints = SCPITransport::EnumEndpoints(m_transports[m_selectedTransport]); + int endpointIndex = 0; for(auto endpoint : endpoints) { m_endpoints.push_back(endpoint); m_endpointNames.push_back(endpoint.path + " ("+ endpoint.description +")"); + if(m_selectedTransportType == SCPITransportType::TRANSPORT_HID && (endpoint.path.rfind(m_path) == 0)) + { // Special handling for HID : select the endpoint matching the path provided by the driver + m_selectedEndpoint = endpointIndex; + } + endpointIndex++; } if(m_selectedEndpoint >= (int)m_endpoints.size()) { diff --git a/src/ngscopeclient/AddInstrumentDialog.h b/src/ngscopeclient/AddInstrumentDialog.h index 6d2af289..dcd900e7 100644 --- a/src/ngscopeclient/AddInstrumentDialog.h +++ b/src/ngscopeclient/AddInstrumentDialog.h @@ -72,6 +72,7 @@ class AddInstrumentDialog : public Dialog int m_selectedDriver; std::vector m_drivers; int m_selectedTransport; + SCPITransportType m_selectedTransportType; std::vector m_transports; int m_selectedEndpoint; std::vector m_endpoints; From 4f0256c0475300bc887e14343d23326ecfc7cfb6 Mon Sep 17 00:00:00 2001 From: fredzo Date: Mon, 9 Feb 2026 14:40:52 +0100 Subject: [PATCH 6/8] Added refresh button for endpoints combo. --- src/ngscopeclient/AddInstrumentDialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ngscopeclient/AddInstrumentDialog.cpp b/src/ngscopeclient/AddInstrumentDialog.cpp index 06ad1ae8..99d8ab59 100644 --- a/src/ngscopeclient/AddInstrumentDialog.cpp +++ b/src/ngscopeclient/AddInstrumentDialog.cpp @@ -208,6 +208,11 @@ bool AddInstrumentDialog::DoRender() UpdatePath(); } HelpMarker("Select the transport endpoint from the list and/or edit the path manually."); + ImGui::SameLine(); + if(ImGui::Button("⟳")) + { + UpdateCombos(); + } } if(ImGui::InputText("Path", &m_path)) m_pathEdited = !(m_path.empty() || (m_path == m_defaultPath)); From 155967a8846db19d7810b6e70755b57b13a1b3b5 Mon Sep 17 00:00:00 2001 From: fredzo Date: Mon, 9 Feb 2026 14:41:16 +0100 Subject: [PATCH 7/8] Prepare merge. --- lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib b/lib index bebf21c3..aaa5296f 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit bebf21c36fb72d43f5c8886dca2cbec4b66a4efb +Subproject commit aaa5296f177cc12f2a7ae622bc3f3c3064baae0b From ef2d2195de1d33fa30dc86abc380ba93c4d10640 Mon Sep 17 00:00:00 2001 From: fredzo Date: Mon, 9 Feb 2026 14:44:12 +0100 Subject: [PATCH 8/8] Finished merge. --- lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib b/lib index aaa5296f..c4d7c904 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit aaa5296f177cc12f2a7ae622bc3f3c3064baae0b +Subproject commit c4d7c9047dd335da3ca6caebb625c3e2f00730af