- Timestamp:
- Sep 4, 2014, 11:18:26 AM (10 years ago)
- Location:
- geovis/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Makefile.in
r4628 r4629 9 9 USE_THROTTLING_SLEEP = #yes 10 10 SLEEP_AFTER_QUEUE_FRAME = yes 11 QUEUE_ONLY_ONE_FRAME = yes 11 12 12 13 bindir = @bindir@ … … 111 112 DEFINES += -DSLEEP_AFTER_QUEUE_FRAME 112 113 endif 114 ifdef QUEUE_ONLY_ONE_FRAME 115 DEFINES += -DQUEUE_ONLY_ONE_FRAME 116 endif 113 117 114 118 CXX_SWITCHES = $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(DEFINES) $(INCLUDES) -
geovis/trunk/RenderServer.h
r4349 r4629 21 21 class Stats; 22 22 23 #define GEOVIS_VERSION_STRING "0. 4"23 #define GEOVIS_VERSION_STRING "0.5.0" 24 24 25 25 #define MSECS_ELAPSED(t1, t2) \ -
geovis/trunk/Renderer.cpp
r4628 r4629 87 87 _bgColor[2] = 0; 88 88 //setMaximumFrameRateInHertz(15.0); 89 // 100M Bit89 // 100Mbit 90 90 setMaximumBitrate(1.0e8); 91 91 _lastFrameTime = _minFrameTime; 92 TRACE("Bandwidth target: %.2f M Bit", (float)(getMaximumBitrate()/1.0e6));92 TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6)); 93 93 TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz()); 94 94 … … 1041 1041 } 1042 1042 osgEarth::ImageLayerOptions layerOpts(name, opts); 1043 #ifdef USE_OSGEARTH_TRUNK 1044 layerOpts.textureCompression() = osg::Texture::USE_IMAGE_DATA_FORMAT; 1045 #endif 1043 1046 if (makeShared) { 1044 1047 layerOpts.shared() = true; … … 1321 1324 1322 1325 setMaximumBitrate(origBitrate); 1323 TRACE("Bandwidth target: %.2f M Bit", (float)(getMaximumBitrate()/1.0e6));1326 TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6)); 1324 1327 TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz()); 1325 1328 -
geovis/trunk/Renderer.h
r4628 r4629 20 20 #include <osgViewer/Viewer> 21 21 #include <osgGA/StateSetManipulator> 22 #include <osgUtil/IncrementalCompileOperation> 22 23 23 24 #include <osgEarth/StringUtils> … … 365 366 rate = 0.25; 366 367 _minFrameTime = 1.0/rate; 368 if (_viewer.valid()) { 369 osgUtil::IncrementalCompileOperation *op = 370 _viewer->getDatabasePager()->getIncrementalCompileOperation(); 371 if (op != NULL) { 372 TRACE("Setting DB Pager target frame rate to %g", rate); 373 op->setTargetFrameRate(rate); 374 } 375 } 367 376 } 368 377 -
geovis/trunk/RendererCmd.cpp
r4628 r4629 107 107 std::string cmd(str); 108 108 cmd.erase(cmd.find_last_not_of(" \n\r\t")+1); 109 TRACE("command %lu: '%s'", g_stats.nCommands +1, cmd.c_str());109 TRACE("command %lu: '%s'", g_stats.nCommands, cmd.c_str()); 110 110 #endif 111 111 lastCmdStatus = TCL_OK; … … 772 772 { 773 773 int x, y; 774 if (Tcl_GetIntFromObj(interp, objv[ 2], &x) != TCL_OK ||775 Tcl_GetIntFromObj(interp, objv[ 3], &y) != TCL_OK) {774 if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK || 775 Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) { 776 776 return TCL_ERROR; 777 777 } … … 779 779 osgEarth::GeoPoint mapPoint; 780 780 size_t length; 781 char mesg[ 256];781 char mesg[512]; 782 782 if (g_renderer->mapMouseCoords(x, y, mapPoint)) { 783 783 std::string srsInit; 784 784 std::string verticalDatum; 785 if (objc > 4) {786 srsInit = Tcl_GetString(objv[ 4]);787 if (objc > 5) {788 verticalDatum = Tcl_GetString(objv[ 5]);785 if (objc > 5) { 786 srsInit = Tcl_GetString(objv[5]); 787 if (objc > 6) { 788 verticalDatum = Tcl_GetString(objv[6]); 789 789 } 790 790 osgEarth::SpatialReference *outSRS = … … 802 802 // send coords to client 803 803 length = snprintf(mesg, sizeof(mesg), 804 "nv>map coords %g %g %g %d %d {%s} {%s}\n", 804 "nv>map coords %s %g %g %g %d %d {%s} {%s}\n", 805 Tcl_GetString(objv[2]), //g_stats.nCommands, 805 806 mapPoint.x(), mapPoint.y(), mapPoint.z(), 806 807 x, y, … … 812 813 // Out of range 813 814 length = snprintf(mesg, sizeof(mesg), 814 "nv>map coords invalid %d %d\n", x, y); 815 "nv>map coords %s invalid %d %d\n", 816 Tcl_GetString(objv[2]), //g_stats.nCommands, 817 x, y); 815 818 816 819 queueResponse(mesg, length, Response::VOLATILE); … … 1547 1550 1548 1551 static CmdSpec mapOps[] = { 1549 {"coords", 1, MapCoordsOp, 4, 6, "x y ?srs? ?verticalDatum?"},1552 {"coords", 1, MapCoordsOp, 5, 7, "token x y ?srs? ?verticalDatum?"}, 1550 1553 {"grid", 1, MapGraticuleOp, 3, 4, "bool ?type?"}, 1551 1554 {"layer", 2, MapLayerOp, 3, 0, "op ?params...?"}, … … 1750 1753 { 1751 1754 double x, y, z; 1752 if (Tcl_GetDoubleFromObj(interp, objv[ 2], &x) != TCL_OK ||1753 Tcl_GetDoubleFromObj(interp, objv[ 3], &y) != TCL_OK ||1754 Tcl_GetDoubleFromObj(interp, objv[ 4], &z) != TCL_OK) {1755 if (Tcl_GetDoubleFromObj(interp, objv[3], &x) != TCL_OK || 1756 Tcl_GetDoubleFromObj(interp, objv[4], &y) != TCL_OK || 1757 Tcl_GetDoubleFromObj(interp, objv[5], &z) != TCL_OK) { 1755 1758 return TCL_ERROR; 1756 1759 } 1757 1760 const osgEarth::SpatialReference *srs = NULL; 1758 if (objc < 6) {1761 if (objc < 7) { 1759 1762 srs = g_renderer->getMapSRS(); 1760 1763 if (srs == NULL) { … … 1763 1766 } 1764 1767 } else { 1765 std::string srsInit(Tcl_GetString(objv[ 5]));1768 std::string srsInit(Tcl_GetString(objv[6])); 1766 1769 std::string verticalDatum; 1767 if (objc > 6) {1768 verticalDatum = Tcl_GetString(objv[ 6]);1770 if (objc > 7) { 1771 verticalDatum = Tcl_GetString(objv[7]); 1769 1772 } 1770 1773 srs = osgEarth::SpatialReference::get(srsInit, verticalDatum); … … 1785 1788 // send coords to client 1786 1789 length = snprintf(mesg, sizeof(mesg), 1787 "nv>screen coords %g %g %g %g %g %g\n", 1790 "nv>screen coords %s %g %g %g %g %g %g\n", 1791 Tcl_GetString(objv[2]), 1788 1792 screen.x(), screen.y(), screen.z(), 1789 1793 x, y, z); … … 1793 1797 // Out of range 1794 1798 length = snprintf(mesg, sizeof(mesg), 1795 "nv>screen coords invalid %g %g %g\n", x, y, z); 1799 "nv>screen coords %s invalid %g %g %g\n", 1800 Tcl_GetString(objv[2]), 1801 x, y, z); 1796 1802 1797 1803 queueResponse(mesg, length, Response::VOLATILE); … … 1817 1823 static CmdSpec screenOps[] = { 1818 1824 {"bgcolor", 1, ScreenBgColorOp, 5, 5, "r g b"}, 1819 {"coords", 1, ScreenCoordsOp, 5, 7, "x y z ?srs? ?verticalDatum?"},1825 {"coords", 1, ScreenCoordsOp, 6, 8, "token x y z ?srs? ?verticalDatum?"}, 1820 1826 {"size", 1, ScreenSizeOp, 4, 4, "width height"} 1821 1827 }; -
geovis/trunk/ResponseQueue.cpp
r3998 r4629 26 26 } 27 27 28 ResponseQueue::~ResponseQueue() 28 ResponseQueue::~ResponseQueue() 29 29 { 30 30 TRACE("Deleting ResponseQueue"); … … 45 45 if (pthread_mutex_lock(&_idle) != 0) { 46 46 ERROR("can't lock mutex: %s", strerror(errno)); 47 } 47 } 48 #ifdef QUEUE_ONLY_ONE_FRAME 48 49 /* Examine the list and remove any queued responses of the same type. */ 49 50 TRACE("Before # of elements is %d", _list.size()); 50 51 for (std::list<Response *>::iterator itr = _list.begin(); 51 52 itr != _list.end();) { 52 /* Remove any duplicate image or legend responses. There should be no 53 * more than one. Note that if the client starts using multiple legends 53 /* Remove any duplicate image or legend responses. There should be no 54 * more than one. Note that if the client starts using multiple legends 54 55 * for different fields, this optimization should be disabled for legends. 55 56 * We may also need to differentiate between screen images and "hardcopy" … … 67 68 } 68 69 } 70 #endif 69 71 /* Add the new response to the end of the list. */ 70 72 _list.push_back(response); … … 75 77 if (pthread_mutex_unlock(&_idle) != 0) { 76 78 ERROR("can't unlock mutex: %s", strerror(errno)); 77 } 79 } 78 80 } 79 81 … … 105 107 if (pthread_mutex_unlock(&_idle) != 0) { 106 108 ERROR("can't unlock mutex: %s", strerror(errno)); 107 } 109 } 108 110 return response; 109 111 } -
geovis/trunk/geovis_protocol.txt
r4578 r4629 90 90 91 91 screen bgcolor <r> <g> <b> 92 screen coords < x> <y> <z> <?srs?> <?verticalDatum?>92 screen coords <token> <x> <y> <z> <?srs?> <?verticalDatum?> 93 93 Transate map coordinates to screen/mouse coordinates. 94 <token> - String token, included in response 94 95 <x>,<y>,<z> - Map coordinates. If srs not given, these are in the map's 95 96 coordinate system. … … 114 115 == Map Commands == 115 116 116 map coords < x> <y> <?srs?> <?verticalDatum?>117 map coords <token> <x> <y> <?srs?> <?verticalDatum?> 117 118 Translate screen/mouse coordinates into map coordinates. 119 <token> - String token, included in response 118 120 <x>,<y> - Screen/mouse coordinates 119 121 <srs> - Optional horizontal srs init string for coordinate system to return … … 207 209 nv>image -type image -bytes <nbytes> 208 210 <binary RGB data> 209 nv>map coords < mapX> <mapY> <mapZ> <screenX> <screenY> <?srs?> <?verticalDatum?>211 nv>map coords <token> <mapX> <mapY> <mapZ> <screenX> <screenY> <?srs?> <?verticalDatum?> 210 212 Reply to query of map coordinates from screen coordinates. srs of the map 211 213 coordinates may be included if not in map's native coordinate system 212 nv>map coords invalid <mouseX> <mouseY>214 nv>map coords <token> invalid <mouseX> <mouseY> 213 215 Reply indicating an off-map click/query 214 nv>screen coords < screenX> <screenY> <screenZ> <mapX> <mapY> <mapZ>216 nv>screen coords <token> <screenX> <screenY> <screenZ> <mapX> <mapY> <mapZ> 215 217 Reply to query of screen coordinates from map coordinates 216 nv>screen coords invalid <mapX> <mapY> <mapZ>218 nv>screen coords <token> invalid <mapX> <mapY> <mapZ> 217 219 Reply indicating requested point is out of the view frustum 218 220 nv>ok -token <seqnum> 219 Reply indicated commands through <seqnum> (numbered beginning at 1) have been221 Reply indicated commands through <seqnum> (numbered beginning at 0) have been 220 222 processed, but no new image was rendered 221 223 ================================================================================
Note: See TracChangeset
for help on using the changeset viewer.