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
16 changes: 13 additions & 3 deletions .github/workflows/release_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
build-linux:
name: Release backend and GUI
runs-on: ubuntu-24.04
permissions:
contents: write

steps:
- name: Checkout code
Expand All @@ -35,6 +37,10 @@ jobs:

- name: Configure CMake
run: |
mkdir -p extensions
cd extensions
git clone https://github.com/falcon-eyrie/falcon-fklab-extensions.git --branch develop --depth 1
cd ..
mkdir -p build
cd build
C_PATH=/usr/local/bin/clang
Expand All @@ -51,14 +57,18 @@ jobs:

- name: Build GUI
run: |
cd falcon_gui
flutter pub get
flutter build linux --release

- name: Prepare release
run: |
mkdir -p falcon_gui/build/linux/x64/release/bundle/bin
cp build/falcon/falcon falcon_gui/build/linux/x64/release/bundle/bin
cp falcon_gui/assets/icon.png falcon_gui/build/linux/x64/release/bundle/
BUNDLE_DIR="falcon_gui/build/linux/x64/release/bundle"

mkdir -p $BUNDLE_DIR/bin
cp build/falcon/falcon $BUNDLE_DIR/bin/
cp falcon_gui/assets/icon.png $BUNDLE_DIR/

tar -czf falcon_linux_v${{ github.event.inputs.version }}.tar.gz -C $BUNDLE_DIR .

