gmocappy clock

More
10 Mar 2021 20:14 #201696 by HansU
Replied by HansU on topic gmocappy clock
Ahh I uploaded the timer_hu.glade instead of timer_hu.py.
I edited the post (the forum added the timestamp)

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

More
10 Mar 2021 20:48 #201707 by newbynobi
Replied by newbynobi on topic gmocappy clock
Oom, I can not see an error on the files you posted, but I have not jet tested on a LinuxCNC computer.
Did you use tabs to idend the python code or did you edit it on a windows pc? Both is a bad idea, as it often leads to strange errors.

The code you added will react exactly like the running time, so why you added a additional label, you need also additional pin to reset the time when a new part starts and it should only update if the interpreter is running and and and

So I see you are in the first steps.

Please post the terminal output, there must be some strange output.

Norbert

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

More
10 Mar 2021 21:39 #201727 by HansU
Replied by HansU on topic gmocappy clock
Yes I want to add the function when the display is working.

The indentation is fine and it's editied on a linux system.
And I only added 3 lines. Maybe I have missed something?

The output of LinuxCNC is
...
**** GMOCCAPY GETINIINFO **** 
Preference file path: /home/cnc/linuxcnc/configs/Sieg-X1/Sieg-X1.pref
timer_v2.hal:4: parameter or pin 'timer.periode_time_machine' not found
'halcmd -f timer_v2.hal' exited with 1
/usr/lib/python2.7/dist-packages/gmoccapy/notification.py:168: GtkWarning: Invalid icon size 48

  self.popup.show()
/usr/bin/gmoccapy:5204: GtkWarning: Invalid icon size 48

  gtk.main()

where timer_v2.hal is essentially your last hal file (I attached it again to have the same base)
If I skip the hal file with
EMBED_TAB_COMMAND = gladevcp -x {XID} -u timer_hu.py timer_4.glade
then the tab is shown at least (of course with no function)
Attachments:

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

More
10 Mar 2021 22:07 #201731 by HansU
Replied by HansU on topic gmocappy clock
What I am wondering most is that it fails with the error above when I simply replace your timer.glade by my timer_4.glade.
As timer_4.glade only extends timer.glade with an additional test field / label. I would assume that it show the default value if it isn't overwritten.

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

More
11 Mar 2021 05:23 - 11 Mar 2021 05:26 #201775 by newbynobi
Replied by newbynobi on topic gmocappy clock
Aahhhh.

That can not work!
You changed the Emmbedded part of the INI entry!!!

That line must contain the Hal file as parameter, you seem to load the timer_v2. Hal on an other place!

See also this post: Order of Hal files

Norbert
Last edit: 11 Mar 2021 05:26 by newbynobi.

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

More
11 Mar 2021 13:57 #201813 by HansU
Replied by HansU on topic gmocappy clock

That line must contain the Hal file as parameter, you seem to load the timer_v2. Hal on an other place!


No, I just replaced
EMBED_TAB_NAME = timer
EMBED_TAB_LOCATION = ntb_setup
EMBED_TAB_COMMAND = gladevcp -x {XID} -u timer_v2.py -H timer_v2.hal timer.glade
by
EMBED_TAB_NAME = timer
EMBED_TAB_LOCATION = ntb_setup
EMBED_TAB_COMMAND = gladevcp -x {XID} -u timer_hu.py -H timer_v2.hal timer_4.glade
.
I didn't add it or load it at another place.
And first is working (of course, because it's yours :laugh:) and second not.

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

More
11 Mar 2021 20:49 #201857 by newbynobi
Replied by newbynobi on topic gmocappy clock
Did you want it to show like this?



By changing the entry in the load part of the INI File you changed the component names, so all hal pin aren not any more called timer, but timer_4

I changed the hal pin names and now it does work
EMBED_TAB_NAME = timer
EMBED_TAB_LOCATION = ntb_setup
EMBED_TAB_COMMAND = gladevcp -x {XID} -u timer_hu.py -H timer_4.hal timer_4.glade

If we do not specify a component name, the name of the glade file will be taken.

Norbert
Attachments:
The following user(s) said Thank You: tivoi, HansU

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

More
11 Mar 2021 21:55 #201878 by HansU
Replied by HansU on topic gmocappy clock

Did you want it to show like this?

Yes

If we do not specify a component name, the name of the glade file will be taken.

That was the crucial hint. I didn't know that. If I only change the file name, then all works as expected!
Thanks so much Norbert!

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

More
12 Mar 2021 12:05 - 12 Mar 2021 19:04 #201950 by HansU
Replied by HansU on topic gmocappy clock
I added the travel distances to Norberts VCP:


and renamed it to counter as it does now more than time based counting.
But pay attention on if you already used the abs or integ HAL component in another hal file.
Only the columns are a bit strechted since a added a vbox around. Without the vbox was that correct (see counter_b.glade)
The calculation of the real travel distance was easier than my first approach when using the pin "motion.current-vel".
If someone has a better name for "Real" please tell me. I didn't want to use "Total" because it doesn't simply adds the travel distances of X, Y and Z.
The Program Running Time makes no sense in this location as you can only get there when the program is stopped. In this case the counter will be resetted and you will always see a zero. I let it in if someone wants it at another location.

Therefore a added a separate VCP for the current program running to be displayed at the main screen like this:




I added it in the INI file in this way:
EMBED_TAB_NAME = Counter
EMBED_TAB_LOCATION = ntb_setup
EMBED_TAB_COMMAND = gladevcp -x {XID} -u counter.py -H counter.hal counter.glade

EMBED_TAB_NAME = Timer
EMBED_TAB_LOCATION = box_custom_4
EMBED_TAB_COMMAND = gladevcp -x {XID} -u programtimer.py -H programtimer.hal programtimer.glade

I'll add the files for the programtimer in another post because of the file number limitation.
Attachments:
Last edit: 12 Mar 2021 19:04 by HansU.

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

More
12 Mar 2021 12:10 #201951 by HansU
Replied by HansU on topic gmocappy clock
The files for the program timer...

Another thing I noticed while playing around:
Can you also grey out the stop button (like you already did with the play and pause button) when the program is already stopped?


Attachments:

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

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