Skip to content

Commit e7fc083

Browse files
committed
bugfixes for v1.15.1
1 parent 3768a97 commit e7fc083

File tree

6 files changed

+42
-14
lines changed

6 files changed

+42
-14
lines changed

.github/workflows/cppcmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
LSL_TAG: '1.15.2'
1414
LSL_RELEASE: '1.15.2'
1515
LSL_RELEASE_SUFFIX: ''
16-
APP_VERSION: 'v1.15.0'
16+
APP_VERSION: 'v1.15.1'
1717

1818
jobs:
1919
build:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5)
33

44
set(PROJECT_VERSION_MAJOR 1)
55
set(PROJECT_VERSION_MINOR 15)
6-
set(PROJECT_VERSION_PATCH 0)
6+
set(PROJECT_VERSION_PATCH 1)
77

88
project(actiCHamp
99
LANGUAGES CXX

LibTalker.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -554,21 +554,19 @@ bool LibTalker::CheckFDA(void)
554554
bool LibTalker::setOutTriggerMode(t_TriggerOutputMode triggerMode, int nSyncPin, int nFreq, int nPulseWidth)
555555
{
556556
char sVar[20];
557-
bool retVal = true;
557+
bool retVal = true;
558558
int res = ampGetProperty(m_Handle, PG_DEVICE, 0, DPROP_CHR_Type, sVar, sizeof(sVar));
559559
if (res != AMP_OK)
560560
{
561561
Error("Error checking device type before setting trigger output mode, error code: ", res);
562562
}
563-
if (strcmp(sVar, "5002"))
563+
if (!strcmp(sVar, "5002"))
564564
{
565-
retVal = false;
566-
triggerMode = t_TriggerOutputMode::TM_DEFAULT;
567-
}
568-
res = ampSetProperty(m_Handle, PG_MODULE, 0, MPROP_I32_TriggerOutMode, &triggerMode, sizeof(triggerMode));
569-
if (res != AMP_OK)
570-
{
571-
Error("Error setting trigger output mode, error code: ", res);
565+
res = ampSetProperty(m_Handle, PG_MODULE, 0, MPROP_I32_TriggerOutMode, &triggerMode, sizeof(triggerMode));
566+
if (res != AMP_OK)
567+
{
568+
Error("Error setting trigger output mode, error code: ", res);
569+
}
572570
}
573571
return retVal;
574572
}

mainwindow.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ MainWindow::MainWindow(QWidget *parent, const char* config_file): QMainWindow(pa
3030
{
3131
m_AppVersion.Major = 1;
3232
m_AppVersion.Minor = 15;
33-
m_AppVersion.Bugfix = 0;
33+
m_AppVersion.Bugfix = 1;
3434

3535
ui->setupUi(this);
3636
m_bUseActiveShield = false;
3737
m_bOverrideAutoUpdate = false;
38-
LoadConfig(config_file);
3938

4039
// make GUI connections
4140
QObject::connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(close()));
@@ -52,6 +51,33 @@ MainWindow::MainWindow(QWidget *parent, const char* config_file): QMainWindow(pa
5251
QObject::connect(ui->rbDefault, SIGNAL(clicked(bool)), this, SLOT(RadioButtonBehavior(bool)));
5352
QObject::connect(ui->rbMirror, SIGNAL(clicked(bool)), this, SLOT(RadioButtonBehavior(bool)));
5453
SetSamplingRate();
54+
QString cfgfilepath = find_config_file(config_file);
55+
LoadConfig(cfgfilepath);
56+
}
57+
58+
QString MainWindow::find_config_file(const char* filename) {
59+
if (filename) {
60+
QString qfilename(filename);
61+
if (!QFileInfo::exists(qfilename))
62+
QMessageBox(QMessageBox::Warning, "Config file not found",
63+
QStringLiteral("The file '%1' doesn't exist").arg(qfilename), QMessageBox::Ok,
64+
this);
65+
else
66+
return qfilename;
67+
}
68+
QFileInfo exeInfo(QCoreApplication::applicationFilePath());
69+
QString defaultCfgFilename(exeInfo.completeBaseName() + ".cfg");
70+
qInfo() << defaultCfgFilename;
71+
QStringList cfgpaths;
72+
cfgpaths << QDir::currentPath()
73+
<< QStandardPaths::standardLocations(QStandardPaths::ConfigLocation) << exeInfo.path();
74+
for (auto path : cfgpaths) {
75+
QString cfgfilepath = path + QDir::separator() + defaultCfgFilename;
76+
if (QFileInfo::exists(cfgfilepath)) return cfgfilepath;
77+
}
78+
QMessageBox::warning(this, "No config file not found",
79+
QStringLiteral("No default config file could be found"), "Continue with default config");
80+
return "";
5581
}
5682

5783
void MainWindow::VersionsDialog()

mainwindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class MainWindow : public QMainWindow
5858
~MainWindow();
5959

6060
private slots:
61-
61+
QString find_config_file(const char* filename);
6262
void LoadConfigDialog();
6363
void SaveConfigDialog();
6464
void Link();

release_notes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v1.15.1
2+
-BUGFIX: removed trigger mode setting error for old actiCHamp (not plus)
3+
-BUGFIX: config file loading properly
4+
15
v1.15.0
26
-FEATURE: added mirror trigger output option
37
-FEATURE: report bitness in Help->About

0 commit comments

Comments
 (0)