From d020c739c0bacf4add0c05bc80428116e3508f7b Mon Sep 17 00:00:00 2001
From: bruno-f-cruz <7049351+bruno-f-cruz@users.noreply.github.com>
Date: Thu, 2 Oct 2025 13:38:03 -0700
Subject: [PATCH] Attempt to refactor workflow using copier
---
.config/dotnet-tools.json | 2 +-
.copier-answers.yml | 5 +
.editorconfig | 27 +
.flake8 | 7 +
.../aind-behavior-device-water-tuner-cicd.yml | 207 ++
.github/workflows/ci.yml | 25 -
.github/workflows/docs.yml | 24 -
.github/workflows/tag_and_publish.yml | 10 -
.gitignore | 15 +-
.python-version | 4 +-
bonsai/NuGet.config | 7 +-
bonsai/setup.ps1 | 1 -
docs/conf.py | 35 +-
docs/index.rst | 9 +-
docs/json-schemas.rig.rst | 10 -
docs/json-schemas.rst | 22 +-
docs/json-schemas.session.rst | 8 -
docs/json-schemas.task_logic.rst | 9 -
examples/clabe.yml | 19 +
examples/example.py | 83 -
examples/rig.py | 49 +
examples/session.py | 29 +
examples/task_logic.py | 31 +
pyproject.toml | 61 +-
...{regenerate_environment.cmd => deploy.cmd} | 0
scripts/deploy.ps1 | 31 +
scripts/launcher.cmd | 6 +
scripts/launcher.ps1 | 3 +
scripts/regenerate_environment.ps1 | 15 -
src/.gitignore | 5 +
.../aind_behavior_device_water_tuner.json | 956 ++++++
src/Extensions.csproj | 18 +-
.../AindBehaviorDeviceWaterTuner.Generated.cs | 2817 +++++++++++++++++
src/Extensions/AindBehaviorSessionModel.cs | 379 ---
src/Extensions/AindBehaviorWaterTunerRig.cs | 1539 ---------
.../AindBehaviorWaterTunerTaskLogic.cs | 364 ---
src/Extensions/ExtensionDataTypes.cs | 667 ----
src/Extensions/Logging.bonsai | 25 +-
src/Extensions/WaterCalibrationModel.cs | 2 +-
.../__init__.py | 31 +-
src/aind_behavior_device_water_tuner/cli.py | 44 +
.../data_types.py | 2 -
.../launcher.py | 84 +-
.../regenerate.py | 41 +-
src/aind_behavior_device_water_tuner/rig.py | 7 +-
.../task_logic.py | 25 +-
src/main.bonsai | 81 +-
tests/__init__.py | 3 +-
uv.lock | 1600 ++++------
49 files changed, 5123 insertions(+), 4321 deletions(-)
create mode 100644 .copier-answers.yml
create mode 100644 .editorconfig
create mode 100644 .flake8
create mode 100644 .github/workflows/aind-behavior-device-water-tuner-cicd.yml
delete mode 100644 .github/workflows/ci.yml
delete mode 100644 .github/workflows/docs.yml
delete mode 100644 .github/workflows/tag_and_publish.yml
delete mode 100644 docs/json-schemas.rig.rst
delete mode 100644 docs/json-schemas.session.rst
delete mode 100644 docs/json-schemas.task_logic.rst
create mode 100644 examples/clabe.yml
delete mode 100644 examples/example.py
create mode 100644 examples/rig.py
create mode 100644 examples/session.py
create mode 100644 examples/task_logic.py
rename scripts/{regenerate_environment.cmd => deploy.cmd} (100%)
create mode 100644 scripts/deploy.ps1
create mode 100644 scripts/launcher.cmd
create mode 100644 scripts/launcher.ps1
delete mode 100644 scripts/regenerate_environment.ps1
create mode 100644 src/.gitignore
create mode 100644 src/DataSchemas/aind_behavior_device_water_tuner.json
create mode 100644 src/Extensions/AindBehaviorDeviceWaterTuner.Generated.cs
delete mode 100644 src/Extensions/AindBehaviorSessionModel.cs
delete mode 100644 src/Extensions/AindBehaviorWaterTunerRig.cs
delete mode 100644 src/Extensions/AindBehaviorWaterTunerTaskLogic.cs
delete mode 100644 src/Extensions/ExtensionDataTypes.cs
create mode 100644 src/aind_behavior_device_water_tuner/cli.py
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index a1a9bfe..44b1c27 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"bonsai.sgen": {
- "version": "0.4.0",
+ "version": "0.6.1",
"commands": [
"bonsai.sgen"
]
diff --git a/.copier-answers.yml b/.copier-answers.yml
new file mode 100644
index 0000000..50327d1
--- /dev/null
+++ b/.copier-answers.yml
@@ -0,0 +1,5 @@
+_src_path: ..\Aind.Behavior.CopierTemplate\aind-behavior-template\
+author_email: bruno.cruz@alleninstitute.org
+author_name: Bruno F. Cruz
+prefix: aind-behavior-device
+project_name: water-tuner
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..eaec598
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,27 @@
+# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
+###############################
+# Core EditorConfig Options #
+###############################
+# All files
+[*]
+indent_style = space
+
+# XML project files
+[*.{csproj,vcxproj,vcxproj.filters,proj,projitems,shproj,bonsai}]
+indent_size = 2
+
+# XML config files
+[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
+indent_size = 2
+
+# Code files
+[*.{cs,csx}]
+indent_size = 4
+insert_final_newline = true
+charset = utf-8-bom
+###############################
+# .NET Coding Conventions #
+###############################
+[*.{cs}]
+# Organize usings
+dotnet_sort_system_directives_first = true
diff --git a/.flake8 b/.flake8
new file mode 100644
index 0000000..07bd2e2
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,7 @@
+[flake8]
+exclude =
+ .git,
+ __pycache__,
+ build
+max-complexity = 10
+max-line-length = 120
\ No newline at end of file
diff --git a/.github/workflows/aind-behavior-device-water-tuner-cicd.yml b/.github/workflows/aind-behavior-device-water-tuner-cicd.yml
new file mode 100644
index 0000000..32450ea
--- /dev/null
+++ b/.github/workflows/aind-behavior-device-water-tuner-cicd.yml
@@ -0,0 +1,207 @@
+name: water-tuner test suite
+
+on:
+ workflow_dispatch:
+ pull_request:
+ push:
+ branches:
+ - main
+ - dev*
+ - release*
+ release:
+ types: [published]
+
+jobs:
+ # ╔──────────────────────────╗
+ # │ _____ _ │
+ # │ |_ _|__ ___| |_ ___ │
+ # │ | |/ _ \/ __| __/ __| │
+ # │ | | __/\__ \ |_\__ \ │
+ # │ |_|\___||___/\__|___/ │
+ # │ │
+ # ╚──────────────────────────╝
+ tests:
+ runs-on: windows-latest
+ name: water-tuner unit tests
+ steps:
+ - uses: actions/checkout@v5
+
+ - uses: astral-sh/setup-uv@v6
+ with:
+ enable-cache: true
+
+ - name: Install python dependencies
+ run: uv sync
+
+ - name: Run ruff format
+ run: uv run ruff format
+
+ - name: Run ruff check
+ run: uv run ruff check
+
+ - name: Run codespell
+ run: uv run codespell
+
+ - name: Setup .NET Core SDK
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 8.x
+
+ - name: Restore dotnet tools
+ run: dotnet tool restore
+
+ - name: Setup Bonsai environment
+ working-directory: ./bonsai
+ run: ./setup.ps1
+
+ - name: Run python unit tests
+ run: uv run python -m unittest
+
+ - name: Regenerate schemas
+ run: uv run water-tuner regenerate
+
+ - name: Check for uncommitted changes
+ run: |
+ git config --global core.safecrlf false
+ git diff --exit-code || (echo "Untracked changes found" && exit 1)
+
+ # ╔───────────────────────────────────────────────────────────╗
+ # │ ____ ___ ____ ____ ____ _ │
+ # │ / ___|_ _/ ___| _ \ | _ \ ___| | ___ __ _ ___ ___ │
+ # │ | | | | | | | | | | |_) / _ \ |/ _ \/ _` / __|/ _ \ │
+ # │ | |___ | | |___| |_| | | _ < __/ | __/ (_| \__ \ __/ │
+ # │ \____|___\____|____/ |_| \_\___|_|\___|\__,_|___/\___| │
+ # │ │
+ # ╚───────────────────────────────────────────────────────────╝
+ github-rc-release:
+ needs: tests
+ runs-on: ubuntu-latest
+ if: >
+ github.ref == 'refs/heads/main' &&
+ github.event_name == 'push' &&
+ github.event.head_commit.author.email != 'github-actions[bot]@users.noreply.github.com'
+ name: Create GitHub pre-release
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ fetch-depth: 0
+ ref: main
+
+ - uses: astral-sh/setup-uv@v6
+ with:
+ enable-cache: true
+
+ - name: Bump pre-release by default
+ run: uv version --bump rc
+
+ - name: Regenerate schemas
+ run: uv run water-tuner regenerate
+
+ - name: Commit version and schema changes
+ run: |
+ git config --global user.name "github-actions[bot]"
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
+ git add .
+ git commit -m "Bump version and regenerate schemas [skip ci]" || echo "No changes to commit"
+ git push origin main
+
+ - name: Get version
+ id: get_version
+ run: |
+ version=$(uv version --output-format json | jq -r '.version')
+ echo "version=$version" >> $GITHUB_OUTPUT
+
+ - name: Create GitHub Release
+ uses: softprops/action-gh-release@v2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: v${{ steps.get_version.outputs.version }}
+ name: v${{ steps.get_version.outputs.version }}
+ generate_release_notes: true
+ prerelease: true
+ body: |
+ Automated pre-release v${{ steps.get_version.outputs.version }}
+
+ # ╔─────────────────────────────────────────────────────────────────╗
+ # │ ____ _ _ _ ____ _ │
+ # │ | _ \ _ _| |__ | (_) ___ | _ \ ___| | ___ __ _ ___ ___ │
+ # │ | |_) | | | | '_ \| | |/ __| | |_) / _ \ |/ _ \/ _` / __|/ _ \ │
+ # │ | __/| |_| | |_) | | | (__ | _ < __/ | __/ (_| \__ \ __/ │
+ # │ |_| \__,_|_.__/|_|_|\___| |_| \_\___|_|\___|\__,_|___/\___| │
+ # │ │
+ # ╚─────────────────────────────────────────────────────────────────╝
+
+ github-public-release:
+ runs-on: ubuntu-latest
+ name: Create GitHub public release
+ needs: tests
+ if: github.event_name == 'release' &&
+ github.event.action == 'published' &&
+ !github.event.release.prerelease
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ fetch-depth: 0
+ ref: main
+
+ - uses: astral-sh/setup-uv@v6
+ with:
+ enable-cache: true
+
+ - name: Get release version from tag
+ id: get_version
+ run: echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
+
+ - name: Validate version tag format
+ run: uv version ${{ steps.get_version.outputs.version }} --dry-run
+
+ - name: Update package version
+ run: uv version ${{ steps.get_version.outputs.version }}
+
+ - name: Regenerate schemas
+ run: uv run water-tuner regenerate
+
+ - name: Commit version and schema changes
+ run: |
+ git config --global user.name "github-actions[bot]"
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
+ git add .
+ git commit -m "Set version and regenerate schemas" || echo "No changes to commit"
+ git push origin main
+
+ # ╔─────────────────────────╗
+ # │ ____ │
+ # │ | _ \ ___ ___ ___ │
+ # │ | | | |/ _ \ / __/ __| │
+ # │ | |_| | (_) | (__\__ \ │
+ # │ |____/ \___/ \___|___/ │
+ # │ │
+ # ╚─────────────────────────╝
+ build-docs:
+ name: Build and deploy documentation to GitHub Pages
+ runs-on: ubuntu-latest
+ needs: github-rc-release
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v5
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v3
+
+ - name: Setup Graphviz
+ uses: ts-graphviz/setup-graphviz@v2
+
+ - name: Install docs group of dependencies
+ run: uv sync --group docs
+
+ - name: Build Sphinx documentation
+ run: uv run sphinx-build -b html docs/ _build/html
+
+ - name: Deploy to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v4
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: _build/html
+ force_orphan: true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 1f9538a..0000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-name: ci/cd
-
-on:
- workflow_dispatch:
- pull_request:
- branches:
- - main
- push:
- branches:
- - main
-
-jobs:
-
- python-linting:
- uses: AllenNeuralDynamics/Aind.Behavior.GitHubActions/.github/workflows/python-linting.yml@main
- with:
- runs-on: windows-latest
-
- 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
- runs-on: windows-latest
\ No newline at end of file
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
deleted file mode 100644
index 68c570b..0000000
--- a/.github/workflows/docs.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: Deploy Sphinx documentation to Pages
-
-on:
- workflow_dispatch:
- push:
- branches: [main]
-
-jobs:
- pages:
- runs-on: ubuntu-latest
- steps:
- - name: Setup Graphviz
- uses: ts-graphviz/setup-graphviz@v2.0.2
- - id: deployment
- uses: sphinx-notes/pages@v3
- with:
- publish: false
- python_version: 3.11
- checkout: true
- - uses: peaceiris/actions-gh-pages@v3
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_dir: ${{ steps.deployment.outputs.artifact }}
- force_orphan: true
\ No newline at end of file
diff --git a/.github/workflows/tag_and_publish.yml b/.github/workflows/tag_and_publish.yml
deleted file mode 100644
index 1f566ac..0000000
--- a/.github/workflows/tag_and_publish.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-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/.gitignore b/.gitignore
index 59231ef..4053511 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ bin
obj
Packages
Bonsai.exe.WebView2
+Bonsai/Settings/
*.bin
*.avi
*.dll
@@ -12,7 +13,8 @@ Bonsai.exe.WebView2
*.exe.settings
*.bonsai.layout
local
-*.snl
+.venv
+
# Byte-compiled / optimized / DLL files
__pycache__/
@@ -80,13 +82,4 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
-# .python-version
-
-# mypy
-.mypy_cache/
-
-# ruff
-.ruff_cache/
-
-# venv files
-.venv
+# .python-version
\ No newline at end of file
diff --git a/.python-version b/.python-version
index 06c7113..31a10be 100644
--- a/.python-version
+++ b/.python-version
@@ -1,3 +1,3 @@
-3.11
+3.13
3.12
-3.13
\ No newline at end of file
+3.11
\ No newline at end of file
diff --git a/bonsai/NuGet.config b/bonsai/NuGet.config
index a0adc59..35696f8 100644
--- a/bonsai/NuGet.config
+++ b/bonsai/NuGet.config
@@ -1,9 +1,6 @@
-
-
-
-
-
+
+
diff --git a/bonsai/setup.ps1 b/bonsai/setup.ps1
index 01cfba6..890eeda 100644
--- a/bonsai/setup.ps1
+++ b/bonsai/setup.ps1
@@ -15,7 +15,6 @@ if (!(Test-Path "./Bonsai.exe")) {
Expand-Archive "temp.zip" -DestinationPath "." -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
Pop-Location
\ No newline at end of file
diff --git a/docs/conf.py b/docs/conf.py
index 5db92dc..a9e589f 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,24 +1,21 @@
-import os
-import sys
-
-import erdantic as erd
-from pydantic import BaseModel
+# Configuration file for the Sphinx documentation builder.
+#
+# For the full list of built-in configuration values, see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
import aind_behavior_device_water_tuner
import aind_behavior_device_water_tuner.rig
import aind_behavior_device_water_tuner.task_logic
-sys.path.insert(0, os.path.abspath("../src/DataSchemas"))
-
-SOURCE_ROOT = "https://github.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/tree/main/src/DataSchemas/"
+SOURCE_ROOT = "https://github.com/AllenNeuralDynamics/Aind.Behavior.Device.WaterTuner/tree/main/src/"
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
-project = "Aind Behavior WaterTuner project"
+project = " water-tuner "
copyright = "2025, Allen Institute for Neural Dynamics"
-author = "Bruno Cruz"
-release = aind_behavior_device_water_tuner.__version__
+author = " Bruno F. Cruz "
+release = aind_behavior_device_water_tuner.__semver__
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -32,7 +29,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.githubpages",
"sphinx.ext.linkcode",
- "sphinx_mdinclude",
+ "myst_parser",
"sphinxcontrib.autodoc_pydantic",
]
@@ -49,7 +46,7 @@
html_theme = "furo"
html_static_path = ["_static"]
-html_title = "Aind Behavior WaterTuner"
+html_title = "water-tuner"
html_favicon = "_static/favicon.ico"
html_theme_options = {
"light_logo": "light-logo.svg",
@@ -64,6 +61,8 @@
# -- Options for linkcode extension ---------------------------------------
+
+
def linkcode_resolve(domain, info):
if domain != "py":
return None
@@ -71,13 +70,3 @@ def linkcode_resolve(domain, info):
return None
filename = info["module"].replace(".", "/")
return f"{SOURCE_ROOT}/{filename}.py"
-
-
-# -- Class diagram generation (Optional) ---------------------------------------
-def export_model_diagram(model: BaseModel, root: str = "_static") -> None:
- diagram = erd.create(model)
- diagram.draw(f"{root}/{model.__name__}.svg")
-
-
-_diagram_root = "_static"
-# export_model_diagram(MyPydanticBaseModel, _diagram_root)
diff --git a/docs/index.rst b/docs/index.rst
index 2e2e8ee..b2213ba 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,14 +1,17 @@
-Welcome to the Aind Behavior WaterTuner project documentation!
-========================================================================
+Welcome to the water-tuner project documentation!
+=========================================================
-.. mdinclude:: ../README.md
+.. include:: ../README.md
+ :parser: myst_parser.sphinx_
.. toctree::
:maxdepth: 2
:caption: Contents:
+ self
api
json-schemas
+ GitHub Source Code
Indices and tables
==================
diff --git a/docs/json-schemas.rig.rst b/docs/json-schemas.rig.rst
deleted file mode 100644
index beb79f0..0000000
--- a/docs/json-schemas.rig.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-
-json-schemas.rig
-------------------
-
-`Download Schema `_
-
-.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/main/src/DataSchemas/aind_behavior_water_tuner_rig.json
- :lift_definitions:
- :auto_reference:
-
diff --git a/docs/json-schemas.rst b/docs/json-schemas.rst
index 1fdf2c9..fd6da12 100644
--- a/docs/json-schemas.rst
+++ b/docs/json-schemas.rst
@@ -1,8 +1,18 @@
-json-schemas
+json-schema
-------------
-.. toctree::
- :maxdepth: 4
+The following json-schemas are used as the format definition of the input for this task. They are the result of the `Pydantic`` models defined in `src/aind_behavior_device_water_tuner`, and are also used to generate `src/Extensions/AindBehaviorDeviceWaterTuner.cs` via `Bonsai.Sgen`.
- json-schemas.session
- json-schemas.rig
- json-schemas.task_logic
\ No newline at end of file
+`Download Schema `_
+
+Task Logic Schema
+~~~~~~~~~~~~~~~~~
+.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.Device.WaterTuner/main/src/DataSchemas/aind_behavior_device_water_tuner.json#/$defs/AindBehaviorDeviceWaterTunerTaskLogic
+ :lift_definitions:
+ :auto_reference:
+
+
+Rig Schema
+~~~~~~~~~~~~~~
+.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.Device.WaterTuner/main/src/DataSchemas/aind_behavior_device_water_tuner.json#/$defs/AindBehaviorDeviceWaterTunerRig
+ :lift_definitions:
+ :auto_reference:
diff --git a/docs/json-schemas.session.rst b/docs/json-schemas.session.rst
deleted file mode 100644
index 2c1f2cf..0000000
--- a/docs/json-schemas.session.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-json-schemas.session
----------------------
-
-`Download Schema `_
-
-.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/main/src/DataSchemas/aind_behavior_session_model.json
- :lift_definitions:
- :auto_reference:
diff --git a/docs/json-schemas.task_logic.rst b/docs/json-schemas.task_logic.rst
deleted file mode 100644
index 9221e19..0000000
--- a/docs/json-schemas.task_logic.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-
-json-schemas.task_logic
--------------------------
-
-`Download Schema `_
-
-.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/main/src/DataSchemas/aind_behavior_water_tuner_task_logic.json
- :lift_definitions:
- :auto_reference:
diff --git a/examples/clabe.yml b/examples/clabe.yml
new file mode 100644
index 0000000..0ea914b
--- /dev/null
+++ b/examples/clabe.yml
@@ -0,0 +1,19 @@
+# In order to get picked up, move this file to the root of the project or ./local
+
+data_dir: C:/Data
+allow_dirty: true
+
+watchdog:
+ project_name: "ADD PROJECT NAME HERE"
+ destination: '\\allen\\aind\\scratch\\water-tuner\\data'
+ delete_modalities_source_after_success: true
+ job_type: "ADD JOB TYPE HERE"
+ transfer_endpoint: "http://aind-data-transfer-service-dev/api/v2/submit_jobs"
+ s3_bucket: "default"
+
+default_behavior_picker:
+ config_library_dir: '\\allen\aind\scratch\AindBehavior.db\AindBehaviorDeviceWaterTuner'
+
+curriculum:
+ script: "curriculum run"
+ project_directory: "./src/aind_behavior_device_water_tuner/curricula/Aind.Behavior.Device.WaterTuner.Curricula"
diff --git a/examples/example.py b/examples/example.py
deleted file mode 100644
index da171c2..0000000
--- a/examples/example.py
+++ /dev/null
@@ -1,83 +0,0 @@
-import datetime
-import os
-
-from aind_behavior_services import rig
-from aind_behavior_services.calibration import aind_manipulator
-from aind_behavior_services.calibration.aind_manipulator import (
- AindManipulatorCalibration,
- AindManipulatorCalibrationInput,
- AindManipulatorCalibrationOutput,
- Axis,
- AxisConfiguration,
- ManipulatorPosition,
-)
-from aind_behavior_services.session import AindBehaviorSessionModel
-
-from aind_behavior_device_water_tuner.rig import AindBehaviorWaterTunerRig, SerialScale
-from aind_behavior_device_water_tuner.task_logic import (
- AindBehaviorWaterTunerParameters,
- AindBehaviorWaterTunerTaskLogic,
-)
-
-
-def mock_session() -> AindBehaviorSessionModel:
- """Generates a mock AindBehaviorSessionModel model"""
- return AindBehaviorSessionModel(
- date=datetime.datetime.now(tz=datetime.timezone.utc),
- experiment="AindBehaviorWaterTuner",
- root_path="c://Data",
- subject="test",
- notes="test session",
- experiment_version="0.0.0",
- allow_dirty_repo=True,
- skip_hardware_validation=False,
- experimenter=["Foo", "Bar"],
- )
-
-
-def mock_rig() -> AindBehaviorWaterTunerRig:
- manipulator_calibration = AindManipulatorCalibration(
- output=AindManipulatorCalibrationOutput(),
- input=AindManipulatorCalibrationInput(
- full_step_to_mm=(ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)),
- axis_configuration=[
- AxisConfiguration(axis=Axis.Y1, min_limit=-1, max_limit=15000),
- AxisConfiguration(axis=Axis.Y2, min_limit=-1, max_limit=15000),
- AxisConfiguration(axis=Axis.X, min_limit=-1, max_limit=15000),
- AxisConfiguration(axis=Axis.Z, min_limit=-1, max_limit=15000),
- ],
- homing_order=[Axis.Y1, Axis.Y2, Axis.X, Axis.Z],
- initial_position=ManipulatorPosition(y1=0, y2=0, x=0, z=0),
- ),
- )
-
- return AindBehaviorWaterTunerRig(
- rig_name="testrig",
- harp_behavior=rig.harp.HarpBehavior(port_name="COM3"),
- manipulator=aind_manipulator.AindManipulatorDevice(port_name="COM10", calibration=manipulator_calibration),
- scale=SerialScale(port_name="COM12"),
- )
-
-
-def mock_task_logic() -> AindBehaviorWaterTunerTaskLogic:
- return AindBehaviorWaterTunerTaskLogic(
- task_parameters=AindBehaviorWaterTunerParameters(
- repeat_count=200, valve_open_interval=0.2, valve_open_time=[0.02, 0.05, 0.1]
- )
- )
-
-
-def main(path_seed: str = "./local/{schema}.json"):
- example_session = mock_session()
- example_rig = mock_rig()
- example_task_logic = mock_task_logic()
-
- os.makedirs(os.path.dirname(path_seed), exist_ok=True)
-
- for model in [example_task_logic, example_session, example_rig]:
- with open(path_seed.format(schema=model.__class__.__name__), "w", encoding="utf-8") as f:
- f.write(model.model_dump_json(indent=2))
-
-
-if __name__ == "__main__":
- main()
diff --git a/examples/rig.py b/examples/rig.py
new file mode 100644
index 0000000..f55fdb4
--- /dev/null
+++ b/examples/rig.py
@@ -0,0 +1,49 @@
+import os
+
+import aind_behavior_services.rig
+from aind_behavior_services.calibration import aind_manipulator
+from aind_behavior_services.calibration.aind_manipulator import (
+ AindManipulatorCalibration,
+ AindManipulatorCalibrationInput,
+ AindManipulatorCalibrationOutput,
+ Axis,
+ AxisConfiguration,
+ ManipulatorPosition,
+)
+
+from aind_behavior_device_water_tuner.rig import AindBehaviorDeviceWaterTunerRig, SerialScale
+
+manipulator_calibration = AindManipulatorCalibration(
+ output=AindManipulatorCalibrationOutput(),
+ input=AindManipulatorCalibrationInput(
+ full_step_to_mm=(ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)),
+ axis_configuration=[
+ AxisConfiguration(axis=Axis.Y1, min_limit=-1, max_limit=15000),
+ AxisConfiguration(axis=Axis.Y2, min_limit=-1, max_limit=15000),
+ AxisConfiguration(axis=Axis.X, min_limit=-1, max_limit=15000),
+ AxisConfiguration(axis=Axis.Z, min_limit=-1, max_limit=15000),
+ ],
+ homing_order=[Axis.Y1, Axis.Y2, Axis.X, Axis.Z],
+ initial_position=ManipulatorPosition(y1=0, y2=0, x=0, z=0),
+ ),
+)
+
+rig = AindBehaviorDeviceWaterTunerRig(
+ rig_name="testrig",
+ harp_behavior=aind_behavior_services.rig.harp.HarpBehavior(port_name="COM3"),
+ manipulator=aind_manipulator.AindManipulatorDevice(port_name="COM10", calibration=manipulator_calibration),
+ scale=SerialScale(port_name="COM12"),
+)
+
+
+def main(path_seed: str = "./local/{schema}.json"):
+ os.makedirs(os.path.dirname(path_seed), exist_ok=True)
+ models = [rig]
+
+ for model in models:
+ with open(path_seed.format(schema=model.__class__.__name__), "w", encoding="utf-8") as f:
+ f.write(model.model_dump_json(indent=2))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/session.py b/examples/session.py
new file mode 100644
index 0000000..dbc87c1
--- /dev/null
+++ b/examples/session.py
@@ -0,0 +1,29 @@
+import datetime
+import os
+
+from aind_behavior_services.session import AindBehaviorSessionModel
+
+session = AindBehaviorSessionModel(
+ date=datetime.datetime.now(tz=datetime.timezone.utc),
+ experiment="AindBehaviorDeviceWaterTuner",
+ root_path="c://",
+ subject="test",
+ notes="test session",
+ experiment_version="0.1.0",
+ allow_dirty_repo=True,
+ skip_hardware_validation=False,
+ experimenter=["Foo", "Bar"],
+)
+
+
+def main(path_seed: str = "./local/{schema}.json"):
+ os.makedirs(os.path.dirname(path_seed), exist_ok=True)
+ models = [session]
+
+ for model in models:
+ with open(path_seed.format(schema=model.__class__.__name__), "w", encoding="utf-8") as f:
+ f.write(model.model_dump_json(indent=2))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/task_logic.py b/examples/task_logic.py
new file mode 100644
index 0000000..65137ea
--- /dev/null
+++ b/examples/task_logic.py
@@ -0,0 +1,31 @@
+import os
+
+from aind_behavior_curriculum import Stage, TrainerState
+
+from aind_behavior_device_water_tuner.task_logic import (
+ AindBehaviorDeviceWaterTunerTaskLogic,
+ AindBehaviorDeviceWaterTunerTaskParameters,
+)
+
+task_logic = AindBehaviorDeviceWaterTunerTaskLogic(
+ task_parameters=AindBehaviorDeviceWaterTunerTaskParameters(
+ repeat_count=200, valve_open_interval=0.2, valve_open_time=[0.02, 0.05, 0.1]
+ )
+)
+
+
+def main(path_seed: str = "./local/example_{schema}.json"):
+ example_task_logic = task_logic
+ example_trainer_state = TrainerState(
+ stage=Stage(name="example_stage", task=example_task_logic), curriculum=None, is_on_curriculum=False
+ )
+ os.makedirs(os.path.dirname(path_seed), exist_ok=True)
+ models = [example_task_logic, example_trainer_state]
+
+ for model in models:
+ with open(path_seed.format(schema=model.__class__.__name__), "w", encoding="utf-8") as f:
+ f.write(model.model_dump_json(indent=2))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/pyproject.toml b/pyproject.toml
index 19f69d5..9cb9b15 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,65 +1,52 @@
[build-system]
-requires = ["setuptools", "setuptools-scm"]
-build-backend = "setuptools.build_meta"
+requires = ["uv_build>=0.8.22"]
+build-backend = "uv_build"
[project]
name = "aind-behavior-device-water-tuner"
-description = "A repository with a pipeline for automatic water calibration for animal experiments."
-authors = [
- { name = "Bruno Cruz", email = "bruno.cruz@alleninstitute.org" },
-]
-license = {text = "MIT"}
+description = "A library that defines AIND data schema for the water-tuner experiment."
+authors = [ {name = "Bruno F. Cruz", email = "bruno.cruz@alleninstitute.org"}]
+license = "MIT"
requires-python = ">=3.11"
-dynamic = ["version", "readme"]
classifiers = [
"Programming Language :: Python :: 3.11",
- "License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
]
+version = "0.4.0"
+readme = {file = "README.md", content-type = "text/markdown"}
dependencies = [
- "aind_behavior_services < 0.12",
+ "aind_behavior_services>=0.12, <0.13",
+ "pydantic-settings"
]
[project.urls]
-Documentation = "https://allenneuraldynamics.github.io/Aind.Behavior.WaterTuner/"
-Repository = "https://github.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/"
-Issues = "https://github.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/issues"
-Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.WaterTuner/releases"
+Documentation = "https://allenneuraldynamics.github.io/Aind.Behavior.Device.WaterTuner/"
+Repository = "https://github.com/AllenNeuralDynamics/Aind.Behavior.Device.WaterTuner/"
+Issues = "https://github.com/AllenNeuralDynamics/Aind.Behavior.Device.WaterTuner/issues"
+Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.Device.WaterTuner/releases"
[project.optional-dependencies]
-launcher = ["aind_behavior_experiment_launcher[aind-services]==0.5.0rc1"]
+launcher = ["aind-clabe[aind-services]"]
+
+[dependency-groups]
dev = [
- "aind_behavior_device_water_tuner[launcher]",
+ "aind-behavior-device-water-tuner[launcher]",
"ruff",
"codespell"
]
docs = [
- 'Sphinx<7.3',
+ 'Sphinx',
'furo',
'sphinx-jinja',
- 'autodoc_pydantic[erdantic]',
- 'sphinx-jsonschema',
- 'sphinx-copybutton',
- "sphinx_mdinclude",
-]
+ 'myst_parser',
+ 'sphinx-jsonschema']
[project.scripts]
-clabe = "aind_behavior_device_water_tuner.launcher:main"
-regenerate = "aind_behavior_device_water_tuner.regenerate:main"
-
-[tool.setuptools.packages.find]
-where = ["src"]
-
-[tool.setuptools.package-data]
-aind_behavior_device_water_tuner = ["py.typed"]
-
-[tool.setuptools.dynamic]
-version = {attr = "aind_behavior_device_water_tuner.__version__"}
-readme = {file = "README.md", content-type = "text/markdown"}
+water-tuner = "aind_behavior_device_water_tuner.cli:main"
[tool.ruff]
line-length = 120
@@ -72,5 +59,9 @@ mccabe = { max-complexity = 14 }
pydocstyle = { convention = 'google' }
[tool.codespell]
-skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build,uv.lock'
+skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build,uv.lock,*Generated.cs'
ignore-words-list = 'nd'
+
+[tool.uv]
+default-groups = ['dev']
+required-version = '>=0.8.4'
diff --git a/scripts/regenerate_environment.cmd b/scripts/deploy.cmd
similarity index 100%
rename from scripts/regenerate_environment.cmd
rename to scripts/deploy.cmd
diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1
new file mode 100644
index 0000000..9c937f1
--- /dev/null
+++ b/scripts/deploy.ps1
@@ -0,0 +1,31 @@
+$scriptPath = $MyInvocation.MyCommand.Path
+$scriptDirectory = Split-Path -Parent $scriptPath
+Set-Location (Split-Path -Parent $scriptDirectory)
+
+Write-Output "Initializing and updating submodules..."
+&git submodule update --init --recursive
+
+Write-Output "Creating a Python environment..."
+
+if (-not (Get-Command uv -ErrorAction SilentlyContinue)) {
+ throw "The 'uv' command was not found. See https://docs.astral.sh/uv/getting-started/installation/ for instructions."
+}
+
+if (Test-Path -Path ./.venv) {
+ Remove-Item ./.venv -Recurse -Force
+}
+&uv venv
+.\.venv\Scripts\Activate.ps1
+Write-Output "Synchronizing environment..."
+&uv sync --extra launcher
+Write-Output "Creating a Bonsai environment and installing packages..."
+if (Test-Path -Path "bonsai") {
+ Set-Location "bonsai"
+ .\setup.ps1
+} elseif (Test-Path -Path ".bonsai") {
+ Set-Location ".bonsai"
+ .\setup.ps1
+} else {
+ throw "Neither 'bonsai' nor '.bonsai' directory found."
+}
+Set-Location ..
\ No newline at end of file
diff --git a/scripts/launcher.cmd b/scripts/launcher.cmd
new file mode 100644
index 0000000..4ded834
--- /dev/null
+++ b/scripts/launcher.cmd
@@ -0,0 +1,6 @@
+@echo off
+setlocal
+set "scriptPath=%~dp0"
+set "launcherPath=%scriptPath%launcher.ps1"
+powershell -ExecutionPolicy Bypass -File "%launcherPath%"
+endlocal
diff --git a/scripts/launcher.ps1 b/scripts/launcher.ps1
new file mode 100644
index 0000000..16a4eb1
--- /dev/null
+++ b/scripts/launcher.ps1
@@ -0,0 +1,3 @@
+$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
+Set-Location -Path (Split-Path -Parent $scriptPath)
+&uv run water-tuner clabe
diff --git a/scripts/regenerate_environment.ps1 b/scripts/regenerate_environment.ps1
deleted file mode 100644
index 5de218e..0000000
--- a/scripts/regenerate_environment.ps1
+++ /dev/null
@@ -1,15 +0,0 @@
-$scriptPath = $MyInvocation.MyCommand.Path
-$scriptDirectory = Split-Path -Parent $scriptPath
-Set-Location (Split-Path -Parent $scriptDirectory)
-Write-Output "Creating a Python environment..."
-if (Test-Path -Path ./.venv) {
- Remove-Item ./.venv -Recurse -Force
-}
-&python -m venv ./.venv
-.\.venv\Scripts\Activate.ps1
-Write-Output "Installing python packages..."
-&pip install .[launcher]
-Write-Output "Creating a Bonsai environment and installing packages..."
-Set-Location "bonsai"
-.\setup.ps1
-Set-Location ..
\ No newline at end of file
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..f2d70a3
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,5 @@
+# Bonsai scripting files
+.vs
+.vscode
+src.sln
+.bonsai
\ No newline at end of file
diff --git a/src/DataSchemas/aind_behavior_device_water_tuner.json b/src/DataSchemas/aind_behavior_device_water_tuner.json
new file mode 100644
index 0000000..f7b3a14
--- /dev/null
+++ b/src/DataSchemas/aind_behavior_device_water_tuner.json
@@ -0,0 +1,956 @@
+{
+ "$defs": {
+ "AindBehaviorDeviceWaterTunerRig": {
+ "properties": {
+ "aind_behavior_services_pkg_version": {
+ "default": "0.12.1",
+ "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.4.0",
+ "default": "0.4.0",
+ "title": "Version",
+ "type": "string"
+ },
+ "computer_name": {
+ "description": "Computer name",
+ "title": "Computer Name",
+ "type": "string"
+ },
+ "rig_name": {
+ "description": "Rig name",
+ "title": "Rig Name",
+ "type": "string"
+ },
+ "scale": {
+ "$ref": "#/$defs/SerialScale",
+ "title": "Serial scale device"
+ },
+ "harp_behavior": {
+ "$ref": "#/$defs/HarpBehavior",
+ "description": "Harp behavior"
+ },
+ "manipulator": {
+ "default": null,
+ "description": "Manipulator",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/AindManipulatorDevice"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "rig_name",
+ "scale",
+ "harp_behavior"
+ ],
+ "title": "AindBehaviorDeviceWaterTunerRig",
+ "type": "object"
+ },
+ "AindBehaviorDeviceWaterTunerTaskLogic": {
+ "additionalProperties": false,
+ "description": "Main task logic model for the water-tuner task.",
+ "properties": {
+ "name": {
+ "const": "AindBehaviorDeviceWaterTuner",
+ "default": "AindBehaviorDeviceWaterTuner",
+ "description": "Name of the task logic",
+ "title": "Name",
+ "type": "string"
+ },
+ "description": {
+ "default": "",
+ "description": "Description of the task.",
+ "title": "Description",
+ "type": "string"
+ },
+ "task_parameters": {
+ "$ref": "#/$defs/AindBehaviorDeviceWaterTunerTaskParameters",
+ "description": "Parameters of the task logic"
+ },
+ "version": {
+ "const": "0.4.0",
+ "default": "0.4.0",
+ "title": "Version",
+ "type": "string"
+ },
+ "stage_name": {
+ "default": null,
+ "description": "Optional stage name the `Task` object instance represents.",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Stage Name"
+ }
+ },
+ "required": [
+ "task_parameters"
+ ],
+ "title": "AindBehaviorDeviceWaterTunerTaskLogic",
+ "type": "object"
+ },
+ "AindBehaviorDeviceWaterTunerTaskParameters": {
+ "additionalProperties": true,
+ "properties": {
+ "rng_seed": {
+ "default": null,
+ "description": "Seed of the random number generator",
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Rng Seed"
+ },
+ "aind_behavior_services_pkg_version": {
+ "default": "0.12.1",
+ "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"
+ },
+ "valve_open_time": {
+ "description": "An array with the times (s) the valve is open during calibration",
+ "items": {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ "minItems": 1,
+ "title": "Valve Open Time",
+ "type": "array"
+ },
+ "valve_open_interval": {
+ "default": 0.2,
+ "description": "Time between two consecutive valve openings (s)",
+ "exclusiveMinimum": 0,
+ "title": "Valve open interval",
+ "type": "number"
+ },
+ "repeat_count": {
+ "default": 200,
+ "description": "Number of times the valve opened per measure valve_open_time entry",
+ "minimum": 1,
+ "title": "Repeat count",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "valve_open_time"
+ ],
+ "title": "AindBehaviorDeviceWaterTunerTaskParameters",
+ "type": "object"
+ },
+ "AindBehaviorSessionModel": {
+ "properties": {
+ "aind_behavior_services_pkg_version": {
+ "default": "0.12.1",
+ "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.1",
+ "default": "0.3.1",
+ "title": "Version",
+ "type": "string"
+ },
+ "experiment": {
+ "description": "Name of the experiment",
+ "title": "Experiment",
+ "type": "string"
+ },
+ "experimenter": {
+ "default": [],
+ "description": "Name of the experimenter",
+ "items": {
+ "type": "string"
+ },
+ "title": "Experimenter",
+ "type": "array"
+ },
+ "date": {
+ "description": "Date of the experiment",
+ "format": "date-time",
+ "title": "Date",
+ "type": "string"
+ },
+ "root_path": {
+ "description": "Root path where data will be logged",
+ "title": "Root Path",
+ "type": "string"
+ },
+ "session_name": {
+ "default": null,
+ "description": "Name of the session. This will be used to create a folder in the root path.",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Session Name"
+ },
+ "subject": {
+ "description": "Name of the subject",
+ "title": "Subject",
+ "type": "string"
+ },
+ "experiment_version": {
+ "description": "Version of the experiment",
+ "title": "Experiment Version",
+ "type": "string"
+ },
+ "notes": {
+ "default": null,
+ "description": "Notes about the experiment",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Notes"
+ },
+ "commit_hash": {
+ "default": null,
+ "description": "Commit hash of the repository",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Commit Hash"
+ },
+ "allow_dirty_repo": {
+ "default": false,
+ "description": "Allow running from a dirty repository",
+ "title": "Allow Dirty Repo",
+ "type": "boolean"
+ },
+ "skip_hardware_validation": {
+ "default": false,
+ "description": "Skip hardware validation",
+ "title": "Skip Hardware Validation",
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "experiment",
+ "root_path",
+ "subject",
+ "experiment_version"
+ ],
+ "title": "AindBehaviorSessionModel",
+ "type": "object"
+ },
+ "AindManipulatorCalibration": {
+ "description": "Aind manipulator calibration class",
+ "properties": {
+ "device_name": {
+ "default": "AindManipulator",
+ "description": "Must match a device name in rig/instrument",
+ "title": "Device name",
+ "type": "string"
+ },
+ "input": {
+ "$ref": "#/$defs/AindManipulatorCalibrationInput",
+ "title": "Input of the calibration"
+ },
+ "output": {
+ "$ref": "#/$defs/AindManipulatorCalibrationOutput",
+ "title": "Output of the calibration."
+ },
+ "date": {
+ "default": null,
+ "oneOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Date"
+ },
+ "description": {
+ "const": "Calibration of the load cells system",
+ "default": "Calibration of the load cells system",
+ "title": "Description",
+ "type": "string"
+ },
+ "notes": {
+ "default": null,
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Notes"
+ }
+ },
+ "required": [
+ "input",
+ "output"
+ ],
+ "title": "AindManipulatorCalibration",
+ "type": "object"
+ },
+ "AindManipulatorCalibrationInput": {
+ "properties": {
+ "full_step_to_mm": {
+ "$ref": "#/$defs/ManipulatorPosition",
+ "default": {
+ "x": 0.01,
+ "y1": 0.01,
+ "y2": 0.01,
+ "z": 0.01
+ },
+ "title": "Full step to mm. Used to convert steps to SI Units"
+ },
+ "axis_configuration": {
+ "default": [
+ {
+ "axis": 2,
+ "step_acceleration_interval": 100,
+ "step_interval": 100,
+ "microstep_resolution": 0,
+ "maximum_step_interval": 2000,
+ "motor_operation_mode": 0,
+ "max_limit": 25.0,
+ "min_limit": -0.01
+ },
+ {
+ "axis": 3,
+ "step_acceleration_interval": 100,
+ "step_interval": 100,
+ "microstep_resolution": 0,
+ "maximum_step_interval": 2000,
+ "motor_operation_mode": 0,
+ "max_limit": 25.0,
+ "min_limit": -0.01
+ },
+ {
+ "axis": 1,
+ "step_acceleration_interval": 100,
+ "step_interval": 100,
+ "microstep_resolution": 0,
+ "maximum_step_interval": 2000,
+ "motor_operation_mode": 0,
+ "max_limit": 25.0,
+ "min_limit": -0.01
+ },
+ {
+ "axis": 4,
+ "step_acceleration_interval": 100,
+ "step_interval": 100,
+ "microstep_resolution": 0,
+ "maximum_step_interval": 2000,
+ "motor_operation_mode": 0,
+ "max_limit": 25.0,
+ "min_limit": -0.01
+ }
+ ],
+ "items": {
+ "$ref": "#/$defs/AxisConfiguration"
+ },
+ "title": "Axes configuration. Only the axes that are configured will be enabled.",
+ "type": "array"
+ },
+ "homing_order": {
+ "default": [
+ 2,
+ 3,
+ 1,
+ 4
+ ],
+ "items": {
+ "$ref": "#/$defs/Axis"
+ },
+ "title": "Homing order",
+ "type": "array"
+ },
+ "initial_position": {
+ "$ref": "#/$defs/ManipulatorPosition",
+ "default": {
+ "x": 0.0,
+ "y1": 0.0,
+ "y2": 0.0,
+ "z": 0.0
+ }
+ }
+ },
+ "title": "AindManipulatorCalibrationInput",
+ "type": "object"
+ },
+ "AindManipulatorCalibrationOutput": {
+ "properties": {},
+ "title": "AindManipulatorCalibrationOutput",
+ "type": "object"
+ },
+ "AindManipulatorDevice": {
+ "properties": {
+ "device_type": {
+ "const": "StepperDriver",
+ "default": "StepperDriver",
+ "title": "Device Type",
+ "type": "string"
+ },
+ "device_name": {
+ "default": null,
+ "description": "Device name",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Device Name"
+ },
+ "additional_settings": {
+ "default": null,
+ "description": "Additional settings",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/BaseModel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "calibration": {
+ "default": null,
+ "oneOf": [
+ {
+ "$ref": "#/$defs/AindManipulatorCalibration"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Calibration of the manipulator"
+ },
+ "who_am_i": {
+ "const": 1130,
+ "default": 1130,
+ "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": "AindManipulatorDevice",
+ "type": "object"
+ },
+ "Axis": {
+ "description": "Motor axis available",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "title": "Axis",
+ "type": "integer",
+ "x-enumNames": [
+ "None",
+ "X",
+ "Y1",
+ "Y2",
+ "Z"
+ ]
+ },
+ "AxisConfiguration": {
+ "description": "Axis configuration",
+ "properties": {
+ "axis": {
+ "$ref": "#/$defs/Axis",
+ "title": "Axis to be configured"
+ },
+ "step_acceleration_interval": {
+ "default": 100,
+ "description": "Acceleration of the step interval in microseconds",
+ "maximum": 2000,
+ "minimum": 2,
+ "title": "Acceleration",
+ "type": "integer"
+ },
+ "step_interval": {
+ "default": 100,
+ "description": "Step interval in microseconds.",
+ "maximum": 20000,
+ "minimum": 100,
+ "title": "Step interval",
+ "type": "integer"
+ },
+ "microstep_resolution": {
+ "$ref": "#/$defs/MicrostepResolution",
+ "default": 0,
+ "title": "Microstep resolution"
+ },
+ "maximum_step_interval": {
+ "default": 2000,
+ "maximum": 20000,
+ "minimum": 100,
+ "title": "Configures the time between step motor pulses (us) used when starting or stopping a movement",
+ "type": "integer"
+ },
+ "motor_operation_mode": {
+ "$ref": "#/$defs/MotorOperationMode",
+ "default": 0,
+ "title": "Motor operation mode"
+ },
+ "max_limit": {
+ "default": 25,
+ "title": "Maximum limit in SI units. A value of 0 disables this limit.",
+ "type": "number"
+ },
+ "min_limit": {
+ "default": -0.01,
+ "title": "Minimum limit in SI units. A value of 0 disables this limit.",
+ "type": "number"
+ }
+ },
+ "required": [
+ "axis"
+ ],
+ "title": "AxisConfiguration",
+ "type": "object"
+ },
+ "BaseModel": {
+ "properties": {},
+ "title": "BaseModel",
+ "type": "object"
+ },
+ "ExtensionDataTypes": {
+ "properties": {
+ "calibration": {
+ "$ref": "#/$defs/WaterValveCalibration"
+ }
+ },
+ "required": [
+ "calibration"
+ ],
+ "title": "ExtensionDataTypes",
+ "type": "object"
+ },
+ "HarpBehavior": {
+ "properties": {
+ "device_type": {
+ "const": "Behavior",
+ "default": "Behavior",
+ "title": "Device Type",
+ "type": "string"
+ },
+ "device_name": {
+ "default": null,
+ "description": "Device name",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Device Name"
+ },
+ "additional_settings": {
+ "default": null,
+ "description": "Additional settings",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/BaseModel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "calibration": {
+ "default": null,
+ "description": "Calibration",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/BaseModel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "who_am_i": {
+ "const": 1216,
+ "default": 1216,
+ "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": "HarpBehavior",
+ "type": "object"
+ },
+ "ManipulatorPosition": {
+ "properties": {
+ "x": {
+ "title": "X coordinate",
+ "type": "number"
+ },
+ "y1": {
+ "title": "Y1 coordinate",
+ "type": "number"
+ },
+ "y2": {
+ "title": "Y2 coordinate",
+ "type": "number"
+ },
+ "z": {
+ "title": "Z coordinate",
+ "type": "number"
+ }
+ },
+ "required": [
+ "x",
+ "y1",
+ "y2",
+ "z"
+ ],
+ "title": "ManipulatorPosition",
+ "type": "object"
+ },
+ "Measurement": {
+ "description": "Input for water valve calibration class",
+ "properties": {
+ "valve_open_interval": {
+ "description": "Time between two consecutive valve openings (s)",
+ "exclusiveMinimum": 0,
+ "title": "Valve open interval",
+ "type": "number"
+ },
+ "valve_open_time": {
+ "description": "Valve open interval (s)",
+ "exclusiveMinimum": 0,
+ "title": "Valve open time",
+ "type": "number"
+ },
+ "water_weight": {
+ "description": "Weight of water delivered (g)",
+ "items": {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ "minItems": 1,
+ "title": "Water weight",
+ "type": "array"
+ },
+ "repeat_count": {
+ "description": "Number of times the valve opened.",
+ "minimum": 0,
+ "title": "Repeat count",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "valve_open_interval",
+ "valve_open_time",
+ "water_weight",
+ "repeat_count"
+ ],
+ "title": "Measurement",
+ "type": "object"
+ },
+ "MicrostepResolution": {
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "title": "MicrostepResolution",
+ "type": "integer",
+ "x-enumNames": [
+ "Microstep8",
+ "Microstep16",
+ "Microstep32",
+ "Microstep64"
+ ]
+ },
+ "MotorOperationMode": {
+ "enum": [
+ 0,
+ 1
+ ],
+ "title": "MotorOperationMode",
+ "type": "integer",
+ "x-enumNames": [
+ "Quiet",
+ "Dynamic"
+ ]
+ },
+ "SerialScale": {
+ "properties": {
+ "device_type": {
+ "const": "SerialScale",
+ "default": "SerialScale",
+ "title": "Device Type",
+ "type": "string"
+ },
+ "device_name": {
+ "default": null,
+ "description": "Device name",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Device Name"
+ },
+ "additional_settings": {
+ "default": null,
+ "description": "Additional settings",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/BaseModel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "calibration": {
+ "default": null,
+ "description": "Calibration",
+ "oneOf": [
+ {
+ "$ref": "#/$defs/BaseModel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "port_name": {
+ "description": "COM port to which the scale is connected",
+ "title": "Port Name",
+ "type": "string"
+ }
+ },
+ "required": [
+ "port_name"
+ ],
+ "title": "SerialScale",
+ "type": "object"
+ },
+ "WaterValveCalibration": {
+ "description": "Water valve calibration class",
+ "properties": {
+ "device_name": {
+ "default": "WaterValve",
+ "description": "Name of the device being calibrated",
+ "title": "Device name",
+ "type": "string"
+ },
+ "input": {
+ "$ref": "#/$defs/WaterValveCalibrationInput",
+ "title": "Input of the calibration"
+ },
+ "output": {
+ "$ref": "#/$defs/WaterValveCalibrationOutput",
+ "title": "Output of the calibration."
+ },
+ "date": {
+ "default": null,
+ "oneOf": [
+ {
+ "format": "date-time",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Date"
+ },
+ "description": {
+ "const": "Calibration of the water valve delivery system",
+ "default": "Calibration of the water valve delivery system",
+ "title": "Description",
+ "type": "string"
+ },
+ "notes": {
+ "default": null,
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Notes"
+ }
+ },
+ "required": [
+ "input",
+ "output"
+ ],
+ "title": "WaterValveCalibration",
+ "type": "object"
+ },
+ "WaterValveCalibrationInput": {
+ "properties": {
+ "measurements": {
+ "default": [],
+ "description": "List of measurements",
+ "items": {
+ "$ref": "#/$defs/Measurement"
+ },
+ "title": "Measurements",
+ "type": "array"
+ }
+ },
+ "title": "WaterValveCalibrationInput",
+ "type": "object"
+ },
+ "WaterValveCalibrationOutput": {
+ "description": "Output for water valve calibration class",
+ "properties": {
+ "interval_average": {
+ "default": null,
+ "description": "Dictionary keyed by measured valve interval and corresponding average single event volume.",
+ "oneOf": [
+ {
+ "additionalProperties": {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Interval average"
+ },
+ "slope": {
+ "description": "Slope of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)",
+ "title": "Regression slope",
+ "type": "number"
+ },
+ "offset": {
+ "description": "Offset of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)",
+ "title": "Regression offset",
+ "type": "number"
+ },
+ "r2": {
+ "default": null,
+ "description": "R2 metric from the linear model.",
+ "oneOf": [
+ {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "R2"
+ },
+ "valid_domain": {
+ "default": null,
+ "description": "The optional time-intervals the calibration curve was calculated on.",
+ "oneOf": [
+ {
+ "items": {
+ "exclusiveMinimum": 0,
+ "type": "number"
+ },
+ "minItems": 2,
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Valid domain"
+ }
+ },
+ "required": [
+ "slope",
+ "offset"
+ ],
+ "title": "WaterValveCalibrationOutput",
+ "type": "object"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Extensions.csproj b/src/Extensions.csproj
index c36bbb2..cc5da87 100644
--- a/src/Extensions.csproj
+++ b/src/Extensions.csproj
@@ -1,10 +1,12 @@
-
- net472
-
-
-
-
-
-
+
+ net48
+ true
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Extensions/AindBehaviorDeviceWaterTuner.Generated.cs b/src/Extensions/AindBehaviorDeviceWaterTuner.Generated.cs
new file mode 100644
index 0000000..0e5160d
--- /dev/null
+++ b/src/Extensions/AindBehaviorDeviceWaterTuner.Generated.cs
@@ -0,0 +1,2817 @@
+//----------------------
+//
+// Generated using the NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
+//
+//----------------------
+
+
+namespace AindBehaviorDeviceWaterTunerDataSchema
+{
+ #pragma warning disable // Disable all warnings
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindBehaviorDeviceWaterTunerRig
+ {
+
+ private string _aindBehaviorServicesPkgVersion;
+
+ private string _version;
+
+ private string _computerName;
+
+ private string _rigName;
+
+ private SerialScale _scale;
+
+ private HarpBehavior _harpBehavior;
+
+ private AindManipulatorDevice _manipulator;
+
+ public AindBehaviorDeviceWaterTunerRig()
+ {
+ _aindBehaviorServicesPkgVersion = "0.12.1";
+ _version = "0.4.0";
+ _scale = new SerialScale();
+ _harpBehavior = new HarpBehavior();
+ }
+
+ protected AindBehaviorDeviceWaterTunerRig(AindBehaviorDeviceWaterTunerRig other)
+ {
+ _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
+ _version = other._version;
+ _computerName = other._computerName;
+ _rigName = other._rigName;
+ _scale = other._scale;
+ _harpBehavior = other._harpBehavior;
+ _manipulator = other._manipulator;
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
+ public string AindBehaviorServicesPkgVersion
+ {
+ get
+ {
+ return _aindBehaviorServicesPkgVersion;
+ }
+ set
+ {
+ _aindBehaviorServicesPkgVersion = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("version")]
+ public string Version
+ {
+ get
+ {
+ return _version;
+ }
+ set
+ {
+ _version = value;
+ }
+ }
+
+ ///
+ /// Computer name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("computer_name")]
+ [System.ComponentModel.DescriptionAttribute("Computer name")]
+ public string ComputerName
+ {
+ get
+ {
+ return _computerName;
+ }
+ set
+ {
+ _computerName = value;
+ }
+ }
+
+ ///
+ /// Rig name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("rig_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Rig name")]
+ public string RigName
+ {
+ get
+ {
+ return _rigName;
+ }
+ set
+ {
+ _rigName = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("scale", Required=Newtonsoft.Json.Required.Always)]
+ public SerialScale Scale
+ {
+ get
+ {
+ return _scale;
+ }
+ set
+ {
+ _scale = value;
+ }
+ }
+
+ ///
+ /// Harp behavior
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("harp_behavior", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Harp behavior")]
+ public HarpBehavior HarpBehavior
+ {
+ get
+ {
+ return _harpBehavior;
+ }
+ set
+ {
+ _harpBehavior = value;
+ }
+ }
+
+ ///
+ /// Manipulator
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("manipulator")]
+ [System.ComponentModel.DescriptionAttribute("Manipulator")]
+ public AindManipulatorDevice Manipulator
+ {
+ get
+ {
+ return _manipulator;
+ }
+ set
+ {
+ _manipulator = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorDeviceWaterTunerRig(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorDeviceWaterTunerRig(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
+ stringBuilder.Append("Version = " + _version + ", ");
+ stringBuilder.Append("ComputerName = " + _computerName + ", ");
+ stringBuilder.Append("RigName = " + _rigName + ", ");
+ stringBuilder.Append("Scale = " + _scale + ", ");
+ stringBuilder.Append("HarpBehavior = " + _harpBehavior + ", ");
+ stringBuilder.Append("Manipulator = " + _manipulator);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Main task logic model for the water-tuner task.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Main task logic model for the water-tuner task.")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindBehaviorDeviceWaterTunerTaskLogic
+ {
+
+ private string _name;
+
+ private string _description;
+
+ private AindBehaviorDeviceWaterTunerTaskParameters _taskParameters;
+
+ private string _version;
+
+ private string _stageName;
+
+ public AindBehaviorDeviceWaterTunerTaskLogic()
+ {
+ _name = "AindBehaviorDeviceWaterTuner";
+ _description = "";
+ _taskParameters = new AindBehaviorDeviceWaterTunerTaskParameters();
+ _version = "0.4.0";
+ }
+
+ protected AindBehaviorDeviceWaterTunerTaskLogic(AindBehaviorDeviceWaterTunerTaskLogic other)
+ {
+ _name = other._name;
+ _description = other._description;
+ _taskParameters = other._taskParameters;
+ _version = other._version;
+ _stageName = other._stageName;
+ }
+
+ ///
+ /// Name of the task logic
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("name")]
+ [System.ComponentModel.DescriptionAttribute("Name of the task logic")]
+ public string Name
+ {
+ get
+ {
+ return _name;
+ }
+ set
+ {
+ _name = value;
+ }
+ }
+
+ ///
+ /// Description of the task.
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("description")]
+ [System.ComponentModel.DescriptionAttribute("Description of the task.")]
+ public string Description
+ {
+ get
+ {
+ return _description;
+ }
+ set
+ {
+ _description = value;
+ }
+ }
+
+ ///
+ /// Parameters of the task logic
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("task_parameters", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Parameters of the task logic")]
+ public AindBehaviorDeviceWaterTunerTaskParameters TaskParameters
+ {
+ get
+ {
+ return _taskParameters;
+ }
+ set
+ {
+ _taskParameters = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("version")]
+ public string Version
+ {
+ get
+ {
+ return _version;
+ }
+ set
+ {
+ _version = value;
+ }
+ }
+
+ ///
+ /// Optional stage name the `Task` object instance represents.
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("stage_name")]
+ [System.ComponentModel.DescriptionAttribute("Optional stage name the `Task` object instance represents.")]
+ public string StageName
+ {
+ get
+ {
+ return _stageName;
+ }
+ set
+ {
+ _stageName = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorDeviceWaterTunerTaskLogic(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorDeviceWaterTunerTaskLogic(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("Name = " + _name + ", ");
+ stringBuilder.Append("Description = " + _description + ", ");
+ stringBuilder.Append("TaskParameters = " + _taskParameters + ", ");
+ stringBuilder.Append("Version = " + _version + ", ");
+ stringBuilder.Append("StageName = " + _stageName);
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindBehaviorDeviceWaterTunerTaskParameters
+ {
+
+ private double? _rngSeed;
+
+ private string _aindBehaviorServicesPkgVersion;
+
+ private System.Collections.Generic.List _valveOpenTime;
+
+ private double _valveOpenInterval;
+
+ private int _repeatCount;
+
+ public AindBehaviorDeviceWaterTunerTaskParameters()
+ {
+ _aindBehaviorServicesPkgVersion = "0.12.1";
+ _valveOpenTime = new System.Collections.Generic.List();
+ _valveOpenInterval = 0.2D;
+ _repeatCount = 200;
+ }
+
+ protected AindBehaviorDeviceWaterTunerTaskParameters(AindBehaviorDeviceWaterTunerTaskParameters other)
+ {
+ _rngSeed = other._rngSeed;
+ _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
+ _valveOpenTime = other._valveOpenTime;
+ _valveOpenInterval = other._valveOpenInterval;
+ _repeatCount = other._repeatCount;
+ }
+
+ ///
+ /// Seed of the random number generator
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("rng_seed")]
+ [System.ComponentModel.DescriptionAttribute("Seed of the random number generator")]
+ public double? RngSeed
+ {
+ get
+ {
+ return _rngSeed;
+ }
+ set
+ {
+ _rngSeed = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
+ public string AindBehaviorServicesPkgVersion
+ {
+ get
+ {
+ return _aindBehaviorServicesPkgVersion;
+ }
+ set
+ {
+ _aindBehaviorServicesPkgVersion = value;
+ }
+ }
+
+ ///
+ /// An array with the times (s) the valve is open during calibration
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("valve_open_time", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("An array with the times (s) the valve is open during calibration")]
+ public System.Collections.Generic.List ValveOpenTime
+ {
+ get
+ {
+ return _valveOpenTime;
+ }
+ set
+ {
+ _valveOpenTime = value;
+ }
+ }
+
+ ///
+ /// Time between two consecutive valve openings (s)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("valve_open_interval")]
+ [System.ComponentModel.DescriptionAttribute("Time between two consecutive valve openings (s)")]
+ public double ValveOpenInterval
+ {
+ get
+ {
+ return _valveOpenInterval;
+ }
+ set
+ {
+ _valveOpenInterval = value;
+ }
+ }
+
+ ///
+ /// Number of times the valve opened per measure valve_open_time entry
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("repeat_count")]
+ [System.ComponentModel.DescriptionAttribute("Number of times the valve opened per measure valve_open_time entry")]
+ public int RepeatCount
+ {
+ get
+ {
+ return _repeatCount;
+ }
+ set
+ {
+ _repeatCount = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorDeviceWaterTunerTaskParameters(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorDeviceWaterTunerTaskParameters(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("RngSeed = " + _rngSeed + ", ");
+ stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
+ stringBuilder.Append("ValveOpenTime = " + _valveOpenTime + ", ");
+ stringBuilder.Append("ValveOpenInterval = " + _valveOpenInterval + ", ");
+ stringBuilder.Append("RepeatCount = " + _repeatCount);
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindBehaviorSessionModel
+ {
+
+ private string _aindBehaviorServicesPkgVersion;
+
+ private string _version;
+
+ private string _experiment;
+
+ private System.Collections.Generic.List _experimenter;
+
+ private System.DateTimeOffset _date;
+
+ private string _rootPath;
+
+ private string _sessionName;
+
+ private string _subject;
+
+ private string _experimentVersion;
+
+ private string _notes;
+
+ private string _commitHash;
+
+ private bool _allowDirtyRepo;
+
+ private bool _skipHardwareValidation;
+
+ public AindBehaviorSessionModel()
+ {
+ _aindBehaviorServicesPkgVersion = "0.12.1";
+ _version = "0.3.1";
+ _experimenter = new System.Collections.Generic.List();
+ _allowDirtyRepo = false;
+ _skipHardwareValidation = false;
+ }
+
+ protected AindBehaviorSessionModel(AindBehaviorSessionModel other)
+ {
+ _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
+ _version = other._version;
+ _experiment = other._experiment;
+ _experimenter = other._experimenter;
+ _date = other._date;
+ _rootPath = other._rootPath;
+ _sessionName = other._sessionName;
+ _subject = other._subject;
+ _experimentVersion = other._experimentVersion;
+ _notes = other._notes;
+ _commitHash = other._commitHash;
+ _allowDirtyRepo = other._allowDirtyRepo;
+ _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
+ {
+ get
+ {
+ return _version;
+ }
+ set
+ {
+ _version = value;
+ }
+ }
+
+ ///
+ /// Name of the experiment
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("experiment", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Name of the experiment")]
+ public string Experiment
+ {
+ get
+ {
+ return _experiment;
+ }
+ set
+ {
+ _experiment = value;
+ }
+ }
+
+ ///
+ /// Name of the experimenter
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("experimenter")]
+ [System.ComponentModel.DescriptionAttribute("Name of the experimenter")]
+ public System.Collections.Generic.List Experimenter
+ {
+ get
+ {
+ return _experimenter;
+ }
+ set
+ {
+ _experimenter = value;
+ }
+ }
+
+ ///
+ /// Date of the experiment
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("date")]
+ [System.ComponentModel.DescriptionAttribute("Date of the experiment")]
+ public System.DateTimeOffset Date
+ {
+ get
+ {
+ return _date;
+ }
+ set
+ {
+ _date = value;
+ }
+ }
+
+ ///
+ /// Root path where data will be logged
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("root_path", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Root path where data will be logged")]
+ public string RootPath
+ {
+ get
+ {
+ return _rootPath;
+ }
+ set
+ {
+ _rootPath = value;
+ }
+ }
+
+ ///
+ /// Name of the session. This will be used to create a folder in the root path.
+ ///
+ [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 _sessionName;
+ }
+ set
+ {
+ _sessionName = value;
+ }
+ }
+
+ ///
+ /// Name of the subject
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("subject", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Name of the subject")]
+ public string Subject
+ {
+ get
+ {
+ return _subject;
+ }
+ set
+ {
+ _subject = value;
+ }
+ }
+
+ ///
+ /// Version of the experiment
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("experiment_version", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Version of the experiment")]
+ public string ExperimentVersion
+ {
+ get
+ {
+ return _experimentVersion;
+ }
+ set
+ {
+ _experimentVersion = value;
+ }
+ }
+
+ ///
+ /// Notes about the experiment
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("notes")]
+ [System.ComponentModel.DescriptionAttribute("Notes about the experiment")]
+ public string Notes
+ {
+ get
+ {
+ return _notes;
+ }
+ set
+ {
+ _notes = value;
+ }
+ }
+
+ ///
+ /// Commit hash of the repository
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("commit_hash")]
+ [System.ComponentModel.DescriptionAttribute("Commit hash of the repository")]
+ public string CommitHash
+ {
+ get
+ {
+ return _commitHash;
+ }
+ set
+ {
+ _commitHash = value;
+ }
+ }
+
+ ///
+ /// Allow running from a dirty repository
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("allow_dirty_repo")]
+ [System.ComponentModel.DescriptionAttribute("Allow running from a dirty repository")]
+ public bool AllowDirtyRepo
+ {
+ get
+ {
+ return _allowDirtyRepo;
+ }
+ set
+ {
+ _allowDirtyRepo = value;
+ }
+ }
+
+ ///
+ /// Skip hardware validation
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("skip_hardware_validation")]
+ [System.ComponentModel.DescriptionAttribute("Skip hardware validation")]
+ public bool SkipHardwareValidation
+ {
+ get
+ {
+ return _skipHardwareValidation;
+ }
+ set
+ {
+ _skipHardwareValidation = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorSessionModel(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorSessionModel(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("AindBehaviorServicesPkgVersion = " + _aindBehaviorServicesPkgVersion + ", ");
+ stringBuilder.Append("Version = " + _version + ", ");
+ stringBuilder.Append("Experiment = " + _experiment + ", ");
+ stringBuilder.Append("Experimenter = " + _experimenter + ", ");
+ stringBuilder.Append("Date = " + _date + ", ");
+ stringBuilder.Append("RootPath = " + _rootPath + ", ");
+ stringBuilder.Append("SessionName = " + _sessionName + ", ");
+ stringBuilder.Append("Subject = " + _subject + ", ");
+ stringBuilder.Append("ExperimentVersion = " + _experimentVersion + ", ");
+ stringBuilder.Append("Notes = " + _notes + ", ");
+ stringBuilder.Append("CommitHash = " + _commitHash + ", ");
+ stringBuilder.Append("AllowDirtyRepo = " + _allowDirtyRepo + ", ");
+ stringBuilder.Append("SkipHardwareValidation = " + _skipHardwareValidation);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Aind manipulator calibration class
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Aind manipulator calibration class")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindManipulatorCalibration
+ {
+
+ private string _deviceName;
+
+ private AindManipulatorCalibrationInput _input;
+
+ private AindManipulatorCalibrationOutput _output;
+
+ private System.DateTimeOffset? _date;
+
+ private string _description;
+
+ private string _notes;
+
+ public AindManipulatorCalibration()
+ {
+ _deviceName = "AindManipulator";
+ _input = new AindManipulatorCalibrationInput();
+ _output = new AindManipulatorCalibrationOutput();
+ _description = "Calibration of the load cells system";
+ }
+
+ protected AindManipulatorCalibration(AindManipulatorCalibration other)
+ {
+ _deviceName = other._deviceName;
+ _input = other._input;
+ _output = other._output;
+ _date = other._date;
+ _description = other._description;
+ _notes = other._notes;
+ }
+
+ ///
+ /// Must match a device name in rig/instrument
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
+ [System.ComponentModel.DescriptionAttribute("Must match a device name in rig/instrument")]
+ public string DeviceName
+ {
+ get
+ {
+ return _deviceName;
+ }
+ set
+ {
+ _deviceName = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("input", Required=Newtonsoft.Json.Required.Always)]
+ public AindManipulatorCalibrationInput Input
+ {
+ get
+ {
+ return _input;
+ }
+ set
+ {
+ _input = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
+ public AindManipulatorCalibrationOutput Output
+ {
+ get
+ {
+ return _output;
+ }
+ set
+ {
+ _output = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("date")]
+ public System.DateTimeOffset? Date
+ {
+ get
+ {
+ return _date;
+ }
+ set
+ {
+ _date = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("description")]
+ public string Description
+ {
+ get
+ {
+ return _description;
+ }
+ set
+ {
+ _description = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("notes")]
+ public string Notes
+ {
+ get
+ {
+ return _notes;
+ }
+ set
+ {
+ _notes = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibration(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibration(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("DeviceName = " + _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))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindManipulatorCalibrationInput
+ {
+
+ private ManipulatorPosition _fullStepToMm;
+
+ private System.Collections.Generic.List _axisConfiguration;
+
+ private System.Collections.Generic.List _homingOrder;
+
+ private ManipulatorPosition _initialPosition;
+
+ public AindManipulatorCalibrationInput()
+ {
+ _fullStepToMm = new ManipulatorPosition();
+ _axisConfiguration = new System.Collections.Generic.List();
+ _homingOrder = new System.Collections.Generic.List();
+ _initialPosition = new ManipulatorPosition();
+ }
+
+ protected AindManipulatorCalibrationInput(AindManipulatorCalibrationInput other)
+ {
+ _fullStepToMm = other._fullStepToMm;
+ _axisConfiguration = other._axisConfiguration;
+ _homingOrder = other._homingOrder;
+ _initialPosition = other._initialPosition;
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("full_step_to_mm")]
+ public ManipulatorPosition FullStepToMm
+ {
+ get
+ {
+ return _fullStepToMm;
+ }
+ set
+ {
+ _fullStepToMm = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("axis_configuration")]
+ public System.Collections.Generic.List AxisConfiguration
+ {
+ get
+ {
+ return _axisConfiguration;
+ }
+ set
+ {
+ _axisConfiguration = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("homing_order")]
+ public System.Collections.Generic.List HomingOrder
+ {
+ get
+ {
+ return _homingOrder;
+ }
+ set
+ {
+ _homingOrder = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("initial_position")]
+ public ManipulatorPosition InitialPosition
+ {
+ get
+ {
+ return _initialPosition;
+ }
+ set
+ {
+ _initialPosition = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibrationInput(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibrationInput(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("FullStepToMm = " + _fullStepToMm + ", ");
+ stringBuilder.Append("AxisConfiguration = " + _axisConfiguration + ", ");
+ stringBuilder.Append("HomingOrder = " + _homingOrder + ", ");
+ stringBuilder.Append("InitialPosition = " + _initialPosition);
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindManipulatorCalibrationOutput
+ {
+
+ public AindManipulatorCalibrationOutput()
+ {
+ }
+
+ protected AindManipulatorCalibrationOutput(AindManipulatorCalibrationOutput other)
+ {
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibrationOutput(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibrationOutput(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ return false;
+ }
+
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AindManipulatorDevice
+ {
+
+ private string _deviceType;
+
+ private string _deviceName;
+
+ private BaseModel _additionalSettings;
+
+ private AindManipulatorCalibration _calibration;
+
+ private int _whoAmI;
+
+ private string _serialNumber;
+
+ private string _portName;
+
+ public AindManipulatorDevice()
+ {
+ _deviceType = "StepperDriver";
+ _whoAmI = 1130;
+ }
+
+ protected AindManipulatorDevice(AindManipulatorDevice other)
+ {
+ _deviceType = other._deviceType;
+ _deviceName = other._deviceName;
+ _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;
+ }
+ }
+
+ ///
+ /// Device name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
+ [System.ComponentModel.DescriptionAttribute("Device name")]
+ public string DeviceName
+ {
+ get
+ {
+ return _deviceName;
+ }
+ set
+ {
+ _deviceName = 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;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
+ public AindManipulatorCalibration Calibration
+ {
+ get
+ {
+ return _calibration;
+ }
+ set
+ {
+ _calibration = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
+ public int WhoAmI
+ {
+ get
+ {
+ return _whoAmI;
+ }
+ set
+ {
+ _whoAmI = value;
+ }
+ }
+
+ ///
+ /// Device serial number
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
+ [System.ComponentModel.DescriptionAttribute("Device serial number")]
+ public string SerialNumber
+ {
+ get
+ {
+ return _serialNumber;
+ }
+ set
+ {
+ _serialNumber = value;
+ }
+ }
+
+ ///
+ /// Device port name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Device port name")]
+ public string PortName
+ {
+ get
+ {
+ return _portName;
+ }
+ set
+ {
+ _portName = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorDevice(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorDevice(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("DeviceType = " + _deviceType + ", ");
+ stringBuilder.Append("DeviceName = " + _deviceName + ", ");
+ stringBuilder.Append("AdditionalSettings = " + _additionalSettings + ", ");
+ stringBuilder.Append("Calibration = " + _calibration + ", ");
+ stringBuilder.Append("WhoAmI = " + _whoAmI + ", ");
+ stringBuilder.Append("SerialNumber = " + _serialNumber + ", ");
+ stringBuilder.Append("PortName = " + _portName);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Motor axis available
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ public enum Axis
+ {
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
+ None = 0,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
+ X = 1,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
+ Y1 = 2,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
+ Y2 = 3,
+
+ [System.Runtime.Serialization.EnumMemberAttribute(Value="4")]
+ Z = 4,
+ }
+
+
+ ///
+ /// Axis configuration
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Axis configuration")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class AxisConfiguration
+ {
+
+ private Axis _axis;
+
+ private int _stepAccelerationInterval;
+
+ private int _stepInterval;
+
+ private MicrostepResolution _microstepResolution;
+
+ private int _maximumStepInterval;
+
+ private MotorOperationMode _motorOperationMode;
+
+ private double _maxLimit;
+
+ private double _minLimit;
+
+ public AxisConfiguration()
+ {
+ _stepAccelerationInterval = 100;
+ _stepInterval = 100;
+ _microstepResolution = AindBehaviorDeviceWaterTunerDataSchema.MicrostepResolution.Microstep8;
+ _maximumStepInterval = 2000;
+ _motorOperationMode = AindBehaviorDeviceWaterTunerDataSchema.MotorOperationMode.Quiet;
+ _maxLimit = 25D;
+ _minLimit = -0.01D;
+ }
+
+ protected AxisConfiguration(AxisConfiguration other)
+ {
+ _axis = other._axis;
+ _stepAccelerationInterval = other._stepAccelerationInterval;
+ _stepInterval = other._stepInterval;
+ _microstepResolution = other._microstepResolution;
+ _maximumStepInterval = other._maximumStepInterval;
+ _motorOperationMode = other._motorOperationMode;
+ _maxLimit = other._maxLimit;
+ _minLimit = other._minLimit;
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("axis", Required=Newtonsoft.Json.Required.Always)]
+ public Axis Axis
+ {
+ get
+ {
+ return _axis;
+ }
+ set
+ {
+ _axis = value;
+ }
+ }
+
+ ///
+ /// Acceleration of the step interval in microseconds
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("step_acceleration_interval")]
+ [System.ComponentModel.DescriptionAttribute("Acceleration of the step interval in microseconds")]
+ public int StepAccelerationInterval
+ {
+ get
+ {
+ return _stepAccelerationInterval;
+ }
+ set
+ {
+ _stepAccelerationInterval = value;
+ }
+ }
+
+ ///
+ /// Step interval in microseconds.
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("step_interval")]
+ [System.ComponentModel.DescriptionAttribute("Step interval in microseconds.")]
+ public int StepInterval
+ {
+ get
+ {
+ return _stepInterval;
+ }
+ set
+ {
+ _stepInterval = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("microstep_resolution")]
+ public MicrostepResolution MicrostepResolution
+ {
+ get
+ {
+ return _microstepResolution;
+ }
+ set
+ {
+ _microstepResolution = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("maximum_step_interval")]
+ public int MaximumStepInterval
+ {
+ get
+ {
+ return _maximumStepInterval;
+ }
+ set
+ {
+ _maximumStepInterval = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("motor_operation_mode")]
+ public MotorOperationMode MotorOperationMode
+ {
+ get
+ {
+ return _motorOperationMode;
+ }
+ set
+ {
+ _motorOperationMode = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("max_limit")]
+ public double MaxLimit
+ {
+ get
+ {
+ return _maxLimit;
+ }
+ set
+ {
+ _maxLimit = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("min_limit")]
+ public double MinLimit
+ {
+ get
+ {
+ return _minLimit;
+ }
+ set
+ {
+ _minLimit = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AxisConfiguration(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new AxisConfiguration(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("Axis = " + _axis + ", ");
+ stringBuilder.Append("StepAccelerationInterval = " + _stepAccelerationInterval + ", ");
+ stringBuilder.Append("StepInterval = " + _stepInterval + ", ");
+ stringBuilder.Append("MicrostepResolution = " + _microstepResolution + ", ");
+ stringBuilder.Append("MaximumStepInterval = " + _maximumStepInterval + ", ");
+ stringBuilder.Append("MotorOperationMode = " + _motorOperationMode + ", ");
+ stringBuilder.Append("MaxLimit = " + _maxLimit + ", ");
+ stringBuilder.Append("MinLimit = " + _minLimit);
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class BaseModel
+ {
+
+ public BaseModel()
+ {
+ }
+
+ protected BaseModel(BaseModel other)
+ {
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BaseModel(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new BaseModel(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ return false;
+ }
+
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class ExtensionDataTypes
+ {
+
+ private WaterValveCalibration _calibration;
+
+ public ExtensionDataTypes()
+ {
+ _calibration = new WaterValveCalibration();
+ }
+
+ protected ExtensionDataTypes(ExtensionDataTypes other)
+ {
+ _calibration = other._calibration;
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("calibration", Required=Newtonsoft.Json.Required.Always)]
+ public WaterValveCalibration Calibration
+ {
+ get
+ {
+ return _calibration;
+ }
+ set
+ {
+ _calibration = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ExtensionDataTypes(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new ExtensionDataTypes(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("Calibration = " + _calibration);
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class HarpBehavior
+ {
+
+ private string _deviceType;
+
+ private string _deviceName;
+
+ private BaseModel _additionalSettings;
+
+ private BaseModel _calibration;
+
+ private int _whoAmI;
+
+ private string _serialNumber;
+
+ private string _portName;
+
+ public HarpBehavior()
+ {
+ _deviceType = "Behavior";
+ _whoAmI = 1216;
+ }
+
+ protected HarpBehavior(HarpBehavior other)
+ {
+ _deviceType = other._deviceType;
+ _deviceName = other._deviceName;
+ _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;
+ }
+ }
+
+ ///
+ /// Device name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
+ [System.ComponentModel.DescriptionAttribute("Device name")]
+ public string DeviceName
+ {
+ get
+ {
+ return _deviceName;
+ }
+ set
+ {
+ _deviceName = 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
+ {
+ return _whoAmI;
+ }
+ set
+ {
+ _whoAmI = value;
+ }
+ }
+
+ ///
+ /// Device serial number
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
+ [System.ComponentModel.DescriptionAttribute("Device serial number")]
+ public string SerialNumber
+ {
+ get
+ {
+ return _serialNumber;
+ }
+ set
+ {
+ _serialNumber = value;
+ }
+ }
+
+ ///
+ /// Device port name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Device port name")]
+ public string PortName
+ {
+ get
+ {
+ return _portName;
+ }
+ set
+ {
+ _portName = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpBehavior(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new HarpBehavior(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("DeviceType = " + _deviceType + ", ");
+ stringBuilder.Append("DeviceName = " + _deviceName + ", ");
+ stringBuilder.Append("AdditionalSettings = " + _additionalSettings + ", ");
+ stringBuilder.Append("Calibration = " + _calibration + ", ");
+ stringBuilder.Append("WhoAmI = " + _whoAmI + ", ");
+ stringBuilder.Append("SerialNumber = " + _serialNumber + ", ");
+ stringBuilder.Append("PortName = " + _portName);
+ 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.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class ManipulatorPosition
+ {
+
+ private double _x;
+
+ private double _y1;
+
+ private double _y2;
+
+ private double _z;
+
+ public ManipulatorPosition()
+ {
+ }
+
+ protected ManipulatorPosition(ManipulatorPosition other)
+ {
+ _x = other._x;
+ _y1 = other._y1;
+ _y2 = other._y2;
+ _z = other._z;
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("x", Required=Newtonsoft.Json.Required.Always)]
+ public double X
+ {
+ get
+ {
+ return _x;
+ }
+ set
+ {
+ _x = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("y1", Required=Newtonsoft.Json.Required.Always)]
+ public double Y1
+ {
+ get
+ {
+ return _y1;
+ }
+ set
+ {
+ _y1 = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("y2", Required=Newtonsoft.Json.Required.Always)]
+ public double Y2
+ {
+ get
+ {
+ return _y2;
+ }
+ set
+ {
+ _y2 = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("z", Required=Newtonsoft.Json.Required.Always)]
+ public double Z
+ {
+ get
+ {
+ return _z;
+ }
+ set
+ {
+ _z = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new ManipulatorPosition(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new ManipulatorPosition(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);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Input for water valve calibration class
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Input for water valve calibration class")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class Measurement
+ {
+
+ private double _valveOpenInterval;
+
+ private double _valveOpenTime;
+
+ private System.Collections.Generic.List _waterWeight;
+
+ private int _repeatCount;
+
+ public Measurement()
+ {
+ _waterWeight = new System.Collections.Generic.List();
+ }
+
+ protected Measurement(Measurement other)
+ {
+ _valveOpenInterval = other._valveOpenInterval;
+ _valveOpenTime = other._valveOpenTime;
+ _waterWeight = other._waterWeight;
+ _repeatCount = other._repeatCount;
+ }
+
+ ///
+ /// 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("water_weight", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Weight of water delivered (g)")]
+ public System.Collections.Generic.List WaterWeight
+ {
+ get
+ {
+ return _waterWeight;
+ }
+ set
+ {
+ _waterWeight = value;
+ }
+ }
+
+ ///
+ /// 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
+ {
+ get
+ {
+ return _repeatCount;
+ }
+ set
+ {
+ _repeatCount = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new Measurement(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new Measurement(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("ValveOpenInterval = " + _valveOpenInterval + ", ");
+ stringBuilder.Append("ValveOpenTime = " + _valveOpenTime + ", ");
+ stringBuilder.Append("WaterWeight = " + _waterWeight + ", ");
+ stringBuilder.Append("RepeatCount = " + _repeatCount);
+ 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.6.1.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.6.1.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,
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class SerialScale
+ {
+
+ private string _deviceType;
+
+ private string _deviceName;
+
+ private BaseModel _additionalSettings;
+
+ private BaseModel _calibration;
+
+ private string _portName;
+
+ public SerialScale()
+ {
+ _deviceType = "SerialScale";
+ }
+
+ protected SerialScale(SerialScale other)
+ {
+ _deviceType = other._deviceType;
+ _deviceName = other._deviceName;
+ _additionalSettings = other._additionalSettings;
+ _calibration = other._calibration;
+ _portName = other._portName;
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
+ public string DeviceType
+ {
+ get
+ {
+ return _deviceType;
+ }
+ set
+ {
+ _deviceType = value;
+ }
+ }
+
+ ///
+ /// Device name
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
+ [System.ComponentModel.DescriptionAttribute("Device name")]
+ public string DeviceName
+ {
+ get
+ {
+ return _deviceName;
+ }
+ set
+ {
+ _deviceName = 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;
+ }
+ }
+
+ ///
+ /// COM port to which the scale is connected
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("COM port to which the scale is connected")]
+ public string PortName
+ {
+ get
+ {
+ return _portName;
+ }
+ set
+ {
+ _portName = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new SerialScale(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new SerialScale(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("DeviceType = " + _deviceType + ", ");
+ stringBuilder.Append("DeviceName = " + _deviceName + ", ");
+ stringBuilder.Append("AdditionalSettings = " + _additionalSettings + ", ");
+ stringBuilder.Append("Calibration = " + _calibration + ", ");
+ stringBuilder.Append("PortName = " + _portName);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Water valve calibration class
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Water valve calibration class")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class WaterValveCalibration
+ {
+
+ private string _deviceName;
+
+ private WaterValveCalibrationInput _input;
+
+ private WaterValveCalibrationOutput _output;
+
+ private System.DateTimeOffset? _date;
+
+ private string _description;
+
+ private string _notes;
+
+ public WaterValveCalibration()
+ {
+ _deviceName = "WaterValve";
+ _input = new WaterValveCalibrationInput();
+ _output = new WaterValveCalibrationOutput();
+ _description = "Calibration of the water valve delivery system";
+ }
+
+ protected WaterValveCalibration(WaterValveCalibration 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 WaterValveCalibrationInput Input
+ {
+ get
+ {
+ return _input;
+ }
+ set
+ {
+ _input = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
+ public WaterValveCalibrationOutput Output
+ {
+ get
+ {
+ return _output;
+ }
+ set
+ {
+ _output = value;
+ }
+ }
+
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("date")]
+ public System.DateTimeOffset? Date
+ {
+ get
+ {
+ return _date;
+ }
+ set
+ {
+ _date = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("description")]
+ public string Description
+ {
+ get
+ {
+ return _description;
+ }
+ set
+ {
+ _description = value;
+ }
+ }
+
+ [Newtonsoft.Json.JsonPropertyAttribute("notes")]
+ public string Notes
+ {
+ get
+ {
+ return _notes;
+ }
+ set
+ {
+ _notes = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new WaterValveCalibration(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new WaterValveCalibration(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("DeviceName = " + _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))
+ {
+ stringBuilder.Append(" ");
+ }
+ stringBuilder.Append("}");
+ return stringBuilder.ToString();
+ }
+ }
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class WaterValveCalibrationInput
+ {
+
+ private System.Collections.Generic.List _measurements;
+
+ public WaterValveCalibrationInput()
+ {
+ _measurements = new System.Collections.Generic.List();
+ }
+
+ protected WaterValveCalibrationInput(WaterValveCalibrationInput other)
+ {
+ _measurements = other._measurements;
+ }
+
+ ///
+ /// List of measurements
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("measurements")]
+ [System.ComponentModel.DescriptionAttribute("List of measurements")]
+ public System.Collections.Generic.List Measurements
+ {
+ get
+ {
+ return _measurements;
+ }
+ set
+ {
+ _measurements = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new WaterValveCalibrationInput(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new WaterValveCalibrationInput(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("Measurements = " + _measurements);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Output for water valve calibration class
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Output for water valve calibration class")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
+ [Bonsai.CombinatorAttribute(MethodName="Generate")]
+ public partial class WaterValveCalibrationOutput
+ {
+
+ private System.Collections.Generic.Dictionary _intervalAverage;
+
+ private double _slope;
+
+ private double _offset;
+
+ private double? _r2;
+
+ private System.Collections.Generic.List _validDomain;
+
+ public WaterValveCalibrationOutput()
+ {
+ }
+
+ protected WaterValveCalibrationOutput(WaterValveCalibrationOutput other)
+ {
+ _intervalAverage = other._intervalAverage;
+ _slope = other._slope;
+ _offset = other._offset;
+ _r2 = other._r2;
+ _validDomain = other._validDomain;
+ }
+
+ ///
+ /// Dictionary keyed by measured valve interval and corresponding average single event volume.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("interval_average")]
+ [System.ComponentModel.DescriptionAttribute("Dictionary keyed by measured valve interval and corresponding average single even" +
+ "t volume.")]
+ public System.Collections.Generic.Dictionary IntervalAverage
+ {
+ get
+ {
+ return _intervalAverage;
+ }
+ set
+ {
+ _intervalAverage = value;
+ }
+ }
+
+ ///
+ /// Slope of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("slope", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Slope of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)")]
+ public double Slope
+ {
+ get
+ {
+ return _slope;
+ }
+ set
+ {
+ _slope = value;
+ }
+ }
+
+ ///
+ /// Offset of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)
+ ///
+ [Newtonsoft.Json.JsonPropertyAttribute("offset", Required=Newtonsoft.Json.Required.Always)]
+ [System.ComponentModel.DescriptionAttribute("Offset of the linear regression : Volume(g) = Slope(g/s) * time(s) + offset(g)")]
+ public double Offset
+ {
+ get
+ {
+ return _offset;
+ }
+ set
+ {
+ _offset = value;
+ }
+ }
+
+ ///
+ /// R2 metric from the linear model.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("r2")]
+ [System.ComponentModel.DescriptionAttribute("R2 metric from the linear model.")]
+ public double? R2
+ {
+ get
+ {
+ return _r2;
+ }
+ set
+ {
+ _r2 = value;
+ }
+ }
+
+ ///
+ /// The optional time-intervals the calibration curve was calculated on.
+ ///
+ [System.Xml.Serialization.XmlIgnoreAttribute()]
+ [Newtonsoft.Json.JsonPropertyAttribute("valid_domain")]
+ [System.ComponentModel.DescriptionAttribute("The optional time-intervals the calibration curve was calculated on.")]
+ public System.Collections.Generic.List ValidDomain
+ {
+ get
+ {
+ return _validDomain;
+ }
+ set
+ {
+ _validDomain = value;
+ }
+ }
+
+ public System.IObservable Generate()
+ {
+ return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new WaterValveCalibrationOutput(this)));
+ }
+
+ public System.IObservable Generate(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, _ => new WaterValveCalibrationOutput(this));
+ }
+
+ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
+ {
+ stringBuilder.Append("IntervalAverage = " + _intervalAverage + ", ");
+ stringBuilder.Append("Slope = " + _slope + ", ");
+ stringBuilder.Append("Offset = " + _offset + ", ");
+ stringBuilder.Append("R2 = " + _r2 + ", ");
+ stringBuilder.Append("ValidDomain = " + _validDomain);
+ 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();
+ }
+ }
+
+
+ ///
+ /// Serializes a sequence of data model objects into JSON strings.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Serializes a sequence of data model objects into JSON strings.")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Transform)]
+ [Bonsai.CombinatorAttribute()]
+ public partial class SerializeToJson
+ {
+
+ public Newtonsoft.Json.Formatting Formatting { get; set; }
+
+ private System.IObservable Process(System.IObservable source)
+ {
+ var formatting = Formatting;
+ return System.Reactive.Linq.Observable.Select(source, value => Newtonsoft.Json.JsonConvert.SerializeObject(value, formatting));
+ }
+
+ 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);
+ }
+
+ 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);
+ }
+
+ 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);
+ }
+ }
+
+
+ ///
+ /// Deserializes a sequence of JSON strings into data model objects.
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.6.1.0 (Newtonsoft.Json v13.0.0.0)")]
+ [System.ComponentModel.DescriptionAttribute("Deserializes a sequence of JSON strings into data model objects.")]
+ [System.ComponentModel.DefaultPropertyAttribute("Type")]
+ [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Transform)]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
+ public partial class DeserializeFromJson : Bonsai.Expressions.SingleArgumentExpressionBuilder
+ {
+
+ public DeserializeFromJson()
+ {
+ Type = new Bonsai.Expressions.TypeMapping();
+ }
+
+ public Bonsai.Expressions.TypeMapping Type { get; set; }
+
+ public override System.Linq.Expressions.Expression Build(System.Collections.Generic.IEnumerable arguments)
+ {
+ var typeMapping = (Bonsai.Expressions.TypeMapping)Type;
+ var returnType = typeMapping.GetType().GetGenericArguments()[0];
+ return System.Linq.Expressions.Expression.Call(
+ typeof(DeserializeFromJson),
+ "Process",
+ new System.Type[] { returnType },
+ System.Linq.Enumerable.Single(arguments));
+ }
+
+ private static System.IObservable Process(System.IObservable source)
+ {
+ return System.Reactive.Linq.Observable.Select(source, value => Newtonsoft.Json.JsonConvert.DeserializeObject(value));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Extensions/AindBehaviorSessionModel.cs b/src/Extensions/AindBehaviorSessionModel.cs
deleted file mode 100644
index 3fc0ea4..0000000
--- a/src/Extensions/AindBehaviorSessionModel.cs
+++ /dev/null
@@ -1,379 +0,0 @@
-//----------------------
-//
-// Generated using the NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
-//
-//----------------------
-
-
-namespace AindBehaviorWaterTuner.Session
-{
- #pragma warning disable // Disable all warnings
-
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AindBehaviorSessionModel
- {
-
- private string _aindBehaviorServicesPkgVersion = "0.11.0";
-
- private string _version = "0.3.1";
-
- private string _experiment;
-
- private System.Collections.Generic.List _experimenter = new System.Collections.Generic.List();
-
- private System.DateTimeOffset _date;
-
- private string _rootPath;
-
- private string _sessionName;
-
- private string _subject;
-
- private string _experimentVersion;
-
- private string _notes;
-
- private string _commitHash;
-
- private bool _allowDirtyRepo = false;
-
- private bool _skipHardwareValidation = false;
-
- public AindBehaviorSessionModel()
- {
- }
-
- protected AindBehaviorSessionModel(AindBehaviorSessionModel other)
- {
- _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
- _version = other._version;
- _experiment = other._experiment;
- _experimenter = other._experimenter;
- _date = other._date;
- _rootPath = other._rootPath;
- _sessionName = other._sessionName;
- _subject = other._subject;
- _experimentVersion = other._experimentVersion;
- _notes = other._notes;
- _commitHash = other._commitHash;
- _allowDirtyRepo = other._allowDirtyRepo;
- _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
- {
- get
- {
- return _version;
- }
- set
- {
- _version = value;
- }
- }
-
- ///
- /// Name of the experiment
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("experiment", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Name of the experiment")]
- public string Experiment
- {
- get
- {
- return _experiment;
- }
- set
- {
- _experiment = value;
- }
- }
-
- ///
- /// Name of the experimenter
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("experimenter")]
- [System.ComponentModel.DescriptionAttribute("Name of the experimenter")]
- public System.Collections.Generic.List Experimenter
- {
- get
- {
- return _experimenter;
- }
- set
- {
- _experimenter = value;
- }
- }
-
- ///
- /// Date of the experiment
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("date")]
- [System.ComponentModel.DescriptionAttribute("Date of the experiment")]
- public System.DateTimeOffset Date
- {
- get
- {
- return _date;
- }
- set
- {
- _date = value;
- }
- }
-
- ///
- /// Root path where data will be logged
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("root_path", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Root path where data will be logged")]
- public string RootPath
- {
- get
- {
- return _rootPath;
- }
- set
- {
- _rootPath = value;
- }
- }
-
- ///
- /// Name of the session. This will be used to create a folder in the root path.
- ///
- [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 _sessionName;
- }
- set
- {
- _sessionName = value;
- }
- }
-
- ///
- /// Name of the subject
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("subject", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Name of the subject")]
- public string Subject
- {
- get
- {
- return _subject;
- }
- set
- {
- _subject = value;
- }
- }
-
- ///
- /// Version of the experiment
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("experiment_version", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Version of the experiment")]
- public string ExperimentVersion
- {
- get
- {
- return _experimentVersion;
- }
- set
- {
- _experimentVersion = value;
- }
- }
-
- ///
- /// Notes about the experiment
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("notes")]
- [System.ComponentModel.DescriptionAttribute("Notes about the experiment")]
- public string Notes
- {
- get
- {
- return _notes;
- }
- set
- {
- _notes = value;
- }
- }
-
- ///
- /// Commit hash of the repository
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("commit_hash")]
- [System.ComponentModel.DescriptionAttribute("Commit hash of the repository")]
- public string CommitHash
- {
- get
- {
- return _commitHash;
- }
- set
- {
- _commitHash = value;
- }
- }
-
- ///
- /// Allow running from a dirty repository
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("allow_dirty_repo")]
- [System.ComponentModel.DescriptionAttribute("Allow running from a dirty repository")]
- public bool AllowDirtyRepo
- {
- get
- {
- return _allowDirtyRepo;
- }
- set
- {
- _allowDirtyRepo = value;
- }
- }
-
- ///
- /// Skip hardware validation
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("skip_hardware_validation")]
- [System.ComponentModel.DescriptionAttribute("Skip hardware validation")]
- public bool SkipHardwareValidation
- {
- get
- {
- return _skipHardwareValidation;
- }
- set
- {
- _skipHardwareValidation = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorSessionModel(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorSessionModel(this));
- }
-
- 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("session_name = " + _sessionName + ", ");
- stringBuilder.Append("subject = " + _subject + ", ");
- stringBuilder.Append("experiment_version = " + _experimentVersion + ", ");
- stringBuilder.Append("notes = " + _notes + ", ");
- stringBuilder.Append("commit_hash = " + _commitHash + ", ");
- stringBuilder.Append("allow_dirty_repo = " + _allowDirtyRepo + ", ");
- stringBuilder.Append("skip_hardware_validation = " + _skipHardwareValidation);
- 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();
- }
- }
-
-
- ///
- /// Serializes a sequence of data model objects into JSON strings.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Serializes a sequence of data model objects into JSON strings.")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Transform)]
- public partial class SerializeToJson
- {
-
- private System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, value => Newtonsoft.Json.JsonConvert.SerializeObject(value));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return Process(source);
- }
- }
-
-
- ///
- /// Deserializes a sequence of JSON strings into data model objects.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Deserializes a sequence of JSON strings into data model objects.")]
- [System.ComponentModel.DefaultPropertyAttribute("Type")]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Transform)]
- [System.Xml.Serialization.XmlIncludeAttribute(typeof(Bonsai.Expressions.TypeMapping))]
- public partial class DeserializeFromJson : Bonsai.Expressions.SingleArgumentExpressionBuilder
- {
-
- public DeserializeFromJson()
- {
- Type = new Bonsai.Expressions.TypeMapping();
- }
-
- public Bonsai.Expressions.TypeMapping Type { get; set; }
-
- public override System.Linq.Expressions.Expression Build(System.Collections.Generic.IEnumerable arguments)
- {
- var typeMapping = (Bonsai.Expressions.TypeMapping)Type;
- var returnType = typeMapping.GetType().GetGenericArguments()[0];
- return System.Linq.Expressions.Expression.Call(
- typeof(DeserializeFromJson),
- "Process",
- new System.Type[] { returnType },
- System.Linq.Enumerable.Single(arguments));
- }
-
- private static System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, value => Newtonsoft.Json.JsonConvert.DeserializeObject(value));
- }
- }
-}
\ No newline at end of file
diff --git a/src/Extensions/AindBehaviorWaterTunerRig.cs b/src/Extensions/AindBehaviorWaterTunerRig.cs
deleted file mode 100644
index a1c779a..0000000
--- a/src/Extensions/AindBehaviorWaterTunerRig.cs
+++ /dev/null
@@ -1,1539 +0,0 @@
-//----------------------
-//
-// Generated using the NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
-//
-//----------------------
-
-
-namespace AindBehaviorWaterTuner.Rig
-{
- #pragma warning disable // Disable all warnings
-
- ///
- /// Aind manipulator calibration class
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Aind manipulator calibration class")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AindManipulatorCalibration
- {
-
- private string _deviceName = "AindManipulator";
-
- private AindManipulatorCalibrationInput _input = new AindManipulatorCalibrationInput();
-
- private AindManipulatorCalibrationOutput _output = new AindManipulatorCalibrationOutput();
-
- private System.DateTimeOffset? _date;
-
- private string _description = "Calibration of the load cells system";
-
- private string _notes;
-
- public AindManipulatorCalibration()
- {
- }
-
- protected AindManipulatorCalibration(AindManipulatorCalibration other)
- {
- _deviceName = other._deviceName;
- _input = other._input;
- _output = other._output;
- _date = other._date;
- _description = other._description;
- _notes = other._notes;
- }
-
- ///
- /// Must match a device name in rig/instrument
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Must match a device name in rig/instrument")]
- public string DeviceName
- {
- get
- {
- return _deviceName;
- }
- set
- {
- _deviceName = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("input", Required=Newtonsoft.Json.Required.Always)]
- public AindManipulatorCalibrationInput Input
- {
- get
- {
- return _input;
- }
- set
- {
- _input = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("output", Required=Newtonsoft.Json.Required.Always)]
- public AindManipulatorCalibrationOutput Output
- {
- get
- {
- return _output;
- }
- set
- {
- _output = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("date")]
- public System.DateTimeOffset? Date
- {
- get
- {
- return _date;
- }
- set
- {
- _date = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("description")]
- public string Description
- {
- get
- {
- return _description;
- }
- set
- {
- _description = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("notes")]
- public string Notes
- {
- get
- {
- return _notes;
- }
- set
- {
- _notes = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibration(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibration(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))
- {
- stringBuilder.Append(" ");
- }
- stringBuilder.Append("}");
- return stringBuilder.ToString();
- }
- }
-
-
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AindManipulatorCalibrationInput
- {
-
- private ManipulatorPosition _fullStepToMm;
-
- private System.Collections.Generic.List _axisConfiguration = new System.Collections.Generic.List();
-
- private System.Collections.Generic.List _homingOrder = new System.Collections.Generic.List();
-
- private ManipulatorPosition _initialPosition;
-
- public AindManipulatorCalibrationInput()
- {
- }
-
- protected AindManipulatorCalibrationInput(AindManipulatorCalibrationInput other)
- {
- _fullStepToMm = other._fullStepToMm;
- _axisConfiguration = other._axisConfiguration;
- _homingOrder = other._homingOrder;
- _initialPosition = other._initialPosition;
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("full_step_to_mm")]
- public ManipulatorPosition FullStepToMm
- {
- get
- {
- return _fullStepToMm;
- }
- set
- {
- _fullStepToMm = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("axis_configuration")]
- public System.Collections.Generic.List AxisConfiguration
- {
- get
- {
- return _axisConfiguration;
- }
- set
- {
- _axisConfiguration = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("homing_order")]
- public System.Collections.Generic.List HomingOrder
- {
- get
- {
- return _homingOrder;
- }
- set
- {
- _homingOrder = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("initial_position")]
- public ManipulatorPosition InitialPosition
- {
- get
- {
- return _initialPosition;
- }
- set
- {
- _initialPosition = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibrationInput(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibrationInput(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("full_step_to_mm = " + _fullStepToMm + ", ");
- stringBuilder.Append("axis_configuration = " + _axisConfiguration + ", ");
- stringBuilder.Append("homing_order = " + _homingOrder + ", ");
- stringBuilder.Append("initial_position = " + _initialPosition);
- 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.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AindManipulatorCalibrationOutput
- {
-
- public AindManipulatorCalibrationOutput()
- {
- }
-
- protected AindManipulatorCalibrationOutput(AindManipulatorCalibrationOutput other)
- {
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorCalibrationOutput(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorCalibrationOutput(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- return false;
- }
-
- 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.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AindManipulatorDevice
- {
-
- private string _deviceType = "StepperDriver";
-
- private string _deviceName;
-
- private BaseModel _additionalSettings;
-
- private AindManipulatorCalibration _calibration;
-
- private int _whoAmI = 1130;
-
- private string _serialNumber;
-
- private string _portName;
-
- public AindManipulatorDevice()
- {
- }
-
- protected AindManipulatorDevice(AindManipulatorDevice other)
- {
- _deviceType = other._deviceType;
- _deviceName = other._deviceName;
- _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;
- }
- }
-
- ///
- /// Device name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Device name")]
- public string DeviceName
- {
- get
- {
- return _deviceName;
- }
- set
- {
- _deviceName = 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;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("calibration")]
- public AindManipulatorCalibration Calibration
- {
- get
- {
- return _calibration;
- }
- set
- {
- _calibration = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("who_am_i")]
- public int WhoAmI
- {
- get
- {
- return _whoAmI;
- }
- set
- {
- _whoAmI = value;
- }
- }
-
- ///
- /// Device serial number
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
- [System.ComponentModel.DescriptionAttribute("Device serial number")]
- public string SerialNumber
- {
- get
- {
- return _serialNumber;
- }
- set
- {
- _serialNumber = value;
- }
- }
-
- ///
- /// Device port name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Device port name")]
- public string PortName
- {
- get
- {
- return _portName;
- }
- set
- {
- _portName = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindManipulatorDevice(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindManipulatorDevice(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("device_type = " + _deviceType + ", ");
- stringBuilder.Append("device_name = " + _deviceName + ", ");
- 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;
- }
-
- 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();
- }
- }
-
-
- ///
- /// Motor axis available
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- public enum Axis
- {
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="0")]
- None = 0,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="1")]
- X = 1,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="2")]
- Y1 = 2,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="3")]
- Y2 = 3,
-
- [System.Runtime.Serialization.EnumMemberAttribute(Value="4")]
- Z = 4,
- }
-
-
- ///
- /// Axis configuration
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Axis configuration")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AxisConfiguration
- {
-
- private Axis _axis;
-
- private int _stepAccelerationInterval = 100;
-
- private int _stepInterval = 100;
-
- private MicrostepResolution _microstepResolution = AindBehaviorWaterTuner.Rig.MicrostepResolution.Microstep8;
-
- private int _maximumStepInterval = 2000;
-
- private MotorOperationMode _motorOperationMode = AindBehaviorWaterTuner.Rig.MotorOperationMode.Quiet;
-
- private double _maxLimit = 25D;
-
- private double _minLimit = -0.01D;
-
- public AxisConfiguration()
- {
- }
-
- protected AxisConfiguration(AxisConfiguration other)
- {
- _axis = other._axis;
- _stepAccelerationInterval = other._stepAccelerationInterval;
- _stepInterval = other._stepInterval;
- _microstepResolution = other._microstepResolution;
- _maximumStepInterval = other._maximumStepInterval;
- _motorOperationMode = other._motorOperationMode;
- _maxLimit = other._maxLimit;
- _minLimit = other._minLimit;
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("axis", Required=Newtonsoft.Json.Required.Always)]
- public Axis Axis
- {
- get
- {
- return _axis;
- }
- set
- {
- _axis = value;
- }
- }
-
- ///
- /// Acceleration of the step interval in microseconds
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("step_acceleration_interval")]
- [System.ComponentModel.DescriptionAttribute("Acceleration of the step interval in microseconds")]
- public int StepAccelerationInterval
- {
- get
- {
- return _stepAccelerationInterval;
- }
- set
- {
- _stepAccelerationInterval = value;
- }
- }
-
- ///
- /// Step interval in microseconds.
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("step_interval")]
- [System.ComponentModel.DescriptionAttribute("Step interval in microseconds.")]
- public int StepInterval
- {
- get
- {
- return _stepInterval;
- }
- set
- {
- _stepInterval = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("microstep_resolution")]
- public MicrostepResolution MicrostepResolution
- {
- get
- {
- return _microstepResolution;
- }
- set
- {
- _microstepResolution = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("maximum_step_interval")]
- public int MaximumStepInterval
- {
- get
- {
- return _maximumStepInterval;
- }
- set
- {
- _maximumStepInterval = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("motor_operation_mode")]
- public MotorOperationMode MotorOperationMode
- {
- get
- {
- return _motorOperationMode;
- }
- set
- {
- _motorOperationMode = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("max_limit")]
- public double MaxLimit
- {
- get
- {
- return _maxLimit;
- }
- set
- {
- _maxLimit = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("min_limit")]
- public double MinLimit
- {
- get
- {
- return _minLimit;
- }
- set
- {
- _minLimit = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AxisConfiguration(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AxisConfiguration(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("axis = " + _axis + ", ");
- stringBuilder.Append("step_acceleration_interval = " + _stepAccelerationInterval + ", ");
- stringBuilder.Append("step_interval = " + _stepInterval + ", ");
- stringBuilder.Append("microstep_resolution = " + _microstepResolution + ", ");
- stringBuilder.Append("maximum_step_interval = " + _maximumStepInterval + ", ");
- stringBuilder.Append("motor_operation_mode = " + _motorOperationMode + ", ");
- stringBuilder.Append("max_limit = " + _maxLimit + ", ");
- stringBuilder.Append("min_limit = " + _minLimit);
- 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.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class BaseModel
- {
-
- public BaseModel()
- {
- }
-
- protected BaseModel(BaseModel other)
- {
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new BaseModel(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new BaseModel(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- return false;
- }
-
- 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.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class HarpBehavior
- {
-
- private string _deviceType = "Behavior";
-
- private string _deviceName;
-
- private BaseModel _additionalSettings;
-
- private BaseModel _calibration;
-
- private int _whoAmI = 1216;
-
- private string _serialNumber;
-
- private string _portName;
-
- public HarpBehavior()
- {
- }
-
- protected HarpBehavior(HarpBehavior other)
- {
- _deviceType = other._deviceType;
- _deviceName = other._deviceName;
- _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;
- }
- }
-
- ///
- /// Device name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Device name")]
- public string DeviceName
- {
- get
- {
- return _deviceName;
- }
- set
- {
- _deviceName = 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
- {
- return _whoAmI;
- }
- set
- {
- _whoAmI = value;
- }
- }
-
- ///
- /// Device serial number
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("serial_number")]
- [System.ComponentModel.DescriptionAttribute("Device serial number")]
- public string SerialNumber
- {
- get
- {
- return _serialNumber;
- }
- set
- {
- _serialNumber = value;
- }
- }
-
- ///
- /// Device port name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Device port name")]
- public string PortName
- {
- get
- {
- return _portName;
- }
- set
- {
- _portName = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new HarpBehavior(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new HarpBehavior(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("device_type = " + _deviceType + ", ");
- stringBuilder.Append("device_name = " + _deviceName + ", ");
- 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;
- }
-
- 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.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class ManipulatorPosition
- {
-
- private double _x;
-
- private double _y1;
-
- private double _y2;
-
- private double _z;
-
- public ManipulatorPosition()
- {
- }
-
- protected ManipulatorPosition(ManipulatorPosition other)
- {
- _x = other._x;
- _y1 = other._y1;
- _y2 = other._y2;
- _z = other._z;
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("x", Required=Newtonsoft.Json.Required.Always)]
- public double X
- {
- get
- {
- return _x;
- }
- set
- {
- _x = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("y1", Required=Newtonsoft.Json.Required.Always)]
- public double Y1
- {
- get
- {
- return _y1;
- }
- set
- {
- _y1 = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("y2", Required=Newtonsoft.Json.Required.Always)]
- public double Y2
- {
- get
- {
- return _y2;
- }
- set
- {
- _y2 = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("z", Required=Newtonsoft.Json.Required.Always)]
- 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 ManipulatorPosition(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new ManipulatorPosition(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);
- 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.4.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.4.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,
- }
-
-
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class SerialScale
- {
-
- private string _deviceType = "SerialScale";
-
- private string _deviceName;
-
- private BaseModel _additionalSettings;
-
- private BaseModel _calibration;
-
- private string _portName;
-
- public SerialScale()
- {
- }
-
- protected SerialScale(SerialScale other)
- {
- _deviceType = other._deviceType;
- _deviceName = other._deviceName;
- _additionalSettings = other._additionalSettings;
- _calibration = other._calibration;
- _portName = other._portName;
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("device_type")]
- public string DeviceType
- {
- get
- {
- return _deviceType;
- }
- set
- {
- _deviceType = value;
- }
- }
-
- ///
- /// Device name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("device_name")]
- [System.ComponentModel.DescriptionAttribute("Device name")]
- public string DeviceName
- {
- get
- {
- return _deviceName;
- }
- set
- {
- _deviceName = 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;
- }
- }
-
- ///
- /// COM port to which the scale is connected
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("port_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("COM port to which the scale is connected")]
- public string PortName
- {
- get
- {
- return _portName;
- }
- set
- {
- _portName = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new SerialScale(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new SerialScale(this));
- }
-
- protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
- {
- stringBuilder.Append("device_type = " + _deviceType + ", ");
- stringBuilder.Append("device_name = " + _deviceName + ", ");
- stringBuilder.Append("additional_settings = " + _additionalSettings + ", ");
- stringBuilder.Append("calibration = " + _calibration + ", ");
- stringBuilder.Append("port_name = " + _portName);
- 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.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Source)]
- public partial class AindBehaviorWaterTunerRig
- {
-
- private string _aindBehaviorServicesPkgVersion = "0.11.0";
-
- private string _version = "0.2.0";
-
- private string _computerName;
-
- private string _rigName;
-
- private SerialScale _scale = new SerialScale();
-
- private HarpBehavior _harpBehavior = new HarpBehavior();
-
- private AindManipulatorDevice _manipulator;
-
- public AindBehaviorWaterTunerRig()
- {
- }
-
- protected AindBehaviorWaterTunerRig(AindBehaviorWaterTunerRig other)
- {
- _aindBehaviorServicesPkgVersion = other._aindBehaviorServicesPkgVersion;
- _version = other._version;
- _computerName = other._computerName;
- _rigName = other._rigName;
- _scale = other._scale;
- _harpBehavior = other._harpBehavior;
- _manipulator = other._manipulator;
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("aind_behavior_services_pkg_version")]
- public string AindBehaviorServicesPkgVersion
- {
- get
- {
- return _aindBehaviorServicesPkgVersion;
- }
- set
- {
- _aindBehaviorServicesPkgVersion = value;
- }
- }
-
- [Newtonsoft.Json.JsonPropertyAttribute("version")]
- public string Version
- {
- get
- {
- return _version;
- }
- set
- {
- _version = value;
- }
- }
-
- ///
- /// Computer name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("computer_name")]
- [System.ComponentModel.DescriptionAttribute("Computer name")]
- public string ComputerName
- {
- get
- {
- return _computerName;
- }
- set
- {
- _computerName = value;
- }
- }
-
- ///
- /// Rig name
- ///
- [Newtonsoft.Json.JsonPropertyAttribute("rig_name", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Rig name")]
- public string RigName
- {
- get
- {
- return _rigName;
- }
- set
- {
- _rigName = value;
- }
- }
-
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("scale", Required=Newtonsoft.Json.Required.Always)]
- public SerialScale Scale
- {
- get
- {
- return _scale;
- }
- set
- {
- _scale = value;
- }
- }
-
- ///
- /// Harp behavior
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("harp_behavior", Required=Newtonsoft.Json.Required.Always)]
- [System.ComponentModel.DescriptionAttribute("Harp behavior")]
- public HarpBehavior HarpBehavior
- {
- get
- {
- return _harpBehavior;
- }
- set
- {
- _harpBehavior = value;
- }
- }
-
- ///
- /// Manipulator
- ///
- [System.Xml.Serialization.XmlIgnoreAttribute()]
- [Newtonsoft.Json.JsonPropertyAttribute("manipulator")]
- [System.ComponentModel.DescriptionAttribute("Manipulator")]
- public AindManipulatorDevice Manipulator
- {
- get
- {
- return _manipulator;
- }
- set
- {
- _manipulator = value;
- }
- }
-
- public System.IObservable Process()
- {
- return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return(new AindBehaviorWaterTunerRig(this)));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, _ => new AindBehaviorWaterTunerRig(this));
- }
-
- 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 + ", ");
- stringBuilder.Append("scale = " + _scale + ", ");
- stringBuilder.Append("harp_behavior = " + _harpBehavior + ", ");
- stringBuilder.Append("manipulator = " + _manipulator);
- 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();
- }
- }
-
-
- ///
- /// Serializes a sequence of data model objects into JSON strings.
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("Bonsai.Sgen", "0.4.0.0 (Newtonsoft.Json v13.0.0.0)")]
- [System.ComponentModel.DescriptionAttribute("Serializes a sequence of data model objects into JSON strings.")]
- [Bonsai.CombinatorAttribute()]
- [Bonsai.WorkflowElementCategoryAttribute(Bonsai.ElementCategory.Transform)]
- public partial class SerializeToJson
- {
-
- private System.IObservable Process(System.IObservable source)
- {
- return System.Reactive.Linq.Observable.Select(source, value => Newtonsoft.Json.JsonConvert.SerializeObject(value));
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return Process(source);
- }
-
- public System.IObservable Process(System.IObservable source)
- {
- return Process