Esempio n. 1
0
def process_input(command_string):
    if command_string == "":
        return
    #    daq_utils.broadcast_output(time.ctime(time.time()))
    if command_string == "q":
        sys.exit()
    daq_lib.broadcast_output(time.ctime(time.time()) + "\n" + command_string)
    try:
        daq_lib.set_field("program_state", "Program Busy")
        execute_command(command_string)
    except NameError:
        error_string = "Unknown command: " + command_string
        print error_string
    except SyntaxError:
        print "Syntax error"
    except KeyError:
        print "Key error"
    except TypeError:
        print "Type error"
    except KeyboardInterrupt:
        abort_data_collection()
        print "Interrupt caught by daq server\n"
    if (
        command_string != "pause_data_collection()"
        and command_string != "continue_data_collection()"
        and command_string != "abort_data_collection()"
        and command_string != "unmount_after_abort()"
        and command_string != "no_unmount_after_abort()"
    ):
        daq_lib.set_field("program_state", "Program Ready")
Esempio n. 2
0
def hi_macro():
    print "hello from macros\n"
    daq_lib.broadcast_output("broadcast hi")