GUI Modification Plasma

More
10 Dec 2016 00:20 #83866 by islander261
Replied by islander261 on topic GUI Modification Plasma
Andy

Thank you. It was actually my intention to use one adjustment widget for both tabs. I think that I used the wrong terminology when describing my situation. I used the term tab because they are attached to the Gmoccapy screen using the EMBED_TAB command in the .ini file. I have no idea what a Glade tab is. I have two separate Glade files, one for each portion of the screen. I don't know how to combine the files so that the result will load properly. So it is of to Gtk/Glade references once again.

John

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

More
10 Dec 2016 00:29 #83867 by andypugh
Replied by andypugh on topic GUI Modification Plasma
If it makes you feel better: You are finding this hard, because it is hard.

The embedded tabs can't find each other. They can't even find Gmoccapy. The only place they "touch" is in HAL.

I think you will need an output HAL widget and a _hidden_ HAL input widget in each tab, with them wired input to output in HAL. Then Python code will have to watch for inputs changing and set the value of the output widgets to match.
Make sure that you ignore changes to very nearly the same value, or you will get a feedback loop which might eat all CPU.

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

More
12 Dec 2016 04:58 #83934 by islander261
Replied by islander261 on topic GUI Modification Plasma
Hello

Thank you all for the tips! I have made some progress. For one variable I now have one tab synchronized with another. This at least gives me a blueprint for a path forward. This did require work on all all three files *.glade, *.hal and *.py. Some parts I really don't quite understand, but I brute force found a way to make it work. I will update on a more concise way to make this work in the next few days. I still don't have a good enough grip on the process to give a good explanation.

John

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

More
18 Dec 2016 19:52 #84371 by islander261
Replied by islander261 on topic GUI Modification Plasma
Hello

Again a big thank you to everyone that has assisted with tips and coaching. I now have controls and variables in the tabs interacting with each other (synchronized). This has required linking the .glade and .py files through the HAL (.hal files). My lack of knowledge about object oriented programming and Python have made this a frustrating journey at times. I still don't really understand why I had to do somethings to make this work.

Now for the current problems. I have what I believe to be intermittent problems when starting Gmoccapy. Sometimes when starting the correct graphic for some of the widgets is not used, the screen usually also has trouble with the correct display of the frame borders when this happens. This is not a show stopper and occurs less frequently as my code has gotten better. By far the biggest problem is loading or initialization of persistent variables in the Python code. This is again an apparently intermittent problem that only occurs with the controls that are modified between tabs. These are both HAL Horizontal slider widgets and HAL check box widgets. I am quite sure that this is related to the handling of the adjustments for the horizontal sliders but no clue about the check boxes. Sometimes I can shutdown and restart the program 10 times without a problem and sometimes only once. One thing I do know is that once this happens the only reliable way I have found to start things working correcting again is to delete the *.var file causing it to be recreated with the default values for the variables. At first I thought this might be related to execution order because I thought that the order in which I selected the widgets on the screen had an effect. Something in the Python code causes the persistent variables for the items that are shared between tabs to have an index to the group offset by one position. This always happens the same way. I have checked the *.var files and they are correct prior to the error occurring and are then saved on shutdown with the error after it occurs. Again my knowledge of OOP and Python are hindering me in coming up with a good trouble shooting plan.

I am wanting to keep moving forward now that things are mostly working. Here are few questions I have right now about data items I can't find and controls I don't understand.
1. Can I set the preview tab so that the origin of the axis starts in the lower left corner instead of the center of the preview area?
2. Is there a system variable that has the linear distance for each move? I want to sum the distance cut with the torch.
3. I am having a continuing error with the radio buttons in one tab. I am sure it is my coding error but I don't know where to start looking.
/usr/bin/gladevcp:185: GtkWarning: IA__gtk_radio_button_set_group: assertion '!g_slist_find (group, radio_button)' failed
  builder.add_from_file(xmlname)
The radio buttons don't actually do anything yet but I am making progress in that direction.
4. Looks like quite a few problems on startup when you look at the terminal, is this normal?

None of this is finished code and is mostly hooked to things for testing, it will not run a machine.

I have a bunch of plasma specific questions that I will post in the General topics thread because they may apply to all GUIs.

John
Attachments:

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

More
19 Dec 2016 00:13 #84384 by andypugh
Replied by andypugh on topic GUI Modification Plasma
As a guess, the code that restores the values from the disk file might be trying to run before all the interface widgets actually exist.

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

More
19 Dec 2016 18:12 #84418 by newbynobi
Replied by newbynobi on topic GUI Modification Plasma
/usr/bin/gladevcp:185: GtkWarning: IA__gtk_radio_button_set_group: assertion '!g_slist_find (group, radio_button)' failed
  builder.add_from_file(xmlname)

This is probably caused, because you have not added some optin button to a button group.
The first one has no group, and all others must be added to that group!
/usr/bin/gladevcp:295: GtkWarning: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17
  gtk.main()

You are not allowed to resize widgets with negativ values. If you want to hide it, just use the corresponding property.

Norebrt

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

More
19 Dec 2016 18:58 #84421 by islander261
Replied by islander261 on topic GUI Modification Plasma
Andy

Thank you, I am confused because I though that by using the Embed_Tab command in the .ini file all the order of initialization and starting was handled for you. Can you please point me to a reference that explains what needs to be done?

Norbert

Thank you, I have fixed the radio button error by correcting my Glade file for the tab. The negative sized widget error is still present. I am confused by this because I have not knowingly set any widgets this way. I have only knowingly modified the .glade files attached to my previous post. I have searched all the Glade files that I have knowingly modified and can't find any widgets set to a negative width. Does the error message contain the file name that has the error?

John

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

More
19 Dec 2016 19:16 #84427 by newbynobi
Replied by newbynobi on topic GUI Modification Plasma
No, it does not indicate the filename.
Try to load only one panel at the time and check to find the error.

Norbert

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

More
19 Dec 2016 19:18 #84428 by andypugh
Replied by andypugh on topic GUI Modification Plasma

Thank you, I am confused because I though that by using the Embed_Tab command in the .ini file all the order of initialization and starting was handled for you. Can you please point me to a reference that explains what needs to be done?


You can try running the HAL that makes the connections as part of the last EMBED_TAB command, see the -H switch here:
linuxcnc.org/docs/html/man/man1/gladevcp.1.html
Also make sure that the EMBED_COMMANDs contain the -W switch so that execution pauses there until loading is finished.

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

More
19 Dec 2016 23:08 #84437 by islander261
Replied by islander261 on topic GUI Modification Plasma
Andy

Thank you. My .ini file already uses the -H switch for the HAL file in my EMBED_COMMAND lines. I can't find an example of using the -W switch in the EMBED_COMMAND lines. I may resort to just placing all the HAL connections in the last EMBED_COMMAND line. I have been trying to keep all files and commands for each part together so I can find my through all of this when it needs maintaining in a few years.

John

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

Moderators: newbynobiHansU
Time to create page: 0.093 seconds
Powered by Kunena Forum