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
89e5422e
Commit
89e5422e
authored
Jan 26, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. timer
2. link to pars 3. set to sensor's center
parent
626d4ea8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
29 deletions
+63
-29
index.php
src/index/index.php
+2
-0
index.html
src/photofinish/index.html
+7
-3
photo-finish.js
src/photofinish/photo-finish.js
+49
-22
photo-finish.php
src/photofinish/photo-finish.php
+5
-4
No files found.
src/index/index.php
View file @
89e5422e
...
...
@@ -113,12 +113,14 @@
<a
href=
"camogmgui.php"
title=
"Store video/images to the camera's storage"
>
Recorder
</a><br
/>
<a
href=
"snapshot/"
title=
"Take a snapshot and download from the camera"
>
Snapshot
</a><br
/>
<a
href=
"raw.php"
title=
"Take a snapshot and download raw pixel data from the camera"
>
Snapshot (raw image data)
</a><br
/>
<a
href=
"photofinish/"
title=
"Scanline mode demo"
>
Photo finish demo
</a><br
/>
<br
/>
<a
href=
"hwmon.html"
title=
"hwmon.html"
>
Temperature monitor
</a><br
/>
<a
href=
"update_software.html"
title=
"update NAND flash"
>
Update firmware
</a><br
/>
<br
/>
<a
title=
"docs"
href=
"http://wiki.elphel.com/index.php?title=Tmp_manual"
>
User manual
</a><br
/>
<a
href=
"jp4-viewer/?width=1200&quality=1"
title=
"preview jp4 images (drag and drop from PC)"
>
JP4 Viewer
</a><br
/>
<a
href=
"/debugfs.html"
title=
"Linux Kernel Dynamic Debug helper interface (debug device drivers)"
>
DebugFS
</a><br
/>
</div>
<body>
</html>
src/photofinish/index.html
View file @
89e5422e
...
...
@@ -5,9 +5,8 @@
<meta
name=
"author"
content=
"?"
/>
<link
rel=
"stylesheet"
href=
"/js/bootstrap/css/bootstrap.css"
>
<style>
#control-panel
{
padding
:
5px
5px
0px
5px
;
}
#links-panel
,
#control-panel
,
#display-panel
{
padding
:
5px
5px
0px
5px
;
}
...
...
@@ -19,9 +18,14 @@
<table>
<tr>
<td>
<div
id=
'links-panel'
>
<a
title=
'Photo finish related pars'
href=
'/parsedit.php?sensor_port=0&WB_EN&AUTOEXP_ON&EXPOS&COMPRESSOR_RUN&TRIG&TRIG_PERIOD&PF_HEIGHT&WOI_HEIGHT&WOI_TOP&WOI_LEFT&WOI_WIDTH&refresh'
>
Parameter Editor (port 0)
</a>
</div>
<div
id=
'control-panel'
>
<button
id=
'init'
title=
'init linescan mode'
class=
'btn btn-default btn-danger '
>
init
</button>
<button
id=
'refresh'
title=
'refresh image (no sync)'
class=
'btn btn-default btn-success '
>
refresh
</button>
<span
id=
'status'
></status>
</div>
</td>
</tr>
...
...
src/photofinish/photo-finish.js
View file @
89e5422e
...
...
@@ -25,33 +25,29 @@
* for the JavaScript code in this page.
*/
var
display_object
;
$
(
function
(){
$
(
"#init"
).
on
(
'click'
,
function
(){
console
.
log
(
"init photo finish"
);
wait_start
();
$
.
ajax
({
url
:
"photo-finish.php?cmd=init"
,
success
:
function
(){
console
.
log
(
"success"
);
wait_stop
(
"init done"
);
}
});
});
$
(
"#refresh"
).
on
(
'click'
,
function
(){
console
.
log
(
"refresh images"
);
t1
=
$
(
"#display-panel"
).
jp4
({
ip
:
"127.0.0.1"
,
port
:
2323
,
width
:
600
,
fast
:
true
,
lowres
:
0
,
webworker_path
:
"/js"
});
wait_start
();
display_object
.
data
.
refresh
();
});
var
t1
=
$
(
"#display-panel"
).
jp4
({
display_object
=
$
(
"#display-panel"
).
jp4
({
ip
:
"127.0.0.1"
,
port
:
2323
,
width
:
600
,
...
...
@@ -61,19 +57,28 @@ $(function(){
});
$
(
"#display-panel"
).
on
(
"canvas_ready"
,
function
(){
canvas_ready_handler
(
this
);
});
// get display canvas - hide
var
cnv_old
=
$
(
this
).
find
(
"#display"
)[
0
];
});
$
(
cnv_old
).
hide
();
function
canvas_ready_handler
(
elem
){
var
w
=
cnv_old
.
width
;
var
h
=
cnv_old
.
height
;
// find display canvas from original plugin
var
cnv_old
=
$
(
elem
).
find
(
"#display"
)[
0
];
var
parent
=
$
(
cnv_old
).
parent
();
var
parent
=
$
(
cnv_old
).
parent
();
// init
if
(
parent
.
find
(
"#display2"
).
length
==
0
){
$
(
cnv_old
).
hide
();
cnv_new
=
$
(
"<canvas>"
,{
id
:
"display2"
});
parent
.
append
(
cnv_new
);
}
else
{
cnv_new
=
parent
.
find
(
"#display2"
);
}
cnv_new
=
$
(
"<canvas>"
,{
id
:
"display2"
})
;
parent
.
append
(
cnv_new
)
;
var
w
=
cnv_old
.
width
;
var
h
=
cnv_old
.
height
;
var
ctx
=
cnv_new
[
0
].
getContext
(
"2d"
);
...
...
@@ -86,6 +91,28 @@ $(function(){
ctx
.
drawImage
(
cnv_old
,
0
,
0
,
w
,
h
,
0
,
0
,
w
,
h
);
ctx
.
restore
();
});
});
wait_stop
(
"refresh done"
);
}
var
wait_interval
;
var
timeout_counter
;
function
wait_start
(){
timeout_counter
=
30
;
clearInterval
(
wait_interval
);
wait_interval
=
setInterval
(
wait_tick
,
1000
);
}
function
wait_stop
(
msg
){
clearInterval
(
wait_interval
);
$
(
"#status"
).
html
(
msg
);
}
function
wait_tick
(){
if
(
timeout_counter
==
0
){
wait_stop
(
"Timeout"
);
}
else
{
timeout_counter
--
;
}
$
(
"#status"
).
html
(
"waiting("
+
timeout_counter
+
")"
);
}
src/photofinish/photo-finish.php
View file @
89e5422e
...
...
@@ -55,13 +55,14 @@ $pars_init_0 = array(
$pars_init_1
=
array
(
'COLOR'
=>
5
,
'TRIG'
=>
4
,
'TRIG_PERIOD'
=>
10
0000
,
// 2000fps
'TRIG_PERIOD'
=>
5
0000
,
// 2000fps
'PF_HEIGHT'
=>
2
,
'WOI_HEIGHT'
=>
16
,
// for faster work
'WOI_HEIGHT'
=>
16
// for faster work
);
$pars_init_2
=
array
(
'WOI_HEIGHT'
=>
8000
// equals to 10 seconds for 400fps
'WOI_HEIGHT'
=>
8000
,
// equals to 10 seconds for 400fps
'WOI_TOP'
=>
968
// scan at the sensor's center
);
$pars_init_3
=
array
(
...
...
@@ -77,7 +78,7 @@ if ($cmd=="init"){
elphel_set_P_arr
(
$sensor_port
,
$pars_init_0
,
$frame_num
+
3
);
elphel_set_P_arr
(
$sensor_port
,
$pars_init_1
,
$frame_num
+
6
);
elphel_set_P_arr
(
$sensor_port
,
$pars_init_2
,
$frame_num
+
9
);
elphel_set_P_arr
(
$sensor_port
,
$pars_init_3
,
$frame_num
+
1
1
);
elphel_set_P_arr
(
$sensor_port
,
$pars_init_3
,
$frame_num
+
1
2
);
elphel_wait_frame_abs
(
$sensor_port
,
$frame_num
+
12
);
...
...
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