# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # from DAMrealtime import DAMrealtime base_path = '/home/gg/Desktop/test/' email = dict ( sender = '*****@*****.**', recipient = '*****@*****.**', server = 'automail.cc.ic.ac.uk' ) d = DAMrealtime(path=base_path, email=email, useEnvironmental=True) DAM_problems = [( fname, d.getDAMStatus(fname) ) for fname in d.listDAMMonitors() if d.getDAMStatus(fname) == '50'] ENV_problems = [( fname, d.hasEnvProblem(fname) ) for fname in d.listEnvMonitors() if d.hasEnvProblem(fname)] if DAM_problems: d.alert(DAM_problems) if ENV_problems: d.alert(ENV_problems)
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # from DAMrealtime import DAMrealtime base_path = '/home/gg/Desktop/test/' email = dict(sender='*****@*****.**', recipient='*****@*****.**', server='automail.cc.ic.ac.uk') d = DAMrealtime(path=base_path, email=email, useEnvironmental=True) DAM_problems = [(fname, d.getDAMStatus(fname)) for fname in d.listDAMMonitors() if d.getDAMStatus(fname) == '50'] ENV_problems = [(fname, d.hasEnvProblem(fname)) for fname in d.listEnvMonitors() if d.hasEnvProblem(fname)] if DAM_problems: d.alert(DAM_problems) if ENV_problems: d.alert(ENV_problems)
parser.add_option( "-e", "--envpath", dest="env_path", metavar="/path/to/flymon/", help="Specifies where the RAW flymon files are located", ) (options, args) = parser.parse_args() email = dict( sender="*****@*****.**", recipient="*****@*****.**", server="automail.cc.ic.ac.uk" ) if options.dam_path: d = DAMrealtime(path=options.dam_path, email=email) DAM_problems = [ (fname, d.getDAMStatus(fname)) for fname in d.listDAMMonitors() if d.getDAMStatus(fname) == "50" ] if DAM_problems: d.alert(DAM_problems) if options.env_path: e = ENVrealtime(path=options.env_path, email=email) ENV_problems = [(fname, e.hasEnvProblem(fname)) for fname in e.listEnvMonitors() if e.hasEnvProblem(fname)] if ENV_problems: e.alert(ENV_problems) if not options.dam_path and not options.env_path: parser.error("You must specify a path for TriKinetics or flymon files") parser.print_help()
# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # from DAMrealtime import DAMrealtime from time import sleep import serial use_serial = True if use_serial: ser = serial.Serial('/dev/ttyACM0', 57600) sleep(2) #fullpath to a single monitor file (or to of a folder containing all monitors) path = '/home/gg/Desktop/DAMS/' r = DAMrealtime(path=path, folderName='videoDAM') for fname in r.listDAMMonitors(): command = r.deprive(fname) print command if use_serial: ser.write(command) if use_serial: ser.close()
metavar="/path/to/DAM/", help="Specifies where the RAW TriKinetics files are located") parser.add_option('-e', '--envpath', dest='env_path', metavar="/path/to/flymon/", help="Specifies where the RAW flymon files are located") (options, args) = parser.parse_args() email = dict(sender='*****@*****.**', recipient='*****@*****.**', server='automail.cc.ic.ac.uk') if options.dam_path: d = DAMrealtime(path=options.dam_path, email=email) DAM_problems = [(fname, d.getDAMStatus(fname)) for fname in d.listDAMMonitors() if d.getDAMStatus(fname) == '50'] if DAM_problems: d.alert(DAM_problems) if options.env_path: e = ENVrealtime(path=options.env_path, email=email) ENV_problems = [(fname, e.hasEnvProblem(fname)) for fname in e.listEnvMonitors() if e.hasEnvProblem(fname)] if ENV_problems: e.alert(ENV_problems) if not options.dam_path and not options.env_path: parser.error("You must specify a path for TriKinetics or flymon files") parser.print_help()