@kuriousdesign/machine-sdk
Version:
Shared data types and helpers for machine-related repositories
139 lines (138 loc) • 6.05 kB
JavaScript
"use strict";
// {attribute 'qualified_only'}
// {attribute 'strict'}
// TYPE RobWaypoints :
// (
// NONE := 0, //do not remove or change this
// HOME := 1, //identifier for the robot's home position
// FIXTURE_LEFT_PERCH := 2, //identifier for the fixture perch position
// FIXTURE_RIGHT_PERCH := 3, //identifier for the fixture perch position
// TOOL_PERCH :=4
// );
// END_TYPE
Object.defineProperty(exports, "__esModule", { value: true });
exports.RobTasks = exports.RobTools = exports.RobWaypoints = void 0;
exports.robotWaypointToString = robotWaypointToString;
exports.robotToolToString = robotToolToString;
exports.robotTaskToString = robotTaskToString;
var RobWaypoints;
(function (RobWaypoints) {
RobWaypoints[RobWaypoints["NONE"] = 0] = "NONE";
RobWaypoints[RobWaypoints["HOME"] = 1] = "HOME";
RobWaypoints[RobWaypoints["FIXTURE_LEFT_PERCH"] = 2] = "FIXTURE_LEFT_PERCH";
RobWaypoints[RobWaypoints["FIXTURE_RIGHT_PERCH"] = 3] = "FIXTURE_RIGHT_PERCH";
RobWaypoints[RobWaypoints["TOOL_PERCH"] = 4] = "TOOL_PERCH";
})(RobWaypoints || (exports.RobWaypoints = RobWaypoints = {}));
function robotWaypointToString(waypoint) {
switch (waypoint) {
case RobWaypoints.NONE:
return 'None';
case RobWaypoints.HOME:
return 'Home';
case RobWaypoints.FIXTURE_LEFT_PERCH:
return 'Fixture Left Perch';
case RobWaypoints.FIXTURE_RIGHT_PERCH:
return 'Fixture Right Perch';
case RobWaypoints.TOOL_PERCH:
return 'Tool Perch';
default:
return 'Unknown';
}
}
// {attribute 'qualified_only'}
// {attribute 'strict'}
// TYPE RobTools :
// (
// NONE := 0, //do not remove or change this
// WEIGHING_GRIPPER := 1, //identifier for the weighing gripper tool
// APPLICATOR := 2, //identifier for the applicator tool
// CAMERA := 3 //identifier for the camera tool
// );
// END_TYPE
var RobTools;
(function (RobTools) {
RobTools[RobTools["NONE"] = 0] = "NONE";
RobTools[RobTools["WEIGHING_GRIPPER"] = 1] = "WEIGHING_GRIPPER";
RobTools[RobTools["APPLICATOR"] = 2] = "APPLICATOR";
RobTools[RobTools["CAMERA"] = 3] = "CAMERA";
})(RobTools || (exports.RobTools = RobTools = {}));
function robotToolToString(tool) {
switch (tool) {
case RobTools.NONE:
return 'None';
case RobTools.WEIGHING_GRIPPER:
return 'Weighing Gripper';
case RobTools.APPLICATOR:
return 'Applicator';
case RobTools.CAMERA:
return 'Camera';
default:
return 'Unknown';
}
}
// {attribute 'qualified_only'}
// {attribute 'strict'}
// TYPE RobTasks :
// (
// NONE := 0, //do not remove or change this
// RETRIEVE_TOOL := 1, //param0: toolId (identifier from Tools enum specifying which tool to retrieve, e.g., WEIGHING_GRIPPER, APPLICATOR, CAMERA), checks for tool presence; if missing, moves to "Home" and signals fault
// RETURN_TOOL := 2, //param0: toolId (identifier from Tools enum specifying which tool to return to the tool rack)
// GO_TO_WAYPOINT := 3, //param0: positionId (identifier from Positions enum specifying the target waypoint, e.g., FIXTURE_PERCH, HOME), moves robot to the specified position
// GRIP_PART := 4, //param0: partId (identifier of the part to grip, e.g., part 1), performs a diagonal lift (½" up, ½" away from fixed clamp side) for clearance
// SAMPLE_WEIGHT := 5, //param0: sampleCount (number of weight samples, e.g., XX), param1: sampleDuration (duration in seconds, e.g., 2), waits briefly then records average weight over the period
// REPOSITION_AND_RELEASE_PART := 6, //no params: moves back ¼" toward fixed clamp, down ¼", opens gripper to drop tube onto false bottom, returns to perch position
// REMOVE_FALSE_BOTTOMS := 7, //no params: removes false bottoms from the fixture(s)
// HOME_SQUEEGEE_MOTOR := 8, //no params: homes the squeegee motor while moving to fixture perch position
// WIPE_APPLICATOR := 9, //no params: cleans the applicator (detailed cleaning procedure TBD)
// PERFORM_APPLICATION_TASK := 10, //param0: tubeId (identifier of the tube to process, e.g., tube 1), applies the task to the specified tube
// INSERT_FALSE_BOTTOMS := 11, //no params: slides false bottoms back into place in the fixture(s)
// TAKE_IMAGES := 12 //param0: tubeList (list of tube IDs to image), captures images and sends to HMI for display (most recent as large image, others in album view)
// );
// END_TYPE
exports.RobTasks = {
NONE: 0,
RETRIEVE_TOOL: 1,
RETURN_TOOL: 2,
GO_TO_WAYPOINT: 3,
GRIP_PART: 4,
SAMPLE_WEIGHT: 5,
REPOSITION_AND_RELEASE_PART: 6,
REMOVE_FALSE_BOTTOMS: 7,
HOME_SQUEEGEE_MOTOR: 8,
WIPE_APPLICATOR: 9,
PERFORM_APPLICATION_TASK: 10,
INSERT_FALSE_BOTTOMS: 11,
TAKE_IMAGES: 12
};
function robotTaskToString(task) {
switch (task) {
case exports.RobTasks.NONE:
return 'None';
case exports.RobTasks.RETRIEVE_TOOL:
return 'Retrieve Tool';
case exports.RobTasks.RETURN_TOOL:
return 'Return Tool';
case exports.RobTasks.GO_TO_WAYPOINT:
return 'Go To Waypoint';
case exports.RobTasks.GRIP_PART:
return 'Grip Part';
case exports.RobTasks.SAMPLE_WEIGHT:
return 'Sample Weight';
case exports.RobTasks.REPOSITION_AND_RELEASE_PART:
return 'Reposition And Release Part';
case exports.RobTasks.REMOVE_FALSE_BOTTOMS:
return 'Remove False Bottoms';
case exports.RobTasks.HOME_SQUEEGEE_MOTOR:
return 'Home Squeegee Motor';
case exports.RobTasks.WIPE_APPLICATOR:
return 'Wipe Applicator';
case exports.RobTasks.PERFORM_APPLICATION_TASK:
return 'Perform Application Task';
case exports.RobTasks.INSERT_FALSE_BOTTOMS:
return 'Insert False Bottoms';
case exports.RobTasks.TAKE_IMAGES:
return 'Take Images';
default:
return 'Unknown';
}
}