Results 1 to 2 of 2

Thread: Problem with visualizing process data on BananaPI

  1. #1
    Join Date
    May 2015
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Problem with visualizing process data on BananaPI

    Hello!

    My visualization will show booking status of seats in the bus. You can see whole bus with seats which should change colours and also numbers of free/ busy seats below the main picture. For example: at first there are 42 free green seats so we can see text: "42 free"; "0 busy". Let's say 2 people will sit on two seats. Main pic will change: there will be 40 seats green and 2 red one. Same with the text below: "40 free" and "2 busy".

    I managed to synchronize signals from module box (CAN bus line) to BananaPi using TI SN65HVD230D transceiver. I got information from each ID seat section per one frame (seats 1-32 , 33-64 and status of each seat - free, taken, error and not available). I attach receive.c file (http://svn.code.sf.net/p/can4linux/c...ples/receive.c) which I'm using to check the frames (in Terminal typing ./receive -t3 -H).

    First I thought about writing a timer which will collect the data from receive.c. each 1s - I wonder how exactly I should declare data to be seen in Qt in my QTimer.
    After I done that I thought to visualize state of seats - I think I should use slots and signals of each seat depending of its state (for free seat - graphic with green seat, and for taken/busy one - a red graphic seat). Is this a good idea?

    Thank you in advance for each tip

    Example of frames:

    0.167986 938/0x000003aa : bD ( 8 ): 00 fc ff ff ff ff ff 3f - noone is sitting
    0.167963 938/0x000003aa : bD ( 8 ): 01 fc ff ff ff ff ff 3f - seat no 1 is taken/ busy
    0.167972 938/0x000003aa : bD ( 8 ): 04 fc ff ff ff ff ff 3f - seat no 2 is taken/ busy
    0.167973 938/0x000003aa : bD ( 8 ): 10 00 fc ff ff ff ff 3f - seat no 3 is taken/busy
    0.167973 938/0x000003aa : bD ( 8 ): 40 00 fc ff ff ff ff 3f - seat no 4 is taken/busy
    0.167981 938/0x000003aa : bD ( 8 ): 00 01 fc ff ff ff ff 3f - seat no 5 is taken/busy
    0.168021 938/0x000003aa : bD ( 8 ): 00 04 fc ff ff ff ff 3f - seat no 6 is taken/busy
    0.167986 938/0x000003aa : bD ( 8 ): 00 10 fc ff ff ff ff 3f - seat no 7 is taken/busy
    0.167988 938/0x000003aa : bD ( 8 ): 00 40 fc ff ff ff ff 3f - seat no 8 is taken/busy
    0.168017 938/0x000003aa : bD ( 8 ): 00 00 fd ff ff ff ff 3f - seat no 9 is taken/busy

    0.168023 938/0x000003aa : bD ( 8 ): 00 00 fc ff ff ff ff 7f - seat no 32 is taken/busy
    0.167001 939/0x000003ab : bD ( 8 ): ff ff ff ff ff fc ff ff - seat no 53 is free
    0.167023 939/0x000003ab : bD ( 8 ): ff ff ff ff ff fd ff ff - seat no 53 is taken/busy

    0.167992 938/0x000003aa : bD ( 8 ): 00 01 fc ff ff ff ff 7f - seat no 5 & 32 are taken/ busy
    0.167986 938/0x000003aa : bD ( 8 ): 05 00 fc ff ff ff ff 3f - seat no 1 & 2 are taken/ busy
    0.167965 938/0x000003aa : bD ( 8 ): 40 01 fc ff ff ff ff 3f - seat no 4 & 5 are taken/ busy

    0.167971 938/0x000003aa : bD ( 8 ): 50 01 fc ff ff ff ff 3f - seat no 3, 4 and 5 are taken/busy

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with visualizing process data on BananaPI

    If you are going to use the command line utility to receive data from the sensors then you should start it with QProcess and react when dataReady() Is signalled. Read the available data on to the end of a QByteArray buffer and then, for each full line in tHe buffer, parse the line, update your GUI, and remove the line from the buffer. In this approach the Qt program does not poll for data, it just waits to receive it.

    If you are going to build the receiving code into your program then a different approach will be required.

Similar Threads

  1. Send data to parent process in Qt
    By PstdEr in forum Newbie
    Replies: 1
    Last Post: 20th April 2013, 16:12
  2. Process the display data before displaying in QTreeView
    By babu198649 in forum Qt Programming
    Replies: 5
    Last Post: 23rd June 2009, 05:21
  3. Replies: 2
    Last Post: 12th September 2007, 07:36
  4. Replies: 14
    Last Post: 27th November 2006, 05:09
  5. a question about visualizing cursor in read-only QTextEdit
    By kennyxing in forum Qt Programming
    Replies: 3
    Last Post: 17th September 2006, 19:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.