Skip to content

Commit 292ea5f

Browse files
Juliana MashonJuliana Mashon
Juliana Mashon
authored and
Juliana Mashon
committed
Bookmark--working
1 parent 8c12d5f commit 292ea5f

File tree

1 file changed

+72
-33
lines changed

1 file changed

+72
-33
lines changed

broker_functions.py

+72-33
Original file line numberDiff line numberDiff line change
@@ -495,50 +495,89 @@ def mark_coord(self, x, y, z, property, mark_as): # TODO: Fix "label"
495495

496496
# return ...
497497

498-
# verify_tool() --> check
499-
# mount_tool() --> check
500-
# dismount_tool() --> check
498+
# TODO: verify_tool() --> get broker message example
499+
# TODO: mount_tool() --> get broker message example
500+
# TODO: dismount_tool() --> get broker message example
501+
502+
# def mount_tool(self, x, y, z):
503+
# mount_tool_message = {
504+
# **RPC_REQUEST,
505+
# "body": {
506+
# "kind": "execute",
507+
# "body": {
508+
# "kind": "parameter_application",
509+
# "args": {
510+
# "label": "Tool",
511+
# "data_value": {
512+
# "kind": "coordinate",
513+
# "args": {
514+
# "x": x,
515+
# "y": y,
516+
# "z": z
517+
# }
518+
# }
519+
# }
520+
# }
521+
# }
522+
# }
523+
524+
# self.broker_connect.publish(mount_tool_message)
525+
# # return ...
526+
527+
# TODO: water() --> all or single coords
528+
# TODO: dispense() --> single coords?
529+
530+
# TODO: sequence()
531+
# TODO: get_seed_tray_call(tray, cell)
532+
# TODO: sort(points, method) --> API?
533+
534+
# TODO: get_job() --> access status tree --> fetch all or single by name
535+
# TODO: set_job() --> access status tree --> inject(?) new or edit single by name
536+
# TODO: complete_job() --> access status tree --> edit single by name
537+
538+
def lua(self, code_snippet): # TODO: verify working
539+
lua_message = {
540+
**RPC_REQUEST,
541+
"body": {
542+
"kind": "lua",
543+
"args": {
544+
"lua": code_snippet
545+
}
546+
}
547+
}
501548

502-
def mount_tool(self, x, y, z):
503-
mount_tool_message = {
549+
self.broker_connect.publish(lua_message)
550+
# return ...
551+
552+
def if_statement(self, variable, operator, value, then_id, else_id): # TODO: add 'do nothing' functionality
553+
if_statement_message = {
504554
**RPC_REQUEST,
505555
"body": {
506-
"kind": "execute",
507-
"body": {
508-
"kind": "parameter_application",
509-
"args": {
510-
"label": "Tool",
511-
"data_value": {
512-
"kind": "coordinate",
513-
"args": {
514-
"x": x,
515-
"y": y,
516-
"z": z
517-
}
556+
"kind": "_if",
557+
"args": {
558+
"lhs": variable,
559+
"op": operator,
560+
"rhs": value,
561+
"_then": {
562+
"kind": "execute",
563+
"args": {
564+
"sequence_id": then_id
565+
}
566+
},
567+
"_else": {
568+
"kind": "execute",
569+
"args": {
570+
"sequence_id": else_id
518571
}
519572
}
520573
}
521574
}
522575
}
523576

524-
self.broker_connect.publish(mount_tool_message)
577+
self.broker_connect.publish(if_statement_message)
525578
# return ...
526579

527-
# water() --> check
528-
# dispense() --> check
529-
530-
# sequence() --> check
531-
# get_seed_tray_call(tray, cell) --> check
532-
# sort(points, method) --> check (API?)
533-
534-
# get_job() --> LUA
535-
# set_job() --> LUA
536-
# complete_job() --> LUA
537-
538-
# lua() --> sequence (broker message)
539-
# if_statement() --> sequence (broker message)
540-
541-
def assertion(self, code, as_type, id=''):
580+
def assertion(self, code, as_type, id=''): # TODO: add 'continue' functionality
542581
assertion_message = {
543582
**RPC_REQUEST,
544583
"body": {

0 commit comments

Comments
 (0)