Changeset 2071
- Timestamp:
- 08/09/12 10:49:33 (10 months ago)
- Location:
- branches/tsvstar-uitest
- Files:
-
- 7 edited
-
core/conf.c (modified) (2 diffs)
-
core/luascript.c (modified) (1 diff)
-
include/conf.h (modified) (1 diff)
-
lib/ubasic/camera_functions.c (modified) (1 diff)
-
lib/ubasic/tokenizer.c (modified) (1 diff)
-
lib/ubasic/tokenizer.h (modified) (1 diff)
-
lib/ubasic/ubasic.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tsvstar-uitest/core/conf.c
r2067 r2071 805 805 806 806 //------------------------------------------------------------------- 807 int conf_setValue(unsigned short id, tConfigVal configVal ) {807 int conf_setValue(unsigned short id, tConfigVal configVal, int conf_save_flag ) { 808 808 unsigned short i; 809 809 int ret = CONF_EMPTY, len, len2; … … 862 862 } 863 863 } 864 if( ret!=CONF_EMPTY ) {864 if( ret!=CONF_EMPTY && conf_save_flag ) { 865 865 conf_save(); 866 866 } 867 867 return ret; 868 868 } 869 870 int conf_toggleValue(unsigned short id, int direction, int conf_save_flag ) 871 { 872 int i; 873 int* valueptr; 874 875 for( i=0; i<CONF_NUM; ++i ) { 876 if( conf_info[i].id==id ) { 877 878 // ONLY INTEGER COULD HAVE QUICKDISABLED ABILITY 879 880 if ( conf_info[i].type != CONF_VALUE && 881 conf_info[i].type != CONF_VALUE_PTR ) 882 break; 883 884 if ( conf_info[i].size!= sizeof(int) ) 885 break; 886 887 value_turn_state( (int*)conf_info[i].var, direction ); 888 889 if ( conf_save_flag ) 890 conf_save(); 891 892 return CONF_VALUE; 893 } 894 } 895 896 return CONF_EMPTY; 897 } 898 869 899 870 900 //------------------------------------------------------------------- -
branches/tsvstar-uitest/core/luascript.c
r2065 r2071 1991 1991 } 1992 1992 } 1993 lua_pushboolean(L, conf_setValue(id, configVal ));1993 lua_pushboolean(L, conf_setValue(id, configVal, 1)); 1994 1994 if( configVal.pInt ) { 1995 1995 free(configVal.pInt); -
branches/tsvstar-uitest/include/conf.h
r2067 r2071 423 423 extern void conf_update_prevent_shutdown(void); 424 424 extern int conf_getValue(unsigned short id, tConfigVal* configVal); 425 extern int conf_setValue(unsigned short id, tConfigVal configVal); 425 extern int conf_setValue(unsigned short id, tConfigVal configVal, int save_conf ); 426 extern int conf_toggleValue(unsigned short id, int direction, int save_conf ); 426 427 427 428 -
branches/tsvstar-uitest/lib/ubasic/camera_functions.c
r1975 r2071 610 610 return 0; 611 611 } 612 613 int shooting_get_real_focus_mode() { printf("%s\n",__FUNCTION__); return 0;} 614 int shooting_get_display_mode() { printf("%s\n",__FUNCTION__); return 0;} 615 int shooting_get_flash_mode() { printf("%s\n",__FUNCTION__); return 0;} 616 int shooting_in_progress() { printf("%s\n",__FUNCTION__); return 0;} 617 int shooting_is_flash() { printf("%s\n",__FUNCTION__); return 0;} 618 int shooting_get_is_mode() { printf("%s\n",__FUNCTION__); return 0;} 619 int shooting_get_ev_correction1() { printf("%s\n",__FUNCTION__); return 0;} 620 int shooting_get_resolution() { printf("%s\n",__FUNCTION__); return 0;} 621 int lens_get_zoom_point() { printf("%s\n",__FUNCTION__); return 0;} 622 int get_focal_length() { printf("%s\n",__FUNCTION__); return 0;} 623 int swap_partitions(int n) { printf("%s:%d\n",__FUNCTION__,n); return 0;} 624 int conf_toggleValue(int id,int dir) { printf("toggle_value(%d,%d)\n",id,dir); return 0;} 625 void JogDial_CCW() {} 626 void JogDial_CW() {} 627 612 628 #endif -
branches/tsvstar-uitest/lib/ubasic/tokenizer.c
r1975 r2071 228 228 {"is_capture_mode_valid", TOKENIZER_IS_CAPTURE_MODE_VALID}, 229 229 {"reboot", TOKENIZER_REBOOT}, 230 {"turn_config_value", TOKENIZER_TURN_CONFIG_VALUE}, 231 {"config_save", TOKENIZER_CONFIG_SAVE}, 230 232 231 233 {"end", TOKENIZER_END}, -
branches/tsvstar-uitest/lib/ubasic/tokenizer.h
r1975 r2071 204 204 TOKENIZER_SET_CONFIG_VALUE, 205 205 TOKENIZER_SET_YIELD, 206 TOKENIZER_SWAP_PARTITIONS 206 TOKENIZER_SWAP_PARTITIONS, 207 TOKENIZER_TURN_CONFIG_VALUE, 208 TOKENIZER_CONFIG_SAVE 207 209 } ubasic_token; 208 210 -
branches/tsvstar-uitest/lib/ubasic/ubasic.c
r1975 r2071 47 47 #include <io.h> 48 48 #include <stdlib.h> /* rand,srand */ 49 #include <stdio.h> /* sprintf */ 49 50 #include "camera_functions.h" 50 51 #else … … 114 115 115 116 static int ubasic_md_ret_var_num; 117 118 static int config_save_flag; // state of "config_save" 116 119 117 120 static int expr(void); … … 177 180 yield_max_lines = YIELD_MAX_LINES_DEFAULT; 178 181 yield_max_ms = YIELD_MAX_MS_DEFAULT; 182 config_save_flag=1; 179 183 } 180 184 /*---------------------------------------------------------------------------*/ … … 530 534 int tmode = expr(); 531 535 static struct tm *ttm; 536 #ifdef UBASIC_TEST 537 #else 532 538 ttm = get_localtime(); 539 #endif 533 540 if (tmode==0) r = ttm->tm_sec; 534 541 else if (tmode==1) r = ttm->tm_min; … … 1626 1633 1627 1634 static void set_ev_statement() 1628 {1629 int to;1630 accept(TOKENIZER_SET_EV);1631 to = expr();1632 shooting_set_prop(PROPCASE_EV_CORRECTION_1, to);1633 shooting_set_prop(PROPCASE_EV_CORRECTION_2, to);1634 accept_cr();1635 }1635 { 1636 int to; 1637 accept(TOKENIZER_SET_EV); 1638 to = expr(); 1639 shooting_set_prop(PROPCASE_EV_CORRECTION_1, to); 1640 shooting_set_prop(PROPCASE_EV_CORRECTION_2, to); 1641 accept_cr(); 1642 } 1636 1643 1637 1644 static void set_movie_status_statement() … … 1756 1763 configVal.numb = value; 1757 1764 configVal.isNumb = 1; 1758 conf_setValue(id, configVal); 1759 } 1765 conf_setValue(id, configVal, config_save_flag ); 1766 } 1767 accept_cr(); 1768 } 1769 1770 static void turn_config_value_statement() 1771 { 1772 int id, dir; 1773 1774 accept(TOKENIZER_TURN_CONFIG_VALUE); 1775 id = expr(); 1776 dir = expr(); 1777 conf_toggleValue( id, dir, config_save_flag ); 1778 accept_cr(); 1779 } 1780 1781 static void config_save_statement() 1782 { 1783 accept(TOKENIZER_CONFIG_SAVE); 1784 config_save_flag = expr(); 1760 1785 accept_cr(); 1761 1786 } … … 1833 1858 accept(TOKENIZER_VARIABLE); 1834 1859 1860 #ifdef UBASIC_TEST 1861 printf("%s\n",__FUNCTION__); 1862 #else 1835 1863 if (module_mdetect_load()) 1836 1864 ubasic_set_variable(var, libmotiondetect->md_get_cell_diff(col,row)); 1837 1865 else 1866 #endif 1838 1867 ubasic_set_variable(var, 0); 1839 1868 accept_cr(); … … 1944 1973 // script_console_add_line(buf); 1945 1974 1975 #ifdef UBASIC_TEST 1976 printf("%s\n",__FUNCTION__); 1977 #else 1946 1978 if (module_mdetect_load()) 1947 1979 libmotiondetect->md_init_motion_detector( … … 1953 1985 parameters, pixels_step, msecs_before_trigger 1954 1986 ); 1987 #endif 1955 1988 flag_yield=1; 1956 1989 } … … 2308 2341 case TOKENIZER_SET_CONFIG_VALUE: 2309 2342 set_config_value_statement(); 2343 break; 2344 case TOKENIZER_TURN_CONFIG_VALUE: 2345 turn_config_value_statement(); 2346 break; 2347 case TOKENIZER_CONFIG_SAVE: 2348 config_save_statement(); 2310 2349 break; 2311 2350 case TOKENIZER_SET_YIELD:
Note: See TracChangeset
for help on using the changeset viewer.