TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg, const TransporterConfiguration* conf) : Transporter(t_reg, tt_TCP_TRANSPORTER, conf->localHostName, conf->remoteHostName, conf->s_port, conf->isMgmConnection, conf->localNodeId, conf->remoteNodeId, conf->serverNodeId, 0, false, conf->checksum, conf->signalId, conf->tcp.sendBufferSize) { maxReceiveSize = conf->tcp.maxReceiveSize; // Initialize member variables my_socket_invalidate(&theSocket); sendCount = receiveCount = 0; sendSize = receiveSize = 0; reportFreq = 4096; sockOptNodelay = 1; setIf(sockOptRcvBufSize, conf->tcp.tcpRcvBufSize, 70080); setIf(sockOptSndBufSize, conf->tcp.tcpSndBufSize, 71540); setIf(sockOptTcpMaxSeg, conf->tcp.tcpMaxsegSize, 0); m_overload_limit = overload_limit(conf); }
/** * The synthetic video sequence we will work with here is composed of a * single moving object, circular in shape (fixed radius) * The motion here is a linear motion * the foreground intensity and the backgrounf intensity is known * the image is corrupted with zero mean Gaussian noise * @param I The video itself * @param IszX The x dimension of the video * @param IszY The y dimension of the video * @param Nfr The number of frames of the video * @param seed The seed array used for number generation */ void videoSequence(int * I, int IszX, int IszY, int Nfr, int * seed){ int k; int max_size = IszX*IszY*Nfr; /*get object centers*/ int x0 = (int)roundDouble(IszY/2.0); int y0 = (int)roundDouble(IszX/2.0); I[x0 *IszY *Nfr + y0 * Nfr + 0] = 1; /*move point*/ int xk, yk, pos; for(k = 1; k < Nfr; k++){ xk = abs(x0 + (k-1)); yk = abs(y0 - 2*(k-1)); pos = yk * IszY * Nfr + xk *Nfr + k; if(pos >= max_size) pos = 0; I[pos] = 1; } /*dilate matrix*/ int * newMatrix = (int *)malloc(sizeof(int)*IszX*IszY*Nfr); memset(newMatrix, 0, sizeof(int) * max_size); imdilate_disk(I, IszX, IszY, Nfr, 5, newMatrix); int x, y; for(x = 0; x < IszX; x++){ for(y = 0; y < IszY; y++){ for(k = 0; k < Nfr; k++){ I[x*IszY*Nfr + y*Nfr + k] = newMatrix[x*IszY*Nfr + y*Nfr + k]; } } } free(newMatrix); /*define background, add noise*/ setIf(0, 100, I, &IszX, &IszY, &Nfr); setIf(1, 228, I, &IszX, &IszY, &Nfr); /*add noise*/ addNoise(I, &IszX, &IszY, &Nfr, seed); }
bool ParameterItem::getParamData() { ParameterEdit param(this); param.setWindowTitle("Parameter: "+getName()); bool accept = param.exec(); if (accept){ setName(param.getName()); setValue(param.getValue()); setType(param.getType()); setStandardParameter(param.getParamType()); setIf(param.getIf()); setUnless(param.getUnless()); updateParameterItem(); return true; } else return false; }
bool MachineItem::getMachineData() { MachineEdit machineEdit(this); machineEdit.setWindowTitle("Machine: "+getName()); bool accept = machineEdit.exec(); if (accept){ setName(machineEdit.getName()); setAddress(machineEdit.getAddress()); setRos_root(machineEdit.getRos_root()); setRos_package_path(machineEdit.getRos_package_path()); setDefault(machineEdit.getDefault()); setUser(machineEdit.getUser()); setPassword(machineEdit.getPassword()); setTimeout(machineEdit.getTimeout()); setIf(machineEdit.getIf()); setUnless(machineEdit.getUnless()); updateMachineItem(); return true; } else return false; }