Commit 3fcb9cb1 authored by Paolo Cinquegrana's avatar Paolo Cinquegrana
Browse files

aggiunta funzione smart on

parent a4dd4e8e
......@@ -7,6 +7,7 @@ import PyTango
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import os
import time
# variabili globali
listacoperchi = ['CVR1_LSU_UH_CLD', 'CVR_MBX1_MBX2_EOS2_CLD', 'CVR2_LSU_UH_CLD', 'CVR_M21_M22_M23_EOS2_CLD', 'CVR_LSU_EH_1_CLD', 'CVR_LSU_EH_2_CLD', 'BRD_CVR_CLD', 'BRD_SCREEN_CLD']
......@@ -274,6 +275,8 @@ class MainWindow(QDialog):
self.feedbackstato.setReadOnly(1)
self.feedbackon = QPushButton("ON")
self.feedbackon.clicked.connect(self.accendiilfeedback)
self.feedbacksmarton = QPushButton("smart ON")
self.feedbacksmarton.clicked.connect(self.smart_feedback_on)
self.feedbacksb = QPushButton("Standby")
self.feedbacksb.clicked.connect(self.mettiilfeedbackinstandby)
self.feedbackreset = QPushButton("Reset piezos")
......@@ -361,7 +364,8 @@ class MainWindow(QDialog):
self.feedback4monitor.clicked.connect(self.apriccd4)
lofeedback = QGridLayout()
lofeedback.addWidget(self.feedbackpannello, 0, 0)
lofeedback.addWidget(self.feedbackstato, 0, 1, 1, 2)
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)
......@@ -1268,6 +1272,53 @@ class MainWindow(QDialog):
def FUNZIONEVUOTA(self):
print('FUNZIONEVUOTA')
def smart_feedback_on(self):
if str(sacco['fbsequencer'].State()) != 'OFF':
sacco['fbsequencer'].command_inout('Stop')
print('sequencer off')
sacco['feedback'].command_inout("Off")
print('feeback off')
sacco['piezo0'].write_attribute('VoltageHor', 131000)
sacco['piezo0'].write_attribute('VoltageVer', 131000)
print('reset piezo0')
time.sleep(2)
sacco['feedback'].write_attribute('SensorWeights', [1,1,0,0,0,0,0,0,0,0])
sacco['feedback'].write_attribute('ActuatorWeights', [1,1,0,0,0,0,0,0,0,0])
sacco['feedback'].command_inout("On")
print('feedback on 1')
sacco['piezo1'].write_attribute('VoltageHor', 131000)
sacco['piezo1'].write_attribute('VoltageVer', 131000)
print('reset piezo1')
time.sleep(6)
sacco['feedback'].write_attribute('SensorWeights', [1,1,1,1,0,0,0,0,0,0])
sacco['feedback'].write_attribute('ActuatorWeights', [1,1,1,1,0,0,0,0,0,0])
print('feedback on 2')
sacco['piezo2'].write_attribute('VoltageHor', 131000)
sacco['piezo2'].write_attribute('VoltageVer', 131000)
print('reset piezo2')
time.sleep(6)
sacco['feedback'].write_attribute('SensorWeights', [1,1,1,1,1,1,0,0,0,0])
sacco['feedback'].write_attribute('ActuatorWeights', [1,1,1,1,1,1,0,0,0,0])
print('feedback on 3')
sacco['piezo3'].write_attribute('VoltageHor', 131000)
sacco['piezo3'].write_attribute('VoltageVer', 131000)
print('reset piezo3')
time.sleep(5)
sacco['feedback'].write_attribute('SensorWeights', [1,1,1,1,1,1,1,1,0,0])
sacco['feedback'].write_attribute('ActuatorWeights', [1,1,1,1,1,1,1,1,0,0])
print('feedback on 4')
sacco['piezo4'].write_attribute('VoltageHor', 131000)
sacco['piezo4'].write_attribute('VoltageVer', 131000)
print('reset piezo4')
time.sleep(5)
sacco['feedback'].write_attribute('SensorWeights', [1,1,1,1,1,1,1,1,1,1])
sacco['feedback'].write_attribute('ActuatorWeights', [1,1,1,1,1,1,1,1,1,1])
print('feedback on 5')
time.sleep(3)
if str(sacco['fbsequencer'].State()) == 'OFF':
sacco['fbsequencer'].command_inout('Start')
print('sequencer on')
print('fine')
if __name__ == '__main__':
app = QApplication([])
......
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