Preference File

More
11 Apr 2020 19:56 - 11 Apr 2020 19:59 #163650 by cmorley
Replied by cmorley on topic Preference File
You can use qtvcp's file dialog to just get the filename without loading the file by using a STATUS general message to call the dialog. In this way it manages size, placement extensions etc, but It wouldn't save the file name in the preference file or load the file into linuxcnc.

Chris
Last edit: 11 Apr 2020 19:59 by cmorley.

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

More
28 Apr 2020 02:06 #165890 by persei8
Replied by persei8 on topic Preference File
Obviously I wasn't subscribed to this topic since I just now saw your reply. Anyway, I currently have 2 buttons for loading files, one for gcode and one for html. They instantiate a QDialog and all works well. However, I will try the method you suggest and report back.
Jim

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

More
28 Apr 2020 02:34 #165892 by persei8
Replied by persei8 on topic Preference File
It does exactly what I am already doing but why does it report the contents of the dialog request 4 times? Can the filemanager widget be modified to not automatically load a selected file? This way, I could use it to just select a file and decide what to do with it based on the file extension.
[QTvcp.QTVCP.WIDGETS.DIALOG_WIDGET][DEBUG]  Saving FileDialog-geometry data from widget screen_options to file. (dialog_widget.py:141)
OK - file dialog
{'RETURN': u'/home/jim/linuxcnc/nc_files/Dragon.ngc', 'TITLE': 'Load a GCODE File', 'EXTENSIONS': 'NGC Files (*.ngc);;PY Files (*.py)', 'NAME': 'LOAD', 'ID': '_load_gcode_'}
{'RETURN': u'/home/jim/linuxcnc/nc_files/Dragon.ngc', 'TITLE': 'Load a GCODE File', 'EXTENSIONS': 'NGC Files (*.ngc);;PY Files (*.py)', 'NAME': 'LOAD', 'ID': '_load_gcode_'}
{'RETURN': u'/home/jim/linuxcnc/nc_files/Dragon.ngc', 'TITLE': 'Load a GCODE File', 'EXTENSIONS': 'NGC Files (*.ngc);;PY Files (*.py)', 'NAME': 'LOAD', 'ID': '_load_gcode_'}
{'RETURN': u'/home/jim/linuxcnc/nc_files/Dragon.ngc', 'TITLE': 'Load a GCODE File', 'EXTENSIONS': 'NGC Files (*.ngc);;PY Files (*.py)', 'NAME': 'LOAD', 'ID': '_load_gcode_'}

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

More
28 Apr 2020 05:32 - 28 Apr 2020 05:32 #165902 by cmorley
Replied by cmorley on topic Preference File
I don;t know why it reports four time - if you still have the relevent files I would love to see.

I just pushed an update to file_manager so you can class patch the load(self, fname):
function to call a function in the handler file instead.
There is an example how to do this in the qtvcp code snippets section of the docs.

Chris
Last edit: 28 Apr 2020 05:32 by cmorley.

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

More
28 Apr 2020 15:16 #165985 by persei8
Replied by persei8 on topic Preference File
I haven't got the latest pushed update yet but I tried the class patching and it works. ( I didn't realize this is aka monkey patching )
Re: dialogs, every dialog that I call via
STAT.emit('dialog-request', mess)
or
ACTION.CALL_DIALOG(mess)
results in being reported 4 times in the console. You can probably only notice if linuxcnc is started from a terminal. This code is already in the example files.

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

More
29 Apr 2020 02:06 #166049 by cmorley
Replied by cmorley on topic Preference File
yes monkey patching.

From memory that can happen if you have multiple instances of the same dialogs loaded.
I'm not sure what you mean by 'already in the example files' which example files?

If you didn't update then your patching will probably break when you update I changed the function signature - easy enough to fix it.

chris

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

More
29 Apr 2020 17:19 #166110 by persei8
Replied by persei8 on topic Preference File
Sorry about the vagueness. To reproduce what I am seeing:
start linuxcnc in a terminal
select one of the configs under sim.qtvcp_screens.qtdragon
click on estop, power, home-all
click TOOL TOUCHOFF and wait for it to time out
There will be an error about timing out without making contact - expected
The contents of the dialog that was called will be displayed 4 times.
There's also something about Parameter file name is missing. - no idea what that is about.
Unrelated - there is an error about no attribute named proc but I have no interest in fixing that. I'm working on an updated version anyway.

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

More
30 Apr 2020 05:34 #166188 by cmorley
Replied by cmorley on topic Preference File
Thanks.

In axis_tool_button widget, In the function 'return_message', there is a debug print statement that printed _all_ return messages (and of course each tool button would print it too).

I'll remove it and hopefully that will be that.

Chris

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

More
02 May 2020 04:10 #166388 by hottabich
Replied by hottabich on topic Preference File
Hello Jim! Please tell me the mechanism of work of Probe Screen Widget.
Why the widget does not respond to probe-in. I see that everything is tied to a hal pin. I'm interested in how to connect to mesa 7i96. Thanks in advance!

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

More
02 May 2020 13:47 - 02 May 2020 13:49 #166404 by persei8
Replied by persei8 on topic Preference File
I also use a 7i96 but I have the probe input run through a debounce component first. In qtdragon_postgui.hal file there is:

net probe-input debounce.0.3.in <= hm2_7i96.0.gpio.004.in
net debounce_p debounce.0.3.out => motion.probe-input

You could bypass the debounce and just enter:
net probe_input hm2_7i96.0.gpio.xxx.in => motion.probe-input

You can monitor the state of the hal pin in HALSHOW -> pins -> motion.probe-input. If it doesn't toggle with your physical probe input, then something is not connected right.
Also, the probe widget is inactive until the machine is ON and HOMED.
Jim
Last edit: 02 May 2020 13:49 by persei8.
The following user(s) said Thank You: hottabich

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

Moderators: cmorley
Time to create page: 0.096 seconds
Powered by Kunena Forum