dial and button issues on some cams - page 4 - General Discussion and Assistance - CHDK Forum

dial and button issues on some cams

  • 39 Replies
  • 10113 Views
*

Offline reyalp

  • ******
  • 14082
Re: dial and button issues on some cams
« Reply #30 on: 23 / June / 2020, 01:33:07 »
Advertisements
I´ve tested up to 80, but 100 is fine on both cams. :haha
Updated ixus300 and sx210 to use 100 in trunk 5532
Don't forget what the H stands for.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #31 on: 03 / August / 2020, 13:47:46 »
 :) Using Alt key from running script can be surprising...
A workaround is : call function, set or zoom and return with alt key
Quote
function exitalt(x) -- keeps 'cursor' on place
   x=x or 1
   sleep(99); wait_click(22)
   if x~=0 then exit_alt() end; wait_click(22)
   repeat sleep(333) until get_alt_mode()
--   if get_mode() then set_record(false) end
   -- update values
   EXP_COUNT=string.format("_%04d.",get_exp_count() or 0)
--   INSERT_MAP[1][3]=EXP_COUNT
   sleep(1000)
   play_sound(4)
end
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #32 on: 20 / August / 2020, 14:46:19 »
 :xmas Found a possible use for "left" button...
Code: [Select]
// core/console.c
// misc->console->display last console

// * /-------------------------------------------------------------------
static void save_console()
{
    FILE *fh = fopen("A/console.Log","wb");
    if(!fh) return;
short i=0;
static char const *c; c=&console_buf[0][0];
//        fwrite((char *)&console_buf,sizeof(console_buf),1,fh);

while (i<MAX_CONSOLE_HISTORY*(MAX_CONSOLE_LINE_LENGTH+1))
{
while (*c=='\0') { c++; i++;} // need
while (*c!='\0') {fwrite((char *)c,1,1,fh); c++; i++;}
fwrite((char *)"\n",1,1,fh);
while (i%(MAX_CONSOLE_LINE_LENGTH+1)!=0) {c++; i++;}
}
    fclose(fh);
}
//-------------------------------------------------------------------* /

    case KEY_LEFT:
save_console();
        break;
