Commit e3684fa6 authored by Philipp Middendorf's avatar Philipp Middendorf
Browse files

Merge branch 'jerome.carnis-master-patch-12934' into 'master'

deviceEigerP11.py: fix macroserver type

See merge request !36
parents b4a0fdad bac20647
......@@ -4,7 +4,7 @@ import os
import time
from time import sleep
from threading import Thread
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Any, cast, Dict, List, Optional, Tuple, Union
import numpy as np
......@@ -28,6 +28,7 @@ from kamzik3.devices.device import Device
from kamzik3.devices.deviceTango import DeviceTango
from kamzik3.devices.general.deviceScanner import DeviceScanner
from kamzik3.macro.macro import Macro
from kamzik3.macro.macroServer import MacroServer
from kamzik3.macro.scan import Scan
from kamzik3.macro.step import Step, StepDeviceMethod
from kamzik3.snippets.snippetsDecorators import expose_method
......@@ -398,7 +399,7 @@ class EigerSwScanner(DeviceScanner):
raise DeviceError(
"kamzik session is None, can't get the device MacroServer"
)
macro_server = kamzik3.session.get_device("MacroServer")
macro_server = cast(MacroServer, kamzik3.session.get_device("MacroServer"))
current_scan_count = macro_server.get_macro_count()
if current_scan_count != self.last_scan_count:
self._init_new_scan(scanner_input, scanner_attributes, parent_macro)
......@@ -420,7 +421,7 @@ class EigerSwScanner(DeviceScanner):
kamzik3.session.get_value(ATTR_SCAN_COUNT)
)
)
macro_server = kamzik3.session.get_device("MacroServer")
macro_server = cast(MacroServer, kamzik3.session.get_device("MacroServer"))
scan_prefix = macro_server.get_value(ATTR_MACRO_PREFIX)
scan_count = macro_server.get_macro_count()
scan_dir_name = "{}_{}".format(scan_prefix, scan_count - 1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment