chaotic_highlighting

More
28 Jan 2020 12:15 #156001 by nkp
chaotic_highlighting was created by nkp
Hi!
When the Gcode contains subroutines,
chaotic highlighting of the active line is observed.
(I"m using hal_sourceview.py )
The reason is clear - lcnc highlights the line number from the "main" code ,
when a subroutine is found - jumps to the line (line number) from the subroutine.
Is there any solution to this?

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

More
28 Jan 2020 13:55 #156008 by cmorley
Replied by cmorley on topic chaotic_highlighting
What version of linuxcnc?
I thought this problem was worked around already.

Chris

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

More
28 Jan 2020 14:13 - 28 Jan 2020 14:14 #156010 by nkp
Replied by nkp on topic chaotic_highlighting
lcnc 2.7.14
but userscreen

gtk
hal_sourceview.py
Last edit: 28 Jan 2020 14:14 by nkp.

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

More
28 Jan 2020 14:31 - 28 Jan 2020 14:31 #156012 by cmorley
Replied by cmorley on topic chaotic_highlighting
There is comments in the code of hal_glib about subroutine line changes.
sourceview uses the line-changed and file-loaded signals.

It's not clear to me if it was thought to be fixed - maybe was just improved...
I would make a bug report.

Chris
Last edit: 28 Jan 2020 14:31 by cmorley.

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

More
10 Feb 2020 07:51 #156939 by nkp
Replied by nkp on topic chaotic_highlighting

I would make a bug report.

github.com/LinuxCNC/linuxcnc/issues/681

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

More
10 Feb 2020 13:10 - 10 Feb 2020 14:23 #156947 by nkp
Replied by nkp on topic chaotic_highlighting
del
Last edit: 10 Feb 2020 14:23 by nkp.

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

More
10 Feb 2020 15:31 - 10 Feb 2020 15:32 #156961 by cmorley
Replied by cmorley on topic chaotic_highlighting
I would think call level would be more likely.
maybe:
if self.stat.call_level == 0:
    self.old['line']  = self.stat.motion_line

Chris
Last edit: 10 Feb 2020 15:32 by cmorley.

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

More
10 Feb 2020 15:59 - 10 Feb 2020 16:03 #156964 by nkp
Replied by nkp on topic chaotic_highlighting
I tried to do
line_old = old.get('line', None)
        line_new = self.old['line']
        if line_new > line_old:
            self.emit('line-changed', line_new)
that would not jump UP
but it doesn't work (although it should seem to work))
Last edit: 10 Feb 2020 16:03 by nkp.

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

More
10 Feb 2020 16:05 - 10 Feb 2020 16:06 #156966 by nkp
Replied by nkp on topic chaotic_highlighting
for now
def set_line_number(self,linenum):
        self.offset = linenum
        self.check_offset()
        self.highlight_line(self.gstat, self.offset)
        if linenum == 0:   #nkp
            self.line_mem  = 0  



    def highlight_line(self, w, l):
        if l > self.line_mem :  #nkp
            self.line_mem  = l  
        else:
            return
	....
	....
hal_sourceview.py
Last edit: 10 Feb 2020 16:06 by nkp.

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

More
11 Feb 2020 08:32 - 11 Feb 2020 08:33 #157027 by nkp
Replied by nkp on topic chaotic_highlighting
Axis
--- /home/nkp//axis
+++ /home/nkp/linuxcnc/configs/jog/axis
@@ -664,7 +664,8 @@
         self.notifications_clear = False
         self.notifications_clear_info = False
         self.notifications_clear_error = False
-
+        self.current_line_mem = 0
+        
     def start(self):
         if self.running.get(): return
         if not os.path.exists(linuxcnc.nmlfile):
@@ -734,14 +735,16 @@
                 root_window.tk.eval(pane_top + ".tabs raise manual")
             if (self.current_task_mode == linuxcnc.MODE_MDI):
                 root_window.tk.eval(pane_top + ".tabs raise mdi")
-            if (self.current_task_mode == linuxcnc.MODE_AUTO):
+            if (self.current_task_mode != linuxcnc.MODE_AUTO):
                 # not sure if anything needs to be done for this
                 pass
+                self.current_line_mem = 0 
 
         self.after = self.win.after(update_ms, self.update)
-
-        self.win.set_current_line(self.stat.id or self.stat.motion_line)
-
+        if (self.stat.id or self.stat.motion_line) > self.current_line_mem :
+            self.win.set_current_line(self.stat.id or self.stat.motion_line)
+            self.current_line_mem = (self.stat.id or self.stat.motion_line)
+            
         speed = self.stat.current_vel
 
         limits = soft_limits()

Of course, this is not a solution to the problem ...
but the line jumps a little less =)
Last edit: 11 Feb 2020 08:33 by nkp.

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

Moderators: mhaberlerHansU
Time to create page: 0.084 seconds
Powered by Kunena Forum