I want to add a linuxcnc gcode preview to my C++ Qt application.
> Does the QT / C++ combination mean that you can't use Gremlin?
> http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Gremlin
>
You can embed Gremlin, a snippet

void qtCNC::setupGremlin()
{
int retval;
WId id = 0;

     // needed for Gremlin, hardcoded for now
     setenv("INI_FILE_NAME", "~/emc2/configs/qtvcp/axis_mm_test.ini", 1);

     pid_t pID = vfork();
     if (pID == 0)                // child
         {
         retval = execlp("gremlin", "gremlin", (char *) 0);
         if(retval == -1)
             {
             qDebug() << "execlp failed";
             exit(1);
             }
         else
             {
             qDebug() << "Fork succeeded";
             exit(0);
             }
         }
     else if (pID < 0)            // failed to fork
         {
         qDebug() << "Failed to fork";
         exit(1);
         }
     else    // parent executes this code
         {
         // wait until window created
         while(id == 0)
             {
             usleep(5000);
             id = QxtWindowSystem::findWindow("gremlin");
             }
         gremlinEmbedWidget  = new QX11EmbedContainer(tabPlot);
         gremlinEmbedWidget->embedClient(id);
         gremlinEmbedWidget->setGeometry(0,0,tabPlot->width() - 
1,tabPlot->height() - 1);
         gremlinEmbedWidget->show();
         }

}


However I am going to look at Tatlin now:-D

regards

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to