Ignore:
Timestamp:
Mar 12, 2009 9:03:18 AM (15 years ago)
Author:
dkearney
Message:

fix up flow capture command to automatically create a file name and remove it after use.
updated nvscripts to not send filename for capture command.
added proper destructor to AVTranslate object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

    r1311 r1312  
    17371737    std::stringstream fdata;
    17381738    fdata.write(buf.bytes(),buf.size());
    1739     //load_vector_stream(n, fdata);
     1739    // load_vector_stream(n, fdata);
    17401740    load_vector_stream2(n, fdata);
    17411741    Volume *volPtr = NanoVis::volume[n];
     
    17511751    if (volPtr != NULL) {
    17521752        volPtr->set_n_slice(256-n);
    1753         //volPtr->set_n_slice(512-n);
     1753        // volPtr->set_n_slice(512-n);
    17541754        volPtr->disable_cutplane(0);
    17551755        volPtr->disable_cutplane(1);
    1756 
    17571756        volPtr->disable_cutplane(2);
    17581757
     
    17661765        volPtr->move(Vector3(dx0, dy0, dz0));
    17671766
    1768         //
    1769         volPtr->disable();
    17701767    }
    17711768
     
    18081805    }
    18091806
    1810     const char *fileName = Tcl_GetString(objv[3]);
     1807    char fileName[128];
     1808    sprintf(fileName,"/tmp/flow%d.mpeg",getpid());
     1809
    18111810
    18121811    Trace("FLOW started\n");
     
    18551854    NanoVis::initParticle();
    18561855
    1857     // send the movie back to the client
    1858     // FIXME: find a way to get the data from the movie object as a char*
     1856    // FIXME: find a way to get the data from the movie object as a void*
    18591857    Rappture::Buffer data;
    18601858    data.load(fileName);
     
    18621860    sprintf(command,"nv>file -bytes %lu\n",data.size());
    18631861    NanoVis::sendDataToClient(command,data.bytes(),data.size());
     1862    if (remove(fileName) != 0) {
     1863        fprintf(stderr, "Error deleting flow movie file: %s\n", fileName);
     1864        fflush(stderr);
     1865    }
    18641866
    18651867    return TCL_OK;
     
    18771879    return TCL_OK;
    18781880}
    1879 
    18801881
    18811882static int
     
    19071908static int
    19081909FlowSlicePositionOp(ClientData cdata, Tcl_Interp *interp, int objc,
    1909                     Tcl_Obj *const *objv)
     1910                    Tcl_Obj *const *objv)
    19101911{
    19111912    int axis;
     
    19551956
    19561957    proc = Rappture::GetOpFromObj(interp, nFlowSliceOps, flowSliceOps,
    1957         Rappture::CMDSPEC_ARG2, objc, objv, 0);
     1958        Rappture::CMDSPEC_ARG2, objc, objv, 0);
    19581959    if (proc == NULL) {
    19591960        return TCL_ERROR;
     
    20682069
    20692070static Rappture::CmdSpec flowOps[] = {
    2070     {"capture",   1, FlowCaptureOp,       4, 4, "frames filename",},
     2071    {"capture",   1, FlowCaptureOp,       3, 3, "frames",},
    20712072    {"data",      1, FlowDataOp,          3, 0, "oper ?args?",},
    20722073    {"lic",       1, FlowLicOp,           3, 3, "on|off",},
Note: See TracChangeset for help on using the changeset viewer.