Пример #1
0
    def __init__(self):
        QtCore.QThread.__init__(self)
        self.signal = QtCore.SIGNAL("signal")

        self.reset_slot_in = nett.slot_in_float_message()
        self.reset_slot_in.connect('tcp://127.0.0.1:2003', 'reset')
        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__":
    app.exec_()
    sys.exit()