Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:

# Upload Engine
- name: Upload Engine
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Engine-${{ matrix.arch }}-${{ matrix.branding }} (${{ matrix.os }})
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

# Upload Engine
- name: Upload Engine
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Engine-${{ matrix.arch }}-${{ matrix.branding }} (${{ matrix.os }})
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
touch repository.tar.zst
tar -I "zstd -T0 --ultra -10" --exclude=repository.tar.zst --exclude=.git -cf repository.tar.zst .
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: Repository
Expand Down Expand Up @@ -238,14 +238,14 @@ jobs:

# Upload Studio
- name: Upload Studio
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Packages (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: ./dist/${{ matrix.os }}/*.deb

# Upload Engine
- name: Upload Engine
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Engine (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

# Upload
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Binaries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: |
Expand All @@ -94,15 +94,15 @@ jobs:

# Upload lto.o
- name: Upload lto.o
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: lto.o (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: ./build/make/obj/osx-${{ matrix.arch }}-release/**/lto.o

# Upload Engine
- name: Upload Engine
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Engine (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: |
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:

# Upload
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Packages (${{ matrix.os }}-${{ matrix.branding }})
path: ./dist/osx-10.15/*.pkg
Expand Down Expand Up @@ -272,7 +272,7 @@ jobs:

# Upload
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Packages Store (${{ matrix.os }}-${{ matrix.branding }})
path: ./dist/osx-10.15/*.pkg
8 changes: 4 additions & 4 deletions .github/workflows/build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:

# Upload Studio
- name: Upload Studio
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Binaries (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: |
Expand All @@ -117,7 +117,7 @@ jobs:

# Upload Engine
- name: Upload Engine
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Engine (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.branding }})
path: |
Expand Down Expand Up @@ -219,15 +219,15 @@ jobs:

# Upload MSI
- name: Upload MSI
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Packages MSI (${{ matrix.os }}-${{ matrix.branding }})
path: |
./dist/win-10/*.msi

# Upload Packages
- name: Upload App
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Packages App (${{ matrix.os }}-${{ matrix.branding }})
path: |
Expand Down
32 changes: 16 additions & 16 deletions src/Engine/Devices/OpenBCI/OpenBCIDevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@ void OpenBCIDaisyDevice::CreateElectrodes()
mElectrodes.Clear();
mElectrodes.Reserve(NUMELECTRODESDAISY);

mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("P3"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("P4"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("Oz"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("Fz"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("T5"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("T6"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("F3"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("F4"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("T3"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("T4"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("C3"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("C4"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("Cz"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("O1"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("O2"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("Pz"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("1"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("2"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("3"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("4"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("5"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("6"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("7"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("8"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("9"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("10"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("11"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("12"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("13"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("14"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("15"));
mElectrodes.Add(GetEEGElectrodes()->GetElectrodeByID("16"));
}

#endif
3 changes: 1 addition & 2 deletions src/Engine/Devices/OpenBCI/OpenBCIDevices.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class ENGINE_API OpenBCIDeviceBase : public BciDevice
double GetExpectedJitter() const override { return 0.1; }
bool IsWireless() const override { return true; }
bool HasTestMode() const override { return false; }
double GetTimeoutLimit() const override { return 60; }

void CreateSensors() override;

Expand Down Expand Up @@ -133,8 +134,6 @@ class ENGINE_API OpenBCIDevice : public OpenBCIDeviceBase
static const char* GetRuleName() { return "DEVICE_OpenBCI"; }
double GetSampleRate() const override { return SAMPLERATECYTON; }

double GetTimeoutLimit() const override { return 60; } // Long timeout limit because channel config takes so long

void CreateElectrodes() override;

inline double GetImpedance(uint32 idx) override { return mImpedances[idx].imp; }
Expand Down
1 change: 0 additions & 1 deletion src/Engine/Graph/ChannelSelectorNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ bool ChannelSelectorNode::IsChannelSelected(const ChannelBase* channel) const
return false;
}


// create the output ports (with empty multi channels)
void ChannelSelectorNode::ReInitOutputPorts()
{
Expand Down
51 changes: 44 additions & 7 deletions src/Engine/Graph/ViewNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "../DSP/Spectrum.h"
#include "../EngineManager.h"


using namespace Core;

// constructor
Expand Down Expand Up @@ -60,10 +59,11 @@ void ViewNode::Init()
// SETUP PORTS

// setup the input ports
InitInputPorts(3);
InitInputPorts(4);
GetInputPort(INPUTPORT_DOUBLE).Setup("In", "x1", AttributeChannels<double>::TYPE_ID, INPUTPORT_DOUBLE);
GetInputPort(INPUTPORT_SPECTRUM).Setup("In (Spectrum)", "x2", AttributeChannels<Spectrum>::TYPE_ID, INPUTPORT_SPECTRUM);
GetInputPort(INPUTPORT_ENABLE).Setup("Enable", "enable", AttributeChannels<double>::TYPE_ID, INPUTPORT_ENABLE);
GetInputPort(INPUTPORT_LENGTH).Setup("Length in mins", "length", AttributeChannels<double>::TYPE_ID, INPUTPORT_LENGTH);

// ATTRIBUTES

Expand Down Expand Up @@ -100,6 +100,9 @@ void ViewNode::Init()
AttributeSettings* attributeCombinedView = RegisterAttribute("Combined View", "combineView", "Display all input channels in a single chart.", ATTRIBUTE_INTERFACETYPE_CHECKBOX);
attributeCombinedView->SetDefaultValue( AttributeBool::Create(defaultCombinedView) );

AttributeSettings* fixedLength = RegisterAttribute( "Fixed Length in mins", "fixedLength", "Fix length in Seconds.", Core::ATTRIBUTE_INTERFACETYPE_CHECKBOX);
fixedLength->SetDefaultValue( AttributeBool::Create(false) );

// sync buffer size to initial value
SyncBufferSize(true);
}
Expand Down Expand Up @@ -145,6 +148,32 @@ void ViewNode::Update(const Time& elapsed, const Time& delta)
}
}

auto fixedLengthCache = mFixedLengthDuration;
InputPort& lengthPort = GetInputPort(INPUTPORT_LENGTH);
if (lengthPort.HasConnection() == false)
{
GetAttributeSettings(ATTRIB_LENGTH)->SetIsEnabled(true);
mFixedLengthDuration = -1.;
}
else
{
if (lengthPort.GetChannels()->GetNumChannels() > 0 && lengthPort.GetChannels()->GetChannel(0)->IsEmpty() == false)
{
GetAttributeSettings(ATTRIB_LENGTH)->SetIsEnabled(false);
const double sampleValue = lengthPort.GetChannels()->GetChannel(0)->AsType<double>()->GetLastSample();
if (sampleValue > 0.)
mFixedLengthDuration = sampleValue;
}
else
{
mFixedLengthDuration = -1.;
}
}

// If the duration is changed, update buffer size
if (abs(fixedLengthCache - mFixedLengthDuration) > 0.0001)
SyncBufferSize(false);

// update scaling range (i.e. the auto modes need to recalculate the range)
CalculateScalingRange();

Expand Down Expand Up @@ -195,6 +224,12 @@ void ViewNode::OnAttributesChanged()
// show/hide color picker
GetAttributeSettings(ATTRIB_COLORPICK)->SetVisible( CustomColor() );

InputPort &lengthPort = GetInputPort(INPUTPORT_LENGTH);
if (FixedLength())
lengthPort.SetVisible(true);
else
lengthPort.SetVisible(false);

EMIT_EVENT( OnAttributeUpdated(mParentGraph, this, GetAttributeValue(ATTRIB_COLORPICK)) );
}

Expand Down Expand Up @@ -299,7 +334,7 @@ void ViewNode::CalculateScalingRange()
for (uint32 i = 0; i < numChannels; ++i)
{
Channel<double>* channel = GetDoubleChannel(i);
const uint32 numSamples = mViewDuration * channel->GetSampleRate();
const uint32 numSamples = GetViewDuration() * channel->GetSampleRate();
Epoch epoch(channel, numSamples);
epoch.SetPositionByOffset(0);

Expand All @@ -315,7 +350,7 @@ void ViewNode::CalculateScalingRange()
for (uint32 i = 0; i < numChannels; ++i)
{
Channel<double>* channel = GetDoubleChannel(i);
const uint32 numSamples = mViewDuration * channel->GetSampleRate();
const uint32 numSamples = GetViewDuration() * channel->GetSampleRate();
Epoch epoch(channel, numSamples);
epoch.SetPositionByOffset(0);

Expand All @@ -341,14 +376,16 @@ void ViewNode::SyncBufferSize(bool discard)
InputPort& doublePort = GetInputPort(INPUTPORT_DOUBLE);
InputPort& specPort = GetInputPort(INPUTPORT_SPECTRUM);
InputPort& enablePort = GetInputPort(INPUTPORT_ENABLE);
InputPort& lengthPort = GetInputPort(INPUTPORT_LENGTH);
MultiChannel* channels;

auto duration = GetViewDuration();
if (doublePort.HasConnection() && (channels = doublePort.GetChannels()))
channels->SetBufferSizeInSeconds(mViewDuration, discard);
channels->SetBufferSizeInSeconds(duration, discard);

if (specPort.HasConnection() && (channels = specPort.GetChannels()))
channels->SetBufferSizeInSeconds(mViewDuration, discard);
channels->SetBufferSizeInSeconds(duration, discard);

if (enablePort.HasConnection() && (channels = enablePort.GetChannels()))
channels->SetBufferSizeInSeconds(mViewDuration, discard);
channels->SetBufferSizeInSeconds(duration, discard);
}
14 changes: 13 additions & 1 deletion src/Engine/Graph/ViewNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ENGINE_API ViewNode : public SPNode
INPUTPORT_DOUBLE = 0,
INPUTPORT_SPECTRUM,
INPUTPORT_ENABLE,
INPUTPORT_LENGTH,
};

enum
Expand All @@ -55,6 +56,7 @@ class ENGINE_API ViewNode : public SPNode
ATTRIB_USECOLOR,
ATTRIB_COLORPICK,
ATTRIB_COMBINE,
ATTRIB_LENGTH,
};

enum EScalingMode
Expand Down Expand Up @@ -94,6 +96,9 @@ class ENGINE_API ViewNode : public SPNode
double GetRangeMin(uint32 index) const { if (index < mRangesMin.Size()) return mRangesMin[index]; return 0.0; }
double GetRangeMax(uint32 index) const { if (index < mRangesMax.Size()) return mRangesMax[index]; return 0.0; }

bool FixedLength() const { return GetBoolAttribute(ATTRIB_LENGTH); } // checks if length is fixed
double GetFixedLength() const { return mFixedLengthDuration; } // returns the length value

// get the enable flag
bool GetEnableValue() const { return mEnableValue; }

Expand All @@ -108,7 +113,7 @@ class ENGINE_API ViewNode : public SPNode
Channel<Spectrum>* GetSpectrumChannel(uint32 index);

inline void SetViewDuration(double seconds)
{
{
mViewDuration = seconds;
SyncBufferSize(false);
}
Expand All @@ -118,6 +123,12 @@ class ENGINE_API ViewNode : public SPNode
private:
void CalculateScalingRange();
void SyncBufferSize(bool discard = false);
inline double GetViewDuration()
{
if (mFixedLengthDuration >= 0.)
return mFixedLengthDuration * 60.; // since this is in mins
return mViewDuration;
}

double mViewDuration;
double mMaxViewDuration;
Expand All @@ -126,6 +137,7 @@ class ENGINE_API ViewNode : public SPNode
Core::Array<double> mRangesMax;

bool mEnableValue;
double mFixedLengthDuration;


};
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

#define NEUROMORE_ENGINE_VERSION_MAJOR 1
#define NEUROMORE_ENGINE_VERSION_MINOR 7
#define NEUROMORE_ENGINE_VERSION_PATCH 3
#define NEUROMORE_ENGINE_VERSION_PATCH 5

#endif
2 changes: 2 additions & 0 deletions src/QtBase/AttributeWidgets/PropertyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class QTBASE_API PropertyManager : public QObject
// manual property adding
Property* AddProperty(const char* groupName, const char* propertyName, AttributeWidget* attributeWidget, Core::Attribute* attributeValue, Core::AttributeSettings* settings, bool autoDelete=true, bool emitSignal=false);

Core::Array<Property*> GetProperties() const { return mProperties; }

signals:
void ValueChanged(Property* property);
void PropertyAdded(const char* groupName, Property* property);
Expand Down
Loading
Loading