medPacsDataSource::medPacsDataSource(QWidget* parent) : medAbstractDataSource(parent), d(new medPacsDataSourcePrivate) { //this hierarchy is clearly broken: medPacsDataSource inherits from QObject, //pacsWidget is a widget, and its parent is the browserArea, //see destructor. d->pacsWidget = new medPacsWidget(parent); d->pacsSelector = new medPacsSelector(d->pacsWidget); d->pacsHostToolBox = new medBrowserPacsHostToolBox(d->pacsWidget); d->toolBoxes.push_back(d->pacsHostToolBox); d->pacsNodesToolBox = new medBrowserPacsNodesToolBox(d->pacsWidget); d->toolBoxes.push_back(d->pacsNodesToolBox); d->pacsSearchToolBox = new medBrowserPacsSearchToolBox(d->pacsWidget); d->toolBoxes.push_back(d->pacsSearchToolBox); connect(d->pacsWidget, SIGNAL(moveList(const QVector<medMoveCommandItem>&)), this, SLOT(onPacsMove(const QVector<medMoveCommandItem>&))); connect(d->pacsWidget, SIGNAL(import(QString)), this, SIGNAL(dataToImportReceived(QString))); connect(d->pacsNodesToolBox, SIGNAL(nodesUpdated()), d->pacsSelector, SLOT(updateList())); connect(d->pacsSelector, SIGNAL(selectionChanged(QVector<int>)), d->pacsWidget, SLOT(updateSelectedNodes(QVector<int>))); connect(d->pacsNodesToolBox, SIGNAL(echoRequest()), d->pacsWidget, SLOT(onEchoRequest())); connect(d->pacsWidget, SIGNAL(echoResponse(QVector<bool>)), d->pacsNodesToolBox, SLOT(onEchoResponse(QVector<bool>))); connect(d->pacsSearchToolBox, SIGNAL(search(QString)), d->pacsWidget, SLOT(search(QString))); }
static CONDITION serviceThisCommand(DUL_NETWORKKEY ** network, DUL_ASSOCIATIONKEY ** association, DUL_PRESENTATIONCONTEXT * ctx, MSG_TYPE messageType, void **message, DUL_ASSOCIATESERVICEPARAMETERS * params, DMAN_HANDLE ** handle) { CONDITION cond; MSG_GENERAL * general; general = *(MSG_GENERAL **) message; if (!silent) MSG_DumpMessage((void *) general, stdout); switch (messageType) { case MSG_K_C_ECHO_REQ: cond = echoRequest(association, ctx, (MSG_C_ECHO_REQ **) message); break; case MSG_K_C_STORE_REQ: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; case MSG_K_C_FIND_REQ: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; case MSG_K_C_MOVE_REQ: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; case MSG_K_C_GET_REQ: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; case MSG_K_C_CANCEL_REQ: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; case MSG_K_N_ACTION_REQ: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; case MSG_K_N_EVENT_REPORT_REQ: cond = neventReportRequest(params, association, handle, ctx, (MSG_N_EVENT_REPORT_REQ **) message, &fisHandle); break; default: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; } return cond; }
static void * echoFunction(void *arg) { int connfd; connfd = *((int *) arg); free(arg); Pthread_detach(pthread_self()); printf("%s\n\n", "echo server thread started"); echoRequest(connfd); //str_echo(connfd); /* same function as before */ Close(connfd); /* done with connected socket */ return (NULL); }
static CONDITION serviceThisCommand(DUL_NETWORKKEY ** network, DUL_ASSOCIATIONKEY ** association, DUL_PRESENTATIONCONTEXT * ctx, MSG_TYPE messageType, void **message, DUL_ASSOCIATESERVICEPARAMETERS * params, DMAN_HANDLE ** handle) { CONDITION cond; MSG_GENERAL * general; general = *(MSG_GENERAL **) message; if (!silent) MSG_DumpMessage((void *) general, stdout); switch (messageType) { case MSG_K_C_ECHO_REQ: cond = echoRequest(association, ctx, (MSG_C_ECHO_REQ **) message); break; case MSG_K_C_STORE_REQ: cond = storeRequest(params, association, handle, ctx, (MSG_C_STORE_REQ **) message); break; case MSG_K_C_FIND_REQ: cond = findRequest(association, params, ctx, (MSG_C_FIND_REQ **) message, &IDBHandle); break; case MSG_K_C_MOVE_REQ: cond = moveRequest(network, association, ctx, (MSG_C_MOVE_REQ **) message, params, &IDBHandle, handle); break; case MSG_K_C_GET_REQ: cond = cgetRequest(network, association, ctx, (MSG_C_GET_REQ **) message, params, &IDBHandle, handle); break; case MSG_K_C_CANCEL_REQ: cond = SRV_NORMAL; /* This must have happened after we were done */ break; default: fprintf(stderr, "Unimplemented message type: %d\n", messageType); cond = 1; break; } return cond; }
medBrowserPacsNodesToolBox::medBrowserPacsNodesToolBox(QWidget *parent) : medToolBox(parent), d(new medBrowserPacsNodesToolBoxPrivate) { QWidget *page = new QWidget(this); QValidator* validator = new QIntValidator( 0, 65535, this ); d->title = new QLineEdit("DCM4CHEE", page); d->address = new QLineEdit("jumbo-4.irisa.fr", page); d->port = new QLineEdit("10012", page); d->port->setValidator(validator); d->table = new QTableWidget(page); d->add = new QPushButton("Add"); d->add->setObjectName("left"); d->ech = new QPushButton("Echo"); d->ech->setObjectName("center"); d->rem = new QPushButton("Remove"); d->rem->setObjectName("right"); QHBoxLayout *buttons_layout = new QHBoxLayout; buttons_layout->setSpacing(0); buttons_layout->addWidget(d->add); buttons_layout->addWidget(d->ech); buttons_layout->addWidget(d->rem); QFormLayout *form = new QFormLayout; form->addRow("Title", d->title); form->addRow("Address", d->address); form->addRow("Port", d->port); QVBoxLayout *layout = new QVBoxLayout(page); layout->addLayout(form); layout->addWidget(d->table); layout->addLayout(buttons_layout); this->setTitle("Remote Clients"); this->addWidget(page); connect(d->add, SIGNAL(clicked()), this, SLOT(addNode())); connect(d->ech, SIGNAL(clicked()), this, SIGNAL(echoRequest())); connect(d->rem, SIGNAL(clicked()), this, SLOT(remNode())); this->readSettings(); }