Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DDC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GOKA HARSHITH
DDC
Commits
fb3b938d
Commit
fb3b938d
authored
Jun 19, 2016
by
Harshith Goka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change number of sensors to 4
parent
9ad41b5e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
39 deletions
+33
-39
app/src/main/java/com/example/harshith/ddc/Frame.java
app/src/main/java/com/example/harshith/ddc/Frame.java
+2
-3
app/src/main/java/com/example/harshith/ddc/Gesture.java
app/src/main/java/com/example/harshith/ddc/Gesture.java
+8
-8
app/src/main/java/com/example/harshith/ddc/Live.java
app/src/main/java/com/example/harshith/ddc/Live.java
+8
-8
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
...main/java/com/example/harshith/ddc/ReceiveDataThread.java
+1
-1
app/src/main/java/com/example/harshith/ddc/StaticGesture.java
...src/main/java/com/example/harshith/ddc/StaticGesture.java
+14
-19
No files found.
app/src/main/java/com/example/harshith/ddc/Frame.java
View file @
fb3b938d
...
...
@@ -34,8 +34,7 @@ public class Frame{
}
public
void
print
(){
System
.
out
.
print
(
upperBound
);
System
.
out
.
print
(
' '
);
System
.
out
.
println
(
lowerBound
);
L
.
m
(
upperBound
+
""
);
L
.
m
(
lowerBound
+
""
);
}
}
\ No newline at end of file
app/src/main/java/com/example/harshith/ddc/Gesture.java
View file @
fb3b938d
...
...
@@ -4,7 +4,7 @@ package com.example.harshith.ddc;
public
class
Gesture
{
public
int
dataPoints
=
15
;
public
int
sensors
=
1
1
;
public
int
sensors
=
1
0
;
public
int
adcLevels
=
2
;
public
int
adcUpper
=
60
;
public
int
adcLower
=
200
;
...
...
@@ -15,33 +15,33 @@ public class Gesture{
public
Gesture
(){}
public
void
printData
(){
System
.
out
.
println
(
"Printing data..."
);
L
.
m
(
"Printing data..."
);
}
public
void
updateFrame
(
int
[][]
sensorLimits
){
System
.
out
.
println
(
"Updating static frame..."
);
L
.
m
(
"Updating static frame..."
);
}
public
void
updateFrame
(
int
[][][]
sensorLimits
){
System
.
out
.
println
(
"Updating dynamic frame..."
);
L
.
m
(
"Updating dynamic frame..."
);
}
public
void
updateFrame
(
int
[]
fing
){
System
.
out
.
println
(
"Updating frame for real..."
);
L
.
m
(
"Updating frame for real..."
);
}
public
boolean
isInFrame
(
Live
live
){
System
.
out
.
println
(
"Checking if the value is in the static frame..."
);
L
.
m
(
"Checking if the value is in the static frame..."
);
return
true
;
}
public
boolean
isInFrame
(
Live
live
,
int
index
){
System
.
out
.
println
(
"Checking if the value is in the dynamic frame..."
);
L
.
m
(
"Checking if the value is in the dynamic frame..."
);
return
true
;
}
public
void
execute
(
int
gest
){
// perform system function
System
.
out
.
println
(
gest
);
L
.
m
(
""
+
gest
);
}
}
\ No newline at end of file
app/src/main/java/com/example/harshith/ddc/Live.java
View file @
fb3b938d
...
...
@@ -8,17 +8,18 @@ import java.util.Scanner;
public
class
Live
{
int
reading
[];
int
sensors
=
1
1
;
int
sensors
=
1
0
;
public
Live
(){
reading
=
new
int
[
sensors
];
}
public
Live
(
Live
staticLive
){
reading
=
new
int
[
staticLive
.
sensors
];
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
reading
[
i
]
=
staticLive
.
reading
[
i
];
}
// reading = new int [staticLive.sensors];
// for (int i=0; i<sensors; i++) {
// reading[i] = staticLive.reading[i];
// }
reading
=
staticLive
.
reading
.
clone
();
}
...
...
@@ -30,13 +31,12 @@ public class Live {
}
public
void
update
(
int
[]
readings
){
reading
=
readings
;
reading
=
readings
.
clone
()
;
}
public
void
print
(){
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
System
.
out
.
print
(
reading
[
i
]
+
" "
);
L
.
m
(
reading
[
i
]
+
" "
);
}
System
.
out
.
print
(
'\n'
);
}
}
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
View file @
fb3b938d
...
...
@@ -33,7 +33,7 @@ public class ReceiveDataThread extends Thread {
a
[
i
]
=
new
StaticGesture
();
}
int
[]
hand
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
;
int
q
=
0
;
int
[]
hand
;
int
q
=
0
;
q
=
0
;
hand
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
8
,
8
,
8
,
8
,
8
,
8
};
// neutral
...
...
app/src/main/java/com/example/harshith/ddc/StaticGesture.java
View file @
fb3b938d
...
...
@@ -15,38 +15,32 @@ public class StaticGesture extends Gesture {
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
String
text
=
String
.
format
(
"%03d"
,
eFrame
[
i
][
0
]);
System
.
out
.
print
(
text
);
System
.
out
.
print
(
" "
);
L
.
m
(
text
);
}
for
(
int
i
=
5
;
i
<
sensors
;
i
++)
{
if
(
eFrame
[
i
][
1
]<
0
)
System
.
out
.
print
(
" "
);
String
text
=
String
.
format
(
"%05d"
,
eFrame
[
i
][
0
]);
System
.
out
.
print
(
text
);
System
.
out
.
print
(
" "
);
L
.
m
(
text
);
}
System
.
out
.
print
(
'\n'
);
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
String
text
=
String
.
format
(
"%03d"
,
eFrame
[
i
][
1
]);
System
.
out
.
print
(
text
);
System
.
out
.
print
(
" "
);
L
.
m
(
text
);
}
for
(
int
i
=
5
;
i
<
sensors
;
i
++)
{
String
text
=
String
.
format
(
"%05d"
,
eFrame
[
i
][
1
]);
System
.
out
.
print
(
text
);
System
.
out
.
print
(
" "
);
L
.
m
(
text
);
}
System
.
out
.
print
(
'\n'
);
}
public
void
updateFrame
(
int
[][]
sensorLimits
){
//super.updateFrame(sensorLimits);
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
eFrame
[
i
][
j
]
=
sensorLimits
[
i
][
j
];
}
}
// for (int i=0; i<sensors; i++) {
// for (int j=0; j<2; j++) {
// eFrame[i][j] = sensorLimits[i][j];
// }
// }
eFrame
=
sensorLimits
.
clone
();
}
public
void
updateFrame
(
int
[]
hand
){
...
...
@@ -55,10 +49,10 @@ public class StaticGesture extends Gesture {
Frame
[]
f
=
new
Frame
[
sensors
];
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
f
[
i
]
=
new
Frame
(
hand
[
i
],
false
,
adcUpper
,
adcLower
,
2
);
}
for
(
int
i
=
5
;
i
<
sensors
;
i
++)
{
for
(
int
i
=
4
;
i
<
sensors
;
i
++)
{
f
[
i
]
=
new
Frame
(
hand
[
i
],
true
,
mpuUpper
,
mpuLower
,
3
);
}
...
...
@@ -69,7 +63,8 @@ public class StaticGesture extends Gesture {
this
.
updateFrame
(
data
);
}
public
boolean
isInFrame
(
Live
live
){
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
public
boolean
isInFrame
(
Live
live
){
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
if
(!((
eFrame
[
i
][
0
]<
live
.
reading
[
i
])
&&
(
live
.
reading
[
i
]<
eFrame
[
i
][
1
]))){
return
false
;
}
...
...
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