Skip to content

Commit c91afeb

Browse files
authored
Merge pull request #684 from open-ephys/development
GUI v1.0.2
2 parents 7d8c513 + 09605fc commit c91afeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1037
-123
lines changed

.github/workflows/tests.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'JuceLibraryCode/**'
7+
- 'Plugins/**'
8+
- 'Resources/**'
9+
- 'Source/**'
10+
- 'CMakeLists.txt'
11+
- 'HelperFunctions.cmake'
12+
branches:
13+
- 'development'
14+
- 'testing'
15+
16+
jobs:
17+
unit-tests:
18+
name: Unit Tests
19+
runs-on: ubuntu-22.04
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: build
24+
env:
25+
CC: gcc-10
26+
CXX: g++-10
27+
run: |
28+
sudo apt update
29+
sudo ./Resources/Scripts/install_linux_dependencies.sh
30+
git apply Resources/Scripts/gha_unit_tests.patch
31+
cd Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ..
32+
make -j8
33+
- name: run tests
34+
run: |
35+
chmod +x ./Resources/Scripts/run_unit_tests_linux.sh
36+
./Resources/Scripts/run_unit_tests_linux.sh Build/TestBin
37+
shell: bash
38+
39+
integration-tests:
40+
name: Integration Tests
41+
runs-on: windows-2022
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
- name: Setup Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.13'
51+
- name: Start Windows Audio Engine
52+
run: net start audiosrv
53+
- name: Install Scream
54+
shell: powershell
55+
run: |
56+
Start-Service audio*
57+
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
58+
Expand-7ZipArchive -Path C:\Scream3.6.zip -DestinationPath C:\Scream
59+
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
60+
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
61+
$store.Open("ReadWrite")
62+
$store.Add($cert)
63+
$store.Close()
64+
cd C:\Scream\Install\driver
65+
C:\Scream\Install\helpers\devcon install Scream.inf *Scream
66+
- name: Show audio device
67+
run: Get-CimInstance Win32_SoundDevice | fl *
68+
- name: configure
69+
run: |
70+
cd Build
71+
cmake -G "Visual Studio 17 2022" -A x64 ..
72+
- name: Add msbuild to PATH
73+
uses: microsoft/[email protected]
74+
- name: build
75+
run: |
76+
cd Build
77+
msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
78+
- name: Install open-ephys-data-format
79+
shell: powershell
80+
run: |
81+
New-Item -Path '..\OEPlugins' -ItemType Directory
82+
git clone --branch main https://github.com/open-ephys-plugins/open-ephys-data-format.git ..\OEPlugins\open-ephys-data-format
83+
cd ..\OEPlugins\open-ephys-data-format\Build
84+
cmake -G "Visual Studio 17 2022" -A x64 ..
85+
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
86+
- name: Install OpenEphysHDF5Lib
87+
shell: powershell
88+
run: |
89+
git clone --branch main https://github.com/open-ephys-plugins/OpenEphysHDF5Lib.git ..\OEPlugins\OpenEphysHDF5Lib
90+
cd ..\OEPlugins\OpenEphysHDF5Lib\Build
91+
cmake -G "Visual Studio 17 2022" -A x64 ..
92+
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
93+
- name: Install nwb-format
94+
shell: powershell
95+
run: |
96+
git clone --branch main https://github.com/open-ephys-plugins/nwb-format.git ..\OEPlugins\nwb-format
97+
cd ..\OEPlugins\nwb-format\Build
98+
cmake -G "Visual Studio 17 2022" -A x64 ..
99+
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
100+
- name: Install test-suite
101+
shell: powershell
102+
run: |
103+
git clone --branch main https://github.com/open-ephys/open-ephys-python-tools.git C:\open-ephys-python-tools
104+
cd C:\open-ephys-python-tools
105+
pip install -e .
106+
pip install psutil
107+
- name: Run Tests
108+
shell: powershell
109+
run: |
110+
New-Item -Path 'C:\open-ephys\data' -ItemType Directory
111+
git clone --branch main https://github.com/open-ephys/open-ephys-test-suite.git C:\test-suite
112+
cd C:\test-suite
113+
$process = Start-Process -FilePath "Build\Release\open-ephys.exe" -ArgumentList "Build\Release\configs\file_reader_config.xml" -NoNewWindow -PassThru
114+
Write-Host "Started open-ephys process with ID: $($process.Id)"
115+
Start-Sleep -Seconds 10
116+
Write-Host "Starting Python script..."
117+
python run_all.py 2>&1 | Tee-Object -FilePath "python_output.log"
118+
Write-Host "Python script completed. Output saved to python_output.log"
119+
Stop-Process -Id $process.Id -Force
120+
env:
121+
OE_WINDOWS_GITHUB_RECORD_PATH: C:\open-ephys\data
122+
- name: Set timestamp
123+
shell: powershell
124+
id: timestamp
125+
run: |
126+
$timestamp = Get-Date -Format 'yyyy_MM_dd_HH_mm_ss'
127+
"timestamp=$timestamp" >> $env:GITHUB_OUTPUT
128+
- name: Upload test results
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: windows_${{ steps.timestamp.outputs.timestamp }}.log
132+
path: python_output.log
133+
retention-days: 7

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Open Ephys GUI main build file
22
cmake_minimum_required(VERSION 3.15)
33

4-
set(GUI_VERSION 1.0.1)
4+
set(GUI_VERSION 1.0.2)
55

66
string(REGEX MATCHALL "[0-9]+" VERSION_LIST ${GUI_VERSION})
77
list(LENGTH VERSION_LIST num_version_components)

Plugins/LfpViewer/DisplayBuffer.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,33 @@ void DisplayBuffer::addChannel (
6464
ContinuousChannel::Type type,
6565
bool isRecorded,
6666
int group,
67+
float xpos,
6768
float ypos,
6869
String description,
69-
String structure)
70+
String structure,
71+
float inputRangeMin,
72+
float inputRangeMax,
73+
String units,
74+
bool hasGroupMetadata,
75+
bool hasYposMetadata,
76+
bool hasXposMetadata)
7077
{
7178
ChannelMetadata metadata = ChannelMetadata();
7279
metadata.name = name;
7380
metadata.type = type;
7481
metadata.group = group;
82+
metadata.xpos = xpos;
7583
metadata.ypos = ypos;
7684
metadata.structure = structure;
7785
metadata.type = type;
7886
metadata.isRecorded = isRecorded;
7987
metadata.description = description;
88+
metadata.inputRangeMin = inputRangeMin;
89+
metadata.inputRangeMax = inputRangeMax;
90+
metadata.units = units;
91+
metadata.hasGroupMetadata = hasGroupMetadata;
92+
metadata.hasYposMetadata = hasYposMetadata;
93+
metadata.hasXposMetadata = hasXposMetadata;
8094

8195
channelMetadata.add (metadata);
8296
channelMap[channelNum] = numChannels;

Plugins/LfpViewer/DisplayBuffer.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,16 @@ class TESTABLE DisplayBuffer : public AudioBuffer<float>
6161
ContinuousChannel::Type channelType,
6262
bool isRecorded,
6363
int group = 0,
64+
float xpos = 0.0f,
6465
float ypos = 0,
6566
String description = "",
66-
String structure = "None");
67+
String structure = "None",
68+
float inputRangeMin = -5000.0f,
69+
float inputRangeMax = +5000.0f,
70+
String units = "",
71+
bool hasGroupMetadata = false,
72+
bool hasYposMetadata = false,
73+
bool hasXposMetadata = false);
6774

6875
/** Initializes the event channel at the start of each buffer */
6976
void initializeEventChannel (int nSamples);
@@ -86,11 +93,18 @@ class TESTABLE DisplayBuffer : public AudioBuffer<float>
8693
{
8794
String name = "";
8895
int group = 0;
96+
float xpos = 0.0f;
8997
float ypos = 0;
9098
String structure = "None";
9199
ContinuousChannel::Type type;
92100
bool isRecorded = false;
93101
String description = "";
102+
float inputRangeMin = -5000.0f;
103+
float inputRangeMax = +5000.0f;
104+
String units = "";
105+
bool hasGroupMetadata = false;
106+
bool hasYposMetadata = false;
107+
bool hasXposMetadata = false;
94108
};
95109

96110
Array<ChannelMetadata> channelMetadata;

Plugins/LfpViewer/LfpChannelDisplay.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ void LfpChannelDisplay::setType (ContinuousChannel::Type type_)
7979
typeStr = options->getTypeName (type);
8080
}
8181

