Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
d72dfabf
Commit
d72dfabf
authored
Jan 03, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
histograms height fix
parent
16a1e7cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
pgm_functions.c
src/drivers/elphel/pgm_functions.c
+15
-0
No files found.
src/drivers/elphel/pgm_functions.c
View file @
d72dfabf
...
@@ -251,6 +251,8 @@
...
@@ -251,6 +251,8 @@
#define MD1(x)
#define MD1(x)
#endif
#endif
#define BUGFIX_HISTWND_HEIGHT
static
struct
device
*
g_dev_ptr
=
NULL
;
///< Global pointer to basic device structure. This pointer is used in debugfs output functions
static
struct
device
*
g_dev_ptr
=
NULL
;
///< Global pointer to basic device structure. This pointer is used in debugfs output functions
void
pgm_functions_set_device
(
struct
device
*
dev
)
void
pgm_functions_set_device
(
struct
device
*
dev
)
{
{
...
@@ -1782,6 +1784,10 @@ int pgm_hist (int sensor_port, ///< sensor port number (0..3
...
@@ -1782,6 +1784,10 @@ int pgm_hist (int sensor_port, ///< sensor port number (0..3
long
height
;
long
height
;
}
hist_setup_data
;
}
hist_setup_data
;
struct
frameparspair_t
pars_to_update
[
4
*
MAX_SENSORS
];
struct
frameparspair_t
pars_to_update
[
4
*
MAX_SENSORS
];
#ifdef BUGFIX_HISTWND_HEIGHT
int
actual_height
;
#endif
/*
/*
struct frameparspair_t pars_to_update[4]={
struct frameparspair_t pars_to_update[4]={
{P_HISTWND_LEFT, 0},
{P_HISTWND_LEFT, 0},
...
@@ -1803,11 +1809,20 @@ int pgm_hist (int sensor_port, ///< sensor port number (0..3
...
@@ -1803,11 +1809,20 @@ int pgm_hist (int sensor_port, ///< sensor port number (0..3
hist_setup_data
.
left
=
((
thispars
->
pars
[
P_HISTWND_RLEFT
+
poffs
]
*
(
thispars
->
pars
[
P_ACTUAL_WIDTH
]
-
hist_setup_data
.
width
))
>>
16
)
&
0xfffe
;
hist_setup_data
.
left
=
((
thispars
->
pars
[
P_HISTWND_RLEFT
+
poffs
]
*
(
thispars
->
pars
[
P_ACTUAL_WIDTH
]
-
hist_setup_data
.
width
))
>>
16
)
&
0xfffe
;
if
(
hist_setup_data
.
left
>
(
thispars
->
pars
[
P_ACTUAL_WIDTH
]
-
hist_setup_data
.
width
))
hist_setup_data
.
left
=
thispars
->
pars
[
P_ACTUAL_WIDTH
]
-
hist_setup_data
.
width
;
if
(
hist_setup_data
.
left
>
(
thispars
->
pars
[
P_ACTUAL_WIDTH
]
-
hist_setup_data
.
width
))
hist_setup_data
.
left
=
thispars
->
pars
[
P_ACTUAL_WIDTH
]
-
hist_setup_data
.
width
;
#ifdef BUGFIX_HISTWND_HEIGHT
actual_height
=
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
2
;
hist_setup_data
.
height
=
((
thispars
->
pars
[
P_HISTWND_RHEIGHT
+
poffs
]
*
actual_height
)
>>
16
)
&
0xfffe
;
if
(
hist_setup_data
.
height
<
2
)
hist_setup_data
.
height
=
2
;
else
if
(
hist_setup_data
.
height
>
actual_height
)
hist_setup_data
.
height
=
actual_height
;
hist_setup_data
.
top
=
((
thispars
->
pars
[
P_HISTWND_RTOP
+
poffs
]
*
(
actual_height
-
hist_setup_data
.
height
))
>>
16
)
&
0xfffe
;
if
(
hist_setup_data
.
top
>
(
actual_height
-
hist_setup_data
.
height
))
hist_setup_data
.
top
=
actual_height
-
hist_setup_data
.
height
;
#else
hist_setup_data
.
height
=
((
thispars
->
pars
[
P_HISTWND_RHEIGHT
+
poffs
]
*
thispars
->
pars
[
P_ACTUAL_HEIGHT
])
>>
16
)
&
0xfffe
;
hist_setup_data
.
height
=
((
thispars
->
pars
[
P_HISTWND_RHEIGHT
+
poffs
]
*
thispars
->
pars
[
P_ACTUAL_HEIGHT
])
>>
16
)
&
0xfffe
;
if
(
hist_setup_data
.
height
<
2
)
hist_setup_data
.
height
=
2
;
if
(
hist_setup_data
.
height
<
2
)
hist_setup_data
.
height
=
2
;
else
if
(
hist_setup_data
.
height
>
thispars
->
pars
[
P_ACTUAL_HEIGHT
])
hist_setup_data
.
height
=
thispars
->
pars
[
P_ACTUAL_HEIGHT
];
else
if
(
hist_setup_data
.
height
>
thispars
->
pars
[
P_ACTUAL_HEIGHT
])
hist_setup_data
.
height
=
thispars
->
pars
[
P_ACTUAL_HEIGHT
];
hist_setup_data
.
top
=
((
thispars
->
pars
[
P_HISTWND_RTOP
+
poffs
]
*
(
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
hist_setup_data
.
height
))
>>
16
)
&
0xfffe
;
hist_setup_data
.
top
=
((
thispars
->
pars
[
P_HISTWND_RTOP
+
poffs
]
*
(
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
hist_setup_data
.
height
))
>>
16
)
&
0xfffe
;
if
(
hist_setup_data
.
top
>
(
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
hist_setup_data
.
height
))
hist_setup_data
.
top
=
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
hist_setup_data
.
height
;
if
(
hist_setup_data
.
top
>
(
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
hist_setup_data
.
height
))
hist_setup_data
.
top
=
thispars
->
pars
[
P_ACTUAL_HEIGHT
]
-
hist_setup_data
.
height
;
#endif
if
((
hist_setup_data
.
left
!=
thispars
->
pars
[
P_HISTWND_LEFT
+
poffs
])
||
if
((
hist_setup_data
.
left
!=
thispars
->
pars
[
P_HISTWND_LEFT
+
poffs
])
||
(
hist_setup_data
.
width
!=
thispars
->
pars
[
P_HISTWND_WIDTH
+
poffs
])
||
(
hist_setup_data
.
width
!=
thispars
->
pars
[
P_HISTWND_WIDTH
+
poffs
])
||
...
...
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