Skip to content

Commit

Permalink
Set board mode
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneLin0708 committed Jan 26, 2024
1 parent 334fd77 commit 3523ded
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Engine/API/Hardware/controller_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ XDAQInfo read_xdaq_info(xdaq::Device *dev)
else
info.model = XDAQModel::Unknown;
break;
case 1: info.model = XDAQModel::Core; break;
case 2: info.model = XDAQModel::One; break;
case 2: info.model = XDAQModel::Core; break;
case 4: info.model = XDAQModel::One; break;
default: info.model = XDAQModel::Unknown;
}
info.expander = (*dev->get_register_sync(0x35)) != 0;
Expand Down
4 changes: 2 additions & 2 deletions Engine/API/Hardware/rhxglobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ const uint32_t TCPSpikeMagicNumber = 0x3ae2710f;
#ifdef USE_QT
#include <QString>

const QString OrganizationName = "Intan Technologies";
const QString OrganizationDomain = "intantech.com";
const QString OrganizationName = "KonteX Neuroscience";
const QString OrganizationDomain = "kontex.io";
const QString ApplicationName = "XDAQRHX";
const QString ApplicationCopyrightYear = "2020-2023";

Expand Down
10 changes: 7 additions & 3 deletions GUI/Dialogs/boardselectdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ auto get_xdaq_board(QWidget *parent, auto launch, const XDAQInfo &info)
QObject::connect(launch_button_rhd, &QPushButton::clicked, [launch, info, launch_properties]() {
QSettings settings;
settings.beginGroup("XDAQ");
auto config = json::parse(info.device_config);
config["mode"] = "rhd";
launch(
new RHXController(
ControllerType::ControllerRecordUSB3,
launch_properties->at("sample_rate"),
info.get_device(info.device_config)
info.get_device(config.dump())
),
launch_properties->at("stim_step_size")
);
Expand All @@ -373,11 +375,13 @@ auto get_xdaq_board(QWidget *parent, auto launch, const XDAQInfo &info)
QObject::connect(launch_button_rhs, &QPushButton::clicked, [launch, info, launch_properties]() {
QSettings settings;
settings.beginGroup("XDAQ");
auto config = json::parse(info.device_config);
config["mode"] = "rhs";
launch(
new RHXController(
ControllerType::ControllerStimRecord,
launch_properties->at("sample_rate"),
info.get_device(info.device_config)
info.get_device(config.dump())
),
launch_properties->at("stim_step_size")
);
Expand Down Expand Up @@ -561,7 +565,7 @@ BoardSelectDialog::BoardSelectDialog(QWidget *parent, const std::vector<XDAQInfo
connect(advancedButton, &QPushButton::clicked, this, [&]() {
QSettings settings;
settings.beginGroup("XDAQ");
bool use_opencl = true;
bool use_opencl = settings.value("useOpenCL", true).toBool();
std::uint8_t playback_ports = 255;
AdvancedStartupDialog advancedStartupDialog(use_opencl, playback_ports, false, this);
advancedStartupDialog.exec();
Expand Down
9 changes: 7 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
//
//------------------------------------------------------------------------------
#include <fmt/format.h>
#include <qsettings.h>
#include <xdaq/device_plugin.h>

#include <QApplication>
Expand Down Expand Up @@ -313,9 +314,11 @@ int main(int argc, char *argv[])
fmt::print("Device: {}\n", device);
auto device_json = json::parse(device);
for (const auto &device : device_json) {
auto dev = plugin.create(device.dump());
auto default_rhd = device;
default_rhd["mode"] = "rhd";
auto dev = plugin.create(default_rhd.dump());
auto info = read_xdaq_info(dev.get());
info.plugin = plugin.path;
info.plugin = json::parse(plugin.info).at("name");
info.device_config = device.dump();
info.get_device = [&opened_device, &plugin](std::string device) {
opened_device = plugin.create(device);
Expand All @@ -333,6 +336,8 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationName(ApplicationName);
// Globally disable unused Context Help buttons from windows/dialogs
QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
QSettings settings;
std::cout << settings.fileName().toStdString() << '\n';

#ifdef __APPLE__
app.setStyle(QStyleFactory::create("Fusion"));
Expand Down

0 comments on commit 3523ded

Please sign in to comment.