« Last Edit: 01 / September / 2020, 14:17:46 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14082
Re: dial and button issues on some cams
« Reply #33 on: 31 / August / 2020, 21:31:07 »
::) That console.c has one of my enhancements that never disturbs:
https://chdk.setepontos.com/index.php?topic=14048.msg144026#msg144026
But G16 can´t save console.Log.
It hangs without crashing instead until bat taken out.
(Btw. All my cams do that, when I try to save empty console for some cracyness;)
Quote
(// but no save console again, same as g16.)
This is surely a bug in your code. I don't feel like trying to debug it, but maybe working from the code in gui_console_draw or console_draw would be a better approach. Neither is a perfect fit though.

I'm also not convinced there's much need for this, print_screen can be used from script to send output to a file, so it would only be useful for non-script messages or cases where you decide you want to save it after the the fact.
Don't forget what the H stands for.


*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #34 on: 01 / September / 2020, 13:29:21 »
 :-[ Now I know, that it works camindependent , when there were >=30 lines printed in console. (rotating table)
Then console.log could look like this:
Code: [Select]
@19$51: 54 'do'
@51: '_@'
@20$52: 35 'if x==1 exec
{'
@78: 'if==__=__=__=__=__=
__=_'
@21$78: 34 'exec { ?"Brea
k with bug"'
@78: 'if==__=__=__=__=__=
__=_?'
@22$78: 60 '?"Break with
bug"'
Break with bug
@78: 'if==__=__=__=__=__=
__=_?$@'
@23$79: 256 'bug,bug'
@79: 'bug,'
@24$79: 24 ',bug'
@79: 'bug,'
0 Mb 1730 Log -23
@ 2020/9/1 # 18:47:44
24:79 uBASIC: Unk stmt
bug,
@25$79: 256 'bug,bug'
*** ABGEBROCHEN ***
@48: 'playsound@'
@18$50: 60 '?bug,"-------
----",x,bug'
50 ----------- 7 50
@50: '?_,$,,_@'
It could be useful, if (script breaks with error and print_screen is off and You don´t have a 2nd cam to take screenshot from the 1st).

EDIT: Version for relase 1.6 attached.
« Last Edit: 25 / December / 2020, 11:28:21 by Caefix »
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #35 on: 03 / September / 2020, 15:51:14 »
so it would only be useful for non-script messages or cases where you decide you want to save it after the the fact.
Ah,  :haha You could throw a line from elsewhere to console.
Here´s a funny example with gui_osd.c:
Code: [Select]
//* Line 1386
    struct tm *ttm = get_localtime();
    sprintf(osd_buf, "%08d :%02u:%02u:%02u",get_tick_count(), ttm->tm_hour, ttm->tm_min, ttm->tm_sec);
console_add_line(osd_buf);
//*/
    if (conf.console_show)
        console_draw(force_redraw);

No need to repeat, that´s the console.log

00002910 :21:15:20
00000490 :21:15:18
00000570 :21:15:18
00000650 :21:15:18
00000800 :21:15:18
00000880 :21:15:18
00000960 :21:15:18
00001040 :21:15:19
00001120 :21:15:19
00001200 :21:15:19
00001280 :21:15:19
00001360 :21:15:19
00001440 :21:15:19
00001530 :21:15:19
00001610 :21:15:19
00001710 :21:15:19
00001790 :21:15:19
00001870 :21:15:19
00001950 :21:15:19
00002030 :21:15:20
00002110 :21:15:20
00002190 :21:15:20
00002270 :21:15:20
00002350 :21:15:20
00002430 :21:15:20
00002510 :21:15:20
00002590 :21:15:20
00002670 :21:15:20
00002750 :21:15:20
00002830 :21:15:20
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #36 on: 14 / September / 2020, 13:15:07 »
You could define a trouble button to perform 100% (PhySw?) crash.
Haven´t figured out yet, where it writes a Romlog. (seems not after sleep :P)
If it does, You have probably recorded a fw_workflow that did the expected.
Code: [Select]
static int luaCB_exception( lua_State* L )
{
int i=0; while (i<1); {i++;} // Romlog on demand? 20 secs later
  return 00;
}

FUNC(exception)  // ~~line 3000

// click "shoot_half"; exception()

//...;....1....;....2....;....3....;....4....;....5....;....6....;....7....;....
// tokenizer.h
  TOKENIZER_EXCEPTION, // Romlog? 20 secs later

// tokenizer.c
  {"exception",               TOKENIZER_EXCEPTION}, // Romlog on demand? 20 secs later

// ubasic.c // statement & factor
  case TOKENIZER_EXCEPTION: // Romlog on demand? 20 secs later
ended=0; while (ended<1); {ended++;}

// click "shoot_half"~exception

Edit: Once in rec, one in play. 1st look difference: play asks for HDMI, rec doesn´t.
« Last Edit: 14 / September / 2020, 13:30:14 by Caefix »
All lifetime is a loan from eternity.

*

Offline srsa_4c

  • ******
  • 4451
Re: dial and button issues on some cams
« Reply #37 on: 14 / September / 2020, 13:32:54 »
Code: [Select]
int i=0; while (i<1);
That's an infinite loop, you're effectively halting the task with this code.


*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #38 on: 14 / September / 2020, 13:41:57 »
Any shorter way?  :)
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: dial and button issues on some cams
« Reply #39 on: 22 / December / 2020, 12:55:27 »
Sx200:  :blink:
Code: [Select]
if is_pressed "zoom_in" then k=22
 if is_pressed "zoom_out" then k=24
doesn´t work (only ~10% hits), but
Code: [Select]
if is_key "zoom_in" then k=22
 if is_key "zoom_out" then k=24
does. && it´s at ubasic only, (each version, ever :)
&& wheel turns only in filebrowser & reader, not in menues.
Code: [Select]
Former tricks, that don´t change anything here:
void JogDial_CW(void){
 _PostLogicalEventToUI(0x874, 1);  // RotateJogDialRight

    #undef  CAM_KEY_PRESS_DELAY
    #define CAM_KEY_PRESS_DELAY             120
« Last Edit: 23 / December / 2020, 14:05:28 by Caefix »
All lifetime is a loan from eternity.

 

Related Topics