82+
void LfpChannelDisplay::setUnits (const String& newUnits)
83+
{
84+
units = newUnits;
85+
}
86+
87+
const String& LfpChannelDisplay::getUnits() const
88+
{
89+
return units;
90+
}
91+
8292
void LfpChannelDisplay::setEnabledState (bool state)
8393
{
8494
/*if (state)
@@ -809,6 +819,18 @@ void LfpChannelDisplay::setDepth (float depth_)
809819
depth = depth_;
810820
}
811821

822+
void LfpChannelDisplay::setXpos (float xpos_)
823+
{
824+
xpos = xpos_;
825+
}
826+
827+
void LfpChannelDisplay::setMetadataPresence (bool hasGroupMetadata_, bool hasYposMetadata_, bool hasXposMetadata_)
828+
{
829+
groupMetadataAvailable = hasGroupMetadata_;
830+
yposMetadataAvailable = hasYposMetadata_;
831+
xposMetadataAvailable = hasXposMetadata_;
832+
}
833+
812834
void LfpChannelDisplay::setRecorded (bool recorded_)
813835
{
814836
isRecorded = recorded_;

Plugins/LfpViewer/LfpChannelDisplay.h

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ class LfpChannelDisplay : public Component
8989
/** Sets the channel depth*/
9090
void setDepth (float);
9191

92+
/** Sets the channel x-position */
93+
void setXpos (float);
94+
95+
/** Records which metadata fields were provided for this channel */
96+
void setMetadataPresence (bool hasGroupMetadata_, bool hasYposMetadata_, bool hasXposMetadata_);
97+
9298
/** Sets whether or not the channel is recorded by an upstream Record Node*/
9399
void setRecorded (bool);
94100

@@ -113,6 +119,12 @@ class LfpChannelDisplay : public Component
113119
/** Return the assigned channel name */
114120
String getName();
115121

122+
/** Set the units string used for display */
123+
void setUnits (const String& newUnits);
124+
125+
/** Return the units string for this channel */
126+
const String& getUnits() const;
127+
116128
/** Returns the assigned channel number for this display, relative
117129
to the subset of channels being drawn to the canvas */
118130
int getDrawableChannelNumber();
@@ -170,6 +182,10 @@ class LfpChannelDisplay : public Component
170182

171183
float getDepth() { return depth; }
172184
int getGroup() { return group; }
185+
float getXpos() const { return xpos; }
186+
bool hasGroupMetadata() const { return groupMetadataAvailable; }
187+
bool hasYposMetadata() const { return yposMetadataAvailable; }
188+
bool hasXposMetadata() const { return xposMetadataAvailable; }
173189

174190
int ifrom, ito, ito_local, ifrom_local;
175191

@@ -189,10 +205,16 @@ class LfpChannelDisplay : public Component
189205
int drawableChan;
190206

191207
String name;
192-
int group;
193-
float depth;
208+
int group = 0;
209+
float depth = 0.0f;
210+
float xpos = 0.0f;
211+
bool groupMetadataAvailable = false;
212+
bool yposMetadataAvailable = false;
213+
bool xposMetadataAvailable = false;
194214
bool isRecorded;
195215

216+
String units;
217+
196218
FontOptions channelFont;
197219

198220
Colour lineColour;

Plugins/LfpViewer/LfpChannelDisplayInfo.cpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,31 @@ void LfpChannelDisplayInfo::paint (Graphics& g)
239239

240240
if (getChannelTypeStringVisibility())
241241
{
242+
constexpr int textHeight = 14;
243+
constexpr int textStartX = 5;
244+
const int textY = center + 10;
245+
242246
g.setFont (FontOptions (13.0f));
243-
g.drawText (typeStr, 5, center + 10, 50, 14, Justification::centred, false);
247+
g.setColour (lineColour);
248+
const auto currentFont = g.getCurrentFont();
249+
250+
const int typeWidth = currentFont.getStringWidth (typeStr);
251+
const int typeBoundsWidth = typeWidth + 2;
252+
g.drawText (typeStr, textStartX, textY, typeBoundsWidth, textHeight, Justification::centredLeft, false);
253+
254+
const String& unitsText = getUnits();
255+
if (unitsText.isNotEmpty())
256+
{
257+
const int unitsX = textStartX + typeWidth + 5;
258+
const int unitsWidth = getWidth() - unitsX - 4;
259+
260+
if (unitsWidth > 0)
261+
{
262+
g.setColour (Colours::grey.withAlpha (0.8f));
263+
g.setFont (FontOptions (12.0f));
264+
g.drawFittedText (unitsText, unitsX, textY, unitsWidth, textHeight, Justification::centredLeft, 1, 0.8f);
265+
}
266+
}
244267
}
245268

246269
if (isSingleChannel)
@@ -325,8 +348,7 @@ bool LfpChannelDisplayInfo::isChannelNumberHidden()
325348
String LfpChannelDisplayInfo::getTooltip()
326349
{
327350
const bool showChannelNumbers = options->getChannelNameState();
328-
const String channelString = (isChannelNumberHidden() ? ("--") : showChannelNumbers ? String (getChannelNumber() + 1)
329-
: getName());
351+
const String channelString = showChannelNumbers ? String (getChannelNumber() + 1) : getName();
330352

331353
return channelString;
332-
}
354+
}

0 commit comments

Comments
 (0)