Skip to content

Commit aacdcae

Browse files
Initial commit with FrameV2 support.
0 parents  commit aacdcae

20 files changed

Lines changed: 2465 additions & 0 deletions

.clang-format

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Logic style
2+
Language: Cpp
3+
# manually added flags
4+
FixNamespaceComments: 'false'
5+
SortIncludes: 'false'
6+
7+
8+
# flags copied from web editor, https://zed0.co.uk/clang-format-configurator/
9+
AllowShortBlocksOnASingleLine: 'false'
10+
AllowShortCaseLabelsOnASingleLine: 'false'
11+
AllowShortFunctionsOnASingleLine: None
12+
AllowShortIfStatementsOnASingleLine: 'false'
13+
AllowShortLoopsOnASingleLine: 'false'
14+
AlwaysBreakAfterReturnType: None
15+
AlwaysBreakTemplateDeclarations: 'true'
16+
BreakBeforeBraces: Allman
17+
ColumnLimit: '140'
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
19+
ContinuationIndentWidth: '4'
20+
Cpp11BracedListStyle: 'false'
21+
IndentWidth: '4'
22+
KeepEmptyLinesAtTheStartOfBlocks: 'false'
23+
MaxEmptyLinesToKeep: '2'
24+
NamespaceIndentation: All
25+
PointerAlignment: Left
26+
SpaceBeforeParens: Never
27+
SpaceInEmptyParentheses: 'false'
28+
SpacesInCStyleCastParentheses: 'true'
29+
SpacesInParentheses: 'true'
30+
SpacesInSquareBrackets: 'true'
31+
TabWidth: '4'
32+
UseTab: Never

.github/workflows/build.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags:
7+
- '*'
8+
pull_request:
9+
branches: [master]
10+
11+
jobs:
12+
windows:
13+
runs-on: windows-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Build
17+
run: |
18+
cmake -B ${{github.workspace}}/build -A x64
19+
cmake --build ${{github.workspace}}/build --config Release
20+
- name: Upload windows build
21+
uses: actions/upload-artifact@v2
22+
with:
23+
name: windows
24+
path: ${{github.workspace}}/build/Analyzers/Release/*.dll
25+
macos:
26+
runs-on: macos-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Build
30+
run: |
31+
cmake -B ${{github.workspace}}/build/x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64
32+
cmake --build ${{github.workspace}}/build/x86_64
33+
cmake -B ${{github.workspace}}/build/arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64
34+
cmake --build ${{github.workspace}}/build/arm64
35+
- name: Upload MacOS x86_64 build
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: macos_x86_64
39+
path: ${{github.workspace}}/build/x86_64/Analyzers/*.so
40+
- name: Upload MacOS arm64 build
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: macos_arm64
44+
path: ${{github.workspace}}/build/arm64/Analyzers/*.so
45+
linux:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v2
49+
- name: Build
50+
run: |
51+
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
52+
cmake --build ${{github.workspace}}/build
53+
env:
54+
CC: gcc-10
55+
CXX: g++-10
56+
- name: Upload Linux build
57+
uses: actions/upload-artifact@v2
58+
with:
59+
name: linux
60+
path: ${{github.workspace}}/build/Analyzers/*.so
61+
publish:
62+
needs: [windows, macos, linux]
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: download individual builds
66+
uses: actions/download-artifact@v2
67+
with:
68+
path: ${{github.workspace}}/artifacts
69+
- name: zip
70+
run: |
71+
cd ${{github.workspace}}/artifacts
72+
zip -r ${{github.workspace}}/analyzer.zip .
73+
- uses: actions/upload-artifact@v2
74+
with:
75+
name: all-platforms
76+
path: ${{github.workspace}}/artifacts/**
77+
- name: create release
78+
uses: softprops/action-gh-release@v1
79+
if: startsWith(github.ref, 'refs/tags/')
80+
with:
81+
files: ${{github.workspace}}/analyzer.zip

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
.DS_Store

CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cmake_minimum_required (VERSION 3.13)
2+
3+
project(TimeDeltaAnalyzer)
4+
5+
add_definitions( -DLOGIC2 )
6+
7+
# enable generation of compile_commands.json, helpful for IDEs to locate include files.
8+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
9+
10+
# custom CMake Modules are located in the cmake directory.
11+
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
12+
13+
include(ExternalAnalyzerSDK)
14+
15+
set(SOURCES
16+
src/TimeDeltaAnalyzer.cpp
17+
src/TimeDeltaAnalyzer.h
18+
src/TimeDeltaAnalyzerResults.cpp
19+
src/TimeDeltaAnalyzerResults.h
20+
src/TimeDeltaAnalyzerSettings.cpp
21+
src/TimeDeltaAnalyzerSettings.h
22+
src/TimeDeltaSimulationDataGenerator.cpp
23+
src/TimeDeltaSimulationDataGenerator.h
24+
)
25+
26+
add_analyzer_plugin(${PROJECT_NAME} SOURCES ${SOURCES})

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 ADInstruments (Peter Jaquiery)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

cmake/ExternalAnalyzerSDK.cmake

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
include(FetchContent)
2+
3+
# Use the C++11 standard
4+
set(CMAKE_CXX_STANDARD 11)
5+
6+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
7+
8+
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY OR NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
9+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/)
10+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/)
11+
endif()
12+
13+
# Fetch the Analyzer SDK if the target does not already exist.
14+
if(NOT TARGET Saleae::AnalyzerSDK)
15+
FetchContent_Declare(
16+
analyzersdk
17+
GIT_REPOSITORY https://github.com/saleae/AnalyzerSDK.git
18+
GIT_TAG master
19+
GIT_SHALLOW True
20+
GIT_PROGRESS True
21+
)
22+
23+
FetchContent_GetProperties(analyzersdk)
24+
25+
if(NOT analyzersdk_POPULATED)
26+
FetchContent_Populate(analyzersdk)
27+
include(${analyzersdk_SOURCE_DIR}/AnalyzerSDKConfig.cmake)
28+
29+
if(APPLE OR WIN32)
30+
get_target_property(analyzersdk_lib_location Saleae::AnalyzerSDK IMPORTED_LOCATION)
31+
if(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
32+
file(COPY ${analyzersdk_lib_location} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
33+
else()
34+
message(WARNING "Please define CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_LIBRARY_OUTPUT_DIRECTORY if you want unit tests to locate ${analyzersdk_lib_location}")
35+
endif()
36+
endif()
37+
38+
endif()
39+
endif()
40+
41+
function(add_analyzer_plugin TARGET)
42+
set(options )
43+
set(single_value_args )
44+
set(multi_value_args SOURCES)
45+
cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${ARGN} )
46+
47+
48+
add_library(${TARGET} MODULE ${_p_SOURCES})
49+
target_link_libraries(${TARGET} PRIVATE Saleae::AnalyzerSDK)
50+
51+
set(ANALYZER_DESTINATION "Analyzers")
52+
install(TARGETS ${TARGET} RUNTIME DESTINATION ${ANALYZER_DESTINATION}
53+
LIBRARY DESTINATION ${ANALYZER_DESTINATION})
54+
55+
set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ANALYZER_DESTINATION}
56+
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ANALYZER_DESTINATION})
57+
endfunction()

0 commit comments

Comments
 (0)