Don't like ads? PRO users don't see any ads ;-)
Guest

xuyv first 100 linnes

By: a guest on May 5th, 2012  |  syntax: None  |  size: 4.13 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. From f605fc571f913bf24ac8ff22b9a40007b4a0b0eb Mon Sep 17 00:00:00 2001
  2. From: SammelLothar <SammelLothar@gmx.de>
  3. Date: Tue, 24 Jan 2012 21:41:51 +0100
  4. Subject: [PATCH] foam-xyuv-Modification-2.6-pre
  5.  
  6. ---
  7.  lib/python/hershey.py                 |   10 +-
  8.  lib/python/rs274/glcanon.py           |  287 +++++++++++++++++++++++++++++----
  9.  nc_files/foam-xyuv.ngc                |   25 +++
  10.  share/axis/tcl/axis.tcl               |    5 +
  11.  src/emc/usr_intf/axis/scripts/axis.py |   52 ++++++-
  12.  5 files changed, 339 insertions(+), 40 deletions(-)
  13.  create mode 100644 nc_files/foam-xyuv.ngc
  14.  
  15. diff --git a/lib/python/hershey.py b/lib/python/hershey.py
  16. index 16bb02a..6a07a3d 100644
  17. --- a/lib/python/hershey.py
  18. +++ b/lib/python/hershey.py
  19. @@ -17,7 +17,7 @@
  20.  
  21.  from minigl import *
  22.  
  23. -translate = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '-': 10, '.': 11, 'X': 12, 'Y': 13, 'Z': 14, 'G': 15}
  24. +translate = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '-': 10, '.': 11, 'X': 12, 'Y': 13, 'Z': 14, 'G': 15,'V':16,'U':17}
  25.  
  26.  class Hershey:
  27.      def __init__(self):
  28. @@ -92,8 +92,12 @@ class Hershey:
  29.            (160.0, 380.0), (200.0, 420.0), (260.0, 440.0), (280.0, 440.0),
  30.            (340.0, 420.0), (380.0, 380.0), (400.0, 320.0),
  31.            (400.0, 280.0), (270.0, 280.0)
  32. -
  33. -          ]]
  34. +          ]],
  35. +    # V
  36. +        [[(60, 20), (200, 440)], [(340, 20), (200, 440)]],
  37. +    # U
  38. +        [[(60, 20), (60, 400),(95,410),(130,420),(165,430),(200,440)],
  39. +        [(340, 20),(340, 400),(305, 410),(270, 420),(235, 430),(200, 440)]]
  40.  
  41.         )
  42.  
  43. diff --git a/lib/python/rs274/glcanon.py b/lib/python/rs274/glcanon.py
  44. index 75322bb..d704446 100644
  45. --- a/lib/python/rs274/glcanon.py
  46. +++ b/lib/python/rs274/glcanon.py
  47. @@ -78,6 +78,10 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
  48.          self.g5x_offset_u = 0.0
  49.          self.g5x_offset_v = 0.0
  50.          self.g5x_offset_w = 0.0
  51. +        self.xyuv_live_plot_data = []
  52. +        self.grid_space = 10.0
  53. +        self.xy_plane_z_position = 5.0
  54. +        self.uv_plane_z_position = 30.0
  55.  
  56.      def comment(self, arg):
  57.          if arg.startswith("AXIS,"):
  58. @@ -86,7 +90,35 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
  59.              if command == "stop": raise KeyboardInterrupt
  60.              if command == "hide": self.suppress += 1
  61.              if command == "show": self.suppress -= 1
  62. -
  63. +            if command == "XY_Z_POS":
  64. +                if len(parts) > 2 :
  65. +                    try:
  66. +                        self.xy_plane_z_position = float(parts[2])
  67. +                        if 210 in self.state.gcodes:
  68. +                            self.xy_plane_z_position = self.xy_plane_z_position / 25.4
  69. +                    except:
  70. +                        self.xy_plane_z_position = 5.0/25.4
  71. +            if command == "UV_Z_POS":
  72. +                if len(parts) > 2 :
  73. +                    try:
  74. +                        self.uv_plane_z_position = float(parts[2])
  75. +                        if 210 in self.state.gcodes:
  76. +                            self.uv_plane_z_position = self.uv_plane_z_position / 25.4
  77. +                    except:
  78. +                        self.uv_plane_z_position = 30.0
  79. +            if command == "GRID":
  80. +                if len(parts) > 2 :
  81. +                    try:
  82. +                        self.grid_space = float(parts[2])
  83. +                        if 210 in self.state.gcodes:
  84. +                            self.grid_space=self.grid_space / 25.4
  85. +                    except:
  86. +                        self.grid_space = 5.0/25.4
  87. +                
  88. +    def get_grid_space(self):return self.grid_space
  89. +    def get_xy_plane_z_position(self):return self.xy_plane_z_position
  90. +    def get_uv_plane_z_position(self):return self.uv_plane_z_position
  91. +
  92.      def message(self, message): pass
  93.  
  94.      def check_abort(self): pass
  95. @@ -96,7 +128,21 @@ class GLCanon(Translated, ArcsToSegmentsMixin):
  96.          self.lineno = self.state.sequence_number
  97.  
  98.      def draw_lines(self, lines, for_selection, j=0):
  99. -        return linuxcnc.draw_lines(self.geometry, lines, for_selection)
  100. +        if 171 in self.state.gcodes: