Skip to content
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

ongoing development #3

Draft
wants to merge 26 commits into
base: devel
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e729c9d
add close connection
azazellochg Feb 8, 2023
05b1083
large refactoring, mainly to separate objects.py and client/sever logic
azazellochg Feb 12, 2023
151bc8c
continue refactoring, basic get/set/has seem to work remotely/locally
azazellochg Apr 5, 2023
74b9784
add feg regs script
azazellochg Jun 26, 2023
3e2e2e9
remove semccd
azazellochg Jan 13, 2025
73e4f02
big refactoring in progress
azazellochg Jan 22, 2025
19b81e9
refactor requirements for rtd
azazellochg Jan 22, 2025
85940c3
first testing. move base com class
azazellochg Jan 22, 2025
03ab4f8
refactor vectors and stage
azazellochg Jan 23, 2025
a433e35
fix imports
azazellochg Jan 23, 2025
58cecb1
adding mags and button events
azazellochg Jan 23, 2025
43f1c40
add missing file
azazellochg Jan 23, 2025
b5e9b7f
playing with buttons, fix vectors and stage, fix call()
azazellochg Jan 23, 2025
91d979d
1) fix has attr, 2) cache stage limits, 3) fix check_prerequisites, 4…
azazellochg Jan 24, 2025
f38ac99
enable stem for the test acquisition
azazellochg Jan 24, 2025
515fe85
add annotations
azazellochg Jan 24, 2025
e83c307
minor fixes
azazellochg Jan 24, 2025
420aed2
cleaner imports
azazellochg Jan 24, 2025
5f025c3
improve enum docs
azazellochg Jan 24, 2025
c5df360
boilerplate for server
azazellochg Jan 26, 2025
ee5a586
first attempt of a socket client
azazellochg Jan 27, 2025
324988c
basic doc
azazellochg Jan 27, 2025
ed6d8a8
better imports
azazellochg Jan 27, 2025
f0125f1
add a remote connection test
azazellochg Jan 27, 2025
f4c0cc0
fix hostname
azazellochg Jan 27, 2025
52c360d
specify data length
azazellochg Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor fixes
azazellochg committed Jan 24, 2025
commit e83c307bf7fd0bd534b32df143cc581073abefca
13 changes: 9 additions & 4 deletions pytemscript/clients/com_client.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,9 @@

class COMBase:
""" Base class that handles COM interface connections. """
def __init__(self, useLD: bool = False, useTecnaiCCD: bool = False):
def __init__(self,
useLD: bool = False,
useTecnaiCCD: bool = False):
self.tem = None
self.tem_adv = None
self.tem_lowdose = None
@@ -86,7 +88,10 @@ class COMClient:
:param debug: Print debug messages
:type debug: bool
"""
def __init__(self, useLD: bool = False, useTecnaiCCD: bool = False, debug: bool = False):
def __init__(self,
useLD: bool = False,
useTecnaiCCD: bool = False,
debug: bool = False):
logging.basicConfig(level=logging.DEBUG if debug else logging.INFO,
datefmt='%d/%b/%Y %H:%M:%S',
format='[%(asctime)s] %(message)s',
@@ -127,11 +132,11 @@ def get_from_cache(self, attrname):
self.cache[attrname] = self.get(attrname)
return self.cache[attrname]

def clear_cache(self, attrname):
def clear_cache(self, attrname) -> None:
if attrname in self.cache:
del self.cache[attrname]

def has(self, attrname):
def has(self, attrname) -> bool:
""" GET request with cache support. Should be used only for attributes
that do not change.
Behavior:
2 changes: 1 addition & 1 deletion pytemscript/modules/autoloader.py
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ def unload_cartridge(self) -> None:

def run_inventory(self) -> None:
""" Performs an inventory of the cassette.
Note: This function takes considerable time to callute.
Note: This function takes considerable time to execute.
"""
# TODO: check if cassette is present
if self.is_available:
2 changes: 1 addition & 1 deletion pytemscript/modules/utilities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import logging
from pathlib import Path
from typing import Optional, Union
from typing import Optional

from ..utils.enums import ImagePixelType, AcqImageFileFormat, StageAxes