qtvcp issues

More
29 Oct 2018 02:29 #119582 by cmorley
Replied by cmorley on topic qtvcp issues
I cannot replicate the problem with the button commands.
My guess is you might have two mechanisms working the button against it's self.
If you can post a sample that demonstrates the problem I will try to replicate it here.

Chris M

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

More
31 Oct 2018 02:29 #119685 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris,
I have not been able to make the dialogues stay where they should end up yet. I have a question on the configure file you mention, im guessing that is the one in my linuxcnc .ini file, but I can not find any entries there for qtvcp. Can you clarify if that is the right file to look at.

The time date display works up but is not in a good layout for me. it has to fit in a label 100x60. Time on the top line and date on the next line.

Are the items that write to the, for example, status spindle speed including a label name or something. Mine are just expecting a value in the string and nothing else.

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

More
31 Oct 2018 05:20 #119687 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
In one of my prior post I had mentioned that I had some problem with the clutter that the qt designer signal/slot editor can create in more complex gui designs. As a result I do a good deal of this work by editing the .ui xml file. My 1xMill gui has 178 signal and slots defined right now. 178 signal and slots would equal 356 large labels and the 356 wires pointing to their connections. That will make the editor unusable because the labels will hide all buttons or other items that have already been entered for connections.

Since these labels are just used to give hints they can be moved out of the way and just stacked up in one location. If you remove the hint items in the .xml file qt will put them back in which is ok since they default to location x20 and Y20. I decided to move them all to x0 and y0 in my updated .ui file as shown in the power on button example below. There are 186 more with different items plus the associated slot also sown below.

<connection>
<sender>abtn_mainv_power_on</sender>
<signal>toggled(bool)</signal>
<receiver>MainWindow</receiver>
<slot>abtn_mainv_power_on_toggled()</slot>
<hints>
<hint type="sourcelabel">
<x>0</x>
<y>0</y>
</hint>
<hint type="destinationlabel">
<x>0</x>
<y>0</y>
</hint>
</hints>
</connection>
<slot>abtn_mainv_power_on_toggled()</slot>

Here is a picture of the result.

Attachments:

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

More
31 Oct 2018 05:58 #119688 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris and everyone interested in Qtvcp work in progress.

I have uploaded the 1xMillGui to git hub - not fully functional yet but getting very close.

I think most of the features I wanted to include in the 1xMill gui are there and pleased with it. Now starting to work on the special items to get those to work. If you load this gui the way it is now you may find that it is always in jog step mode. It needs more work but it will give you and idea how it works and what it can do when completed. I will mostly likely work on the handler file, and welcomes help and suggestions on how to get all the features working.

There could potentially be some button or other minor changes to other types if that is appropriate.

You can find it on get hub: auto-mation-assist/1xMillGui.
The following user(s) said Thank You: tommylight

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

More
01 Nov 2018 07:53 #119749 by cmorley
Replied by cmorley on topic qtvcp issues
I grabbed your github work a few things about that. (I know you said you are new to github)

It looks to me that you commited just the two file - it would be easier for people to help if you forked linuxcnc and added your screen to it, ideally by adding a simulated sample that anyone could load up. Saves us having to move and edit files to make it work. - for instance your handler file imports a scrowl_bar that is not included, so I had to comment that out..

Anyways after getting it up and displaying:
Yes I see the time stamp always reset the text_template and seemed to ignore ]n for new line. I have a fix for that (and using <br> instead of \n works).
looking at dialogs - since there was no dialog included I added a toolOffsetDialog, uncommented the geometry command in the handler file and made your button displaly it. I did open in the right place but was too big. This was too big because I had set the widgets minimum size larger then you wanted. Ill fix that.
Also the geometry command is relative to the full screen, not the window. So looks like I need to add a 'reference from window position' option.
It looks to me you want the dialogs to sit in front of the stacked widget. Would you rather just add them to the stacked widget? Some widgets are available already that way -camview, and originOffsets. I could expose the rest, other then the file dialog as QT doesn't provide an embedable one (I'd have to build it) .

You were asking about status_labels, such as spindle speed, how to display text with the number.. The property text template sets this. By default it is %s. You could set it to 'Spindle Speed %s' or most anything else. You can also use rich text to set it's size font color etc. the easiest way to do that is to go to the 'text' property under the heading 'QLabel'. click the text and you will see a box with dots in it on the right.
click that - a dialog comes up letting you set rich text. Once you are happy, press ok on th edialog - this will set the text to what you specified. Now copy that into the texttemplate under the statusLabel heading. Then add the %s or %d or %f so the number will show too.

