当前位置: 首页>>代码示例>>Python>>正文


Python Encoder.encode_axes方法代码示例

本文整理汇总了Python中Encoder.encode_axes方法的典型用法代码示例。如果您正苦于以下问题:Python Encoder.encode_axes方法的具体用法?Python Encoder.encode_axes怎么用?Python Encoder.encode_axes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Encoder的用法示例。


在下文中一共展示了Encoder.encode_axes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: queue_point_new_ext

# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import encode_axes [as 别名]
  def queue_point_new_ext(self, position, dda_rate, relative_axes, distance, feedrate):
    """
    Queue a position with the new style!  Moves to a certain position over a given duration
    with either relative or absolute positioning.  Relative vs. Absolute positioning
    is done on an axis to axis basis.

    @param list position: A 5 dimentional position in steps specifying where each axis should move to
    @param int dda_rate: Steps per second along the master axis
    @param list relative_axes: Array of axes whose coordinates should be considered relative
    @param float distance: distance in millimeters moved in (x,y,z) space OR if distance(x,y,z) == 0, then max(distance(A),distance(B))
    @param float feedrate: the actual feedrate in units of millimeters/second
    """
    if len(position) != self.extendedPointLength:
      raise PointLengthError(len(position))

    payload = struct.pack(
      '<BiiiiiIBfh',
      host_action_command_dict['QUEUE_POINT_NEW_EXT'],
      position[0], position[1], position[2], position[3], position[4],
      dda_rate,
      Encoder.encode_axes(relative_axes),
      float(distance),
      int(float(feedrate)*64.0)
    )

    self.writer.send_action_payload(payload)
开发者ID:jetty840,项目名称:s3g,代码行数:28,代码来源:s3g.py

示例2: recall_home_positions

# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import encode_axes [as 别名]
  def recall_home_positions(self, axes):
    """
    Recall and move to the home positions written to the EEPROM
    @param axes: Array of axis names ['x', 'y', ...] whose position should be saved
    """
    payload = struct.pack(
      '<BB',
      host_action_command_dict['RECALL_HOME_POSITIONS'], 
      Encoder.encode_axes(axes)
    )

    self.writer.send_action_payload(payload)
开发者ID:jetty840,项目名称:s3g,代码行数:14,代码来源:s3g.py

示例3: store_home_positions

# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import encode_axes [as 别名]
  def store_home_positions(self, axes):
    """
    Write the current axes locations to the EEPROM as the home position
    @param list axes: Array of axis names ['x', 'y', ...] whose position should be saved
    """
    payload = struct.pack(
      '<BB',
      host_action_command_dict['STORE_HOME_POSITIONS'], 
      Encoder.encode_axes(axes)
    )

    self.writer.send_action_payload(payload)
开发者ID:jetty840,项目名称:s3g,代码行数:14,代码来源:s3g.py

示例4: find_axes_maximums

# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import encode_axes [as 别名]
  def find_axes_maximums(self, axes, rate, timeout):
    """
    Move the toolhead in the positive direction, along the specified axes,
    until an endstop is reached or a timeout occurs.
    @param list axes: Array of axis names ['x', 'y', ...] to move
    @param double rate: Movement rate, in steps/??
    @param double timeout: Amount of time to move in seconds before halting the command
    """
    payload = struct.pack(
      '<BBIH',
      host_action_command_dict['FIND_AXES_MAXIMUMS'],
      Encoder.encode_axes(axes),
      rate,
      timeout
    )

    self.writer.send_action_payload(payload)
开发者ID:jetty840,项目名称:s3g,代码行数:19,代码来源:s3g.py

示例5: toggle_axes

# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import encode_axes [as 别名]
  def toggle_axes(self, axes, enable):
    """
    Used to explicitly power steppers on or off.
    @param list axes: Array of axis names ['x', 'y', ...] to configure
    @param boolean enable: If true, enable all selected axes. Otherwise, disable the selected
           axes.
    """
    axes_bitfield = Encoder.encode_axes(axes)
    if enable:
      axes_bitfield |= 0x80

    payload = struct.pack(
      '<BB',
      host_action_command_dict['ENABLE_AXES'], 
      axes_bitfield
    )

    self.writer.send_action_payload(payload)
开发者ID:jetty840,项目名称:s3g,代码行数:20,代码来源:s3g.py

示例6: queue_extended_point_new

# 需要导入模块: import Encoder [as 别名]
# 或者: from Encoder import encode_axes [as 别名]
  def queue_extended_point_new(self, position, duration, relative_axes):
    """
    Queue a position with the new style!  Moves to a certain position over a given duration
    with either relative or absolute positioning.  Relative vs. Absolute positioning
    is done on an axis to axis basis.

    @param list position: A 5 dimentional position in steps specifying where each axis should move to
    @param int duration: The total duration of the move in miliseconds
    @param list relative_axes: Array of axes whose coordinates should be considered relative
    """
    if len(position) != self.extendedPointLength:
      raise PointLengthError(len(position))

    payload = struct.pack(
      '<BiiiiiIB',
      host_action_command_dict['QUEUE_EXTENDED_POINT_NEW'],
      position[0], position[1], position[2], position[3], position[4],
      duration, 
      Encoder.encode_axes(relative_axes)
    )

    self.writer.send_action_payload(payload)
开发者ID:jetty840,项目名称:s3g,代码行数:24,代码来源:s3g.py


注:本文中的Encoder.encode_axes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。