- name: Publish artifact
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
![Falcon version](https://img.shields.io/badge/Falcon-v1.3.0-blue)

![Falcon version](https://img.shields.io/badge/Falcon-v2.0.0-green) ![License](https://img.shields.io/badge/License-GPLv3-blue)
# Falcon core

Falcon is a software for real-time processing of neural signals to enable short-latency closed-loop feedback in
Expand Down
3 changes: 1 addition & 2 deletions falcon/configuration.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class FalconConfiguration : public Configuration {
options::Bool logging_cloud_enabled{true};
options::Int logging_cloud_port{5556};
options::String server_side_storage_environment{"./", options::isdir(true, true)};
options::String server_side_storage_resources{"@RESOURCES_PATH@/resources",
options::isdir(true, true)};
options::String server_side_storage_resources{"~/falcon/resources", options::isdir(true, true)};
options::ValueMap<options::String> server_side_storage_custom;
};

Expand Down
22 changes: 0 additions & 22 deletions falcon_gui/falcon/config.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions falcon_gui/falcon/debug_config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion falcon_gui/lib/graph_editor/processor_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class _YamlOptionChip extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: context.c.primaryContainer,
color: context.c.surfaceContainer,
borderRadius: BorderRadius.circular(16),
),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
Expand Down
6 changes: 1 addition & 5 deletions falcon_gui/lib/settings/theme_mode_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ final ValueNotifier<ThemeMode> themeNotifier = ValueNotifier(ThemeMode.system);

Future<void> setThemeModeFromConfig() async {
try {
if (localConfig.themeMode == null) {
await _saveThemeModeToLocalConfig(ThemeMode.system);
}

final themeModeName = localConfig.themeMode ?? 'system';
final themeModeName = localConfig.themeMode;
final themeMode = themeModeName == 'light'
? ThemeMode.light
: themeModeName == 'dark'
Expand Down
2 changes: 1 addition & 1 deletion falcon_gui/lib/state/falcon_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class FalconManager extends ChangeNotifier {
[
'-c',
if (kDebugMode) ...[
'falcon/debug_config.yaml',
'build/falcon/config.yaml',
] else ...[
'${falconInstallationPath.path}/config.yaml',
],
Expand Down
45 changes: 24 additions & 21 deletions falcon_gui/lib/utils/local_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LocalConfig get localConfig => _config;

abstract class LocalConfigManager {
static final File _configFile = kDebugMode
? File('falcon/debug_config.yaml')
? File('build/falcon/config.yaml')
: File('config.yaml');

static Future<void> setThemeMode(String modeName) async {
Expand All @@ -23,10 +23,10 @@ abstract class LocalConfigManager {
}

static Future<void> setLastOpenedGraphFilePath(String path) async {
// if (localConfig.lastOpenedGraph != path) {
_config = _config.copyWith(lastOpenedGraph: path);
await _saveConfig();
// }
if (localConfig.lastOpenedGraph != path) {
_config = _config.copyWith(lastOpenedGraph: path);
await _saveConfig();
}
}

static Future<void> loadConfig() async {
Expand All @@ -40,6 +40,7 @@ abstract class LocalConfigManager {
);
} else {
_config = LocalConfig();
await _saveConfig();
}
} catch (e, s) {
logError('Error loading local config: $e', s);
Expand Down Expand Up @@ -71,16 +72,17 @@ abstract class LocalConfigManager {

class LocalConfig {
LocalConfig({
this.themeMode,
this.themeMode = 'system',
this.networkPort = 5555,
this.loggingPath = '~/falcon/output/logs/',
this.serverSideStorageEnvironment = '~/falcon/output/',
this.serverSideStorageResources = '~/falcon/resources/',
this.lastOpenedGraph,
this.graphFile,
this.graphAutostart,
this.debugEnabled,
this.networkPort,
this.loggingPath,
this.serverSideStorageEnvironment,
this.serverSideStorageResources,
});

factory LocalConfig.fromMap(Map<String, dynamic> map) {
final graph = map['graph'] as Map?;
final debug = map['debug'] as Map?;
Expand All @@ -90,20 +92,21 @@ class LocalConfig {
final ui = map['ui'] as Map?;

return LocalConfig(
networkPort: network?['port'] as int? ?? 5555,
loggingPath: logging?['path'] as String? ?? '~/falcon/output/logs/',
serverSideStorageEnvironment:
serverSideStorage?['environment'] as String? ?? '~/falcon/output/',
serverSideStorageResources:
serverSideStorage?['resources'] as String? ?? '~/falcon/resources/',
themeMode: ui?['theme_mode'] as String? ?? 'system',
graphFile: graph?['file'] as String?,
graphAutostart: graph?['autostart'] as bool?,
debugEnabled: debug?['enabled'] as bool?,
networkPort: network?['port'] as int?,
loggingPath: logging?['path'] as String?,
serverSideStorageEnvironment:
serverSideStorage?['environment'] as String?,
serverSideStorageResources: serverSideStorage?['resources'] as String?,
themeMode: ui?['theme_mode'] as String?,
lastOpenedGraph: ui?['last_opened_graph'] as String?,
);
}

final String? themeMode;
final String themeMode;
final String? lastOpenedGraph;

@Deprecated("Do not use this field. It's for falcon backend.")
Expand All @@ -113,13 +116,13 @@ class LocalConfig {
@Deprecated("Do not use this field. It's for falcon backend.")
final bool? debugEnabled;
@Deprecated("Do not use this field. It's for falcon backend.")
final int? networkPort;
final int networkPort;
@Deprecated("Do not use this field. It's for falcon backend.")
final String? loggingPath;
final String loggingPath;
@Deprecated("Do not use this field. It's for falcon backend.")
final String? serverSideStorageEnvironment;
final String serverSideStorageEnvironment;
@Deprecated("Do not use this field. It's for falcon backend.")
final String? serverSideStorageResources;
final String serverSideStorageResources;

Map<String, dynamic> toMap() {
return {
Expand Down
54 changes: 54 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
set -e

NAMESPACE="org.falcon-eyrie.falcon_gui"
BASE_DIR="$HOME/.local/share/$NAMESPACE"

LATEST_VERSION="2.0.0-rc1"
RELEASE_BUNDLE_URL="https://github.com/falcon-eyrie/falcon-core/releases/download/v$LATEST_VERSION/falcon_linux_v$LATEST_VERSION.tar.gz"
DESKTOP_ENTRY="$HOME/.local/share/applications/$NAMESPACE.desktop"

DEPS=("libgtk-3-0" "libzmq5")

echo "Installing Falcon, please wait..."


mkdir -p "$BASE_DIR"

wget -qL "$RELEASE_BUNDLE_URL" -O "$BASE_DIR/falcon_linux_v$LATEST_VERSION.tar.gz"
tar -xzf "$BASE_DIR/falcon_linux_v$LATEST_VERSION.tar.gz" -C "$BASE_DIR" --strip-components=1
rm "$BASE_DIR/falcon_linux_v$LATEST_VERSION.tar.gz"

echo "Falcon v$LATEST_VERSION installed to $BASE_DIR"

echo "Creating desktop entry at $DESKTOP_ENTRY..."

cat <<EOF > "$DESKTOP_ENTRY"
[Desktop Entry]
Version=$LATEST_VERSION
Type=Application
Name=Falcon
Exec=$BASE_DIR/falcon_gui
Icon=$BASE_DIR/icon.png
Terminal=false
Categories=Utility;
EOF

chmod +x "$DESKTOP_ENTRY"
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database "$HOME/.local/share/applications"
fi

echo "Downloading following dependencies: ${DEPS[*]}"

echo "This may require sudo password..."

sudo apt-get update -qq
for dep in "${DEPS[@]}"; do
if ! dpkg -s "$dep" >/dev/null 2>&1; then
echo "Installing $dep..."
sudo apt-get install -y -qq "$dep"
fi
done

echo "Installation complete! You can launch Falcon from the application menu."