Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Johnsel/scopehal-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnsel committed Dec 5, 2023
2 parents ebf69a2 + db900ad commit 387b7f2
Show file tree
Hide file tree
Showing 20 changed files with 558 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
VULKAN_SDK_VERSION: 1.3.250.1
VULKAN_SDK_VERSION: 1.3.268.0

jobs:

Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
cd ~
git clone https://github.com/KhronosGroup/glslang.git
cd glslang
git checkout tags/sdk-${{ env.VULKAN_SDK_VERSION }}
git checkout tags/vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}
git clone https://github.com/google/googletest.git External/googletest
cd External/googletest
git checkout 0c400f67fcf305869c5fb113dd296eca266c9725
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = ../scopehal-docs.git
[submodule "src/imgui"]
path = src/imgui
url = https://github.com/ocornut/imgui
url = ../imgui.git
[submodule "src/implot"]
path = src/implot
url = ../implot.git
Expand Down
2 changes: 1 addition & 1 deletion doc
2 changes: 1 addition & 1 deletion src/imgui
Submodule imgui updated 81 files
+1 −1 .github/issue_template.md
+10 −6 backends/imgui_impl_allegro5.cpp
+7 −3 backends/imgui_impl_allegro5.h
+17 −11 backends/imgui_impl_android.cpp
+7 −3 backends/imgui_impl_android.h
+8 −5 backends/imgui_impl_dx10.cpp
+5 −2 backends/imgui_impl_dx10.h
+8 −5 backends/imgui_impl_dx11.cpp
+5 −2 backends/imgui_impl_dx11.h
+8 −5 backends/imgui_impl_dx12.cpp
+5 −2 backends/imgui_impl_dx12.h
+6 −3 backends/imgui_impl_dx9.cpp
+5 −2 backends/imgui_impl_dx9.h
+86 −53 backends/imgui_impl_glfw.cpp
+5 −2 backends/imgui_impl_glfw.h
+6 −3 backends/imgui_impl_glut.cpp
+6 −3 backends/imgui_impl_glut.h
+5 −2 backends/imgui_impl_metal.h
+8 −5 backends/imgui_impl_metal.mm
+8 −5 backends/imgui_impl_opengl2.cpp
+5 −2 backends/imgui_impl_opengl2.h
+10 −5 backends/imgui_impl_opengl3.cpp
+5 −2 backends/imgui_impl_opengl3.h
+8 −7 backends/imgui_impl_opengl3_loader.h
+5 −2 backends/imgui_impl_osx.h
+20 −16 backends/imgui_impl_osx.mm
+25 −2 backends/imgui_impl_sdl2.cpp
+6 −2 backends/imgui_impl_sdl2.h
+53 −32 backends/imgui_impl_sdl3.cpp
+6 −2 backends/imgui_impl_sdl3.h
+10 −6 backends/imgui_impl_sdlrenderer2.cpp
+8 −0 backends/imgui_impl_sdlrenderer2.h
+10 −6 backends/imgui_impl_sdlrenderer3.cpp
+8 −0 backends/imgui_impl_sdlrenderer3.h
+125 −55 backends/imgui_impl_vulkan.cpp
+10 −7 backends/imgui_impl_vulkan.h
+10 −5 backends/imgui_impl_wgpu.cpp
+7 −2 backends/imgui_impl_wgpu.h
+44 −5 backends/imgui_impl_win32.cpp
+5 −2 backends/imgui_impl_win32.h
+1 −1 docs/BACKENDS.md
+319 −2 docs/CHANGELOG.txt
+12 −11 docs/CONTRIBUTING.md
+2 −2 docs/EXAMPLES.md
+5 −10 docs/FAQ.md
+60 −30 docs/FONTS.md
+18 −14 docs/README.md
+1 −2 docs/TODO.txt
+6 −2 examples/example_allegro5/main.cpp
+6 −1 examples/example_android_opengl3/main.cpp
+6 −2 examples/example_apple_metal/main.mm
+6 −2 examples/example_apple_opengl2/main.mm
+19 −12 examples/example_emscripten_wgpu/main.cpp
+6 −2 examples/example_glfw_metal/main.mm
+6 −2 examples/example_glfw_opengl2/main.cpp
+6 −2 examples/example_glfw_opengl3/main.cpp
+6 −32 examples/example_glfw_vulkan/main.cpp
+6 −2 examples/example_glut_opengl2/main.cpp
+6 −2 examples/example_sdl2_directx11/main.cpp
+6 −2 examples/example_sdl2_metal/main.mm
+6 −2 examples/example_sdl2_opengl2/main.cpp
+6 −2 examples/example_sdl2_opengl3/main.cpp
+6 −2 examples/example_sdl2_sdlrenderer2/main.cpp
+6 −32 examples/example_sdl2_vulkan/main.cpp
+6 −2 examples/example_sdl3_opengl3/main.cpp
+7 −3 examples/example_sdl3_sdlrenderer3/main.cpp
+6 −2 examples/example_win32_directx10/main.cpp
+6 −2 examples/example_win32_directx11/main.cpp
+6 −2 examples/example_win32_directx12/main.cpp
+6 −2 examples/example_win32_directx9/main.cpp
+7 −3 examples/example_win32_opengl3/main.cpp
+2 −2 imconfig.h
+1,063 −734 imgui.cpp
+198 −120 imgui.h
+492 −202 imgui_demo.cpp
+148 −72 imgui_draw.cpp
+253 −102 imgui_internal.h
+299 −99 imgui_tables.cpp
+467 −177 imgui_widgets.cpp
+76 −72 imstb_textedit.h
+21 −13 misc/freetype/imgui_freetype.cpp
99 changes: 99 additions & 0 deletions src/ngscopeclient/AddSpectrometerDialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/***********************************************************************************************************************
* *
* ngscopeclient *
* *
* Copyright (c) 2012-2023 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
* following conditions are met: *
* *
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other materials provided with the distribution. *
* *
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Implementation of AddSpectrometerDialog
*/

