Beispiel #1
0
qObjectnode::
qObjectnode(QObject *data, QGraphicsItem *parent, bool autodelete) : GraphicsNode(parent),m_autodelete(autodelete)
{
	m_data=data;
	if(m_data==0)
		qWarning("NULL Data Object!");
	else {
		QWidget* tst = dynamic_cast<QWidget*>(data);
		if(tst!=0)
			setCentralWidget(tst);

		const QMetaObject* m = m_data->metaObject();
		int property_count = m->propertyCount()-1;

		for(;property_count>=0;property_count--) {
			QMetaProperty prop = m->property(property_count);
			if(prop.isConstant() || !prop.isUser())
				continue;
			if(prop.isReadable() && prop.hasNotifySignal())
			{
				add_source(QString(prop.name()) + "[" +QString(prop.typeName())  +"]",m_data,property_count);
			}
			if(prop.isWritable())
				add_sink(QString(prop.name()) + "[" +QString(prop.typeName())  +"]",m_data,property_count);
		}
	}
}
void sink_manager_heartbeat(ip_t ip, uint8_t *buf)
{
    sink_t *sink = get_sink(ip);

    if (sink != NULL) {
        sink->last_heartbeat = util_time_now();
    } else {
        sink_t new_sink;
        if (sink_initialize(&new_sink, ip, buf) != RET_OK) {
            return;
        }
        new_sink.last_heartbeat = util_time_now();
        add_sink(new_sink);
    }
    
    purge_dead_sinks();
}