Commit e57e8131 authored by Paolo Cinquegrana's avatar Paolo Cinquegrana
Browse files

aggiunti bottoni store pzt position, restore pzt poisition

parent d9821b8b
......@@ -33,6 +33,7 @@ try:
sacco['pumptemperature'] = PyTango.DeviceProxy('srv-tango-srf-01:20000/sl/cooling/dmm_sl.01')
sacco['trigger'] = PyTango.DeviceProxy('srv-tango-srf-01:20000/ec-sl-slpsr-01/evr/ff100000')
sacco['totem_delay'] = PyTango.DeviceProxy('srv-tango-srf-01:20000/slu/motor/trls_slu.05')
sacco['costanti'] = PyTango.DeviceProxy('srv-tango-srf-01:20000/slu/misc/ranges')
except PyTango.DevFailed:
print('error defining sacco DeviceProxys')
......@@ -260,7 +261,7 @@ class MainWindow(QDialog):
self.feedbackstato.setReadOnly(1)
self.feedbackon = QPushButton("ON")
self.feedbackon.clicked.connect(self.accendiilfeedback)
self.feedbacksmarton = QPushButton("smart ON")
self.feedbacksmarton = QPushButton("Start 1by1")
self.feedbacksmarton.clicked.connect(self.smart_feedback_on)
self.feedbacksb = QPushButton("Standby")
self.feedbacksb.clicked.connect(self.mettiilfeedbackinstandby)
......@@ -272,7 +273,7 @@ class MainWindow(QDialog):
self.feedbackstopothers.clicked.connect(self.neresterasoltantounoFB)
self.feedbackstopothers.setDisabled(1)
self.feedbackautolabel = QPushButton('Auto-weights')
# self.feedbackautolabel.clicked.connect(self.)
self.feedbackautolabel.clicked.connect(self.apriSEQpesi)
self.feedbackautoread = QLineEdit('')
self.feedbackautoonoffreset = QPushButton('On')
self.feedbackautoonoffreset.clicked.connect(self.comandipersequencer)
......@@ -282,6 +283,10 @@ class MainWindow(QDialog):
self.feedbackstopothersccds = QPushButton('Stop other BL ccd')
self.feedbackstopothersccds.clicked.connect(self.neresterasoltantounoCCD)
self.feedbackstopothersccds.setDisabled(1)
self.feedbacksalvapiezi = QPushButton('Save pzt voltage')
self.feedbacksalvapiezi.clicked.connect(self.scrivitensioni)
self.feedbackripristinapiezi = QPushButton('Restore pzt voltage')
self.feedbackripristinapiezi.clicked.connect(self.riapplicatensioni)
self.feedback0L = QLabel("SLR Table1 -> Table2")
self.feedback0L.setAlignment(Qt.AlignCenter)
self.feedback0x = QProgressBar()
......@@ -359,17 +364,19 @@ class MainWindow(QDialog):
lofeedback = QGridLayout()
lofeedback.addWidget(self.feedbackpannello, 0, 0)
lofeedback.addWidget(self.feedbackstato, 0, 1)
lofeedback.addWidget(self.feedbacksmarton, 0, 2)
lofeedback.addWidget(self.feedbackon, 0, 3)
lofeedback.addWidget(self.feedbacksb, 0, 4)
lofeedback.addWidget(self.feedbackreset, 0, 5)
lofeedback.addWidget(self.feedbackconfig, 0, 6)
lofeedback.addWidget(self.feedbackstopothers, 0, 7)
lofeedback.addWidget(self.feedbackon, 0, 2)
lofeedback.addWidget(self.feedbacksb, 0, 3)
lofeedback.addWidget(self.feedbackconfig, 0, 4)
lofeedback.addWidget(self.feedbacksmarton, 0, 5)
lofeedback.addWidget(self.feedbackreset, 0, 6)
lofeedback.addWidget(self.feedbacksalvapiezi, 0, 7)
lofeedback.addWidget(self.feedbackripristinapiezi, 0, 8, 1, 2)
lofeedback.addWidget(self.feedbackautolabel, 1, 0)
lofeedback.addWidget(self.feedbackautoread, 1, 1)
lofeedback.addWidget(self.feedbackautoonoffreset, 1, 2)
lofeedback.addWidget(self.feedbackstopothersauto, 1, 3)
lofeedback.addWidget(self.feedbackstopothersccds, 1, 4)
lofeedback.addWidget(self.feedbackstopothers, 1, 5)
lofeedback.addWidget(self.feedback0L, 2, 0, 1, 2)
lofeedback.addWidget(self.feedback0x, 3, 0)
lofeedback.addWidget(self.feedback0y, 3, 1)
......@@ -807,6 +814,9 @@ class MainWindow(QDialog):
eval("self.feedback" + str(kkkk) + "x.setValue(0)")
eval("self.feedback" + str(kkkk) + "x.setTextVisible(0)")
self.convertistatotiptilt(kkkk, READ_stato_tiptilt)
tmp = sacco['costanti'].read_attribute('voltage_tiptilt_slu01_H')
tmpt = tmp.time.todatetime()
self.feedbackripristinapiezi.setText('Restore pzt ' + str(tmpt.year) + '/' + str(tmpt.month) + '/' + str(tmpt.day) + ' ' + str(tmpt.hour) + ':' + str(tmpt.minute))
try:
altreccd = []
if self.linea == 'TOTEM':
......@@ -1260,6 +1270,81 @@ class MainWindow(QDialog):
except:
print('error ccd ldm')
def scrivitensioni(self):
tmp = sacco['piezo1'].VoltageHor
sacco['costanti'].write_attribute('voltage_tiptilt_slu01_H', tmp)
time.sleep(0.02)
tmp = sacco['piezo1'].VoltageVer
sacco['costanti'].write_attribute('voltage_tiptilt_slu01_V', tmp)
time.sleep(0.02)
tmp = sacco['piezo2'].VoltageHor
sacco['costanti'].write_attribute('voltage_tiptilt_slu02_H', tmp)
time.sleep(0.02)
tmp = sacco['piezo2'].VoltageVer
sacco['costanti'].write_attribute('voltage_tiptilt_slu02_V', tmp)
time.sleep(0.02)
tmp = sacco['piezo3'].VoltageHor
sacco['costanti'].write_attribute('voltage_tiptilt_slu03_H', tmp)
time.sleep(0.02)
tmp = sacco['piezo3'].VoltageVer
sacco['costanti'].write_attribute('voltage_tiptilt_slu03_V', tmp)
time.sleep(0.02)
tmp = sacco['piezo0'].VoltageHor
sacco['costanti'].write_attribute('voltage_tiptilt_slu04_H', tmp)
time.sleep(0.02)
tmp = sacco['piezo0'].VoltageVer
sacco['costanti'].write_attribute('voltage_tiptilt_slu04_V', tmp)
time.sleep(0.02)
tmp = sacco['piezo4'].VoltageHor
sacco['costanti'].write_attribute('voltage_tiptilt_slu05_H', tmp)
time.sleep(0.02)
tmp = sacco['piezo4'].VoltageVer
sacco['costanti'].write_attribute('voltage_tiptilt_slu05_V', tmp)
def riapplicatensioni(self):
tmp = sacco['costanti'].voltage_tiptilt_slu01_H
sacco['piezo1'].write_attribute('VoltageHor')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu01_V
sacco['piezo1'].write_attribute('VoltageVer')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu02_H
sacco['piezo2'].write_attribute('VoltageHor')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu02_V
sacco['piezo2'].write_attribute('VoltageVer')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu03_H
sacco['piezo3'].write_attribute('VoltageHor')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu03_V
sacco['piezo3'].write_attribute('VoltageVer')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu04_H
sacco['piezo0'].write_attribute('VoltageHor')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu04_V
sacco['piezo0'].write_attribute('VoltageVer')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu05_H
sacco['piezo4'].write_attribute('VoltageHor')
time.sleep(0.02)
tmp = sacco['costanti'].voltage_tiptilt_slu05_V
sacco['piezo4'].write_attribute('VoltageVer')
time.sleep(0.02)
def apriSEQpesi(self):
if self.linea == 'TIMER':
os.system('/usr/local/tango-9.3.3/bin/atkpanel ' + sacco['tmrfbsequencer'].name() + ' &')
elif self.linea == 'TIMEX':
os.system('/usr/local/tango-9.3.3/bin/atkpanel ' + sacco['tmxfbsequencer'].name() + ' &')
elif self.linea == 'DIPROI':
os.system('/usr/local/tango-9.3.3/bin/atkpanel ' + sacco['dpifbsequencer'].name() + ' &')
elif self.linea == 'LDM':
os.system('/usr/local/tango-9.3.3/bin/atkpanel ' + sacco['ldmfbsequencer'].name() + ' &')
elif self.linea == 'MAGNEDYN':
os.system('/usr/local/tango-9.3.3/bin/atkpanel ' + sacco['magfbsequencer'].name() + ' &')
def forcepanel(self):
nuovalinea = self.menubeamline.currentText()
self.linea = nuovalinea
......@@ -1351,7 +1436,7 @@ class MainWindow(QDialog):
nome = sacco['ldmfeedback'].dev_name()
elif self.linea == 'MAGNEDYN':
nome = sacco['magfeedback'].dev_name()
eval("os.system('/runtime/bin/mimofb " + nome + " &')")
eval("os.system('/runtime/bin/mimo-fb-gui " + nome + " &')")
def apritiptilt0(self):
nome = sacco['piezo0'].dev_name()
......@@ -1359,7 +1444,7 @@ class MainWindow(QDialog):
def apriccd0(self):
nome = sacco['ccd0'].dev_name()
eval("os.system('/runtime/bin/gigecam " + nome + " --refresh=200 &')")
eval("os.system('/runtime/bin/gigecam-gui " + nome + " --refresh=200 &')")
def apritiptilt1(self):
nome = sacco['piezo1'].dev_name()
......@@ -1367,7 +1452,7 @@ class MainWindow(QDialog):
def apriccd1(self):
nome = sacco['ccd1'].dev_name()
eval("os.system('/runtime/bin/gigecam " + nome + " --refresh=200 &')")
eval("os.system('/runtime/bin/gigecam-gui " + nome + " --refresh=200 &')")
def apritiptilt2(self):
nome = sacco['piezo2'].dev_name()
......@@ -1375,7 +1460,7 @@ class MainWindow(QDialog):
def apriccd2(self):
nome = sacco['ccd2'].dev_name()
eval("os.system('/runtime/bin/gigecam " + nome + " --refresh=200 &')")
eval("os.system('/runtime/bin/gigecam-gui " + nome + " --refresh=200 &')")
def apritiptilt3(self):
nome = sacco['piezo3'].dev_name()
......@@ -1383,7 +1468,7 @@ class MainWindow(QDialog):
def apriccd3(self):
nome = sacco['ccd3'].dev_name()
eval("os.system('/runtime/bin/gigecam " + nome + " --refresh=200 &')")
eval("os.system('/runtime/bin/gigecam-gui " + nome + " --refresh=200 &')")
def apritiptilt4(self):
nome = sacco['piezo4'].dev_name()
......@@ -1400,7 +1485,7 @@ class MainWindow(QDialog):
nome = sacco['ldmccd4'].dev_name()
elif self.linea == 'MAGNEDYN':
nome = sacco['magccd4'].dev_name()
eval("os.system('/runtime/bin/gigecam " + nome + " --refresh=200 &')")
eval("os.system('/runtime/bin/gigecam-gui " + nome + " --refresh=200 &')")
def apridalaytotem(self):
os.system('/runtime/bin/motion_controller slu/motor/trls_slu.05 -title SLU_TOTEM_DELAY_LINE &')
......@@ -1419,7 +1504,7 @@ class MainWindow(QDialog):
nome = sacco['ldmfeedback'].dev_name()
elif self.linea == 'MAGNEDYN':
nome = sacco['magfeedback'].dev_name()
eval("os.system('/runtime/bin/mimoconfig " + nome + " --laser &')")
eval("os.system('/runtime/bin/mimoconfig-gui " + nome + " --laser &')")
def comandipersequencer(self):
if self.linea == 'TIMER':
......@@ -1456,10 +1541,10 @@ class MainWindow(QDialog):
sacco['totem_delay'].write_attribute('Position', gol)
def apridecimatori(self):
os.system("/runtime/bin/sl-decimators-gui")
os.system("/runtime/bin/sl-decimators-gui &")
def apridelaycalc(self):
os.system("python3 /runtime/bin/slu-delay-calculator-gui/SluDelayCalculator.py &")
os.system("/runtime/bin/slu-delay-calculator-gui &")
def FUNZIONEVUOTA(self):
print('FUNZIONEVUOTA')
......
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