forked from brainflow-dev/brainflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI Tests with standalone executables
- Loading branch information
1 parent
0a823f9
commit db7c7aa
Showing
46 changed files
with
7,054 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...Flow/.swiftpm/xcode/xcuserdata/scottmiller.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>BrainFlow.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>4</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Created by Scott Miller on 4/9/22. | ||
// | ||
|
||
#ifndef BrainFlow_h | ||
#define BrainFlow_h | ||
|
||
#include "board_controller.h" | ||
#include "data_handler.h" | ||
#include "board_info_getter.h" | ||
#include "ml_module.h" | ||
|
||
#endif /* BrainFlow_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "swift-numerics", | ||
"repositoryURL": "https://github.com/apple/swift-numerics.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "0a5bc04095a675662cf24757cc0640aa2204253b", | ||
"version": "1.0.2" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// swift-tools-version:5.3 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "BrainFlow", | ||
platforms: [ | ||
.macOS(.v10_15), .iOS(.v13) | ||
], | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library(name: "BrainFlow", | ||
targets: ["BrainFlow"]) | ||
], | ||
dependencies: [ | ||
.package(name: "swift-numerics", | ||
url: "https://github.com/apple/swift-numerics.git", .upToNextMajor(from: "1.0.0")) | ||
], | ||
targets: [ | ||
.target( | ||
name: "BrainFlow", | ||
dependencies: [.product(name: "Numerics", package: "swift-numerics")] | ||
), | ||
.testTarget( | ||
name: "BrainFlowTests", | ||
dependencies: ["BrainFlow", .product(name: "Numerics", package: "swift-numerics")], | ||
sources: ["BoardShimTests.swift", | ||
"BrainFlowCItests.swift", | ||
"BrainFlowTests.swift", | ||
"DataFilterTests.swift"] | ||
) | ||
] | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# BrainFlow | ||
|
||
Swift bindings for the BrainFlow C++ API. Contributed by Scott Miller for Aeris Rising, LLC. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import Foundation | ||
|
||
struct dummy { | ||
let num = 1 | ||
} | ||
|
47 changes: 47 additions & 0 deletions
47
swift_package/BrainFlow/Sources/BrainFlowBindings/BoardDescription.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// BoardDescription.swift | ||
// a Swift reimagining of BrainFlow's board_description data type | ||
// | ||
// Created by Scott Miller for Aeris Rising, LLC on 8/23/21. | ||
// | ||
import Foundation | ||
//import BrainFlow | ||
|
||
struct BoardDescription: Codable, Equatable { | ||
let package_num_channel: Int32 | ||
let timestamp_channel: Int32 | ||
let accel_channels: [Int32]? | ||
let ecg_channels: [Int32]? | ||
let eeg_channels: [Int32]? | ||
let eeg_names: String? | ||
let emg_channels: [Int32]? | ||
let eog_channels: [Int32]? | ||
let marker_channel: Int32? | ||
let name: String? | ||
let num_rows: Int32? | ||
let sampling_rate: Int32? | ||
let battery_channel: Int32? | ||
let eda_channels: [Int32]? | ||
let gyro_channels: [Int32]? | ||
let ppg_channels: [Int32]? | ||
let resistance_channels: [Int32]? | ||
let temperature_channels: [Int32]? | ||
|
||
// decode the input JSON into self: | ||
init(_ descriptionJSON: String) throws { | ||
guard descriptionJSON != "" else { | ||
throw BrainFlowException("Nil board description JSON", .JSON_NOT_FOUND_ERROR) | ||
} | ||
|
||
let decoder = JSONDecoder() | ||
let jsonData = Data(descriptionJSON.utf8) | ||
|
||
do { | ||
let json = try decoder.decode(type(of: self), from: jsonData) | ||
self = json | ||
} catch { | ||
try? BoardShim.logMessage(.LEVEL_CRITICAL, "board description JSON decoding error:\n \(error)") | ||
throw BrainFlowException("Invalid board description JSON", .NO_SUCH_DATA_IN_JSON_ERROR) | ||
} | ||
} | ||
} |
Oops, something went wrong.