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
2d87a8e1
Commit
2d87a8e1
authored
Dec 12, 2016
by
jaehyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ble_cell_id in regarding to cell_location
parent
b2e4646d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
18 deletions
+37
-18
src/main/java/com/skt/ehs/mbs/fpbuilder/blefpbuilder/BLEFpBuilder.java
.../com/skt/ehs/mbs/fpbuilder/blefpbuilder/BLEFpBuilder.java
+14
-14
src/main/java/com/skt/ehs/mbs/fpbuilder/blefpbuilder/BLE_Floor.java
...ava/com/skt/ehs/mbs/fpbuilder/blefpbuilder/BLE_Floor.java
+23
-4
No files found.
src/main/java/com/skt/ehs/mbs/fpbuilder/blefpbuilder/BLEFpBuilder.java
View file @
2d87a8e1
...
...
@@ -23,9 +23,9 @@ public class BLEFpBuilder {
BLE_Floor
bFloor
;
public
BLEFpBuilder
(
int
M
,
int
N
,
int
sizeOfCell
)
{
public
BLEFpBuilder
(
int
M
,
int
N
,
int
sizeOfCell
,
int
campus
,
int
building
,
int
floor
)
{
bFloor
=
new
BLE_Floor
(
M
,
N
,
sizeOfCell
);
bFloor
=
new
BLE_Floor
(
M
,
N
,
sizeOfCell
,
campus
,
building
,
floor
);
}
public
void
LoadCellID
()
{
...
...
@@ -170,15 +170,16 @@ public class BLEFpBuilder {
public
boolean
build
()
throws
Throwable
{
// Todo read from Console or Database
int
campus_id
=
SAMPLE_CAMPUS_ID
;
int
building_id
=
SAMPLE_BUILDING_ID
;
int
floor_id
=
SAMPLE_FLOOR_ID
;
int
object_campus_id
=
bFloor
.
getCampus_id
();
int
object_building_id
=
bFloor
.
getBuilding_id
();
int
object_floor_id
=
bFloor
.
getFloor_id
();
int
object_cell_size
=
bFloor
.
getBle_cell_size
();
int
ble_cell_id
;
double
scale_pixel
=
readMapScale
(
campus_id
,
building_id
,
floor_id
);
// 수집시 사용한 지도의 축척정보
double
scale_pixel
=
readMapScale
(
object_campus_id
,
object_building_id
,
object_
floor_id
);
// 수집시 사용한 지도의 축척정보
bFloor
.
setMap_scale_pixel
(
scale_pixel
);
double
object_scale_pixel
;
...
...
@@ -200,8 +201,8 @@ public class BLEFpBuilder {
ble_cell_id
=
bFloor
.
getCell
(
m
,
n
).
get_id
();
System
.
out
.
printf
(
"
floor_id : %d, building_id : %d, campus
_id : %d, ble_cell_id : %d, lower_rssi_dir : %d, upper_rssi_dir : %d "
,
floor_id
,
building_id
,
campus
_id
,
ble_cell_id
,
rssi_dir
.
get_lower_rssi_dir
(),
rssi_dir
.
get_upper_rssi_dir
()
);
System
.
out
.
printf
(
"
campus_id : %d, building_id : %d, floor
_id : %d, ble_cell_id : %d, lower_rssi_dir : %d, upper_rssi_dir : %d "
,
object_campus_id
,
object_building_id
,
object_floor
_id
,
ble_cell_id
,
rssi_dir
.
get_lower_rssi_dir
(),
rssi_dir
.
get_upper_rssi_dir
()
);
System
.
out
.
printf
(
" ble_cell_location : ("
+
bFloor
.
getCell
(
m
,
n
).
get_location_x
()+
", "
+
bFloor
.
getCell
(
m
,
n
).
get_location_y
()+
")"
);
System
.
out
.
println
();
...
...
@@ -244,7 +245,7 @@ public class BLEFpBuilder {
final
double
rssi_std_dev
=
Math
.
sqrt
(
sum_of_dev
/
(
count
-
1
));
// Bessel correction for sample stdev
// populate insert value
FPElement
cell_elem
=
new
FPElement
(
floor_id
,
building_id
,
campus_id
,
ble_cell_id
,
rssi_dir
.
get_rssi_dir
(),
entry
.
getKey
(),
count
,
rssi_min
,
rssi_max
,
rssi_avg
,
rssi_std_dev
);
FPElement
cell_elem
=
new
FPElement
(
object_floor_id
,
object_building_id
,
object_
campus_id
,
ble_cell_id
,
rssi_dir
.
get_rssi_dir
(),
entry
.
getKey
(),
count
,
rssi_min
,
rssi_max
,
rssi_avg
,
rssi_std_dev
);
fp_cell_per_ap
.
add
(
cell_elem
);
}
...
...
@@ -271,11 +272,10 @@ public class BLEFpBuilder {
public
static
void
main
(
String
[]
args
)
{
int
M
=
(
FLOOR_LENGTH_X
%
CELL_SIZE_BLE
==
0
)?
(
FLOOR_LENGTH_X
/
CELL_SIZE_BLE
)
:
(
FLOOR_LENGTH_X
/
CELL_SIZE_BLE
)+
1
;
int
N
=
(
FLOOR_LENGTH_Y
%
CELL_SIZE_BLE
==
0
)?
(
FLOOR_LENGTH_Y
/
CELL_SIZE_BLE
)
:
(
FLOOR_LENGTH_Y
/
CELL_SIZE_BLE
)+
1
;
BLEFpBuilder
fp
=
new
BLEFpBuilder
((
FLOOR_LENGTH_X
%
CELL_SIZE_BLE
==
0
)?
FLOOR_LENGTH_X
/
CELL_SIZE_BLE
:
FLOOR_LENGTH_X
/
CELL_SIZE_BLE
+
1
,
(
FLOOR_LENGTH_Y
%
CELL_SIZE_BLE
==
0
)?
FLOOR_LENGTH_Y
/
CELL_SIZE_BLE
:
FLOOR_LENGTH_Y
/
CELL_SIZE_BLE
+
1
,
CELL_SIZE_BLE
);
// mFloor
BLEFpBuilder
fp
=
new
BLEFpBuilder
(
M
,
N
,
CELL_SIZE_BLE
,
SAMPLE_CAMPUS_ID
,
SAMPLE_BUILDING_ID
,
SAMPLE_FLOOR_ID
);
// mFloor
fp
.
LoadCellID
();
fp
.
LoadCellLocation
();
...
...
src/main/java/com/skt/ehs/mbs/fpbuilder/blefpbuilder/BLE_Floor.java
View file @
2d87a8e1
...
...
@@ -11,15 +11,22 @@ class BLE_Floor {
// Todo 수집방향
private
final
int
[]
rssi_dir
=
new
int
[]{
1000000
,
2000000
,
3000000
,
4000000
,
5000000
,
6000000
,
7000000
,
8000000
};
private
double
map_scale_pixel
;
private
int
ble_cell_size
;
public
BLE_Floor
(
int
M
,
int
N
,
int
sizeOfCell
)
{
// later , may need these data be treated in one map object.......
private
double
map_scale_pixel
;
private
int
campus_id
;
private
int
building_id
;
private
int
floor_id
;
public
BLE_Floor
(
int
M
,
int
N
,
int
sizeOfCell
,
int
campus
,
int
building
,
int
floor
)
{
this
.
bcm_M
=
M
;
this
.
bcm_N
=
N
;
this
.
bcm
=
new
_ble_cell
[
M
][
N
];
this
.
ble_cell_size
=
sizeOfCell
;
this
.
campus_id
=
campus
;
this
.
building_id
=
building
;
this
.
floor_id
=
floor
;
}
public
int
getCellID
(
int
M
,
int
N
)
{
...
...
@@ -39,7 +46,8 @@ class BLE_Floor {
public
void
showCellLocation
()
{
for
(
int
j
=
0
;
j
<
bcm_N
;
j
++)
{
for
(
int
i
=
0
;
i
<
bcm_M
;
i
++)
{
System
.
out
.
printf
(
"("
+
bcm
[
i
][
j
].
get_location_x
()+
","
+
bcm
[
i
][
j
].
get_location_y
()+
")"
);
if
(
bcm
[
i
][
j
]
!=
null
)
System
.
out
.
printf
(
"("
+
bcm
[
i
][
j
].
get_location_x
()+
","
+
bcm
[
i
][
j
].
get_location_y
()+
")"
);
}
System
.
out
.
println
();
}
...
...
@@ -91,4 +99,15 @@ class BLE_Floor {
return
ble_cell_size
;
}
public
int
getCampus_id
()
{
return
campus_id
;
}
public
int
getBuilding_id
()
{
return
building_id
;
}
public
int
getFloor_id
()
{
return
floor_id
;
}
}
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