qtdragon mod

More
10 months 3 weeks ago #339750 by cmorley
Replied by cmorley on topic qtdragon mod
Do you mean you are using HALUI to do MPG jogging?

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

More
10 months 3 weeks ago - 10 months 3 weeks ago #339753 by Mr. Mass
Replied by Mr. Mass on topic qtdragon mod
No, I added my pins and linked them to jog_increments widget:
Code:
[code][code]pin = QHAL.newpin("mpg.mpg-inc.1", QHAL.HAL_BIT, QHAL.HAL_IN) pin.value_changed.connect(lambda s: self.w.jogincrements_linear.setCurrentIndex(1)) pin = QHAL.newpin("mpg.mpg-inc.2", QHAL.HAL_BIT, QHAL.HAL_IN) pin.value_changed.connect(lambda s: self.w.jogincrements_linear.setCurrentIndex(2)) pin = QHAL.newpin("mpg.mpg-inc.3", QHAL.HAL_BIT, QHAL.HAL_IN) pin.value_changed.connect(lambda s: self.w.jogincrements_linear.setCurrentIndex(3)) pin = QHAL.newpin("mpg.mpg-inc.cont", QHAL.HAL_BIT, QHAL.HAL_IN) pin.value_changed.connect(lambda s: self.w.jogincrements_linear.setCurrentIndex(0)) [code][code][code]But I would like to be able to enable/disable the increment selection from the screen, only showing the current value. Perhaps there is a way to disable the drop-down menu or something like that.
[/code][/code][/code][/code][/code]
Last edit: 10 months 3 weeks ago by Mr. Mass.

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

More
10 months 3 weeks ago #339767 by cmorley
Replied by cmorley on topic qtdragon mod
adding:
        self.w.jogincrements_linear.setEnabled(0)

to the end of
    def init_widgets(self):

Will make it not respond to screen clicks, but should still respond from HAL pin changes

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

More
10 months 3 weeks ago #339787 by Mr. Mass
Replied by Mr. Mass on topic qtdragon mod
Oh, that works great, thank you very much. I even made a small function that checks the active HAL pin against the widget every time the encoder signals, but your method is much more elegant.

New question: how to connect a button to a HAL pin? I want to add an MPG on/off button. I created a HAL pin in the handler file and created IndicatedPushButton. In the button properties, I added HAL.set_p(’mpg.mpg-enable’,’1’) to true_python_cmd_string. But I got an error:

  File "<string>", line 1
    HAL.set_p(’mpg.mpg-enable’,’1’)
              ^
SyntaxError: invalid character '’' (U+2019)

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

More
10 months 3 weeks ago #339808 by cmorley
Replied by cmorley on topic qtdragon mod
you could use a PushButton (under the linuxcnc-HAL heading)

It makes a hal pin.
Don't forget to set the property:
pin_name and pin_type
The following user(s) said Thank You: Mr. Mass

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

More
8 months 3 weeks ago #342811 by Mr. Mass
Replied by Mr. Mass on topic qtdragon mod
Finished the mod for qtdragon, which adds HAL pin encoders for all sliders, jog on all axes, increments, and MPG.

Add HAL pins for XYZABC axis jog:

qtdragon.jog.axis.x.plus
qtdragon.jog.axis.x.minus
qtdragon.jog.axis.y.plus
qtdragon.jog.axis.y.minus
qtdragon.jog.axis.z.plus
qtdragon.jog.axis.z.minus
qtdragon.jog.axis.a.plus
qtdragon.jog.axis.a.minus
qtdragon.jog.axis.b.plus
qtdragon.jog.axis.b.minus
qtdragon.jog.axis.c.plus
qtdragon.jog.axis.c.minus

For example, following pins are available for feedrate slider:

qtdragon.feed.override.count-enable = HAL_BIT, IN must be TRUE to enable feedrate counts
qtdragon.feed.override.counts = HAL_S32, IN encoder input for change feed override
qtdragon.feed.override.btn-100 = HAL_BIT, IN reset to feed override to 100%
qtdragon.feed.override.step = HAL_S32, IN increase/decrease step as a % of the maximum value

For sliders JOG_RATE and ANGULAR_JOG add pins to toggle between fast and slow jogging:

qtdragon.jog.override-linear.turtle = HAL_BIT IN decrease jogging in 10 times
qtdragon.jog.override-linear.turtle-led = HAL_BIT, OUT indicated slow mode is on
qtdragon.jog.override-angular.turtle = HAL_BIT IN decrease angular jogging in 10 times
qtdragon.jog.override-angular.turtle-led = HAL_BIT, OUT indicated angular jogging slow mode is on

Add HAL pins for MPG:

qtdragon.mpg.mpg-enable = HAL_BIT, IN must be TRUE to enable MPG counts

Jog increments pins, used first 3 INCREMENTS from ini file:
qtdragon.mpg.mpg-inc.1 = HAL_BIT, IN
qtdragon.mpg.mpg-inc.2 = HAL_BIT, IN
qtdragon.mpg.mpg-inc.3 = HAL_BIT, IN

For angular axis used next pins, also first 3 value from ini:
qtdragon.mpg.mpg-angular-inc.1 = HAL_BIT, IN
qtdragon.mpg.mpg-angular-inc.2 = HAL_BIT, IN
qtdragon.mpg.mpg-angular-inc.3 = HAL_BIT, IN

Pins for axis selected:
qtdragon.mpg.axis.x = HAL_BIT, IN
qtdragon.mpg.axis.y = HAL_BIT, IN
qtdragon.mpg.axis.z = HAL_BIT, IN
qtdragon.mpg.axis.a = HAL_BIT, IN
qtdragon.mpg.axis.b = HAL_BIT, IN
qtdragon.mpg.axis.c = HAL_BIT, IN

MPG encoder pin:

qtdragon.mpg.encoder-count = HAL_S32, IN MPG encoder input

Add a pins to cycle change increments:
qtdragon.mpg.mpg-inc.cycle = HAL_BIT, IN
qtdragon.mpg.mpg-angular-inc.cycle = HAL_BIT, IN

Put this file into <YOUR CONFIG FOLDER>/qtvcp/screens/qtdragon_hd/. Tested on qtdragon_hd, but should be working on qtdragon too.
The following user(s) said Thank You: COFHAL

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

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