Microscope now has option to add a name
This commit is contained in:
parent
60c11b1072
commit
7f42b3b706
1 changed files with 5 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ Defines a microscope object, binding a camera and stage with basic functionality
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import uuid
|
||||||
|
|
||||||
from openflexure_stage import OpenFlexureStage
|
from openflexure_stage import OpenFlexureStage
|
||||||
from .camera.pi import StreamingCamera
|
from .camera.pi import StreamingCamera
|
||||||
|
|
@ -40,6 +41,10 @@ class Microscope(object):
|
||||||
if attach_plugins:
|
if attach_plugins:
|
||||||
self.attach_plugins()
|
self.attach_plugins()
|
||||||
|
|
||||||
|
# Get name from config, or generate
|
||||||
|
if not 'name' in self.config:
|
||||||
|
self.config['name'] = uuid.uuid4().hex
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
"""Create microscope on context enter."""
|
"""Create microscope on context enter."""
|
||||||
return self
|
return self
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue