×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Issue in logfilepositionsource example

    Hello friends,
    I am making an GPS example with the help of logfilepositionsource on WinCE platform. But I am not understanding the below code.
    Code:
    logFile->setFileName(QCoreApplication::applicationDirPath()
                + QDir::separator() + "simplelog.txt");
        if (!logFile->open(QIODevice::ReadOnly))
            qWarning() << "Error: cannot open source file" << logFile->fileName();
    Due to this code my signal is not getting generated at the below code.
    Code:
       LogFilePositionSource *source = new LogFilePositionSource(this);
        connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
                this, SLOT(positionUpdated(QGeoPositionInfo)));
    simplelog.txt file is already having some data & if we add this file then it shows that much data only which I have tested on Symbian platform.

    I want live latitude & longitude should be displayed on the screen. But It is not showing me any data on the screen as message
    Error: cannot open source file
    is coming on screen.
    I have made the changes in the self generated .pro file for simpleLog.txt which are as below
    Code:
    LatLong.path = $$DESTDIR
    LatLong.files = simplelog.txt
    LatLong.CONFIG = no_link no_dependencies explicit_dependencies no_build combine ignore_no_exist no_clean
    INSTALLS += LatLong
    build_pass:ALL_DEPS+=install_LatLong
    It is not getting reflected even though I run qmake & nmake commands.

    If anybody has any idea then please let tell me, Is there any other way than this?
    I don't want to use simplelog.txt file in my application. How to remove this
    Code:
    logFile->setFileName(QCoreApplication::applicationDirPath()
                + QDir::separator() + "simplelog.txt");
        if (!logFile->open(QIODevice::ReadOnly))
            qWarning() << "Error: cannot open source file" << logFile->fileName();
    & generate the signal so that I can get the latitude & longitude.

    If anybody know about this please tell me....

    Thanks in advance.

    Regards,
    ash_21.
    Life is Short..... Live it with Positive Attitude...

  2. #2
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: Issue in logfilepositionsource example

    That's been fixed in the git repository.

    Just change logfilepositionsource.pro so that this
    Code:
    symbian: {
        addFiles.sources = simplelog.txt
        DEPLOYMENT += addFiles
    
        TARGET.CAPABILITY = Location    
    } else {
    becomes
    Code:
    symbian|wince*: {
        symbian: {
            addFiles.sources = simplelog.txt
            DEPLOYMENT += addFiles
        
            TARGET.CAPABILITY = Location
        }
        wince*: {
            addFiles.sources = ./simplelog.txt
            addFiles.path = .
            DEPLOYMENT += addFiles
        }
    } else {
    Just in case you're wondering what was going wrong, the qmake manual has a section on the DEPLOYMENT variable which will probably clear things up a bit.

    Cheers

    Dave

  3. #3
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Quote Originally Posted by dalaing View Post
    That's been fixed in the git repository.

    Just change logfilepositionsource.pro so that this
    Code:
    symbian: {
        addFiles.sources = simplelog.txt
        DEPLOYMENT += addFiles
    
        TARGET.CAPABILITY = Location    
    } else {
    becomes
    Code:
    symbian|wince*: {
        symbian: {
            addFiles.sources = simplelog.txt
            DEPLOYMENT += addFiles
        
            TARGET.CAPABILITY = Location
        }
        wince*: {
            addFiles.sources = ./simplelog.txt
            addFiles.path = .
            DEPLOYMENT += addFiles
        }
    } else {
    Just in case you're wondering what was going wrong, the qmake manual has a section on the DEPLOYMENT variable which will probably clear things up a bit.

    Cheers

    Dave
    Thanks Dave for your valuable help.
    Please clarify my doubts:
    1) Will it show actual position once I deploy this example on Windows CE GPS enabled device? I don't want to show values which are stored at that file.
    2) I want to show that positions on my UI also.
    3) I have created basic .pro file but it is not getting updated when I add any code & run qmake & nmake command.
    4) At the same time pri file is getting created, Can I update that file so that it will reflect the changes made by me in my project.
    5) I am doing totally different program with the help of logfilepositionresource example..

    Kindly give me some advice so that I can make proper changes & run that application..

    Regards,
    ash_21.
    Life is Short..... Live it with Positive Attitude...

  4. #4
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Hi Dave,
    I did the way you suggested me & I run my test application successfully for GPS.
    Currently I am getting only values from simplelog.txt file. Can you please tell me that Can I get actual position on GPS enabled device with this code?
    Is actual position get appended to the file?
    or Is there any other way from that we can get actual GPS location?

    Kindly please advise me so that I can modify my code...

    Regards,
    ash_21.
    Life is Short..... Live it with Positive Attitude...

  5. #5
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Hi Dave,
    I have tested that application on my device but it is showing me only values from that text file (simplelog.txt). It is not getting updated with real values.
    Kindly please tell me modifications so that I will make necessary changes & check the real values on my WinCE device.
    I did not understand the meaning of this code
    Code:
    void LogFilePositionSource::requestUpdate(int timeout)
    {
        // For simplicity, ignore timeout - assume that if data is not available
        // now, no data will be added to the file later
        if (logFile->canReadLine())
            readNextPosition();
        else
            emit requestTimeout();
    }
    In Bold, you have just ignored the real data which will not get added to the file.
    So Where can I make changes so that I can get the actual gps values?
    Also you have mentioned in the LogFilePositionSource constructor that
    Code:
    if (!logFile->open(QIODevice::ReadOnly))
    is not open it will not work & it will display error message.

    Please tell me the way so that I can get the actual gps locations..

    I will wait for your positive reply..

    Regards,
    ash_21.
    Life is Short..... Live it with Positive Attitude...

  6. #6
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: Issue in logfilepositionsource example

    Hi,

    Your pro file just needs
    Code:
        wince*: {
            addFiles.sources = ./simplelog.txt
            addFiles.path = .
            DEPLOYMENT += addFiles
        }
    in it rather than the other stuff.

    The QMake manual, including the section on the DEPLOYMENT variable would have helped you there.

    Have you read any of the documentation for the Location API? If there's a problem with the documentation that's something that should be fixed rather than dealt with on a case by case basis in forums

    Cheers,

    Dave

  7. #7
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Quote Originally Posted by dalaing View Post
    Hi,

    Your pro file just needs
    Code:
        wince*: {
            addFiles.sources = ./simplelog.txt
            addFiles.path = .
            DEPLOYMENT += addFiles
        }
    in it rather than the other stuff.

    The QMake manual, including the section on the DEPLOYMENT variable would have helped you there.

    Have you read any of the documentation for the Location API? If there's a problem with the documentation that's something that should be fixed rather than dealt with on a case by case basis in forums

    Cheers,

    Dave
    Hi Dave,
    As per your suggestion I re-read the documentation of the location API. I have also added the simplelog.txt file in my .pro file. I am confused in the following code.
    Code:
    logFile->setFileName(QCoreApplication::applicationDirPath()
                + QDir::separator() + "simplelog.txt");
        if (!logFile->open(QIODevice::ReadOnly))
            qWarning() << "Error: cannot open source file" << logFile->fileName();
    Here you have just opened file in ReadOnly format. How can we add real device data to this file?
    Also I have confusion on the following code.
    Code:
    void LogFilePositionSource::requestUpdate(int /*timeout*/)
    {
        // For simplicity, ignore timeout - assume that if data is not available
        // now, no data will be added to the file later
        if (logFile->canReadLine())
            readNextPosition();
        else
            emit requestTimeout();
    }
    In bold line you have mention that.... Data will not get added to the file...

    Current application is properly showing me data (which present in that file) on my screen. It is not showing me any real value at all.

    In Location API documentation also you have mentioned the same thing..
    Please tell me where I am going wrong (where to make changes) so that I can do the proper changes & execute my application..

    Should I have to use NMEA class to get actual GPS data?

    I hope you understand my doubt.

    I will wait for your reply..

    Regards,
    ash_21.
    Life is Short..... Live it with Positive Attitude...

  8. #8
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: Issue in logfilepositionsource example

    The current documentation is here, although it hasn't changed much (if at all) from the tech previews to the beta.

    I believe that the very first section after the overview has the answers you are after.

    At present I am finding it difficult to believe that you've read the Location API documentation, and if you haven't read it then any help I give will be a waste of both of our time (assuming the documentation communicates things much more efficiently than I would in a forum reply )

    Cheers,

    Dave

  9. #9
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Quote Originally Posted by dalaing View Post
    The current documentation is here, although it hasn't changed much (if at all) from the tech previews to the beta.

    I believe that the very first section after the overview has the answers you are after.

    At present I am finding it difficult to believe that you've read the Location API documentation, and if you haven't read it then any help I give will be a waste of both of our time (assuming the documentation communicates things much more efficiently than I would in a forum reply )

    Cheers,

    Dave
    Hi Dave,
    Thanks for the new documentation. You are correct after the overview section they have mentioned the ways.
    I have thoroughly read those points & same way I am implementing my test application.
    There, they have mentioned that
    HTML Code:
    The LogFilePositionSource class in examples/logfilepositionsource  shows how to subclass QGeoPositionInfoSource  to create a custom location data source.
    This example class reads location data from a text file, log.txt. The file specifies location data using a simple text format: it contains one location update per line, where each line contains a date/time, a latitude and a longitude, separated by spaces. The date/time is in ISO 8601 format and the latitude and longitude are in degrees decimal format. Here is an excerpt from log.txt:
    
            2009-08-24T22:25:01 -27.576082 153.092415
            2009-08-24T22:25:02 -27.576223 153.092530
            2009-08-24T22:25:03 -27.576364 153.092648
    I have implemented the same way they have discussed in the documentation.
    Again I am saying that I got the result by your suggestion from your previous posts by updating the .pro file.

    I have checked twice or thrice but did not get any success.

    I am extremely sorry if I am doing anything wrong.

    My query is that, Will that log file get appended with the real GPS value if I uncomment "timeout" from requestUpdate() function?

    I will also try the other examples you have given in the new help url.

    Please suggest me so that I can check it.
    Life is Short..... Live it with Positive Attitude...

  10. #10
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: Issue in logfilepositionsource example

    Have you read the section "Requesting location data from data sources"? That's the section that details how to read data from the device - I'd suggest reading the documentation a little more thoroughly if you missed that section. I won't respond to anything else in this thread which is covered in the documentation.

    You're probably not going to get anywhere working from logfilepositionsource, so it really comes down to reading and understanding the documentation.

    Cheers,

    Dave

  11. #11
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Quote Originally Posted by dalaing View Post
    Have you read the section "Requesting location data from data sources"? That's the section that details how to read data from the device - I'd suggest reading the documentation a little more thoroughly if you missed that section. I won't respond to anything else in this thread which is covered in the documentation.

    You're probably not going to get anywhere working from logfilepositionsource, so it really comes down to reading and understanding the documentation.

    Cheers,

    Dave
    Ok,
    Thanks Dave for your valuable help...
    You should give actual data rather than copying it in a file & showing it by just opening a file & putting it in a ReadOnly mode.
    Life is Short..... Live it with Positive Attitude...

  12. #12
    Regular Contributor
    Join Date
    May 2007
    Posts
    320

    Re: Issue in logfilepositionsource example

    Quote Originally Posted by ash_21 View Post
    Hi Dave,
    Thanks for the new documentation. You are correct after the overview section they have mentioned the ways.
    I have thoroughly read those points & same way I am implementing my test application.
    There, they have mentioned that
    HTML Code:
    The LogFilePositionSource class in examples/logfilepositionsource  shows how to subclass QGeoPositionInfoSource  to create a custom location data source.
    This example class reads location data from a text file, log.txt. The file specifies location data using a simple text format: it contains one location update per line, where each line contains a date/time, a latitude and a longitude, separated by spaces. The date/time is in ISO 8601 format and the latitude and longitude are in degrees decimal format. Here is an excerpt from log.txt:
    
            2009-08-24T22:25:01 -27.576082 153.092415
            2009-08-24T22:25:02 -27.576223 153.092530
            2009-08-24T22:25:03 -27.576364 153.092648
    I have implemented the same way they have discussed in the documentation.
    Again I am saying that I got the result by your suggestion from your previous posts by updating the .pro file.

    I have checked twice or thrice but did not get any success.

    I am extremely sorry if I am doing anything wrong.

    My query is that, Will that log file get appended with the real GPS value if I uncomment "timeout" from requestUpdate() function?

    I will also try the other examples you have given in the new help url.

    Please suggest me so that I can check it.

    Hi Dave,
    I have done the GPS application in Qt for Windows Mobile. I got the values long back when I tasted that application but for your information I am sending this.

    Regards,
    ash_21.
    Life is Short..... Live it with Positive Attitude...

Similar Threads

  1. OVI Publishing Issue - POINT OF CONTACT
    By Vignesh.M in forum [Closed] Publishing to Nokia Store
    Replies: 4
    Last Post: 2009-08-18, 14:35
  2. issue with at+cusd over bluetooth link
    By hbanks in forum General Messaging
    Replies: 2
    Last Post: 2007-09-25, 21:21
  3. RTSP video streaming issue on 6280
    By olivier_irac in forum General Development Questions
    Replies: 0
    Last Post: 2006-12-04, 15:11
  4. Security code issue for 6230
    By kababoom in forum General Development Questions
    Replies: 1
    Last Post: 2004-08-19, 05:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×