Skip to content

Commit ab4e425

Browse files
authored
Falcon Studio (#134)
1 parent fb84d44 commit ab4e425

File tree

82 files changed

+9444
-148
lines changed

Some content is hidden

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

82 files changed

+9444
-148
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
name: Format and Compile
1+
name: Build backend
22

33
on:
44
pull_request:
55
branches: [develop]
6-
6+
paths:
7+
# Skip CPP pipeline if the changes are only GUI
8+
- "**"
9+
- "!falcon_gui/**"
10+
- "!.github/workflows/build_gui.yml"
711
jobs:
812
build-linux:
9-
name: Format and Compile
13+
name: Build backend
1014
runs-on: ubuntu-24.04
1115

1216
strategy:
1317
matrix:
14-
compiler: [clang, gcc]
18+
compiler: [clang] # gcc is disabled for now
1519

1620
steps:
1721
- name: Checkout code
@@ -40,18 +44,16 @@ jobs:
4044
mkdir -p build
4145
cd build
4246
if [ "${{ matrix.compiler }}" == "clang" ]; then
43-
cmake .. \
44-
-DCMAKE_BUILD_TYPE=Debug \
45-
-DIGNORE_EXTENSIONS=ON \
46-
-DCMAKE_C_COMPILER=/usr/local/bin/clang \
47-
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++
47+
C_PATH=/usr/local/bin/clang
48+
CXX_PATH=/usr/local/bin/clang++
4849
else
49-
cmake .. \
50-
-DCMAKE_BUILD_TYPE=Debug \
51-
-DIGNORE_EXTENSIONS=ON \
52-
-DCMAKE_C_COMPILER=/usr/bin/gcc \
53-
-DCMAKE_CXX_COMPILER=/usr/bin/g++
50+
C_PATH=/usr/bin/gcc
51+
CXX_PATH=/usr/bin/g++
5452
fi
53+
cmake .. \
54+
-DCMAKE_BUILD_TYPE=Release \
55+
-DCMAKE_C_COMPILER=$C_PATH \
56+
-DCMAKE_CXX_COMPILER=$CXX_PATH
5557
5658
- name: Build project
5759
run: |

.github/workflows/build_gui.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build GUI
2+
3+
on:
4+
pull_request:
5+
branches: [develop]
6+
paths:
7+
- "falcon_gui/**"
8+
- ".github/workflows/build_gui.yml"
9+
10+
jobs:
11+
build-linux:
12+
name: Build GUI
13+
runs-on: ubuntu-24.04
14+
15+
defaults:
16+
run:
17+
working-directory: falcon_gui
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Install FVM and Flutter
24+
working-directory: . # To install FVM globally for the entire workflow
25+
run: |
26+
curl -fsSL https://fvm.app/install.sh | bash
27+
echo "/home/runner/fvm/bin" >> $GITHUB_PATH
28+
echo "/home/runner/fvm/versions/3.38.5/bin" >> $GITHUB_PATH
29+
export PATH="/home/runner/fvm/bin:$PATH"
30+
31+
fvm install 3.38.5
32+
fvm global 3.38.5
33+
34+
- name: Lint and format
35+
run: |
36+
flutter pub get
37+
dart format --set-exit-if-changed .
38+
flutter analyze --fatal-infos --fatal-warnings
39+
40+
- name: Build project
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y libgtk-3-dev
44+
flutter build linux --release
45+
46+
- name: Publish artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: falcon_gui
50+
path: falcon_gui/build/linux/x64/release/bundle/
51+
if-no-files-found: error

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@
2323
"C_Cpp.codeAnalysis.exclude": {
2424
"build/": true,
2525
"extensions/": true,
26+
"**/.fvm/": true,
27+
"**/.venv/": true,
2628
},
2729
}

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ cmake_minimum_required(VERSION 3.16)
33

44
# Export compile commands for VS Code IntelliSense
55
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
6+
set(CMAKE_CXX_STANDARD 26)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
set(CMAKE_CXX_EXTENSIONS OFF)
9+
610

711
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
8-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -Wall -Wextra -Wunused -std=c++17 -pthread")
12+
message(STATUS "Debug build")
13+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -Wall -Wextra -Wunused -pthread")
14+
elseif(CMAKE_BUILD_TYPE STREQUAL "Profile")
15+
message(STATUS "Profile build")
16+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g -fno-omit-frame-pointer -fno-inline-functions -Wall -Wextra -Wunused -pthread")
917
else()
10-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Wunused -std=c++17 -pthread")
18+
message(STATUS "Release build")
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Wunused -pthread")
1120
endif()
1221

1322
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
@@ -114,8 +123,6 @@ FetchContent_GetProperties(units)
114123
if(NOT units_POPULATED)
115124
message(STATUS "Populating LLNL units...")
116125
FetchContent_MakeAvailable(units)
117-
# Add here options for units building
118-
set(CMAKE_CXX_STANDARD 17)
119126
set(USE_LIBCXX OFF CACHE INTERNAL "")
120127
set(UNITS_HEADER_ONLY OFF CACHE INTERNAL "")
121128
set(UNITS_ENABLE_TESTS OFF CACHE BOOL "Whether or not to build the tests")

analysis_options.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Disables Dart analysis for root C++ project in VS Code (and possiblely other IDEs).
2+
# The recommended way to enable Dart analysis for the GUI project is to open it as
3+
# a standalone project in the IDE.
4+
analyzer:
5+
errors:
6+
todo: ignore
7+
exclude:
8+
- "**"
9+
linter:
10+
rules: []

extensions.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
enable , extension name , extension path , extension version (optional)
2-
0 , decoding , https://github.com/falcon-eyrie/falcon-decoding-extensions
3-
0 , behavior , https://github.com/falcon-eyrie/falcon-behavior-extensions, develop
4-
1 , core , https://github.com/falcon-eyrie/falcon-fklab-extensions, develop
1+
enable, extension name, extension path, extension version (optional)
2+
dev, core, extensions/falcon-fklab-extensions

falcon/configuration.hpp.in

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@
2626
#include "utilities/configuration.hpp"
2727

2828
class FalconConfiguration : public Configuration {
29-
public:
30-
FalconConfiguration();
29+
public:
30+
FalconConfiguration();
3131

32-
// CONFIG OPTIONS
33-
public:
34-
options::String graph_file{""};
35-
options::Bool debug_enabled{false};
36-
options::Bool testing_enabled{false};
37-
options::Bool graph_autostart{false};
38-
options::Int network_port{5555};
39-
options::String logging_path{"./", options::isdir()};
40-
options::Bool logging_screen_enabled{true};
41-
options::Bool logging_cloud_enabled{true};
42-
options::Int logging_cloud_port{5556};
43-
options::String server_side_storage_environment{"./", options::isdir()};
44-
options::String server_side_storage_resources{"@RESOURCES_PATH@/resources",
45-
options::isdir(true, true)};
46-
options::ValueMap<options::String> server_side_storage_custom;
32+
// CONFIG OPTIONS
33+
public:
34+
options::String graph_file{""};
35+
options::Bool debug_enabled{false};
36+
options::Bool testing_enabled{false};
37+
options::Bool graph_autostart{false};
38+
options::Int network_port{5555};
39+
options::String logging_path{"./", options::isdir(true, true)};
40+
options::Bool logging_screen_enabled{true};
41+
options::Bool logging_cloud_enabled{true};
42+
options::Int logging_cloud_port{5556};
43+
options::String server_side_storage_environment{"./", options::isdir(true, true)};
44+
options::String server_side_storage_resources{"@RESOURCES_PATH@/resources",
45+
options::isdir(true, true)};
46+
options::ValueMap<options::String> server_side_storage_custom;
4747
};
4848

4949
#endif

falcon/graphmanager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ void GraphManager::HandleCommand(const std::string& command, std::deque<std::str
5050
}
5151
ParseGraph(node);
5252
// save YAML to global_context_.resolve_path( "graphs://_last_graph" )
53-
std::ofstream fout(global_context_->resolve_path("graphs://_last_graph.yaml"));
54-
fout << node;
53+
// Disabled for now
54+
// std::ofstream fout(global_context_->resolve_path("graphs://_last_graph.yaml"));
55+
// fout << node;
5556

5657
} else if (command == "destroy") {
5758
graph_.Destroy();

falcon/idata.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ uint64_t Data::serial_number() const {
2828
return serial_number_;
2929
}
3030

31+
int64_t Data::ingestion_ns() const {
32+
return ingestion_ns_;
33+
}
34+
35+
void Data::set_ingestion_ns() {
36+
ingestion_ns_ = std::chrono::duration_cast<std::chrono::nanoseconds>(
37+
std::chrono::steady_clock::now().time_since_epoch())
38+
.count();
39+
}
40+
41+
void Data::forward_ingestion_ns(const Data& data) {
42+
ingestion_ns_ = data.ingestion_ns_;
43+
}
44+
3145
void Data::set_source_timestamp() {
3246
source_timestamp_ = Clock::now();
3347
}

falcon/idata.hpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,26 @@ class Data : public IData<Data, BaseType> {
151151
uint64_t serial_number() const;
152152
void set_serial_number(uint64_t n);
153153

154+
/**
155+
* @brief This timestamp is set when the data packet is first
156+
* ingested by Falcon.
157+
*
158+
* @return int64_t
159+
*/
160+
int64_t ingestion_ns() const;
161+
162+
/**
163+
* @brief Set the ingestion timestamp to now. This should only be called
164+
* by a "source" processor when the data packet is first ingested.
165+
*/
166+
void set_ingestion_ns();
167+
168+
/**
169+
* @brief Forward the ingestion timestamp from an upstream data packet
170+
* to this data packet.
171+
*/
172+
void forward_ingestion_ns(const Data& data);
173+
154174
/**
155175
* @brief set_source_timestamp set the timepoint based on the internal
156176
* Falcon clock.
@@ -253,6 +273,11 @@ class Data : public IData<Data, BaseType> {
253273
virtual void SerializeFlatBuffer(flexbuffers::Builder& flex_builder);
254274

255275
protected:
276+
/**
277+
* @brief timestamp in nanoseconds when the data packet
278+
* was first ingested by Falcon.
279+
*/
280+
int64_t ingestion_ns_;
256281
TimePoint source_timestamp_;
257282
uint64_t hardware_timestamp_; // e.g. from Neuralynx
258283
uint64_t serial_number_;

0 commit comments

Comments
 (0)