Changeset 1039 for trunk


Ignore:
Timestamp:
01/10/11 02:06:43 (2 years ago)
Author:
reyalP
Message:

quick fix for scriptless badpixel.bin creation.
1) count badpixels for both shots
2) rename bad_tmp.bin on success

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/raw.c

    r1035 r1039  
    2323#define RAW_TARGET_FILENAME     "%s%04d%s" 
    2424#define RAW_BRACKETING_FILENAME "%s%04d_%02d%s"  
     25 
     26#define PATH_BADPIXEL_BIN "A/CHDK/badpixel.bin" 
     27#define PATH_BAD_TMP_BIN "A/CHDK/bad_tmp.bin" 
    2528 
    2629//------------------------------------------------------------------- 
     
    127130        char* altrawadr = get_alt_raw_image_addr(); 
    128131 
    129     // ! ! ! exclusively for special script which creates badpixel.bin ! ! ! 
     132    // ! ! ! exclusively for badpixel creation ! ! ! 
    130133    // NOTE: get_bad_count_and_write_file() must be called from here and cannot be called 
    131134    // outside of this function. 
    132     if (conf.save_raw==255) conf.save_raw=get_bad_count_and_write_file("A/CHDK/bad_tmp.bin"); 
     135    // TODO now that we make badpixel in code, special use of save_raw is not needed 
     136    // also don't need to actually save a raw when making bad pixel 
     137    if (conf.save_raw==255) conf.save_raw=get_bad_count_and_write_file(PATH_BAD_TMP_BIN); 
    133138    // 
    134139 
     
    487492 
    488493        badpix_cnt1 = conf.save_raw; 
     494        conf.save_raw = 255; 
    489495        shooting_set_tv96_direct(96, SET_LATER); 
    490496 
     
    501507        if (badpix_cnt1 == badpix_cnt2) 
    502508        { 
     509            // TODO script asked confirmation first 
     510            // should sanity check bad pixel count at least, 
     511            /// wrong buffer address could make badpixel bigger than available mem 
    503512            char msg[32]; 
    504513            console_add_line("badpixel.bin created."); 
    505514            sprintf(msg, "Bad pixel count: %d", badpix_cnt1); 
    506515            console_add_line(msg); 
     516            DeleteFile_Fut(PATH_BADPIXEL_BIN); 
     517            RenameFile_Fut(PATH_BAD_TMP_BIN,PATH_BADPIXEL_BIN); 
    507518        } 
    508519        else 
     
    511522            console_add_line("Please try again."); 
    512523        } 
    513          
     524        DeleteFile_Fut(PATH_BAD_TMP_BIN); 
     525 
    514526        action_push_delay(3000); 
    515527        break; 
Note: See TracChangeset for help on using the changeset viewer.