octoprint_compat: add webcam settings
Signed-off-by: Simon Germain <sgermain06@gmail.com>
This commit is contained in:
parent
f79439aedd
commit
11f4ae75cc
|
@ -245,6 +245,21 @@ enable_ufp: True
|
||||||
# files will be uploaded in UFP format. When set to False Cura will
|
# files will be uploaded in UFP format. When set to False Cura will
|
||||||
# upload files in .gcode format. This setting has no impact on other
|
# upload files in .gcode format. This setting has no impact on other
|
||||||
# slicers. The default is True.
|
# slicers. The default is True.
|
||||||
|
|
||||||
|
flip_h: False
|
||||||
|
# Set the webcam horizontal flip. The default is False.
|
||||||
|
flip_h: False
|
||||||
|
# Set the webcam vertical flip. The default is False.
|
||||||
|
rotate_90: False
|
||||||
|
# Set the webcam rotation by 90 degrees. The default is False.
|
||||||
|
stream_url: /webcam/?action=stream
|
||||||
|
# The URL to use for streaming the webcam. It can be set to an absolute
|
||||||
|
# URL if needed. In order to get the webcam to work in Cura through
|
||||||
|
# an Octoprint connection, you can set this value to
|
||||||
|
# http://<octoprint ip>/webcam/?action=stream. The default value is
|
||||||
|
# /webcam/?action=stream.
|
||||||
|
webcam_enabled: True
|
||||||
|
# Enables the webcam. The default is True.
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Tip
|
!!! Tip
|
||||||
|
|
|
@ -18,3 +18,9 @@ cors_domains:
|
||||||
# Supports Cura, Slic3r, and Slic3r dervivatives
|
# Supports Cura, Slic3r, and Slic3r dervivatives
|
||||||
# (PrusaSlicer, SuperSlicer)
|
# (PrusaSlicer, SuperSlicer)
|
||||||
[octoprint_compat]
|
[octoprint_compat]
|
||||||
|
# Default webcam config values:
|
||||||
|
# flip_h = false
|
||||||
|
# flip_v = false
|
||||||
|
# rotate_90 = false
|
||||||
|
# stream_url = /webcam/?action=stream
|
||||||
|
# webcam_enabled = true
|
||||||
|
|
|
@ -2,6 +2,20 @@
|
||||||
This file will track changes that require user intervention,
|
This file will track changes that require user intervention,
|
||||||
such as a configuration change or a reinstallation.
|
such as a configuration change or a reinstallation.
|
||||||
|
|
||||||
|
### February 16th 2022
|
||||||
|
- Webcam settings can now be defined in the `moonraker.conf` file, under
|
||||||
|
the `[octoprint_compat]` section. The default values are being used as
|
||||||
|
default values.
|
||||||
|
|
||||||
|
Default values:
|
||||||
|
| Setting | Default value |
|
||||||
|
|---------|---------------|
|
||||||
|
| flip_h | False |
|
||||||
|
| flip_v | False |
|
||||||
|
| rotate_90 | False |
|
||||||
|
| stream_url | /webcam/?action=stream |
|
||||||
|
| webcam_enabled | True |
|
||||||
|
|
||||||
### January 22th 2022
|
### January 22th 2022
|
||||||
- The `color_order` option in the `[wled]` section has been deprecated.
|
- The `color_order` option in the `[wled]` section has been deprecated.
|
||||||
This is configured in wled directly. This is not a breaking change,
|
This is configured in wled directly. This is not a breaking change,
|
||||||
|
|
|
@ -43,6 +43,15 @@ class OctoprintCompat:
|
||||||
'software_version')
|
'software_version')
|
||||||
self.enable_ufp: bool = config.getboolean('enable_ufp', True)
|
self.enable_ufp: bool = config.getboolean('enable_ufp', True)
|
||||||
|
|
||||||
|
# Get webcam settings from config
|
||||||
|
self.webcam: Dict[str, Any] = {
|
||||||
|
'flipH': config.getboolean('flip_h', False),
|
||||||
|
'flipV': config.getboolean('flip_v', False),
|
||||||
|
'rotate90': config.getboolean('rotate_90', False),
|
||||||
|
'streamUrl': config.get('stream_url', '/webcam/?action=stream'),
|
||||||
|
'webcamEnabled': config.getboolean('webcam_enabled', True),
|
||||||
|
}
|
||||||
|
|
||||||
# Local variables
|
# Local variables
|
||||||
self.klippy_apis: APIComp = self.server.lookup_component('klippy_apis')
|
self.klippy_apis: APIComp = self.server.lookup_component('klippy_apis')
|
||||||
self.heaters: Dict[str, Dict[str, Any]] = {}
|
self.heaters: Dict[str, Dict[str, Any]] = {}
|
||||||
|
@ -216,9 +225,6 @@ class OctoprintCompat:
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
Used to parse Octoprint capabilities
|
Used to parse Octoprint capabilities
|
||||||
|
|
||||||
Hardcode capabilities to be basically there and use default
|
|
||||||
fluid/mainsail webcam path.
|
|
||||||
"""
|
"""
|
||||||
settings = {
|
settings = {
|
||||||
'plugins': {},
|
'plugins': {},
|
||||||
|
@ -226,15 +232,7 @@ class OctoprintCompat:
|
||||||
'sdSupport': False,
|
'sdSupport': False,
|
||||||
'temperatureGraph': False
|
'temperatureGraph': False
|
||||||
},
|
},
|
||||||
# TODO: Get webcam settings from config file to allow user
|
'webcam': self.webcam,
|
||||||
# to customise this.
|
|
||||||
'webcam': {
|
|
||||||
'flipH': False,
|
|
||||||
'flipV': False,
|
|
||||||
'rotate90': False,
|
|
||||||
'streamUrl': '/webcam/?action=stream',
|
|
||||||
'webcamEnabled': True,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
if self.enable_ufp:
|
if self.enable_ufp:
|
||||||
settings['plugins'] = {
|
settings['plugins'] = {
|
||||||
|
|
Loading…
Reference in New Issue