Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fpbuilder_ble
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jaehyu
fpbuilder_ble
Commits
92239206
Commit
92239206
authored
Dec 01, 2016
by
jaehyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devise BLECELL , FLOOR class
parent
9957d43d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
20 deletions
+152
-20
src/main/java/com/skt/ehs/mbs/conf/Configure.java
src/main/java/com/skt/ehs/mbs/conf/Configure.java
+2
-2
src/main/java/com/skt/ehs/mbs/fpbuilder/BLECell.java
src/main/java/com/skt/ehs/mbs/fpbuilder/BLECell.java
+88
-6
src/main/java/com/skt/ehs/mbs/fpbuilder/BLEFPBuilder.java
src/main/java/com/skt/ehs/mbs/fpbuilder/BLEFPBuilder.java
+26
-11
src/main/java/com/skt/ehs/mbs/fpbuilder/CellMatrix.java
src/main/java/com/skt/ehs/mbs/fpbuilder/CellMatrix.java
+23
-1
src/main/java/com/skt/ehs/mbs/fpbuilder/Floor.java
src/main/java/com/skt/ehs/mbs/fpbuilder/Floor.java
+13
-0
No files found.
src/main/java/com/skt/ehs/mbs/conf/Configure.java
View file @
92239206
...
...
@@ -34,7 +34,7 @@ public class Configure {
public
static
final
double
CELL_SIZE_BLE
=
300
;
public
static
final
double
CELL_SIZE_MAG
=
50
;
public
static
final
double
LENGTH_X
=
6000
;
public
static
final
double
LENGTH_Y
=
6000
;
public
static
final
double
LENGTH_X
=
3500
;
// 층의 X축방향 길이
public
static
final
double
WIDTH_Y
=
2000
;
// 폭
}
src/main/java/com/skt/ehs/mbs/fpbuilder/BLECell.java
View file @
92239206
...
...
@@ -4,14 +4,96 @@ package com.skt.ehs.mbs.fpbuilder;
* Created by user on 2016-11-30.
*/
public
class
BLECell
{
int
cell_id
;
int
ble_cell_id
;
double
location_x
,
location_y
;
// 실거리 ??
double
rssi_min
,
rssi_max
,
rssi_avg
,
rssi_std_dev
;
int
rssi_dir
;
double
magnitude_angle
;
// 해당 cell의 각 수집방향에 대하여 수집된 지자기방향의 평균값으로 대표
public
int
get
C
ell_id
()
{
return
cell_id
;
public
int
get
Ble_c
ell_id
()
{
return
ble_
cell_id
;
}
public
void
setCell_id
(
int
cell_id
)
{
this
.
cell_id
=
cell_id
;
public
void
setBle_cell_id
(
int
ble_cell_id
)
{
this
.
ble_cell_id
=
ble_cell_id
;
}
public
double
getLocation_x
()
{
return
location_x
;
}
public
void
setLocation_x
(
double
location_x
)
{
this
.
location_x
=
location_x
;
}
public
double
getLocation_y
()
{
return
location_y
;
}
public
void
setLocation_y
(
double
location_y
)
{
this
.
location_y
=
location_y
;
}
public
double
getRssi_min
()
{
return
rssi_min
;
}
public
void
setRssi_min
(
double
rssi_min
)
{
this
.
rssi_min
=
rssi_min
;
}
public
double
getRssi_max
()
{
return
rssi_max
;
}
public
void
setRssi_max
(
double
rssi_max
)
{
this
.
rssi_max
=
rssi_max
;
}
public
double
getRssi_avg
()
{
return
rssi_avg
;
}
public
void
setRssi_avg
(
double
rssi_avg
)
{
this
.
rssi_avg
=
rssi_avg
;
}
public
double
getRssi_std_dev
()
{
return
rssi_std_dev
;
}
public
void
setRssi_std_dev
(
double
rssi_std_dev
)
{
this
.
rssi_std_dev
=
rssi_std_dev
;
}
public
int
getRssi_dir
()
{
return
rssi_dir
;
}
public
void
setRssi_dir
(
int
rssi_dir
)
{
this
.
rssi_dir
=
rssi_dir
;
}
public
double
getMagnitude_angle
()
{
return
magnitude_angle
;
}
public
void
setMagnitude_angle
(
double
magnitude_angle
)
{
this
.
magnitude_angle
=
magnitude_angle
;
}
@Override
public
String
toString
()
{
return
"BLECell{"
+
"ble_cell_id="
+
ble_cell_id
+
", location_x="
+
location_x
+
", location_y="
+
location_y
+
", rssi_min="
+
rssi_min
+
", rssi_max="
+
rssi_max
+
", rssi_avg="
+
rssi_avg
+
", rssi_std_dev="
+
rssi_std_dev
+
", rssi_dir="
+
rssi_dir
+
", magnitude_angle="
+
magnitude_angle
+
'}'
;
}
//
}
src/main/java/com/skt/ehs/mbs/fpbuilder/BLEFPBuilder.java
View file @
92239206
...
...
@@ -29,33 +29,48 @@ public class BLEFPBuilder {
return
false
;
}
/* Todo
층(floor) 단면에 대하여 x축방향 길이 (Configure.LENGTH_X) 와
폭 (Configure.WIDTH_Y) 을 성분으로 하는 가상 Matrix를 구성한다.
void
genCell
()
{
int
xmax
=
(
int
)
(
Configure
.
LENGTH_X
/
Configure
.
CELL_SIZE_BLE
);
int
ymax
=
(
int
)
(
Configure
.
LENGTH_Y
/
Configure
.
CELL_SIZE_BLE
);
*/
void
genCells
()
{
System
.
out
.
println
(
"X : "
+
xmax
+
" Y : "
+
ymax
);
if
(((
int
)
Configure
.
LENGTH_X
%
(
int
)
Configure
.
CELL_SIZE_BLE
)
!=
0
)
xmax
++;
if
(((
int
)
Configure
.
LENGTH_Y
%
(
int
)
Configure
.
CELL_SIZE_BLE
)
!=
0
)
ymax
++;
// compose ble-cell-matrix
int
M
=
(
int
)
(
Configure
.
LENGTH_X
/
Configure
.
CELL_SIZE_BLE
);
int
N
=
(
int
)
(
Configure
.
WIDTH_Y
/
Configure
.
CELL_SIZE_BLE
);
System
.
out
.
println
(
"X : "
+
M
+
" Y : "
+
N
);
if
(((
int
)
Configure
.
LENGTH_X
%
(
int
)
Configure
.
CELL_SIZE_BLE
)
!=
0
)
M
++;
if
(((
int
)
Configure
.
WIDTH_Y
%
(
int
)
Configure
.
CELL_SIZE_BLE
)
!=
0
)
N
++;
System
.
out
.
println
(
"M : "
+
M
+
" N : "
+
N
);
int
[][]
ble_cell_ids
=
new
int
[
M
][
N
];
CellMatrix
cells
=
new
CellMatrix
(
ble_cell_ids
);
cells
.
show
();
List
<
BLECell
>
ble_cells
=
new
ArrayList
<>();
for
(
int
x
=
1
;
x
<=
xmax
;
x
++)
{
for
(
int
x
=
1
;
x
<=
M
;
x
++)
{
int
idx
=
0
;
int
id
=
0
;
int
id_x
=
1000
*
x
;
for
(
int
y
=
1
;
y
<=
ymax
;
y
++)
{
for
(
int
y
=
1
;
y
<=
N
;
y
++)
{
id
=
id_x
+
y
;
BLECell
next
=
new
BLECell
();
next
.
set
C
ell_id
(
id
);
next
.
set
Ble_c
ell_id
(
id
);
ble_cells
.
add
(
next
);
}
}
Iterator
<
BLECell
>
iter
=
ble_cells
.
iterator
();
while
(
iter
.
hasNext
())
System
.
out
.
println
(
iter
.
next
().
getCell_id
());
//
while (iter.hasNext()) System.out.println(iter.next().getCell_id());
System
.
out
.
println
(
ble_cells
.
size
());
}
...
...
@@ -91,7 +106,7 @@ public class BLEFPBuilder {
public
static
void
main
(
String
[]
args
)
{
BLEFPBuilder
b
=
new
BLEFPBuilder
();
b
.
genCell
();
b
.
genCell
s
();
processor
();
}
...
...
src/main/java/com/skt/ehs/mbs/fpbuilder/CellMatrix.java
View file @
92239206
...
...
@@ -3,7 +3,7 @@ package com.skt.ehs.mbs.fpbuilder;
/**
* Created by user on 2016-11-30.
*/
final
public
class
CellMatrix
{
public
class
CellMatrix
{
private
final
int
M
;
// number of rows
private
final
int
N
;
// number of columns
private
int
[][]
cell_ids
=
null
;
...
...
@@ -15,6 +15,28 @@ final public class CellMatrix {
cell_ids
=
new
int
[
M
][
N
];
}
// create Matrix using parameterized Matrix
public
CellMatrix
(
int
[][]
data
)
{
M
=
data
.
length
;
N
=
data
[
0
].
length
;
this
.
cell_ids
=
new
int
[
M
][
N
];
for
(
int
i
=
0
;
i
<
M
;
i
++)
for
(
int
j
=
0
;
j
<
N
;
j
++)
this
.
cell_ids
[
i
][
j
]
=
data
[
i
][
j
];
}
public
int
getElement
(
int
x
,
int
y
)
{
return
this
.
cell_ids
[
x
][
y
];
}
// print matrix
public
void
show
()
{
for
(
int
i
=
0
;
i
<
M
;
i
++)
{
for
(
int
j
=
0
;
j
<
N
;
j
++)
{
System
.
out
.
printf
(
"%9d "
,
cell_ids
[
i
][
j
]);
}
System
.
out
.
println
();
}
}
}
src/main/java/com/skt/ehs/mbs/fpbuilder/Floor.java
0 → 100644
View file @
92239206
package
com.skt.ehs.mbs.fpbuilder
;
/**
* Created by user on 2016-12-01.
* 층을 가상 Matrix 로 구성하고,
* Matrix의 각 element는 값으로 BLECell 타입의 Object를 가지게 된다
*/
public
class
Floor
extends
CellMatrix
{
public
Floor
(
int
M
,
int
N
)
{
super
(
M
,
N
);
}
}
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