gmocappy clock

More
5 years 7 months ago #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 to join the conversation.

More
5 years 7 months ago #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 to join the conversation.

More
5 years 7 months ago #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
Code:
... **** 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
Code:
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)

Please Log in to join the conversation.

More
5 years 7 months ago #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 to join the conversation.

More
5 years 7 months ago #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

Please Log in to join the conversation.

More
5 years 7 months ago #201813 by HansU
Replied by HansU on topic gmocappy clock

newbynobi wrote: 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
Code:
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
Code:
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 to join the conversation.

More
5 years 7 months ago #201857 by newbynobi
Replied by newbynobi on topic gmocappy clock
Did you want it to show like this?

Attachment not found



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
Code:
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

Please Log in to join the conversation.

More
5 years 7 months ago #201878 by HansU
Replied by HansU on topic gmocappy clock

newbynobi wrote: Did you want it to show like this?

Yes

newbynobi wrote: 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 to join the conversation.

More
5 years 7 months ago #201950 by HansU
Replied by HansU on topic gmocappy clock
I added the travel distances to Norberts VCP:

Attachment not found


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:


Attachment not found



I added it in the INI file in this way:
Code:
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.

Please Log in to join the conversation.

More
5 years 7 months ago #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?


Attachment not found

Please Log in to join the conversation.

Time to create page: 0.191 seconds
Powered by Kunena Forum