Axis Position Logger

More
25 Feb 2024 14:13 #294364 by Aciera
Replied by Aciera on topic Axis Position Logger

Can someone explain to me how to edit this project or create something similar?

If you mean to modify the source code then you would need to do run-in-place installation and build linuxcnc on your local PC.

linuxcnc.org/docs/html/code/building-linuxcnc.html

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

More
25 Feb 2024 14:45 #294369 by tommylight
Replied by tommylight on topic Axis Position Logger
Position logger is a separate project by JT, so i do not know/think building LinuxCNC would help.
The issue is with old python used by it, so editing it to use python3 should be enough, although no idea how much work would that entail.
The following user(s) said Thank You: Aciera

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

More
25 Feb 2024 15:54 #294390 by Aciera
Replied by Aciera on topic Axis Position Logger
Ah yes thanks, sometimes I get confused going from one thread to another.
The following user(s) said Thank You: tommylight

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

More
25 Feb 2024 16:26 - 25 Feb 2024 17:22 #294394 by Aciera
Replied by Aciera on topic Axis Position Logger
So, to get the source you would download the .deb folder using the wget command as described here:
jethornton.github.io/emclog/install.html
Then right click on the downloaded 'emclog_1.0.0_all.deb' and choose 'Extract Here'
In the extracted folder extract the folder 'data.tar.xz'
You will find the pyhton file 'emclog' in the extracted 'usr/bin' folder.
This file you will need to update to python3.


[edit]
You will also need the gui file 'emclog.ui' from the folder 'emclog_1.0.0_all/usr/lib/python3/dist-packages/libemclog'

[edit2]
Just found the GitHub page for these two files:
github.com/jethornton/emclog/blob/master/emclog/src/emclog.ui
Last edit: 25 Feb 2024 17:22 by Aciera.
The following user(s) said Thank You: Mecanix, Ehsan_R

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

More
25 Feb 2024 16:58 #294402 by Ehsan_R
Replied by Ehsan_R on topic Axis Position Logger
Hello
I am very new to Python programming
Would it be possible for you to give me a more complete explanation of how you did what you did or send me the files you edited?
forum.linuxcnc.org/21-axis/30986-axis-po...gger?start=30#247082

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

More
25 Feb 2024 17:14 - 25 Feb 2024 17:17 #294406 by Ehsan_R
Replied by Ehsan_R on topic Axis Position Logger
So, to get the source you would download the .deb folder using the wget command as described here:
jethornton.github.io/emclog/install.html
Then right click on the downloaded 'emclog_1.0.0_all.deb' and choose 'Extract Here'
In the extracted folder extract the folder 'data.tar.xz'
You will find the pyhton file 'emclog' in the extracted 'usr/bin' folder.
This file you will need to update to python3.
[edit]
You will also need the gui file 'emclog.ui' from the folder 'emclog_1.0.0_all/usr/lib/python3/dist-packages/libemclog'


I applied these changes
How do I create the installable file after that?
 
Last edit: 25 Feb 2024 17:17 by Ehsan_R.

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

More
25 Feb 2024 17:25 #294409 by Aciera
Replied by Aciera on topic Axis Position Logger
you can run it from a terminal with (make sure the file 'emclog.py' is marked as executable):

$ python3 <your_path_here>/emclog.py
The following user(s) said Thank You: Ehsan_R

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

More
25 Feb 2024 17:47 #294414 by Ehsan_R
Replied by Ehsan_R on topic Axis Position Logger
#!/usr/bin/python3

import os, sys, math

if sys.version_info[0] > 3:
    raise Exception("Python 3 is required.")
I changed these program lines like this
ehsan@debian:~/Desktop$ python3 emclog.py
Traceback (most recent call last):
  File "/home/ehsan/Desktop/emclog.py", line 16, in <module>
    IN_AXIS = os.environ.has_key("AXIS_PROGRESS_BAR")
              ^^^^^^^^^^^^^^^^^^
AttributeError: '_Environ' object has no attribute 'has_key'
ehsan@debian:~/Desktop$
I got this error
How do I fix it?

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

More
25 Feb 2024 17:52 #294415 by Aciera
Replied by Aciera on topic Axis Position Logger
Just a few things to get you started, I copied 'emclog.ui' into my home directory and  I got the gui started with the following code (start Linuxcnc first):

Warning: Spoiler!


 
The following user(s) said Thank You: Ehsan_R

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

More
25 Feb 2024 17:57 #294416 by Aciera
Replied by Aciera on topic Axis Position Logger
Note that this modification is not correct
[i]    def sendToAxis(self):

        sys.stdout.write(self.gcodeLW(0, 1))[/i]

but the original is also not working:
    def sendToAxis(self):

        sys.stdout.write(self.g_code.get(0.0, END))

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

Time to create page: 0.104 seconds
Powered by Kunena Forum