qtvcp issues

More
13 Oct 2018 16:37 #118745 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris,

I have started developing my custom gui with QTvcp it's coming along well. I would like to be able to have separate text labels for the on and off state of some buttons, like inch/mm swapping for the the dro displays. I have not been able to find a way to do that within the QT designer under QAbstractButton "test" entry. Have you found a way to do that? I’m wondering if this is perhaps something that styles sheets handle.

I think that it may be beneficial to start a new thread like "QTvcp Development Work" or something like it.

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

More
13 Oct 2018 18:32 #118749 by cmorley
Replied by cmorley on topic qtvcp issues
Well I looked into this and it should have been easy with stylesheets....
But it didn't work like it should have.

I will look into coding the capability into buttons tonight.

Chris M

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

More
14 Oct 2018 03:40 #118756 by cmorley
Replied by cmorley on topic qtvcp issues
Ok I pushed some work on this.
If you try and pull this:
(while in your qt5vcp_py2 branch)
git pull

you will get a warning message about conflicts.
This is because I rebased it over the latest master.

As long as you have not changed any linuxcnc code type this:
(your GUI code should be fine but i would copy it somewhere anyways)

git reset --hard origin/qt5vcp_py2

Then you should be up to date.

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

More
14 Oct 2018 03:53 #118757 by cmorley
Replied by cmorley on topic qtvcp issues
So I added options on the action button for text toggling.
Right now the button must be a checkable button.
You set that under QAbstactButton on the right hand property editor.

Then under the Indicator_PushButton on the right side property editor:
check the checked_state_text_option button and the set the textboxes in
true_state_string and false_state_string to the text you wish to toggle.

You can confirm it works by going back to the QAbstractButton heading and then
check/uncheck the 'checked' button; the text in the button should change.

If all good save and start linuxcnc with your new GUI and test.

If you wish to change font/font size/ colors that would be done with stylesheets.

stylesheets can be set from designer on widgets by right clicking the widget and selecting 'change stylesheet'
You can see this on the 'qtdefault' test screen for instance the ESTOP button.

stylesheets are a subject all to them selves...

Hope this helps

Chris M

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

More
14 Oct 2018 04:21 #118760 by cmorley
Replied by cmorley on topic qtvcp issues
I forgot to say that qtdefault test screen's estop, power, and home butttons now change text based on state - just for an example

Chris M

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

More
14 Oct 2018 21:22 - 14 Oct 2018 21:25 #118800 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris,

Your additions/modifications are working. I did notice that if I click on a button that has different text for "on" and "off" states that it requires a mouse button release before the text itself changes. So the text change cannot happen until the button down process is released.

I’m researching if there is a ability to have multiple lines in button text since some button description text gets a little long at times for a single line. I have tried a few carriage return linefeed command symbols in the text but that has not worked. So likely that is not the correct method or I'm doing it wrong.

I have come to realize now that for some buttons for which there is no stock pre-set action that I need to change those to hal push buttons instead of the hal action buttons in my gui. At least I think that is correct and as a sample I have included some info below.

The gui that I'm building for my mill has a fourth axis rotary, which can be configured as a indexer or used as a rotary rpm adjustable spindle. So I will be using the spindle hal action buttons for most of the buttons and give the objectnames, like "abtn_axis4_forward" or "abtn_axis4_stop".

For any hal push buttons used that have no predefined actions the objectnames for those buttons will have prefix "btn" instead of "abtn" like: "btn_axis4_spin_mode_enable" to change from indexer to spin mode on the 4th axis rotary.

I'm thinking about what it will take to display x number of mdi history commands and be able to click on those past issued commands so the clicked on one can be pasted into the mdi txt command line like gmocappy allows. This saves a lot of typing at times.

Getting close to needing to work on linking the gui into linuxcnc to update my hal file and make changes to the gui as needed. I will review your documentation on what needs to be done to get the pins to show up in linuxcnc.
Last edit: 14 Oct 2018 21:25 by auto-mation-assist.

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

More
14 Oct 2018 23:08 #118806 by cmorley
Replied by cmorley on topic qtvcp issues
The signal I used to change text was 'toggled' which is a press release action.
That should be able to changed to pressed to have the label change sooner.
On checkable buttons why would you hold it down?

On regular buttons if you look under QAbstrectButton look for property 'text'
If you click on the text you will notice a box with dots in it. click that.
A dialog box will show. It allows multiline text.

On the work I just pushed that is not currently possible but I could add it.
(though not as nicely to access)

HAL buttons are used for controlling HAL pins - if you don't need HAL pins then they are not really appropriate.

If you can't find preprogrammed buttons that do what you want, then you need to either build custom widgets (that would be nice if you think it's something everyone would want - I would add it to qtvcp) or use the handler files to code a custom button control on regular buttons or action buttons.

While there are action buttons for running MDI commands from the INI file, buttons for running MDI history is interesting - i could add something like that to action buttons. something like 'MDIHistoryButton you would specify which line (counting back from the last command) it fires. Probably best to have it copy the code to the MDI command line first - or have it hilight the line first...
Currently there is no exclusive MDI history display widget - the sample screen use the gcode screen.
The following user(s) said Thank You: auto-mation-assist

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

More
15 Oct 2018 20:15 #118843 by cmorley
Replied by cmorley on topic qtvcp issues
I pushed some more work on buttons.
now you can use \n in the text string to get two line text eg:
One\nTwo will display

one
two

also momentary buttons can have state based text (state based on the linuxcnc status)

Chris M

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

More
16 Oct 2018 05:04 #118863 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Thanks the \n in the middle works great.

I used StatusStacked in four places and need to figure out how to pull up the different pages that are in a stack from the control buttons like "manual", or "probe" as examples. The stacked pages pull up fine with the small manually selected arrows on the stacked pages.

You mentioned; "On checkable buttons why would you hold it down?"
I was holding down A button during testing and noticed that several times that I was apparently holding a button down a little too long without realizing it and noticed it changes on mouse button release which was apposite of what I had expected. I see it as being just an observation, not as a problem.

I will do a pull again to get your latest updates.

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

More
16 Oct 2018 23:01 #118908 by cmorley
Replied by cmorley on topic qtvcp issues
Are you talking QTvcp's stacked widget or QT's general stcked widget?

QT's can be set programmatically with:
YOUR_STACKED_WIDGET_NAME.setCurrentIndex (index_number)

QTvcp's stack switches automatically on linuxcnc's mode changes. (manual,MDI and AUTO)
Maybe what you would like is action buttons that display a specific layer of a stack widget?

Chris M
The following user(s) said Thank You: newbynobi

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

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