Exemple #1
0
 def stop_cue(self, elemental_ip = cf.elemental_ip):
     if self.channel_locked is not True:
         response = liveapi.cue_command(elemental_ip, self.stream_id, 'stop_cue')
         self.in_cue = False
         return response
     else:
         return "Channel is locked"
Exemple #2
0
 def start_cue(self, elemental_ip = cf.elemental_ip):
     if self.channel_locked is not True:
         response = liveapi.cue_command(elemental_ip, self.stream_id, 'start_cue')
         self.in_cue = True
         lock_channel(cf.lock_interval)
         return response
     else:
         return "Channel is locked"
def gpi_ctrl():
    global state
    form_gpiCtrl = forms.GPIctrl()
    btn = request.form['btn']
    stream = form_gpiCtrl.stream_id.data
    cf.gpi2stream[str(cf.GPI_1)] = stream
    if btn == 'btn_ss_cue':
        if state == 0:
            response = liveapi.cue_command(cf.elemental_ip, str(stream),
                                           'start_cue')
            state = 1

        elif state == 1:
            response = liveapi.cue_command(cf.elemental_ip, str(stream),
                                           'stop_cue')
            state = 0

        return response
    elif btn == 'btn_set':
        return "Ip set"
def start_stop_avail(gpi):
    global state
    print("4. Event detcted")

    if GPIO.input(gpi):  # Rising edge == True
        if state == 1:
            print("5. Stopping cue")
            startime = time.time()
            liveapi.cue_command(elemental_ip, gpi2stream[str(gpi)], 'stop_cue')
            print("Reaction time: " + str(time.time() - startime))
            state = 0
            time.sleep(5)
    else:  # Rising edge == False
        if state == 0:
            print("5. Starting cue")
            startime = time.time()
            liveapi.cue_command(elemental_ip, gpi2stream[str(gpi)],
                                'start_cue')
            print("Reaction time: " + str(time.time() - startime))
            state = 1
            time.sleep(5)
Exemple #5
0
def cue_command():
    global elemental_ip
    if request.method == 'POST':
        print(request.form)
        if 'start_cue_button' in request.form:
            command = 'start_cue'
            print(command)
        if 'stop_cue_button' in request.form:
            command = 'stop_cue'
            print(command)

        response = liveapi.cue_command(elemental_ip, '17', command)
        return response
 def stop_cue(self, elemental_ip=cf.elemental_ip):
     response = liveapi.cue_command(elemental_ip, self.stream_id,
                                    'stop_cue')