-
- All Implemented Interfaces:
-
se.cpacsystems.assist.linkage.ToolContract
public class ToolManager implements ToolContract
Manager for tool related operations.
-
-
Constructor Summary
Constructors Constructor Description ToolManager(Context appC)
-
Method Summary
Modifier and Type Method Description static ContentValuestoolDataToContentValues(ToolData tool)Create ContentValues from a tool data object. static Array<byte>point3DListToBlob(ArrayList<Point3D> points)Create byte array "blob" from a list of Point3D objects. static ArrayList<Point3D>blobToPoint3DList(Array<byte> asBytes)Create a list of Point3D objects from a byte array "blob". static ToolDatacursorToToolData(Cursor cursor)Translates calls from ToolTool data static LinkageConfigDatacursorToLinkData(Cursor cursor)Translates database call for linkages to linkageDataTiltRotator id is forgotten! static ContentValuesTiltSensorDataToContentValues(TiltSensorData tiltSensorData)Translates TiltSensorData to ContentValuesTiltSensorData id is forgotten! static TiltSensorDatacursorToTiltSensorData(Cursor cursor)Translates database call for linkages to TiltSensorData voidregisterActiveToolObserver(ContentObserver co)voidregisterToolDbChangeObserver(ContentObserver co)voidregisterSensorChangeObserver(ContentObserver co)synchronized booleanremoveTool(int tool)Remove toolLinkages linked to tool will be ereased booleansetActiveTool(int tool)Set Active tool Id intgetActiveTool()getActiveTool returns ToolId of active tool ToolDatagetActiveToolData()Returns a ToolData object with the data of the tool which is currently selected as the active tool by the user. intgetFixedTool()Returns status of fixed tool0 for no fixed tool ToolDatagetFixedToolData()Returns Tooldata of fixed tool booleansetFixedTool(int tool)Returns result of set fixed tool0 for no fixed toolNormally done by linkage service ToolDatagetToolData(int toolId)Returns tool data for specified tool. ToolDatagetToolDataBySmartAttachmentStatus(int smartAttachmentStatus)Returns ToolData that do not have an updated smart attachment copy intgetToolId(String activeLinkageProperty)Returns ToolID for active propertyProperties such as public static final String ACTIVE_TOOL = "activeTool";FIXED_TOOL , ACTIVE_SENSOR_LINKAGE intgetTiltRotatorId(String activeLinkageProperty)ToolDatagetToolData(String activeLinkageProperty)Returns ToolData for active propertyProperties such as public static final String ACTIVE_TOOL = "activeTool";FIXED_TOOL , ACTIVE_SENSOR_LINKAGE , ACTIVE_TILTROTATOR, DEFAULT_TILTROTATOR List<ToolData>getToolList()Retrieves a list with ToolData objects for all defined tools in the database. List<ToolData>getTiltTools()Get list of tilt tools synchronized voidaddOrUpdateTool(ToolData tool)Create or Update toolInserts new toolData with return updated id.Updates specified tool of id is inserted. intsetActiveTiltIMU(int sn)Set serial number of active tilt imu intgetActiveTiltIMU()Get serial number of active tilt imu intgetActiveTiltType()Get type of active tilt imu TiltSensorDatagetActiveSensorInfo()Get active tilt sensor List<TiltSensorData>getTiltSensors()Get list of tilt sensors -
-
Constructor Detail
-
ToolManager
ToolManager(Context appC)
-
-
Method Detail
-
toolDataToContentValues
static ContentValues toolDataToContentValues(ToolData tool)
Create ContentValues from a tool data object.
-
point3DListToBlob
static Array<byte> point3DListToBlob(ArrayList<Point3D> points)
Create byte array "blob" from a list of Point3D objects.
-
blobToPoint3DList
static ArrayList<Point3D> blobToPoint3DList(Array<byte> asBytes)
Create a list of Point3D objects from a byte array "blob".
-
cursorToToolData
static ToolData cursorToToolData(Cursor cursor)
Translates calls from ToolTool data
- Parameters:
cursor- list of cursors in
-
cursorToLinkData
static LinkageConfigData cursorToLinkData(Cursor cursor)
Translates database call for linkages to linkageDataTiltRotator id is forgotten! (not included)
-
TiltSensorDataToContentValues
static ContentValues TiltSensorDataToContentValues(TiltSensorData tiltSensorData)
Translates TiltSensorData to ContentValuesTiltSensorData id is forgotten! (not included)
-
cursorToTiltSensorData
static TiltSensorData cursorToTiltSensorData(Cursor cursor)
Translates database call for linkages to TiltSensorData
-
registerActiveToolObserver
void registerActiveToolObserver(ContentObserver co)
-
registerToolDbChangeObserver
void registerToolDbChangeObserver(ContentObserver co)
-
registerSensorChangeObserver
void registerSensorChangeObserver(ContentObserver co)
-
removeTool
synchronized boolean removeTool(int tool)
Remove toolLinkages linked to tool will be ereased
- Parameters:
tool- id to be removed
-
setActiveTool
boolean setActiveTool(int tool)
Set Active tool Id
- Parameters:
tool- id
-
getActiveTool
int getActiveTool()
getActiveTool returns ToolId of active tool
-
getActiveToolData
ToolData getActiveToolData()
Returns a ToolData object with the data of the tool which is currently selected as the active tool by the user.
The following permission is required for third parties to access the tool data:
- se.cpacsystems.permission.READ_TOOL
-
getFixedTool
int getFixedTool()
Returns status of fixed tool0 for no fixed tool
-
getFixedToolData
ToolData getFixedToolData()
Returns Tooldata of fixed tool
-
setFixedTool
boolean setFixedTool(int tool)
Returns result of set fixed tool0 for no fixed toolNormally done by linkage service
-
getToolData
ToolData getToolData(int toolId)
Returns tool data for specified tool.
- Parameters:
toolId- id of tool
-
getToolDataBySmartAttachmentStatus
ToolData getToolDataBySmartAttachmentStatus(int smartAttachmentStatus)
Returns ToolData that do not have an updated smart attachment copy
- Parameters:
smartAttachmentStatus- status whether tool is updated in smart attachment database
-
getToolId
int getToolId(String activeLinkageProperty)
Returns ToolID for active property
Properties such as public static final String ACTIVE_TOOL = "activeTool";FIXED_TOOL , ACTIVE_SENSOR_LINKAGE- Parameters:
activeLinkageProperty- property in the properties table
-
getTiltRotatorId
@Deprecated() int getTiltRotatorId(String activeLinkageProperty)
-
getToolData
ToolData getToolData(String activeLinkageProperty)
Returns ToolData for active property
Properties such as public static final String ACTIVE_TOOL = "activeTool";FIXED_TOOL , ACTIVE_SENSOR_LINKAGE , ACTIVE_TILTROTATOR, DEFAULT_TILTROTATOR
-
getToolList
List<ToolData> getToolList()
Retrieves a list with ToolData objects for all defined tools in the database.
The following permission is required to access the tool data:
- se.cpacsystems.permission.READ_TOOL
-
getTiltTools
List<ToolData> getTiltTools()
Get list of tilt tools
-
addOrUpdateTool
synchronized void addOrUpdateTool(ToolData tool)
Create or Update toolInserts new toolData with return updated id.Updates specified tool of id is inserted.
- Parameters:
tool- to be inserted / updated
-
setActiveTiltIMU
int setActiveTiltIMU(int sn)
Set serial number of active tilt imu
- Parameters:
sn- serial number of sensor, send 0 to reset current active tool
-
getActiveTiltIMU
int getActiveTiltIMU()
Get serial number of active tilt imu
-
getActiveTiltType
int getActiveTiltType()
Get type of active tilt imu
-
getActiveSensorInfo
TiltSensorData getActiveSensorInfo()
Get active tilt sensor
-
getTiltSensors
List<TiltSensorData> getTiltSensors()
Get list of tilt sensors
-
-
-
-