Chris

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

More
01 Nov 2018 13:01 - 01 Nov 2018 13:11 #119759 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris,

You are right I just uploaded the files and was thinking later on that it would be a little difficult to get them loaded and working. I have never used a simulator always a actual machine. So I’m not familiar with how to do a simulation but will need to figure it out when I have no machine available when travelling for the summer in the lower 48 each year.

If you have some time please send me a email on how put things in github linuxcnc properly or if there is information available a link to it.

The missing scowl file is not used so the link to the file can be deleted. I wanted to remove the little up and own arrows but never got that far. They move in the bar in the wrong direction in inverted mode and are really no needed. I just hide them instead of trying to remove them.

The dialogues should reside on each panel that is reserved for them in the stacked widget and sized to 600x400. I did figure out that the position they use is screen related and not gui related so I just stopped putting them in until that is resolved

I have been working on the handler file to get some of the items working that are not yet functional. There are a few minor changes and addition to the gui .ui file itself that this work required.

I will do some testing with the labels and need to figure out how to change the button colors for buttons that are active later. I don’t care much about other cosmetics and I’m used to working with plain grey panels in 19 inch racks for my many years as an electronics technician.

One of the most difficult things for me is to figure out what commands are available to link into your code, format them and categories. I have a lot of items in the handler file that would likely be plug-ins in some gui's.

I uploaded the gui files early so that it would be helpful for you to see some of the problems I’m running into at times. I still do not have the name switching between true and false states on buttons working again. I'm thinking about trying some commands from the handler to do this since that information could potentially come from a configuration file later.

I will be working on the jogging functions next. I found that the step group of buttons on the linear jogging panel were always keeping the step jog mode active so I ended up removing the check mark in their command list for now. You may also find that some panels are not being called up in the files I uploaded. That is just a stacked number error which I have corrected in my files here.
Last edit: 01 Nov 2018 13:11 by auto-mation-assist.

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

More
01 Nov 2018 22:49 #119791 by cmorley
Replied by cmorley on topic qtvcp issues
Ok I pushed a fix for the button labels. I didn't realize it was HAL buttons rather then action buttons.

Having buttons change color when in different states is best done with stylsheets.
Now like every thing else it can be done in multiple ways:

You can add a separate stylesheet file - this would be best if you plan to restyle alot of the screen or like the style code separate from the screen code. It's also easier for other to customize the look of the screen as all the style code is in one place.

You can use designer to add style sheets specs to certain widgets - it's convenient when doing a few buttons and you can see the result right away.

You can add python code to change the stylesheet - this gives you the most control or how and when it will change.

and of course you can do all three - there is a hierarchy of course.

Chris M

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

More
01 Nov 2018 22:56 #119793 by cmorley
Replied by cmorley on topic qtvcp issues
Here is a picture of change the backbround of a pushbutton using designer.
First you right click the button and choose 'set stylesheets'
This is just a very basic example.
Stylesheets use a cut down version of CSS and is a subject all on it's own :)

Chris M
Attachments:
The following user(s) said Thank You: tommylight, auto-mation-assist

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

More
02 Nov 2018 02:37 #119801 by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris,

While were talking about buttons I miss the ability to set the default state, like a check box making the current state the default state (True or False). I used this feature in Labview quite often. It bothers me that buttons seen to like to come up in that False state when bringing up my gui which does not reflect the actual state of what panels are actively shown at start up.

Same problem with the jog slow and fast buttons, one of those should always be true on start up.

I can set the panels shown at start up in the handlers .ini section but I have not found or can not recall the correct command to set the state of a button there.

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

More
02 Nov 2018 04:31 - 02 Nov 2018 04:32 #119803 by cmorley
Replied by cmorley on topic qtvcp issues
In designer under 'abstract button' you will see a property 'checked' (just under 'checkable') this will set the state of the button on startup - unless it is controlled by linuxcnc - then it will display the linuxcnc startup default.
For instance if you use the estop action, the button will reflect the state of linuxcnc no matter what.

If you want to set button state in the handler file (again as long as it isn't controlled by linuxcnc):

self.w.[SOME_BUTTON].setChecked(True)

If you want to set an action button that is controlled by linuxcnc, then you must set linuxcnc's state. This should remove Estop on start up, and the button should follow.

ACTION.SET_ESTOP_STATE(False)

These should be put in the initilized__ function (under the heading 'Special Functions called from QTVCP')

Chris M
Last edit: 02 Nov 2018 04:32 by cmorley.

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

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