Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
36f1a4c763b7
Commit
34a6af70
authored
Nov 05, 2017
by
alex@thinkpad
Browse files
Lua: console.visible (status)
API tests updated --HG-- branch : lua_fix
parent
254314a2010f
Changes
2
Show whitespace changes
Inline
Side-by-side
modules/lua/lua_console.c
View file @
36f1a4c7
...
...
@@ -53,7 +53,19 @@ static int luaCB_console_write(lua_State * L)
return
0
;
}
static
int
luaCB_console_index
(
lua_State
*
L
)
{
lua_rawget
(
L
,
1
);
return
1
;
}
static
int
luaCB_console_index
(
lua_State
*
L
)
{
LUA_PARAM_STRING_OPTIONAL
(
key
,
2
,
""
);
/// Whether or not the console is displayed.
// @tfield bool visible
if
(
!
strcmp
(
key
,
"visible"
))
{
extern
int
console_visible
;
lua_pushboolean
(
L
,
console_visible
);
}
else
lua_rawget
(
L
,
1
);
return
1
;
}
static
int
luaCB_console_newindex
(
lua_State
*
L
)
{
lua_rawset
(
L
,
1
);
return
0
;
}
...
...
scripts/api_test.lua
View file @
36f1a4c7
...
...
@@ -15,7 +15,7 @@ function request_mode(mode, mode_str)
while
camera
.
mode
~=
mode
do
printf
(
"Please switch to %s mode.\n"
,
mode_str
,
mode
)
while
camera
.
mode
~=
mode
do
console
.
show
()
console
.
show
()
;
assert
(
console
.
visible
)
msleep
(
1000
)
end
end
...
...
@@ -1013,7 +1013,7 @@ function test_lens_focus()
printf
(
"Please enable autofocus.\n"
)
printf
(
"(or, remove the lens from the camera to skip this test)\n"
)
while
not
lens
.
af
and
lens
.
name
~=
""
do
console
.
show
()
console
.
show
()
;
assert
(
console
.
visible
)
msleep
(
1000
)
end
msleep
(
1000
)
...
...
@@ -1161,13 +1161,13 @@ function test_movie()
-- now it should work
-- hide the console for a nicer look
console
.
hide
()
console
.
hide
()
;
assert
(
not
console
.
visible
)
movie
.
start
()
assert
(
movie
.
recording
)
msleep
(
1000
)
movie
.
stop
()
assert
(
not
movie
.
recording
)
console
.
show
()
console
.
show
()
;
assert
(
console
.
visible
)
printf
(
"Movie recording tests completed.\n"
)
printf
(
"
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment