Turntable

Turntable is the graphical space markup element that is used to define turntables. Agents (material items) passing through it keep their current orientation on the conveyor.

Once placed on a conveyor, the turntable divides it into two independent conveyors, working in the same Conveyor Network. Turntable may connect unlimited number of conveyors at any angle.

Turntable has its own transportation speed (it may differ from the speed of the connected conveyors).

Note: Other markup elements can be used if:

The width of the turntable is automatically adjusted once you change the width of the conveyor

The time required to switch to another conveyor depends on the defined Rotation speed of the turntable.

Note: Conveyor expects items of the same type after the turntable.

 To draw a turntable

The turntable can be drawn in either of the following ways:
  1. Drag the  Turntable element from the Space Markup section of the  Material Handling Library palette to the agent diagram and place it at any desired location of the graphical editor or over the conveyor. Release the mouse button when done. You may change the element's location by dragging it along the conveyor.
  2. Connect two conveyors at any desired angle (except for the right angle 90°). The turntable will be automatically created in the point of junction.
    Note: The Transfer Table element will be created instead of the turntable if the conveyors are connected at right angle (90°).
To adjust position of a turntable
  1. Click the turntable you need to edit.
  2. Drag the turntable to the desired position on the current conveyor.
    The conveyor will adjust its shape in accordance with the turntable's new position.

Properties

General

Name – The name of this turntable. The name is used to identify and access the element from code and Material Handling Library blocks' properties.

Ignore – If selected, the turntable is excluded from the model.

Visible on upper level – If selected, the turntable is also visible on the upper level where this agent lives.

Lock – If selected, the turntable is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them.

Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Material item type - The type of the material item that is processed at this turntable. This type is automatically taken from the conveyor this turntable is located on. Do not change the material item type since the conveyor expects items of the same type after the turntable.

Speed - The speed at which the turntable moves the agents (material items).

Rotation speed - The speed of turntable rotation.

Actions

In all the actions, the current material item is accessible as the local variable agent.

On leading edge enter - Here you can type Java code that will be executed when the leading edge of the material item reaches the turntable on the conveyor.

On trailing edge enter - Here you can type Java code that will be executed when the trailing edge of the material item reaches the turntable.

On leading edge exit - Here you can type Java code that will be executed when the leading edge of the material item leaves the turntable.

On trailing edge exit - Here you can type Java code that will be executed when the trailing edge of the material item leaves the turntable.

On failed - Here you can type Java code that will be executed in case of turntable failure.

On repaired - Here you can type Java code that will be executed when the turntable is repaired.

Appearance

Fill color – Shape's fill color. Choose No color, if you do not want the area to be filled.

Line color – Outline color. Choose No color, if you do not want outline to be drawn.

Position and size

X – X-coordinate of the turntable's start point.

Y – Y-coordinate of the turntable's start point.

Z – Z-coordinate of the turntable's start point.

Advanced

Show in – Here you can choose whether you want the shape to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.

Show name – If selected, the shape name is displayed on the graphical diagram.

Functions

Speed and delay

Function

Description

double getSpeed(SpeedUnits units)

Returns the speed of the turntable in the specified speed units.

Parameter:
units
- a constant defining the speed units

double setSpeed(double speed, SpeedUnits units)

Sets the new speed of the turntable in the specified speed units.

Parameter:
speed - a new speed value
units - a constant defining the speed units

double getRotationSpeed(RotationSpeedUnits units)

Returns the turntable's speed (in the specified speed units).

Parameter:
units
- a constant defining the speed units

double setRotationSpeed(double rotationSpeedRotationSpeedUnits units)

Sets the turntable's rotation speed (in the specified speed units) when switcing from one conveyor to another.

Parameter:
rotationSpeed - a new speed value
units - a constant defining the time units


Agents (material items)

Function

Description

int size()

Returns the current number of agents (material items) on the turntable, returns null if none.

T getAgent(int index)

Returns the agent at a given position (counted from 0, from the exit). Throws error in case of invalid (or out-of-bounds) index.

Parameter: index - the index of the agent

List getAgents()

Returns the list of agents (material items) that are currently located on the turntable, returns null if none. 

boolean contains(Agent agent)

Returns true is the given agent (material item) is on the turntable, returns false otherwise.

Parameter: agent - the agent

boolean removeAgent(Agent agent)

Removes the given agent from the turntable. The agent will be removed only if it is currently located on the turntable.

If the agent was removed successfully, returns true, otherwise returns false.

Parameter: agent - the agent (material item) to be removed from the turntable.


Conveyors and network

Function

Description

List getIncomingPaths()

Returns the list of all incoming conveyors, i.e. the conveyors, transferring agents (material items) to the turntable, returns null if none. 

List getOutgoingPaths()

Returns the list of all outgoing conveyors, i.e. the conveyors, accepting agents (material items) from the turntable, returns null if none. 

ConveyorPath getConnection(int index)

Returns conveyor connected to the turntable by the provided index.

Parameter:
index
- the connection index.

List  getConnections()

Returns the list of conveyors connected to the turntable, returns null if none. 

int getConnectionsCount()

Returns the number of conveyors connected to the turntable, returns null if none. 

ConveyorNetwork getNetwork()

Returns the network the turntable belongs to.


Failure / repair

Function

Description

boolean isFailed()

Returns true if the turntable failed (broke down) and is not operating, returns false otherwise.

boolean fail()

Initiates turntable failure. The turntable stops.

boolean repair()

Repairs the turntable, makes it available again.

Visibility

Function

Description

boolean isVisible()

Returns true if the turntable is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the turntable.

Parameter: v - visibility. If v is true - the turntable is set to be visible, if it is false - not visible.


Сolor / texture

Function

Description

Color getLineColor()

Returns the line color of the turntable, or null if the turntable has no color or uses a texture (in this case use getLineTexture() to get the turntable's texture).

Texture getLineTexture()

Returns the line texture of the turntable or null if the turntable has no texture but uses a color (in this case use getLineColor() to get the turntable's color).

void setLineColor(Color lineColor)

Sets the line color of the turntable.

Parameter: lineColor - the new color

void setLineColor(Paint lineColor)

Sets the line color (or texture) of the turntable.

Parameter: lineColor - the new texture

Color getFillColor()

Returns the fill color of the turntable, or null if shape has no fill color or has textured fill (in this case getFillTexture() should be used instead) 

Texture getFillTexture()

Returns the fill texture of the turntable, if the turntable has fill texture, or null if the turntable has no texture but uses a color (in this case use getFillColor() to get the turntable's color).

void setFillColor(Color fillColor)

Sets the fill color of the turntable.

Parameter:
fillColor - the new fill color, if null, the turntable is not filled

void setFillColor(Paint fillColor)

Sets the fill color (or Texture) of the shape.

Parameter:
fillColor - the new fill color, if null, the shape is not filled


Position

Function

Description

double getX()

Returns the X coordinate of the center point of the turntable.

double getY()

Returns the Y coordinate of the center point of the turntable.

double getZ()

Returns the Z coordinate of the center point of the turntable.

Point getXYZ(Point out)

Returns the (X, Y, Z) coordinates of the center point of the given turntable

Parameter:
out
- the output Point object to write the result to. The object may be null.


Related topics

 Space markup for material handling models

 Conveyor

 Material Handling Library

 API reference: ConveyorTurntable class