- Timestamp:
- Sep 12, 2008, 1:29:18 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r1126 r1152 1 2008-09-09: 1 2 3 * Created legend for xy plots. You can raise/lower/show/hide/rename 4 traces (curves). There is also a provision for displaying the 5 fill area between two curves and taking the average of two or 6 more curves. 7 * Nanovis markers now change the transfer function globally. Previously 8 changing the a marker changes the transfer function for that volume 9 only. Now all volumes using that transfer function are affected. 10 * Pymolproxy changed to use file transfer for PDB files. This should 11 prevent large datasets from breaking pymol. 12 * Data sent to render servers now made in one write. Should improve 13 performance for large datasets. 14 * Nanovis server was profiled and improvements made to protocol. 15 * "Abort" button fixed. Previous version abort was disabled during 16 simulation. 17 * New checkbutton indicator for booleanentry (switch). 18 * Empty sequences (pymol) are now checked. 19 * Fixed heightmap (surface plot) grid to accurately measure the surface. 2 20 * added bohr units and conversion to meters 3 21 * added a free text label so users can label each element of a sequence. … … 5 23 * changed boolean widget to use a simple checkbutton 6 24 * added ability to set the color of integer and number widgets 7 25 to a wavelength or range of wavelengths. 8 26 9 27 2008-06-11: fixed bug in Ruby putfile() method (bhaley) … … 11 29 2008-03-30: Rappture 20080330 released 12 30 2008-02-18: added initial bindings and build scripts for Ruby (bhaley) 31 -
trunk/gui/pkgIndex.tcl.in
r1018 r1152 8 8 variable library $dir 9 9 } 10 package require Rappture 10 11 package provide RapptureGUI $version 11 12 } $dir] -
trunk/gui/scripts/visviewer.tcl
r1142 r1152 149 149 set hosts [split $hostlist ,] 150 150 set random_hosts {} 151 set ticks [clock ticks] 152 expr {srand($ticks)} 151 153 for { set i [llength $hosts] } { $i > 0 } { incr i -1 } { 152 154 set index [expr {round(rand()*$i - 0.5)}] -
trunk/gui/scripts/xylegend.tcl
r1141 r1152 25 25 inherit itk::Widget 26 26 27 private variable autocolors_ { 28 #0000cd 29 #cd0000 30 #00cd00 31 #3a5fcd 32 #cdcd00 33 #cd1076 34 #009acd 35 #00c5cd 36 #a2b5cd 37 #7ac5cd 38 #66cdaa 39 #a2cd5a 40 #cd9b9b 41 #cdba96 42 #cd3333 43 #cd6600 44 #cd8c95 45 #cd00cd 46 #9a32cd 47 #6ca6cd 48 #9ac0cd 49 #9bcd9b 50 #00cd66 51 #cdc673 52 #cdad00 53 #cd5555 54 #cd853f 55 #cd7054 56 #cd5b45 57 #cd6889 58 #cd69c9 59 #551a8b 60 } 61 private variable lastColorIndex_ "" 27 62 private variable _dispatcher "" ;# dispatcher for !events 28 63 private variable graph_ "" 29 64 private variable tree_ "" 30 private variable diff_ "" 31 private variable focus_ ""65 private variable diff_ ""; # Polygon marker used for difference. 66 private variable rename_ ""; # Node selected to be renamed. 32 67 private variable diffelements_ 33 68 … … 35 70 destructor {} 36 71 37 public method Activate{}72 public method reset {} 38 73 public method Average {} 39 74 public method Check {} 40 public method Deactivate {}41 75 public method Delete { args } 42 76 public method Difference {} … … 163 197 -applycommand [itcl::code $this Editor apply] 164 198 } 199 set lastColorIndex_ [llength $autocolors_] 165 200 Check 166 201 eval itk_initialize $args … … 171 206 # ---------------------------------------------------------------------- 172 207 itcl::body Rappture::XyLegend::destructor {} { 173 Deactivate 208 foreach node [$tree_ children root] { 209 $tree_ delete $node 210 } 211 if { $diff_ != "" } { 212 catch { $graph_ marker delete $diff_ } 213 } 174 214 } 175 215 … … 183 223 $itk_component(legend) entry configure $node -label $label -icon $im \ 184 224 -activeicon $im 225 update idletasks 185 226 return $node 186 227 } 187 228 188 229 # ---------------------------------------------------------------------- 189 # USAGE: activate<curve> ?<settings>?230 # USAGE: reset <curve> ?<settings>? 190 231 # 191 232 # Clients use this to add a curve to the plot. The optional <settings> … … 193 234 # -brightness, -width, -linestyle and -raise. 194 235 # ---------------------------------------------------------------------- 195 itcl::body Rappture::XyLegend::Activate {} { 236 itcl::body Rappture::XyLegend::reset {} { 237 foreach node [$tree_ children root] { 238 $tree_ delete $node 239 } 196 240 foreach elem [$graph_ element show] { 197 241 set label [$graph_ element cget $elem -label] … … 202 246 } 203 247 $itk_component(legend) open -recurse root 204 } 205 206 itcl::body Rappture::XyLegend::Deactivate {} { 207 foreach node [$tree_ children root] { 208 $tree_ delete $node 209 } 248 Check 210 249 } 211 250 … … 355 394 } 356 395 } 357 if { [$itk_component(legend) index focus] != -1 } {358 $itk_component(controls).rename configure -state normal359 }360 396 if { [$tree_ degree 0] > 1 && [llength $nodes] > 0 } { 361 397 foreach n { raise lower } { … … 367 403 } 368 404 1 { 369 foreach n { hide show toggle } {405 foreach n { hide show toggle rename } { 370 406 $itk_component(controls).$n configure -state normal 371 407 } … … 403 439 set ycoords [blt::vector create \#auto -command ""] 404 440 441 blt::busy hold $itk_component(hull) 442 update 405 443 # Step 1. Get the x-values for each curve, then sort them to get the 406 444 # unique values. … … 450 488 # Don't use the vector because we don't know when it will be cleaned up. 451 489 490 if { $lastColorIndex_ == 0 } { 491 set lastColorIndex_ [llength $autocolors_] 492 } 493 incr lastColorIndex_ -1 494 set color [lindex $autocolors_ $lastColorIndex_] 452 495 $graph_ element create $name -label $label -x [$xcoords range 0 end]\ 453 -y [$sum range 0 end] -symbol scross 496 -y [$sum range 0 end] -symbol scross -pixels 3 -color $color 454 497 blt::vector destroy $xcoords $ycoords $sum 455 498 set node [Add $name $label -delete] 456 499 Raise $node 500 blt::busy forget $itk_component(hull) 457 501 } 458 502 … … 484 528 set diff_ [$graph_ marker create polygon \ 485 529 -coords [$m range 0 end] \ 486 -elem $elem1 \530 -element $elem1 \ 487 531 -stipple dot1 \ 488 -outline "" -fill blue4]532 -outline "" -fill "#cd69c9"] 489 533 blt::vector destroy $m $x $y 490 534 set diffelements_($elem1) 1 … … 519 563 } 520 564 activate { 521 set focus_ [$itk_component(legend) index focus]522 if { $ focus_ == "" } {565 set rename_ [$itk_component(legend) curselection] 566 if { $rename_ == "" } { 523 567 return; 524 568 } 525 set label [$itk_component(legend) entry cget $ focus_ -label]526 foreach { l r w h } [$itk_component(legend) bbox $ focus_] break569 set label [$itk_component(legend) entry cget $rename_ -label] 570 foreach { l r w h } [$itk_component(legend) bbox $rename_] break 527 571 set info(text) $label 528 572 set info(x) [expr $l + [winfo rootx $itk_component(legend)]] … … 542 586 } 543 587 set label [lindex $args 0] 544 $itk_component(legend) entry configure $ focus_ -label $label545 set elem [$tree_ label $ focus_]588 $itk_component(legend) entry configure $rename_ -label $label 589 set elem [$tree_ label $rename_] 546 590 $graph_ element configure $elem -label $label 547 591 } -
trunk/gui/scripts/xyresult.tcl
r1140 r1152 30 30 #000080 #800000 #006600 31 31 #660066 #996600 #666600 32 }33 set autocolors {34 #4876ff35 #00bfff36 #cae1ff37 #98f5ff38 #7fffd439 #00ff7f40 #caff7041 #ffff0042 #ffc1c143 #ffe7ba44 #ff404045 #ff7f0046 #ff000047 #ffaeb948 #ff00ff49 #bf3dff50 #0000ff51 #87ceff52 #bfefff53 #00f5ff54 #c1ffc155 #00ff0056 #fff68f57 #ffd70058 #ff6a6a59 #ffa54f60 #ff8c6961 #ff725662 #ff149363 #ff82ab64 #ff93fa65 #9b30ff66 32 } 67 33 set autocolors { … … 191 157 rename -highlightbackground -controlbackground controlBackground Background 192 158 } 193 pack $itk_component(reset) -padx 4 -pady 4-anchor e159 pack $itk_component(reset) -padx 4 -pady 2 -anchor e 194 160 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 195 161 … … 274 240 itk_component add legendbutton { 275 241 button $itk_component(controls).legendbutton \ 276 -borderwidth 1 -padx 3 -pady0 \242 -borderwidth 1 -padx 2 -pady 0 -highlightthickness 0 \ 277 243 -text "L" -font "-*-times new roman-bold-i-*-*-11-*-*-*-*-*-*-*" \ 278 244 -command [itcl::code $this legend toggle] … … 282 248 rename -highlightbackground -controlbackground controlBackground Background 283 249 } 284 pack $itk_component(legendbutton) -padx 4 -pady 4-anchor e250 pack $itk_component(legendbutton) -padx 4 -pady { 0 2 } -anchor e 285 251 286 252 itk_component add legend { … … 289 255 after idle [subst { 290 256 update idletasks 291 $itk_component(legend) Activate257 $itk_component(legend) reset 292 258 }] 293 259 Rappture::Tooltip::for $itk_component(legendbutton) \ … … 439 405 } 440 406 441 # if anything changed, then rebuild the plot407 # If anything changed, then rebuild the plot 442 408 if {$changed} { 443 409 $_dispatcher event -idle !rebuild 444 410 } 445 411 446 # nothing left? then start over with auto colors412 # Nothing left? then start over with auto colors 447 413 if {[llength $_clist] == 0} { 448 414 set _autoColorI 0 … … 810 776 } 811 777 } 778 $itk_component(legend) reset 812 779 } 813 780 -
trunk/packages/vizservers/pymolproxy/pymolproxy.c
r1142 r1152 48 48 #define IO_TIMEOUT (30000) 49 49 50 typedef struct { 51 unsigned int date; 52 size_t nFrames; /* # of frames sent to client. */ 53 size_t nBytes; /* # of bytes for all frames. */ 54 size_t nCommands; /* # of commands executed */ 55 double cmdTime; /* Elasped time spend executing commands. */ 56 struct timeval start; /* Start of elapsed time. */ 57 } Stats; 58 59 static Stats stats; 60 50 61 static FILE *flog; 51 62 static int debug = 1; … … 91 102 } PymolProxy; 92 103 104 static int 105 ExecuteCommand(Tcl_Interp *interp, Tcl_DString *dsPtr, Stats *statsPtr) 106 { 107 struct timeval tv; 108 double start, finish; 109 110 gettimeofday(&tv, NULL); 111 start = ((double)tv.tv_sec) + ((double)tv.tv_usec * 1.0e-6); 112 Tcl_Eval(interp, Tcl_DStringValue(dsPtr)); 113 trace("Executed (%s)", Tcl_DStringValue(dsPtr)); 114 Tcl_DStringSetLength(dsPtr, 0); 115 gettimeofday(&tv, NULL); 116 117 finish = ((double)tv.tv_sec) + ((double)tv.tv_usec * 1.0e-6); 118 statsPtr->cmdTime += finish - start; 119 statsPtr->nCommands++; 120 } 121 122 static int 123 WriteStats(Stats *statsPtr, int code) 124 { 125 struct timeval tv; 126 double start, finish; 127 int lockf; 128 FILE *f; 129 char *lockFileName, *statsFileName; 130 131 /* Get ending time. */ 132 gettimeofday(&tv, NULL); 133 finish = ((double)tv.tv_sec) + ((double)tv.tv_usec * 1.0e-6); 134 tv = statsPtr->start; 135 start = ((double)tv.tv_sec) + ((double)tv.tv_usec * 1.0e-6); 136 for(;;) { 137 lockf = open(lockFileName, O_EXCL | O_CREAT | O_TRUNC | O_WRONLY, 0600); 138 if (lockf >= 0) { 139 break; 140 } 141 if (errno != EEXIST) { 142 fprintf(stderr, "can't open lock file \"%s\"\n: %s\n", 143 lockFileName, strerror(errno)); 144 return 0; 145 } 146 /* Need to turn off alarms first. */ 147 alarm(0); 148 sleep(1); 149 } 150 f = fopen(statsFileName, "a+"); 151 if (f == NULL) { 152 fprintf(f, "\"pymolproxy\",%d,%d,%d,%d,%d,%d,%g,%g", 153 getpid(), 154 code, 155 statsPtr->date, 156 statsPtr->nFrames, 157 statsPtr->nBytes, 158 statsPtr->nCommands, 159 statsPtr->cmdTime, 160 finish - start); 161 fclose(f); 162 } 163 close(lockf); 164 unlink(lockFileName); 165 return 1; 166 } 167 93 168 INLINE static void 94 169 dyBufferInit(DyBuffer *buffer) … … 183 258 result = 0; 184 259 } 185 return (total);260 return total; 186 261 } 187 262 … … 1032 1107 { 1033 1108 char buffer[800]; 1034 unsigned int bytes=0;1109 unsigned int nBytes=0; 1035 1110 float samples = 0.0; 1036 1111 PymolProxy *pymol = (PymolProxy *) cdata; … … 1049 1124 waitForString(pymol, "image follows: ", buffer, 800); 1050 1125 1051 sscanf(buffer, "image follows: %d %f\n", & bytes, &samples);1126 sscanf(buffer, "image follows: %d %f\n", &nBytes, &samples); 1052 1127 1053 write(3, &samples,sizeof(samples));1128 write(3, &samples, sizeof(samples)); 1054 1129 1055 dyBufferSetLength(&pymol->image, bytes);1130 dyBufferSetLength(&pymol->image, nBytes); 1056 1131 1057 1132 bread(pymol->p_stdout, pymol->image.data, pymol->image.used); … … 1059 1134 waitForString(pymol, " ScenePNG", buffer,800); 1060 1135 1061 if ( bytes && (pymol->image.used == bytes)) {1136 if ((nBytes > 0) && (pymol->image.used == nBytes)) { 1062 1137 sprintf(buffer, "nv>image %d %d %d %d\n", 1063 bytes, pymol->cacheid, pymol->frame, pymol->rock_offset);1138 nBytes, pymol->cacheid, pymol->frame, pymol->rock_offset); 1064 1139 trace("to-molvis> %s", buffer); 1065 1140 write(pymol->c_stdin, buffer, strlen(buffer)); 1066 bwrite(pymol->c_stdin, pymol->image.data, bytes); 1141 bwrite(pymol->c_stdin, pymol->image.data, nBytes); 1142 stats.nFrames++; 1143 stats.nBytes += nBytes; 1067 1144 } 1068 1145 return pymol->status; … … 1073 1150 { 1074 1151 char buffer[800]; 1075 unsigned int bytes=0;1152 unsigned int nBytes=0; 1076 1153 float samples = 0.0; 1077 1154 PymolProxy *pymol = (PymolProxy *) cdata; … … 1090 1167 waitForString(pymol, "image follows: ", buffer, 800); 1091 1168 1092 sscanf(buffer, "image follows: %d %f\n", & bytes, &samples);1169 sscanf(buffer, "image follows: %d %f\n", &nBytes, &samples); 1093 1170 write(3,&samples,sizeof(samples)); 1094 1171 1095 dyBufferSetLength(&pymol->image, bytes);1172 dyBufferSetLength(&pymol->image, nBytes); 1096 1173 1097 1174 bread(pymol->p_stdout, pymol->image.data, pymol->image.used); 1098 1175 1099 if ( bytes && (pymol->image.used == bytes)) {1176 if ((nBytes > 0) && (pymol->image.used == nBytes)) { 1100 1177 sprintf(buffer, "nv>image %d %d %d %d\n", 1101 bytes, pymol->cacheid, pymol->frame, pymol->rock_offset);1178 nBytes, pymol->cacheid, pymol->frame, pymol->rock_offset); 1102 1179 write(pymol->c_stdin, buffer, strlen(buffer)); 1103 1180 trace("to-molvis buffer=%s\n", buffer); 1104 bwrite(pymol->c_stdin, pymol->image.data, bytes); 1181 bwrite(pymol->c_stdin, pymol->image.data, nBytes); 1182 stats.nFrames++; 1183 stats.nBytes += nBytes; 1105 1184 } 1106 1185 return pymol->status; … … 1120 1199 int pid; 1121 1200 PymolProxy pymol; 1122 struct timeval now, end;1201 struct timeval now, end; 1123 1202 int timeout; 1124 1203 … … 1242 1321 1243 1322 gettimeofday(&end, NULL); 1244 1245 while(1) 1246 { 1247 char ch; 1248 1249 gettimeofday(&now,NULL); 1250 1251 if ( (!pymol.need_update) ) 1252 timeout = -1; 1253 else if ((now.tv_sec > end.tv_sec) || ( (now.tv_sec == end.tv_sec) && (now.tv_usec >= end.tv_usec)) ) 1254 timeout = 0; 1255 else 1256 { 1257 timeout = (end.tv_sec - now.tv_sec) * 1000; 1258 1259 if (end.tv_usec > now.tv_usec) 1260 timeout += (end.tv_usec - now.tv_usec) / 1000; 1261 else 1262 timeout += (((1000000 + end.tv_usec) - now.tv_usec) / 1000) - 1000; 1263 1264 } 1265 1266 if (!pymol.immediate_update) 1267 status = poll(ufd, 3, timeout); 1268 else 1269 status = 0; 1270 1271 if ( status < 0 ) 1272 { 1273 trace("pymolproxy: POLL ERROR: status = %d, errno = %d, %s \n", status,errno,strerror(errno)); 1274 } 1275 else if (status > 0) 1276 { 1277 gettimeofday(&now,NULL); 1278 1279 if (ufd[0].revents) { /* Client Stdout Connection: command input */ 1280 if (read(ufd[0].fd,&ch,1) <= 0) 1281 { 1282 if (errno != EINTR) 1283 { 1284 trace("pymolproxy: lost client connection (%d).\n", errno); 1285 break; 1286 } 1287 } 1288 else 1289 { 1290 Tcl_DStringAppend(&cmdbuffer, &ch, 1); 1291 1292 if (ch == '\n' && Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer))) { 1293 Tcl_Eval(interp, Tcl_DStringValue(&cmdbuffer)); 1294 trace("Executed(%d,%d): %s", pymol.need_update, pymol.immediate_update, Tcl_DStringValue(&cmdbuffer)); 1295 Tcl_DStringSetLength(&cmdbuffer, 0); 1296 1297 if (timeout == 0) status = 0; // send update 1298 } 1299 } 1300 } 1301 1302 if (ufd[1].revents ) { /* pyMol Stdout Connection: pymol (unexpected) output */ 1303 if (read(ufd[1].fd, &ch, 1) <= 0) 1304 { 1305 if (errno != EINTR) { 1306 trace("pymolproxy: lost connection (stdout) to pymol server\n"); 1307 break; 1308 } 1309 } 1310 else 1311 { 1312 dyBufferAppend(&dybuffer, &ch, 1); 1313 1314 if (ch == '\n') { 1315 ch = 0; 1316 dyBufferAppend(&dybuffer, &ch, 1); 1317 trace("STDOUT>%s",dybuffer.data); 1318 dyBufferSetLength(&dybuffer,0); 1319 } 1320 } 1321 } 1322 1323 if (ufd[2].revents) { /* pyMol Stderr Connection: pymol standard error output */ 1324 if (read(ufd[2].fd, &ch, 1) <= 0) 1325 { 1326 if (errno != EINTR) { 1327 trace("pymolproxy: lost connection (stderr) to pymol server\n"); 1328 break; 1329 } 1330 } 1331 else { 1332 dyBufferAppend(&dybuffer2, &ch, 1); 1333 1334 if (ch == '\n') { 1335 ch = 0; 1336 dyBufferAppend(&dybuffer2, &ch, 1); 1337 trace("stderr>%s", dybuffer2.data); 1338 dyBufferSetLength(&dybuffer2,0); 1339 } 1340 } 1341 } 1342 } 1343 1344 if (status == 0) 1345 { 1346 gettimeofday(&now,NULL); 1347 1348 if (pymol.need_update && pymol.can_update) 1349 Tcl_Eval(interp, "bmp -\n"); 1350 1351 end.tv_sec = now.tv_sec; 1352 end.tv_usec = now.tv_usec + 150000; 1353 1354 if (end.tv_usec >= 1000000) 1355 { 1356 end.tv_sec++; 1357 end.tv_usec -= 1000000; 1358 } 1359 1360 } 1361 1362 } 1363 1323 stats.start = end; 1324 while(1) { 1325 char ch; 1326 1327 gettimeofday(&now,NULL); 1328 1329 if ( (!pymol.need_update) ) 1330 timeout = -1; 1331 else if ((now.tv_sec > end.tv_sec) || ( (now.tv_sec == end.tv_sec) && (now.tv_usec >= end.tv_usec)) ) 1332 timeout = 0; 1333 else { 1334 timeout = (end.tv_sec - now.tv_sec) * 1000; 1335 1336 if (end.tv_usec > now.tv_usec) 1337 timeout += (end.tv_usec - now.tv_usec) / 1000; 1338 else 1339 timeout += (((1000000 + end.tv_usec) - now.tv_usec) / 1000) - 1000; 1340 1341 } 1342 1343 if (!pymol.immediate_update) 1344 status = poll(ufd, 3, timeout); 1345 else 1346 status = 0; 1347 1348 if ( status < 0 ) { 1349 trace("pymolproxy: POLL ERROR: status = %d, errno = %d, %s \n", status,errno,strerror(errno)); 1350 } else if (status > 0) { 1351 gettimeofday(&now,NULL); 1352 1353 if (ufd[0].revents) { /* Client Stdout Connection: command input */ 1354 if (read(ufd[0].fd,&ch,1) <= 0) { 1355 if (errno != EINTR) { 1356 trace("pymolproxy: lost client connection (%d).\n", errno); 1357 break; 1358 } 1359 } else { 1360 Tcl_DStringAppend(&cmdbuffer, &ch, 1); 1361 1362 if (ch == '\n' && Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer))) { 1363 ExecuteCommand(interp, &cmdbuffer, &stats); 1364 if (timeout == 0) status = 0; // send update 1365 } 1366 } 1367 } 1368 1369 if (ufd[1].revents ) { /* pyMol Stdout Connection: pymol (unexpected) output */ 1370 if (read(ufd[1].fd, &ch, 1) <= 0) { 1371 if (errno != EINTR) { 1372 trace("pymolproxy: lost connection (stdout) to pymol server\n"); 1373 break; 1374 } 1375 } else { 1376 dyBufferAppend(&dybuffer, &ch, 1); 1377 1378 if (ch == '\n') { 1379 ch = 0; 1380 dyBufferAppend(&dybuffer, &ch, 1); 1381 trace("STDOUT>%s",dybuffer.data); 1382 dyBufferSetLength(&dybuffer,0); 1383 } 1384 } 1385 } 1386 1387 if (ufd[2].revents) { /* pyMol Stderr Connection: pymol standard error output */ 1388 if (read(ufd[2].fd, &ch, 1) <= 0) { 1389 if (errno != EINTR) { 1390 trace("pymolproxy: lost connection (stderr) to pymol server\n"); 1391 break; 1392 } 1393 } else { 1394 dyBufferAppend(&dybuffer2, &ch, 1); 1395 1396 if (ch == '\n') { 1397 ch = 0; 1398 dyBufferAppend(&dybuffer2, &ch, 1); 1399 trace("stderr>%s", dybuffer2.data); 1400 dyBufferSetLength(&dybuffer2,0); 1401 } 1402 } 1403 } 1404 } 1405 1406 if (status == 0) { 1407 gettimeofday(&now,NULL); 1408 1409 if (pymol.need_update && pymol.can_update) 1410 Tcl_Eval(interp, "bmp -\n"); 1411 1412 end.tv_sec = now.tv_sec; 1413 end.tv_usec = now.tv_usec + 150000; 1414 1415 if (end.tv_usec >= 1000000) { 1416 end.tv_sec++; 1417 end.tv_usec -= 1000000; 1418 } 1419 1420 } 1421 1422 } 1423 1364 1424 status = waitpid(pid, &result, WNOHANG); 1365 1425 WriteStats(&stats, status); 1366 1426 if (status == -1) { 1367 1427 trace("pymolproxy: error waiting on pymol server to exit (%d)\n", errno); … … 1373 1433 alarm(0); 1374 1434 1375 while ((status == -1) && (errno == EINTR)) 1376 { 1377 trace("pymolproxy: Attempting to SIGKILL process.\n"); 1378 kill(-pid, SIGKILL); // kill process group 1379 alarm(10); 1380 status = waitpid(pid, &result, 0); 1381 alarm(0); 1382 } 1383 } 1384 1435 while ((status == -1) && (errno == EINTR)) { 1436 trace("pymolproxy: Attempting to SIGKILL process.\n"); 1437 kill(-pid, SIGKILL); // kill process group 1438 alarm(10); 1439 status = waitpid(pid, &result, 0); 1440 alarm(0); 1441 } 1442 } 1443 1385 1444 trace("pymolproxy: pymol server process ended (%d)\n", result); 1386 1445 1387 1446 dyBufferFree(&pymol.image); 1388 1447 1389 1448 Tcl_DeleteInterp(interp); 1390 1449 1391 1450 return( (status == pid) ? 0 : 1); 1392 1451 }
Note: See TracChangeset
for help on using the changeset viewer.