-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprimitive_functions.py
72 lines (51 loc) · 1.89 KB
/
primitive_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from data_logging import *
###############################################################################
def press (obj):
write ("execute : Press the " + obj)
def read_state(obj):
write ("execute : Read states of " + obj)
def goto(coord):
write ("execute : Go to " + coord)
def hold(obj):
write ("execute : Hold " + obj)
def leave(obj):
write ("execute : Leave "+ obj)
def rotate(obj, number_of_turns, direction):
write ("execute : Rotate "+ obj + " by " + number_of_turns + " in " + direction + " direction.")
def click(obj):
write("execute : Click on "+ obj)
def move_cursor(obj):
write("execute : Move Cursor to "+ obj)
def switch_on(obj):
write("execute : Press the " + obj + " switch to turn it on.")
def switch_off(obj):
write("execute : Press the " + obj + " switch to turn it off.")
def face(obj, direction):
write("execute : Face the " + obj + " towards " + direction)
def align(obj1, obj2):
write("execute : Align " + obj1 + " with " + obj2)
def type_text(text):
write("execute : Type " + text)
def check(obj, condition):
write ("execute : Check if " + obj + " is " + condition)
def touch(obj1, obj2):
write ("execute : Touch " + obj1 + " to " + obj2)
#################################################################################
#Based on Run Time responses
def sample_is_mounted():
write("Sample is already mounted. Continuing to next step...")
def do_not_unmount():
write("Not unmounting the sample")
def throw_exception (error):
write("\n########### ERROR ###########\n")
write(error)
write("Terminating Execution\n")
write("\n#############################\n")
sys.exit(0)
def check_database(key, value):
param_array = key.strip('\n').split(',')
database_value = return_value(param_array)
if (database_value == value):
return True
else:
return False