Control API Class¶
-
class
chronosGui2.
chronosGui2
¶ -
class
Hardware
¶ Access camera hardware, such as the jog wheel and status LEDs.
Warning: Do not initialize more than one Hardware class. You only have one set of inputs, and only one thing can read from them. If two things read, every other event will be dropped.
- Properties:
- LEDs (write-only): Assign True or False to light or darken.
- backRecordingLightLit
- frontRecordingLightLit
- recordingLightsLit
- Jog Wheel (read-only): True if button is being held down.
- jogWheelPressed
- Record Button (read-only): True if button is being held down.
- recordButtonReleased
- Functions:
- subscribe(event:str, callback:func):
- Invoke callback when event happens.
-
jogWheelPressed
¶ True if the jog wheel is pressed.
-
recordButtonPressed
¶ True if the record button is pressed.
-
subscribe
(eventName: str, callback: Callable[[Optional[int]], None]) → None¶ Invoke callback when event happens.
Use: subscribe(event:str, callback:func)
Example
hardware = Hardware() #Only instantiate this once! hardware.subscribe(‘recordButtonDown’,
lambda: print(‘down’) )- Valid events are:
- jogWheelHighResolutionRotation
- Fired when the jog wheel is rotated, 4x/detent. Callback is passed ±1 indicating (clock) direction.
- jogWheelLowResolutionRotation
- Fired when the jog wheel is rotated, 1x/detent. Callback is passed ±1 indicating (clock) direction.
- jogWheelDown
- Jog wheel is depressed.
- jogWheelUp
- Jog wheel is released.
- jogWheelHeld (unimplimented)
- Jog wheel is “long-pressed”, ie, held for one second without rotation.
- recordButtonDown
- The red record button is held down.
- recordButtonUp
- The red record button is released.
-
class
MenuToggle
(*, menu: PyQt5.QtWidgets.QWidget, button: Union[PyQt5.QtWidgets.QWidget, List[PyQt5.QtWidgets.QWidget]], focusTarget: PyQt5.QtWidgets.QWidget = None, xRange: Tuple[int, int], invisiblePadding: int = 0, duration: int = 17)¶ An object for motion-based menu toggling.
- Constructor Args:
menu: The menu to be toggled. button: A widget, or list of widgets, which have a
clicked signal.- xRange: A tuple containing a start position and end
- position for the menu to animate between. The menu will be hidden when in the start position. The y coordinate is set visually, by moving the menu in the .ui files.
- invisiblePadding = 0: Compensate for touch margins. Touch
- margins are assumed to stick out in the direction of the opening motion.
duration = 17: Of the animation, in ms.
-
checkHide
(*_)¶ Start to hide the menu, if not in use.
-
forceHide
(*_)¶ Start to hide the menu, even if something’s focussed on it.
-
show
(*_)¶ Start to show the menu. Inverse of checkHide or forceHide.
-
toggle
()¶ Start to show the menu, or start to hide the menu if it’s already opened.
-
animate
= <module 'chronosGui2.animate' from '/home/david/Documents/Krontech/chronos-gui-2/chronosGui2/animate.py'>¶
-
api
= <module 'chronosGui2.api' from '/home/david/Documents/Krontech/chronos-gui-2/chronosGui2/api.py'>¶
-
debugger
= <module 'chronosGui2.debugger' from '/home/david/Documents/Krontech/chronos-gui-2/chronosGui2/debugger.py'>¶
-
delay
(timeout: int, callback: Callable[[], None], *, paused: bool = False)¶ Delay ms before calling timeout.
Parameters: - timeout – in ms, before calling callback
- callback – invoked after some timeout
- = False (paused) – don’t start the timer upon creation
Yields: The underlying QTimer object.
-
os
= <module 'os' from '/usr/lib/python3.7/os.py'>¶
-
settings
= <module 'chronosGui2.settings' from '/home/david/Documents/Krontech/chronos-gui-2/chronosGui2/settings.py'>¶
-
class
signalTap
(transformer)¶ Generic class to transform a pyqtSignal.
-
connect
(fn)¶ Invoke the function fn when the signal is emitted.
-
disconnect
(fn)¶ Do not call fn when the signal is emitted any more.
-
emit
(*args)¶ Emit the transformed signal, based on the untransformed input values. (Invokes transformer.)
-
emitVerbatim
(*args)¶ Emit the transformed signal, based on the pre-transformed input values. (Ignores transformer.)
-
-
signal_tap
= <module 'chronosGui2.signal_tap' from '/home/david/Documents/Krontech/chronos-gui-2/chronosGui2/signal_tap.py'>¶
-
sys
= <module 'sys' (built-in)>¶
-
class