QtPyVCP - Max_Velocity Override - Button Group Freebie

More
13 Dec 2019 00:59 #152567 by Leon82
Ok, I'll double check everything, I thought I made them the same names

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

More
13 Dec 2019 01:05 #152569 by Donb9261
make sure you use the qtpyvcp machineactions.py file from the .local/python2.7/lib... as stated. the one from the examples is not loaded by the config. The mainwindow.py is in your vcp folder created when you initialized the vcp.
The following user(s) said Thank You: Leon82

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

More
13 Dec 2019 01:13 #152571 by Donb9261
Oh and make sure each button has the actions set in Qt.

Oriniginally you only had these options:

machine.max-velocity.set
machine.max-velocity.reset

Now after editing your machineactions.py:

machine.max-velocity.set
machine.max-velocity.reset
machine.max-velocity.zero
machine.max-velocity.twentyfive
machine.max-velocity.fifty
machine.max-velocity.seventyfive
machine.max-velocity.hundred

You can set a label and set the rule to {:6.4f}.format(ch[0]) i believe to see the actual value of current velocity. Use the current velocity channel.

I am currently on the road away from my Mint Monster PC so I cannot see my full setup. Sorry.

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

More
13 Dec 2019 01:14 - 13 Dec 2019 01:15 #152572 by Leon82

make sure you use the qtpyvcp machineactions.py file from the .local/python2.7/lib... as stated. the one from the examples is not loaded by the config. The mainwindow.py is in your vcp folder created when you initialized the vcp.


I used that one I had to show hidden files to get there.

You didn't put anything in the action field for the button correct?
Last edit: 13 Dec 2019 01:15 by Leon82.

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

More
13 Dec 2019 01:22 #152574 by Donb9261
Remove the rules or actions tied to your slider. The slider would take precedence.
The following user(s) said Thank You: Leon82

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

More
13 Dec 2019 01:43 #152575 by Leon82

Oh and make sure each button has the actions set in Qt.

Oriniginally you only had these options:

machine.max-velocity.set
machine.max-velocity.reset

Now after editing your machineactions.py:

machine.max-velocity.set
machine.max-velocity.reset
machine.max-velocity.zero
machine.max-velocity.twentyfive
machine.max-velocity.fifty
machine.max-velocity.seventyfive
machine.max-velocity.hundred

You can set a label and set the rule to {:6.4f}.format(ch[0]) i believe to see the actual value of current velocity. Use the current velocity channel.

I am currently on the road away from my Mint Monster PC so I cannot see my full setup. Sorry.


Ok I think this is where I need to work on

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

More
13 Dec 2019 01:49 #152577 by Donb9261
You create(def) any action you want via the machineactions.py file. Then those actions would become available for use in the actions field of your object property for the widget.

I may have failed to mention to add the new actions to each button. If so, sorry. I am old, deaf, dumb, and blind. Just ask my wife.
The following user(s) said Thank You: Leon82

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

More
13 Dec 2019 03:39 - 13 Dec 2019 03:45 #152582 by Leon82
i got the zero button to work.

i deleted the slider for max vel override, I'm working with an old cooyy of mine.

copied your names and code segments
im using 2.9, i wonder if its not calculating the c val correct from the ini. And since 0 is zero it works
Last edit: 13 Dec 2019 03:45 by Leon82.

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

More
13 Dec 2019 03:52 #152583 by Donb9261
Yes, I am on 2.9 as well. If zero works, then recheck your code as the methods are the same the only change is the decimal multiplier. It pulls in the current INFO value for the param and then does math then outputs the computed value to the setting in the planner.

So, if one works they all work. Linuxcnc starts at ini defaults. Then writes to ram any mods never storing the value persistently. So in code it is the same as saying:

somevar = 1
somevar = 2
somevar = 3

print(somevar)
>>> 3

So you have set somevar to a value in your code. Meaning that you are referencing/receiving the correct channels into your variable and back out to Linuxcnc variables/settings.

Send me your two files and I will review them because from what you say, it should be working for you... :-)

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

More
13 Dec 2019 03:59 #152584 by Leon82

Yes, I am on 2.9 as well. If zero works, then recheck your code as the methods are the same the only change is the decimal multiplier. It pulls in the current INFO value for the param and then does math then outputs the computed value to the setting in the planner.

So, if one works they all work. Linuxcnc starts at ini defaults. Then writes to ram any mods never storing the value persistently. So in code it is the same as saying:

somevar = 1
somevar = 2
somevar = 3

print(somevar)
>>> 3

So you have set somevar to a value in your code. Meaning that you are referencing/receiving the correct channels into your variable and back out to Linuxcnc variables/settings.

Send me your two files and I will review them because from what you say, it should be working for you... :-)



cool, thanks

no rush, im off to bed lol

File Attachment:

File Name: machine_actions.py
File Size:33 KB

File Attachment:

File Name: mainwindow.py
File Size:4 KB
Attachments:

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

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