From 0f7256c1884d61df8ebe22b15cf2a62cc54bf9ef Mon Sep 17 00:00:00 2001 From: bey0ne <195894611+bey0ne@users.noreply.github.com> Date: Tue, 27 Oct 2026 12:19:05 +0000 Subject: [PATCH] Set Image: number BMP pages 1-8 like text pages (#26) The text page picker already shows HD pages as 1-8 (protocol 0-7, see tagtinker_prepare_text_tx), but Set Image listed BMPs as P0-P7 and the BMP page selector went 0-7. Issue #26 shows the image written to protocol page N is displayed by Change Page N+1, so a BMP sent to "page 1" was shown by Change Page 2. Only the labels change: the same protocol pages go on the wire, saved synced_images.txt / web_job.txt / _pN filename hints keep their meaning. Color 2.6 (UI page on the wire) is shown unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QYkmJ3RnCgGZEBKnfRJt5x --- protocol/tagtinker_proto.h | 8 ++++++++ scenes/tagtinker_scene_image_options.c | 24 ++++++++++++++-------- scenes/tagtinker_scene_synced_image_list.c | 6 +++++- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/protocol/tagtinker_proto.h b/protocol/tagtinker_proto.h index 4ddbeb8..ea82b1a 100644 --- a/protocol/tagtinker_proto.h +++ b/protocol/tagtinker_proto.h @@ -88,6 +88,14 @@ static inline bool tagtinker_profile_uses_ui_page(const TagTinkerTagProfile* pro return profile && tagtinker_type_uses_ui_page(profile->type_code); } +/* Page number shown to the user for a protocol page. HD tags show protocol + * pages 0-7 as 1-8, like the text page picker: the image written to protocol + * page N is the one "Change Page N+1" displays (issue #26). Color 2.6 uses + * the UI page number on the wire, so it is shown as-is. */ +static inline uint8_t tagtinker_page_to_ui(const TagTinkerTagProfile* profile, uint8_t proto_page) { + return tagtinker_profile_uses_ui_page(profile) ? proto_page : (uint8_t)(proto_page + 1U); +} + static inline void tagtinker_profile_glass_size( const TagTinkerTagProfile* profile, uint16_t* width, diff --git a/scenes/tagtinker_scene_image_options.c b/scenes/tagtinker_scene_image_options.c index 2c0c006..039acdf 100644 --- a/scenes/tagtinker_scene_image_options.c +++ b/scenes/tagtinker_scene_image_options.c @@ -5,14 +5,24 @@ enum { ImageOptionTransmit, }; +static const TagTinkerTagProfile* image_option_profile(const TagTinkerApp* app) { + if(app->selected_target < 0 || app->selected_target >= app->target_count) return NULL; + return &app->targets[app->selected_target].profile; +} + +/* The list index is the protocol page (0-7); the label is the page number + * the user sees everywhere else (1-8 on HD tags). */ +static void image_option_set_page_text(const TagTinkerApp* app, VariableItem* item, uint8_t page) { + char buf[4]; + snprintf(buf, sizeof(buf), "%u", tagtinker_page_to_ui(image_option_profile(app), page)); + variable_item_set_current_value_text(item, buf); +} + static void image_option_page_changed(VariableItem* item) { TagTinkerApp* app = variable_item_get_context(item); app->image_tx_job.page = variable_item_get_current_value_index(item); app->img_page = app->image_tx_job.page; - - char buf[4]; - snprintf(buf, sizeof(buf), "%u", app->image_tx_job.page); - variable_item_set_current_value_text(item, buf); + image_option_set_page_text(app, item, app->image_tx_job.page); } static void image_option_enter_cb(void* ctx, uint32_t index) { @@ -39,11 +49,7 @@ void tagtinker_scene_image_options_on_enter(void* ctx) { VariableItem* item = variable_item_list_add(list, "Page", 8, image_option_page_changed, app); variable_item_set_current_value_index(item, job->page); - { - char buf[4]; - snprintf(buf, sizeof(buf), "%u", job->page); - variable_item_set_current_value_text(item, buf); - } + image_option_set_page_text(app, item, job->page); /* Position, compression and frame-repeat are intentionally fixed here: * pages are the only knob that meaningfully changes per-image, the rest diff --git a/scenes/tagtinker_scene_synced_image_list.c b/scenes/tagtinker_scene_synced_image_list.c index 93c3dc8..13d97b3 100644 --- a/scenes/tagtinker_scene_synced_image_list.c +++ b/scenes/tagtinker_scene_synced_image_list.c @@ -225,7 +225,11 @@ void tagtinker_scene_synced_image_list_on_enter(void* ctx) { sizeof(synced_image_labels[menu_idx]), "%sP%u %s", image->resampled ? "~ " : "", - image->page, + tagtinker_page_to_ui( + (app->selected_target >= 0 && app->selected_target < app->target_count) ? + &app->targets[app->selected_target].profile : + NULL, + image->page), image->job_id); synced_image_menu_map[menu_idx] = (uint8_t)i; submenu_add_item(