예제 #1
0
def TEST_COLOR_GREEN():
    send_message(color_switch="test_color:GREEN")
    testform = TestForm()
    testform.validate_on_submit()
    return render_template("index.html",
                           title=title,
                           form=testform,
                           validate=True)
예제 #2
0
def BR_ADJUST():
    global br_value
    br_value = request.form["br_slider"]
    send_message(set_br="br_value:" + br_value)
    testform = TestForm()
    return render_template("index.html",
                           title=title,
                           br=br_value,
                           form=testform)
예제 #3
0
def TEST_COLOR_RED():
    send_message(color_switch="test_color:RED")
    #return redirect(url_for('index'))
    testform = TestForm()
    testform.validate_on_submit()
    return render_template("index.html",
                           title=title,
                           form=testform,
                           validate=True)
예제 #4
0
def LED_NUM():
    global led_color
    global led_num_option
    global led_select
    global br_value
    global led_mode_option
    global led_area_startx
    global led_area_starty
    global led_area_width
    global led_area_height
    global led_red_gain
    global led_green_gain
    global led_blue_gain

    log.debug("led_color : %s", led_color)
    list_led_color = request.form.getlist('color_switcher')
    led_color = list_led_color[0]
    send_message(color_switch=led_color)

    list_led_num_option = request.form.getlist('choice_switcher')
    led_num_option = list_led_num_option[0]

    list_br_value = request.form.getlist('led_brightness_fields')
    br_value = list_br_value[0]

    list_led_select = request.form.getlist('led_select_fields')
    led_select = list_led_select[0]
    send_message(set_br="br_value:" + br_value)

    if 'all' in led_num_option[0]:
        send_message(led_num="led_num:" + led_num_option)
    else:
        send_message(led_num="led_num:" + led_num_option + ",led_select:" +
                     led_select)

    list_led_mode_option = request.form.getlist('led_mode_switcher')
    led_mode_option = list_led_mode_option[0]
    send_message(set_led_mode="led_mode_option:" + led_mode_option)

    if 'area' in led_mode_option:
        list_led_total_width = request.form.getlist('led_total_width_fields')
        led_total_width = list_led_total_width[0]
        log.debug("led_total_width:%s", led_total_width)
        send_message(set_led_tatol_width="led_total_width:" + led_total_width)

        list_led_total_height = request.form.getlist('led_total_height_fields')
        led_total_height = list_led_total_height[0]
        log.debug("led_total_height:%s", led_total_height)
        send_message(set_led_tatol_height="led_total_height:" +
                     led_total_height)

        list_led_area_startx = request.form.getlist('led_area_startx_fields')
        led_area_startx = list_led_area_startx[0]
        log.debug("led_area_startx:%s", led_area_startx)
        send_message(set_led_area_startx="led_area_startx:" + led_area_startx)

        list_led_area_starty = request.form.getlist('led_area_starty_fields')
        led_area_starty = list_led_area_starty[0]
        log.debug("led_area_starty:%s", led_area_starty)
        send_message(set_led_area_starty="led_area_starty:" + led_area_starty)

        list_led_area_width = request.form.getlist('led_area_width_fields')
        led_area_width = list_led_area_width[0]
        log.debug("led_area_width:%s", led_area_width)
        send_message(set_led_area_width="led_area_width:" + led_area_width)

        list_led_area_height = request.form.getlist('led_area_height_fields')
        led_area_height = list_led_area_height[0]
        log.debug("led_area_height:%s", led_area_height)
        send_message(set_led_area_height="led_area_height:" + led_area_height)

        send_message(set_led_area_params_confirm="confirm:true")

    # handle led current gain mode and rgb mode
    list_led_current_gain_option = request.form.getlist(
        'led_current_gain_switcher')
    for i in list_led_current_gain_option:
        log.debug("current_gain_option: %s", i)

    # LED current gain mode/ rgb mode
    if "led_current_gain_mode" in list_led_current_gain_option:
        list_led_red_gain = request.form.getlist('led_red_gain_fields')
        led_red_gain = list_led_red_gain[0]
        log.debug("typeof(led_red_gain) : %s", type(led_red_gain))
        list_led_green_gain = request.form.getlist('led_green_gain_fields')
        led_green_gain = list_led_green_gain[0]
        list_led_blue_gain = request.form.getlist('led_blue_gain_fields')
        led_blue_gain = list_led_blue_gain[0]
        led_current_gain = int(led_red_gain) << 16 | int(
            led_green_gain) << 8 | int(led_blue_gain)
        send_message(set_led_current_gain="led_current_gain:" +
                     str(led_current_gain))

    testform = TestForm()

    return render_template("index.html", title=title, form=testform)
예제 #5
0
def TEST_COLOR_WHITE():
    send_message(color_switch="test_color:WHITE")
    return redirect(url_for('index'))