Changeset 1035 for trunk/core/raw.c
- Timestamp:
- 01/09/11 03:15:50 (2 years ago)
- File:
-
- 1 edited
-
trunk/core/raw.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/raw.c
r1017 r1035 7 7 #include "dng.h" 8 8 #include "math.h" 9 #include "keyboard.h" 10 #include "action_stack.h" 11 #include "gui_draw.h" 12 #include "gui_mbox.h" 13 #include "gui_lang.h" 9 14 #endif 10 15 #ifdef OPT_CURVES … … 50 55 //------------------------------------------------------------------- 51 56 52 unsigned int get_bad_count_and_write_file(c har *fn){57 unsigned int get_bad_count_and_write_file(const char *fn){ 53 58 int count=0; 54 59 unsigned short c[2]; … … 123 128 124 129 // ! ! ! exclusively for special script which creates badpixel.bin ! ! ! 130 // NOTE: get_bad_count_and_write_file() must be called from here and cannot be called 131 // outside of this function. 125 132 if (conf.save_raw==255) conf.save_raw=get_bad_count_and_write_file("A/CHDK/bad_tmp.bin"); 126 133 // … … 442 449 return binary_count; 443 450 } 444 #endif 451 452 // ----------------------------------------------- 453 454 enum BadpixelFSM 455 { 456 BADPIX_START, 457 BADPIX_S1, 458 BADPIX_S2 459 }; 460 461 int badpixel_task_stack(long p) 462 { 463 static unsigned int badpix_cnt1, badpix_cnt2; 464 static int raw_conf_bck; 465 466 switch(p) 467 { 468 469 case BADPIX_START: 470 action_pop(); 471 472 console_clear(); 473 console_add_line("Wait please... "); 474 console_add_line("This takes a few seconds,"); 475 console_add_line("don't panic!"); 476 477 raw_conf_bck = conf.save_raw; 478 conf.save_raw = 255; 479 480 shooting_set_tv96_direct(96, SET_LATER); 481 action_push(BADPIX_S1); 482 action_push(AS_SHOOT); 483 action_push_delay(3000); 484 break; 485 case BADPIX_S1: 486 action_pop(); 487 488 badpix_cnt1 = conf.save_raw; 489 shooting_set_tv96_direct(96, SET_LATER); 490 491 action_push(BADPIX_S2); 492 action_push(AS_SHOOT); 493 break; 494 case BADPIX_S2: 495 action_pop(); 496 497 badpix_cnt2 = conf.save_raw; 498 conf.save_raw = raw_conf_bck; 499 500 console_clear(); 501 if (badpix_cnt1 == badpix_cnt2) 502 { 503 char msg[32]; 504 console_add_line("badpixel.bin created."); 505 sprintf(msg, "Bad pixel count: %d", badpix_cnt1); 506 console_add_line(msg); 507 } 508 else 509 { 510 console_add_line("badpixel.bin failed."); 511 console_add_line("Please try again."); 512 } 513 514 action_push_delay(3000); 515 break; 516 default: 517 action_stack_standard(p); 518 break; 519 } 520 521 return 1; 522 } 523 524 525 void create_badpixel_bin() 526 { 527 if (!(mode_get() & MODE_REC)) 528 { 529 gui_mbox_init(LANG_ERROR, LANG_MSG_RECMODE_REQUIRED, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 530 return; 531 } 532 533 gui_set_mode(GUI_MODE_ALT); 534 action_stack_create(&badpixel_task_stack, BADPIX_START); 535 } 536 537 #endif
Note: See TracChangeset
for help on using the changeset viewer.