示例#1
0
void OpenIGTLinkProtocol::writeAcceptingMessage(igtl::MessageBase* body) const
{
    QString dtype(body->GetDeviceType());
    QString dname(body->GetDeviceName());
    CX_LOG_CHANNEL_DEBUG(CX_OPENIGTLINK_CHANNEL_NAME) << QString("Accepting incoming igtlink message (%1, %2): ")
                                                        .arg(dtype)
                                                        .arg(dname);
}
示例#2
0
TreeNodePtr TreeRepository::getTopNode()
{
	std::vector<TreeNodePtr> all = this->getNodes();
	for (unsigned i=0; i<all.size(); ++i)
		if (all[i]->getUid() == "node::invisible_top")
			return all[i];
	CX_LOG_CHANNEL_DEBUG("CA") << "invalid tree - did not find top node";
	return TreeNodePtr();
}
示例#3
0
void HttpRequestHandler::create_display(QHttpRequest *req, QHttpResponse *resp)
{
    // example test line:
	// curl -H 'Content-Type: application/json' -X PUT -d '{"width":600,"height":300,"layout":"LAYOUT_US_Acquisition"}' http://localhost:8085/layout/display
//    QByteArray body = req->body();
    QJsonDocument doc = QJsonDocument::fromJson(req->body());
    CX_LOG_CHANNEL_DEBUG("CA") << "JSON: " << QString(req->body());
    QSize size;
    size.setWidth(doc.object()["width"].toInt());
    size.setHeight(doc.object()["height"].toInt());
    QString layout = doc.object()["layout"].toString();

    CX_LOG_CHANNEL_DEBUG("CA") << "size " << size.width() << "," << size.height() << ", layout " << layout;

    mApi->createLayoutWidget(size, layout);

    resp->writeHead(200); // everything is OK
    resp->end();
}
示例#4
0
QVariant ToolTreeNode::getColor() const
{
	if (!mTool->isInitialized())
		return QColor("darkgray");
	if (mTool->getVisible())
		return QColor("green");
	else
		return QColor("red");

	CX_LOG_CHANNEL_DEBUG("CA") << "tool " << mTool->getName() << ": init=" << mTool->isInitialized() << ", v=" << mTool->getVisible();
}