Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc infrastructure and docfx theme #18

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.77.0",
"commands": [
"docfx"
]
}
}
}
41 changes: 23 additions & 18 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,35 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: Checkout
uses: actions/[email protected]
with:
submodules: true

- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: 7.x

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

uses: microsoft/setup-msbuild@v2
- name: Restore NuGet Packages
run: msbuild -t:restore src\Bonsai.DAQmx.sln
run: msbuild -t:restore src/Bonsai.DAQmx.sln

- name: Build Solution
run: msbuild src/Bonsai.DAQmx.sln /p:Configuration=Release

- name: Setup DocFX
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install docfx
run: dotnet tool restore

- name: Build documentation
run: dotnet docfx docs/docfx.json

- name: Build Documentation
run: docfx docs/docfx.json

- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
- name: Publish to github pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
force_orphan: true
publish_branch: gh-pages
force_orphan: true
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/bonsai"]
path = docs/bonsai
url = https://github.com/bonsai-rx/docfx-tools
14 changes: 13 additions & 1 deletion docs/apidoc/Bonsai_DAQmx_AnalogInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@
uid: Bonsai.DAQmx.AnalogInput
---

[!include[AnalogInput](~/articles/daqmx-analoginput.md)]
[`AnalogInput`](xref:Bonsai.DAQmx.AnalogInput) configures and starts a data acquisition task for sampling voltage measurements from one or more physical analog input channels. Samples from each channel will be collected in a sample buffer, where each row corresponds to a channel in the acquisition task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the [`Channels`](xref:Bonsai.DAQmx.AnalogInput.Channels) property.

If no input source is specified, data will be collected asynchronously every time a new buffer is filled.

:::workflow
![AnalogInput-Async](../workflows/AnalogInput-Async.bonsai)
:::

Alternatively, if an input observable sequence is provided, a new data buffer will be collected every time a new notification is emitted by the input source.

:::workflow
![AnalogInput-Sync](../workflows/AnalogInput-Sync.bonsai)
:::
14 changes: 13 additions & 1 deletion docs/apidoc/Bonsai_DAQmx_AnalogOutput.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@
uid: Bonsai.DAQmx.AnalogOutput
---

[!include[AnalogOutput](~/articles/daqmx-analogoutput.md)]
[`AnalogOutput`](xref:Bonsai.DAQmx.AnalogOutput) configures and starts a task for generating voltage signals in one or more physical analog output channels. Voltage samples for each channel are read from sample buffers in the source sequence, where each row corresponds to one of the channels in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the [`Channels`](xref:Bonsai.DAQmx.AnalogOutput.Channels) property.

Signals can be generated continuously, where a ring buffer is constanty updated with new data arriving from the source sequence.

:::workflow
![AnalogOutput-Continuous](../workflows/AnalogOutput-Continuous.bonsai)
:::

Alternatively, signals can also be generated with a finite number of samples, in which case the input buffers will provide samples until the specified buffer size is reached. In this case, the operator will wait for the task to finish generating the specified number of samples.

:::workflow
![AnalogOutput-Finite](../workflows/AnalogOutput-Finite.bonsai)
:::
16 changes: 15 additions & 1 deletion docs/apidoc/Bonsai_DAQmx_DigitalInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@
uid: Bonsai.DAQmx.DigitalInput
---

[!include[DigitalInput](~/articles/daqmx-digitalinput.md)]
[`DigitalInput`](xref:Bonsai.DAQmx.DigitalInput) configures and starts a data acquisition task for sampling logical values from one or more digital input lines. Logical values will be collected in a sample buffer, where each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel. Each row corresponds to a channel in the acquisition task, and each column to a sample from each of the channels. The order of the channels in the sample buffer follows the order in which you specify the channels in the [`Channels`](xref:Bonsai.DAQmx.DigitalInput.Channels) property.

Digital lines can be grouped as a port when creating the local virtual channel, either by specifying a range of lines (e.g. `Dev1/port0/line0:3`) or by specifying an entire port at once (e.g. `Dev1/port0`).

