Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
8af5b504
Commit
8af5b504
authored
Aug 23, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speedup global flags
parent
05a16a80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
27 deletions
+29
-27
debugfs.js
src/debugfs-webgui/debugfs.js
+23
-26
debugfs.php
src/debugfs-webgui/debugfs.php
+6
-1
No files found.
src/debugfs-webgui/debugfs.js
View file @
8af5b504
...
@@ -78,7 +78,7 @@ function init(){
...
@@ -78,7 +78,7 @@ function init(){
}
else
{
}
else
{
$
(
this
).
html
(
"Switch off debug"
);
$
(
this
).
html
(
"Switch off debug"
);
$
.
ajax
({
$
.
ajax
({
url
:
"debugfs.php?cmd=
setflag&flag=%2Bp
"
,
url
:
"debugfs.php?cmd=
restore
"
,
queue
:
true
queue
:
true
});
});
}
}
...
@@ -408,27 +408,20 @@ function init_ui_controls(record,index){
...
@@ -408,27 +408,20 @@ function init_ui_controls(record,index){
}
}
}
}
if
(
!
exists
){
if
(
!
exists
){
//add to debugfs_data - copy current checkboxes - then select
//add to list, add to front
//apply to debugfs
var
arr
=
debugfs_data
[
index
].
configs
[
active
];
var
arr
=
debugfs_data
[
index
].
configs
[
active
];
debugfs_data
[
index
].
configs
[
i
]
=
JSON
.
parse
(
JSON
.
stringify
(
arr
));
debugfs_data
[
index
].
configs
[
i
]
=
JSON
.
parse
(
JSON
.
stringify
(
arr
));
debugfs_data
[
index
].
configs
[
i
].
name
=
value
;
debugfs_data
[
index
].
configs
[
i
].
name
=
value
;
dropdown_add_list_item
(
record
,
index
,
i
);
dropdown_add_list_item
(
record
,
index
,
i
);
//sync for now should be enough
//dropdown_clone_new_config(value,active);
update_debugfs_config
();
existing
=
i
;
existing
=
i
;
}
else
{
}
else
{
//select and restore checkboxes
//select and restore checkboxes
console
.
log
(
"This config already exists, selecting"
);
console
.
log
(
"This config already exists, selecting"
);
}
}
//select anyway
//select anyway
debugfs_data
[
index
].
configs
[
active
].
state
=
0
;
dropdown_select_config
(
index
,
existing
);
debugfs_data
[
index
].
configs
[
existing
].
state
=
1
;
$
(
"#dropdown_"
+
index
).
html
(
record
.
configs
[
existing
].
name
+
caret
);
$
(
this
).
parent
().
click
();
$
(
this
).
parent
().
click
();
//check ze name if dose note exist add to list and to config then apply config
//check ze name if dose note exist add to list and to config then apply config
...
@@ -484,24 +477,28 @@ function dropdown_add_list_item(record,index,j){
...
@@ -484,24 +477,28 @@ function dropdown_add_list_item(record,index,j){
lentry
.
click
(
function
(){
lentry
.
click
(
function
(){
var
index
=
$
(
this
).
attr
(
"myindex"
);
var
index
=
$
(
this
).
attr
(
"myindex"
);
var
confindex
=
$
(
this
).
attr
(
"confindex"
);
var
confindex
=
$
(
this
).
attr
(
"confindex"
);
var
name
=
$
(
this
).
html
(
);
dropdown_select_config
(
index
,
confindex
);
var
sname
=
$
(
"#dropdown_"
+
index
).
html
(
);
}
);
sname
=
sname
.
substr
(
0
,
sname
.
length
-
caret
.
length
);
$
(
"#controls_"
+
index
).
find
(
"ul"
).
append
(
lentry
);
}
if
(
name
==
sname
){
function
dropdown_select_config
(
index
,
config_index
){
var
record
=
debugfs_data
[
index
];
var
ac
=
dropdown_active_config
(
record
);
var
name_new
=
record
.
configs
[
config_index
].
name
;
var
name_old
=
record
.
configs
[
ac
].
name
;
if
(
name_new
==
name_old
){
console
.
log
(
"Already selected, doing nothing"
);
console
.
log
(
"Already selected, doing nothing"
);
}
else
{
}
else
{
//select config action here: rename, and restore checkboxes' states
$
(
"#dropdown_"
+
index
).
html
(
record
.
configs
[
config_index
].
name
+
caret
);
$
(
"#dropdown_"
+
index
).
html
(
record
.
configs
[
confindex
].
name
+
caret
);
var
ac
=
dropdown_active_config
(
record
);
record
.
configs
[
ac
].
state
=
0
;
record
.
configs
[
ac
].
state
=
0
;
record
.
configs
[
confindex
].
state
=
1
;
record
.
configs
[
config_index
].
state
=
1
;
//restore checkboxes!
update_debugfs_config
();
update_debugfs_config
();
}
}
});
$
(
"#controls_"
+
index
).
find
(
"ul"
).
append
(
lentry
);
}
}
function
update_debugfs_config
(){
function
update_debugfs_config
(){
...
...
src/debugfs-webgui/debugfs.php
View file @
8af5b504
...
@@ -125,13 +125,16 @@ function apply_config_to_control(){
...
@@ -125,13 +125,16 @@ function apply_config_to_control(){
function
apply_flag
(
$flag
){
function
apply_flag
(
$flag
){
global
$tmp_config
,
$DEBUGFSFILE
;
global
$tmp_config
,
$DEBUGFSFILE
;
//
echo "<pre>\n";
//
add short command for all here
$arr_config
=
json_decode
(
file_get_contents
(
$tmp_config
),
true
);
$arr_config
=
json_decode
(
file_get_contents
(
$tmp_config
),
true
);
foreach
(
$arr_config
as
$k0
=>
$v0
){
foreach
(
$arr_config
as
$k0
=>
$v0
){
if
(
$v0
[
'state'
]
==
1
){
if
(
$v0
[
'state'
]
==
1
){
foreach
(
$v0
[
'configs'
]
as
$k1
=>
$v1
){
foreach
(
$v0
[
'configs'
]
as
$k1
=>
$v1
){
if
(
$v1
[
'state'
]
==
1
){
if
(
$v1
[
'state'
]
==
1
){
$cmd
=
"echo -n 'file "
.
$v0
[
'file'
]
.
"
$flag
' >
$DEBUGFSFILE
"
;
exec
(
$cmd
);
/*
foreach($v1['lines'] as $k2 => $v2){
foreach($v1['lines'] as $k2 => $v2){
$file = $v2['file'];
$file = $v2['file'];
$lineno = $v2['lineno'];
$lineno = $v2['lineno'];
...
@@ -140,10 +143,12 @@ function apply_flag($flag){
...
@@ -140,10 +143,12 @@ function apply_flag($flag){
exec($cmd);
exec($cmd);
//echo "echo -n 'file $file line $lineno ${sign}p'\n";
//echo "echo -n 'file $file line $lineno ${sign}p'\n";
}
}
*/
}
}
}
}
}
}
}
}
echo
"Done"
;
echo
"Done"
;
}
}
...
...
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