Commit 24a75b8d authored by Tong Zhang's avatar Tong Zhang
Browse files

REF: Fix field set and use milli_sleep().

parent 7bdc338f
...@@ -13,7 +13,6 @@ Show the available templates: ...@@ -13,7 +13,6 @@ Show the available templates:
>>> makeBasePyQtApp -l >>> makeBasePyQtApp -l
""" """
import time
import sys import sys
from PyQt5.QtCore import pyqtSignal from PyQt5.QtCore import pyqtSignal
...@@ -29,6 +28,7 @@ from mpl4qt.widgets import MatplotlibBaseWidget ...@@ -29,6 +28,7 @@ from mpl4qt.widgets import MatplotlibBaseWidget
from phantasy import MachinePortal from phantasy import MachinePortal
from phantasy_ui import BaseAppForm from phantasy_ui import BaseAppForm
from phantasy_ui import milli_sleep
from phantasy_ui.widgets import ElementWidget from phantasy_ui.widgets import ElementWidget
from phantasy_ui.widgets import LatticeWidget from phantasy_ui.widgets import LatticeWidget
from phantasy_apps.allison_scanner.data import draw_beam_ellipse_with_params from phantasy_apps.allison_scanner.data import draw_beam_ellipse_with_params
...@@ -169,9 +169,7 @@ class MyAppWindow(BaseAppForm, Ui_MainWindow): ...@@ -169,9 +169,7 @@ class MyAppWindow(BaseAppForm, Ui_MainWindow):
reconnect, to avoid unnecessary trigging. reconnect, to avoid unnecessary trigging.
""" """
self.quad_selected = self.__mp.get_elements(name=name)[0] self.quad_selected = self.__mp.get_elements(name=name)[0]
milli_sleep(500)
time.sleep(1.0)
self._quad_widget = ElementWidget(self.quad_selected) self._quad_widget = ElementWidget(self.quad_selected)
self.quad1_grad_dsbox.valueChanged.disconnect() self.quad1_grad_dsbox.valueChanged.disconnect()
try: try:
...@@ -193,7 +191,7 @@ class MyAppWindow(BaseAppForm, Ui_MainWindow): ...@@ -193,7 +191,7 @@ class MyAppWindow(BaseAppForm, Ui_MainWindow):
1. print the setting of selected quad 1. print the setting of selected quad
2. update drawing with online simulated results 2. update drawing with online simulated results
""" """
setattr(self.quad_selected, QUAD_FIELD_NAME) = grad setattr(self.quad_selected, QUAD_FIELD_NAME, grad)
# update simulation # update simulation
self.__lat.sync_settings() self.__lat.sync_settings()
......
Markdown is supported
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