If no input source is specified, samples will be collected asynchronously every time a new buffer is filled.

:::workflow
![DigitalInput-Async](../workflows/DigitalInput-Async.bonsai)
:::

Alternatively, if an input observable sequence is provided, a new sample buffer will be collected every time a new notification is emitted by the input source.

:::workflow
![DigitalInput-Sync](../workflows/DigitalInput-Sync.bonsai)
:::
22 changes: 21 additions & 1 deletion docs/apidoc/Bonsai_DAQmx_DigitalOutput.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,24 @@
uid: Bonsai.DAQmx.DigitalOutput
---

[!include[DigitalOutput](~/articles/daqmx-digitaloutput.md)]
[`DigitalOutput`](xref:Bonsai.DAQmx.DigitalOutput) configures and starts a task for writing logical values to one or more digital output lines. Logical values for each line are read from sample buffers in the source sequence, where each row corresponds to one of the channels in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the [`Channels`](xref:Bonsai.DAQmx.DigitalOutput.Channels) property.

Each logical value sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel. Digital lines can be grouped as a port when creating the local virtual channel, either by specifying a range of lines (e.g. `Dev1/port0/line0:3`) or by specifying an entire port at once (e.g. `Dev1/port0`).

Signals can be generated continuously, where a ring buffer is constanty updated with new data arriving from the source sequence.

:::workflow
![DigitalOutput-Continuous](../workflows/DigitalOutput-Continuous.bonsai)
:::

Logical values can also be provided by a source of integers specifying a bitmask with the state of all digital lines in a single port.

:::workflow
![DigitalOutput-ContinuousSingleSample](../workflows/DigitalOutput-ContinuousSingleSample.bonsai)
:::

Alternatively, signals can also be generated with a finite number of samples, in which case the input buffers will provide samples until the specified buffer size is reached. In this case, the operator will wait for the task to finish generating the specified number of samples.

:::workflow
![DigitalOutput-Finite](../workflows/DigitalOutput-Finite.bonsai)
:::
18 changes: 0 additions & 18 deletions docs/articles/daqmx-analoginput.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/articles/daqmx-analogoutput.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs/articles/daqmx-digitalinput.md

This file was deleted.

27 changes: 0 additions & 27 deletions docs/articles/daqmx-digitaloutput.md

This file was deleted.

23 changes: 0 additions & 23 deletions docs/articles/intro.md

This file was deleted.

11 changes: 5 additions & 6 deletions docs/articles/manual.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
How to use
==========
# How to use

`Bonsai.DAQmx` provides an interface for data acquisition and signal generation on NI hardware using four distinct operators.

Expand All @@ -8,13 +7,13 @@ In order to use any of the operators, you need to specify a collection of physic
Working examples for each of these operators can be found in the extended description for each operator, which we cover below.

## AnalogInput
[!include[AnalogInput](~/articles/daqmx-analoginput.md)]
[!include[AnalogInput](../apidoc/Bonsai_DAQmx_AnalogInput.md)]

## AnalogOutput
[!include[AnalogOutput](~/articles/daqmx-analogoutput.md)]
[!include[AnalogOutput](../apidoc/Bonsai_DAQmx_AnalogOutput.md)]

## DigitalInput
[!include[DigitalInput](~/articles/daqmx-digitalinput.md)]
[!include[DigitalInput](../apidoc/Bonsai_DAQmx_DigitalInput.md)]

## DigitalOutput
[!include[DigitalOutput](~/articles/daqmx-digitaloutput.md)]
[!include[DigitalOutput](../apidoc/Bonsai_DAQmx_DigitalOutput.md)]
8 changes: 2 additions & 6 deletions docs/articles/toc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
- name: Getting Started
items:
- name: Quickstart
href: intro.md
- name: How to use
href: manual.md
- href: ../index.md
- href: manual.md
1 change: 1 addition & 0 deletions docs/bonsai
Submodule bonsai added at 14246d
Loading