Changeset 244 in flair-src for trunk/tools/FlairGCS/src
- Timestamp:
- May 24, 2018, 11:45:33 AM (7 years ago)
- Location:
- trunk/tools/FlairGCS/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/ConnectionLayout.cpp
r234 r244 23 23 24 24 void ConnectionLayout::receive(char *buf, int size) { 25 // printf("trame %x\n",buf[0]);26 // for(int i=0; i<size;i++) printf("%x ",buf[i]);27 // printf("\n");25 // fprintf(stderr,"trame %x\n",buf[0]); 26 // for(int i=0; i<size;i++) fprintf(stderr,"%x ",buf[i]); 27 // fprintf(stderr,"\n"); 28 28 switch ((unsigned char)buf[0]) { 29 29 case XML_HEADER: { … … 33 33 xml.resize(size); 34 34 35 // printf("recu %i\n%s\n",size,xml.toLocal8Bit().constData());35 // fprintf(stderr,"recu %i\n%s\n",size,xml.toLocal8Bit().constData()); 36 36 if (!doc.setContent(xml)) { 37 printf("prob setContent fichier\n");37 fprintf(stderr,"prob setContent fichier\n"); 38 38 } 39 39 … … 42 42 } 43 43 case DATAS_BIG_ENDIAN: { 44 // for(int i=0;i<size;i++) printf("%x ",buf[i]);45 // printf("\n");44 // for(int i=0;i<size;i++) fprintf(stderr,"%x ",buf[i]); 45 // fprintf(stderr,"\n"); 46 46 uint16_t period; 47 47 memcpy(&period, &buf[1], sizeof(uint16_t)); … … 51 51 } 52 52 case DATAS_LITTLE_ENDIAN: { 53 // for(int i=0;i<size;i++) printf("%x ",buf[i]);54 // printf("\n");53 // for(int i=0;i<size;i++) fprintf(stderr,"%x ",buf[i]); 54 // fprintf(stderr,"\n"); 55 55 uint16_t period; 56 56 memcpy(&period, &buf[1], sizeof(uint16_t)); 57 // printf("recu %i period %i\n",size,period);57 // fprintf(stderr,"recu %i period %i\n",size,period); 58 58 drawDatas(&buf[3], size - 3, period); 59 59 break; 60 60 } 61 61 default: 62 printf("trame non supportée %x\n", buf[0]);62 fprintf(stderr,"trame non supportée %x\n", buf[0]); 63 63 } 64 64 } 65 65 66 66 void ConnectionLayout::XmlToSend(QDomDocument doc) { 67 // printf("xml to send\n%s\n",doc.toString().toLocal8Bit().constData());67 // fprintf(stderr,"xml to send\n%s\n",doc.toString().toLocal8Bit().constData()); 68 68 69 69 // xml to send a mettre dans le manager … … 83 83 XmlWidget::LoadXml(tmp); 84 84 } else { 85 printf("%s not found in xml file \n", name.toLocal8Bit().constData());85 fprintf(stderr,"%s not found in xml file \n", name.toLocal8Bit().constData()); 86 86 } 87 87 } … … 111 111 112 112 if (!doc.setContent(xml)) { 113 printf("prob setContent fichier\n");113 fprintf(stderr,"prob setContent fichier\n"); 114 114 } 115 115 -
trunk/tools/FlairGCS/src/DataPlot1D.cpp
r222 r244 40 40 receivesize += sizeof(int16_t); 41 41 } else { 42 printf("MyDataPlot1D::addCurve unknown type %s\n",42 fprintf(stderr,"MyDataPlot1D::addCurve unknown type %s\n", 43 43 type.toLocal8Bit().constData()); 44 44 } … … 97 97 datas[i] = data; 98 98 } else { 99 printf("DataPlot1D::BufEvent unknown type %s\n",99 fprintf(stderr,"DataPlot1D::BufEvent unknown type %s\n", 100 100 datas_type.at(i).toLocal8Bit().constData()); 101 101 } -
trunk/tools/FlairGCS/src/DataPlot2D.cpp
r235 r244 212 212 receivesize += sizeof(int16_t); 213 213 } else { 214 printf("DataPlot2D::addCurve unknown type %s\n",214 fprintf(stderr,"DataPlot2D::addCurve unknown type %s\n", 215 215 type.toLocal8Bit().constData()); 216 216 } … … 287 287 plot_data(data1, data2, i); 288 288 } else { 289 printf("DataPlot2D::DrawDatas type non connu\n");289 fprintf(stderr,"DataPlot2D::DrawDatas type non connu\n"); 290 290 } 291 291 } -
trunk/tools/FlairGCS/src/Layout.cpp
r221 r244 40 40 void Layout::Constructor(QString name) { 41 41 visible_widget = qgridlayout->parentWidget(); 42 // if(visible_widget==NULL) printf("null\n");42 // if(visible_widget==NULL) fprintf(stderr,"null\n"); 43 43 qgridlayout->setObjectName(name); 44 // printf("layout\n%s\n",XmlDoc().toString().toLocal8Bit().constData());44 // fprintf(stderr,"layout\n%s\n",XmlDoc().toString().toLocal8Bit().constData()); 45 45 SetIsContainer(true); 46 46 SetIsExpandable(true); … … 97 97 // if an item already exists at this position, put it on a new row 98 98 if (qgridlayout->itemAtPosition(row, col) != NULL) { 99 printf("existe %s\n", name.toLocal8Bit().constData());99 fprintf(stderr,"widget %s: (%i,%i) already exists\n", name.toLocal8Bit().constData(),row, col); 100 100 row = qgridlayout->rowCount(); 101 fprintf(stderr,"using (%i,%i) for %s\n", row, col,name.toLocal8Bit().constData()); 101 102 } 102 103 -
trunk/tools/FlairGCS/src/Manager.cpp
r234 r244 37 37 qRegisterMetaType<QModelIndex>("QModelIndex"); // pour le file ui?? 38 38 this->name = name; 39 //f printf(stderr,"Manager %x\n",thread());39 //ffprintf(stderr,stderr,"Manager %x\n",thread()); 40 40 setWindowTitle(name); 41 41 … … 88 88 89 89 if (UDT::ERROR == UDT::bind(serv, (sockaddr *)&my_addr, sizeof(my_addr))) { 90 printf("bind error, %s\n", UDT::getlasterror().getErrorMessage());90 fprintf(stderr,"bind error, %s\n", UDT::getlasterror().getErrorMessage()); 91 91 } 92 92 93 93 if (UDT::ERROR == UDT::listen(serv, 1)) { 94 printf("listen error, %s\n", UDT::getlasterror().getErrorMessage());94 fprintf(stderr,"listen error, %s\n", UDT::getlasterror().getErrorMessage()); 95 95 } 96 96 … … 101 101 102 102 Manager::~Manager() { 103 printf("%i\n",udtSockets.count());104 103 for (int i = 0; i < udtSockets.count(); i++) { 105 104 udtSockets.at(i)->kill(); … … 109 108 // delete main_layout; 110 109 UDT::cleanup(); 111 printf("ok\n");112 110 } 113 111 … … 120 118 if (UDT::INVALID_SOCK ==(socket = UDT::accept(serv, (sockaddr *)&their_addr, &namelen))) { 121 119 if (UDT::getlasterror().getErrorCode() != 6002) 122 printf("accept error: %s, code %i\n", UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode());120 fprintf(stderr,"accept error: %s, code %i\n", UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode()); 123 121 return; 124 122 } else { 125 123 QString name=QString("%1:%2").arg(inet_ntoa(their_addr.sin_addr)).arg(their_addr.sin_port); 126 printf("connected to %s\n",name.toLocal8Bit().constData());124 fprintf(stderr,"connected to %s\n",name.toLocal8Bit().constData()); 127 125 128 126 QThread *thread = new QThread(this); … … 148 146 connect(udtSocket, SIGNAL(dataReady(char *, int)), newLayout,SLOT(receive(char *, int)),Qt::BlockingQueuedConnection); 149 147 connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *))); 148 connect(udtSocket, SIGNAL(destroyed(QObject *)), this, SLOT(udtSocketDestroyed(QObject *))); 150 149 connect(udtSocket, SIGNAL(destroyed()), newLayout, SLOT(deleteLater())); 151 150 … … 171 170 } 172 171 172 void Manager::udtSocketDestroyed(QObject *obj) { 173 udtSockets.removeOne((UdtSocket *)obj); 174 } 175 173 176 void Manager::layoutDestroyed(QObject *obj) { 174 177 int index = connectionsLayout.indexOf((ConnectionLayout *)obj); 175 178 179 delete connectionsWidget.at(index); 180 connectionsWidget.removeAt(index); 181 connectionsLayout.removeOne((ConnectionLayout *)obj); 182 176 183 //tab: avoid having only 1 tab (0, 2 or more) 177 184 if (tabBar->count() > 1) { … … 179 186 } 180 187 181 delete connectionsWidget.at(index);182 connectionsWidget.removeAt(index);183 connectionsLayout.removeOne((ConnectionLayout *)obj);184 185 188 if (connectionsLayout.count() == 1) { 186 189 hiddenTabName = tabBar->tabText(0); … … 191 194 status->showMessage(""); 192 195 } 196 197 193 198 } 194 199 … … 222 227 223 228 void Manager::tabBarCurrentChanged(int index) { 229 224 230 if (index >= 0) { 225 connectionsWidget.at(currentTab)->hide(); 231 //if we are coming from layout destroyed 232 if(currentTab<connectionsLayout.count()) connectionsWidget.at(currentTab)->hide(); 226 233 connectionsWidget.at(index)->show(); 227 234 currentTab = index; … … 230 237 connectionsWidget.at(0)->show(); 231 238 } 232 233 239 if (tabBar->count() == 0) { 234 240 status->showMessage(connectionsLayout.at(0)->getUDTStats()); … … 341 347 QDomDocument doc("remote_ui_xml"); 342 348 connectionsLayout.at(i)->GetUpdateXml((QDomElement *)&doc); 343 // printf("merge\n%s\n",doc.toString().toLocal8Bit().constData());349 // fprintf(stderr,"merge\n%s\n",doc.toString().toLocal8Bit().constData()); 344 350 345 351 connectionsLayout.at(i)->XmlToSend(doc); -
trunk/tools/FlairGCS/src/Manager.h
r234 r244 53 53 void deleteFileUI(void); 54 54 void newConnectionLayout(QString name); 55 void udtSocketDestroyed(QObject *obj); 55 56 void layoutDestroyed(QObject *obj); 56 57 -
trunk/tools/FlairGCS/src/Map.cpp
r222 r244 82 82 SLOT(changeproxy(int))); 83 83 } else { 84 printf("Error, no services!\n");84 fprintf(stderr,"Error, no services!\n"); 85 85 mapWidget->setEnabled(false); 86 86 } -
trunk/tools/FlairGCS/src/Picture.cpp
r15 r244 48 48 bool big_endian) { 49 49 if (big_endian) 50 printf("Picture::BufEvent, big endian not handled\n");50 fprintf(stderr,"Picture::BufEvent, big endian not handled\n"); 51 51 52 52 if (IsEnabled() == false || RefreshRate_ms() != period) … … 61 61 label->setPixmap(QPixmap::fromImage(image)); 62 62 } else 63 printf("buffer trop petit\n");63 fprintf(stderr,"buffer trop petit\n"); 64 64 } 65 65 -
trunk/tools/FlairGCS/src/RangeFinderPlot.cpp
r15 r244 39 39 receivesize = nb_samples * sizeof(int16_t); 40 40 } else { 41 printf("RangeFinderPlot::RangeFinderPlot unknown type %s\n",41 fprintf(stderr,"RangeFinderPlot::RangeFinderPlot unknown type %s\n", 42 42 data_type.toLocal8Bit().constData()); 43 43 } … … 177 177 SetTriangle(i, data); 178 178 } else { 179 printf("RangeFinderPlot::BufEvent unknown type %s\n",179 fprintf(stderr,"RangeFinderPlot::BufEvent unknown type %s\n", 180 180 data_type.toLocal8Bit().constData()); 181 181 } -
trunk/tools/FlairGCS/src/UdtSocket.cpp
r242 r244 39 39 bool blocking = false; 40 40 if (UDT::setsockopt(socket, 0, UDT_RCVSYN, &blocking, sizeof(bool)) != 0) 41 printf("UDT::setsockopt error (UDT_RCVSYN)\n");41 fprintf(stderr,"UDT::setsockopt error (UDT_RCVSYN)\n"); 42 42 43 43 heartbeat_timer = new QTimer(this); … … 57 57 58 58 void UdtSocket::setName(QString name) { 59 printf(" %s is %s\n",this->name.toLocal8Bit().constData(),name.toLocal8Bit().constData());59 fprintf(stderr," %s is %s\n",this->name.toLocal8Bit().constData(),name.toLocal8Bit().constData()); 60 60 this->name=name; 61 61 } … … 79 79 UDT::TRACEINFO perf; 80 80 if (UDT::ERROR == UDT::perfmon(socket, &perf)) { 81 printf("perfmon: %s\n",UDT::getlasterror().getErrorMessage());81 fprintf(stderr,"perfmon: %s\n",UDT::getlasterror().getErrorMessage()); 82 82 }/* else { 83 printf("%s socket stats:\n",name.toLocal8Bit().constData());84 printf("total number of sent packets, including retransmissions: %i\n",perf.pktSentTotal);85 printf("total number of received packets: %i\n",perf.pktRecvTotal);86 printf("total number of lost packets, measured in the sending side: %i\n",perf.pktSndLossTotal);87 printf("total number of lost packets, measured in the receiving side: %i\n",perf.pktRcvLossTotal);88 printf("total number of retransmitted packets, measured in the sending side: %i\n",perf.pktRetransTotal);89 printf("total number of sent ACK packets: %i\n",perf.pktSentACKTotal);90 printf("total number of received ACK packets: %i\n",perf.pktRecvACKTotal);91 printf("total number of sent NAK packets: %i\n",perf.pktSentNAKTotal);92 printf("total number of received NAK packets: %i\n",perf.pktRecvNAKTotal);93 printf("round trip time: %fms\n",perf.msRTT);83 fprintf(stderr,"%s socket stats:\n",name.toLocal8Bit().constData()); 84 fprintf(stderr,"total number of sent packets, including retransmissions: %i\n",perf.pktSentTotal); 85 fprintf(stderr,"total number of received packets: %i\n",perf.pktRecvTotal); 86 fprintf(stderr,"total number of lost packets, measured in the sending side: %i\n",perf.pktSndLossTotal); 87 fprintf(stderr,"total number of lost packets, measured in the receiving side: %i\n",perf.pktRcvLossTotal); 88 fprintf(stderr,"total number of retransmitted packets, measured in the sending side: %i\n",perf.pktRetransTotal); 89 fprintf(stderr,"total number of sent ACK packets: %i\n",perf.pktSentACKTotal); 90 fprintf(stderr,"total number of received ACK packets: %i\n",perf.pktRecvACKTotal); 91 fprintf(stderr,"total number of sent NAK packets: %i\n",perf.pktSentNAKTotal); 92 fprintf(stderr,"total number of received NAK packets: %i\n",perf.pktRecvNAKTotal); 93 fprintf(stderr,"round trip time: %fms\n",perf.msRTT); 94 94 95 95 }*/ … … 114 114 char *buf = (char *)malloc(buf_size); 115 115 if (!buf) { 116 printf("error malloc UdtSocket::receiveData buffer\n");116 fprintf(stderr,"error malloc UdtSocket::receiveData buffer\n"); 117 117 return; 118 118 } 119 119 char *uncompressbuf=(char *)malloc(COMPRESS_CHUNK); 120 120 if (!uncompressbuf) { 121 printf("error malloc UdtSocket::receiveData uncompress buffer\n");121 fprintf(stderr,"error malloc UdtSocket::receiveData uncompress buffer\n"); 122 122 free(buf); 123 123 return; 124 124 } 125 //f printf(stderr,"receiveData %x\n",thread());125 //ffprintf(stderr,stderr,"receiveData %x\n",thread()); 126 126 127 127 while (!stop) { … … 135 135 int eid = UDT::epoll_create(); 136 136 if (eid < 0) { 137 printf("%s: epoll_create error (%s)\n",name.toLocal8Bit().constData(),UDT::getlasterror().getErrorMessage());137 fprintf(stderr,"%s: epoll_create error (%s)\n",name.toLocal8Bit().constData(),UDT::getlasterror().getErrorMessage()); 138 138 } 139 139 140 140 if (UDT::epoll_add_usock(eid, socket) < 0) { 141 141 if (UDT::getlasterror().getErrorCode() == 5004) { 142 printf("disconnected from %s\n",name.toLocal8Bit().constData());142 fprintf(stderr,"disconnected from %s\n",name.toLocal8Bit().constData()); 143 143 heartbeat_timer->stop(); 144 144 deleteLater(); 145 145 stop=true;; 146 146 } else { 147 printf("%s: epoll_add_usock error (%s)\n",name.toLocal8Bit().constData(),UDT::getlasterror().getErrorMessage());147 fprintf(stderr,"%s: epoll_add_usock error (%s)\n",name.toLocal8Bit().constData(),UDT::getlasterror().getErrorMessage()); 148 148 } 149 149 } … … 155 155 if (rv == -1) { 156 156 if (UDT::getlasterror().getErrorCode() != 6003) 157 printf("prob %i\n", UDT::getlasterror().getErrorCode());157 fprintf(stderr,"prob %i\n", UDT::getlasterror().getErrorCode()); 158 158 } else if(readfds==socket && num==1 && rv==1) { 159 159 … … 201 201 } else { 202 202 if(UDT::getlasterror().getErrorCode()!=6002) 203 printf("udt socket:%s %i\n",UDT::getlasterror().getErrorMessage(),size);203 fprintf(stderr,"udt socket: %s %i\n",UDT::getlasterror().getErrorMessage(),size); 204 204 //UDT::close(socket);//si deconnecté 205 205 //free(buf); … … 207 207 } 208 208 } else { 209 printf("udt socket:%s\n",UDT::getlasterror().getErrorMessage());209 fprintf(stderr,"udt socket: %s\n",UDT::getlasterror().getErrorMessage()); 210 210 } 211 211 UDT::epoll_remove_usock(eid, socket); … … 220 220 qint64 sent = UDT::sendmsg(socket, buf, size, ttl, inOrder); 221 221 if (sent != size) { 222 printf("%s, error writting to udt (%s)\n",name.toLocal8Bit().constData(), UDT::getlasterror().getErrorMessage());222 fprintf(stderr,"%s, error writting to udt (%s)\n",name.toLocal8Bit().constData(), UDT::getlasterror().getErrorMessage()); 223 223 if (UDT::getlasterror().getErrorCode() == 2001) { 224 fprintf(stderr,"%s, closing connection\n",name.toLocal8Bit().constData()); 224 225 stop = true; 225 226 heartbeat_timer->stop(); -
trunk/tools/FlairGCS/src/UsSensorPlot.cpp
r222 r244 97 97 receivesize += sizeof(int16_t); 98 98 } else { 99 printf("UsSensorPlot::unknown type %s\n",99 fprintf(stderr,"UsSensorPlot::unknown type %s\n", 100 100 datasType.toLocal8Bit().constData()); 101 101 } … … 217 217 *buf += nbSamples*sizeof(uint16_t); 218 218 } else { 219 printf("UsSensorPlot::DrawDatas type non connu %s\n",datasType.toLocal8Bit().constData());219 fprintf(stderr,"UsSensorPlot::DrawDatas type non connu %s\n",datasType.toLocal8Bit().constData()); 220 220 } 221 221 uint16_t *data=(uint16_t*)*buf; -
trunk/tools/FlairGCS/src/XmlWidget.cpp
r68 r244 73 73 74 74 XmlWidget *XmlWidget::GetXmlWidget(QString name, QString type) { 75 // printf("recherche %s75 // fprintf(stderr,"recherche %s 76 76 // %s\n",name.toLocal8Bit().constData(),type.toLocal8Bit().constData()); 77 77 78 78 for (int i = 0; i < childs->count(); i++) { 79 // printf("child name79 // fprintf(stderr,"child name 80 80 // %s\n",childs->at(i)->write_elem.attribute("name").toLocal8Bit().constData()); 81 // printf("child tag81 // fprintf(stderr,"child tag 82 82 // %s\n",childs->at(i)->write_elem.tagName().toLocal8Bit().constData()); 83 83 if (childs->at(i)->write_elem.attribute("name") == name && … … 96 96 QString name = to_parse.attribute("name"); 97 97 98 // printf("parse %s98 // fprintf(stderr,"parse %s 99 99 // %s\n",type.toLocal8Bit().constData(),name.toLocal8Bit().constData()); 100 100 XmlWidget *match; … … 102 102 103 103 if (match == NULL) { 104 // printf("not match\n");104 // fprintf(stderr,"not match\n"); 105 105 XmlEvent(to_parse); 106 106 } else { 107 // printf("match\n");107 // fprintf(stderr,"match\n"); 108 108 // si on a une balise IsEnabled, on ne traite que ca 109 109 if (match->visible_widget != NULL) { … … 120 120 // si on a une balise delete, on ne traite que ca 121 121 if (to_parse.attribute("Delete") == "1") { 122 // printf("delete flag\n");122 // fprintf(stderr,"delete flag\n"); 123 123 if (match->isContainer == true && match->childs->count() != 0) { 124 // printf("non vide124 // fprintf(stderr,"non vide 125 125 // %s\n",match->objectName().toLocal8Bit().constData()); 126 126 return; … … 134 134 match->isExpandable == false) { 135 135 QString new_name; 136 printf("possible doublon\n");136 fprintf(stderr,"possible doublon\n"); 137 137 for (int i = 0; i < 65535; i++) { 138 138 new_name = QString("%1_%2").arg(name).arg(i); … … 147 147 break; 148 148 } 149 printf("new_name %s\n", new_name.toLocal8Bit().constData());149 fprintf(stderr,"new_name %s\n", new_name.toLocal8Bit().constData()); 150 150 to_parse.setAttribute("name", new_name); 151 151 to_parse.setAttribute("old_name", name); … … 177 177 QString type = elem.tagName(); 178 178 QString name = elem.attribute("name"); 179 // printf("%s179 // fprintf(stderr,"%s 180 180 // %s\n",type.toLocal8Bit().constData(),name.toLocal8Bit().constData()); 181 181 XmlWidget *match; … … 183 183 184 184 if (match != NULL) { 185 // printf("match\n");185 // fprintf(stderr,"match\n"); 186 186 match->LoadXml(elem); 187 187 } … … 296 296 QDomNamedNodeMap attributes=write_elem.attributes(); 297 297 while(attributes.count()!=0) { 298 // printf("%i %s\n",attributes.count(),attributes.item(0).toAttr().name().toLocal8Bit().constData());298 //fprintf(stderr,"%i %s\n",attributes.count(),attributes.item(0).toAttr().name().toLocal8Bit().constData()); 299 299 write_elem.removeAttribute(attributes.item(0).toAttr().name()); 300 300 } -
trunk/tools/FlairGCS/src/file_ui.cpp
r234 r244 34 34 bool blocking = true; 35 35 if (UDT::setsockopt(socket, 0, UDT_SNDSYN, &blocking, sizeof(bool))!= 0) { 36 printf("UDT::setsockopt error (UDT_SNDSYN) %s\n",UDT::getlasterror().getErrorMessage());36 fprintf(stderr,"UDT::setsockopt error (UDT_SNDSYN) %s\n",UDT::getlasterror().getErrorMessage()); 37 37 } 38 38 … … 42 42 43 43 if (UDT::setsockopt(socket, 0, UDT_LINGER, &_linger, sizeof(struct linger)) != 0) 44 printf("UDT::setsockopt error (UDT_LINGER) %s\n",UDT::getlasterror().getErrorMessage());44 fprintf(stderr,"UDT::setsockopt error (UDT_LINGER) %s\n",UDT::getlasterror().getErrorMessage()); 45 45 46 46 dialog = new QDialog(); 47 //f printf(stderr,"creator file ui %x\n",thread());47 //ffprintf(stderr,stderr,"creator file ui %x\n",thread()); 48 48 dialog->setWindowTitle("log files"); 49 49 QGridLayout *main_layout = new QGridLayout(dialog); … … 86 86 bool flag_new_seq = true; 87 87 QString folder_name; 88 //f printf(stderr,"file_ui thread %x\n",thread());88 //ffprintf(stderr,stderr,"file_ui thread %x\n",thread()); 89 89 while(1) { 90 90 // receive file info … … 101 101 size = qFromBigEndian(size); 102 102 103 // printf("file_ui recu %i %x\n",bytesRead,recv_buf[0]);103 // fprintf(stderr,"file_ui recu %i %x\n",bytesRead,recv_buf[0]); 104 104 if ((recv_buf[0]==FILE_INFO_LITTLE_ENDIAN || recv_buf[0]==FILE_INFO_BIG_ENDIAN) && size>0) { 105 105 if (flag_new_seq == true) { … … 148 148 endOfFiles(); 149 149 UDT::close(socket); 150 printf("disconnected from log files\n");150 fprintf(stderr,"disconnected from log files\n"); 151 151 break; 152 152 } … … 221 221 QString txt_line = txt_in.readLine(); 222 222 data_type.append(txt_line.section("(",-1)); // on part de la fin pour trouver la premiere parenthese ouvrante 223 // printf("type %s\n",txt_line.section("(",-1).toLocal8Bit().constData());223 // fprintf(stderr,"type %s\n",txt_line.section("(",-1).toLocal8Bit().constData()); 224 224 } 225 225 txt_file.close(); … … 323 323 QFile file(filename); 324 324 if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) 325 printf("file_ui::save_comment: erreur ouverture fichier %s\n",325 fprintf(stderr,"file_ui::save_comment: erreur ouverture fichier %s\n", 326 326 filename.toLocal8Bit().constData()); 327 327 QTextStream out(&file); … … 337 337 QFile global_file(filename); 338 338 if (!global_file.open(QIODevice::WriteOnly | QIODevice::Text)) 339 printf("file_ui::save_csv: erreur ouverture fichier %s\n",339 fprintf(stderr,"file_ui::save_csv: erreur ouverture fichier %s\n", 340 340 filename.toLocal8Bit().constData()); 341 341 QTextStream out(&global_file); … … 344 344 filename = file_names->at(csv_combo->currentIndex() - 1); 345 345 QFile ref_file(filename); 346 // printf("file_ui::save_csv: ref %s\n",filename.toLocal8Bit().constData());346 // fprintf(stderr,"file_ui::save_csv: ref %s\n",filename.toLocal8Bit().constData()); 347 347 if (!ref_file.open(QIODevice::ReadOnly | QIODevice::Text)) 348 printf("file_ui::save_csv: erreur ouverture ficher %s\n",348 fprintf(stderr,"file_ui::save_csv: erreur ouverture ficher %s\n", 349 349 filename.toLocal8Bit().constData()); 350 350 … … 359 359 m_file[j].setFileName(filename); 360 360 if (!m_file[j].open(QIODevice::ReadOnly | QIODevice::Text)) 361 printf("file_ui::save_csv: erreur ouverture ficher %s\n",361 fprintf(stderr,"file_ui::save_csv: erreur ouverture ficher %s\n", 362 362 filename.toLocal8Bit().constData()); 363 363 m_in[j].setDevice(&m_file[j]); … … 382 382 qint64 ref_us = ref_line.section(',', 0, 0).toLongLong(); 383 383 int ref_ns = ref_line.section(',', 1, 1).toInt(); 384 // printf("ref %lld %i\n",ref_us,ref_ns);384 // fprintf(stderr,"ref %lld %i\n",ref_us,ref_ns); 385 385 386 386 for (int i = 0; i < file_names->count() - 1; i++) { 387 387 qint64 csv_us = m_line[i].section(',', 0, 0).toLongLong(); 388 388 int csv_ns = m_line[i].section(',', 1, 1).toInt(); 389 // printf("m %lld %i\n",csv_us,csv_ns);389 // fprintf(stderr,"m %lld %i\n",csv_us,csv_ns); 390 390 391 391 while (is_greater(ref_us, csv_us, ref_ns, csv_ns) == true) { … … 396 396 csv_us = m_line[i].section(',', 0, 0).toLongLong(); 397 397 csv_ns = m_line[i].section(',', 1, 1).toInt(); 398 // printf("m %lld %i\n",csv_us,csv_ns);398 // fprintf(stderr,"m %lld %i\n",csv_us,csv_ns); 399 399 } 400 400 csv_us = m_line_prev[i].section(',', 0, 0).toLongLong(); 401 401 csv_ns = m_line_prev[i].section(',', 1, 1).toInt(); 402 // printf("m ok %lld %i\n",csv_us,csv_ns);402 // fprintf(stderr,"m ok %lld %i\n",csv_us,csv_ns); 403 403 404 404 ref_line += "," + m_line_prev[i].section(',', 2); … … 420 420 QFile global_file(filename); 421 421 if (!global_file.open(QIODevice::WriteOnly | QIODevice::Text)) 422 printf("file_ui::save_txt: erreur ouverture ficher %s\n",422 fprintf(stderr,"file_ui::save_txt: erreur ouverture ficher %s\n", 423 423 filename.toLocal8Bit().constData()); 424 424 QTextStream out(&global_file); … … 429 429 QFile ref_file(filename); 430 430 if (!ref_file.open(QIODevice::ReadOnly | QIODevice::Text)) 431 printf("file_ui::save_txt: erreur ouverture ficher %s\n",431 fprintf(stderr,"file_ui::save_txt: erreur ouverture ficher %s\n", 432 432 filename.toLocal8Bit().constData()); 433 433 … … 450 450 QFile txt_file(filename); 451 451 if (!txt_file.open(QIODevice::ReadOnly | QIODevice::Text)) 452 printf("file_ui::save_txt: erreur ouverture ficher %s\n",452 fprintf(stderr,"file_ui::save_txt: erreur ouverture ficher %s\n", 453 453 filename.toLocal8Bit().constData()); 454 454 QTextStream txt_in(&txt_file); -
trunk/tools/FlairGCS/src/main.cpp
r234 r244 46 46 int nentries; 47 47 48 printf("Segmentation fault:\n");48 fprintf(stderr,"Segmentation fault:\n"); 49 49 /* Dump a backtrace of the frame which caused the segfault: */ 50 50 nentries = backtrace(bt, sizeof(bt) / sizeof(bt[0])); … … 62 62 63 63 if (bint.c[0] == 1) { 64 printf("error, ground station is only compatible with little endian\n");64 fprintf(stderr,"error, ground station is only compatible with little endian\n"); 65 65 return -1; 66 66 } … … 72 72 73 73 parseOptions(argc, argv); 74 printf("listening on port %i\n", port);74 fprintf(stderr,"listening on port %i\n", port); 75 75 76 76 qRegisterMetaType<const char *>("const char*");
Note:
See TracChangeset
for help on using the changeset viewer.