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
Hide 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(){
}
else
{
$
(
this
).
html
(
"Switch off debug"
);
$
.
ajax
({
url
:
"debugfs.php?cmd=
setflag&flag=%2Bp
"
,
url
:
"debugfs.php?cmd=
restore
"
,
queue
:
true
});
}
...
...
@@ -408,27 +408,20 @@ function init_ui_controls(record,index){
}
}
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
];
debugfs_data
[
index
].
configs
[
i
]
=
JSON
.
parse
(
JSON
.
stringify
(
arr
));
debugfs_data
[
index
].
configs
[
i
].
name
=
value
;
dropdown_add_list_item
(
record
,
index
,
i
);
//sync for now should be enough
//dropdown_clone_new_config(value,active);
update_debugfs_config
();
existing
=
i
;
}
else
{
//select and restore checkboxes
console
.
log
(
"This config already exists, selecting"
);
}
//select anyway
debugfs_data
[
index
].
configs
[
active
].
state
=
0
;
debugfs_data
[
index
].
configs
[
existing
].
state
=
1
;
$
(
"#dropdown_"
+
index
).
html
(
record
.
configs
[
existing
].
name
+
caret
);
dropdown_select_config
(
index
,
existing
);
$
(
this
).
parent
().
click
();
//check ze name if dose note exist add to list and to config then apply config
...
...
@@ -484,26 +477,30 @@ function dropdown_add_list_item(record,index,j){
lentry
.
click
(
function
(){
var
index
=
$
(
this
).
attr
(
"myindex"
);
var
confindex
=
$
(
this
).
attr
(
"confindex"
);
var
name
=
$
(
this
).
html
();
var
sname
=
$
(
"#dropdown_"
+
index
).
html
();
sname
=
sname
.
substr
(
0
,
sname
.
length
-
caret
.
length
);
if
(
name
==
sname
){
console
.
log
(
"Already selected, doing nothing"
);
}
else
{
//select config action here: rename, and restore checkboxes' states
$
(
"#dropdown_"
+
index
).
html
(
record
.
configs
[
confindex
].
name
+
caret
);
var
ac
=
dropdown_active_config
(
record
);
record
.
configs
[
ac
].
state
=
0
;
record
.
configs
[
confindex
].
state
=
1
;
update_debugfs_config
();
}
dropdown_select_config
(
index
,
confindex
);
});
$
(
"#controls_"
+
index
).
find
(
"ul"
).
append
(
lentry
);
}
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"
);
}
else
{
$
(
"#dropdown_"
+
index
).
html
(
record
.
configs
[
config_index
].
name
+
caret
);
record
.
configs
[
ac
].
state
=
0
;
record
.
configs
[
config_index
].
state
=
1
;
//restore checkboxes!
update_debugfs_config
();
}
}
function
update_debugfs_config
(){
console
.
log
(
"syncing debugfs config"
);
//console.log(debugfs_data);
...
...
src/debugfs-webgui/debugfs.php
View file @
8af5b504
...
...
@@ -125,13 +125,16 @@ function apply_config_to_control(){
function
apply_flag
(
$flag
){
global
$tmp_config
,
$DEBUGFSFILE
;
//
echo "<pre>\n";
//
add short command for all here
$arr_config
=
json_decode
(
file_get_contents
(
$tmp_config
),
true
);
foreach
(
$arr_config
as
$k0
=>
$v0
){
if
(
$v0
[
'state'
]
==
1
){
foreach
(
$v0
[
'configs'
]
as
$k1
=>
$v1
){
if
(
$v1
[
'state'
]
==
1
){
$cmd
=
"echo -n 'file "
.
$v0
[
'file'
]
.
"
$flag
' >
$DEBUGFSFILE
"
;
exec
(
$cmd
);
/*
foreach($v1['lines'] as $k2 => $v2){
$file = $v2['file'];
$lineno = $v2['lineno'];
...
...
@@ -140,10 +143,12 @@ function apply_flag($flag){
exec($cmd);
//echo "echo -n 'file $file line $lineno ${sign}p'\n";
}
*/
}
}
}
}
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