Commit a491953f authored by jaehyu's avatar jaehyu

commited for homework

parent 0e058332
......@@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class BLEFPBuilder {
......@@ -16,8 +17,6 @@ public class BLEFPBuilder {
public static final int LENGTH_X = 8000;
public static final int WIDTH_Y = 4000;
Floor mFloor;
public BLEFPBuilder(int M,int N) {
......@@ -58,9 +57,9 @@ public class BLEFPBuilder {
}
private static double readMapScale() {
int iCampusID = 1; // Todo console 에서 받아옴
int iBuildingID = 1; // Todo console 에서 받아옴
int iFloorID = 1; // Todo console 에서 받아옴
int iCampusID = 1; // Todo: Console 에서 받아옴
int iBuildingID = 1; // Todo: Console 에서 받아옴
int iFloorID = 1; // Todo: Console 에서 받아옴
double ret = 0;
try {
......@@ -131,8 +130,33 @@ public class BLEFPBuilder {
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);
// sample ble_list
List<_ble_indicator> sample = new ArrayList<>();
_ble_indicator a = new _ble_indicator("aaaaa", 1111);
sample.add(a);
_ble_indicator b = new _ble_indicator("bbbb", 2222);
sample.add(b);
_ble_indicator c = new _ble_indicator("aaaaa", 3333);
sample.add(c);
_ble_indicator d = new _ble_indicator("ccccc", 4444);
sample.add(d);
_ble_indicator e = new _ble_indicator("aaaaa", 5555);
sample.add(e);
_ble_indicator f = new _ble_indicator("cccc", 6666);
sample.add(f);
_ble_indicator g = new _ble_indicator("bbbb", 7777);
sample.add(g);
// using collection.stream()
// calculate rssi_min, rssi_max, rssi_avg, rssi_std_dev, count per ap_id
// rssi_avg per ap_id
sample.stream().collect(Collectors.groupingBy( ble -> ble.m_ap_id,
Collectors.counting()))
.forEach( (x,y) -> System.out.println(x+"\t"+y));
// calculate mag_angle - 해당 cell의 각 수집방향에 대하여 수집된 지자기방향의 평균값으로 대표
// then insert into fp_ble_data table
......@@ -144,13 +168,13 @@ public class BLEFPBuilder {
public static void main(String[] args) {
BLEFPBuilder bleFPBuilder = new BLEFPBuilder((LENGTH_X % CELL_SIZE_BLE == 0)? LENGTH_X/CELL_SIZE_BLE : LENGTH_X/CELL_SIZE_BLE + 1,(WIDTH_Y % CELL_SIZE_BLE == 0)? WIDTH_Y/CELL_SIZE_BLE : WIDTH_Y/CELL_SIZE_BLE + 1); // mFloor
bleFPBuilder.LoadCellID();
bleFPBuilder.LoadCellLocation();
BLEFPBuilder fp = new BLEFPBuilder((LENGTH_X % CELL_SIZE_BLE == 0)? LENGTH_X/CELL_SIZE_BLE : LENGTH_X/CELL_SIZE_BLE + 1,(WIDTH_Y % CELL_SIZE_BLE == 0)? WIDTH_Y/CELL_SIZE_BLE : WIDTH_Y/CELL_SIZE_BLE + 1); // mFloor
fp.LoadCellID();
fp.LoadCellLocation();
if (!bleFPBuilder.LoadDBConnectionPool()) {
if (!fp.LoadDBConnectionPool()) {
//exit
}
bleFPBuilder.build();
fp.build();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment