I've noticed that set_console_layout(..) doesn't work in my time lapse script since these changes, as demonstrated by this test script:Code: [Select]--[[@title console test--]]set_console_layout(0,11,45,13) -- this has no effect now, worked beforeprint("testing 1")print("testing 2")print("testing 3")set_console_autoredraw(-1) -- screen disappears in 3 secondsprint("Hello") -- doesn't show on screensleep(5000)--set_console_autoredraw(1) -- screen reappearsprint("Good Bye")Here's the description in the Wiki:Quoteset_console_layout x1 y1 x2 y2 --> set console position and size, range is x=0 to 45 and y=0 to 14Note : coordinates are in units of characters and are numbered from the lower left hand corner of the screen. So x1,y1 is the lower left corner and x2,y2 is the upper right corner. set_console_autoredraw(-1) does work, as Phil described. That is, the screen console disappears after 3 seconds. However, the screen console doesn't reappear when a new script starts. That is, it's not re-initialized.Since Phil did the changes, it would probably be easier for him to fix it.
--[[@title console test--]]set_console_layout(0,11,45,13) -- this has no effect now, worked beforeprint("testing 1")print("testing 2")print("testing 3")set_console_autoredraw(-1) -- screen disappears in 3 secondsprint("Hello") -- doesn't show on screensleep(5000)--set_console_autoredraw(1) -- screen reappearsprint("Good Bye")
set_console_layout x1 y1 x2 y2 --> set console position and size, range is x=0 to 45 and y=0 to 14Note : coordinates are in units of characters and are numbered from the lower left hand corner of the screen. So x1,y1 is the lower left corner and x2,y2 is the upper right corner.
Max console width was reduced to 44 to allow for scrolling when displaying the console history.If you call set_console_layout with values out of range or too large it is ignored.
Quote from: philmoz on 22 / July / 2013, 09:54:10Max console width was reduced to 44 to allow for scrolling when displaying the console history.If you call set_console_layout with values out of range or too large it is ignored.Would it make more sense to clamp the console dimension at the max value rather than just ignoring the call?
There's a text editor script included in the CHDK distribution. The console's disappearance (3..30 seconds after last update) is quite annoying when somebody tries to use that script. Could we somehow allow a permanent console display (either with a script command or with console settings)?
set_config_value( 297, 30000) -- console timeout
I've used Code: [Select] set_config_value( 297, 30000) -- console timeoutto push the timeout to over 8 hours. That's been enough for anything I've needed it for. Obviously, the script probably should to do a get_config_value() and restore the timeout on exit.
Index: CHDK/SCRIPTS/EDITOR/EDI.lua===================================================================--- CHDK/SCRIPTS/EDITOR/EDI.lua (revision 3835)+++ CHDK/SCRIPTS/EDITOR/EDI.lua (working copy)@@ -45,6 +45,11 @@ additionally: the biggest file I successfully opened on SX130IS had 916 kB. Opening 962 kB file failed. Other cameras has different size of free memory, nevertheless opening average scripts as 5-10 kb shouldn't cause any problems. --]] +-- store original console timeout value+-- TODO: use the cnf_osd library instead of config ID?+ConTO = get_config_value(297)+set_config_value( 297, 30000)+ -- CHECK GIVEN PARAMETERS -- if y<5 then y=5 end if x<10 then x=10 end@@ -498,6 +503,7 @@ cls() print("EDI has been terminated.") set_console_autoredraw(1)+ set_config_value( 297, ConTO) -- restore console timeout value set_console_layout(0,0,25,5) -- Thx, msl! EXIT=true end
Quote from: waterwingz on 21 / December / 2014, 10:14:19I've used Code: [Select] set_config_value( 297, 30000) -- console timeoutto push the timeout to over 8 hours. That's been enough for anything I've needed it for. Obviously, the script probably should to do a get_config_value() and restore the timeout on exit.That seems to do the job, thanks. I have currently used the config ID directly. Perhaps it would be more future-proof to use the generated cnf_osd Lua library (but that would increase memory use and may not be available in case of an incomplete install)...?Code: [Select]Index: CHDK/SCRIPTS/EDITOR/EDI.lua===================================================================--- CHDK/SCRIPTS/EDITOR/EDI.lua (revision 3835)+++ CHDK/SCRIPTS/EDITOR/EDI.lua (working copy)@@ -45,6 +45,11 @@ additionally: the biggest file I successfully opened on SX130IS had 916 kB. Opening 962 kB file failed. Other cameras has different size of free memory, nevertheless opening average scripts as 5-10 kb shouldn't cause any problems. --]] +-- store original console timeout value+-- TODO: use the cnf_osd library instead of config ID?+ConTO = get_config_value(297)+set_config_value( 297, 30000)+ -- CHECK GIVEN PARAMETERS -- if y<5 then y=5 end if x<10 then x=10 end@@ -498,6 +503,7 @@ cls() print("EDI has been terminated.") set_console_autoredraw(1)+ set_config_value( 297, ConTO) -- restore console timeout value set_console_layout(0,0,25,5) -- Thx, msl! EXIT=true end
I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.
Quote from: philmoz on 21 / December / 2014, 14:06:04I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.I think you only need the restore part of that - just reset to whatever is in the conf.console_timeout value on script exit.
Quote from: waterwingz on 21 / December / 2014, 14:55:07Quote from: philmoz on 21 / December / 2014, 14:06:04I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.I think you only need the restore part of that - just reset to whatever is in the conf.console_timeout value on script exit.But isn't this the value the new function is going to change to give the script control over the console?
Started by intrinsic « 1 2 » General Discussion and Assistance
Started by wrybread Script Writing
Started by Duncan Feature Requests
Started by acid2000 DryOS Development
Started by waterwingz General Discussion and Assistance