- Timestamp:
- Aug 29, 2016, 4:58:23 PM (8 years ago)
- Location:
- trunk/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
r55 r67 181 181 status = UDT::close(com_sock); 182 182 if (status != 0) 183 printf("Error udt::close %s", UDT::getlasterror().getErrorMessage());183 Printf("Error udt::close %s", UDT::getlasterror().getErrorMessage()); 184 184 185 185 status = UDT::close(file_sock); 186 186 if (status != 0) 187 printf("Error udt::close %s", UDT::getlasterror().getErrorMessage());187 Printf("Error udt::close %s", UDT::getlasterror().getErrorMessage()); 188 188 189 189 SleepMS(200); // a revoir, sinon UDT::cleanup bloque en RT … … 294 294 xmlDoc *doc; 295 295 rcv_buf[bytesRead] = 0; 296 296 //Printf("%s\n",rcv_buf); 297 297 doc = xmlReadMemory(rcv_buf, (int)bytesRead, "include.xml", 298 298 "ISO-8859-1", 0); -
trunk/lib/FlairCore/src/Map.cpp
r15 r67 21 21 #include "GeoCoordinate.h" 22 22 #include "FrameworkManager.h" 23 #include <cmath> 23 24 #include <string.h> 24 25 #include <sstream> … … 80 81 void Map::ExtraXmlEvent(void) { 81 82 82 // attention pas rt safe (creation checkpoint)83 // attention pas rt safe (creation/destruction checkpoint) 83 84 size_t i = 0; 84 85 while (1) { 85 // printf("test %i\n",i);86 86 double latitude, longitude; 87 87 double altitude = 0; … … 90 90 long_prop << "long" << i; 91 91 alt_prop << "alt" << i; 92 92 93 if (GetPersistentXmlProp(lat_prop.str(), latitude) && 93 94 GetPersistentXmlProp(long_prop.str(), longitude)) { 94 95 GetPersistentXmlProp(alt_prop.str(), altitude); 96 95 97 if (i >= checkpoints.size()) { 98 //add checkpoint 96 99 GeoCoordinate *checkpoint = new GeoCoordinate( 97 100 this, "checkpoint", latitude, longitude, altitude); 98 101 checkpoints.push_back(checkpoint); 99 // printf("add %i\n",i); 102 } else if(isnan(latitude) || isnan(longitude)) { 103 //delete checkpoint 104 removeCheckpoint(i); 105 break;//si delete, la station sol n'envoit que cette info 100 106 } else { 107 //move checkpoint 101 108 checkpoints.at(i)->SetCoordinates(latitude, longitude, altitude); 102 109 } … … 107 114 i++; 108 115 } 109 116 /* 110 117 for (size_t i = 0; i < checkpoints.size(); i++) { 111 118 double latitude, longitude, altitude; 112 119 checkpoints.at(i)->GetCoordinates(&latitude, &longitude, &altitude); 113 // printf("%i %f %f\n",i,latitude,longitude); 120 printf("%i %f %f\n",i,latitude,longitude); 121 }*/ 122 } 123 124 void Map::removeCheckpoint(size_t index) { 125 //left shift 126 for (size_t i = index; i < checkpoints.size()-1; i++) { 127 double latitude, longitude, altitude; 128 checkpoints.at(i+1)->GetCoordinates(&latitude, &longitude, &altitude); 129 checkpoints.at(i)->SetCoordinates(latitude,longitude,altitude); 114 130 } 131 132 //remove last one 133 delete checkpoints.back(); 134 checkpoints.pop_back(); 135 136 //remove last one in xml 137 ostringstream lat_prop, long_prop, alt_prop; 138 lat_prop << "lat" << checkpoints.size(); 139 long_prop << "long" << checkpoints.size(); 140 alt_prop << "alt" << checkpoints.size(); 141 UnsetPersistentXmlProp(lat_prop.str()); 142 UnsetPersistentXmlProp(long_prop.str()); 143 UnsetPersistentXmlProp(alt_prop.str()); 115 144 } 116 145 -
trunk/lib/FlairCore/src/Map.h
r15 r67 77 77 void ExtraXmlEvent(void); 78 78 79 void removeCheckpoint(size_t index); 80 79 81 std::vector<core::GeoCoordinate *> checkpoints; 80 82 std::vector<const core::GeoCoordinate *> to_draw; -
trunk/lib/FlairCore/src/Widget.cpp
r15 r67 82 82 if (GetPersistentXmlProp<double>(prop, tmp)) { 83 83 value = tmp; 84 return true; 85 } else { 86 return false; 87 } 88 } 89 90 template <> 91 bool Widget::GetPersistentXmlProp(std::string prop, std::string &value) { 92 xmlChar *result = NULL; 93 result = xmlGetProp(pimpl_->file_node, (xmlChar *)prop.c_str()); 94 if (result != NULL) { 95 value = std::string((char *)result); 96 xmlFree(result); 84 97 return true; 85 98 } else { … … 208 221 } 209 222 223 template <> void Widget::SetPersistentXmlProp(std::string prop, std::string value) { 224 SetVolatileXmlProp(prop, value); 225 SetVolatileXmlProp(prop, value, pimpl_->file_node); 226 } 227 228 void Widget::UnsetPersistentXmlProp(std::string prop) { 229 xmlUnsetProp(pimpl_->file_node, (xmlChar *)prop.c_str()); 230 } 231 210 232 void Widget::SendXml(void) { pimpl_->SendXml(); } 211 233 -
trunk/lib/FlairCore/src/Widget.h
r15 r67 143 143 virtual void XmlEvent(void){}; 144 144 145 /*! 146 * \brief Unset a persistent xml property 147 * 148 * Unset an existent property, so it won't be saved. 149 * 150 * \param prop property to set 151 */ 152 void UnsetPersistentXmlProp(std::string prop); 153 145 154 private: 146 155 class Widget_impl *pimpl_; -
trunk/lib/FlairSensorActuator/src/NmeaGps.cpp
r55 r67 195 195 if (result != 1) { 196 196 Warn("unrecognized nmea sentence: %s\n",frame); 197 return; 197 198 } 198 199
Note:
See TracChangeset
for help on using the changeset viewer.