Changeset 3608 for trunk/packages/vizservers
- Timestamp:
- Apr 2, 2013 1:54:43 PM (11 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Command.cpp
r3607 r3608 1333 1333 queueResponse(info, cmdLength, Response::VOLATILE); 1334 1334 #else 1335 ssize_t nWritten = SocketWrite(info, (size_t)cmdLength); 1336 if (nWritten != (ssize_t)cmdLength) { 1335 if (SocketWrite(info, (size_t)cmdLength) != (ssize_t)cmdLength) { 1337 1336 ERROR("Short write"); 1338 1337 return TCL_ERROR; 1339 1338 } 1340 1339 #endif -
trunk/packages/vizservers/nanovis/FlowCmd.cpp
r3605 r3608 1070 1070 }; 1071 1071 1072 static int 1073 MakeImageFiles(Tcl_Interp *interp, char *tmpFileName, 1074 FlowVideoSwitches *switchesPtr, bool *cancelPtr) 1072 static bool 1073 MakeImageFiles(char *tmpFileName, 1074 int width, int height, int numFrames, 1075 bool *cancelPtr) 1075 1076 { 1076 1077 struct pollfd pollResults; … … 1084 1085 oldHeight = NanoVis::winHeight; 1085 1086 1086 if ( (switchesPtr->width != oldWidth) ||1087 (switchesPtr->height != oldHeight)) {1087 if (width != oldWidth || 1088 height != oldHeight) { 1088 1089 // Resize to the requested size. 1089 NanoVis::resizeOffscreenBuffer( switchesPtr->width, switchesPtr->height);1090 NanoVis::resizeOffscreenBuffer(width, height); 1090 1091 } 1091 1092 NanoVis::resetFlows(); 1092 1093 *cancelPtr = false; 1093 int result = TCL_OK;1094 bool result = true; 1094 1095 size_t length = strlen(tmpFileName); 1095 for (int i = 1; i <= switchesPtr->numFrames; i++) {1096 for (int i = 1; i <= numFrames; i++) { 1096 1097 if (((i & 0xF) == 0) && (poll(&pollResults, 1, timeout) > 0)) { 1097 1098 /* If there's another command on stdin, that means the client is … … 1116 1117 sprintf(tmpFileName + length, "/image%d.ppm", i); 1117 1118 result = nv::writePPMFile(tmpFileName, NanoVis::screenBuffer, 1118 switchesPtr->width, switchesPtr->height);1119 if ( result != TCL_OK) {1119 width, height); 1120 if (!result) { 1120 1121 break; 1121 1122 } 1122 1123 } 1123 if ( (switchesPtr->width != oldWidth)||1124 (switchesPtr->height != oldHeight)) {1124 if (width != oldWidth || 1125 height != oldHeight) { 1125 1126 NanoVis::resizeOffscreenBuffer(oldWidth, oldHeight); 1126 1127 } … … 1241 1242 size_t length = strlen(tmpFileName); 1242 1243 bool canceled = false; 1243 result = MakeImageFiles(interp, tmpFileName, &switches, &canceled); 1244 if (MakeImageFiles(tmpFileName, 1245 switches.width, switches.height, switches.numFrames, 1246 &canceled)) { 1247 result = TCL_OK; 1248 } else { 1249 result = TCL_ERROR; 1250 } 1244 1251 if ((result == TCL_OK) && (!canceled)) { 1245 1252 result = MakeMovie(interp, tmpFileName, token, &switches);
Note: See TracChangeset
for help on using the changeset viewer.