Display setup sheet

More
08 Apr 2020 20:05 #163232 by anfänger
Hello,

I use fusion for cad and cam and thought it would be useful to be able to show the setup sheets in probe basic. So I added a setup tab with a Webview widget.
I always rename the setup sheets like the nc-files (and hope fusion will do this automatically one day). now I only need to find a way to load the sheet together with the nc file.
For this I would need to read path and name, change the ending and parse this to the webview widget.
Or simply add a filechooser to the setup tab



Can anyone help me to make the changes?
I have never worked with python or qt.

Thanks Patrick

Please Log in or Create an account to join the conversation.

More
08 Apr 2020 22:51 #163250 by persei8
Replied by persei8 on topic Display setup sheet
What a good idea. I also use Fusion as well as Aspire and they both can make setup sheets. I generally just print it off. If you name the ngc and setup html files with the same basename, a python routine could just look for the html file whenever you load a gcode file. (I know, you said that - just pondering) I will think about implementing this in qtdragon.

Please Log in or Create an account to join the conversation.

More
09 Apr 2020 00:00 #163255 by KCJ
Replied by KCJ on topic Display setup sheet
Patrick, that is a fantastic idea!

I'll make an example showing how this type of addition can be done without having to modify any of the ProbeBasic code.

Cheers,
Kurt

Please Log in or Create an account to join the conversation.

More
09 Apr 2020 01:57 #163279 by KCJ
Replied by KCJ on topic Display setup sheet
Here is a quick and dirty example of how to add the setup sheet tab to ProbeBasic, without having to modify any if the PB source files.

  1. Place the attached custom_probebasic.py file in your config directory.
  2. Add a custom_config.yml file to the config directory with the following content:
    # use custom probe basic main window class
    windows:
      mainwindow:
        provider: custom_probebasic:CustomProbeBasic
  3. Specify the YAML file in the INI:
    [DISPLAY]
    DISPLAY = probe_basic
    CONFIG_FILE = custom_config.yml
    ...


Run LinuxCNC as usual. A new tab will be inserted in the main tab widget containing a QWebView for displaying the setup sheet. Each time a GCODE file is loaded it will look for an HTML file with the same name as the gcode file and display it in the webview.



Cheers,
Kurt
Attachments:
The following user(s) said Thank You: BigJohnT, tommylight, anfänger

Please Log in or Create an account to join the conversation.

More
09 Apr 2020 02:02 #163280 by Lcvette
Replied by Lcvette on topic Display setup sheet

Here is a quick and dirty example of how to add the setup sheet tab to ProbeBasic, without having to modify any if the PB source files.

  1. Place the attached custom_probebasic.py file in your config directory.
  2. Add a custom_config.yml file to the config directory with the following content:
    # use custom probe basic main window class
    windows:
      mainwindow:
        provider: custom_probebasic:CustomProbeBasic
  3. Specify the YAML file in the INI:
    [DISPLAY]
    DISPLAY = probe_basic
    CONFIG_FILE = custom_config.yml
    ...


Run LinuxCNC as usual. A new tab will be inserted in the main tab widget containing a QWebView for displaying the setup sheet. Each time a GCODE file is loaded it will look for an HTML file with the same name as the gcode file and display it in the webview.



Cheers,
Kurt


I actually made a set up sheet window in the file chooser tab already just for this but couldn't figure out the webview widget, hazzy can you set it up there? It's already formatted in probe basic for this purpose!

Chris
The following user(s) said Thank You: KCJ, anfänger

Please Log in or Create an account to join the conversation.

More
09 Apr 2020 02:04 #163281 by KCJ
Replied by KCJ on topic Display setup sheet
Hey Chris, absolutely! I did not know it was already there.

Please Log in or Create an account to join the conversation.

More
09 Apr 2020 04:28 #163297 by anfänger
Replied by anfänger on topic Display setup sheet
Thanks for all the help. I didn’t realise the setup tab yet. But I will have a look at it on the next release. Till then I will check out the custom yaml file.

Cheers Patrick

Please Log in or Create an account to join the conversation.

More
18 Aug 2024 11:39 #308059 by anfänger
Replied by anfänger on topic Display setup sheet
Short question, I updated all my machines now to 2.9.3 and moved my modifications to the user tabs.
I thought also adding the setup sheet to my lathe using probe_basic_lathe.
With the mill it is still working on the lathe i get following error:
Traceback (most recent call last):
File "/usr/bin/probe_basic_lathe", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3/dist-packages/probe_basic_lathe/__init__.py", line 19, in main
qtpyvcp.run_vcp(opts, VCP_CONFIG_FILE)
File "/usr/lib/python3/dist-packages/qtpyvcp/__init__.py", line 26, in run_vcp
run(*args, **kwargs)
File "/usr/lib/python3/dist-packages/qtpyvcp/app/__init__.py", line 129, in run
launch_application(opts, config)
File "/usr/lib/python3/dist-packages/qtpyvcp/app/launcher.py", line 78, in launch_application
loadWindows(config['windows'])
File "/usr/lib/python3/dist-packages/qtpyvcp/app/launcher.py", line 228, in loadWindows
window = _initialize_object_from_dict(window_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/qtpyvcp/app/launcher.py", line 208, in _initialize_object_from_dict
return obj(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/home/ditte/linuxcnc/configs/ditte/custom_probebasic.py", line 15, in __init__
super(CustomProbeBasic, self).__init__(*args, **kwargs)
File "/usr/lib/python3/dist-packages/probe_basic/probe_basic.py", line 47, in __init__
self.vtk.setViewMachine() # set view to machine at startup
^^^^^^^^
AttributeError: 'CustomProbeBasic' object has no attribute 'vtk'

Please Log in or Create an account to join the conversation.

More
25 Aug 2024 11:24 #308592 by Lcvette
Replied by Lcvette on topic Display setup sheet
check the custom config yaml file for the changes made. always compare your sim config files first that is 99% of the time where your error originates from. if the sim launches and runs without issue.

Please Log in or Create an account to join the conversation.

More
26 Aug 2024 08:17 #308678 by anfänger
Replied by anfänger on topic Display setup sheet
I solve the issue by making a custom tab and adapting the code snippets KCJ wrote four jears ago.
The following user(s) said Thank You: Lcvette

Please Log in or Create an account to join the conversation.

Moderators: KCJLcvette
Time to create page: 0.114 seconds
Powered by Kunena Forum