These is the correct conversion .... position is in double format ... so
the conversion is these.

                 Xd = emcStatus->motion.traj.position.tran.x;
                 Yd = emcStatus->motion.traj.position.tran.y ;
                 Zd = emcStatus->motion.traj.position.tran.z ;
                 X =QString::number(Xd);
                 Y =QString::number(Yd);
                 Z =QString::number(Zd);


but unfortunately the error persist ...

Il giorno lun 3 dic 2018 alle ore 13:52 theman whosoldtheworld <
bleachk...@gmail.com> ha scritto:

> @franks  thanks .... never understand that I must insert in my config
> folder (or absolute path file) with emc.nml file ..... so actually as test
> pourpose I've insert in my c++ app an adbolute path like these:
>
> RCS_STAT_CHANNEL *stat = new  RCS_STAT_CHANNEL(emcFormat, "emcStatus",
> "xemc", "/home/mypc/linuxcnc-dev/configs/sim/axis/emc.nml");
>
> now nothing about error in compiling time .... the app start ... but i've
> an error in these point of code:
>
> RCS_STAT_CHANNEL *stat = new  RCS_STAT_CHANNEL(emcFormat, "emcStatus",
> "xemc", "/home/mypc/linuxcnc-dev/configs/sim/axis/emc.nml");
>
>
>              if((stat->peek() == EMC_STAT_TYPE) || (stat->valid())) /*
> error ... these condition never valid */
>              {
>                  corri = false;
>                  corriPlus = false;
>                  sendPosition(Error, Error, Error);
>
>                  qDebug() << " errore EMC_STAT_TYPE ......   ";
>              }
>              else
>              {
>                  EMC_STAT *emcStatus =
> static_cast<EMC_STAT*>(stat->get_address());
>
>                  /*std::cout << emcStatus->motion.traj.position.tran.x <<
> " "
>                                  << emcStatus->motion.traj.position.tran.y
> << " "
>                                  << emcStatus->motion.traj.position.tran.z
> << "\n";*/
>
>                  X =
> QString(QChar::fromLatin1(emcStatus->motion.traj.position.tran.x ));
> /***********  these conversion is really wrong ****************/
>                  Y =
> QString(QChar::fromLatin1(emcStatus->motion.traj.position.tran.y )) ;
> /***********  these conversion is really wrong ****************/
>                  Z =
> QString(QChar::fromLatin1(emcStatus->motion.traj.position.tran.z )) ;
> /***********  these conversion is really wrong ****************/
>
>
>                  qDebug() << " position x:   " <<  X ;
>                  qDebug() << " position y:   " <<  Y;
>                  qDebug() << " position z:   " <<  Z;
>
>                  emit sendPosition(X, Y ,Z);
>
>    }
>
> stat is never valid or == to EMC_STAT_TYPE ... but is possible to have my
> emcStatus->motion.traj.position.tran.x,
> emcStatus->motion.traj.position.tran.y,
> emcStatus->motion.traj.position.tran.z  HEUREKA!!
>
> actually I not know why I have these situation ... I've used your emc.nml
> file .... without hidcomp and keystick part.
>
> bkt
>
> Il giorno ven 30 nov 2018 alle ore 23:17 Frank Tkalcevic <
> fr...@franksworkshop.com.au> ha scritto:
>
>> This is what I use on mine...
>>
>> https://github.com/ftkalcevic/CNCConfig/blob/master/9x20lathe/emc.nml
>>
>> I've added entries for my own process, hidcomp.  The linuxcnc I'm running
>> is a bit old, so I don't know if the buffer sizes are correct.
>>
>>
>>
>>
>> -----Original Message-----
>> From: theman whosoldtheworld [mailto:bleachk...@gmail.com]
>> Sent: Friday, 30 November 2018 11:34 PM
>> To: Enhanced Machine Controller (EMC)
>> Cc: EMC developers
>> Subject: Re: [Emc-developers] [Emc-users] [EMC] NML_FILE = emc.nml
>>
>> no solution for these ... if I try to insert the row obtain an error
>> relative to "impossible establish nml connection" (more or less these is
>> the messages that appear on terminal) if not insert these row if I try to
>> ruan a c++ program like these:
>>
>> void qtdro::dro()
>> {
>>    // const QStringList args = QCoreApplication::arguments();
>>         const QStringList args = QApplication::arguments();
>>
>>
>>         if(args.isEmpty() || (args.size() < 1))
>>         {
>>             /*std::cerr << "Usage: " << argv[0] << " NMLFILE\n";*/
>>             qDebug() << "NMLFILE is not open yet";
>>             qDebug() << "args is open? ...." << args.isEmpty();
>>             qDebug() << "args.size? ....... " << args.size();
>>             qDebug() << "args.[0] contains? ....... " << args[0];
>>         }
>>         else
>>         {
>>             qDebug() << "args is open? ...." << args.isEmpty();
>>             qDebug() << "args.size? ....... " << args.size();
>>             qDebug() << "args.[0] contains? ....... " << args[0];
>>             qDebug() << "args.[0] contains? ....... " << args[1];
>>
>>             QString s0 = args[0];
>>             QString s1 = args[1];
>>             QString s2 =
>> "/home/mypc/linuxcnc-dev/configs/sim/axis/axis.ini";
>>
>>            const char *nmlfile = s2.toStdString().c_str();
>>            qDebug() << "consta chars c2 contains? ....... " <<
>> s2.toStdString().c_str();
>>            qDebug() << "consta chars c2 contains? ....... " << *c2;
>>             //RCS_STAT_CHANNEL *stat = new  RCS_STAT_CHANNEL(emcFormat,
>> "emcStatus", "xemc", nmlfile);
>>            RCS_STAT_CHANNEL *stat = new  RCS_STAT_CHANNEL(emcFormat,
>> "emcStatus", "xemc", "/home/mypc/linuxcnc-dev/configs/sim/axis/axis.ini");
>>
>> I've a return messages like these:
>>
>> libnml/cms/cms_cfg.cc 496: No buffer-line entry found for buffer emcStatus
>> in config file /home/mypc/linuxcnc-dev/configs/sim/axis/axis.ini.
>> libnml/nml/nml.cc 370: NML: cms_config returned -1.
>>
>> **********************************************************
>> * Current Directory = /home/mypc/linuxcnc-dev/scripts
>> *
>> **********************************************************
>> * BufferName = emcStatus
>> * ProcessName = xemc
>> * Config File = /home/mypc/linuxcnc-dev/configs/sim/axis/axis.ini
>> * error_type = 0 (NML_NO_ERROR)
>> ************************************************************
>>
>> libnml/nml/nml.cc 1343: NML::peek: CMS not configured.
>>
>> So my original question (make some time and post ago)  is: But in SIM only
>> installa (no preempt), NML server is running??
>>
>> sob ... I know my english is quite bad ... I hope was all clear ..
>>
>> bkt
>>
>>
>>
>> Il giorno mer 28 nov 2018 alle ore 15:33 andy pugh <bodge...@gmail.com>
>> ha
>> scritto:
>>
>> > On Wed, 28 Nov 2018 at 10:26, theman whosoldtheworld <
>> bleachk...@gmail.com
>> > >
>> > wrote:
>> >
>> > > [EMC] NML_FILE = emc.nml
>> > >
>> > > these row in file.ini is still valid?
>> >
>> >
>> > Some sections of code still look for it:
>> >
>> > https://github.com/LinuxCNC/linuxcnc/search?l=C%2B%2B&q=NML_FILE
>> >
>> > No version of the docs (back to 2.2 at least) has ever mentioned that
>> > entry.
>> > I think it must be the case that the default value is OK.
>> >
>> > --
>> > atp
>> > "A motorcycle is a bicycle with a pandemonium attachment and is designed
>> > for the especial use of mechanical geniuses, daredevils and lunatics."
>> > � George Fitch, Atlanta Constitution Newspaper, 1916
>> >
>> > _______________________________________________
>> > Emc-users mailing list
>> > emc-us...@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/emc-users
>> >
>>
>> _______________________________________________
>> Emc-developers mailing list
>> Emc-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
>>
>>
>> _______________________________________________
>> Emc-developers mailing list
>> Emc-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
>

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to