|
|
|
@ -8,6 +8,9 @@ from collections import namedtuple
@@ -8,6 +8,9 @@ from collections import namedtuple
|
|
|
|
|
from datetime import datetime, timedelta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__version__ = '0.0.1' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# example time table for the TrapControl |
|
|
|
|
example = ''' |
|
|
|
|
00:00.0 close |
|
|
|
@ -187,6 +190,7 @@ class TimedCommands(object):
@@ -187,6 +190,7 @@ class TimedCommands(object):
|
|
|
|
|
''' parses a time table and establishes a serial connection |
|
|
|
|
|
|
|
|
|
timetable: |
|
|
|
|
a file path to an excel file or |
|
|
|
|
a textual representaion of time and commands like |
|
|
|
|
|
|
|
|
|
00:12.0 close |
|
|
|
@ -215,6 +219,9 @@ class TimedCommands(object):
@@ -215,6 +219,9 @@ class TimedCommands(object):
|
|
|
|
|
# make sure the available commands are a dictionary |
|
|
|
|
cmd_dict = self._ensure_command_dict(available_commands) |
|
|
|
|
# parse the time table into something suitable |
|
|
|
|
if '.xls' in timetable: |
|
|
|
|
self.commands = parse_excel_file(timetable, cmd_dict) |
|
|
|
|
else: |
|
|
|
|
self.commands = parse_time_table(timetable, cmd_dict) |
|
|
|
|
|
|
|
|
|
# establish the serial connection |
|
|
|
@ -259,5 +266,3 @@ class TrapControl(TimedCommands):
@@ -259,5 +266,3 @@ class TrapControl(TimedCommands):
|
|
|
|
|
|
|
|
|
|
def __init__(self, timetable): |
|
|
|
|
super().__init__(timetable, ['open', 'close']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|