zlp_projection_element module

This module contains utility classes and methods which ease the management and operation of projection elements.

class z_laser_zlp1.zlp_projection_element.ProjectionElement(module_id, thrift_client)[source]

Bases: object

This class implement the functions related with projection elements.

Parameters:
  • module_id (str) – function module identification name
  • thrift_client (object) – object with the generated client to communicate with the projector
module_id

function module identification name

Type:str
figures_list

list with the figures’ identificator names

Type:list
default_projection_element

basic object initialization for Projection Elements

Type:object
__init__(module_id, thrift_client)[source]

Initialize the ProjectionElement object.

init_projection_element(elem)[source]

Initialize new projection element.

Parameters:elem (object) – projection element object to initialize
Returns:projection element object with fields initialized
Return type:object
create_polyline(name)[source]

Create and initialize a new polyline object.

Parameters:name (str) – polyline name
Returns:polyline struct with fields initialized
Return type:object
define_polyline(cs_name, proj_elem_params, reflection=False)[source]

Create a new line as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the parameters to identify and define a line as a new projection element
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

define_arrow(cs_name, proj_elem_params, reflection=False)[source]

Create a new arrow as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the parameters to identify and define an arrow as a new projection element
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

define_rectangle(cs_name, proj_elem_params, points, reflection=False)[source]

Create a new rectangle as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the parameters to identify and define a rectangle as a new projection element
  • points (list) – 4 points list of rectangle corners
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

create_curve(name, curve_type)[source]

Create and initialize a new curve (circle, arc or oval) object.

Parameters:name (str) – curve name
Returns:curve object with fields initialized
Return type:curve (object)
define_circle(cs_name, proj_elem_params, reflection=False)[source]

Define a new circle as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the necessary parameters to identify and define a circle as a
  • projection element (new) –
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

define_arc(cs_name, proj_elem_params, reflection=False)[source]

Create a new arc as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the necessary parameters to identify and define an arc as a
  • projection figure (new) –
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

define_oval(cs_name, proj_elem_params, reflection=False)[source]

Create a new oval as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the necessary parameters to identify and define an oval as a
  • projection figure (new) –
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

create_text(name)[source]

Create and initialize a new text object.

Parameters:name (str) – text object name
Returns:text object with fields initialized
Return type:text (object)
define_text(cs_name, proj_elem_params, reflection=False)[source]

Create a new text as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • proj_elem_params (object) – object with the necessary parameters to identify and define a text as a
  • projection figure (new) –
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

get_figure(params)[source]

Get properties of a defined projection element.

Parameters:params (object) – object with the necessary parameters to identify the projection element
Returns:the first value in the returned tuple is the object of the projection element, the second is a bool success value and the third is an information message string
Return type:tuple[object, bool, str]
get_polyline(name, proj_elem)[source]

Get properties of a defined polyline.

Parameters:
  • name (str) – name of the polyline
  • params (object) – object to fill with the projection element properties
Returns:

object with the properties of the polyline

Return type:

object

get_circle(name, proj_elem)[source]

Get properties of a defined circle.

Parameters:
  • name (str) – name of the circle
  • params (object) – object to fill with the projection element properties
Returns:

object with the properties of the polyline

Return type:

object

get_arc(name, proj_elem)[source]

Get properties of a defined arc.

Parameters:
  • name (str) – name of the arc
  • params (object) – object to fill with the projection element properties
Returns:

object with the properties of the polyline

Return type:

object

get_oval(name, proj_elem)[source]

Get properties of a defined oval.

Parameters:
  • name (str) – name of the oval
  • params (object) – object to fill with the projection element properties
Returns:

object with the properties of the polyline

Return type:

object

get_text(name, proj_elem)[source]

Get properties of a defined text.

Parameters:
  • name (str) – name of the text
  • params (object) – object to fill with the projection element properties
Returns:

object with the properties of the polyline

Return type:

object

activate_figure(figure_params, status)[source]

Hide (deactivate) or unhide (activate hidden) a projection element from the active reference system.

Parameters:
  • figure_params (object) – object with the necessary parameters to identify the projection element
  • status (bool) – true if activate projection element, false otherwise
Returns:

the first value in the returned tuple is a bool success value and the second value is an information message string

Return type:

tuple[bool, str]

delete_figure(figure_params)[source]

Delete a projection element from the active reference system.

Parameters:figure_params (object) – object with the necessary parameters to identify the projection element
Returns:the first value in the returned tuple is a bool success value and the second value is an information message string
Return type:tuple[bool, str]
translate_figure(figure_params, dx=0, dy=0, dz=0)[source]

Translate a projection element from one position to another.

Parameters:
  • figure_params (object) – object with the necessary parameters to identify the projection element
  • dx (float) – offset in x direction
  • dy (float) – offset in y direction
  • dz (float) – offset in z direction
Returns:

the first value in the returned tuple is a bool success value and the second value is an information message string

Return type:

tuple[bool, str]

scale_figure(figure_params, scale_factor)[source]

Scale size of a projection element.

Parameters:
  • figure_params (object) – object with the necessary parameters to identify the projection element
  • scale_factor (float) – scalation factor of the projection element
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]

rotate_figure(figure_params, x_angle, y_angle, z_angle)[source]

Rotate a projection element an angle.

Parameters:
  • proj_elem_params (object) – object with the necessary parameters to identify the projection element
  • rotation_angle (float) – rotation angle of the projection element [degrees]
Returns:

the first value in the returned tuple is a bool success value and the second value is an information message string

Return type:

tuple[bool, str]

cs_axes_create(cs_params, proj_elem_params)[source]

Create projection elements of the reference system’s origin axes.

Parameters:
  • cs_params (object) – object with the definition parameters of the reference system
  • proj_elem_params (object) – object to fill with the projection element properties
Returns:

the first value in the returned tuple is a bool success value and the second value is an information message string

Return type:

tuple[bool, str]

cs_frame_create(cs_name, proj_elem_params, points)[source]

Create projection element of the reference system’s frame.

Parameters:
  • cs_name (str) – name of the reference system
  • proj_elem_params (object) – object to fill with the projection element properties
  • points (list) – list of the user system reference points
Returns:

the first value in the returned tuple is a bool success value and the second value is an information message string

Return type:

tuple[bool, str]

define_pointer(cs_name, pointer)[source]

Create a new pointer as projection element.

Parameters:
  • cs_name (str) – name of coordinate system which the new projection element will be added
  • pointer (object) – object with the necessary parameters to identify and define a pointer as a
  • projection figure (new) –
Returns:

the first value in the returned tuple is a bool success value and the second value in the tuple is an information message string

Return type:

tuple[bool, str]