Changeset 489


Ignore:
Timestamp:
08/20/08 19:44:25 (6 years ago)
Author:
Jucifer
Message:
  • hacked print_screen a bit: e.g. "print_screen 123" (or print_screen(123)) should output file to chdk/logs/log_0123.txt
Location:
branches/juciphox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/juciphox/core/gui_fselect.c

    r488 r489  
    1111#include "gui_fselect.h" 
    1212#include "raw_merge.h" 
     13#include "raw.h" 
    1314#include "conf.h" 
    1415 
  • branches/juciphox/core/luascript.c

    r486 r489  
    476476static int luaCB_print_screen( lua_State* L ) 
    477477{ 
    478   script_print_screen_statement( lua_toboolean( L, 1 ) ); 
     478   
     479  if lua_isboolean( L, 1 ) script_print_screen_statement( lua_toboolean( L, 1 ) ); 
     480  else script_print_screen_statement( luaL_checknumber( L, 1 ) ); 
    479481  return 0; 
    480482} 
  • branches/juciphox/core/main.c

    r428 r489  
    100100    mkdir("A/CHDK/CURVES"); 
    101101    mkdir("A/CHDK/DATA"); 
     102    mkdir("A/CHDK/LOGS"); 
    102103    auto_started = 0; 
    103104     
  • branches/juciphox/core/script.c

    r463 r489  
    378378static int  print_screen_p;             // print_screen predicate: 0-off 1-on. 
    379379static int  print_screen_d = -1;        // print_screen file descriptor. 
    380 static const char print_screen_file[] ="A/CHDK/SCRIPTS/PR_SCREEN.TXT"; 
     380//static const char print_screen_file[] ="A/CHDK/SCRIPTS/PR_SCREEN.TXT"; 
     381static const char print_screen_file_prefix[] = "A/CHDK/LOGS/LOG_"; 
     382char print_screen_file[25]; 
     383static const char extension_txt[] = ".TXT"; 
    381384 
    382385void script_print_screen_init() 
     
    400403void script_print_screen_statement(int val) 
    401404{ 
    402   if (val && print_screen_d<0) { 
    403       print_screen_d = open(print_screen_file, O_WRONLY|O_CREAT|O_TRUNC, 0777); 
     405  if (val) { 
     406    if (print_screen_d>=0) close(print_screen_d); 
     407    int i=0; 
     408    int c=0; 
     409    static char file_number[5]; 
     410    strcpy(print_screen_file, print_screen_file_prefix); 
     411    if (val<0) val = -val; 
     412    while (val > 9999) val += -10000; 
     413    for (i=10; i<=1000; i=i*10) { if (val<i) ++c; } 
     414    for (i=1; i<=c; ++i) { sprintf(file_number, "%d", 0); strcat(print_screen_file, file_number); } 
     415    sprintf(file_number, "%d", val); 
     416    strcat(print_screen_file, file_number); 
     417    strcat(print_screen_file, extension_txt); 
     418    print_screen_d = open(print_screen_file, O_WRONLY|O_CREAT|O_TRUNC, 0777); 
    404419  } 
    405420  print_screen_p = val; 
  • branches/juciphox/doc/version.txt

    r488 r489  
    55 
    66log 
     7 
     8 
     9489 / 0.3.9 
     10Jucifer 
     11 
     12- hacked print_screen a bit: e.g. "print_screen 123" (or print_screen(123)) should output file to chdk/logs/log_0123.txt 
     13 
     14 
    715 
    8160.3.8 / PP 
  • branches/juciphox/version.inc

    r488 r489  
    1 BUILD_NUMBER := 0.3.8 
     1BUILD_NUMBER := 0.3.9 
Note: See TracChangeset for help on using the changeset viewer.