Changeset 3361
- Timestamp:
- Feb 26, 2013 1:42:53 AM (11 years ago)
- Location:
- branches/nanovis2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nanovis2
-
branches/nanovis2/packages/vizservers/vtkvis/RpVtkDataSet.cpp
r3334 r3361 356 356 357 357 _dataSet = reader->GetOutput(); 358 if (_dataSet == NULL) 359 return false; 358 360 #ifndef USE_VTK6 359 361 _dataSet->SetPipelineInformation(NULL); … … 362 364 _dataSet->GetPointData()->GetScalars() != NULL && 363 365 _dataSet->GetPointData()->GetScalars()->GetLookupTable() != NULL) { 364 ERROR("No lookup table should be specified in DataSets");366 USER_ERROR("No lookup table should be specified in VTK data sets"); 365 367 } 366 368 … … 389 391 _dataSet->GetPointData()->GetScalars() != NULL && 390 392 _dataSet->GetPointData()->GetScalars()->GetLookupTable() != NULL) { 391 ERROR("No lookup table should be specified in DataSets");393 USER_ERROR("No lookup table should be specified in VTK data sets"); 392 394 } 393 395 -
branches/nanovis2/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r3334 r3361 82 82 int result; 83 83 84 TRACE("command : '%s'", Tcl_DStringValue(dsPtr));84 TRACE("command %lu: '%s'", g_stats.nCommands+1, Tcl_DStringValue(dsPtr)); 85 85 lastCmdStatus = TCL_OK; 86 86 result = Tcl_EvalEx(interp, Tcl_DStringValue(dsPtr), … … 4070 4070 } 4071 4071 g_renderer->addDataSet(name); 4072 g_renderer->setData(name, data, nbytes); 4072 if (!g_renderer->setData(name, data, nbytes)) { 4073 USER_ERROR("Failed to load data for dataset \"%s\"", name); 4074 free(data); 4075 return TCL_ERROR; 4076 } 4073 4077 g_stats.nDataSets++; 4074 4078 g_stats.nDataBytes += nbytes; … … 9697 9701 * and allow a new image to be 9698 9702 * rendered. */ 9699 } else if (status != TCL_OK) {9703 } else { //if (status != TCL_OK) { 9700 9704 ret = 0; 9701 9705 if (handleError(interp, clientData, status, fdOut) < 0) { … … 9725 9729 int nBytes; 9726 9730 9727 string = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); 9728 TRACE("status=%d errorInfo=(%s)", status, string); 9731 TRACE("Enter"); 9732 9733 if (status != TCL_OK) { 9734 string = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); 9735 nBytes = strlen(string); 9736 if (nBytes > 0) { 9737 TRACE("status=%d errorInfo=(%s)", status, string); 9738 9739 std::ostringstream oss; 9740 #ifdef OLD_ERRORS 9741 oss << "VtkVis Server Error: " << string << "\n"; 9742 nBytes += 22; 9743 #else 9744 oss << "nv>viserror -type internal_error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string; 9745 nBytes = oss.str().length(); 9746 #endif 9747 9748 #ifdef USE_THREADS 9749 QueueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR); 9750 #else 9751 if (write(fdOut, oss.str().c_str(), nBytes) < 0) { 9752 ERROR("write failed: %s", strerror(errno)); 9753 return -1; 9754 } 9755 #endif 9756 } 9757 } 9758 9759 TRACE("Before user error"); 9760 9761 string = getUserMessages(); 9729 9762 nBytes = strlen(string); 9730 9731 std::ostringstream oss; 9763 if (nBytes > 0) { 9764 TRACE("userError=(%s)", string); 9765 9766 std::ostringstream oss; 9732 9767 #ifdef OLD_ERRORS 9733 oss << "VtkVis Server Error: " << string << "\n";9734 nBytes += 22;9768 oss << "VtkVis Server Error: " << string << "\n"; 9769 nBytes += 22; 9735 9770 #else 9736 oss << "nv>viserror -type error-bytes " << nBytes << "\n" << string;9737 nBytes = oss.str().length();9771 oss << "nv>viserror -type error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string; 9772 nBytes = oss.str().length(); 9738 9773 #endif 9739 9774 9740 9775 #ifdef USE_THREADS 9741 QueueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR);9776 QueueResponse(clientData, oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR); 9742 9777 #else 9743 if (write(fdOut, oss.str().c_str(), nBytes) < 0) {9744 ERROR("write failed: %s", strerror(errno));9745 return -1;9746 }9778 if (write(fdOut, oss.str().c_str(), nBytes) < 0) { 9779 ERROR("write failed: %s", strerror(errno)); 9780 return -1; 9781 } 9747 9782 #endif 9783 clearUserMessages(); 9784 } 9785 9786 TRACE("Leave"); 9748 9787 9749 9788 return 0; -
branches/nanovis2/packages/vizservers/vtkvis/RpVtkRendererCmd.h
r3334 r3361 11 11 #include <cstdio> 12 12 #include <tcl.h> 13 13 14 #include "ReadBuffer.h" 14 15 -
branches/nanovis2/packages/vizservers/vtkvis/Trace.cpp
r3334 r3361 11 11 #include <syslog.h> 12 12 13 #include <string> 14 #include <sstream> 15 13 16 #include "Trace.h" 14 17 15 18 using namespace Rappture::VtkVis; 19 20 static std::ostringstream g_UserErrorString; 16 21 17 22 #define MSG_LEN 2047 … … 64 69 syslog(priority, "%s", message); 65 70 } 71 72 /** 73 * \brief Write a user message to buffer 74 */ 75 void 76 Rappture::VtkVis::logUserMessage(const char* fmt, ...) 77 { 78 char message[MSG_LEN + 1]; 79 int length = 0; 80 va_list lst; 81 82 va_start(lst, fmt); 83 84 length += vsnprintf(message, MSG_LEN, fmt, lst); 85 message[MSG_LEN] = '\0'; 86 87 g_UserErrorString << message << "\n"; 88 } 89 90 const char * 91 Rappture::VtkVis::getUserMessages() 92 { 93 return g_UserErrorString.str().c_str(); 94 } 95 96 void 97 Rappture::VtkVis::clearUserMessages() 98 { 99 g_UserErrorString.str(std::string()); 100 } -
branches/nanovis2/packages/vizservers/vtkvis/Trace.h
r3305 r3361 13 13 namespace Rappture { 14 14 namespace VtkVis { 15 16 extern void logUserMessage(const char* format, ...); 17 18 extern const char *getUserMessages(); 19 20 extern void clearUserMessages(); 15 21 16 22 extern void initLog(); … … 30 36 #define INFO(...) Rappture::VtkVis::logMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) 31 37 38 #define USER_ERROR(...) Rappture::VtkVis::logUserMessage(__VA_ARGS__) 39 32 40 } 33 41 }
Note: See TracChangeset
for help on using the changeset viewer.