# This is a pw_console config file that defines a default window layout.
# For more info on what can be added to this file see:
#   https://pigweed.dev/pw_console/py/pw_console/docs/user_guide.html#configuration
config_title: pw_console

# Window layout
windows:
  # Left split with tabbed views.
  Split 1 tabbed:
    Python Repl:
      hidden: False
  # Right split with stacked views.
  Split 2 stacked:
    Device Logs:
      hidden: False
    Host Logs:
      hidden: False

window_column_split_method: vertical
# window_column_split_method: horizontal

# Default colors:
ui_theme: dark
code_theme: pigweed-code
swap_light_and_dark: False

# A few other choices:
# ui_theme: high-contrast-dark
# ui_theme: nord
# ui_theme: synthwave84
# code_theme: gruvbox-dark
# code_theme: pigweed-code-light
# code_theme: synthwave84

# Log display options:
spaces_between_columns: 2
hide_date_from_log_time: True
recolor_log_lines_to_match_level: False

column_order:
  # Column name
  - time
  - level
  - timestamp
  - module
  # Hidden:
  # - source_name

column_order_omit_unspecified_columns: True

snippets:
  Echo RPC:
    code: |
      device.rpcs.pw.rpc.EchoService.Echo(msg='hello world')
    description: |
      Send a string to the device and receive a response with the same
      message back.

      >>> device.rpcs.pw.rpc.EchoService.Echo(msg='hello world')
      (Status.OK, pw.rpc.EchoMessage(msg='hello world'))

  Reboot to bootloader:
    code: |
      device.rpcs.board.Board.Reboot(reboot_type=1)
    description: |
      Sent a reboot request to the device. The console must be
      relaunched to reconnect.

  Get onboard temp sensor value:
    code: |
      device.rpcs.board.Board.OnboardTemp()
    description: |
      Get the current value of the onboard temperature sensor.

      ```pycon
      >>> device.rpcs.board.Board.OnboardTemp()
      (Status.OK, board.OnboardTempResponse(temp=24.797744750976562))
      ```

  Log onboard temp sensor values every 1000ms:
    code: |
      call = device.rpcs.board.Board.OnboardTempStream.invoke(
          request_args=dict(sample_interval_ms=1000),
          on_next=lambda _, message: LOG.info(message)
      )
    description: |
      Start logging with:

      ```pycon
      >>> call = device.rpcs.board.Board.OnboardTempStream.invoke(request_args=dict(sample_interval_ms=1000), on_next=lambda _, message: LOG.info(message))
      ```

      Log messages will appear in the 'Host Logs' window.
      To stop the streaming RPC run `call.cancel()`:

      ```pycon
      >>> call.cancel()
      True
      ```
