Skip to content

Porting to QT6 #4

Description

@colorcube

I wanted to test the program. Luckily I managed to compile it with QT6.

It starts but loading a hpgl file causes a crash with SIGABRT.

It would be nice to provide a bit more information about the program and what it can do. At least a screenshot would be nice.
That's the way it looks for me:
Bildschirmfoto_20250114_163242

Activity

  1. colorcube commented on Jan 14, 2025

    @colorcube
    Author

    I had no idea what I'm doing. Nevertheless here's the diff:

    localplot-qt6.diff.txt

  2. colorcube commented on Jan 14, 2025

    @colorcube
    Author

    Console output is

    QSettings: initializing.
    QSettings: setting org properties.
    "[16:31 39.176]" "Inkscape not found on system."
    "[16:31 39.176]" "Python not found on system."
    hpgl_output.py test:  -1
    "[16:31 39.176]" "hpgl_output.py not found on system."
    dxf_input.py test:  -1
    "[16:31 39.176]" "dxf_input.py not found on system."
    Device width in inches.
    "[16:31 39.186]" "Scene scale set to 1:1"
    

    No idea why python and inkscape stuff wasn't found. It's all there.

  3. ctag commented on Jan 14, 2025

    @ctag
    Collaborator

    Thanks for opening the issue.

    That screenshot is more or less the correct UI, it was never very polished.

    When I get some time I'll try to build with QT6 and see if I can get the same errors. Can you share what operating system you're using?

  4. colorcube commented on Jan 14, 2025

    @colorcube
    Author

    Thanks for the quick reply

    Linux
    Ubuntu 24.04
    more specific: Tuxedo OS 24.04 which has KDE Neon packages with Qt 6.8.1

    What is a good location to discuss general topics about the app?
    Maybe add discussions to this repo?

  5. colorcube commented on Jan 14, 2025

    @colorcube
    Author

    The crash occurs when mutexUnlock() is called:

    void MainWindow::newFileToScene(
    ...
        hpglModel->mutexUnlock();
    
        handle_plotSceneSelectionChanged();
        sceneConstrainItems();
    }

    hope this helps a bit

  6. ctag commented on Jan 14, 2025

    @ctag
    Collaborator

    Thanks for the information. It should be finding those binaries correctly under Linux. Can you share the paths? (which {inkscape,python})

    If it works OK for you I'd prefer to stay in github issues. There's not a lot of activity for this repo to add another tab for discussions.

  7. colorcube commented on Jan 14, 2025

    @colorcube
    Author
    $ which inkscape
    /usr/bin/inkscape
    
    $ which python
    $ which python3
    /usr/bin/python3
    
    $ ls /usr/share/inkscape/extensions/hpgl_output.py
    /usr/share/inkscape/extensions/hpgl_output.py
    
    $ ls /usr/share/inkscape/extensions/dxf_input.py
    /usr/share/inkscape/extensions/dxf_input.py

    python is python3 - I changed that in the source code

  8. colorcube commented on Jan 15, 2025

    @colorcube
    Author

    While I can't load files I tried the "Jog Perimeter" function.

    I get following error:

    bool QSerialPort::flush(): device not open
    "[12:40 43.179]" "Serial port didn't open? :'("
    

    Talking to the plotter using tio works. I guess my compile/port is broken. I know very little about c++/qt.

    I was wondering how "Jog Perimeter" works. Expected to find an "OH;" command which returns the hard clipping area from the plotter. But that's not the case as far I can tell.
    Maybe I misunderstand the function. I expect the plotter hard clipping area will be shown in the plotting window so I can arrange a plot file in that area.

  9. ctag commented on Jan 15, 2025

    @ctag
    Collaborator

    Jog perimeter will move the plotter to show the bounding area of the loaded graphic. Helps to make sure you have the scale correct.

    Plotter size is set manually in Settings -> Cutter.

    It's been just about a decade since I've worked on this, but what I recall is that the UScutters do not implement very much of HPGL, and the commands that do give answer back - such as plot speed - are wrong.

    What serial port is your plotter showing up as? And is it set in Settings -> Serial?

  10. ctag commented on Jan 15, 2025

    @ctag
    Collaborator

    From your diff file, I'd appreciate a pull request with your notes on installation.
    I am still trying to understand the header changes it made, was that automated or you working to get compiling to succeed?

    It looks like the master branch is too far behind to work with now, please try again on your side with the testing branch.

  11. colorcube commented on Jan 15, 2025

    @colorcube
    Author

    I see. The plotter you used use a roll of vinyl I assume, which is a slightly different workflow with paper sheets. The roll has "no end", paper has.

    I have a Mutoh XP-500 A0 pen plotter.
    The plotter automatically determine the paper size. With the OH command you can get the hard clipping area on that paper. The plotter set the origin (0,0) to the center of the plotting area.
    For example for A3 format the area is -7875,-5459,7875,5459.

    Most plotter set the origin (0,0) to the lower left corner as I know. That means setting the plotting windows with scaling is needed based on the hard clipping area.

    For me a good solution would be:

    • get paper size from plotter (hard clipping area)
    • show hard clipping area in the plotting window
    • load file and arrange that on the plotting window

    Although I can't test the program and I'm not 100% sure how it works, to me it seems that not many changes are needed to accomplish that?!

    I guess some "plotter type" settings might be good. I may need to learn c++ 😬

    Device is ttyUSB1
    I use /dev/ttyUSB1 with tio which works.

  12. colorcube commented on Jan 15, 2025

    @colorcube
    Author

    I am still trying to understand the header changes it made, was that automated or you working to get compiling to succeed?

    I made changes without really knowing what I do ;-)
    qtcreator suggested there were not needed imports ...

    It looks like the master branch is too far behind to work with now, please try again on your side with the testing branch.

    I'll try and report

  13. colorcube commented on Jan 15, 2025

    @colorcube
    Author

    testing branch compiles with qt6 when

    QFuture<void> tThread = QtConcurrent::run(this->hpglModel, &hpglListModel::duplicateSelectedRows);

    is changed to

    QFuture<void> tThread = QtConcurrent::run(&hpglListModel::duplicateSelectedRows, this->hpglModel);

    crash is the same.

    python and *py scripts are still not found, although I changed python2 to python3.

    "Jog Perimeter":

    bool QSerialPort::flush(): device not open
    "[15:49 10.641]" "Serial port didn't open? :'("
    
  14. colorcube commented on Jan 15, 2025

    @colorcube
    Author
  15. colorcube commented on Jan 15, 2025

    @colorcube
    Author

    The serial connection seems to work.

    I falsely assumed that ttyUSB0 in the device select box is enough, but /dev/ttyUSB0 needs to be in the input field below, which is filled when you change the select box. But it is initially empty.

  16. colorcube commented on Jan 15, 2025

    @colorcube
    Author

    I managed to fix the python path stuff using QFileInfo. I'm still learning and playing around. I'll send a pull request when I'm more confident I don't do stupid things.

    Still crash on hpgl file load. I don't think I could figure that out soon.

  17. ctag commented on Jan 16, 2025

    @ctag
    Collaborator

    I have a Mutoh XP-500 A0 pen plotter.

    OK, so there are two separate things going on here then. The first is that localplot was written on QT5 and doesn't support QT6 yet, and the second is that it only supports UScutter vinyl cutters because that's all we had to test on.

    If you are available to test changes, we can try and add support for your paper plotter to the program.

  18. colorcube commented on Jan 16, 2025

    @colorcube
    Author

    Yes, you're right.

    I made already some minor changes regarding my plotter. For learning c++/qt. I might be able to modify it, so it works for me. It could be used as an example what needs to be changed to support multiple plotters.

    Currently my main problem is the crash on file load. I don't have enough experience (yet) to debug that.

  19. ctag commented on Jan 18, 2025

    @ctag
    Collaborator

    OK, I've moved my setup to QT6, see the same QT:Concurrent compile error mutex unlock crash.

    Can you try opening the serial port again, but following these steps:

    1. Run socat PTY,link=/tmp/tty STDOUT and leave running in a shell.
    2. Open localplot and set the serial device in settings to /tmp/tty
    3. Use jog perimeter or run and see if HPGL is outputted to the socat shell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions