Skip to content
Snippets Groups Projects
Commit 2488d667 authored by Claudio Scafuri's avatar Claudio Scafuri :speech_balloon:
Browse files

Merge branch 'qt5_python3' into 'master'

Qt5 python3

See merge request !1
parents c53185fb c67f74bb
No related branches found
Tags 1.1.0
1 merge request!1Qt5 python3
......@@ -14,7 +14,7 @@ class TangoDev(object):
try:
self.dev = PyTango.DeviceProxy(self._name)
except:
print('Cannot initialize %s device' % self._name)
print(('Cannot initialize %s device' % self._name))
def cmd_exec(self, comm, *args, **kwargs):
if self.dev is None:
......@@ -23,14 +23,14 @@ class TangoDev(object):
try:
self.dev.command_inout(comm, args[0])
except Exception as error:
print('Failed to execute command %s (with arguments) on device %s.' % (comm, self.dev))
print(error[1].desc)
print(('Failed to execute command %s (with arguments) on device %s.' % (comm, self.dev)))
print((error[1].desc))
else:
try:
self.dev.command_inout(comm)
except Exception as error:
print('Failed to execute command %s on device %s.' % (comm, self.dev))
print(error[1].desc)
print(('Failed to execute command %s on device %s.' % (comm, self.dev)))
print((error[1].desc))
def getAttrValue(self, attr):
if self.dev is None:
......@@ -58,7 +58,7 @@ class TangoDev(object):
try:
temp = self.dev.write_attribute(attr, value)
except:
print('Cannot set %f for device %s' % (value, self._name))
print(('Cannot set %f for device %s' % (value, self._name)))
def State(self):
try:
......@@ -70,7 +70,7 @@ class TangoDev(object):
def getProperty(self, propertyName):
try:
temp = self.dev.get_property(propertyName)
if propertyName in temp.keys():
if propertyName in list(temp.keys()):
return float(temp[propertyName][0])
else:
return None
......@@ -208,7 +208,7 @@ class Trigger(TangoDev):
if time_shift:
self.setAttrValue(self._attMaster, time_shift)
else:
print('Error trying to shift trigger reference for dev %s.' % self._name)
print(('Error trying to shift trigger reference for dev %s.' % self._name))
class BSTController(object):
......@@ -241,7 +241,7 @@ class BSTController(object):
self.fstatus = TangoDev('f/misc/fermistatus')
#terfermistatus
self.terafermistatus = TangoDev('srv-tf-srf:20000/tf/mover1d/x_sdiag_tf.01')
self.terafermistatus = TangoDev('srv-tango-tf-01:20000/tf/mover1d/x_sdiag_tf.01')
##############################
......
#!/usr/bin/python
#!/usr/bin/python3
import sys
from PyQt4 import QtGui, QtCore
from PyQt5 import QtCore, QtWidgets
import openBSTGUI
import bstController
class MainWindow(QtGui.QMainWindow, openBSTGUI.Ui_OpenBST):
class MainWindow(QtWidgets.QMainWindow, openBSTGUI.Ui_OpenBST):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
......@@ -221,7 +221,7 @@ class Executor(QtCore.QThread):
# print("Running")
self.function()
app = QtGui.QApplication(sys.argv)
app = QtWidgets.QApplication(sys.argv)
main = MainWindow()
main.show()
sys.exit(app.exec_())
This diff is collapsed.
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