<!-- SPDX-FileCopyrightText: Copyright 2023 Jetperch LLC
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->

<a id="record"></a>

# Record

### *class* pyjoulescope_driver.Record(driver, device_path, signals=None, auto=None)

Record streaming sample data to a JLS v2 file.

* **Parameters:**
  * **driver** – The active driver instance.
  * **device_path** – The device prefix path or list of device prefix paths.
  * **signals** – The list of signals to record.  None=[‘current’, ‘voltage’]
  * **auto** – Configure automatic operation.
    Provide the list of automatic operations to perform, which can be:
    \* signal_enable
    \* signal_disable
    None (default) is equivalent to [‘signal_enable’, ‘signal_disable’]

Call `open()` to start recording and `close()` to stop.

#### close()

Close the recording and release all resources.

Safe to call repeatedly and after a failed `open()`.

* **Raises:**
  **RuntimeError** – If a write failed, such as on a full disk.
  The recording is closed, but the file may be incomplete.

#### open(filename, user_data=None)

Start the recording.

* **Parameters:**
  * **filename** – The filename for the recording.  Use
    time64.filename to produce a filename from timestamp.
  * **user_data** – The list of additional user data
    given as [chunk_meta, data] pairs.
    Use chunk_meta 0 and a data string for notes
    that display in the Joulescope UI.
* **Returns:**
  self.
