void PAGE_TelemconfigInit(int page)
{
    (void)page;
    enum {
        COL1 = (10 + ((LCD_WIDTH - 320) / 2)),
        COL2 = (COL1 + 55),
        COL3 = (COL1 + 156),
        COL4 = (COL1 + 225),
        ROW1 = (70 + ((LCD_HEIGHT - 240) / 2)),
    };
    const u8 row_height = 25;
    PAGE_SetModal(0);
#if HAS_STANDARD_GUI
    if (Model.mixer_mode == MIXER_STANDARD)
        PAGE_ShowHeader_ExitOnly(PAGE_GetName(PAGEID_TELEMCFG), MODELMENU_Show);
    else
#endif
        PAGE_ShowHeader(PAGE_GetName(PAGEID_TELEMCFG));

    if (telem_state_check() == 0) {
        GUI_CreateLabelBox(&gui->msg, 20, 80, 280, 100, &NARROW_FONT, NULL, NULL, tempstring);
        return;
    }

    for (long i = 0; i < TELEM_NUM_ALARMS; i++) {
        GUI_CreateLabelBox(&gui->name[i], COL1, ROW1 + row_height * i, 55, 16, &DEFAULT_FONT,
           label_cb, NULL, (void *)i);
        GUI_CreateTextSelect(&gui->type[i], COL2, ROW1 + row_height * i, TEXTSELECT_96, NULL, telem_name_cb, (void *)i);
        GUI_CreateTextSelect(&gui->gtlt[i], COL3, ROW1 + row_height * i, TEXTSELECT_64, NULL, gtlt_cb, (void *)i);
        GUI_CreateTextSelect(&gui->value[i], COL4, ROW1 + row_height * i, TEXTSELECT_64, NULL, limit_cb, (void *)i);
    }
}
Exemple #2
0
void PAGE_TelemtestInit(int page)
{
    (void)okcancel_cb;
    (void)page;
    PAGE_SetModal(0);
    PAGE_SetActionCB(_action_cb);
    if (telem_state_check() == 0) {
        current_page = telemetry_off;
        GUI_CreateLabelBox(&gui->msg, 20, 10, 0, 0, &DEFAULT_FONT, NULL, NULL, tempstring);
        return;
    }

    _show_page(TELEMETRY_Type() == TELEM_DEVO ? &devo_page[current_page] : &dsm_page[current_page]);
}
void PAGE_TelemtestInit(int page)
{
    (void)page;
    PAGE_SetModal(0);
    PAGE_SetActionCB(_action_cb);
    if (telem_state_check() == 0) {
        current_page = telemetry_off;
        GUI_CreateLabelBox(&gui->msg, 20, 10, 0, 0, &DEFAULT_FONT, NULL, NULL, tempstring);
        return;
    }
    if (current_page > telemetry_gps)
        current_page = telemetry_basic;

    _show_page();
}
void PAGE_TelemconfigInit(int page)
{
    (void)label_cb;
    if (page < 0)
        page = current_selected;
    PAGE_SetModal(0);
    PAGE_RemoveAllObjects();
    PAGE_SetActionCB(_action_cb);
    if (telem_state_check() == 0) {
        GUI_CreateLabelBox(&gui->msg, 20, 10, 0, 0, &DEFAULT_FONT, NULL, NULL, tp.str);
        OBJ_SET_USED(&gui->value, 0);  // A indication not allow to scroll up/down
        return;
    }

    PAGE_ShowHeader(_tr("Telemetry config")); // using the same name as related menu item to reduce language strings

    GUI_CreateScrollable(&gui->scrollable, 0, ITEM_HEIGHT + 1, LCD_WIDTH, LCD_HEIGHT - ITEM_HEIGHT -1,
                         ITEM_SPACE, TELEM_NUM_ALARMS, row_cb, getobj_cb, NULL, NULL);
    GUI_SetSelected(GUI_ShowScrollableRowOffset(&gui->scrollable, current_selected));
}
void PAGE_TelemconfigInit(int page)
{
    (void)label_cb;
    (void)page;
    //if (page < 0)
    //    page = current_selected;
    PAGE_SetModal(0);
    PAGE_RemoveAllObjects();
    if (telem_state_check() == 0) {
        GUI_CreateLabelBox(&gui->msg, MSG_X, MSG_Y, 0, 0, &DEFAULT_FONT, NULL, NULL, tempstring);
        OBJ_SET_USED(&gui->value, 0);  // A indication not allow to scroll up/down
        return;
    }

    PAGE_ShowHeader(_tr("Telemetry config")); // using the same name as related menu item to reduce language strings

    GUI_CreateScrollable(&gui->scrollable, 0, HEADER_HEIGHT, LCD_WIDTH, LCD_HEIGHT - HEADER_HEIGHT,
                         LINE_SPACE, TELEM_NUM_ALARMS, row_cb, getobj_cb, NULL, NULL);
    PAGE_SetScrollable(&gui->scrollable, &current_selected);
}
void PAGE_TelemconfigExit()
{
    if(telem_state_check())
        current_selected = GUI_ScrollableGetObjRowOffset(&gui->scrollable, GUI_GetSelected());
}