def __init__(self):
    QtCore.QThread.__init__(self)
    self.signal = QtCore.SIGNAL("signal")

    self.connection_slot_in = nett.slot_in_float_vector_message()
    ip = helper.obtain_ip_address_compute()
    self.connection_slot_in.connect('tcp://'+ip+':8000', 'total_connections')
예제 #2
0
    def __init__(self):
        QtCore.QThread.__init__(self)
        self.signal_fr_e = QtCore.SIGNAL("signal_e")
        self.signal_fr_i = QtCore.SIGNAL("signal_i")

        self.fr_e_slot_in = nett.slot_in_float_vector_message()
        self.fr_i_slot_in = nett.slot_in_float_vector_message()
        ip = helper.obtain_ip_address_compute()
        self.fr_e_slot_in.connect('tcp://' + ip + ':8000', 'fr_e')
        self.fr_i_slot_in.connect('tcp://' + ip + ':8000', 'fr_i')
                                         QtGui.QApplication.UnicodeUTF8))
        self.AreaBrowserTable = AreaTable()
        areaBrowserWidget.setWidget(self.AreaBrowserTable)

        self.addDockWidget(QtCore.Qt.DockWidgetArea(1), areaBrowserWidget)

    def close(self):
        QtGui.qApp.quit()


nett.initialize('tcp://127.0.0.1:2015')

app = QtGui.QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
ip = helper.obtain_ip_address_compute()

area_list_slot_in = nett.slot_in_float_message()
area_list_slot_in.connect('tcp://' + ip + ':8000', 'num_regions')

print 'waiting for region list...'
msg = float_message()
msg.ParseFromString(area_list_slot_in.receive())
areaList = []
for i in range(0, int(msg.value)):
    areaList.append(str(i))
print 'received!'

mainWindow.AreaBrowserTable.updateTable(areaList)

if __name__ == "__main__":