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
4a0ff768
Commit
4a0ff768
authored
Dec 02, 2016
by
jaehyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
couple of improvments.. last of it are being done on weekend
parent
d87eef10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
7 deletions
+54
-7
src/main/java/com/skt/ehs/mbs/db/maria/dao/FPBLEBuildDAO.java
...main/java/com/skt/ehs/mbs/db/maria/dao/FPBLEBuildDAO.java
+3
-1
src/main/java/com/skt/ehs/mbs/fpbuilder/BLEFPBuilder.java
src/main/java/com/skt/ehs/mbs/fpbuilder/BLEFPBuilder.java
+49
-4
src/main/resources/db/maria/mapper/FPBLEBuildMapper.xml
src/main/resources/db/maria/mapper/FPBLEBuildMapper.xml
+2
-2
No files found.
src/main/java/com/skt/ehs/mbs/db/maria/dao/FPBLEBuildDAO.java
View file @
4a0ff768
package
com.skt.ehs.mbs.db.maria.dao
;
package
com.skt.ehs.mbs.db.maria.dao
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* Created by user on 2016-12-01.
* Created by user on 2016-12-01.
*/
*/
public
interface
FPBLEBuildDAO
{
public
interface
FPBLEBuildDAO
{
void
updateScale
(
@Param
(
"scale_pixel"
)
double
scale_pixel
,
@Param
(
"map_id"
)
int
map_id
);
void
updateScale
(
@Param
(
"scale_pixel"
)
double
scale_pixel
,
@Param
(
"map_id"
)
int
map_id
);
public
double
selectScalePixel
(
HashMap
<
String
,
Integer
>
params
);
public
double
selectScalePixel
(
HashMap
<
String
,
Integer
>
params
);
}
}
\ No newline at end of file
src/main/java/com/skt/ehs/mbs/fpbuilder/BLEFPBuilder.java
View file @
4a0ff768
...
@@ -2,8 +2,13 @@ package com.skt.ehs.mbs.fpbuilder;
...
@@ -2,8 +2,13 @@ package com.skt.ehs.mbs.fpbuilder;
import
com.skt.ehs.mbs.db.maria.DBManager
;
import
com.skt.ehs.mbs.db.maria.DBManager
;
import
com.skt.ehs.mbs.db.maria.MariaConnectionManager
;
import
com.skt.ehs.mbs.db.maria.MariaConnectionManager
;
import
com.skt.ehs.mbs.db.maria.dao.FPBLEBuildDAO
;
import
org.apache.ibatis.session.SqlSession
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
public
class
BLEFPBuilder
{
public
class
BLEFPBuilder
{
...
@@ -11,6 +16,20 @@ public class BLEFPBuilder {
...
@@ -11,6 +16,20 @@ public class BLEFPBuilder {
public
static
final
int
LENGTH_X
=
8000
;
public
static
final
int
LENGTH_X
=
8000
;
public
static
final
int
WIDTH_Y
=
4000
;
public
static
final
int
WIDTH_Y
=
4000
;
class
_ble_indicator
{
String
m_ap_id
;
Integer
m_rssi
;
_ble_indicator
(
String
ap_id
,
Integer
rssi
)
{
m_ap_id
=
ap_id
;
m_rssi
=
rssi
;
}
@Override
public
String
toString
()
{
return
String
.
format
(
"%s : %9d"
,
m_ap_id
,
m_rssi
);
}
}
Floor
mFloor
;
Floor
mFloor
;
public
BLEFPBuilder
(
int
M
,
int
N
)
{
public
BLEFPBuilder
(
int
M
,
int
N
)
{
...
@@ -65,6 +84,28 @@ public class BLEFPBuilder {
...
@@ -65,6 +84,28 @@ public class BLEFPBuilder {
return
ret
;
return
ret
;
}
}
private
List
<
_ble_indicator
>
get_aplist_in_coordinate_per_rssidir
(
int
d1
,
int
d2
,
int
x1
,
int
y1
,
int
x2
,
int
y2
)
{
MariaConnectionManager
mngr
=
MariaConnectionManager
.
getInstance
();
List
<
_ble_indicator
>
ret
=
Collections
.
emptyList
();
System
.
out
.
printf
(
"( d1, d2, x1, y1, x2, y2)=( %10d, %10d, %10d, %10d, %10d, %10d )"
,
d1
,
d2
,
x1
,
y1
,
x2
,
y2
);
System
.
out
.
println
();
try
(
SqlSession
session
=
mngr
.
getSqlSessionFactory
().
openSession
())
{
FPBLEBuildDAO
mapper
=
session
.
getMapper
(
FPBLEBuildDAO
.
class
);
// Todo regarding to given rssi_dir & cell_coordi, select <tagid, seq, time> records
// Todo select AP regarding to above <tagid, seq, time> records as per A record.
//ret = mapper.selectAPinCoordiwDir(d1,d2,x1,y1,x2, y2);
}
ret
.
forEach
(
System
.
out
::
println
);
return
ret
;
}
public
boolean
build
()
{
public
boolean
build
()
{
...
@@ -73,13 +114,15 @@ public class BLEFPBuilder {
...
@@ -73,13 +114,15 @@ public class BLEFPBuilder {
mFloor
.
setMap_scale_pixel
(
scale_pixel
);
mFloor
.
setMap_scale_pixel
(
scale_pixel
);
// Todo access DB & calculate factor & build fp.
// Todo access DB & calculate factor & build fp.
/*********************** Loop of loop here ... *************************************/
// 수집방향 맵 준비
// 수집방향 맵 준비
int
[]
temp
=
mFloor
.
loadRSSIDir
();
int
[]
temp
=
mFloor
.
loadRSSIDir
();
System
.
out
.
println
(
Arrays
.
toString
(
temp
));
System
.
out
.
println
(
Arrays
.
toString
(
temp
));
/* Todo 8분위 되어 있는 기준값을 단말기에서 올려주는 값의 범위로 바꾸어 사용할 수 있도록 준비
/* Todo 8분위 되어 있는 기준값을 단말기에서 올려주는 값의 범위로 바꾸어 사용할 수 있도록 준비
switch case 사용
switch case 사용
*/
*/
int
rssi_dir
=
temp
[
0
];
System
.
out
.
println
(
"RSSI_DIR : "
+
rssi_dir
);
// location coordinate 준비
// location coordinate 준비
BLECell
bleCell
=
mFloor
.
getBLECell
(
3
,
5
);
BLECell
bleCell
=
mFloor
.
getBLECell
(
3
,
5
);
...
@@ -93,12 +136,14 @@ public class BLEFPBuilder {
...
@@ -93,12 +136,14 @@ public class BLEFPBuilder {
System
.
out
.
printf
(
"Pixel Coordinate : ("
+
coordinate_pixel_x1
+
", "
+
coordinate_pixel_y1
+
") ("
+
coordinate_pixel_x2
+
", "
+
coordinate_pixel_y2
+
")"
);
System
.
out
.
printf
(
"Pixel Coordinate : ("
+
coordinate_pixel_x1
+
", "
+
coordinate_pixel_y1
+
") ("
+
coordinate_pixel_x2
+
", "
+
coordinate_pixel_y2
+
")"
);
System
.
out
.
println
();
System
.
out
.
println
();
List
<
_ble_indicator
>
ble_list
=
get_aplist_in_coordinate_per_rssidir
(
rssi_dir
,
rssi_dir
,
coordinate_pixel_x1
,
coordinate_pixel_y1
,
coordinate_pixel_x2
,
coordinate_pixel_y2
);
// using collection.stream() ,
// calculate rssi_min, rssi_max, rssi_avg, rssi_std_dev, count per ap_id
// then insert into fp_ble_data table
// Loop here ..*********************************************************************/
return
true
;
return
true
;
...
...
src/main/resources/db/maria/mapper/FPBLEBuildMapper.xml
View file @
4a0ff768
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
<mapper
namespace=
"com.skt.ehs.mbs.db.maria.dao.FPBLEBuildDAO"
>
<mapper
namespace=
"com.skt.ehs.mbs.db.maria.dao.FPBLEBuildDAO"
>
<select
id=
"selectScalePixel"
parameterType=
"map"
resultType=
"double"
>
<select
id=
"selectScalePixel"
parameterType=
"map"
resultType=
"double"
>
select scale_pixel from map_image WHERE campus_id=#{campus_id} and BUILDING_ID = #{building_id} and floor_id=#{floor_id}
select scale_pixel from map_image WHERE campus_id=#{campus_id} and BUILDING_ID = #{building_id} and floor_id=#{floor_id}
</select>
</select>
</mapper>
</mapper>
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