Page 2 of 2 FirstFirst 12
Results 21 to 32 of 32

Thread: Parallel Interface

  1. #21
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    high_flyer

    int pin_init_kernel(int lpt,
    void (*irq_func)(int, void *, struct pt_regs *));
    void pin_release();

    All this stuff, especially "pin_init_kernel" is contend of "kparapin" and "parapindriver",
    which i successfully compiled and "moddprobe" inserted seperately before.

    All this is running. I can open the device, setting and clear all pins.
    In a command line application and in ksimus i can even close it without any trouble.

    Everything is nice except the close(device) command in a primitiv kde application
    i tried to build.
    Just this my problem.

    cheers wally

  2. #22
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Parallel Interface

    hmm...
    did you check the standard error after open()?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #23
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    i just put a Messagebox behind the critical close(device) instruction
    and achieved a nice crash with backtrace-log.
    Maybe this could clear the situation:

    int kparappWidget::pushButtonClose_clicked()
    {
    close(pardevice);
    QMessageBox::about(this, tr("About Application"),
    tr("The <b>Application</b> example demonstrates how to "
    "write modern GUI applications using Qt, with a menu bar, "
    "toolbars, and a status bar."));

    return 0;
    }

    Backtrace log after crash:

    System configuration startup check disabled.

    Using host libthread_db library "/lib/libthread_db.so.1".
    [Thread debugging using libthread_db enabled]
    [New Thread 0xb6cf36d0 (LWP 21378)]
    [KCrash handler]
    #9 0xb6e21228 in main_arena () from /lib/libc.so.6
    #10 0xb7461440 in QObject::QObject () from /usr/lib/qt3/lib/libqt-mt.so.3
    #11 0xb749741d in QWidget::QWidget () from /usr/lib/qt3/lib/libqt-mt.so.3
    #12 0xb75e7852 in QDialog::QDialog () from /usr/lib/qt3/lib/libqt-mt.so.3
    #13 0xb7612c70 in QMessageBox::QMessageBox ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #14 0xb7612d59 in QMessageBox::about () from /usr/lib/qt3/lib/libqt-mt.so.3
    #15 0x0804ec16 in kparappWidget::pushButtonClose_clicked (this=0x80eb560)
    at /home/op/sda-2/Programming/kdevelop-work/kparapp/src/kparappwidget.cpp:82
    #16 0x0804f23a in kparappWidgetBase::qt_invoke (this=0x80eb560, _id=48,
    _o=0xbfc780a8) at ./src/kparappwidgetbase.moc:104
    #17 0x0804e999 in kparappWidget::qt_invoke (this=0x80eb560, _id=48,
    _o=0xbfc780a8) at ./src/kparappwidget.moc:108
    #18 0xb7460f1d in QObject::activate_signal ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #19 0xb7461b5d in QObject::activate_signal ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #20 0xb77a3b5c in QButton::clicked () from /usr/lib/qt3/lib/libqt-mt.so.3
    #21 0xb74f4bfd in QButton::mouseReleaseEvent ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #22 0xb7499880 in QWidget::event () from /usr/lib/qt3/lib/libqt-mt.so.3
    #23 0xb74019c7 in QApplication::internalNotify ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #24 0xb7402909 in QApplication::notify () from /usr/lib/qt3/lib/libqt-mt.so.3
    #25 0xb7b7dd32 in KApplication::notify () from /opt/kde3/lib/libkdecore.so.4
    #26 0xb73a0f57 in QETWidget::translateMouseEvent ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #27 0xb73a00ff in QApplication::x11ProcessEvent ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #28 0xb73b098a in QEventLoop::processEvents ()
    from /usr/lib/qt3/lib/libqt-mt.so.3
    #29 0xb74187f0 in QEventLoop::enterLoop () from /usr/lib/qt3/lib/libqt-mt.so.3
    #30 0xb7418686 in QEventLoop::exec () from /usr/lib/qt3/lib/libqt-mt.so.3
    #31 0xb740157f in QApplication::exec () from /usr/lib/qt3/lib/libqt-mt.so.3
    #32 0x0804dec2 in main (argc=134547724, argv=0xb6e212e2)
    at /home/op/sda-2/Programming/kdevelop-work/kparapp/src/main.cpp:69


    cheers wally

  4. #24
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Parallel Interface

    Is this a Qt3 application?
    And is the message executed?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #25
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    Quote Originally Posted by high_flyer View Post
    hmm...
    did you check the standard error after open()?

    pardevice = open("/dev/ppdrv_device", O_RDWR);
    if (pardevice < 0) {
    fprintf(stderr, "pardevice open failed\n");
    return -1;
    }

    Yes, if there would be a problem, i would not be able to set and clear pins.
    At least i assume so.

    cheers wally

  6. #26
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    Quote Originally Posted by high_flyer View Post
    Is this a Qt3 application?
    And is the message executed?
    Its an qt3 application, because my environment is setu to
    manipulate the old ksimus code.

    The Messagbox does not appear!

    The optical effect is now, that the widgets do not disappear
    but the pushbutton which triggers the close(device) instruction
    remains pushed (do not come back, not released again).
    and the application is frozen.

  7. #27
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Parallel Interface

    what happens if you just comment the ioctl calls?
    (I know that the pin manipulation wont work)
    Does it crash then too?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #28
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    Quote Originally Posted by high_flyer View Post
    (I know that the pin manipulation wont work)


    Yes it crashes too!

    just the open (device ......... and the close( device .....

    its only the close instruction i guess.

    I will try to make a fresh new app for qt4 and see whats happens there.

  9. #29
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    high_flyer

    i posted a request to the parapin mailinglist during the last discussion:

    quote: wallyqt:

    Would be nice if somebody more experienced than me
    may help to clear some missunderstandings on parapin.
    discussion on QT-Centre:
    http://www.qtcentre.org/forum/f-qt-p...rface-594.html

    quote:parapin-users@lists.sourceforge.net :Al Houston:

    **Wally,
    ********I just read through your thread on Qt-Centre, it looks like you guys
    have it figured out correctly by the end of the thread. *The fact this
    is working as a console app, but not a Qt app, is important.

    ********I'm not a Qt programmer, but I have one question: Does Qt mess around
    with loading/unloading kernel modules under the hood at all? *If for
    some reason it forced an unload of kparapin or parport, you might get
    the crash you're seeing on close(). *Seems very unlikely to me, but I
    thought I'd mention it.

    ********I've just gone through the code again -- I can't see any reason why a
    gui layer like Qt would have any idea what's going on in a driver, or
    have any effect on it.

    ********This is a strange one... *I probably won't have time to look at this
    anymore for the next several days, at least. *Hopefully you guys will
    get it figured out by then.


    -Al

  10. #30
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    high_flyer

    i did the same stuff with qt4 and at least achieved an readable error:

    qtparapinwidgets.cpp:68: error: no matching function for call to ‘QtParapinWidgets::close(int&)’
    /usr/include/QtGui/qwidget.h:444: note: candidates are: bool QWidget::close()


    cheers wally

  11. #31
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Parallel Interface

    when i use the ::close for the general namespace i get the
    same crash as with Qt3 :(

    any ideas ?

    #include <fcntl.h> /* open, fcntl */
    #include <sys/ioctl.h> /* ioctl */
    #include <stdio.h> /* printf, getchar */
    #include <stdlib.h> /* exit */
    #include <parapindriver.h> /* parapindriver */
    #include <unistd.h> /* close, read, usleep */
    #include <iostream>

    void QtParapinWidgets::on_pushButtonClose_clicked()
    {
    qWarning("TODO: %s %d",__FILE__,__LINE__);

    if ( m_parapinloaded == true)
    {
    ::close(parapindevice);
    m_parapinloaded = false;
    // label->setText( "Device Closed" );
    }
    }


    wally
    }
    Last edited by wallyqt; 19th November 2007 at 12:53. Reason: disabled smilies

  12. #32
    Join Date
    Nov 2007
    Posts
    27
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Thumbs up Re: Parallel Interface

    Now it works fine! :)

    when i also use ::open to open the device
    i can ::close and all works as wanted.

    parapindevice = ::open("/dev/ppdrv_device", 0);

    cheers wally
    Last edited by wallyqt; 19th November 2007 at 12:51. Reason: disabled smilies

Similar Threads

  1. C++ Interface ..???
    By joseph in forum General Programming
    Replies: 3
    Last Post: 28th May 2008, 09:27
  2. Interface composition and QObject
    By brcain in forum Qt Programming
    Replies: 9
    Last Post: 20th November 2006, 17:56
  3. User Interface with QTableView
    By Brandybuck in forum Qt Programming
    Replies: 1
    Last Post: 22nd March 2006, 23:24
  4. Qt interface running extremely slowly...
    By jazztpt in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2006, 11:12

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.