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
e37a6d8c
Commit
e37a6d8c
authored
Jun 28, 2016
by
Harshith Goka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge Complete
parent
6b72baff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
10 deletions
+55
-10
app/src/main/java/com/example/harshith/ddc/DynamicQueue.java
app/src/main/java/com/example/harshith/ddc/DynamicQueue.java
+5
-4
app/src/main/java/com/example/harshith/ddc/Live.java
app/src/main/java/com/example/harshith/ddc/Live.java
+4
-0
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
...main/java/com/example/harshith/ddc/ReceiveDataThread.java
+46
-6
No files found.
app/src/main/java/com/example/harshith/ddc/DynamicQueue.java
View file @
e37a6d8c
package
com.example.harshith.ddc
;
class
DynamicQueue
{
public
int
noOfSlots
=
7
;
public
int
noOfSlots
=
5000
;
public
int
noOfGestures
;
public
Gesture
[]
gesture
;
public
int
[][]
dtwGap
;
...
...
@@ -109,17 +109,18 @@ class DynamicQueue{
}
}
public
void
proceedExecution
(){
public
int
proceedExecution
(){
for
(
int
i
=
foremostElement
;
i
!=
latestElement
;
i
=(
i
+
1
)%
noOfSlots
)
{
if
(
getShortlistCount
(
i
)==
0
)
foremostElement
=
(
foremostElement
+
1
)%
noOfSlots
;
else
if
(
getShortlistCount
(
i
)==
1
)
{
//gesture execute
gesture
[
firstShortlistGestureIndex
(
foremostElement
)].
execute
(
firstShortlistGestureIndex
(
foremostElement
)
);
foremostElement
=
(
foremostElement
+
1
)%
noOfSlots
;
return
firstShortlistGestureIndex
(
foremostElement
);
//
foremostElement = (foremostElement+1)%noOfSlots;
}
else
break
;
}
overflowCheck
();
return
-
1
;
}
public
void
print
(){
...
...
app/src/main/java/com/example/harshith/ddc/Live.java
View file @
e37a6d8c
...
...
@@ -23,6 +23,10 @@ class Live{
}
}
public
void
update
(
int
[]
p
){
reading
=
p
.
clone
();
}
public
void
updateConsole
(){
Scanner
scan
=
new
Scanner
(
System
.
in
).
useDelimiter
(
"\\s"
);
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
...
...
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
View file @
e37a6d8c
...
...
@@ -35,20 +35,60 @@ public class ReceiveDataThread extends Thread {
tempIn
=
bluetoothSocket
.
getInputStream
();
inputStream
=
tempIn
;
int
noOfGestures
=
2
;
Gesture
[]
a
=
new
Gesture
[
noOfGestures
];
for
(
int
i
=
0
;
i
<
noOfGestures
;
i
++)
{
a
[
i
]
=
new
DynamicGesture
();
}
int
[][]
array
=
new
int
[
5
][
11
];
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
for
(
int
j
=
0
;
j
<
11
;
j
++)
{
array
[
i
][
j
]
=
i
*
2
;
}
}
a
[
0
].
updateFrame
(
array
);
int
[][]
array2
=
new
int
[
5
][
11
];
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
for
(
int
j
=
0
;
j
<
11
;
j
=
j
+
2
)
{
array2
[
i
][
j
]
=
i
*
2
;
}
for
(
int
j
=
1
;
j
<
11
;
j
=
j
+
2
)
{
array2
[
i
][
j
]
=
0
;
}
}
a
[
1
].
updateFrame
(
array2
);
// initialising the 10 gestures
DynamicQueue
q
=
new
DynamicQueue
(
a
);
Live
dynamiclive
=
new
Live
();
byte
[]
buffer
=
new
byte
[
64
];
int
bytes
=
-
1
;
bytes
=
inputStream
.
read
(
buffer
);
readStatus
=
Constants
.
READ_STATUS_OK
;
String
readMessage
=
new
String
(
buffer
,
0
,
bytes
);
stringBuilder
.
append
(
readMessage
);
String
readMessage
;
int
i
;
convert
();
while
(
true
)
{
bytes
=
inputStream
.
read
(
buffer
);
readStatus
=
Constants
.
READ_STATUS_OK
;
readMessage
=
new
String
(
buffer
,
0
,
bytes
);
stringBuilder
.
append
(
readMessage
);
convert
();
if
(
readings
.
length
==
11
)
{
dynamiclive
.
update
(
readings
);
q
.
updateQueue
(
dynamiclive
);
q
.
processQueue
();
i
=
q
.
proceedExecution
();
if
(
i
!=
-
1
){
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
i
,
null
).
sendToTarget
();
}
// q.print();
}
}
}
catch
(
IOException
e
){
...
...
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