diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8372f83a..5cf85bbd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,63 +1,24 @@
-name: CI
+name: ci/cd
on:
+ workflow_dispatch:
pull_request:
branches:
- main
- - feat*
- - dev*
- - release*
+ push:
+ branches:
+ - main
jobs:
- linters:
- runs-on: windows-latest
- strategy:
- matrix:
- python-version: ["3.11"]
- steps:
- - uses: actions/checkout@v3
- - name: Set up Python
- uses: actions/setup-python@v3
- with:
- python-version: "3.11"
- - name: Install dependencies
- run: |
- python -m pip install -e .[linters] --no-cache-dir
- - name: Run ruff format
- run: ruff format .
- - name: Run ruff check
- run: ruff check .
- - name: Run codespell
- run : codespell .
-
- tests:
- runs-on: windows-latest
- steps:
- - uses: actions/checkout@v3
-
- - name: Setup .NET Core SDK
- uses: actions/setup-dotnet@v4.0.0
- with:
- dotnet-version: 7.x
- - name: Restore dotnet tools
- run: dotnet tool restore
- - name: Setup Bonsai
- working-directory: bonsai
- run: .\Setup.ps1
- - name: Set up Python
- uses: actions/setup-python@v3
- with:
- python-version: '3.11'
+ python-linting:
+ uses: AllenNeuralDynamics/Aind.Behavior.GitHubActions/.github/workflows/python-linting.yml@main
+ with:
+ runs-on: ubuntu-latest
- - name: Install dependencies
- run: |
- python -m pip install -e . --no-cache-dir
- - name: Run tests
- run: python -m unittest
- - name: Regenerate schemas
- run: python .\scripts\regenerate.py
- - name: Check for uncommitted changes
- run: |
- git config --global core.safecrlf false
- git diff --exit-code || (echo "Untracked changes found" && exit 1)
+ aind-behavior-framework-testing:
+ uses: AllenNeuralDynamics/Aind.Behavior.GitHubActions/.github/workflows/test-aind-behavior-framework.yml@main
+ with:
+ python-version-path: .python-version
+ run-coverage: false
+ run-schema: true
\ No newline at end of file
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 6b8123c8..beeb07d5 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -3,7 +3,7 @@ name: Deploy Sphinx documentation to Pages
on:
workflow_dispatch:
push:
- branches: [main]
+ branches: main
jobs:
pages:
diff --git a/.github/workflows/tag_and_publish.yml b/.github/workflows/tag_and_publish.yml
new file mode 100644
index 00000000..1f566ac7
--- /dev/null
+++ b/.github/workflows/tag_and_publish.yml
@@ -0,0 +1,10 @@
+name: Tag and Publish
+
+on:
+ workflow_dispatch: {}
+
+jobs:
+ tag-and-publish:
+ uses : AllenNeuralDynamics/Aind.Behavior.GitHubActions/.github/workflows/python-package-tag-and-publish.yml@main
+ with:
+ publish: false
\ No newline at end of file
diff --git a/.python-version b/.python-version
new file mode 100644
index 00000000..06c7113d
--- /dev/null
+++ b/.python-version
@@ -0,0 +1,3 @@
+3.11
+3.12
+3.13
\ No newline at end of file
diff --git a/README.md b/README.md
index c4fa67e9..83fe6cd4 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,11 @@
# aind-vr-foraging
+![CI](https://github.com/AllenNeuralDynamics/Aind.Behavior.VrForaging/actions/workflows/ci.yml/badge.svg)
+[![PyPI - Version](https://img.shields.io/pypi/v/aind-behavior-vr-foraging)](https://pypi.org/project/aind-behavior-vr-foraging/)
+[![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
+[![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
+[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
+
A repository for the VR Foraging task.
---
diff --git a/bonsai/Bonsai.config b/bonsai/Bonsai.config
index 62f0fdef..59d78b71 100644
--- a/bonsai/Bonsai.config
+++ b/bonsai/Bonsai.config
@@ -4,15 +4,17 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -66,11 +68,12 @@
+
-
+
@@ -79,11 +82,13 @@
+
+
@@ -123,15 +128,17 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -182,6 +189,7 @@
+
@@ -190,7 +198,7 @@
-
+
diff --git a/bonsai/setup.ps1 b/bonsai/setup.ps1
index 7f43d41c..01cfba61 100644
--- a/bonsai/setup.ps1
+++ b/bonsai/setup.ps1
@@ -1,9 +1,21 @@
+Push-Location $PSScriptRoot
if (!(Test-Path "./Bonsai.exe")) {
- Invoke-WebRequest "https://github.com/bonsai-rx/bonsai/releases/download/2.8.5/Bonsai.zip" -OutFile "temp.zip"
- Move-Item -Path "NuGet.config" "temp.config"
+ $release = "https://github.com/bonsai-rx/bonsai/releases/latest/download/Bonsai.zip"
+ $configPath = "./Bonsai.config"
+ if (Test-Path $configPath) {
+ [xml]$config = Get-Content $configPath
+ $bootstrapper = $config.PackageConfiguration.Packages.Package.where{$_.id -eq 'Bonsai'}
+ if ($bootstrapper) {
+ $version = $bootstrapper.version
+ $release = "https://github.com/bonsai-rx/bonsai/releases/download/$version/Bonsai.zip"
+ }
+ }
+ Invoke-WebRequest $release -OutFile "temp.zip"
+ Move-Item -Path "NuGet.config" "temp.config" -ErrorAction SilentlyContinue
Expand-Archive "temp.zip" -DestinationPath "." -Force
- Move-Item -Path "temp.config" "NuGet.config" -Force
+ Move-Item -Path "temp.config" "NuGet.config" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "temp.zip"
Remove-Item -Path "Bonsai32.exe"
}
-& .\Bonsai.exe --no-editor
\ No newline at end of file
+& .\Bonsai.exe --no-editor
+Pop-Location
\ No newline at end of file
diff --git a/examples/examples.py b/examples/examples.py
index dda2bc7b..fdc8750a 100644
--- a/examples/examples.py
+++ b/examples/examples.py
@@ -21,6 +21,12 @@
OlfactometerChannelConfig,
OlfactometerChannelType,
)
+from aind_behavior_services.calibration.treadmill import (
+ Treadmill,
+ TreadmillCalibration,
+ TreadmillCalibrationInput,
+ TreadmillCalibrationOutput,
+)
from aind_behavior_services.calibration.water_valve import (
Measurement,
WaterValveCalibration,
@@ -36,10 +42,7 @@
HarpLickometer,
HarpOlfactometer,
HarpSniffDetector,
- HarpTreadmill,
RigCalibration,
- Screen,
- Treadmill,
)
from aind_behavior_vr_foraging.task_logic import (
AindVrForagingTaskLogic,
@@ -126,7 +129,7 @@ def mock_rig() -> AindVrForagingRig:
]
)
water_valve_calibration = WaterValveCalibration(
- input=water_valve_input, output=water_valve_input.calibrate_output(), calibration_date=datetime.datetime.now()
+ input=water_valve_input, output=water_valve_input.calibrate_output(), date=datetime.datetime.now()
)
water_valve_calibration.output = WaterValveCalibrationOutput(slope=1, offset=0) # For testing purposes
@@ -152,16 +155,17 @@ def mock_rig() -> AindVrForagingRig:
harp_clock_generator=HarpClockGenerator(port_name="COM6"),
harp_analog_input=None,
harp_sniff_detector=HarpSniffDetector(port_name="COM7"),
- harp_treadmill=HarpTreadmill(
+ harp_treadmill=Treadmill(
port_name="COM8",
- calibration=Treadmill(
- wheel_diameter=15,
- pulses_per_revolution=28800,
- break_lookup_calibration=[[0, 0], [1, 65535]],
+ calibration=TreadmillCalibration(
+ input=TreadmillCalibrationInput(),
+ output=TreadmillCalibrationOutput(
+ wheel_diameter=15, pulses_per_revolution=28800, brake_lookup_calibration=[[0, 0], [1, 65535]]
+ ),
),
),
manipulator=AindManipulatorDevice(port_name="COM9", calibration=manipulator_calibration),
- screen=Screen(display_index=1),
+ screen=rig.Screen(display_index=1),
calibration=RigCalibration(water_valve=water_valve_calibration),
)
@@ -302,7 +306,10 @@ def PostPatch_VirtualSiteGeneratorHelper(contrast: float = 1, friction: float =
task_parameters=AindVrForagingTaskParameters(
rng_seed=None,
updaters=updaters,
- environment_statistics=environment_statistics,
+ environment=vr_task_logic.BlockStructure(
+ blocks=[vr_task_logic.Block(environment_statistics=environment_statistics, end_conditions=[])],
+ sampling_mode="Random",
+ ),
task_mode_settings=vr_task_logic.ForagingSettings(),
operation_control=operation_control,
)
diff --git a/pyproject.toml b/pyproject.toml
index fbe26339..8412d494 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,24 +4,35 @@ build-backend = "setuptools.build_meta"
[project]
name = "aind-behavior-vr-foraging"
-description = "A library that defines AIND data schema for the Aind Behavior VR Foraing experiment."
+description = "A library that defines AIND data schema for the Aind Behavior VR Foraging experiment."
+authors = [ {name = "Bruno Cruz", email = "bruno.cruz@alleninstitute.org"}]
license = {text = "MIT"}
requires-python = ">=3.11"
classifiers = [
- "Programming Language :: Python :: 3"
+ "Programming Language :: Python :: 3.11",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: Microsoft :: Windows",
]
readme = "README.md"
dynamic = ["version"]
dependencies = [
- "aind_behavior_services@git+https://github.com/AllenNeuralDynamics/Aind.Behavior.Services@0.7.14",
+ "aind_behavior_services>=0.9, <0.10",
]
+[project.urls]
+Documentation = "https://allenneuraldynamics.github.io/Aind.Behavior.VrForaging/"
+Repository = "https://github.com/AllenNeuralDynamics/Aind.Behavior.VrForaging/"
+Issues = "https://github.com/AllenNeuralDynamics/Aind.Behavior.VrForaging/issues"
+Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.VrForaging/releases"
+
[project.optional-dependencies]
-linters = [
- 'ruff',
- 'codespell'
+launcher = ["aind_behavior_experiment_launcher[aind-services]<0.4"]
+
+dev = ["aind_behavior_vr_foraging[launcher]",
+ "ruff",
+ "codespell"
]
docs = [
@@ -33,12 +44,16 @@ docs = [
'sphinx-jsonschema'
]
+[project.scripts]
+clabe = "aind_behavior_vr_foraging.launcher:main"
+regenerate = "aind_behavior_vr_foraging.regenerate:main"
+
[tool.setuptools.packages.find]
where = ["src/DataSchemas"]
[tool.setuptools.dynamic]
version = {attr = "aind_behavior_vr_foraging.__version__"}
-readme = {file = ["README.md"]}
+readme = {file = "README.md", content-type = "text/markdown"}
[tool.ruff]
line-length = 120
@@ -51,5 +66,5 @@ mccabe = { max-complexity = 14 }
pydocstyle = { convention = 'google' }
[tool.codespell]
-skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build'
+skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build,uv.lock'
ignore-words-list = 'nd'
\ No newline at end of file
diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1
index af7ecdb1..1cfed848 100644
--- a/scripts/deploy.ps1
+++ b/scripts/deploy.ps1
@@ -8,7 +8,7 @@ if (Test-Path -Path ./.venv) {
&python -m venv ./.venv
.\.venv\Scripts\Activate.ps1
Write-Output "Installing python packages..."
-&pip install .
+&pip install .[aind-services]
Write-Output "Creating a Bonsai environment and installing packages..."
Set-Location "bonsai"
.\setup.ps1
diff --git a/scripts/launcher.ps1 b/scripts/launcher.ps1
index c4d84221..32e582dc 100644
--- a/scripts/launcher.ps1
+++ b/scripts/launcher.ps1
@@ -1,4 +1,4 @@
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location -Path (Split-Path -Parent $scriptPath)
.\.venv\Scripts\Activate.ps1
-& python .\scripts\launcher.py
\ No newline at end of file
+& clabe
\ No newline at end of file
diff --git a/scripts/launcher.py b/scripts/launcher.py
deleted file mode 100644
index 8c0ff9a9..00000000
--- a/scripts/launcher.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from aind_behavior_services.launcher import LauncherCli
-from aind_behavior_services.session import AindBehaviorSessionModel
-from aind_behavior_vr_foraging.rig import AindVrForagingRig
-from aind_behavior_vr_foraging.task_logic import AindVrForagingTaskLogic
-
-if __name__ == "__main__":
- launcher_cli = LauncherCli(
- rig_schema=AindVrForagingRig,
- session_schema=AindBehaviorSessionModel,
- task_logic_schema=AindVrForagingTaskLogic,
- data_dir=r"C:/Data",
- remote_data_dir=r"\\allen\aind\scratch\vr-foraging\data",
- config_library_dir=r"\\allen\aind\scratch\AindBehavior.db\AindVrForaging",
- workflow=r"./src/vr-foraging.bonsai",
- )
- launcher_cli.run()
diff --git a/scripts/regenerate.cmd b/scripts/regenerate.cmd
deleted file mode 100644
index 7179544c..00000000
--- a/scripts/regenerate.cmd
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-setlocal
-set "scriptPath=%~dp0"
-set "pythonScriptPath=%scriptPath%regenerate.ps1"
-powershell -ExecutionPolicy Bypass -File "%pythonScriptPath%"
-endlocal
diff --git a/scripts/regenerate.ps1 b/scripts/regenerate.ps1
deleted file mode 100644
index 732f62b3..00000000
--- a/scripts/regenerate.ps1
+++ /dev/null
@@ -1,4 +0,0 @@
-$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
-Set-Location -Path (Split-Path -Parent $scriptPath)
-.\.venv\Scripts\Activate.ps1
-& python .\scripts\regenerate.py
\ No newline at end of file
diff --git a/src/.gitignore b/src/.gitignore
index ed998d9a..f2d70a3e 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -2,4 +2,4 @@
.vs
.vscode
src.sln
-*bonsai.layout
\ No newline at end of file
+.bonsai
\ No newline at end of file
diff --git a/src/Calibration/Monitors/center_extrinsics.yml b/src/Calibration/Monitors/center_extrinsics.yml
deleted file mode 100644
index 6d96280e..00000000
--- a/src/Calibration/Monitors/center_extrinsics.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-%YAML:1.0
-rotation:
- x: 0.
- y: 0.
- z: 0.
-translation:
- x: 0.
- y: 1.309016
- z: -13.27
\ No newline at end of file
diff --git a/src/Calibration/Monitors/center_intrinsics.yml b/src/Calibration/Monitors/center_intrinsics.yml
deleted file mode 100644
index 4d60c2ae..00000000
--- a/src/Calibration/Monitors/center_intrinsics.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-%YAML:1.0
-display_id: 1
-frame_width: 1920
-frame_height: 1080
-display_width: 20
-display_height: 15
diff --git a/src/Calibration/Monitors/left_extrinsics.yml b/src/Calibration/Monitors/left_extrinsics.yml
deleted file mode 100644
index a32397e1..00000000
--- a/src/Calibration/Monitors/left_extrinsics.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-%YAML:1.0
-rotation:
- x: 0.
- y: 1.0472
- z: 0.
-translation:
- x: -16.6917756
- y: 1.309016
- z: -3.575264
\ No newline at end of file
diff --git a/src/Calibration/Monitors/left_intrinsics.yml b/src/Calibration/Monitors/left_intrinsics.yml
deleted file mode 100644
index 4d60c2ae..00000000
--- a/src/Calibration/Monitors/left_intrinsics.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-%YAML:1.0
-display_id: 1
-frame_width: 1920
-frame_height: 1080
-display_width: 20
-display_height: 15
diff --git a/src/Calibration/Monitors/right_extrinsics.yml b/src/Calibration/Monitors/right_extrinsics.yml
deleted file mode 100644
index 7d09b950..00000000
--- a/src/Calibration/Monitors/right_extrinsics.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-%YAML:1.0
-rotation:
- x: 0.
- y: -1.0472
- z: 0.
-translation:
- x: 16.6917756
- y: 1.309016
- z: -3.575264
\ No newline at end of file
diff --git a/src/Calibration/Monitors/right_intrinsics.yml b/src/Calibration/Monitors/right_intrinsics.yml
deleted file mode 100644
index 4d60c2ae..00000000
--- a/src/Calibration/Monitors/right_intrinsics.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-%YAML:1.0
-display_id: 1
-frame_width: 1920
-frame_height: 1080
-display_width: 20
-display_height: 15
diff --git a/src/DataSchemas/aind_behavior_session_model.json b/src/DataSchemas/aind_behavior_session_model.json
index c4cd00f0..0663cfd4 100644
--- a/src/DataSchemas/aind_behavior_session_model.json
+++ b/src/DataSchemas/aind_behavior_session_model.json
@@ -1,8 +1,14 @@
{
"properties": {
+ "aind_behavior_services_pkg_version": {
+ "default": "0.9.0",
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
+ "title": "aind_behavior_services package version",
+ "type": "string"
+ },
"version": {
- "const": "0.2.0",
- "default": "0.2.0",
+ "const": "0.3.0",
+ "default": "0.3.0",
"title": "Version",
"type": "string"
},
@@ -31,9 +37,9 @@
"title": "Root Path",
"type": "string"
},
- "remote_path": {
+ "session_name": {
"default": null,
- "description": "Remote path where data will be attempted to be copied to after experiment is done",
+ "description": "Name of the session. This will be used to create a folder in the root path.",
"oneOf": [
{
"type": "string"
@@ -42,7 +48,7 @@
"type": "null"
}
],
- "title": "Remote Path"
+ "title": "Session Name"
},
"subject": {
"description": "Name of the subject",
diff --git a/src/DataSchemas/aind_behavior_vr_foraging/__init__.py b/src/DataSchemas/aind_behavior_vr_foraging/__init__.py
index f6b7e267..3d187266 100644
--- a/src/DataSchemas/aind_behavior_vr_foraging/__init__.py
+++ b/src/DataSchemas/aind_behavior_vr_foraging/__init__.py
@@ -1 +1 @@
-__version__ = "0.4.3"
+__version__ = "0.5.0"
diff --git a/src/DataSchemas/aind_behavior_vr_foraging/data_mappers.py b/src/DataSchemas/aind_behavior_vr_foraging/data_mappers.py
new file mode 100644
index 00000000..750c4cd0
--- /dev/null
+++ b/src/DataSchemas/aind_behavior_vr_foraging/data_mappers.py
@@ -0,0 +1,479 @@
+import datetime
+import logging
+import os
+from pathlib import Path
+from typing import Callable, Dict, List, Optional, Self, Tuple, Type, TypeVar, Union
+
+import aind_behavior_services.rig as AbsRig
+import aind_data_schema
+import aind_data_schema.base
+import aind_data_schema.components.coordinates
+import aind_data_schema.components.devices
+import aind_data_schema.components.stimulus
+import aind_data_schema.core.rig
+import aind_data_schema.core.session
+import git
+import pydantic
+from aind_behavior_experiment_launcher.data_mapper import DataMapper
+from aind_behavior_experiment_launcher.data_mapper import aind_data_schema as ads
+from aind_behavior_experiment_launcher.data_mapper import helpers as data_mapper_helpers
+from aind_behavior_experiment_launcher.launcher.behavior_launcher import BehaviorLauncher
+from aind_behavior_experiment_launcher.records.subject import WaterLogResult
+from aind_behavior_services.calibration import Calibration
+from aind_behavior_services.calibration.olfactometer import OlfactometerChannelType
+from aind_behavior_services.session import AindBehaviorSessionModel
+from aind_behavior_services.utils import model_from_json_file, utcnow
+
+from aind_behavior_vr_foraging.rig import AindVrForagingRig
+from aind_behavior_vr_foraging.task_logic import AindVrForagingTaskLogic
+
+TFrom = TypeVar("TFrom", bound=Union[pydantic.BaseModel, dict])
+TTo = TypeVar("TTo", bound=pydantic.BaseModel)
+
+T = TypeVar("T")
+
+logger = logging.getLogger(__name__)
+
+_DATABASE_DIR = "AindDataSchemaRig"
+
+
+class AindRigDataMapper(ads.AindDataSchemaRigDataMapper):
+ def __init__(
+ self,
+ *,
+ rig_schema_filename: str,
+ db_root: os.PathLike,
+ db_suffix: Optional[str] = None,
+ ):
+ super().__init__()
+ self.filename = rig_schema_filename
+ self.db_root = db_root
+ self.db_dir = db_suffix if db_suffix else f"{_DATABASE_DIR}/{os.environ['COMPUTERNAME']}"
+ self.target_file = Path(self.db_root) / self.db_dir / self.filename
+ self._mapped: Optional[aind_data_schema.core.rig.Rig] = None
+
+ @property
+ def session_name(self):
+ raise NotImplementedError("Method not implemented.")
+
+ def write_standard_file(self, directory: os.PathLike) -> None:
+ self.mapped.write_standard_file(directory)
+
+ def map(self) -> aind_data_schema.core.rig.Rig:
+ logger.info("Mapping aind-data-schema Rig.")
+
+ file_exists = self.target_file.exists()
+ if not file_exists:
+ raise FileNotFoundError(f"File {self.target_file} does not exist.")
+
+ try:
+ self._mapped = model_from_json_file(self.target_file, aind_data_schema.core.rig.Rig)
+ except (pydantic.ValidationError, ValueError, IOError) as e:
+ logger.error("Failed to map to aind-data-schema Session. %s", e)
+ raise e
+ else:
+ return self.mapped
+
+ @property
+ def mapped(self) -> aind_data_schema.core.rig.Rig:
+ if self._mapped is None:
+ raise ValueError("Data has not been mapped yet.")
+ return self._mapped
+
+ def is_mapped(self) -> bool:
+ return self.mapped is not None
+
+
+class AindSessionDataMapper(ads.AindDataSchemaSessionDataMapper):
+ def __init__(
+ self,
+ session_model: AindBehaviorSessionModel,
+ rig_model: AindVrForagingRig,
+ task_logic_model: AindVrForagingTaskLogic,
+ repository: Union[os.PathLike, git.Repo],
+ script_path: os.PathLike,
+ session_end_time: Optional[datetime.datetime] = None,
+ output_parameters: Optional[Dict] = None,
+ subject_info: Optional[WaterLogResult] = None,
+ ):
+ self.session_model = session_model
+ self.rig_model = rig_model
+ self.task_logic_model = task_logic_model
+ self.repository = repository
+ self.script_path = script_path
+ self.session_end_time = session_end_time
+ self.output_parameters = output_parameters
+ self.subject_info = subject_info
+ self._mapped: Optional[aind_data_schema.core.session.Session] = None
+
+ @property
+ def session_name(self):
+ raise self.session_model.session_name
+
+ @property
+ def mapped(self) -> aind_data_schema.core.session.Session:
+ if self._mapped is None:
+ raise ValueError("Data has not been mapped yet.")
+ return self._mapped
+
+ def is_mapped(self) -> bool:
+ return self.mapped is not None
+
+ def map(self) -> Optional[aind_data_schema.core.session.Session]:
+ logger.info("Mapping aind-data-schema Session.")
+ try:
+ self._mapped = self._map(
+ session_model=self.session_model,
+ rig_model=self.rig_model,
+ task_logic_model=self.task_logic_model,
+ repository=self.repository,
+ script_path=self.script_path,
+ session_end_time=self.session_end_time,
+ output_parameters=self.output_parameters,
+ subject_info=self.subject_info,
+ )
+ except (pydantic.ValidationError, ValueError, IOError) as e:
+ logger.error("Failed to map to aind-data-schema Session. %s", e)
+ raise e
+ else:
+ return self._mapped
+
+ def write_standard_file(self, directory: os.PathLike) -> None:
+ self.mapped.write_standard_file(directory)
+
+ @classmethod
+ def _map(
+ cls,
+ session_model: AindBehaviorSessionModel,
+ rig_model: AindVrForagingRig,
+ task_logic_model: AindVrForagingTaskLogic,
+ repository: Union[os.PathLike, git.Repo],
+ script_path: os.PathLike,
+ session_end_time: Optional[datetime.datetime] = None,
+ output_parameters: Optional[Dict] = None,
+ subject_info: Optional[WaterLogResult] = None,
+ **kwargs,
+ ) -> aind_data_schema.core.session.Session:
+ # Normalize repository
+ if isinstance(repository, os.PathLike | str):
+ repository = git.Repo(Path(repository))
+ repository_remote_url = repository.remote().url
+ repository_sha = repository.head.commit.hexsha
+ repository_relative_script_path = Path(script_path).resolve().relative_to(repository.working_dir)
+
+ # Populate calibrations:
+ # calibrations = [cls._mapper_calibration(rig_model.calibration.water_valve)]
+
+ # TODO: Hack until someone solves https://github.com/AllenNeuralDynamics/aind-data-schema/issues/1248
+ _out = (
+ rig_model.calibration.water_valve.output.model_copy(update={"interval_average": None})
+ if rig_model.calibration.water_valve.output
+ else None
+ )
+ water_calibration = aind_data_schema.core.rig.Calibration(
+ calibration_date=rig_model.calibration.water_valve.date
+ if rig_model.calibration.water_valve.date
+ else utcnow(),
+ device_name=rig_model.calibration.water_valve.device_name,
+ description=rig_model.calibration.water_valve.description,
+ input=rig_model.calibration.water_valve.input.model_dump()
+ if rig_model.calibration.water_valve.input
+ else {},
+ output=_out.model_dump() if _out else {},
+ )
+ calibrations = [water_calibration]
+
+ # Populate cameras
+ cameras = data_mapper_helpers.get_cameras(rig_model, exclude_without_video_writer=True)
+ # populate devices
+ devices = [
+ device[0]
+ for device in data_mapper_helpers.get_fields_of_type(rig_model, AbsRig.HarpDeviceGeneric)
+ if device[0]
+ ]
+ # Populate modalities
+ modalities: list[aind_data_schema.core.session.Modality] = [
+ getattr(aind_data_schema.core.session.Modality, "BEHAVIOR")
+ ]
+ if len(cameras) > 0:
+ modalities.append(getattr(aind_data_schema.core.session.Modality, "BEHAVIOR_VIDEOS"))
+ modalities = list(set(modalities))
+ # Populate stimulus modalities
+ stimulus_modalities: list[aind_data_schema.core.session.StimulusModality] = []
+ stimulation_parameters: List[
+ aind_data_schema.core.session.AuditoryStimulation
+ | aind_data_schema.core.session.OlfactoryStimulation
+ | aind_data_schema.core.session.VisualStimulation
+ ] = []
+ stimulation_devices: List[str] = []
+ # Olfactory Stimulation
+ stimulus_modalities.append(aind_data_schema.core.session.StimulusModality.OLFACTORY)
+ olfactory_stimulus_channel_config: List[aind_data_schema.components.stimulus.OlfactometerChannelConfig] = []
+ for _, channel in rig_model.harp_olfactometer.calibration.input.channel_config.items():
+ if channel.channel_type == OlfactometerChannelType.ODOR:
+ olfactory_stimulus_channel_config.append(
+ coerce_to_aind_data_schema(channel, aind_data_schema.components.stimulus.OlfactometerChannelConfig)
+ )
+ stimulation_parameters.append(
+ aind_data_schema.core.session.OlfactoryStimulation(
+ stimulus_name="Olfactory", channels=olfactory_stimulus_channel_config
+ )
+ )
+
+ _olfactory_device = data_mapper_helpers.get_fields_of_type(rig_model, AbsRig.HarpOlfactometer)
+ if len(_olfactory_device) > 0:
+ if _olfactory_device[0][0]:
+ stimulation_devices.append(_olfactory_device[0][0])
+ else:
+ logger.error("Olfactometer device not found in rig model.")
+ raise ValueError("Olfactometer device not found in rig model.")
+
+ # Auditory Stimulation
+ stimulus_modalities.append(aind_data_schema.core.session.StimulusModality.AUDITORY)
+
+ stimulation_parameters.append(
+ aind_data_schema.core.session.AuditoryStimulation(sitmulus_name="Beep", sample_frequency=0)
+ )
+ speaker_config = aind_data_schema.core.session.SpeakerConfig(name="Speaker", volume=60)
+ stimulation_devices.append("speaker")
+ # Visual/VR Stimulation
+ stimulus_modalities.extend(
+ [
+ aind_data_schema.core.session.StimulusModality.VISUAL,
+ aind_data_schema.core.session.StimulusModality.VIRTUAL_REALITY,
+ ]
+ )
+
+ stimulation_parameters.append(
+ aind_data_schema.core.session.VisualStimulation(
+ stimulus_name="VrScreen",
+ stimulus_parameters={},
+ )
+ )
+ _screen_device = data_mapper_helpers.get_fields_of_type(rig_model, AbsRig.Screen)
+ if len(_screen_device) > 0:
+ if _screen_device[0][0]:
+ stimulation_devices.append(_screen_device[0][0])
+ else:
+ logger.error("Screen device not found in rig model.")
+ raise ValueError("Screen device not found in rig model.")
+
+ stimulus_modalities.append(aind_data_schema.core.session.StimulusModality.WHEEL_FRICTION)
+ # Mouse platform
+ mouse_platform: str = "wheel"
+
+ # Reward delivery
+ if rig_model.manipulator.calibration is None:
+ logger.error("Manipulator calibration is not set.")
+ raise ValueError("Manipulator calibration is not set.")
+ initial_position = rig_model.manipulator.calibration.input.initial_position
+ reward_delivery_config = aind_data_schema.core.session.RewardDeliveryConfig(
+ reward_solution=aind_data_schema.core.session.RewardSolution.WATER,
+ reward_spouts=[
+ aind_data_schema.core.session.RewardSpoutConfig(
+ side=aind_data_schema.components.devices.SpoutSide.CENTER,
+ variable_position=True,
+ starting_position=aind_data_schema.components.devices.RelativePosition(
+ device_position_transformations=[
+ aind_data_schema.components.coordinates.Translation3dTransform(
+ translation=[initial_position.x, initial_position.y2, initial_position.z]
+ )
+ ],
+ device_origin="Manipulator home",
+ device_axes=[
+ aind_data_schema.components.coordinates.Axis(
+ name=aind_data_schema.components.coordinates.AxisName.X, direction="Left"
+ ),
+ aind_data_schema.components.coordinates.Axis(
+ name=aind_data_schema.components.coordinates.AxisName.Y, direction="Front"
+ ),
+ aind_data_schema.components.coordinates.Axis(
+ name=aind_data_schema.components.coordinates.AxisName.Z, direction="Top"
+ ),
+ ],
+ ),
+ )
+ ],
+ )
+
+ end_time = datetime.datetime.now()
+
+ # Construct aind-data-schema session
+ aind_data_schema_session = aind_data_schema.core.session.Session(
+ animal_weight_post=subject_info.weight_g if subject_info else None,
+ reward_consumed_total=subject_info.water_earned_ml if subject_info else None,
+ reward_delivery=reward_delivery_config,
+ experimenter_full_name=session_model.experimenter,
+ session_start_time=session_model.date,
+ session_end_time=session_end_time,
+ session_type=session_model.experiment,
+ rig_id=rig_model.rig_name,
+ subject_id=session_model.subject,
+ notes=session_model.notes,
+ data_streams=[
+ aind_data_schema.core.session.Stream(
+ daq_names=devices,
+ stream_modalities=modalities,
+ stream_start_time=session_model.date,
+ stream_end_time=session_end_time if session_end_time else end_time,
+ camera_names=list(cameras.keys()),
+ ),
+ ],
+ calibrations=calibrations,
+ mouse_platform_name=mouse_platform,
+ active_mouse_platform=True,
+ stimulus_epochs=[
+ aind_data_schema.core.session.StimulusEpoch(
+ stimulus_name=session_model.experiment,
+ stimulus_start_time=session_model.date,
+ stimulus_end_time=session_end_time if session_end_time else end_time,
+ stimulus_modalities=stimulus_modalities,
+ stimulus_parameters=stimulation_parameters,
+ software=[
+ aind_data_schema.core.session.Software(
+ name="Bonsai",
+ version=f"{repository_remote_url}/blob/{repository_sha}/bonsai/Bonsai.config",
+ url=f"{repository_remote_url}/blob/{repository_sha}/bonsai",
+ parameters=data_mapper_helpers.snapshot_bonsai_environment(
+ config_file=kwargs.get("bonsai_config_path", Path("./bonsai/bonsai.config"))
+ ),
+ ),
+ aind_data_schema.core.session.Software(
+ name="Python",
+ version=f"{repository_remote_url}/blob/{repository_sha}/pyproject.toml",
+ url=f"{repository_remote_url}/blob/{repository_sha}",
+ parameters=data_mapper_helpers.snapshot_python_environment(),
+ ),
+ ],
+ script=aind_data_schema.core.session.Software(
+ name=Path(script_path).stem,
+ version=session_model.commit_hash if session_model.commit_hash else repository_sha,
+ url=f"{repository_remote_url}/blob/{repository_sha}/{repository_relative_script_path}",
+ parameters=task_logic_model.model_dump(),
+ ),
+ output_parameters=output_parameters if output_parameters else {},
+ speaker_config=speaker_config,
+ reward_consumed_during_epoch=subject_info.total_water_ml if subject_info else None,
+ stimulus_device_names=stimulation_devices,
+ ) # type: ignore
+ ],
+ ) # type: ignore
+ return aind_data_schema_session
+
+ @staticmethod
+ def _mapper_calibration(calibration: Calibration) -> aind_data_schema.components.devices.Calibration:
+ return ads.create_encoding_model(aind_data_schema.components.devices.Calibration)(
+ device_name=calibration.device_name,
+ input=calibration.input.model_dump() if calibration.input else {},
+ output=calibration.output.model_dump() if calibration.output else {},
+ calibration_date=calibration.date if calibration.date else utcnow(),
+ description=calibration.description if calibration.description else "",
+ notes=calibration.notes,
+ )
+
+
+def coerce_to_aind_data_schema(value: TFrom, target_type: Type[TTo]) -> TTo:
+ _normalized_input: dict
+ if isinstance(value, pydantic.BaseModel):
+ _normalized_input = value.model_dump()
+ elif isinstance(value, dict):
+ _normalized_input = value
+ else:
+ raise ValueError(f"Expected value to be a pydantic.BaseModel or a dict, got {type(value)}")
+ target_fields = target_type.model_fields
+ _normalized_input = {k: v for k, v in _normalized_input.items() if k in target_fields}
+ return target_type(**_normalized_input)
+
+
+def aind_session_data_mapper_factory(launcher: BehaviorLauncher) -> AindSessionDataMapper:
+ now = utcnow()
+ return AindSessionDataMapper(
+ session_model=launcher.session_schema,
+ rig_model=launcher.rig_schema,
+ task_logic_model=launcher.task_logic_schema,
+ repository=launcher.repository,
+ script_path=launcher.services_factory_manager.bonsai_app.workflow,
+ session_end_time=now,
+ )
+
+
+def aind_rig_data_mapper_factory(
+ launcher: BehaviorLauncher[AindVrForagingRig, AindBehaviorSessionModel, AindVrForagingTaskLogic],
+) -> AindRigDataMapper:
+ rig_schema: AindVrForagingRig = launcher.rig_schema
+ return AindRigDataMapper(
+ rig_schema_filename=f"{rig_schema.rig_name}.json",
+ db_suffix=f"{_DATABASE_DIR}/{launcher.computer_name}",
+ db_root=launcher.config_library_dir,
+ )
+
+
+class AindDataMapperWrapper(DataMapper):
+ def __init__(
+ self,
+ *,
+ launcher: Optional[BehaviorLauncher] = None,
+ rig_data_mapper_factory: Optional[Callable[[BehaviorLauncher], AindRigDataMapper]] = None,
+ session_data_mapper_factory: Optional[Callable[[BehaviorLauncher], AindSessionDataMapper]] = None,
+ ):
+ super().__init__()
+ self._rig_mapper_factory = rig_data_mapper_factory or aind_rig_data_mapper_factory
+ self._session_mapper_factory = session_data_mapper_factory or aind_session_data_mapper_factory
+
+ self._rig_mapper: Optional[AindRigDataMapper] = None
+ self._session_mapper: Optional[AindSessionDataMapper] = None
+
+ self._session_schema: Optional[aind_data_schema.core.session.Session] = None
+ self._rig_schema: Optional[aind_data_schema.core.rig.Rig] = None
+
+ self._launcher = launcher
+ self._mapped: Optional[aind_data_schema.core.rig.Rig] = None
+
+ @property
+ def session_directory(self):
+ return self._launcher.session_directory
+
+ @property
+ def session_name(self):
+ if self._launcher.session_schema_model is not None:
+ return self._launcher.session_schema_model.session_name
+ else:
+ raise ValueError("Can't infer session name from _launcher.")
+
+ @classmethod
+ def from_launcher(
+ cls,
+ launcher: BehaviorLauncher[AindVrForagingRig, AindBehaviorSessionModel, AindVrForagingTaskLogic],
+ rig_data_mapper_factory: Optional[Callable[[BehaviorLauncher], AindRigDataMapper]] = None,
+ session_data_mapper_factory: Optional[Callable[[BehaviorLauncher], AindSessionDataMapper]] = None,
+ ) -> Self:
+ return cls(
+ launcher=launcher,
+ rig_data_mapper_factory=rig_data_mapper_factory,
+ session_data_mapper_factory=session_data_mapper_factory,
+ )
+
+ def map(self) -> Tuple[aind_data_schema.core.rig.Rig, aind_data_schema.core.session.Session]:
+ if self._launcher is None:
+ raise ValueError("Launcher is not set.")
+ self._rig_mapper = self._rig_mapper_factory(self._launcher)
+ self._session_mapper = self._session_mapper_factory(self._launcher)
+ self._rig_schema = self._rig_mapper.map()
+ self._session_schema = self._session_mapper.map()
+ if self._rig_schema is None or self._session_schema is None:
+ raise ValueError("Failed to map data.")
+ self._session_schema.rig_id = self._rig_schema.rig_id
+ logger.info("Writing session.json to %s", self.session_directory)
+ self._session_schema.write_standard_file(self.session_directory)
+ logger.info("Writing rig.json to %s", self.session_directory)
+ self._rig_schema.write_standard_file(self.session_directory)
+ return self.mapped
+
+ @property
+ def mapped(self) -> Tuple[aind_data_schema.core.rig.Rig, aind_data_schema.core.session.Session]:
+ if self._rig_mapper is None or self._session_mapper is None:
+ raise ValueError("Data has not been mapped yet.")
+ return (self._rig_schema, self._session_schema)
+
+ def is_mapped(self) -> bool:
+ return (self._rig_schema is not None) and (self._session_schema is not None)
diff --git a/src/DataSchemas/aind_behavior_vr_foraging/launcher.py b/src/DataSchemas/aind_behavior_vr_foraging/launcher.py
new file mode 100644
index 00000000..0373cf02
--- /dev/null
+++ b/src/DataSchemas/aind_behavior_vr_foraging/launcher.py
@@ -0,0 +1,111 @@
+import datetime
+import os
+from functools import partial
+from pathlib import Path
+from typing import Callable, Optional
+
+import aind_behavior_experiment_launcher.launcher.behavior_launcher as behavior_launcher
+from aind_behavior_experiment_launcher import resource_monitor
+from aind_behavior_experiment_launcher.apps import BonsaiApp
+from aind_behavior_experiment_launcher.data_transfer import aind_watchdog
+from aind_behavior_services.session import AindBehaviorSessionModel
+
+from aind_behavior_vr_foraging.data_mappers import AindDataMapperWrapper
+from aind_behavior_vr_foraging.rig import AindVrForagingRig
+from aind_behavior_vr_foraging.task_logic import AindVrForagingTaskLogic
+
+
+def make_launcher() -> behavior_launcher.BehaviorLauncher:
+ data_dir = r"C:/Data"
+ remote_dir = Path(r"\\allen\aind\scratch\vr-foraging\data")
+ srv = behavior_launcher.BehaviorServicesFactoryManager()
+ srv.attach_bonsai_app(BonsaiApp(r"./src/vr-foraging.bonsai"))
+ srv.attach_data_mapper(AindDataMapperWrapper.from_launcher)
+ srv.attach_data_transfer(
+ watchdog_data_transfer_factory(remote_dir, project_name="Cognitive flexibility in patch foraging")
+ )
+
+ srv.attach_resource_monitor(
+ resource_monitor.ResourceMonitor(
+ constrains=[
+ resource_monitor.available_storage_constraint_factory(data_dir, 2e11),
+ resource_monitor.remote_dir_exists_constraint_factory(Path(remote_dir)),
+ ]
+ )
+ )
+
+ return behavior_launcher.BehaviorLauncher(
+ rig_schema_model=AindVrForagingRig,
+ session_schema_model=AindBehaviorSessionModel,
+ task_logic_schema_model=AindVrForagingTaskLogic,
+ data_dir=data_dir,
+ config_library_dir=r"\\allen\aind\scratch\AindBehavior.db\AindVrForaging",
+ temp_dir=r"./local/.temp",
+ allow_dirty=False,
+ skip_hardware_validation=False,
+ debug_mode=False,
+ group_by_subject_log=True,
+ services=srv,
+ validate_init=True,
+ )
+
+
+def watchdog_data_transfer_factory(
+ destination: os.PathLike,
+ schedule_time: Optional[datetime.time] = datetime.time(hour=20),
+ project_name: Optional[str] = None,
+ **watchdog_kwargs,
+) -> Callable[[behavior_launcher.BehaviorLauncher], aind_watchdog.WatchdogDataTransferService]:
+ return partial(
+ _watchdog_data_transfer_factory,
+ destination=destination,
+ schedule_time=schedule_time,
+ project_name=project_name,
+ **watchdog_kwargs,
+ )
+
+
+def _watchdog_data_transfer_factory(
+ launcher: behavior_launcher.BehaviorLauncher,
+ destination: os.PathLike,
+ **watchdog_kwargs,
+) -> aind_watchdog.WatchdogDataTransferService:
+ if launcher.services_factory_manager.data_mapper is None:
+ raise ValueError("Data mapper service is not set. Cannot create watchdog.")
+ if not isinstance(launcher.services_factory_manager.data_mapper, AindDataMapperWrapper):
+ raise ValueError(
+ "Data mapper service is not of the correct type (AindDataMapperWrapper). Cannot create watchdog."
+ )
+ if not launcher.services_factory_manager.data_mapper.is_mapped():
+ raise ValueError("Data mapper has not mapped yet. Cannot create watchdog.")
+
+ if not isinstance(launcher.session_schema, AindBehaviorSessionModel):
+ raise ValueError(
+ "Session schema is not of the correct type (AindBehaviorSessionModel). Cannot create watchdog."
+ )
+
+ if not launcher.session_schema.session_name:
+ raise ValueError("Session name is not set. Cannot create watchdog.")
+
+ destination = Path(destination)
+ if launcher.group_by_subject_log:
+ destination = destination / launcher.session_schema.subject
+
+ watchdog = aind_watchdog.WatchdogDataTransferService(
+ source=launcher.session_directory,
+ aind_session_data_mapper=launcher.services_factory_manager.data_mapper._session_mapper,
+ session_name=launcher.session_schema.session_name,
+ destination=destination,
+ **watchdog_kwargs,
+ )
+ return watchdog
+
+
+def main():
+ launcher = make_launcher()
+ launcher.main()
+ return None
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/regenerate.py b/src/DataSchemas/aind_behavior_vr_foraging/regenerate.py
similarity index 99%
rename from scripts/regenerate.py
rename to src/DataSchemas/aind_behavior_vr_foraging/regenerate.py
index b9db9e2e..279045f2 100644
--- a/scripts/regenerate.py
+++ b/src/DataSchemas/aind_behavior_vr_foraging/regenerate.py
@@ -1,8 +1,6 @@
import inspect
from pathlib import Path
-import aind_behavior_vr_foraging.rig
-import aind_behavior_vr_foraging.task_logic
from aind_behavior_services.session import AindBehaviorSessionModel
from aind_behavior_services.utils import (
convert_pydantic_to_bonsai,
@@ -10,6 +8,9 @@
snake_to_pascal_case,
)
+import aind_behavior_vr_foraging.rig
+import aind_behavior_vr_foraging.task_logic
+
SCHEMA_ROOT = Path("./src/DataSchemas/")
EXTENSIONS_ROOT = Path("./src/Extensions/")
NAMESPACE_PREFIX = "AindVrForagingDataSchema"
diff --git a/src/DataSchemas/aind_behavior_vr_foraging/rig.py b/src/DataSchemas/aind_behavior_vr_foraging/rig.py
index 1c45c4ee..6593b2f5 100644
--- a/src/DataSchemas/aind_behavior_vr_foraging/rig.py
+++ b/src/DataSchemas/aind_behavior_vr_foraging/rig.py
@@ -2,12 +2,13 @@
from __future__ import annotations
# Import core types
-from typing import Annotated, List, Literal, Optional
+from typing import List, Literal, Optional
import aind_behavior_services.calibration.olfactometer as oc
import aind_behavior_services.calibration.water_valve as wvc
import aind_behavior_services.rig as rig
from aind_behavior_services.calibration import aind_manipulator
+from aind_behavior_services.calibration.treadmill import Treadmill
from aind_behavior_services.rig import (
AindBehaviorRigModel,
HarpAnalogInput,
@@ -15,26 +16,10 @@
HarpClockGenerator,
HarpLickometer,
HarpSniffDetector,
- Screen,
)
from pydantic import BaseModel, Field
-__version__ = "0.3.0"
-
-
-ValuePair = Annotated[List[float], Field(min_length=2, max_length=2, description="A tuple of two values")]
-
-
-class Treadmill(rig.Treadmill):
- """Overrides the default settings for the treadmill calibration by spec'ing brake_lookup_calibration field"""
-
- brake_lookup_calibration: List[ValuePair] = Field(
- default=[[0, 0], [1, 65535]],
- validate_default=True,
- min_length=2,
- description="Brake lookup calibration. Each Tuple is (0-1 (percent), 0-full-scale). \
- Values are linearly interpolated",
- )
+__version__ = "0.4.0"
class AindManipulatorAdditionalSettings(BaseModel):
@@ -51,16 +36,10 @@ class AindManipulatorDevice(aind_manipulator.AindManipulatorDevice):
)
-class HarpTreadmill(rig.HarpTreadmill):
- """Overrides the default settings for the treadmill calibration"""
-
- calibration: Treadmill = Field(Treadmill(), description="Treadmill calibration settings", validate_default=True)
-
-
class HarpOlfactometer(rig.HarpOlfactometer):
"""Overrides the default settings for the olfactometer calibration"""
- calibration: Optional[oc.OlfactometerCalibration] = Field(default=None, description="Olfactometer calibration")
+ calibration: oc.OlfactometerCalibration = Field(default=None, description="Olfactometer calibration")
class RigCalibration(BaseModel):
@@ -83,8 +62,9 @@ class AindVrForagingRig(AindBehaviorRigModel):
harp_clock_generator: HarpClockGenerator = Field(..., description="Harp clock generator")
harp_clock_repeaters: List[HarpClockGenerator] = Field(default=[], description="Harp clock repeaters")
harp_analog_input: Optional[HarpAnalogInput] = Field(default=None, description="Harp analog input")
- harp_treadmill: HarpTreadmill = Field(..., description="Harp treadmill")
- harp_sniff_detector: Optional[HarpSniffDetector] = Field(None, description="Sniff detector settings")
+ harp_treadmill: Treadmill = Field(..., description="Harp treadmill")
+ harp_sniff_detector: Optional[HarpSniffDetector] = Field(default=None, description="Sniff detector settings")
+ harp_environment_sensor: Optional[rig.HarpEnvironmentSensor] = Field(default=None, description="Environment sensor")
manipulator: AindManipulatorDevice = Field(..., description="Manipulator")
- screen: rig.Screen = Field(default=Screen(), description="Screen settings")
+ screen: rig.Screen = Field(default=rig.Screen(), description="Screen settings")
calibration: RigCalibration = Field(..., description="Calibration models")
diff --git a/src/DataSchemas/aind_behavior_vr_foraging/task_logic.py b/src/DataSchemas/aind_behavior_vr_foraging/task_logic.py
index 4d39b1f3..4b3ce190 100644
--- a/src/DataSchemas/aind_behavior_vr_foraging/task_logic.py
+++ b/src/DataSchemas/aind_behavior_vr_foraging/task_logic.py
@@ -1,13 +1,13 @@
from __future__ import annotations
from enum import Enum
-from typing import Annotated, Dict, List, Literal, Optional, Union
+from typing import Annotated, Dict, List, Literal, Optional, Self, Union
import aind_behavior_services.task_logic.distributions as distributions
from aind_behavior_services.task_logic import AindBehaviorTaskLogicModel, TaskParameters
-from pydantic import BaseModel, Field, NonNegativeFloat, RootModel
+from pydantic import BaseModel, Field, NonNegativeFloat, RootModel, model_validator
-__version__ = "0.4.0"
+__version__ = "0.5.0"
def scalar_value(value: float) -> distributions.Scalar:
@@ -90,7 +90,7 @@ class OperantLogic(BaseModel):
class PowerFunction(BaseModel):
function_type: Literal["PowerFunction"] = "PowerFunction"
- mininum: float = Field(default=0, description="Minimum value of the function")
+ minimum: float = Field(default=0, description="Minimum value of the function")
maximum: float = Field(default=1, description="Maximum value of the function")
a: float = Field(default=1, description="Coefficient a of the function: value = a * pow(b, c * x) + d")
b: float = Field(
@@ -102,7 +102,7 @@ class PowerFunction(BaseModel):
class LinearFunction(BaseModel):
function_type: Literal["LinearFunction"] = "LinearFunction"
- mininum: float = Field(default=0, description="Minimum value of the function")
+ minimum: float = Field(default=0, description="Minimum value of the function")
maximum: float = Field(default=9999, description="Maximum value of the function")
a: float = Field(default=1, description="Coefficient a of the function: value = a * x + b")
b: float = Field(default=0, description="Coefficient b of the function: value = a * x + b")
@@ -113,14 +113,29 @@ class ConstantFunction(BaseModel):
value: float = Field(default=1, description="Value of the function")
+class LookupTableFunction(BaseModel):
+ function_type: Literal["LookupTableFunction"] = "LookupTableFunction"
+ lut_keys: List[float] = Field(..., description="List of keys of the lookup table", min_length=1)
+ lut_values: List[float] = Field(..., description="List of values of the lookup table", min_length=1)
+
+ @model_validator(mode="after")
+ def _validate_lut(self) -> Self:
+ if len(self.lut_keys) != len(self.lut_values):
+ raise ValueError("The number of keys and values must be the same.")
+ return self
+
+
class RewardFunction(RootModel):
- root: Annotated[Union[ConstantFunction, LinearFunction, PowerFunction], Field(discriminator="function_type")]
+ root: Annotated[
+ Union[ConstantFunction, LinearFunction, PowerFunction, LookupTableFunction],
+ Field(discriminator="function_type"),
+ ]
class DepletionRule(str, Enum):
- ON_REWARD = ("OnReward",)
- ON_CHOICE = ("OnChoice",)
- ON_TIME = ("OnTime",)
+ ON_REWARD = "OnReward"
+ ON_CHOICE = "OnChoice"
+ ON_TIME = "OnTime"
ON_DISTANCE = "OnDistance"
@@ -136,7 +151,7 @@ class PatchRewardFunction(BaseModel):
validate_default=True,
)
available: RewardFunction = Field(
- default=LinearFunction(mininum=0, a=-1, b=5),
+ default=LinearFunction(minimum=0, a=-1, b=5),
description="Determines the total amount of reward available left in the patch. The value is in microliters",
validate_default=True,
)
@@ -358,9 +373,63 @@ class TaskModeSettings(RootModel):
root: Annotated[Union[HabituationSettings, ForagingSettings, DebugSettings], Field(discriminator="task_mode")]
+class _BlockEndConditionBase(BaseModel):
+ condition_type: str
+
+
+class BlockEndConditionDuration(_BlockEndConditionBase):
+ condition_type: Literal["Duration"] = "Duration"
+ value: distributions.Distribution = Field(..., description="Time after which the block ends.")
+
+
+class BlockEndConditionDistance(_BlockEndConditionBase):
+ condition_type: Literal["Distance"] = "Distance"
+ value: distributions.Distribution = Field(..., description="Distance after which the block ends.")
+
+
+class BlockEndConditionChoice(_BlockEndConditionBase):
+ condition_type: Literal["Choice"] = "Choice"
+ value: distributions.Distribution = Field(..., description="Number of choices after which the block ends.")
+
+
+class BlockEndConditionReward(_BlockEndConditionBase):
+ condition_type: Literal["Reward"] = "Reward"
+ value: distributions.Distribution = Field(..., description="Number of rewards after which the block ends.")
+
+
+class BlockEndConditionPatchCount(_BlockEndConditionBase):
+ condition_type: Literal["PatchCount"] = "PatchCount"
+ value: distributions.Distribution = Field(..., description="Number of patches after which the block will end.")
+
+
+class BlockEndCondition(RootModel):
+ root: Annotated[
+ Union[
+ BlockEndConditionDuration,
+ BlockEndConditionDistance,
+ BlockEndConditionChoice,
+ BlockEndConditionReward,
+ BlockEndConditionPatchCount,
+ ],
+ Field(discriminator="condition_type"),
+ ]
+
+
+class Block(BaseModel):
+ environment_statistics: EnvironmentStatistics = Field(..., description="Statistics of the environment")
+ end_conditions: List[BlockEndCondition] = Field(
+ [], description="List of end conditions that must be true for the block to end."
+ )
+
+
+class BlockStructure(BaseModel):
+ blocks: List[Block] = Field(..., description="Statistics of the environment", min_length=1)
+ sampling_mode: Literal["Random", "Sequential"] = Field("Sequential", description="Sampling mode of the blocks.")
+
+
class AindVrForagingTaskParameters(TaskParameters):
updaters: Dict[str, NumericalUpdater] = Field(default_factory=dict, description="List of numerical updaters")
- environment_statistics: EnvironmentStatistics = Field(..., description="Statistics of the environment")
+ environment: BlockStructure = Field(..., description="Statistics of the environment")
task_mode_settings: TaskModeSettings = Field(
default=ForagingSettings(), description="Settings of the task stage", validate_default=True
)
@@ -369,5 +438,5 @@ class AindVrForagingTaskParameters(TaskParameters):
class AindVrForagingTaskLogic(AindBehaviorTaskLogicModel):
version: Literal[__version__] = __version__
- name: str = Field(default="AindVrForaging", description="Name of the task logic", frozen=True)
+ name: Literal["AindVrForaging"] = Field(default="AindVrForaging", description="Name of the task logic", frozen=True)
task_parameters: AindVrForagingTaskParameters = Field(..., description="Parameters of the task logic")
diff --git a/src/DataSchemas/aind_vr_foraging_rig.json b/src/DataSchemas/aind_vr_foraging_rig.json
index 72d4ccb7..22e2ecaf 100644
--- a/src/DataSchemas/aind_vr_foraging_rig.json
+++ b/src/DataSchemas/aind_vr_foraging_rig.json
@@ -4,11 +4,7 @@
"description": "Additional settings for the manipulator device",
"properties": {
"spout_axis": {
- "allOf": [
- {
- "$ref": "#/definitions/Axis"
- }
- ],
+ "$ref": "#/definitions/Axis",
"default": 2,
"description": "Spout axis"
}
@@ -26,19 +22,11 @@
"type": "string"
},
"input": {
- "allOf": [
- {
- "$ref": "#/definitions/AindManipulatorCalibrationInput"
- }
- ],
+ "$ref": "#/definitions/AindManipulatorCalibrationInput",
"title": "Input of the calibration"
},
"output": {
- "allOf": [
- {
- "$ref": "#/definitions/AindManipulatorCalibrationOutput"
- }
- ],
+ "$ref": "#/definitions/AindManipulatorCalibrationOutput",
"title": "Output of the calibration."
},
"date": {
@@ -83,11 +71,7 @@
"AindManipulatorCalibrationInput": {
"properties": {
"full_step_to_mm": {
- "allOf": [
- {
- "$ref": "#/definitions/ManipulatorPosition"
- }
- ],
+ "$ref": "#/definitions/ManipulatorPosition",
"default": {
"x": 0.01,
"y1": 0.01,
@@ -159,11 +143,7 @@
"type": "array"
},
"initial_position": {
- "allOf": [
- {
- "$ref": "#/definitions/ManipulatorPosition"
- }
- ],
+ "$ref": "#/definitions/ManipulatorPosition",
"default": {
"x": 0.0,
"y1": 0.0,
@@ -190,11 +170,7 @@
"type": "string"
},
"additional_settings": {
- "allOf": [
- {
- "$ref": "#/definitions/AindManipulatorAdditionalSettings"
- }
- ],
+ "$ref": "#/definitions/AindManipulatorAdditionalSettings",
"default": {
"spout_axis": 2
},
@@ -266,11 +242,7 @@
"description": "Axis configuration",
"properties": {
"axis": {
- "allOf": [
- {
- "$ref": "#/definitions/Axis"
- }
- ],
+ "$ref": "#/definitions/Axis",
"title": "Axis to be configured"
},
"step_acceleration_interval": {
@@ -290,11 +262,7 @@
"type": "integer"
},
"microstep_resolution": {
- "allOf": [
- {
- "$ref": "#/definitions/MicrostepResolution"
- }
- ],
+ "$ref": "#/definitions/MicrostepResolution",
"default": 0,
"title": "Microstep resolution"
},
@@ -306,11 +274,7 @@
"type": "integer"
},
"motor_operation_mode": {
- "allOf": [
- {
- "$ref": "#/definitions/MotorOperationMode"
- }
- ],
+ "$ref": "#/definitions/MotorOperationMode",
"default": 0,
"title": "Motor operation mode"
},
@@ -458,6 +422,202 @@
"title": "CameraController[WebCamera]",
"type": "object"
},
+ "ConnectedClockOutput": {
+ "properties": {
+ "target_device": {
+ "default": null,
+ "description": "Optional device name to provide user additional information",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Target Device"
+ },
+ "output_channel": {
+ "description": "Output channel",
+ "minimum": 0,
+ "title": "Output Channel",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "output_channel"
+ ],
+ "title": "ConnectedClockOutput",
+ "type": "object"
+ },
+ "DisplayCalibration": {
+ "properties": {
+ "intrinsics": {
+ "$ref": "#/definitions/DisplayIntrinsics",
+ "default": {
+ "frame_width": 1920,
+ "frame_height": 1080,
+ "display_width": 20.0,
+ "display_height": 15.0
+ },
+ "description": "Intrinsics"
+ },
+ "extrinsics": {
+ "$ref": "#/definitions/DisplayExtrinsics",
+ "default": {
+ "rotation": {
+ "x": 0.0,
+ "y": 0.0,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 0.0,
+ "y": 1.309016,
+ "z": -13.27
+ }
+ },
+ "description": "Extrinsics"
+ }
+ },
+ "title": "DisplayCalibration",
+ "type": "object"
+ },
+ "DisplayExtrinsics": {
+ "properties": {
+ "rotation": {
+ "$ref": "#/definitions/Vector3",
+ "default": {
+ "x": 0.0,
+ "y": 0.0,
+ "z": 0.0
+ },
+ "description": "Rotation vector (radians)"
+ },
+ "translation": {
+ "$ref": "#/definitions/Vector3",
+ "default": {
+ "x": 0.0,
+ "y": 1.309016,
+ "z": -13.27
+ },
+ "description": "Translation (in cm)"
+ }
+ },
+ "title": "DisplayExtrinsics",
+ "type": "object"
+ },
+ "DisplayIntrinsics": {
+ "properties": {
+ "frame_width": {
+ "default": 1920,
+ "description": "Frame width (px)",
+ "minimum": 0,
+ "title": "Frame Width",
+ "type": "integer"
+ },
+ "frame_height": {
+ "default": 1080,
+ "description": "Frame height (px)",
+ "minimum": 0,
+ "title": "Frame Height",
+ "type": "integer"
+ },
+ "display_width": {
+ "default": 20,
+ "description": "Display width (cm)",
+ "minimum": 0.0,
+ "title": "Display Width",
+ "type": "number"
+ },
+ "display_height": {
+ "default": 15,
+ "description": "Display width (cm)",
+ "minimum": 0.0,
+ "title": "Display Height",
+ "type": "number"
+ }
+ },
+ "title": "DisplayIntrinsics",
+ "type": "object"
+ },
+ "DisplaysCalibration": {
+ "properties": {
+ "left": {
+ "$ref": "#/definitions/DisplayCalibration",
+ "default": {
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ },
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": -16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ }
+ },
+ "description": "Left display calibration"
+ },
+ "center": {
+ "$ref": "#/definitions/DisplayCalibration",
+ "default": {
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ },
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 0.0,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 0.0,
+ "y": 1.309016,
+ "z": -13.27
+ }
+ }
+ },
+ "description": "Center display calibration"
+ },
+ "right": {
+ "$ref": "#/definitions/DisplayCalibration",
+ "default": {
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ },
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": -1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ }
+ },
+ "description": "Right display calibration"
+ }
+ },
+ "title": "DisplaysCalibration",
+ "type": "object"
+ },
"HarpAnalogInput": {
"properties": {
"device_type": {
@@ -639,6 +799,15 @@
"description": "Device port name",
"title": "Port Name",
"type": "string"
+ },
+ "connected_clock_outputs": {
+ "default": [],
+ "description": "Connected clock outputs",
+ "items": {
+ "$ref": "#/definitions/ConnectedClockOutput"
+ },
+ "title": "Connected Clock Outputs",
+ "type": "array"
}
},
"required": [
@@ -647,11 +816,11 @@
"title": "HarpClockGenerator",
"type": "object"
},
- "HarpLickometer": {
+ "HarpEnvironmentSensor": {
"properties": {
"device_type": {
- "const": "lickometer",
- "default": "lickometer",
+ "const": "environmentsensor",
+ "default": "environmentsensor",
"title": "Device Type",
"type": "string"
},
@@ -680,8 +849,8 @@
]
},
"who_am_i": {
- "const": 1400,
- "default": 1400,
+ "const": 1405,
+ "default": 1405,
"title": "Who Am I",
"type": "integer"
},
@@ -707,15 +876,14 @@
"required": [
"port_name"
],
- "title": "HarpLickometer",
+ "title": "HarpEnvironmentSensor",
"type": "object"
},
- "HarpOlfactometer": {
- "description": "Overrides the default settings for the olfactometer calibration",
+ "HarpLickometer": {
"properties": {
"device_type": {
- "const": "olfactometer",
- "default": "olfactometer",
+ "const": "lickometer",
+ "default": "lickometer",
"title": "Device Type",
"type": "string"
},
@@ -733,10 +901,10 @@
},
"calibration": {
"default": null,
- "description": "Olfactometer calibration",
+ "description": "Calibration",
"oneOf": [
{
- "$ref": "#/definitions/OlfactometerCalibration"
+ "$ref": "#/definitions/BaseModel"
},
{
"type": "null"
@@ -744,8 +912,8 @@
]
},
"who_am_i": {
- "const": 1140,
- "default": 1140,
+ "const": 1400,
+ "default": 1400,
"title": "Who Am I",
"type": "integer"
},
@@ -771,14 +939,15 @@
"required": [
"port_name"
],
- "title": "HarpOlfactometer",
+ "title": "HarpLickometer",
"type": "object"
},
- "HarpSniffDetector": {
+ "HarpOlfactometer": {
+ "description": "Overrides the default settings for the olfactometer calibration",
"properties": {
"device_type": {
- "const": "sniffdetector",
- "default": "sniffdetector",
+ "const": "olfactometer",
+ "default": "olfactometer",
"title": "Device Type",
"type": "string"
},
@@ -795,20 +964,13 @@
]
},
"calibration": {
+ "$ref": "#/definitions/OlfactometerCalibration",
"default": null,
- "description": "Calibration",
- "oneOf": [
- {
- "$ref": "#/definitions/BaseModel"
- },
- {
- "type": "null"
- }
- ]
+ "description": "Olfactometer calibration"
},
"who_am_i": {
- "const": 1401,
- "default": 1401,
+ "const": 1140,
+ "default": 1140,
"title": "Who Am I",
"type": "integer"
},
@@ -834,15 +996,14 @@
"required": [
"port_name"
],
- "title": "HarpSniffDetector",
+ "title": "HarpOlfactometer",
"type": "object"
},
- "HarpTreadmill": {
- "description": "Overrides the default settings for the treadmill calibration",
+ "HarpSniffDetector": {
"properties": {
"device_type": {
- "const": "treadmill",
- "default": "treadmill",
+ "const": "sniffdetector",
+ "default": "sniffdetector",
"title": "Device Type",
"type": "string"
},
@@ -859,31 +1020,20 @@
]
},
"calibration": {
- "allOf": [
+ "default": null,
+ "description": "Calibration",
+ "oneOf": [
{
- "$ref": "#/definitions/Treadmill"
+ "$ref": "#/definitions/BaseModel"
+ },
+ {
+ "type": "null"
}
- ],
- "default": {
- "wheel_diameter": 15.0,
- "pulses_per_revolution": 28800,
- "invert_direction": false,
- "brake_lookup_calibration": [
- [
- 0.0,
- 0.0
- ],
- [
- 1.0,
- 65535.0
- ]
- ]
- },
- "description": "Treadmill calibration settings"
+ ]
},
"who_am_i": {
- "const": 1402,
- "default": 1402,
+ "const": 1401,
+ "default": 1401,
"title": "Who Am I",
"type": "integer"
},
@@ -909,7 +1059,7 @@
"required": [
"port_name"
],
- "title": "HarpTreadmill",
+ "title": "HarpSniffDetector",
"type": "object"
},
"ManipulatorPosition": {
@@ -1019,19 +1169,11 @@
"type": "string"
},
"input": {
- "allOf": [
- {
- "$ref": "#/definitions/OlfactometerCalibrationInput"
- }
- ],
+ "$ref": "#/definitions/OlfactometerCalibrationInput",
"title": "Input of the calibration"
},
"output": {
- "allOf": [
- {
- "$ref": "#/definitions/OlfactometerCalibrationOutput"
- }
- ],
+ "$ref": "#/definitions/OlfactometerCalibrationOutput",
"title": "Output of the calibration"
},
"date": {
@@ -1081,6 +1223,9 @@
},
"default": {},
"description": "Configuration of olfactometer channels",
+ "propertyNames": {
+ "$ref": "#/definitions/OlfactometerChannel"
+ },
"title": "Channel Config",
"type": "object"
}
@@ -1093,6 +1238,23 @@
"title": "OlfactometerCalibrationOutput",
"type": "object"
},
+ "OlfactometerChannel": {
+ "description": "Harp Olfactometer available channel",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "title": "OlfactometerChannel",
+ "type": "integer",
+ "x-enumNames": [
+ "Channel0",
+ "Channel1",
+ "Channel2",
+ "Channel3"
+ ]
+ },
"OlfactometerChannelConfig": {
"properties": {
"channel_index": {
@@ -1100,11 +1262,7 @@
"type": "integer"
},
"channel_type": {
- "allOf": [
- {
- "$ref": "#/definitions/OlfactometerChannelType"
- }
- ],
+ "$ref": "#/definitions/OlfactometerChannelType",
"default": "Odor",
"title": "Channel type"
},
@@ -1163,15 +1321,45 @@
"title": "OlfactometerChannelType",
"type": "string"
},
+ "Rect": {
+ "properties": {
+ "x": {
+ "default": 0,
+ "description": "X coordinate of the top-left corner",
+ "minimum": 0,
+ "title": "X",
+ "type": "integer"
+ },
+ "y": {
+ "default": 0,
+ "description": "Y coordinate of the top-left corner",
+ "minimum": 0,
+ "title": "Y",
+ "type": "integer"
+ },
+ "width": {
+ "default": 0,
+ "description": "Width of the rectangle",
+ "minimum": 0,
+ "title": "Width",
+ "type": "integer"
+ },
+ "height": {
+ "default": 0,
+ "description": "Height of the rectangle",
+ "minimum": 0,
+ "title": "Height",
+ "type": "integer"
+ }
+ },
+ "title": "Rect",
+ "type": "object"
+ },
"RigCalibration": {
"description": "Container class for calibration models. In a future release these will be moved to the respective devices",
"properties": {
"water_valve": {
- "allOf": [
- {
- "$ref": "#/definitions/WaterValveCalibration"
- }
- ],
+ "$ref": "#/definitions/WaterValveCalibration",
"description": "Water valve calibration"
}
},
@@ -1203,16 +1391,70 @@
]
},
"calibration": {
- "default": null,
- "description": "Calibration",
- "oneOf": [
- {
- "$ref": "#/definitions/BaseModel"
+ "$ref": "#/definitions/DisplaysCalibration",
+ "default": {
+ "left": {
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": -16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ },
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ }
},
- {
- "type": "null"
+ "center": {
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 0.0,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 0.0,
+ "y": 1.309016,
+ "z": -13.27
+ }
+ },
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ }
+ },
+ "right": {
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": -1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ },
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ }
}
- ]
+ },
+ "description": "Screen calibration"
},
"display_index": {
"default": 1,
@@ -1232,12 +1474,6 @@
"title": "Target Update Frequency",
"type": "number"
},
- "calibration_directory": {
- "default": "Calibration\\Monitors\\",
- "description": "Calibration directory",
- "title": "Calibration Directory",
- "type": "string"
- },
"texture_assets_directory": {
"default": "Textures",
"description": "Calibration directory",
@@ -1333,6 +1569,54 @@
"title": "Gain",
"type": "number"
},
+ "gamma": {
+ "default": null,
+ "description": "Gamma. If None, will disable gamma correction.",
+ "oneOf": [
+ {
+ "minimum": 0.0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Gamma"
+ },
+ "adc_bit_depth": {
+ "default": 0,
+ "description": "ADC bit depth. If None will be left as default.",
+ "oneOf": [
+ {
+ "$ref": "#/definitions/SpinnakerCameraAdcBitDepth"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "pixel_format": {
+ "default": 0,
+ "description": "Pixel format. If None will be left as default.",
+ "oneOf": [
+ {
+ "$ref": "#/definitions/SpinnakerCameraPixelFormat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "region_of_interest": {
+ "$ref": "#/definitions/Rect",
+ "default": {
+ "x": 0,
+ "y": 0,
+ "width": 0,
+ "height": 0
+ },
+ "description": "Region of interest"
+ },
"video_writer": {
"default": null,
"description": "Video writer. If not provided, no video will be saved.",
@@ -1352,8 +1636,441 @@
"title": "SpinnakerCamera",
"type": "object"
},
+ "SpinnakerCameraAdcBitDepth": {
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "title": "SpinnakerCameraAdcBitDepth",
+ "type": "integer",
+ "x-enumNames": [
+ "Adc8bit",
+ "Adc10bit",
+ "Adc12bit"
+ ]
+ },
+ "SpinnakerCameraPixelFormat": {
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15,
+ 16,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23,
+ 24,
+ 25,
+ 26,
+ 27,
+ 28,
+ 29,
+ 30,
+ 31,
+ 32,
+ 33,
+ 34,
+ 35,
+ 36,
+ 37,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 46,
+ 47,
+ 48,
+ 49,
+ 50,
+ 51,
+ 52,
+ 53,
+ 54,
+ 55,
+ 56,
+ 57,
+ 58,
+ 59,
+ 60,
+ 61,
+ 62,
+ 63,
+ 64,
+ 65,
+ 66,
+ 67,
+ 68,
+ 69,
+ 70,
+ 71,
+ 72,
+ 73,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 82,
+ 83,
+ 84,
+ 85,
+ 86,
+ 87,
+ 88,
+ 89,
+ 90,
+ 91,
+ 92,
+ 93,
+ 94,
+ 95,
+ 96,
+ 97,
+ 98,
+ 99,
+ 100,
+ 101,
+ 102,
+ 103,
+ 104,
+ 105,
+ 106,
+ 107,
+ 108,
+ 109,
+ 110,
+ 111,
+ 112,
+ 113,
+ 114,
+ 115,
+ 116,
+ 117,
+ 118,
+ 119,
+ 120,
+ 121,
+ 122,
+ 123,
+ 124,
+ 125,
+ 126,
+ 127,
+ 128,
+ 129,
+ 130,
+ 131,
+ 132,
+ 133,
+ 134,
+ 135,
+ 136,
+ 137,
+ 138,
+ 139,
+ 140,
+ 141,
+ 142,
+ 143
+ ],
+ "title": "SpinnakerCameraPixelFormat",
+ "type": "integer",
+ "x-enumNames": [
+ "Mono8",
+ "Mono16",
+ "Rgb8packed",
+ "Bayergr8",
+ "Bayerrg8",
+ "Bayergb8",
+ "Bayerbg8",
+ "Bayergr16",
+ "Bayerrg16",
+ "Bayergb16",
+ "Bayerbg16",
+ "Mono12packed",
+ "Bayergr12packed",
+ "Bayerrg12packed",
+ "Bayergb12packed",
+ "Bayerbg12packed",
+ "Yuv411packed",
+ "Yuv422packed",
+ "Yuv444packed",
+ "Mono12p",
+ "Bayergr12p",
+ "Bayerrg12p",
+ "Bayergb12p",
+ "Bayerbg12p",
+ "Ycbcr8",
+ "Ycbcr4228",
+ "Ycbcr4118",
+ "Bgr8",
+ "Bgra8",
+ "Mono10packed",
+ "Bayergr10packed",
+ "Bayerrg10packed",
+ "Bayergb10packed",
+ "Bayerbg10packed",
+ "Mono10p",
+ "Bayergr10p",
+ "Bayerrg10p",
+ "Bayergb10p",
+ "Bayerbg10p",
+ "Mono1p",
+ "Mono2p",
+ "Mono4p",
+ "Mono8s",
+ "Mono10",
+ "Mono12",
+ "Mono14",
+ "Mono16s",
+ "Mono32f",
+ "Bayerbg10",
+ "Bayerbg12",
+ "Bayergb10",
+ "Bayergb12",
+ "Bayergr10",
+ "Bayergr12",
+ "Bayerrg10",
+ "Bayerrg12",
+ "Rgba8",
+ "Rgba10",
+ "Rgba10p",
+ "Rgba12",
+ "Rgba12p",
+ "Rgba14",
+ "Rgba16",
+ "Rgb8",
+ "Rgb8Planar",
+ "Rgb10",
+ "Rgb10Planar",
+ "Rgb10p",
+ "Rgb10p32",
+ "Rgb12",
+ "Rgb12Planar",
+ "Rgb12p",
+ "Rgb14",
+ "Rgb16",
+ "Rgb16s",
+ "Rgb32f",
+ "Rgb16Planar",
+ "Rgb565p",
+ "Bgra10",
+ "Bgra10p",
+ "Bgra12",
+ "Bgra12p",
+ "Bgra14",
+ "Bgra16",
+ "Rgba32f",
+ "Bgr10",
+ "Bgr10p",
+ "Bgr12",
+ "Bgr12p",
+ "Bgr14",
+ "Bgr16",
+ "Bgr565p",
+ "R8",
+ "R10",
+ "R12",
+ "R16",
+ "G8",
+ "G10",
+ "G12",
+ "G16",
+ "B8",
+ "B10",
+ "B12",
+ "B16",
+ "Coord3dAbc8",
+ "Coord3dAbc8Planar",
+ "Coord3dAbc10p",
+ "Coord3dAbc10pPlanar",
+ "Coord3dAbc12p",
+ "Coord3dAbc12pPlanar",
+ "Coord3dAbc16",
+ "Coord3dAbc16Planar",
+ "Coord3dAbc32f",
+ "Coord3dAbc32fPlanar",
+ "Coord3dAc8",
+ "Coord3dAc8Planar",
+ "Coord3dAc10p",
+ "Coord3dAc10pPlanar",
+ "Coord3dAc12p",
+ "Coord3dAc12pPlanar",
+ "Coord3dAc16",
+ "Coord3dAc16Planar",
+ "Coord3dAc32f",
+ "Coord3dAc32fPlanar",
+ "Coord3dA8",
+ "Coord3dA10p",
+ "Coord3dA12p",
+ "Coord3dA16",
+ "Coord3dA32f",
+ "Coord3dB8",
+ "Coord3dB10p",
+ "Coord3dB12p",
+ "Coord3dB16",
+ "Coord3dB32f",
+ "Coord3dC8",
+ "Coord3dC10p",
+ "Coord3dC12p",
+ "Coord3dC16",
+ "Coord3dC32f",
+ "Confidence1",
+ "Confidence1p",
+ "Confidence8",
+ "Confidence16",
+ "Confidence32f"
+ ]
+ },
"Treadmill": {
- "description": "Overrides the default settings for the treadmill calibration by spec'ing brake_lookup_calibration field",
+ "properties": {
+ "device_type": {
+ "const": "treadmill",
+ "default": "treadmill",
+ "title": "Device Type",
+ "type": "string"
+ },
+ "additional_settings": {
+ "default": null,
+ "description": "Additional settings",
+ "oneOf": [
+ {
+ "$ref": "#/definitions/BaseModel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "calibration": {
+ "default": null,
+ "oneOf": [
+ {
+ "$ref": "#/definitions/TreadmillCalibration"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Calibration of the treadmill"
+ },
+ "who_am_i": {
+ "const": 1402,
+ "default": 1402,
+ "title": "Who Am I",
+ "type": "integer"
+ },
+ "serial_number": {
+ "default": null,
+ "description": "Device serial number",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Serial Number"
+ },
+ "port_name": {
+ "description": "Device port name",
+ "title": "Port Name",
+ "type": "string"
+ }
+ },
+ "required": [
+ "port_name"
+ ],
+ "title": "Treadmill",
+ "type": "object"
+ },
+ "TreadmillCalibration": {
+ "description": "Treadmill calibration class",
+ "properties": {
+ "device_name": {
+ "default": "Treadmill",
+ "description": "Must match a device name in rig/instrument",
+ "title": "Device name",
+ "type": "string"
+ },
+ "input": {
+ "$ref": "#/definitions/TreadmillCalibrationInput",
+ "title": "Input of the calibration"
+ },
+ "output": {
+ "$ref": "#/definitions/TreadmillCalibrationOutput",
+ "title": "Output of the calibration."
+ },
+ "date": {
+ "default": null,
+ "oneOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Date"
+ },
+ "description": {
+ "const": "Calibration of the treadmill system",
+ "default": "Calibration of the treadmill system",
+ "title": "Description",
+ "type": "string"
+ },
+ "notes": {
+ "default": null,
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Notes"
+ }
+ },
+ "required": [
+ "input",
+ "output"
+ ],
+ "title": "TreadmillCalibration",
+ "type": "object"
+ },
+ "TreadmillCalibrationInput": {
+ "properties": {},
+ "title": "TreadmillCalibrationInput",
+ "type": "object"
+ },
+ "TreadmillCalibrationOutput": {
"properties": {
"wheel_diameter": {
"default": 15,
@@ -1376,19 +2093,8 @@
"type": "boolean"
},
"brake_lookup_calibration": {
- "default": [
- [
- 0,
- 0
- ],
- [
- 1,
- 65535
- ]
- ],
- "description": "Brake lookup calibration. Each Tuple is (0-1 (percent), 0-full-scale). Values are linearly interpolated",
+ "description": "Brake lookup calibration. Each pair of values define (input [torque], output [brake set-point U16])",
"items": {
- "description": "A tuple of two values",
"items": {
"type": "number"
},
@@ -1401,7 +2107,34 @@
"type": "array"
}
},
- "title": "Treadmill",
+ "required": [
+ "brake_lookup_calibration"
+ ],
+ "title": "TreadmillCalibrationOutput",
+ "type": "object"
+ },
+ "Vector3": {
+ "properties": {
+ "x": {
+ "default": 0,
+ "description": "X coordinate of the point",
+ "title": "X",
+ "type": "number"
+ },
+ "y": {
+ "default": 0,
+ "description": "Y coordinate of the point",
+ "title": "Y",
+ "type": "number"
+ },
+ "z": {
+ "default": 0,
+ "description": "Z coordinate of the point",
+ "title": "Z",
+ "type": "number"
+ }
+ },
+ "title": "Vector3",
"type": "object"
},
"VideoWriter": {
@@ -1419,8 +2152,7 @@
{
"$ref": "#/definitions/VideoWriterOpenCv"
}
- ],
- "title": "VideoWriter"
+ ]
},
"VideoWriterFfmpeg": {
"properties": {
@@ -1444,10 +2176,16 @@
"type": "string"
},
"output_arguments": {
- "default": "-c:v hevc_nvenc -pix_fmt x2rgb10le -color_range full -tune hq -preset p3 -rc vbr -cq 16 -rc-lookahead 56 -temporal-aq 1 -qmin 0 -qmax 10",
+ "default": "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M",
"description": "Output arguments",
"title": "Output Arguments",
"type": "string"
+ },
+ "input_arguments": {
+ "default": "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear",
+ "description": "Input arguments",
+ "title": "Input Arguments",
+ "type": "string"
}
},
"title": "VideoWriterFfmpeg",
@@ -1494,19 +2232,11 @@
"type": "string"
},
"input": {
- "allOf": [
- {
- "$ref": "#/definitions/WaterValveCalibrationInput"
- }
- ],
+ "$ref": "#/definitions/WaterValveCalibrationInput",
"title": "Input of the calibration"
},
"output": {
- "allOf": [
- {
- "$ref": "#/definitions/WaterValveCalibrationOutput"
- }
- ],
+ "$ref": "#/definitions/WaterValveCalibrationOutput",
"title": "Output of the calibration."
},
"date": {
@@ -1692,9 +2422,15 @@
}
},
"properties": {
+ "aind_behavior_services_pkg_version": {
+ "default": "0.9.0",
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
+ "title": "aind_behavior_services package version",
+ "type": "string"
+ },
"version": {
- "const": "0.3.0",
- "default": "0.3.0",
+ "const": "0.4.0",
+ "default": "0.4.0",
"title": "Version",
"type": "string"
},
@@ -1709,11 +2445,7 @@
"type": "string"
},
"triggered_camera_controller": {
- "allOf": [
- {
- "$ref": "#/definitions/CameraController_SpinnakerCamera_"
- }
- ],
+ "$ref": "#/definitions/CameraController_SpinnakerCamera_",
"description": "Required camera controller to triggered cameras."
},
"monitoring_camera_controller": {
@@ -1729,35 +2461,19 @@
]
},
"harp_behavior": {
- "allOf": [
- {
- "$ref": "#/definitions/HarpBehavior"
- }
- ],
+ "$ref": "#/definitions/HarpBehavior",
"description": "Harp behavior"
},
"harp_olfactometer": {
- "allOf": [
- {
- "$ref": "#/definitions/HarpOlfactometer"
- }
- ],
+ "$ref": "#/definitions/HarpOlfactometer",
"description": "Harp olfactometer"
},
"harp_lickometer": {
- "allOf": [
- {
- "$ref": "#/definitions/HarpLickometer"
- }
- ],
+ "$ref": "#/definitions/HarpLickometer",
"description": "Harp lickometer"
},
"harp_clock_generator": {
- "allOf": [
- {
- "$ref": "#/definitions/HarpClockGenerator"
- }
- ],
+ "$ref": "#/definitions/HarpClockGenerator",
"description": "Harp clock generator"
},
"harp_clock_repeaters": {
@@ -1782,11 +2498,7 @@
]
},
"harp_treadmill": {
- "allOf": [
- {
- "$ref": "#/definitions/HarpTreadmill"
- }
- ],
+ "$ref": "#/definitions/Treadmill",
"description": "Harp treadmill"
},
"harp_sniff_detector": {
@@ -1801,28 +2513,92 @@
}
]
},
- "manipulator": {
- "allOf": [
+ "harp_environment_sensor": {
+ "default": null,
+ "description": "Environment sensor",
+ "oneOf": [
+ {
+ "$ref": "#/definitions/HarpEnvironmentSensor"
+ },
{
- "$ref": "#/definitions/AindManipulatorDevice"
+ "type": "null"
}
- ],
+ ]
+ },
+ "manipulator": {
+ "$ref": "#/definitions/AindManipulatorDevice",
"description": "Manipulator"
},
"screen": {
- "allOf": [
- {
- "$ref": "#/definitions/Screen"
- }
- ],
+ "$ref": "#/definitions/Screen",
"default": {
"device_type": "Screen",
"additional_settings": null,
- "calibration": null,
+ "calibration": {
+ "center": {
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 0.0,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 0.0,
+ "y": 1.309016,
+ "z": -13.27
+ }
+ },
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ }
+ },
+ "left": {
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": 1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": -16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ },
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ }
+ },
+ "right": {
+ "extrinsics": {
+ "rotation": {
+ "x": 0.0,
+ "y": -1.0472,
+ "z": 0.0
+ },
+ "translation": {
+ "x": 16.6917756,
+ "y": 1.309016,
+ "z": -3.575264
+ }
+ },
+ "intrinsics": {
+ "display_height": 15.0,
+ "display_width": 20.0,
+ "frame_height": 1080,
+ "frame_width": 1920
+ }
+ }
+ },
"display_index": 1,
"target_render_frequency": 60.0,
"target_update_frequency": 120.0,
- "calibration_directory": "Calibration\\Monitors\\",
"texture_assets_directory": "Textures",
"brightness": 0.0,
"contrast": 1.0
@@ -1830,11 +2606,7 @@
"description": "Screen settings"
},
"calibration": {
- "allOf": [
- {
- "$ref": "#/definitions/RigCalibration"
- }
- ],
+ "$ref": "#/definitions/RigCalibration",
"description": "Calibration models"
}
},
diff --git a/src/DataSchemas/aind_vr_foraging_task_logic.json b/src/DataSchemas/aind_vr_foraging_task_logic.json
index c17260e2..4afd5486 100644
--- a/src/DataSchemas/aind_vr_foraging_task_logic.json
+++ b/src/DataSchemas/aind_vr_foraging_task_logic.json
@@ -16,6 +16,12 @@
],
"title": "Rng Seed"
},
+ "aind_behavior_services_pkg_version": {
+ "default": "0.9.0",
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
+ "title": "aind_behavior_services package version",
+ "type": "string"
+ },
"updaters": {
"additionalProperties": {
"$ref": "#/definitions/NumericalUpdater"
@@ -24,36 +30,24 @@
"title": "Updaters",
"type": "object"
},
- "environment_statistics": {
- "allOf": [
- {
- "$ref": "#/definitions/EnvironmentStatistics"
- }
- ],
+ "environment": {
+ "$ref": "#/definitions/BlockStructure",
"description": "Statistics of the environment"
},
"task_mode_settings": {
- "allOf": [
- {
- "$ref": "#/definitions/TaskModeSettings"
- }
- ],
+ "$ref": "#/definitions/TaskModeSettings",
"default": {
"task_mode": "FORAGING"
},
"description": "Settings of the task stage"
},
"operation_control": {
- "allOf": [
- {
- "$ref": "#/definitions/OperationControl"
- }
- ],
+ "$ref": "#/definitions/OperationControl",
"description": "Control of the operation"
}
},
"required": [
- "environment_statistics",
+ "environment",
"operation_control"
],
"title": "AindVrForagingTaskParameters",
@@ -88,11 +82,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/BetaDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/BetaDistributionParameters",
"default": {
"family": "Beta",
"alpha": 5.0,
@@ -163,11 +153,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/BinomialDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/BinomialDistributionParameters",
"default": {
"family": "Binomial",
"n": 1,
@@ -230,6 +216,181 @@
"title": "BinomialDistributionParameters",
"type": "object"
},
+ "Block": {
+ "properties": {
+ "environment_statistics": {
+ "$ref": "#/definitions/EnvironmentStatistics",
+ "description": "Statistics of the environment"
+ },
+ "end_conditions": {
+ "default": [],
+ "description": "List of end conditions that must be true for the block to end.",
+ "items": {
+ "$ref": "#/definitions/BlockEndCondition"
+ },
+ "title": "End Conditions",
+ "type": "array"
+ }
+ },
+ "required": [
+ "environment_statistics"
+ ],
+ "title": "Block",
+ "type": "object"
+ },
+ "BlockEndCondition": {
+ "discriminator": {
+ "mapping": {
+ "Choice": "#/definitions/BlockEndConditionChoice",
+ "Distance": "#/definitions/BlockEndConditionDistance",
+ "Duration": "#/definitions/BlockEndConditionDuration",
+ "PatchCount": "#/definitions/BlockEndConditionPatchCount",
+ "Reward": "#/definitions/BlockEndConditionReward"
+ },
+ "propertyName": "condition_type"
+ },
+ "oneOf": [
+ {
+ "$ref": "#/definitions/BlockEndConditionDuration"
+ },
+ {
+ "$ref": "#/definitions/BlockEndConditionDistance"
+ },
+ {
+ "$ref": "#/definitions/BlockEndConditionChoice"
+ },
+ {
+ "$ref": "#/definitions/BlockEndConditionReward"
+ },
+ {
+ "$ref": "#/definitions/BlockEndConditionPatchCount"
+ }
+ ],
+ "title": "BlockEndCondition"
+ },
+ "BlockEndConditionChoice": {
+ "properties": {
+ "condition_type": {
+ "const": "Choice",
+ "default": "Choice",
+ "title": "Condition Type",
+ "type": "string"
+ },
+ "value": {
+ "$ref": "#/definitions/Distribution",
+ "description": "Number of choices after which the block ends."
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "title": "BlockEndConditionChoice",
+ "type": "object"
+ },
+ "BlockEndConditionDistance": {
+ "properties": {
+ "condition_type": {
+ "const": "Distance",
+ "default": "Distance",
+ "title": "Condition Type",
+ "type": "string"
+ },
+ "value": {
+ "$ref": "#/definitions/Distribution",
+ "description": "Distance after which the block ends."
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "title": "BlockEndConditionDistance",
+ "type": "object"
+ },
+ "BlockEndConditionDuration": {
+ "properties": {
+ "condition_type": {
+ "const": "Duration",
+ "default": "Duration",
+ "title": "Condition Type",
+ "type": "string"
+ },
+ "value": {
+ "$ref": "#/definitions/Distribution",
+ "description": "Time after which the block ends."
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "title": "BlockEndConditionDuration",
+ "type": "object"
+ },
+ "BlockEndConditionPatchCount": {
+ "properties": {
+ "condition_type": {
+ "const": "PatchCount",
+ "default": "PatchCount",
+ "title": "Condition Type",
+ "type": "string"
+ },
+ "value": {
+ "$ref": "#/definitions/Distribution",
+ "description": "Number of patches after which the block will end."
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "title": "BlockEndConditionPatchCount",
+ "type": "object"
+ },
+ "BlockEndConditionReward": {
+ "properties": {
+ "condition_type": {
+ "const": "Reward",
+ "default": "Reward",
+ "title": "Condition Type",
+ "type": "string"
+ },
+ "value": {
+ "$ref": "#/definitions/Distribution",
+ "description": "Number of rewards after which the block ends."
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "title": "BlockEndConditionReward",
+ "type": "object"
+ },
+ "BlockStructure": {
+ "properties": {
+ "blocks": {
+ "description": "Statistics of the environment",
+ "items": {
+ "$ref": "#/definitions/Block"
+ },
+ "minItems": 1,
+ "title": "Blocks",
+ "type": "array"
+ },
+ "sampling_mode": {
+ "default": "Sequential",
+ "description": "Sampling mode of the blocks.",
+ "enum": [
+ "Random",
+ "Sequential"
+ ],
+ "title": "Sampling Mode",
+ "type": "string"
+ }
+ },
+ "required": [
+ "blocks"
+ ],
+ "title": "BlockStructure",
+ "type": "object"
+ },
"ConstantFunction": {
"properties": {
"function_type": {
@@ -290,7 +451,6 @@
"type": "string"
},
"Distribution": {
- "description": "Available distributions",
"discriminator": {
"mapping": {
"Beta": "#/definitions/BetaDistribution",
@@ -299,6 +459,7 @@
"Gamma": "#/definitions/GammaDistribution",
"LogNormal": "#/definitions/LogNormalDistribution",
"Normal": "#/definitions/NormalDistribution",
+ "Pdf": "#/definitions/PdfDistribution",
"Poisson": "#/definitions/PoissonDistribution",
"Scalar": "#/definitions/Scalar",
"Uniform": "#/definitions/UniformDistribution"
@@ -332,9 +493,11 @@
},
{
"$ref": "#/definitions/GammaDistribution"
+ },
+ {
+ "$ref": "#/definitions/PdfDistribution"
}
- ],
- "title": "Distribution"
+ ]
},
"EnvironmentStatistics": {
"properties": {
@@ -394,11 +557,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/ExponentialDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/ExponentialDistributionParameters",
"default": {
"family": "Exponential",
"rate": 0.0
@@ -473,11 +632,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/GammaDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/GammaDistributionParameters",
"default": {
"family": "Gamma",
"shape": 1.0,
@@ -548,19 +703,11 @@
"type": "string"
},
"distance_to_reward": {
- "allOf": [
- {
- "$ref": "#/definitions/Distribution"
- }
- ],
+ "$ref": "#/definitions/Distribution",
"description": "Distance (cm) to the reward"
},
"render_specification": {
- "allOf": [
- {
- "$ref": "#/definitions/RenderSpecification"
- }
- ],
+ "$ref": "#/definitions/RenderSpecification",
"default": {
"contrast": null
},
@@ -581,10 +728,10 @@
"title": "Function Type",
"type": "string"
},
- "mininum": {
+ "minimum": {
"default": 0,
"description": "Minimum value of the function",
- "title": "Mininum",
+ "title": "Minimum",
"type": "number"
},
"maximum": {
@@ -618,11 +765,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/LogNormalDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/LogNormalDistributionParameters",
"default": {
"family": "LogNormal",
"mean": 0.0,
@@ -682,6 +825,40 @@
"title": "LogNormalDistributionParameters",
"type": "object"
},
+ "LookupTableFunction": {
+ "properties": {
+ "function_type": {
+ "const": "LookupTableFunction",
+ "default": "LookupTableFunction",
+ "title": "Function Type",
+ "type": "string"
+ },
+ "lut_keys": {
+ "description": "List of keys of the lookup table",
+ "items": {
+ "type": "number"
+ },
+ "minItems": 1,
+ "title": "Lut Keys",
+ "type": "array"
+ },
+ "lut_values": {
+ "description": "List of values of the lookup table",
+ "items": {
+ "type": "number"
+ },
+ "minItems": 1,
+ "title": "Lut Values",
+ "type": "array"
+ }
+ },
+ "required": [
+ "lut_keys",
+ "lut_values"
+ ],
+ "title": "LookupTableFunction",
+ "type": "object"
+ },
"MovableSpoutControl": {
"properties": {
"enabled": {
@@ -717,11 +894,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/NormalDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/NormalDistributionParameters",
"default": {
"family": "Normal",
"mean": 0.0,
@@ -784,20 +957,12 @@
"NumericalUpdater": {
"properties": {
"operation": {
- "allOf": [
- {
- "$ref": "#/definitions/NumericalUpdaterOperation"
- }
- ],
+ "$ref": "#/definitions/NumericalUpdaterOperation",
"default": "None",
"description": "Operation to perform on the parameter"
},
"parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/NumericalUpdaterParameters"
- }
- ],
+ "$ref": "#/definitions/NumericalUpdaterParameters",
"default": {
"initial_value": 0.0,
"increment": 0.0,
@@ -953,11 +1118,7 @@
"OperationControl": {
"properties": {
"movable_spout_control": {
- "allOf": [
- {
- "$ref": "#/definitions/MovableSpoutControl"
- }
- ],
+ "$ref": "#/definitions/MovableSpoutControl",
"default": {
"enabled": false,
"time_to_collect_after_reward": 1.0,
@@ -966,11 +1127,7 @@
"description": "Control of the movable spout"
},
"odor_control": {
- "allOf": [
- {
- "$ref": "#/definitions/OdorControl"
- }
- ],
+ "$ref": "#/definitions/OdorControl",
"default": {
"valve_max_open_time": 10.0,
"target_total_flow": 1000.0,
@@ -980,11 +1137,7 @@
"description": "Control of the odor"
},
"position_control": {
- "allOf": [
- {
- "$ref": "#/definitions/PositionControl"
- }
- ],
+ "$ref": "#/definitions/PositionControl",
"default": {
"gain": {
"x": 1.0,
@@ -1002,11 +1155,7 @@
"description": "Control of the position"
},
"audio_control": {
- "allOf": [
- {
- "$ref": "#/definitions/AudioControl"
- }
- ],
+ "$ref": "#/definitions/AudioControl",
"default": {
"duration": 0.2,
"frequency": 1000.0
@@ -1020,11 +1169,7 @@
"PatchRewardFunction": {
"properties": {
"amount": {
- "allOf": [
- {
- "$ref": "#/definitions/RewardFunction"
- }
- ],
+ "$ref": "#/definitions/RewardFunction",
"default": {
"function_type": "ConstantFunction",
"value": 1.0
@@ -1032,11 +1177,7 @@
"description": "Determines the amount of reward to be delivered. The value is in microliters"
},
"probability": {
- "allOf": [
- {
- "$ref": "#/definitions/RewardFunction"
- }
- ],
+ "$ref": "#/definitions/RewardFunction",
"default": {
"function_type": "ConstantFunction",
"value": 1.0
@@ -1044,14 +1185,10 @@
"description": "Determines the probability that a reward will be delivered"
},
"available": {
- "allOf": [
- {
- "$ref": "#/definitions/RewardFunction"
- }
- ],
+ "$ref": "#/definitions/RewardFunction",
"default": {
"function_type": "LinearFunction",
- "mininum": 0.0,
+ "minimum": 0.0,
"maximum": 9999.0,
"a": -1.0,
"b": 5.0
@@ -1059,11 +1196,7 @@
"description": "Determines the total amount of reward available left in the patch. The value is in microliters"
},
"depletion_rule": {
- "allOf": [
- {
- "$ref": "#/definitions/DepletionRule"
- }
- ],
+ "$ref": "#/definitions/DepletionRule",
"default": "OnChoice",
"description": "Depletion"
}
@@ -1111,11 +1244,7 @@
]
},
"virtual_site_generation": {
- "allOf": [
- {
- "$ref": "#/definitions/VirtualSiteGeneration"
- }
- ],
+ "$ref": "#/definitions/VirtualSiteGeneration",
"default": {
"inter_site": {
"label": "InterSite",
@@ -1173,20 +1302,100 @@
"title": "PatchStatistics",
"type": "object"
},
- "PoissonDistribution": {
+ "PdfDistribution": {
"properties": {
"family": {
- "const": "Poisson",
- "default": "Poisson",
+ "const": "Pdf",
+ "default": "Pdf",
"title": "Family",
"type": "string"
},
"distribution_parameters": {
- "allOf": [
+ "$ref": "#/definitions/PdfDistributionParameters",
+ "default": {
+ "family": "Pdf",
+ "pdf": [
+ 1.0
+ ],
+ "index": [
+ 0.0
+ ]
+ },
+ "description": "Parameters of the distribution"
+ },
+ "truncation_parameters": {
+ "default": null,
+ "description": "Truncation parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/definitions/TruncationParameters"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "scaling_parameters": {
+ "default": null,
+ "description": "Scaling parameters of the distribution",
+ "oneOf": [
+ {
+ "$ref": "#/definitions/ScalingParameters"
+ },
{
- "$ref": "#/definitions/PoissonDistributionParameters"
+ "type": "null"
}
+ ]
+ }
+ },
+ "title": "PdfDistribution",
+ "type": "object"
+ },
+ "PdfDistributionParameters": {
+ "properties": {
+ "family": {
+ "const": "Pdf",
+ "default": "Pdf",
+ "title": "Family",
+ "type": "string"
+ },
+ "pdf": {
+ "default": [
+ 1
+ ],
+ "description": "The probability density function",
+ "items": {
+ "minimum": 0.0,
+ "type": "number"
+ },
+ "title": "Pdf",
+ "type": "array"
+ },
+ "index": {
+ "default": [
+ 0
],
+ "description": "The index of the probability density function",
+ "items": {
+ "type": "number"
+ },
+ "title": "Index",
+ "type": "array"
+ }
+ },
+ "title": "PdfDistributionParameters",
+ "type": "object"
+ },
+ "PoissonDistribution": {
+ "properties": {
+ "family": {
+ "const": "Poisson",
+ "default": "Poisson",
+ "title": "Family",
+ "type": "string"
+ },
+ "distribution_parameters": {
+ "$ref": "#/definitions/PoissonDistributionParameters",
"default": {
"family": "Poisson",
"rate": 1.0
@@ -1243,11 +1452,7 @@
"PositionControl": {
"properties": {
"gain": {
- "allOf": [
- {
- "$ref": "#/definitions/Vector3"
- }
- ],
+ "$ref": "#/definitions/Vector3",
"default": {
"x": 1.0,
"y": 1.0,
@@ -1256,11 +1461,7 @@
"description": "Gain of the position control."
},
"initial_position": {
- "allOf": [
- {
- "$ref": "#/definitions/Vector3"
- }
- ],
+ "$ref": "#/definitions/Vector3",
"default": {
"x": 0.0,
"y": 2.56,
@@ -1295,10 +1496,10 @@
"title": "Function Type",
"type": "string"
},
- "mininum": {
+ "minimum": {
"default": 0,
"description": "Minimum value of the function",
- "title": "Mininum",
+ "title": "Minimum",
"type": "number"
},
"maximum": {
@@ -1361,6 +1562,7 @@
"mapping": {
"ConstantFunction": "#/definitions/ConstantFunction",
"LinearFunction": "#/definitions/LinearFunction",
+ "LookupTableFunction": "#/definitions/LookupTableFunction",
"PowerFunction": "#/definitions/PowerFunction"
},
"propertyName": "function_type"
@@ -1374,6 +1576,9 @@
},
{
"$ref": "#/definitions/PowerFunction"
+ },
+ {
+ "$ref": "#/definitions/LookupTableFunction"
}
],
"title": "RewardFunction"
@@ -1393,11 +1598,7 @@
]
},
"delay": {
- "allOf": [
- {
- "$ref": "#/definitions/Distribution"
- }
- ],
+ "$ref": "#/definitions/Distribution",
"default": {
"family": "Scalar",
"distribution_parameters": {
@@ -1410,11 +1611,7 @@
"description": "The optional distribution where the delay to reward will be drawn from"
},
"reward_function": {
- "allOf": [
- {
- "$ref": "#/definitions/PatchRewardFunction"
- }
- ],
+ "$ref": "#/definitions/PatchRewardFunction",
"default": {
"amount": {
"function_type": "ConstantFunction",
@@ -1429,7 +1626,7 @@
"b": 5.0,
"function_type": "LinearFunction",
"maximum": 9999.0,
- "mininum": 0.0
+ "minimum": 0.0
},
"depletion_rule": "OnChoice"
},
@@ -1448,11 +1645,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/ScalarDistributionParameter"
- }
- ],
+ "$ref": "#/definitions/ScalarDistributionParameter",
"default": {
"family": "Scalar",
"value": 0.0
@@ -1560,11 +1753,7 @@
"type": "string"
},
"size": {
- "allOf": [
- {
- "$ref": "#/definitions/Size"
- }
- ],
+ "$ref": "#/definitions/Size",
"default": {
"width": 40.0,
"height": 40.0
@@ -1626,11 +1815,7 @@
"type": "string"
},
"distribution_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/UniformDistributionParameters"
- }
- ],
+ "$ref": "#/definitions/UniformDistributionParameters",
"default": {
"family": "Uniform",
"min": 0.0,
@@ -1724,11 +1909,7 @@
"type": "integer"
},
"label": {
- "allOf": [
- {
- "$ref": "#/definitions/VirtualSiteLabels"
- }
- ],
+ "$ref": "#/definitions/VirtualSiteLabels",
"default": "Unspecified",
"description": "Label of the virtual site"
},
@@ -1770,11 +1951,7 @@
]
},
"render_specification": {
- "allOf": [
- {
- "$ref": "#/definitions/RenderSpecification"
- }
- ],
+ "$ref": "#/definitions/RenderSpecification",
"default": {
"contrast": null
},
@@ -1799,11 +1976,7 @@
"VirtualSiteGeneration": {
"properties": {
"inter_site": {
- "allOf": [
- {
- "$ref": "#/definitions/VirtualSiteGenerator"
- }
- ],
+ "$ref": "#/definitions/VirtualSiteGenerator",
"default": {
"render_specification": {
"contrast": null
@@ -1823,11 +1996,7 @@
"description": "Generator of the inter-site virtual sites"
},
"inter_patch": {
- "allOf": [
- {
- "$ref": "#/definitions/VirtualSiteGenerator"
- }
- ],
+ "$ref": "#/definitions/VirtualSiteGenerator",
"default": {
"render_specification": {
"contrast": null
@@ -1859,11 +2028,7 @@
]
},
"reward_site": {
- "allOf": [
- {
- "$ref": "#/definitions/VirtualSiteGenerator"
- }
- ],
+ "$ref": "#/definitions/VirtualSiteGenerator",
"default": {
"render_specification": {
"contrast": null
@@ -1889,31 +2054,19 @@
"VirtualSiteGenerator": {
"properties": {
"render_specification": {
- "allOf": [
- {
- "$ref": "#/definitions/RenderSpecification"
- }
- ],
+ "$ref": "#/definitions/RenderSpecification",
"default": {
"contrast": null
},
"description": "Contrast of the environment"
},
"label": {
- "allOf": [
- {
- "$ref": "#/definitions/VirtualSiteLabels"
- }
- ],
+ "$ref": "#/definitions/VirtualSiteLabels",
"default": "Unspecified",
"description": "Label of the virtual site"
},
"length_distribution": {
- "allOf": [
- {
- "$ref": "#/definitions/Distribution"
- }
- ],
+ "$ref": "#/definitions/Distribution",
"default": {
"family": "Scalar",
"distribution_parameters": {
@@ -1962,11 +2115,7 @@
"type": "integer"
},
"size": {
- "allOf": [
- {
- "$ref": "#/definitions/Size"
- }
- ],
+ "$ref": "#/definitions/Size",
"default": {
"width": 40.0,
"height": 40.0
@@ -1988,11 +2137,7 @@
"type": "number"
},
"textures": {
- "allOf": [
- {
- "$ref": "#/definitions/WallTextures"
- }
- ],
+ "$ref": "#/definitions/WallTextures",
"description": "The textures of the corridor"
}
},
@@ -2005,35 +2150,19 @@
"WallTextures": {
"properties": {
"floor": {
- "allOf": [
- {
- "$ref": "#/definitions/Texture"
- }
- ],
+ "$ref": "#/definitions/Texture",
"description": "The texture of the floor"
},
"ceiling": {
- "allOf": [
- {
- "$ref": "#/definitions/Texture"
- }
- ],
+ "$ref": "#/definitions/Texture",
"description": "The texture of the ceiling"
},
"left": {
- "allOf": [
- {
- "$ref": "#/definitions/Texture"
- }
- ],
+ "$ref": "#/definitions/Texture",
"description": "The texture of the left"
},
"right": {
- "allOf": [
- {
- "$ref": "#/definitions/Texture"
- }
- ],
+ "$ref": "#/definitions/Texture",
"description": "The texture of the right"
}
},
@@ -2050,6 +2179,7 @@
"additionalProperties": false,
"properties": {
"name": {
+ "const": "AindVrForaging",
"default": "AindVrForaging",
"description": "Name of the task logic",
"title": "Name",
@@ -2062,16 +2192,12 @@
"type": "string"
},
"task_parameters": {
- "allOf": [
- {
- "$ref": "#/definitions/AindVrForagingTaskParameters"
- }
- ],
+ "$ref": "#/definitions/AindVrForagingTaskParameters",
"description": "Parameters of the task logic"
},
"version": {
- "const": "0.4.0",
- "default": "0.4.0",
+ "const": "0.5.0",
+ "default": "0.5.0",
"title": "Version",
"type": "string"
},
diff --git a/src/Extensions.csproj b/src/Extensions.csproj
index 24de266a..5a8efe51 100644
--- a/src/Extensions.csproj
+++ b/src/Extensions.csproj
@@ -1,15 +1,15 @@
- net472
+ net48
true
-
+
-
+
\ No newline at end of file
diff --git a/src/Extensions/AindBehaviorSessionModel.cs b/src/Extensions/AindBehaviorSessionModel.cs
index b756e0ed..cec51c14 100644
--- a/src/Extensions/AindBehaviorSessionModel.cs
+++ b/src/Extensions/AindBehaviorSessionModel.cs
@@ -15,7 +15,9 @@ namespace AindVrForagingDataSchema.Session
public partial class AindBehaviorSessionModel
{
- private string _version = "0.2.0";
+ private string _aindBehaviorServicesPkgVersion = "0.9.0";
+
+ private string _version = "0.3.0";
private string _experiment;
@@ -25,7 +27,7 @@ public partial class AindBehaviorSessionModel
private string _rootPath;
- private string _remotePath;
+ private string _sessionName;
private string _subject;
@@ -45,12 +47,13 @@ public AindBehaviorSessionModel()
protected AindBehaviorSessionModel(AindBehaviorSessionModel other)
{
+ _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
_version = other._version;
_experiment = other._experiment;
_experimenter = other._experimenter;
_date = other._date;
_rootPath = other._rootPath;
- _remotePath = other._remotePath;
+ _sessionName = other._sessionName;
_subject = other._subject;
_experimentVersion = other._experimentVersion;
_notes = other._notes;
@@ -59,6 +62,19 @@ protected AindBehaviorSessionModel(AindBehaviorSessionModel other)
_skipHardwareValidation = other._skipHardwareValidation;
}
+ [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
+ public string AindBehaviorServicesPkgVersion
+ {
+ get
+ {
+ return _aindBehaviorServicesPkgVersion;
+ }
+ set
+ {
+ _aindBehaviorServicesPkgVersion = value;
+ }
+ }
+
[Newtonsoft.Json.JsonPropertyAttribute("version")]
public string Version
{
@@ -143,20 +159,19 @@ public string RootPath
}
///
- /// Remote path where data will be attempted to be copied to after experiment is done
+ /// Name of the session. This will be used to create a folder in the root path.
///
- [Newtonsoft.Json.JsonPropertyAttribute("remote_path")]
- [System.ComponentModel.DescriptionAttribute("Remote path where data will be attempted to be copied to after experiment is done" +
- "")]
- public string RemotePath
+ [Newtonsoft.Json.JsonPropertyAttribute("session_name")]
+ [System.ComponentModel.DescriptionAttribute("Name of the session. This will be used to create a folder in the root path.")]
+ public string SessionName
{
get
{
- return _remotePath;
+ return _sessionName;
}
set
{
- _remotePath = value;
+ _sessionName = value;
}
}
@@ -274,12 +289,13 @@ public System.IObservable Process(System.IObs
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
+ stringBuilder.Append("aind_behavior_services_pkg_version = " + _aindBehaviorServicesPkgVersion + ", ");
stringBuilder.Append("version = " + _version + ", ");
stringBuilder.Append("experiment = " + _experiment + ", ");
stringBuilder.Append("experimenter = " + _experimenter + ", ");
stringBuilder.Append("date = " + _date + ", ");
stringBuilder.Append("root_path = " + _rootPath + ", ");
- stringBuilder.Append("remote_path = " + _remotePath + ", ");
+ stringBuilder.Append("session_name = " + _sessionName + ", ");
stringBuilder.Append("subject = " + _subject + ", ");
stringBuilder.Append("experiment_version = " + _experimentVersion + ", ");
stringBuilder.Append("notes = " + _notes + ", ");
diff --git a/src/Extensions/AindManipulator.bonsai b/src/Extensions/AindManipulator.bonsai
index 83daa890..c1fcbc24 100644
--- a/src/Extensions/AindManipulator.bonsai
+++ b/src/Extensions/AindManipulator.bonsai
@@ -2,7 +2,6 @@
@@ -22,11 +21,8 @@
COMx
-
-
-
- StartExperiment
+ TriggerHarpReadDump
Write
@@ -39,11 +35,6 @@
Enabled
-
-
- 1
-
-
StepperDriverCommands
@@ -54,8 +45,6 @@
-
-
\ No newline at end of file
diff --git a/src/Extensions/AindVrForagingRig.cs b/src/Extensions/AindVrForagingRig.cs
index df100a01..d50423cd 100644
--- a/src/Extensions/AindVrForagingRig.cs
+++ b/src/Extensions/AindVrForagingRig.cs
@@ -1125,149 +1125,159 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpAnalogInput
+ public partial class ConnectedClockOutput
{
- private string _deviceType = "analoginput";
-
- private BaseModel _additionalSettings;
-
- private BaseModel _calibration;
-
- private int _whoAmI = 1236;
-
- private string _serialNumber;
+ private string _targetDevice;
- private string _portName;
+ private int _outputChannel;
- public HarpAnalogInput()
+ public ConnectedClockOutput()
{
}
- protected HarpAnalogInput(HarpAnalogInput other)
+ protected ConnectedClockOutput(ConnectedClockOutput other)
{
- _deviceType = other._deviceType;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _whoAmI = other._whoAmI;
- _serialNumber = other._serialNumber;
- _portName = other._portName;
+ _targetDevice = other._targetDevice;
+ _outputChannel = other._outputChannel;
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ ///
+ /// Optional device name to provide user additional information
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("target_device")]
+ [System.ComponentModel.DescriptionAttribute("Optional device name to provide user additional information")]
+ public string TargetDevice
{
get
{
- return _deviceType;
+ return _targetDevice;
}
set
{
- _deviceType = value;
+ _targetDevice = value;
}
}
///
- /// Additional settings
+ /// Output channel
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
- [System.ComponentModel.DescriptionAttribute("Additional settings")]
- public BaseModel AdditionalSettings
+ [Newtonsoft.Json.JsonPropertyAttribute("output_channel", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Output channel")]
+ public int OutputChannel
{
get
{
- return _additionalSettings;
+ return _outputChannel;
}
set
{
- _additionalSettings = value;
+ _outputChannel = value;
}
}
- ///
- /// Calibration
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration")]
- public BaseModel Calibration
+ public System.IObservable Process()
{
- get
- {
- return _calibration;
- }
- set
- {
- _calibration = value;
- }
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ConnectedClockOutput(this)));
}
- [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
- public int WhoAmI
+ public System.IObservable Process(System.IObservable source)
{
- get
- {
- return _whoAmI;
- }
- set
+ return System.Reactive.Linq.Observable.Select(source, _ => new ConnectedClockOutput(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("target_device = " + _targetDevice + ", ");
+ stringBuilder.Append("output_channel = " + _outputChannel);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
{
- _whoAmI = value;
+ stringBuilder.Append(" ");
}
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class DisplayCalibration
+ {
+
+ private DisplayIntrinsics _intrinsics;
+
+ private DisplayExtrinsics _extrinsics;
+
+ public DisplayCalibration()
+ {
+ }
+
+ protected DisplayCalibration(DisplayCalibration other)
+ {
+ _intrinsics = other._intrinsics;
+ _extrinsics = other._extrinsics;
}
///
- /// Device serial number
+ /// Intrinsics
///
- [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
- [System.ComponentModel.DescriptionAttribute("Device serial number")]
- public string SerialNumber
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("intrinsics")]
+ [System.ComponentModel.DescriptionAttribute("Intrinsics")]
+ public DisplayIntrinsics Intrinsics
{
get
{
- return _serialNumber;
+ return _intrinsics;
}
set
{
- _serialNumber = value;
+ _intrinsics = value;
}
}
///
- /// Device port name
+ /// Extrinsics
///
- [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Device port name")]
- public string PortName
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("extrinsics")]
+ [System.ComponentModel.DescriptionAttribute("Extrinsics")]
+ public DisplayExtrinsics Extrinsics
{
get
{
- return _portName;
+ return _extrinsics;
}
set
{
- _portName = value;
+ _extrinsics = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpAnalogInput(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplayCalibration(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpAnalogInput(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplayCalibration(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("device_type = " + _deviceType + ", ");
- stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
- stringBuilder.Append("calibration = " + _calibration + ", ");
- stringBuilder.Append("who_am_i = " + _whoAmI + ", ");
- stringBuilder.Append("serial_number = " + _serialNumber + ", ");
- stringBuilder.Append("port_name = " + _portName);
+ stringBuilder.Append("intrinsics = " + _intrinsics + ", ");
+ stringBuilder.Append("extrinsics = " + _extrinsics);
return true;
}
@@ -1289,149 +1299,201 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpBehavior
+ public partial class DisplayExtrinsics
{
- private string _deviceType = "behavior";
-
- private BaseModel _additionalSettings;
-
- private BaseModel _calibration;
-
- private int _whoAmI = 1216;
-
- private string _serialNumber;
+ private Vector3 _rotation;
- private string _portName;
+ private Vector3 _translation;
- public HarpBehavior()
+ public DisplayExtrinsics()
{
}
- protected HarpBehavior(HarpBehavior other)
+ protected DisplayExtrinsics(DisplayExtrinsics other)
{
- _deviceType = other._deviceType;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _whoAmI = other._whoAmI;
- _serialNumber = other._serialNumber;
- _portName = other._portName;
+ _rotation = other._rotation;
+ _translation = other._translation;
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ ///
+ /// Rotation vector (radians)
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("rotation")]
+ [System.ComponentModel.DescriptionAttribute("Rotation vector (radians)")]
+ public Vector3 Rotation
{
get
{
- return _deviceType;
+ return _rotation;
}
set
{
- _deviceType = value;
+ _rotation = value;
}
}
///
- /// Additional settings
+ /// Translation (in cm)
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
- [System.ComponentModel.DescriptionAttribute("Additional settings")]
- public BaseModel AdditionalSettings
+ [Newtonsoft.Json.JsonPropertyAttribute("translation")]
+ [System.ComponentModel.DescriptionAttribute("Translation (in cm)")]
+ public Vector3 Translation
{
get
{
- return _additionalSettings;
+ return _translation;
}
set
{
- _additionalSettings = value;
+ _translation = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplayExtrinsics(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplayExtrinsics(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("rotation = " + _rotation + ", ");
+ stringBuilder.Append("translation = " + _translation);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
}
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class DisplayIntrinsics
+ {
+
+ private int _frameWidth = 1920;
+
+ private int _frameHeight = 1080;
+
+ private double _displayWidth = 20D;
+
+ private double _displayHeight = 15D;
+
+ public DisplayIntrinsics()
+ {
+ }
+
+ protected DisplayIntrinsics(DisplayIntrinsics other)
+ {
+ _frameWidth = other._frameWidth;
+ _frameHeight = other._frameHeight;
+ _displayWidth = other._displayWidth;
+ _displayHeight = other._displayHeight;
}
///
- /// Calibration
+ /// Frame width (px)
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration")]
- public BaseModel Calibration
+ [Newtonsoft.Json.JsonPropertyAttribute("frame_width")]
+ [System.ComponentModel.DescriptionAttribute("Frame width (px)")]
+ public int FrameWidth
{
get
{
- return _calibration;
+ return _frameWidth;
}
set
{
- _calibration = value;
+ _frameWidth = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
- public int WhoAmI
+ ///
+ /// Frame height (px)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("frame_height")]
+ [System.ComponentModel.DescriptionAttribute("Frame height (px)")]
+ public int FrameHeight
{
get
{
- return _whoAmI;
+ return _frameHeight;
}
set
{
- _whoAmI = value;
+ _frameHeight = value;
}
}
///
- /// Device serial number
+ /// Display width (cm)
///
- [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
- [System.ComponentModel.DescriptionAttribute("Device serial number")]
- public string SerialNumber
+ [Newtonsoft.Json.JsonPropertyAttribute("display_width")]
+ [System.ComponentModel.DescriptionAttribute("Display width (cm)")]
+ public double DisplayWidth
{
get
{
- return _serialNumber;
+ return _displayWidth;
}
set
{
- _serialNumber = value;
+ _displayWidth = value;
}
}
///
- /// Device port name
+ /// Display width (cm)
///
- [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Device port name")]
- public string PortName
+ [Newtonsoft.Json.JsonPropertyAttribute("display_height")]
+ [System.ComponentModel.DescriptionAttribute("Display width (cm)")]
+ public double DisplayHeight
{
get
{
- return _portName;
+ return _displayHeight;
}
set
{
- _portName = value;
+ _displayHeight = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpBehavior(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplayIntrinsics(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpBehavior(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplayIntrinsics(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("device_type = " + _deviceType + ", ");
- stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
- stringBuilder.Append("calibration = " + _calibration + ", ");
- stringBuilder.Append("who_am_i = " + _whoAmI + ", ");
- stringBuilder.Append("serial_number = " + _serialNumber + ", ");
- stringBuilder.Append("port_name = " + _portName);
+ stringBuilder.Append("frame_width = " + _frameWidth + ", ");
+ stringBuilder.Append("frame_height = " + _frameHeight + ", ");
+ stringBuilder.Append("display_width = " + _displayWidth + ", ");
+ stringBuilder.Append("display_height = " + _displayHeight);
return true;
}
@@ -1453,85 +1515,195 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpClockGenerator
+ public partial class DisplaysCalibration
{
- private string _deviceType = "clockgenerator";
-
- private BaseModel _additionalSettings;
-
- private BaseModel _calibration;
-
- private int _whoAmI = 1158;
+ private DisplayCalibration _left;
- private string _serialNumber;
+ private DisplayCalibration _center;
- private string _portName;
+ private DisplayCalibration _right;
- public HarpClockGenerator()
+ public DisplaysCalibration()
{
}
- protected HarpClockGenerator(HarpClockGenerator other)
+ protected DisplaysCalibration(DisplaysCalibration other)
{
- _deviceType = other._deviceType;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _whoAmI = other._whoAmI;
- _serialNumber = other._serialNumber;
- _portName = other._portName;
+ _left = other._left;
+ _center = other._center;
+ _right = other._right;
}
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
+ ///
+ /// Left display calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("left")]
+ [System.ComponentModel.DescriptionAttribute("Left display calibration")]
+ public DisplayCalibration Left
{
get
{
- return _deviceType;
+ return _left;
}
set
{
- _deviceType = value;
+ _left = value;
}
}
///
- /// Additional settings
+ /// Center display calibration
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
- [System.ComponentModel.DescriptionAttribute("Additional settings")]
- public BaseModel AdditionalSettings
+ [Newtonsoft.Json.JsonPropertyAttribute("center")]
+ [System.ComponentModel.DescriptionAttribute("Center display calibration")]
+ public DisplayCalibration Center
{
get
{
- return _additionalSettings;
+ return _center;
}
set
{
- _additionalSettings = value;
+ _center = value;
}
}
///
- /// Calibration
+ /// Right display calibration
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration")]
- public BaseModel Calibration
+ [Newtonsoft.Json.JsonPropertyAttribute("right")]
+ [System.ComponentModel.DescriptionAttribute("Right display calibration")]
+ public DisplayCalibration Right
{
get
{
- return _calibration;
+ return _right;
}
set
{
- _calibration = value;
+ _right = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new DisplaysCalibration(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new DisplaysCalibration(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("left = " + _left + ", ");
+ stringBuilder.Append("center = " + _center + ", ");
+ stringBuilder.Append("right = " + _right);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class HarpAnalogInput
+ {
+
+ private string _deviceType = "analoginput";
+
+ private BaseModel _additionalSettings;
+
+ private BaseModel _calibration;
+
+ private int _whoAmI = 1236;
+
+ private string _serialNumber;
+
+ private string _portName;
+
+ public HarpAnalogInput()
+ {
+ }
+
+ protected HarpAnalogInput(HarpAnalogInput other)
+ {
+ _deviceType = other._deviceType;
+ _additionalSettings = other._additionalSettings;
+ _calibration = other._calibration;
+ _whoAmI = other._whoAmI;
+ _serialNumber = other._serialNumber;
+ _portName = other._portName;
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
+ {
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
+ }
+
+ ///
+ /// Additional settings
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
+ [System.ComponentModel.DescriptionAttribute("Additional settings")]
+ public BaseModel AdditionalSettings
+ {
+ get
+ {
+ return _additionalSettings;
+ }
+ set
+ {
+ _additionalSettings = value;
+ }
+ }
+
+ ///
+ /// Calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Calibration")]
+ public BaseModel Calibration
+ {
+ get
+ {
+ return _calibration;
+ }
+ set
+ {
+ _calibration = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
public int WhoAmI
{
get
@@ -1578,14 +1750,14 @@ public string PortName
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpClockGenerator(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpAnalogInput(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpClockGenerator(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpAnalogInput(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -1617,26 +1789,26 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpLickometer
+ public partial class HarpBehavior
{
- private string _deviceType = "lickometer";
+ private string _deviceType = "behavior";
private BaseModel _additionalSettings;
private BaseModel _calibration;
- private int _whoAmI = 1400;
+ private int _whoAmI = 1216;
private string _serialNumber;
private string _portName;
- public HarpLickometer()
+ public HarpBehavior()
{
}
- protected HarpLickometer(HarpLickometer other)
+ protected HarpBehavior(HarpBehavior other)
{
_deviceType = other._deviceType;
_additionalSettings = other._additionalSettings;
@@ -1742,14 +1914,14 @@ public string PortName
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpLickometer(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpBehavior(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpLickometer(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpBehavior(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -1778,33 +1950,31 @@ public override string ToString()
}
- ///
- /// Overrides the default settings for the olfactometer calibration
- ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Overrides the default settings for the olfactometer calibration")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpOlfactometer
+ public partial class HarpClockGenerator
{
- private string _deviceType = "olfactometer";
+ private string _deviceType = "clockgenerator";
private BaseModel _additionalSettings;
- private OlfactometerCalibration _calibration;
+ private BaseModel _calibration;
- private int _whoAmI = 1140;
+ private int _whoAmI = 1158;
private string _serialNumber;
private string _portName;
- public HarpOlfactometer()
+ private System.Collections.Generic.List _connectedClockOutputs = new System.Collections.Generic.List();
+
+ public HarpClockGenerator()
{
}
- protected HarpOlfactometer(HarpOlfactometer other)
+ protected HarpClockGenerator(HarpClockGenerator other)
{
_deviceType = other._deviceType;
_additionalSettings = other._additionalSettings;
@@ -1812,6 +1982,7 @@ protected HarpOlfactometer(HarpOlfactometer other)
_whoAmI = other._whoAmI;
_serialNumber = other._serialNumber;
_portName = other._portName;
+ _connectedClockOutputs = other._connectedClockOutputs;
}
[Newtonsoft.Json.JsonPropertyAttribute("device_type")]
@@ -1846,12 +2017,12 @@ public BaseModel AdditionalSettings
}
///
- /// Olfactometer calibration
+ /// Calibration
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
[Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Olfactometer calibration")]
- public OlfactometerCalibration Calibration
+ [System.ComponentModel.DescriptionAttribute("Calibration")]
+ public BaseModel Calibration
{
get
{
@@ -1910,14 +2081,32 @@ public string PortName
}
}
- public System.IObservable Process()
+ ///
+ /// Connected clock outputs
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("connected_clock_outputs")]
+ [System.ComponentModel.DescriptionAttribute("Connected clock outputs")]
+ public System.Collections.Generic.List ConnectedClockOutputs
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpOlfactometer(this)));
+ get
+ {
+ return _connectedClockOutputs;
+ }
+ set
+ {
+ _connectedClockOutputs = value;
+ }
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpOlfactometer(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpClockGenerator(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpClockGenerator(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -1927,7 +2116,8 @@ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
stringBuilder.Append("calibration = " + _calibration + ", ");
stringBuilder.Append("who_am_i = " + _whoAmI + ", ");
stringBuilder.Append("serial_number = " + _serialNumber + ", ");
- stringBuilder.Append("port_name = " + _portName);
+ stringBuilder.Append("port_name = " + _portName + ", ");
+ stringBuilder.Append("connected_clock_outputs = " + _connectedClockOutputs);
return true;
}
@@ -1949,26 +2139,26 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpSniffDetector
+ public partial class HarpEnvironmentSensor
{
- private string _deviceType = "sniffdetector";
+ private string _deviceType = "environmentsensor";
private BaseModel _additionalSettings;
private BaseModel _calibration;
- private int _whoAmI = 1401;
+ private int _whoAmI = 1405;
private string _serialNumber;
private string _portName;
- public HarpSniffDetector()
+ public HarpEnvironmentSensor()
{
}
- protected HarpSniffDetector(HarpSniffDetector other)
+ protected HarpEnvironmentSensor(HarpEnvironmentSensor other)
{
_deviceType = other._deviceType;
_additionalSettings = other._additionalSettings;
@@ -2074,14 +2264,14 @@ public string PortName
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpSniffDetector(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpEnvironmentSensor(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpSniffDetector(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpEnvironmentSensor(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -2110,33 +2300,29 @@ public override string ToString()
}
- ///
- /// Overrides the default settings for the treadmill calibration
- ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Overrides the default settings for the treadmill calibration")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpTreadmill
+ public partial class HarpLickometer
{
- private string _deviceType = "treadmill";
+ private string _deviceType = "lickometer";
private BaseModel _additionalSettings;
- private Treadmill _calibration;
+ private BaseModel _calibration;
- private int _whoAmI = 1402;
+ private int _whoAmI = 1400;
private string _serialNumber;
private string _portName;
- public HarpTreadmill()
+ public HarpLickometer()
{
}
- protected HarpTreadmill(HarpTreadmill other)
+ protected HarpLickometer(HarpLickometer other)
{
_deviceType = other._deviceType;
_additionalSettings = other._additionalSettings;
@@ -2178,12 +2364,12 @@ public BaseModel AdditionalSettings
}
///
- /// Treadmill calibration settings
+ /// Calibration
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
[Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Treadmill calibration settings")]
- public Treadmill Calibration
+ [System.ComponentModel.DescriptionAttribute("Calibration")]
+ public BaseModel Calibration
{
get
{
@@ -2242,14 +2428,14 @@ public string PortName
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpTreadmill(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpLickometer(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpTreadmill(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpLickometer(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -2278,100 +2464,156 @@ public override string ToString()
}
+ ///
+ /// Overrides the default settings for the olfactometer calibration
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Overrides the default settings for the olfactometer calibration")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class ManipulatorPosition
+ public partial class HarpOlfactometer
{
- private double _x;
+ private string _deviceType = "olfactometer";
- private double _y1;
+ private BaseModel _additionalSettings;
- private double _y2;
+ private OlfactometerCalibration _calibration;
- private double _z;
+ private int _whoAmI = 1140;
- public ManipulatorPosition()
+ private string _serialNumber;
+
+ private string _portName;
+
+ public HarpOlfactometer()
{
}
- protected ManipulatorPosition(ManipulatorPosition other)
+ protected HarpOlfactometer(HarpOlfactometer other)
{
- _x = other._x;
- _y1 = other._y1;
- _y2 = other._y2;
- _z = other._z;
+ _deviceType = other._deviceType;
+ _additionalSettings = other._additionalSettings;
+ _calibration = other._calibration;
+ _whoAmI = other._whoAmI;
+ _serialNumber = other._serialNumber;
+ _portName = other._portName;
}
- [Newtonsoft.Json.JsonPropertyAttribute("x", Required=Newtonsoft.Json.Required.Always)]
- public double X
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
{
get
{
- return _x;
+ return _deviceType;
}
set
{
- _x = value;
+ _deviceType = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("y1", Required=Newtonsoft.Json.Required.Always)]
- public double Y1
+ ///
+ /// Additional settings
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
+ [System.ComponentModel.DescriptionAttribute("Additional settings")]
+ public BaseModel AdditionalSettings
{
get
{
- return _y1;
+ return _additionalSettings;
}
set
{
- _y1 = value;
+ _additionalSettings = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("y2", Required=Newtonsoft.Json.Required.Always)]
- public double Y2
+ ///
+ /// Olfactometer calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Olfactometer calibration")]
+ public OlfactometerCalibration Calibration
{
get
{
- return _y2;
+ return _calibration;
}
set
{
- _y2 = value;
+ _calibration = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("z", Required=Newtonsoft.Json.Required.Always)]
- public double Z
+ [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
+ public int WhoAmI
{
get
{
- return _z;
+ return _whoAmI;
}
set
{
- _z = value;
+ _whoAmI = value;
}
}
- public System.IObservable Process()
+ ///
+ /// Device serial number
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
+ [System.ComponentModel.DescriptionAttribute("Device serial number")]
+ public string SerialNumber
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ManipulatorPosition(this)));
+ get
+ {
+ return _serialNumber;
+ }
+ set
+ {
+ _serialNumber = value;
+ }
}
- public System.IObservable Process(System.IObservable source)
+ ///
+ /// Device port name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Device port name")]
+ public string PortName
{
- return System.Reactive.Linq.Observable.Select(source, _ => new ManipulatorPosition(this));
+ get
+ {
+ return _portName;
+ }
+ set
+ {
+ _portName = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpOlfactometer(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpOlfactometer(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("x = " + _x + ", ");
- stringBuilder.Append("y1 = " + _y1 + ", ");
- stringBuilder.Append("y2 = " + _y2 + ", ");
- stringBuilder.Append("z = " + _z);
+ stringBuilder.Append("device_type = " + _deviceType + ", ");
+ stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
+ stringBuilder.Append("calibration = " + _calibration + ", ");
+ stringBuilder.Append("who_am_i = " + _whoAmI + ", ");
+ stringBuilder.Append("serial_number = " + _serialNumber + ", ");
+ stringBuilder.Append("port_name = " + _portName);
return true;
}
@@ -2390,121 +2632,152 @@ public override string ToString()
}
- ///
- /// Input for water valve calibration class
- ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Input for water valve calibration class")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class Measurement
+ public partial class HarpSniffDetector
{
- private double _valveOpenInterval;
+ private string _deviceType = "sniffdetector";
- private double _valveOpenTime;
+ private BaseModel _additionalSettings;
- private System.Collections.Generic.List _waterWeight = new System.Collections.Generic.List();
+ private BaseModel _calibration;
- private int _repeatCount;
+ private int _whoAmI = 1401;
- public Measurement()
+ private string _serialNumber;
+
+ private string _portName;
+
+ public HarpSniffDetector()
{
}
- protected Measurement(Measurement other)
+ protected HarpSniffDetector(HarpSniffDetector other)
{
- _valveOpenInterval = other._valveOpenInterval;
- _valveOpenTime = other._valveOpenTime;
- _waterWeight = other._waterWeight;
- _repeatCount = other._repeatCount;
+ _deviceType = other._deviceType;
+ _additionalSettings = other._additionalSettings;
+ _calibration = other._calibration;
+ _whoAmI = other._whoAmI;
+ _serialNumber = other._serialNumber;
+ _portName = other._portName;
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
+ {
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
}
///
- /// Time between two consecutive valve openings (s)
+ /// Additional settings
///
- [Newtonsoft.Json.JsonPropertyAttribute("valve_open_interval", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Time between two consecutive valve openings (s)")]
- public double ValveOpenInterval
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
+ [System.ComponentModel.DescriptionAttribute("Additional settings")]
+ public BaseModel AdditionalSettings
{
get
{
- return _valveOpenInterval;
+ return _additionalSettings;
}
set
{
- _valveOpenInterval = value;
+ _additionalSettings = value;
}
}
///
- /// Valve open interval (s)
+ /// Calibration
///
- [Newtonsoft.Json.JsonPropertyAttribute("valve_open_time", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Valve open interval (s)")]
- public double ValveOpenTime
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Calibration")]
+ public BaseModel Calibration
{
get
{
- return _valveOpenTime;
+ return _calibration;
}
set
{
- _valveOpenTime = value;
+ _calibration = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
+ public int WhoAmI
+ {
+ get
+ {
+ return _whoAmI;
+ }
+ set
+ {
+ _whoAmI = value;
}
}
///
- /// Weight of water delivered (g)
+ /// Device serial number
///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("water_weight", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Weight of water delivered (g)")]
- public System.Collections.Generic.List WaterWeight
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
+ [System.ComponentModel.DescriptionAttribute("Device serial number")]
+ public string SerialNumber
{
get
{
- return _waterWeight;
+ return _serialNumber;
}
set
{
- _waterWeight = value;
+ _serialNumber = value;
}
}
///
- /// Number of times the valve opened.
+ /// Device port name
///
- [Newtonsoft.Json.JsonPropertyAttribute("repeat_count", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Number of times the valve opened.")]
- public int RepeatCount
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Device port name")]
+ public string PortName
{
get
{
- return _repeatCount;
+ return _portName;
}
set
{
- _repeatCount = value;
+ _portName = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Measurement(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpSniffDetector(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new Measurement(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpSniffDetector(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("valve_open_interval = " + _valveOpenInterval + ", ");
- stringBuilder.Append("valve_open_time = " + _valveOpenTime + ", ");
- stringBuilder.Append("water_weight = " + _waterWeight + ", ");
- stringBuilder.Append("repeat_count = " + _repeatCount);
+ stringBuilder.Append("device_type = " + _deviceType + ", ");
+ stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
+ stringBuilder.Append("calibration = " + _calibration + ", ");
+ stringBuilder.Append("who_am_i = " + _whoAmI + ", ");
+ stringBuilder.Append("serial_number = " + _serialNumber + ", ");
+ stringBuilder.Append("port_name = " + _portName);
return true;
}
@@ -2524,174 +2797,99 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- public enum MicrostepResolution
- {
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
- Microstep8 = 0,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
- Microstep16 = 1,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
- Microstep32 = 2,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
- Microstep64 = 3,
- }
-
-
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- public enum MotorOperationMode
- {
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
- Quiet = 0,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
- Dynamic = 1,
- }
-
-
- ///
- /// Olfactometer calibration class
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Olfactometer calibration class")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class OlfactometerCalibration
+ public partial class ManipulatorPosition
{
- private string _deviceName = "Olfactometer";
-
- private OlfactometerCalibrationInput _input = new OlfactometerCalibrationInput();
-
- private OlfactometerCalibrationOutput _output = new OlfactometerCalibrationOutput();
+ private double _x;
- private System.DateTimeOffset? _date;
+ private double _y1;
- private string _description = "Calibration of the harp olfactometer device";
+ private double _y2;
- private string _notes;
+ private double _z;
- public OlfactometerCalibration()
+ public ManipulatorPosition()
{
}
- protected OlfactometerCalibration(OlfactometerCalibration other)
+ protected ManipulatorPosition(ManipulatorPosition other)
{
- _deviceName = other._deviceName;
- _input = other._input;
- _output = other._output;
- _date = other._date;
- _description = other._description;
- _notes = other._notes;
- }
-
- ///
- /// Name of the device being calibrated
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Name of the device being calibrated")]
- public string DeviceName
- {
- get
- {
- return _deviceName;
- }
- set
- {
- _deviceName = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("input", Required=Newtonsoft.Json.Required.Always)]
- public OlfactometerCalibrationInput Input
- {
- get
- {
- return _input;
- }
- set
- {
- _input = value;
- }
+ _x = other._x;
+ _y1 = other._y1;
+ _y2 = other._y2;
+ _z = other._z;
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
- public OlfactometerCalibrationOutput Output
+ [Newtonsoft.Json.JsonPropertyAttribute("x", Required=Newtonsoft.Json.Required.Always)]
+ public double X
{
get
{
- return _output;
+ return _x;
}
set
{
- _output = value;
+ _x = value;
}
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("date")]
- public System.DateTimeOffset? Date
+ [Newtonsoft.Json.JsonPropertyAttribute("y1", Required=Newtonsoft.Json.Required.Always)]
+ public double Y1
{
get
{
- return _date;
+ return _y1;
}
set
{
- _date = value;
+ _y1 = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("description")]
- public string Description
+ [Newtonsoft.Json.JsonPropertyAttribute("y2", Required=Newtonsoft.Json.Required.Always)]
+ public double Y2
{
get
{
- return _description;
+ return _y2;
}
set
{
- _description = value;
+ _y2 = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("notes")]
- public string Notes
+ [Newtonsoft.Json.JsonPropertyAttribute("z", Required=Newtonsoft.Json.Required.Always)]
+ public double Z
{
get
{
- return _notes;
+ return _z;
}
set
{
- _notes = value;
+ _z = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerCalibration(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ManipulatorPosition(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerCalibration(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new ManipulatorPosition(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("device_name = " + _deviceName + ", ");
- stringBuilder.Append("input = " + _input + ", ");
- stringBuilder.Append("output = " + _output + ", ");
- stringBuilder.Append("date = " + _date + ", ");
- stringBuilder.Append("description = " + _description + ", ");
- stringBuilder.Append("notes = " + _notes);
+ stringBuilder.Append("x = " + _x + ", ");
+ stringBuilder.Append("y1 = " + _y1 + ", ");
+ stringBuilder.Append("y2 = " + _y2 + ", ");
+ stringBuilder.Append("z = " + _z);
return true;
}
@@ -2710,54 +2908,121 @@ public override string ToString()
}
+ ///
+ /// Input for water valve calibration class
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Input for water valve calibration class")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class OlfactometerCalibrationInput
+ public partial class Measurement
{
- private System.Collections.Generic.IDictionary _channelConfig;
+ private double _valveOpenInterval;
- public OlfactometerCalibrationInput()
+ private double _valveOpenTime;
+
+ private System.Collections.Generic.List _waterWeight = new System.Collections.Generic.List();
+
+ private int _repeatCount;
+
+ public Measurement()
{
}
- protected OlfactometerCalibrationInput(OlfactometerCalibrationInput other)
+ protected Measurement(Measurement other)
{
- _channelConfig = other._channelConfig;
+ _valveOpenInterval = other._valveOpenInterval;
+ _valveOpenTime = other._valveOpenTime;
+ _waterWeight = other._waterWeight;
+ _repeatCount = other._repeatCount;
}
///
- /// Configuration of olfactometer channels
+ /// Time between two consecutive valve openings (s)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("valve_open_interval", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Time between two consecutive valve openings (s)")]
+ public double ValveOpenInterval
+ {
+ get
+ {
+ return _valveOpenInterval;
+ }
+ set
+ {
+ _valveOpenInterval = value;
+ }
+ }
+
+ ///
+ /// Valve open interval (s)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("valve_open_time", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Valve open interval (s)")]
+ public double ValveOpenTime
+ {
+ get
+ {
+ return _valveOpenTime;
+ }
+ set
+ {
+ _valveOpenTime = value;
+ }
+ }
+
+ ///
+ /// Weight of water delivered (g)
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("channel_config")]
- [System.ComponentModel.DescriptionAttribute("Configuration of olfactometer channels")]
- public System.Collections.Generic.IDictionary ChannelConfig
+ [Newtonsoft.Json.JsonPropertyAttribute("water_weight", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Weight of water delivered (g)")]
+ public System.Collections.Generic.List WaterWeight
{
get
{
- return _channelConfig;
+ return _waterWeight;
}
set
{
- _channelConfig = value;
+ _waterWeight = value;
}
}
- public System.IObservable Process()
+ ///
+ /// Number of times the valve opened.
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("repeat_count", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Number of times the valve opened.")]
+ public int RepeatCount
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerCalibrationInput(this)));
+ get
+ {
+ return _repeatCount;
+ }
+ set
+ {
+ _repeatCount = value;
+ }
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerCalibrationInput(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Measurement(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new Measurement(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("channel_config = " + _channelConfig);
+ stringBuilder.Append("valve_open_interval = " + _valveOpenInterval + ", ");
+ stringBuilder.Append("valve_open_time = " + _valveOpenTime + ", ");
+ stringBuilder.Append("water_weight = " + _waterWeight + ", ");
+ stringBuilder.Append("repeat_count = " + _repeatCount);
return true;
}
@@ -2777,180 +3042,174 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class OlfactometerCalibrationOutput
+ public enum MicrostepResolution
{
- public OlfactometerCalibrationOutput()
- {
- }
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
+ Microstep8 = 0,
- protected OlfactometerCalibrationOutput(OlfactometerCalibrationOutput other)
- {
- }
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
+ Microstep16 = 1,
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerCalibrationOutput(this)));
- }
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
+ Microstep32 = 2,
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerCalibrationOutput(this));
- }
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
+ Microstep64 = 3,
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ public enum MotorOperationMode
+ {
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- return false;
- }
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
+ Quiet = 0,
- public override string ToString()
- {
- System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
- stringBuilder.Append(GetType().Name);
- stringBuilder.Append(" { ");
- if (PrintMembers(stringBuilder))
- {
- stringBuilder.Append(" ");
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
+ Dynamic = 1,
}
+ ///
+ /// Olfactometer calibration class
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Olfactometer calibration class")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class OlfactometerChannelConfig
+ public partial class OlfactometerCalibration
{
- private int _channelIndex;
+ private string _deviceName = "Olfactometer";
- private OlfactometerChannelType _channelType = AindVrForagingDataSchema.Rig.OlfactometerChannelType.Odor;
+ private OlfactometerCalibrationInput _input = new OlfactometerCalibrationInput();
- private OlfactometerChannelConfigFlowRateCapacity _flowRateCapacity = AindVrForagingDataSchema.Rig.OlfactometerChannelConfigFlowRateCapacity._100;
+ private OlfactometerCalibrationOutput _output = new OlfactometerCalibrationOutput();
- private double _flowRate = 100D;
+ private System.DateTimeOffset? _date;
- private string _odorant;
+ private string _description = "Calibration of the harp olfactometer device";
- private double? _odorantDilution;
+ private string _notes;
- public OlfactometerChannelConfig()
+ public OlfactometerCalibration()
{
}
- protected OlfactometerChannelConfig(OlfactometerChannelConfig other)
+ protected OlfactometerCalibration(OlfactometerCalibration other)
{
- _channelIndex = other._channelIndex;
- _channelType = other._channelType;
- _flowRateCapacity = other._flowRateCapacity;
- _flowRate = other._flowRate;
- _odorant = other._odorant;
- _odorantDilution = other._odorantDilution;
+ _deviceName = other._deviceName;
+ _input = other._input;
+ _output = other._output;
+ _date = other._date;
+ _description = other._description;
+ _notes = other._notes;
}
- [Newtonsoft.Json.JsonPropertyAttribute("channel_index", Required=Newtonsoft.Json.Required.Always)]
- public int ChannelIndex
+ ///
+ /// Name of the device being calibrated
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
+ [System.ComponentModel.DescriptionAttribute("Name of the device being calibrated")]
+ public string DeviceName
{
get
{
- return _channelIndex;
+ return _deviceName;
}
set
{
- _channelIndex = value;
+ _deviceName = value;
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("channel_type")]
- public OlfactometerChannelType ChannelType
+ [Newtonsoft.Json.JsonPropertyAttribute("input", Required=Newtonsoft.Json.Required.Always)]
+ public OlfactometerCalibrationInput Input
{
get
{
- return _channelType;
+ return _input;
}
set
{
- _channelType = value;
+ _input = value;
}
}
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("flow_rate_capacity")]
- public OlfactometerChannelConfigFlowRateCapacity FlowRateCapacity
+ [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
+ public OlfactometerCalibrationOutput Output
{
get
{
- return _flowRateCapacity;
+ return _output;
}
set
{
- _flowRateCapacity = value;
+ _output = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("flow_rate")]
- public double FlowRate
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("date")]
+ public System.DateTimeOffset? Date
{
get
{
- return _flowRate;
+ return _date;
}
set
{
- _flowRate = value;
+ _date = value;
}
}
- [Newtonsoft.Json.JsonPropertyAttribute("odorant")]
- public string Odorant
+ [Newtonsoft.Json.JsonPropertyAttribute("description")]
+ public string Description
{
get
{
- return _odorant;
+ return _description;
}
set
{
- _odorant = value;
+ _description = value;
}
}
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("odorant_dilution")]
- public double? OdorantDilution
+ [Newtonsoft.Json.JsonPropertyAttribute("notes")]
+ public string Notes
{
get
{
- return _odorantDilution;
+ return _notes;
}
set
{
- _odorantDilution = value;
+ _notes = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerChannelConfig(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerCalibration(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerChannelConfig(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerCalibration(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("channel_index = " + _channelIndex + ", ");
- stringBuilder.Append("channel_type = " + _channelType + ", ");
- stringBuilder.Append("flow_rate_capacity = " + _flowRateCapacity + ", ");
- stringBuilder.Append("flow_rate = " + _flowRate + ", ");
- stringBuilder.Append("odorant = " + _odorant + ", ");
- stringBuilder.Append("odorant_dilution = " + _odorantDilution);
+ stringBuilder.Append("device_name = " + _deviceName + ", ");
+ stringBuilder.Append("input = " + _input + ", ");
+ stringBuilder.Append("output = " + _output + ", ");
+ stringBuilder.Append("date = " + _date + ", ");
+ stringBuilder.Append("description = " + _description + ", ");
+ stringBuilder.Append("notes = " + _notes);
return true;
}
@@ -2969,75 +3228,54 @@ public override string ToString()
}
- ///
- /// Channel type
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
- public enum OlfactometerChannelType
- {
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="Odor")]
- Odor = 0,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="Carrier")]
- Carrier = 1,
- }
-
-
- ///
- /// Container class for calibration models. In a future release these will be moved to the respective devices
- ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Container class for calibration models. In a future release these will be moved t" +
- "o the respective devices")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class RigCalibration
+ public partial class OlfactometerCalibrationInput
{
- private WaterValveCalibration _waterValve = new WaterValveCalibration();
+ private System.Collections.Generic.IDictionary _channelConfig;
- public RigCalibration()
+ public OlfactometerCalibrationInput()
{
}
- protected RigCalibration(RigCalibration other)
+ protected OlfactometerCalibrationInput(OlfactometerCalibrationInput other)
{
- _waterValve = other._waterValve;
+ _channelConfig = other._channelConfig;
}
///
- /// Water valve calibration
+ /// Configuration of olfactometer channels
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("water_valve", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Water valve calibration")]
- public WaterValveCalibration WaterValve
+ [Newtonsoft.Json.JsonPropertyAttribute("channel_config")]
+ [System.ComponentModel.DescriptionAttribute("Configuration of olfactometer channels")]
+ public System.Collections.Generic.IDictionary ChannelConfig
{
get
{
- return _waterValve;
+ return _channelConfig;
}
set
{
- _waterValve = value;
+ _channelConfig = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new RigCalibration(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerCalibrationInput(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new RigCalibration(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerCalibrationInput(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("water_valve = " + _waterValve);
+ stringBuilder.Append("channel_config = " + _channelConfig);
return true;
}
@@ -3059,52 +3297,1478 @@ public override string ToString()
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class Screen
+ public partial class OlfactometerCalibrationOutput
{
- private string _deviceType = "Screen";
+ public OlfactometerCalibrationOutput()
+ {
+ }
- private BaseModel _additionalSettings;
+ protected OlfactometerCalibrationOutput(OlfactometerCalibrationOutput other)
+ {
+ }
- private BaseModel _calibration;
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerCalibrationOutput(this)));
+ }
- private int _displayIndex = 1;
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerCalibrationOutput(this));
+ }
- private double _targetRenderFrequency = 60D;
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ return false;
+ }
- private double _targetUpdateFrequency = 120D;
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ ///
+ /// Harp Olfactometer available channel
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ public enum OlfactometerChannel
+ {
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
+ Channel0 = 0,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
+ Channel1 = 1,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
+ Channel2 = 2,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
+ Channel3 = 3,
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class OlfactometerChannelConfig
+ {
+
+ private int _channelIndex;
+
+ private OlfactometerChannelType _channelType = AindVrForagingDataSchema.Rig.OlfactometerChannelType.Odor;
+
+ private OlfactometerChannelConfigFlowRateCapacity _flowRateCapacity = AindVrForagingDataSchema.Rig.OlfactometerChannelConfigFlowRateCapacity._100;
+
+ private double _flowRate = 100D;
+
+ private string _odorant;
+
+ private double? _odorantDilution;
+
+ public OlfactometerChannelConfig()
+ {
+ }
+
+ protected OlfactometerChannelConfig(OlfactometerChannelConfig other)
+ {
+ _channelIndex = other._channelIndex;
+ _channelType = other._channelType;
+ _flowRateCapacity = other._flowRateCapacity;
+ _flowRate = other._flowRate;
+ _odorant = other._odorant;
+ _odorantDilution = other._odorantDilution;
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("channel_index", Required=Newtonsoft.Json.Required.Always)]
+ public int ChannelIndex
+ {
+ get
+ {
+ return _channelIndex;
+ }
+ set
+ {
+ _channelIndex = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("channel_type")]
+ public OlfactometerChannelType ChannelType
+ {
+ get
+ {
+ return _channelType;
+ }
+ set
+ {
+ _channelType = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("flow_rate_capacity")]
+ public OlfactometerChannelConfigFlowRateCapacity FlowRateCapacity
+ {
+ get
+ {
+ return _flowRateCapacity;
+ }
+ set
+ {
+ _flowRateCapacity = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("flow_rate")]
+ public double FlowRate
+ {
+ get
+ {
+ return _flowRate;
+ }
+ set
+ {
+ _flowRate = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("odorant")]
+ public string Odorant
+ {
+ get
+ {
+ return _odorant;
+ }
+ set
+ {
+ _odorant = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("odorant_dilution")]
+ public double? OdorantDilution
+ {
+ get
+ {
+ return _odorantDilution;
+ }
+ set
+ {
+ _odorantDilution = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new OlfactometerChannelConfig(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new OlfactometerChannelConfig(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("channel_index = " + _channelIndex + ", ");
+ stringBuilder.Append("channel_type = " + _channelType + ", ");
+ stringBuilder.Append("flow_rate_capacity = " + _flowRateCapacity + ", ");
+ stringBuilder.Append("flow_rate = " + _flowRate + ", ");
+ stringBuilder.Append("odorant = " + _odorant + ", ");
+ stringBuilder.Append("odorant_dilution = " + _odorantDilution);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ ///
+ /// Channel type
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
+ public enum OlfactometerChannelType
+ {
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="Odor")]
+ Odor = 0,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="Carrier")]
+ Carrier = 1,
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class Rect
+ {
+
+ private int _x = 0;
+
+ private int _y = 0;
+
+ private int _width = 0;
+
+ private int _height = 0;
+
+ public Rect()
+ {
+ }
+
+ protected Rect(Rect other)
+ {
+ _x = other._x;
+ _y = other._y;
+ _width = other._width;
+ _height = other._height;
+ }
+
+ ///
+ /// X coordinate of the top-left corner
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("x")]
+ [System.ComponentModel.DescriptionAttribute("X coordinate of the top-left corner")]
+ public int X
+ {
+ get
+ {
+ return _x;
+ }
+ set
+ {
+ _x = value;
+ }
+ }
+
+ ///
+ /// Y coordinate of the top-left corner
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("y")]
+ [System.ComponentModel.DescriptionAttribute("Y coordinate of the top-left corner")]
+ public int Y
+ {
+ get
+ {
+ return _y;
+ }
+ set
+ {
+ _y = value;
+ }
+ }
+
+ ///
+ /// Width of the rectangle
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("width")]
+ [System.ComponentModel.DescriptionAttribute("Width of the rectangle")]
+ public int Width
+ {
+ get
+ {
+ return _width;
+ }
+ set
+ {
+ _width = value;
+ }
+ }
+
+ ///
+ /// Height of the rectangle
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("height")]
+ [System.ComponentModel.DescriptionAttribute("Height of the rectangle")]
+ public int Height
+ {
+ get
+ {
+ return _height;
+ }
+ set
+ {
+ _height = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Rect(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new Rect(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("x = " + _x + ", ");
+ stringBuilder.Append("y = " + _y + ", ");
+ stringBuilder.Append("width = " + _width + ", ");
+ stringBuilder.Append("height = " + _height);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ ///
+ /// Container class for calibration models. In a future release these will be moved to the respective devices
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Container class for calibration models. In a future release these will be moved t" +
+ "o the respective devices")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class RigCalibration
+ {
+
+ private WaterValveCalibration _waterValve = new WaterValveCalibration();
+
+ public RigCalibration()
+ {
+ }
+
+ protected RigCalibration(RigCalibration other)
+ {
+ _waterValve = other._waterValve;
+ }
+
+ ///
+ /// Water valve calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("water_valve", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Water valve calibration")]
+ public WaterValveCalibration WaterValve
+ {
+ get
+ {
+ return _waterValve;
+ }
+ set
+ {
+ _waterValve = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new RigCalibration(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new RigCalibration(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("water_valve = " + _waterValve);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class Screen
+ {
+
+ private string _deviceType = "Screen";
+
+ private BaseModel _additionalSettings;
+
+ private DisplaysCalibration _calibration;
+
+ private int _displayIndex = 1;
+
+ private double _targetRenderFrequency = 60D;
+
+ private double _targetUpdateFrequency = 120D;
+
+ private string _textureAssetsDirectory = "Textures";
+
+ private double _brightness = 0D;
+
+ private double _contrast = 1D;
+
+ public Screen()
+ {
+ }
+
+ protected Screen(Screen other)
+ {
+ _deviceType = other._deviceType;
+ _additionalSettings = other._additionalSettings;
+ _calibration = other._calibration;
+ _displayIndex = other._displayIndex;
+ _targetRenderFrequency = other._targetRenderFrequency;
+ _targetUpdateFrequency = other._targetUpdateFrequency;
+ _textureAssetsDirectory = other._textureAssetsDirectory;
+ _brightness = other._brightness;
+ _contrast = other._contrast;
+ }
+
+ ///
+ /// Device type
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ [System.ComponentModel.DescriptionAttribute("Device type")]
+ public string DeviceType
+ {
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
+ }
+
+ ///
+ /// Additional settings
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
+ [System.ComponentModel.DescriptionAttribute("Additional settings")]
+ public BaseModel AdditionalSettings
+ {
+ get
+ {
+ return _additionalSettings;
+ }
+ set
+ {
+ _additionalSettings = value;
+ }
+ }
+
+ ///
+ /// Screen calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Screen calibration")]
+ public DisplaysCalibration Calibration
+ {
+ get
+ {
+ return _calibration;
+ }
+ set
+ {
+ _calibration = value;
+ }
+ }
+
+ ///
+ /// Display index
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("display_index")]
+ [System.ComponentModel.DescriptionAttribute("Display index")]
+ public int DisplayIndex
+ {
+ get
+ {
+ return _displayIndex;
+ }
+ set
+ {
+ _displayIndex = value;
+ }
+ }
+
+ ///
+ /// Target render frequency
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("target_render_frequency")]
+ [System.ComponentModel.DescriptionAttribute("Target render frequency")]
+ public double TargetRenderFrequency
+ {
+ get
+ {
+ return _targetRenderFrequency;
+ }
+ set
+ {
+ _targetRenderFrequency = value;
+ }
+ }
+
+ ///
+ /// Target update frequency
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("target_update_frequency")]
+ [System.ComponentModel.DescriptionAttribute("Target update frequency")]
+ public double TargetUpdateFrequency
+ {
+ get
+ {
+ return _targetUpdateFrequency;
+ }
+ set
+ {
+ _targetUpdateFrequency = value;
+ }
+ }
+
+ ///
+ /// Calibration directory
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("texture_assets_directory")]
+ [System.ComponentModel.DescriptionAttribute("Calibration directory")]
+ public string TextureAssetsDirectory
+ {
+ get
+ {
+ return _textureAssetsDirectory;
+ }
+ set
+ {
+ _textureAssetsDirectory = value;
+ }
+ }
+
+ ///
+ /// Brightness
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("brightness")]
+ [System.ComponentModel.DescriptionAttribute("Brightness")]
+ public double Brightness
+ {
+ get
+ {
+ return _brightness;
+ }
+ set
+ {
+ _brightness = value;
+ }
+ }
+
+ ///
+ /// Contrast
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("contrast")]
+ [System.ComponentModel.DescriptionAttribute("Contrast")]
+ public double Contrast
+ {
+ get
+ {
+ return _contrast;
+ }
+ set
+ {
+ _contrast = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Screen(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new Screen(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("device_type = " + _deviceType + ", ");
+ stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
+ stringBuilder.Append("calibration = " + _calibration + ", ");
+ stringBuilder.Append("display_index = " + _displayIndex + ", ");
+ stringBuilder.Append("target_render_frequency = " + _targetRenderFrequency + ", ");
+ stringBuilder.Append("target_update_frequency = " + _targetUpdateFrequency + ", ");
+ stringBuilder.Append("texture_assets_directory = " + _textureAssetsDirectory + ", ");
+ stringBuilder.Append("brightness = " + _brightness + ", ");
+ stringBuilder.Append("contrast = " + _contrast);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class SpinnakerCamera
+ {
+
+ private string _deviceType = "SpinnakerCamera";
+
+ private BaseModel _additionalSettings;
+
+ private BaseModel _calibration;
+
+ private string _serialNumber;
+
+ private int _binning = 1;
+
+ private SpinnakerCameraColorProcessing _colorProcessing = AindVrForagingDataSchema.Rig.SpinnakerCameraColorProcessing.Default;
+
+ private int _exposure = 1000;
+
+ private double _gain = 0D;
+
+ private double? _gamma;
+
+ private SpinnakerCameraAdcBitDepth? _adcBitDepth = AindVrForagingDataSchema.Rig.SpinnakerCameraAdcBitDepth.Adc8bit;
+
+ private SpinnakerCameraPixelFormat? _pixelFormat = AindVrForagingDataSchema.Rig.SpinnakerCameraPixelFormat.Mono8;
+
+ private Rect _regionOfInterest;
+
+ private VideoWriter _videoWriter;
+
+ public SpinnakerCamera()
+ {
+ }
+
+ protected SpinnakerCamera(SpinnakerCamera other)
+ {
+ _deviceType = other._deviceType;
+ _additionalSettings = other._additionalSettings;
+ _calibration = other._calibration;
+ _serialNumber = other._serialNumber;
+ _binning = other._binning;
+ _colorProcessing = other._colorProcessing;
+ _exposure = other._exposure;
+ _gain = other._gain;
+ _gamma = other._gamma;
+ _adcBitDepth = other._adcBitDepth;
+ _pixelFormat = other._pixelFormat;
+ _regionOfInterest = other._regionOfInterest;
+ _videoWriter = other._videoWriter;
+ }
+
+ ///
+ /// Device type
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ [System.ComponentModel.DescriptionAttribute("Device type")]
+ public string DeviceType
+ {
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
+ }
+
+ ///
+ /// Additional settings
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
+ [System.ComponentModel.DescriptionAttribute("Additional settings")]
+ public BaseModel AdditionalSettings
+ {
+ get
+ {
+ return _additionalSettings;
+ }
+ set
+ {
+ _additionalSettings = value;
+ }
+ }
+
+ ///
+ /// Calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ [System.ComponentModel.DescriptionAttribute("Calibration")]
+ public BaseModel Calibration
+ {
+ get
+ {
+ return _calibration;
+ }
+ set
+ {
+ _calibration = value;
+ }
+ }
+
+ ///
+ /// Camera serial number
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Camera serial number")]
+ public string SerialNumber
+ {
+ get
+ {
+ return _serialNumber;
+ }
+ set
+ {
+ _serialNumber = value;
+ }
+ }
+
+ ///
+ /// Binning
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("binning")]
+ [System.ComponentModel.DescriptionAttribute("Binning")]
+ public int Binning
+ {
+ get
+ {
+ return _binning;
+ }
+ set
+ {
+ _binning = value;
+ }
+ }
+
+ ///
+ /// Color processing
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("color_processing")]
+ [System.ComponentModel.DescriptionAttribute("Color processing")]
+ public SpinnakerCameraColorProcessing ColorProcessing
+ {
+ get
+ {
+ return _colorProcessing;
+ }
+ set
+ {
+ _colorProcessing = value;
+ }
+ }
+
+ ///
+ /// Exposure time
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("exposure")]
+ [System.ComponentModel.DescriptionAttribute("Exposure time")]
+ public int Exposure
+ {
+ get
+ {
+ return _exposure;
+ }
+ set
+ {
+ _exposure = value;
+ }
+ }
+
+ ///
+ /// Gain
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("gain")]
+ [System.ComponentModel.DescriptionAttribute("Gain")]
+ public double Gain
+ {
+ get
+ {
+ return _gain;
+ }
+ set
+ {
+ _gain = value;
+ }
+ }
+
+ ///
+ /// Gamma. If None, will disable gamma correction.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("gamma")]
+ [System.ComponentModel.DescriptionAttribute("Gamma. If None, will disable gamma correction.")]
+ public double? Gamma
+ {
+ get
+ {
+ return _gamma;
+ }
+ set
+ {
+ _gamma = value;
+ }
+ }
+
+ ///
+ /// ADC bit depth. If None will be left as default.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("adc_bit_depth")]
+ [System.ComponentModel.DescriptionAttribute("ADC bit depth. If None will be left as default.")]
+ public SpinnakerCameraAdcBitDepth? AdcBitDepth
+ {
+ get
+ {
+ return _adcBitDepth;
+ }
+ set
+ {
+ _adcBitDepth = value;
+ }
+ }
+
+ ///
+ /// Pixel format. If None will be left as default.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("pixel_format")]
+ [System.ComponentModel.DescriptionAttribute("Pixel format. If None will be left as default.")]
+ public SpinnakerCameraPixelFormat? PixelFormat
+ {
+ get
+ {
+ return _pixelFormat;
+ }
+ set
+ {
+ _pixelFormat = value;
+ }
+ }
+
+ ///
+ /// Region of interest
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("region_of_interest")]
+ [System.ComponentModel.DescriptionAttribute("Region of interest")]
+ public Rect RegionOfInterest
+ {
+ get
+ {
+ return _regionOfInterest;
+ }
+ set
+ {
+ _regionOfInterest = value;
+ }
+ }
+
+ ///
+ /// Video writer. If not provided, no video will be saved.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("video_writer")]
+ [System.ComponentModel.DescriptionAttribute("Video writer. If not provided, no video will be saved.")]
+ public VideoWriter VideoWriter
+ {
+ get
+ {
+ return _videoWriter;
+ }
+ set
+ {
+ _videoWriter = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new SpinnakerCamera(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new SpinnakerCamera(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("device_type = " + _deviceType + ", ");
+ stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
+ stringBuilder.Append("calibration = " + _calibration + ", ");
+ stringBuilder.Append("serial_number = " + _serialNumber + ", ");
+ stringBuilder.Append("binning = " + _binning + ", ");
+ stringBuilder.Append("color_processing = " + _colorProcessing + ", ");
+ stringBuilder.Append("exposure = " + _exposure + ", ");
+ stringBuilder.Append("gain = " + _gain + ", ");
+ stringBuilder.Append("gamma = " + _gamma + ", ");
+ stringBuilder.Append("adc_bit_depth = " + _adcBitDepth + ", ");
+ stringBuilder.Append("pixel_format = " + _pixelFormat + ", ");
+ stringBuilder.Append("region_of_interest = " + _regionOfInterest + ", ");
+ stringBuilder.Append("video_writer = " + _videoWriter);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ public enum SpinnakerCameraAdcBitDepth
+ {
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
+ Adc8bit = 0,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
+ Adc10bit = 1,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
+ Adc12bit = 2,
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ public enum SpinnakerCameraPixelFormat
+ {
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
+ Mono8 = 0,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
+ Mono16 = 1,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
+ Rgb8packed = 2,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
+ Bayergr8 = 3,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="4")]
+ Bayerrg8 = 4,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="5")]
+ Bayergb8 = 5,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="6")]
+ Bayerbg8 = 6,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="7")]
+ Bayergr16 = 7,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="8")]
+ Bayerrg16 = 8,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="9")]
+ Bayergb16 = 9,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="10")]
+ Bayerbg16 = 10,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="11")]
+ Mono12packed = 11,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="12")]
+ Bayergr12packed = 12,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="13")]
+ Bayerrg12packed = 13,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="14")]
+ Bayergb12packed = 14,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="15")]
+ Bayerbg12packed = 15,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="16")]
+ Yuv411packed = 16,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="17")]
+ Yuv422packed = 17,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="18")]
+ Yuv444packed = 18,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="19")]
+ Mono12p = 19,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="20")]
+ Bayergr12p = 20,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="21")]
+ Bayerrg12p = 21,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="22")]
+ Bayergb12p = 22,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="23")]
+ Bayerbg12p = 23,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="24")]
+ Ycbcr8 = 24,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="25")]
+ Ycbcr4228 = 25,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="26")]
+ Ycbcr4118 = 26,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="27")]
+ Bgr8 = 27,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="28")]
+ Bgra8 = 28,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="29")]
+ Mono10packed = 29,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="30")]
+ Bayergr10packed = 30,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="31")]
+ Bayerrg10packed = 31,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="32")]
+ Bayergb10packed = 32,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="33")]
+ Bayerbg10packed = 33,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="34")]
+ Mono10p = 34,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="35")]
+ Bayergr10p = 35,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="36")]
+ Bayerrg10p = 36,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="37")]
+ Bayergb10p = 37,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="38")]
+ Bayerbg10p = 38,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="39")]
+ Mono1p = 39,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="40")]
+ Mono2p = 40,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="41")]
+ Mono4p = 41,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="42")]
+ Mono8s = 42,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="43")]
+ Mono10 = 43,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="44")]
+ Mono12 = 44,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="45")]
+ Mono14 = 45,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="46")]
+ Mono16s = 46,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="47")]
+ Mono32f = 47,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="48")]
+ Bayerbg10 = 48,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="49")]
+ Bayerbg12 = 49,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="50")]
+ Bayergb10 = 50,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="51")]
+ Bayergb12 = 51,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="52")]
+ Bayergr10 = 52,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="53")]
+ Bayergr12 = 53,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="54")]
+ Bayerrg10 = 54,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="55")]
+ Bayerrg12 = 55,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="56")]
+ Rgba8 = 56,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="57")]
+ Rgba10 = 57,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="58")]
+ Rgba10p = 58,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="59")]
+ Rgba12 = 59,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="60")]
+ Rgba12p = 60,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="61")]
+ Rgba14 = 61,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="62")]
+ Rgba16 = 62,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="63")]
+ Rgb8 = 63,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="64")]
+ Rgb8Planar = 64,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="65")]
+ Rgb10 = 65,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="66")]
+ Rgb10Planar = 66,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="67")]
+ Rgb10p = 67,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="68")]
+ Rgb10p32 = 68,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="69")]
+ Rgb12 = 69,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="70")]
+ Rgb12Planar = 70,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="71")]
+ Rgb12p = 71,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="72")]
+ Rgb14 = 72,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="73")]
+ Rgb16 = 73,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="74")]
+ Rgb16s = 74,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="75")]
+ Rgb32f = 75,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="76")]
+ Rgb16Planar = 76,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="77")]
+ Rgb565p = 77,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="78")]
+ Bgra10 = 78,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="79")]
+ Bgra10p = 79,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="80")]
+ Bgra12 = 80,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="81")]
+ Bgra12p = 81,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="82")]
+ Bgra14 = 82,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="83")]
+ Bgra16 = 83,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="84")]
+ Rgba32f = 84,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="85")]
+ Bgr10 = 85,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="86")]
+ Bgr10p = 86,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="87")]
+ Bgr12 = 87,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="88")]
+ Bgr12p = 88,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="89")]
+ Bgr14 = 89,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="90")]
+ Bgr16 = 90,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="91")]
+ Bgr565p = 91,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="92")]
+ R8 = 92,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="93")]
+ R10 = 93,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="94")]
+ R12 = 94,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="95")]
+ R16 = 95,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="96")]
+ G8 = 96,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="97")]
+ G10 = 97,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="98")]
+ G12 = 98,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="99")]
+ G16 = 99,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="100")]
+ B8 = 100,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="101")]
+ B10 = 101,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="102")]
+ B12 = 102,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="103")]
+ B16 = 103,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="104")]
+ Coord3dAbc8 = 104,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="105")]
+ Coord3dAbc8Planar = 105,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="106")]
+ Coord3dAbc10p = 106,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="107")]
+ Coord3dAbc10pPlanar = 107,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="108")]
+ Coord3dAbc12p = 108,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="109")]
+ Coord3dAbc12pPlanar = 109,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="110")]
+ Coord3dAbc16 = 110,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="111")]
+ Coord3dAbc16Planar = 111,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="112")]
+ Coord3dAbc32f = 112,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="113")]
+ Coord3dAbc32fPlanar = 113,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="114")]
+ Coord3dAc8 = 114,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="115")]
+ Coord3dAc8Planar = 115,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="116")]
+ Coord3dAc10p = 116,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="117")]
+ Coord3dAc10pPlanar = 117,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="118")]
+ Coord3dAc12p = 118,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="119")]
+ Coord3dAc12pPlanar = 119,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="120")]
+ Coord3dAc16 = 120,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="121")]
+ Coord3dAc16Planar = 121,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="122")]
+ Coord3dAc32f = 122,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="123")]
+ Coord3dAc32fPlanar = 123,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="124")]
+ Coord3dA8 = 124,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="125")]
+ Coord3dA10p = 125,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="126")]
+ Coord3dA12p = 126,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="127")]
+ Coord3dA16 = 127,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="128")]
+ Coord3dA32f = 128,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="129")]
+ Coord3dB8 = 129,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="130")]
+ Coord3dB10p = 130,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="131")]
+ Coord3dB12p = 131,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="132")]
+ Coord3dB16 = 132,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="133")]
+ Coord3dB32f = 133,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="134")]
+ Coord3dC8 = 134,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="135")]
+ Coord3dC10p = 135,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="136")]
+ Coord3dC12p = 136,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="137")]
+ Coord3dC16 = 137,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="138")]
+ Coord3dC32f = 138,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="139")]
+ Confidence1 = 139,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="140")]
+ Confidence1p = 140,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="141")]
+ Confidence8 = 141,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="142")]
+ Confidence16 = 142,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="143")]
+ Confidence32f = 143,
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class Treadmill
+ {
+
+ private string _deviceType = "treadmill";
+
+ private BaseModel _additionalSettings;
- private string _calibrationDirectory = "Calibration\\Monitors\\";
+ private TreadmillCalibration _calibration;
- private string _textureAssetsDirectory = "Textures";
+ private int _whoAmI = 1402;
- private double _brightness = 0D;
+ private string _serialNumber;
- private double _contrast = 1D;
+ private string _portName;
- public Screen()
+ public Treadmill()
{
}
- protected Screen(Screen other)
+ protected Treadmill(Treadmill other)
{
_deviceType = other._deviceType;
_additionalSettings = other._additionalSettings;
_calibration = other._calibration;
- _displayIndex = other._displayIndex;
- _targetRenderFrequency = other._targetRenderFrequency;
- _targetUpdateFrequency = other._targetUpdateFrequency;
- _calibrationDirectory = other._calibrationDirectory;
- _textureAssetsDirectory = other._textureAssetsDirectory;
- _brightness = other._brightness;
- _contrast = other._contrast;
+ _whoAmI = other._whoAmI;
+ _serialNumber = other._serialNumber;
+ _portName = other._portName;
}
- ///
- /// Device type
- ///
[Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- [System.ComponentModel.DescriptionAttribute("Device type")]
public string DeviceType
{
get
@@ -3135,13 +4799,9 @@ public BaseModel AdditionalSettings
}
}
- ///
- /// Calibration
- ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
[Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration")]
- public BaseModel Calibration
+ public TreadmillCalibration Calibration
{
get
{
@@ -3153,133 +4813,61 @@ public BaseModel Calibration
}
}
- ///
- /// Display index
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("display_index")]
- [System.ComponentModel.DescriptionAttribute("Display index")]
- public int DisplayIndex
- {
- get
- {
- return _displayIndex;
- }
- set
- {
- _displayIndex = value;
- }
- }
-
- ///
- /// Target render frequency
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("target_render_frequency")]
- [System.ComponentModel.DescriptionAttribute("Target render frequency")]
- public double TargetRenderFrequency
- {
- get
- {
- return _targetRenderFrequency;
- }
- set
- {
- _targetRenderFrequency = value;
- }
- }
-
- ///
- /// Target update frequency
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("target_update_frequency")]
- [System.ComponentModel.DescriptionAttribute("Target update frequency")]
- public double TargetUpdateFrequency
- {
- get
- {
- return _targetUpdateFrequency;
- }
- set
- {
- _targetUpdateFrequency = value;
- }
- }
-
- ///
- /// Calibration directory
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("calibration_directory")]
- [System.ComponentModel.DescriptionAttribute("Calibration directory")]
- public string CalibrationDirectory
- {
- get
- {
- return _calibrationDirectory;
- }
- set
- {
- _calibrationDirectory = value;
- }
- }
-
- ///
- /// Calibration directory
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("texture_assets_directory")]
- [System.ComponentModel.DescriptionAttribute("Calibration directory")]
- public string TextureAssetsDirectory
+ [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
+ public int WhoAmI
{
get
{
- return _textureAssetsDirectory;
+ return _whoAmI;
}
set
{
- _textureAssetsDirectory = value;
+ _whoAmI = value;
}
}
///
- /// Brightness
+ /// Device serial number
///
- [Newtonsoft.Json.JsonPropertyAttribute("brightness")]
- [System.ComponentModel.DescriptionAttribute("Brightness")]
- public double Brightness
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
+ [System.ComponentModel.DescriptionAttribute("Device serial number")]
+ public string SerialNumber
{
get
{
- return _brightness;
+ return _serialNumber;
}
set
{
- _brightness = value;
+ _serialNumber = value;
}
}
///
- /// Contrast
+ /// Device port name
///
- [Newtonsoft.Json.JsonPropertyAttribute("contrast")]
- [System.ComponentModel.DescriptionAttribute("Contrast")]
- public double Contrast
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Device port name")]
+ public string PortName
{
get
{
- return _contrast;
+ return _portName;
}
set
{
- _contrast = value;
+ _portName = value;
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Screen(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Treadmill(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new Screen(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new Treadmill(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -3287,13 +4875,9 @@ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
stringBuilder.Append("device_type = " + _deviceType + ", ");
stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
stringBuilder.Append("calibration = " + _calibration + ", ");
- stringBuilder.Append("display_index = " + _displayIndex + ", ");
- stringBuilder.Append("target_render_frequency = " + _targetRenderFrequency + ", ");
- stringBuilder.Append("target_update_frequency = " + _targetUpdateFrequency + ", ");
- stringBuilder.Append("calibration_directory = " + _calibrationDirectory + ", ");
- stringBuilder.Append("texture_assets_directory = " + _textureAssetsDirectory + ", ");
- stringBuilder.Append("brightness = " + _brightness + ", ");
- stringBuilder.Append("contrast = " + _contrast);
+ stringBuilder.Append("who_am_i = " + _whoAmI + ", ");
+ stringBuilder.Append("serial_number = " + _serialNumber + ", ");
+ stringBuilder.Append("port_name = " + _portName);
return true;
}
@@ -3312,226 +4896,190 @@ public override string ToString()
}
+ ///
+ /// Treadmill calibration class
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Treadmill calibration class")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class SpinnakerCamera
+ public partial class TreadmillCalibration
{
- private string _deviceType = "SpinnakerCamera";
-
- private BaseModel _additionalSettings;
-
- private BaseModel _calibration;
-
- private string _serialNumber;
+ private string _deviceName = "Treadmill";
- private int _binning = 1;
+ private TreadmillCalibrationInput _input = new TreadmillCalibrationInput();
- private SpinnakerCameraColorProcessing _colorProcessing = AindVrForagingDataSchema.Rig.SpinnakerCameraColorProcessing.Default;
+ private TreadmillCalibrationOutput _output = new TreadmillCalibrationOutput();
- private int _exposure = 1000;
+ private System.DateTimeOffset? _date;
- private double _gain = 0D;
+ private string _description = "Calibration of the treadmill system";
- private VideoWriter _videoWriter;
+ private string _notes;
- public SpinnakerCamera()
+ public TreadmillCalibration()
{
}
- protected SpinnakerCamera(SpinnakerCamera other)
+ protected TreadmillCalibration(TreadmillCalibration other)
{
- _deviceType = other._deviceType;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _serialNumber = other._serialNumber;
- _binning = other._binning;
- _colorProcessing = other._colorProcessing;
- _exposure = other._exposure;
- _gain = other._gain;
- _videoWriter = other._videoWriter;
+ _deviceName = other._deviceName;
+ _input = other._input;
+ _output = other._output;
+ _date = other._date;
+ _description = other._description;
+ _notes = other._notes;
}
///
- /// Device type
+ /// Must match a device name in rig/instrument
///
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- [System.ComponentModel.DescriptionAttribute("Device type")]
- public string DeviceType
+ [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
+ [System.ComponentModel.DescriptionAttribute("Must match a device name in rig/instrument")]
+ public string DeviceName
{
get
{
- return _deviceType;
+ return _deviceName;
}
set
{
- _deviceType = value;
+ _deviceName = value;
}
}
- ///
- /// Additional settings
- ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("additional_settings")]
- [System.ComponentModel.DescriptionAttribute("Additional settings")]
- public BaseModel AdditionalSettings
+ [Newtonsoft.Json.JsonPropertyAttribute("input", Required=Newtonsoft.Json.Required.Always)]
+ public TreadmillCalibrationInput Input
{
get
{
- return _additionalSettings;
+ return _input;
}
set
{
- _additionalSettings = value;
+ _input = value;
}
}
- ///
- /// Calibration
- ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- [System.ComponentModel.DescriptionAttribute("Calibration")]
- public BaseModel Calibration
- {
- get
- {
- return _calibration;
- }
- set
- {
- _calibration = value;
- }
- }
-
- ///
- /// Camera serial number
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("serial_number", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Camera serial number")]
- public string SerialNumber
- {
- get
- {
- return _serialNumber;
- }
- set
- {
- _serialNumber = value;
- }
- }
-
- ///
- /// Binning
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("binning")]
- [System.ComponentModel.DescriptionAttribute("Binning")]
- public int Binning
+ [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
+ public TreadmillCalibrationOutput Output
{
get
{
- return _binning;
+ return _output;
}
set
{
- _binning = value;
+ _output = value;
}
}
- ///
- /// Color processing
- ///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("color_processing")]
- [System.ComponentModel.DescriptionAttribute("Color processing")]
- public SpinnakerCameraColorProcessing ColorProcessing
+ [Newtonsoft.Json.JsonPropertyAttribute("date")]
+ public System.DateTimeOffset? Date
{
get
{
- return _colorProcessing;
+ return _date;
}
set
{
- _colorProcessing = value;
+ _date = value;
}
}
- ///
- /// Exposure time
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("exposure")]
- [System.ComponentModel.DescriptionAttribute("Exposure time")]
- public int Exposure
+ [Newtonsoft.Json.JsonPropertyAttribute("description")]
+ public string Description
{
get
{
- return _exposure;
+ return _description;
}
set
{
- _exposure = value;
+ _description = value;
}
}
- ///
- /// Gain
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("gain")]
- [System.ComponentModel.DescriptionAttribute("Gain")]
- public double Gain
+ [Newtonsoft.Json.JsonPropertyAttribute("notes")]
+ public string Notes
{
get
{
- return _gain;
+ return _notes;
}
set
{
- _gain = value;
+ _notes = value;
}
}
- ///
- /// Video writer. If not provided, no video will be saved.
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("video_writer")]
- [System.ComponentModel.DescriptionAttribute("Video writer. If not provided, no video will be saved.")]
- public VideoWriter VideoWriter
+ public System.IObservable Process()
{
- get
- {
- return _videoWriter;
- }
- set
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new TreadmillCalibration(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new TreadmillCalibration(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("device_name = " + _deviceName + ", ");
+ stringBuilder.Append("input = " + _input + ", ");
+ stringBuilder.Append("output = " + _output + ", ");
+ stringBuilder.Append("date = " + _date + ", ");
+ stringBuilder.Append("description = " + _description + ", ");
+ stringBuilder.Append("notes = " + _notes);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
{
- _videoWriter = value;
+ stringBuilder.Append(" ");
}
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class TreadmillCalibrationInput
+ {
+
+ public TreadmillCalibrationInput()
+ {
}
- public System.IObservable Process()
+ protected TreadmillCalibrationInput(TreadmillCalibrationInput other)
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new SpinnakerCamera(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Select(source, _ => new SpinnakerCamera(this));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new TreadmillCalibrationInput(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new TreadmillCalibrationInput(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
- stringBuilder.Append("device_type = " + _deviceType + ", ");
- stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
- stringBuilder.Append("calibration = " + _calibration + ", ");
- stringBuilder.Append("serial_number = " + _serialNumber + ", ");
- stringBuilder.Append("binning = " + _binning + ", ");
- stringBuilder.Append("color_processing = " + _colorProcessing + ", ");
- stringBuilder.Append("exposure = " + _exposure + ", ");
- stringBuilder.Append("gain = " + _gain + ", ");
- stringBuilder.Append("video_writer = " + _videoWriter);
- return true;
+ return false;
}
public override string ToString()
@@ -3549,15 +5097,10 @@ public override string ToString()
}
- ///
- /// Overrides the default settings for the treadmill calibration by spec'ing brake_lookup_calibration field
- ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Overrides the default settings for the treadmill calibration by spec\'ing brake_lo" +
- "okup_calibration field")]
[Bonsai.CombinatorAttribute()]
[Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class Treadmill
+ public partial class TreadmillCalibrationOutput
{
private double _wheelDiameter = 15D;
@@ -3568,11 +5111,11 @@ public partial class Treadmill
private System.Collections.Generic.List> _brakeLookupCalibration = new System.Collections.Generic.List>();
- public Treadmill()
+ public TreadmillCalibrationOutput()
{
}
- protected Treadmill(Treadmill other)
+ protected TreadmillCalibrationOutput(TreadmillCalibrationOutput other)
{
_wheelDiameter = other._wheelDiameter;
_pulsesPerRevolution = other._pulsesPerRevolution;
@@ -3632,12 +5175,12 @@ public bool InvertDirection
}
///
- /// Brake lookup calibration. Each Tuple is (0-1 (percent), 0-full-scale). Values are linearly interpolated
+ /// Brake lookup calibration. Each pair of values define (input [torque], output [brake set-point U16])
///
[System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("brake_lookup_calibration")]
- [System.ComponentModel.DescriptionAttribute("Brake lookup calibration. Each Tuple is (0-1 (percent), 0-full-scale). " +
- " Values are linearly interpolated")]
+ [Newtonsoft.Json.JsonPropertyAttribute("brake_lookup_calibration", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Brake lookup calibration. Each pair of values define (input [torque], output [bra" +
+ "ke set-point U16])")]
public System.Collections.Generic.List> BrakeLookupCalibration
{
get
@@ -3650,14 +5193,14 @@ public System.Collections.Generic.List>
}
}
- public System.IObservable Process()
+ public System.IObservable Process()
{
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Treadmill(this)));
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new TreadmillCalibrationOutput(this)));
}
- public System.IObservable Process(System.IObservable source)
+ public System.IObservable Process(System.IObservable source)
{
- return System.Reactive.Linq.Observable.Select(source, _ => new Treadmill(this));
+ return System.Reactive.Linq.Observable.Select(source, _ => new TreadmillCalibrationOutput(this));
}
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
@@ -3684,6 +5227,113 @@ public override string ToString()
}
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.CombinatorAttribute()]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ public partial class Vector3
+ {
+
+ private double _x = 0D;
+
+ private double _y = 0D;
+
+ private double _z = 0D;
+
+ public Vector3()
+ {
+ }
+
+ protected Vector3(Vector3 other)
+ {
+ _x = other._x;
+ _y = other._y;
+ _z = other._z;
+ }
+
+ ///
+ /// X coordinate of the point
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("x")]
+ [System.ComponentModel.DescriptionAttribute("X coordinate of the point")]
+ public double X
+ {
+ get
+ {
+ return _x;
+ }
+ set
+ {
+ _x = value;
+ }
+ }
+
+ ///
+ /// Y coordinate of the point
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("y")]
+ [System.ComponentModel.DescriptionAttribute("Y coordinate of the point")]
+ public double Y
+ {
+ get
+ {
+ return _y;
+ }
+ set
+ {
+ _y = value;
+ }
+ }
+
+ ///
+ /// Z coordinate of the point
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("z")]
+ [System.ComponentModel.DescriptionAttribute("Z coordinate of the point")]
+ public double Z
+ {
+ get
+ {
+ return _z;
+ }
+ set
+ {
+ _z = value;
+ }
+ }
+
+ public System.IObservable Process()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Vector3(this)));
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new Vector3(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("x = " + _x + ", ");
+ stringBuilder.Append("y = " + _y + ", ");
+ stringBuilder.Append("z = " + _z);
+ return true;
+ }
+
+ public override string ToString()
+ {
+ System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+ stringBuilder.Append(GetType().Name);
+ stringBuilder.Append(" { ");
+ if (PrintMembers(stringBuilder))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.3.0.0 (Newtonsoft.Json v13.0.0.0)")]
[Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "video_writer_type")]
[JsonInheritanceAttribute("FFMPEG", typeof(VideoWriterFfmpeg))]
@@ -3741,7 +5391,9 @@ public partial class VideoWriterFfmpeg : VideoWriter
private string _containerExtension = "mp4";
- private string _outputArguments = "-c:v hevc_nvenc -pix_fmt x2rgb10le -color_range full -tune hq -preset p3 -rc vbr -cq 16 -rc-lookahead 56 -temporal-aq 1 -qmin 0 -qmax 10";
+ private string _outputArguments = "-vf \"scale=out_color_matrix=bt709:out_range=full,format=bgr24,scale=out_range=full\" -c:v h264_nvenc -pix_fmt yuv420p -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -metadata author=\"Allen Institute for Neural Dynamics\" -maxrate 700M -bufsize 350M";
+
+ private string _inputArguments = "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear";
public VideoWriterFfmpeg()
{
@@ -3753,6 +5405,7 @@ protected VideoWriterFfmpeg(VideoWriterFfmpeg other) :
_frameRate = other._frameRate;
_containerExtension = other._containerExtension;
_outputArguments = other._outputArguments;
+ _inputArguments = other._inputArguments;
}
///
@@ -3806,6 +5459,23 @@ public string OutputArguments
}
}
+ ///
+ /// Input arguments
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("input_arguments")]
+ [System.ComponentModel.DescriptionAttribute("Input arguments")]
+ public string InputArguments
+ {
+ get
+ {
+ return _inputArguments;
+ }
+ set
+ {
+ _inputArguments = value;
+ }
+ }
+
public System.IObservable Process()
{
return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new VideoWriterFfmpeg(this)));
@@ -3824,7 +5494,8 @@ protected override bool PrintMembers(System.Text.StringBuilder stringBuilder)
}
stringBuilder.Append("frame_rate = " + _frameRate + ", ");
stringBuilder.Append("container_extension = " + _containerExtension + ", ");
- stringBuilder.Append("output_arguments = " + _outputArguments);
+ stringBuilder.Append("output_arguments = " + _outputArguments + ", ");
+ stringBuilder.Append("input_arguments = " + _inputArguments);
return true;
}
}
@@ -4467,7 +6138,9 @@ public override string ToString()
public partial class AindVrForagingRig
{
- private string _version = "0.3.0";
+ private string _aindBehaviorServicesPkgVersion = "0.9.0";
+
+ private string _version = "0.4.0";
private string _computerName;
@@ -4489,10 +6162,12 @@ public partial class AindVrForagingRig
private HarpAnalogInput _harpAnalogInput;
- private HarpTreadmill _harpTreadmill = new HarpTreadmill();
+ private Treadmill _harpTreadmill = new Treadmill();
private HarpSniffDetector _harpSniffDetector;
+ private HarpEnvironmentSensor _harpEnvironmentSensor;
+
private AindManipulatorDevice _manipulator = new AindManipulatorDevice();
private Screen _screen;
@@ -4505,6 +6180,7 @@ public AindVrForagingRig()
protected AindVrForagingRig(AindVrForagingRig other)
{
+ _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
_version = other._version;
_computerName = other._computerName;
_rigName = other._rigName;
@@ -4518,11 +6194,25 @@ protected AindVrForagingRig(AindVrForagingRig other)
_harpAnalogInput = other._harpAnalogInput;
_harpTreadmill = other._harpTreadmill;
_harpSniffDetector = other._harpSniffDetector;
+ _harpEnvironmentSensor = other._harpEnvironmentSensor;
_manipulator = other._manipulator;
_screen = other._screen;
_calibration = other._calibration;
}
+ [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
+ public string AindBehaviorServicesPkgVersion
+ {
+ get
+ {
+ return _aindBehaviorServicesPkgVersion;
+ }
+ set
+ {
+ _aindBehaviorServicesPkgVersion = value;
+ }
+ }
+
[Newtonsoft.Json.JsonPropertyAttribute("version")]
public string Version
{
@@ -4720,7 +6410,7 @@ public HarpAnalogInput HarpAnalogInput
[System.Xml.Serialization.XmlIgnoreAttribute()]
[Newtonsoft.Json.JsonPropertyAttribute("harp_treadmill", Required=Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DescriptionAttribute("Harp treadmill")]
- public HarpTreadmill HarpTreadmill
+ public Treadmill HarpTreadmill
{
get
{
@@ -4750,6 +6440,24 @@ public HarpSniffDetector HarpSniffDetector
}
}
+ ///
+ /// Environment sensor
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_environment_sensor")]
+ [System.ComponentModel.DescriptionAttribute("Environment sensor")]
+ public HarpEnvironmentSensor HarpEnvironmentSensor
+ {
+ get
+ {
+ return _harpEnvironmentSensor;
+ }
+ set
+ {
+ _harpEnvironmentSensor = value;
+ }
+ }
+
///
/// Manipulator
///
@@ -4816,6 +6524,7 @@ public System.IObservable Process(System.IObservable
protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
{
+ stringBuilder.Append("aind_behavior_services_pkg_version = " + _aindBehaviorServicesPkgVersion + ", ");
stringBuilder.Append("version = " + _version + ", ");
stringBuilder.Append("computer_name = " + _computerName + ", ");
stringBuilder.Append("rig_name = " + _rigName + ", ");
@@ -4829,6 +6538,7 @@ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
stringBuilder.Append("harp_analog_input = " + _harpAnalogInput + ", ");
stringBuilder.Append("harp_treadmill = " + _harpTreadmill + ", ");
stringBuilder.Append("harp_sniff_detector = " + _harpSniffDetector + ", ");
+ stringBuilder.Append("harp_environment_sensor = " + _harpEnvironmentSensor + ", ");
stringBuilder.Append("manipulator = " + _manipulator + ", ");
stringBuilder.Append("screen = " + _screen + ", ");
stringBuilder.Append("calibration = " + _calibration);
@@ -5113,6 +6823,31 @@ public System.IObservable Process(System.IObservable(source);
}
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
public System.IObservable Process(System.IObservable source)
{
return Process(source);
@@ -5128,6 +6863,11 @@ public System.IObservable Process(System.IObservable
return Process(source);
}
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
public System.IObservable Process(System.IObservable source)
{
return Process(source);
@@ -5143,11 +6883,6 @@ public System.IObservable Process(System.IObservable
return Process(source);
}
- public System.IObservable Process(System.IObservable source)
- {
- return Process(source);
- }
-
public System.IObservable Process(System.IObservable source)
{
return Process(source);
@@ -5178,6 +6913,11 @@ public System.IObservable Process(System.IObservable(source);
}
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
public System.IObservable Process(System.IObservable source)
{
return Process(source);
@@ -5198,6 +6938,26 @@ public System.IObservable Process(System.IObservable source)
return Process(source);
}
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
+ public System.IObservable Process(System.IObservable source)
+ {
+ return Process(source);
+ }
+
+ public System.IObservable