class MyMonitor(QDialog):
	def __init__(self, parent = None):
		super(MyMonitor, self).__init__(parent)
		self.c1 = 0
		self.c2 = 0
		self.x = []
		self.y = []
		self.ui = Ui_MonitForm()
		self.ui.setupUi(self)
		self.th = WorkingThread(self)
		self.connect(self.th, SIGNAL('setStatus'), self.plotfunc, Qt.QueuedConnection)
		self.th.start()
		#self.t1 = QTimer()
		#self.t1.timeout.connect(self.th.start)
		#self.t1.start()
	def plotfunc(self):
		for i in range(0,10):
			self.x.append(self.c1)
			self.y.append(self.c2)
			self.c1 += 0.01
			self.c2 = math.sin(2*math.pi*self.c1)
		self.ui.graphicsView.plot(self.x, self.y, clear = True)
		if len(self.x) >= 1000:
			self.x = []
			self.y = []
			self.c1 = 0
class MyMonitor(QDialog):
	def __init__(self, qtreactor, qtip, qtport, parent = None):
		super(MyMonitor, self).__init__(parent)
		self.reactor = qtreactor
		self.ip = qtip
		self.port = qtport
		self.ui = Ui_MonitForm()
		self.ui.setupUi(self)
		self.smsg = None
		self.x = []
		self.y = []
		self.monit = monitor_multi(ip)
		self.monitw = ICUMonitorFactory(self.setmsg, self.ip, self.port)
	def setmsg(self):		
		return self.smsg
	
	def turnOn(self):
		LoopingCall(self.gerfunc).start(0.3)
		self.monitw.startsend(self.reactor, 0.5)

	def gerfunc(self):
		self.monit.preenche()
		orw = self.monit.get_orw((self.ip, 'CEN'))
		self.smsg = orw.to_str()
		print self.smsg
Esempio n. 3
0
class MyMonitor(QDialog):
    def __init__(self, parent=None):
        super(MyMonitor, self).__init__(parent)
        self.c1 = 0
        self.c2 = 0
        self.x = []
        self.y = []
        self.ui = Ui_MonitForm()
        self.ui.setupUi(self)
        self.th = WorkingThread(self)
        self.connect(self.th, SIGNAL('setStatus'), self.plotfunc,
                     Qt.QueuedConnection)
        self.th.start()
        #self.t1 = QTimer()
        #self.t1.timeout.connect(self.th.start)
        #self.t1.start()
    def plotfunc(self):
        for i in range(0, 10):
            self.x.append(self.c1)
            self.y.append(self.c2)
            self.c1 += 0.01
            self.c2 = math.sin(2 * math.pi * self.c1)
        self.ui.graphicsView.plot(self.x, self.y, clear=True)
        if len(self.x) >= 1000:
            self.x = []
            self.y = []
            self.c1 = 0
Esempio n. 4
0
 def __init__(self, parent=None):
     super(MyMonitor, self).__init__(parent)
     self.c1 = 0
     self.c2 = 0
     self.x = []
     self.y = []
     self.ui = Ui_MonitForm()
     self.ui.setupUi(self)
     self.th = WorkingThread(self)
     self.connect(self.th, SIGNAL('setStatus'), self.plotfunc,
                  Qt.QueuedConnection)
     self.th.start()
	def __init__(self, parent = None):
		super(MyMonitor, self).__init__(parent)
		self.c1 = 0
		self.c2 = 0
		self.x = []
		self.y = []
		self.ui = Ui_MonitForm()
		self.ui.setupUi(self)
		self.th = WorkingThread(self)
		self.connect(self.th, SIGNAL('setStatus'), self.plotfunc, Qt.QueuedConnection)
		self.th.start()
	def __init__(self, qtreactor, qtip, qtport, parent = None):
		super(MyMonitor, self).__init__(parent)
		self.reactor = qtreactor
		self.ip = qtip
		self.port = qtport
		self.ui = Ui_MonitForm()
		self.ui.setupUi(self)
		self.smsg = None
		self.x = []
		self.y = []
		self.monit = monitor_multi(ip)
		self.monitw = ICUMonitorFactory(self.setmsg, self.ip, self.port)