#include "ngscopeclient.h"
#include "AddSpectrometerDialog.h"

using namespace std;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction / destruction

AddSpectrometerDialog::AddSpectrometerDialog(Session& session)
: AddInstrumentDialog("Add Spectrometer", "Spectrometer", session)
{
SCPISpectrometer::EnumDrivers(m_drivers);
}

AddSpectrometerDialog::~AddSpectrometerDialog()
{
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// UI event handlers

/**
@brief Connects to a scope
@return True if successful
*/
bool AddSpectrometerDialog::DoConnect()
{
//Create the transport
auto transport = SCPITransport::CreateTransport(m_transports[m_selectedTransport], m_path);
if(transport == nullptr)
{
ShowErrorPopup(
"Transport error",
"Failed to create transport of type \"" + m_transports[m_selectedTransport] + "\"");
return false;
}

//Make sure we connected OK
if(!transport->IsConnected())
{
delete transport;
ShowErrorPopup("Connection error", "Failed to connect to \"" + m_path + "\"");
return false;
}

//Create the spec
auto spec = SCPISpectrometer::CreateSpectrometer(m_drivers[m_selectedDriver], transport);
if(spec == nullptr)
{
ShowErrorPopup(
"Driver error",
"Failed to create spectrometer driver of type \"" + m_drivers[m_selectedDriver] + "\"");
delete transport;
return false;
}

//TODO: apply preferences
LogDebug("FIXME: apply PreferenceManager settings to newly created spectrometer\n");

spec->m_nickname = m_nickname;
m_session.AddSpectrometer(spec);
return true;
}
50 changes: 50 additions & 0 deletions src/ngscopeclient/AddSpectrometerDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/***********************************************************************************************************************
* *
* ngscopeclient *
* *
* Copyright (c) 2012-2023 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
* following conditions are met: *
* *
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other materials provided with the distribution. *
* *
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Declaration of AddSpectrometerDialog
*/
#ifndef AddSpectrometerDialog_h
#define AddSpectrometerDialog_h

#include "AddInstrumentDialog.h"

class AddSpectrometerDialog : public AddInstrumentDialog
{
public:
AddSpectrometerDialog(Session& session);
virtual ~AddSpectrometerDialog();

protected:
virtual bool DoConnect();
};

#endif
2 changes: 1 addition & 1 deletion src/ngscopeclient/AddVNADialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************************************************************************
* *
* glscopeclient *
* ngscopeclient *
* *
* Copyright (c) 2012-2023 Andrew D. Zonenberg *
* All rights reserved. *
Expand Down
2 changes: 1 addition & 1 deletion src/ngscopeclient/AddVNADialog.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************************************************************************
* *
* glscopeclient *
* ngscopeclient *
* *
* Copyright (c) 2012-2023 Andrew D. Zonenberg *
* All rights reserved. *
Expand Down
1 change: 1 addition & 0 deletions src/ngscopeclient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ add_executable(ngscopeclient
AddPowerSupplyDialog.cpp
AddRFGeneratorDialog.cpp
AddScopeDialog.cpp
AddSpectrometerDialog.cpp
AddVNADialog.cpp
BERTDialog.cpp
BERTInputChannelDialog.cpp
Expand Down
Loading

0 comments on commit 387b7f2

Please sign in to comment.