-
Notifications
You must be signed in to change notification settings - Fork 4
Enable multi-dimensional plotting #20
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
4f798ac
204e1ab
e5a080e
e1b6677
86e4f8f
d160848
ed39a81
a2e7bb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| from qtpy.QtCore import QObject, QRunnable, Signal | ||
|
|
||
|
|
||
| class TiledSubscriberSignals(QObject): | ||
| finished = Signal() | ||
| results = Signal(object) | ||
|
|
||
|
|
||
| class TiledSubscriber(QRunnable): | ||
| def __init__( | ||
| self, | ||
| *, | ||
| client, | ||
| node_path_parts, | ||
| **kwargs, | ||
| ): | ||
| super().__init__() | ||
| self.signals = TiledSubscriberSignals() | ||
| self.client = client | ||
| self.node_path_parts = node_path_parts | ||
|
|
||
| def run(self): | ||
| catalog_sub = self.client.subscribe() | ||
| catalog_sub.child_created.add_callback(on_new_child) | ||
| catalog_sub.start() | ||
|
||
|
|
||
|
|
||
| def on_new_child(update): | ||
| "A new child node has been created in a container." | ||
| child = update.child() | ||
| print(child) | ||
| sub = child.subscribe() | ||
| # Is the child also a container? | ||
| if child.structure_family == "container": | ||
| # Recursively subscribe to the children of this new container. | ||
| sub.child_created.add_callback(on_new_child) | ||
| else: | ||
| # Subscribe to data updates (i.e. appended table rows or array slices). | ||
| sub.new_data.add_callback(on_new_data) | ||
| # Launch the subscription. | ||
| # Ask the server to replay from the very first update, if we already | ||
| # missed some. | ||
| sub.start_in_thread(1) | ||
|
||
|
|
||
|
|
||
| def on_new_data(update): | ||
| "Data has been updated (maybe appended) to an array or table." | ||
| print(update.data()) | ||
Uh oh!
There was an error while loading. Please reload this page.