Commit b2e4646d authored by jaehyu's avatar jaehyu

clear error-prone codes

parent 4b7aa107
......@@ -21,39 +21,40 @@ public class BLEFpBuilder {
public static final int SAMPLE_BUILDING_ID = 1;
public static final int SAMPLE_FLOOR_ID = 1;
BLE_Floor mFloor;
BLE_Floor bFloor;
public BLEFpBuilder(int M, int N, int sizeOfCell) {
mFloor = new BLE_Floor(M,N,sizeOfCell);
bFloor = new BLE_Floor(M,N,sizeOfCell);
}
public void LoadCellID() {
for (int x = 1 ; x <= mFloor.getM(); x++) {
for (int x = 1 ; x <= bFloor.getM(); x++) {
int id = 0;
int id_x = 1000 * x;
for (int y = 1; y <= mFloor.getN(); y++) {
for (int y = 1; y <= bFloor.getN(); y++) {
id = id_x + y;
_ble_cell bleCell= new _ble_cell(id);
mFloor.setCell(x-1,y-1,bleCell);
bFloor.setCell(x-1,y-1,bleCell);
}
}
mFloor.showCellID();
bFloor.showCellID();
}
public void LoadCellLocation() {
int location_x = 0;
int location_y = 0;
int cell_size = mFloor.getBle_cell_size();
int cell_size = bFloor.getBle_cell_size();
for (int x = 1 ; x <= mFloor.getM(); x++) {
for (int x = 1 ; x <= bFloor.getM(); x++) {
location_x = (cell_size * x) - (cell_size / 2);
for (int y = 1; y <= mFloor.getN(); y++) {
for (int y = 1; y <= bFloor.getN(); y++) {
location_y = (cell_size * y) - (cell_size / 2);
mFloor.setCellLocation(x-1,y-1,location_x,location_y);
bFloor.setCellLocation(x-1,y-1,location_x,location_y);
}
}
mFloor.showCellLocation();
bFloor.showCellLocation();
}
public boolean LoadDBConnectionPool() {
......@@ -173,15 +174,15 @@ public class BLEFpBuilder {
int campus_id = SAMPLE_CAMPUS_ID;
int building_id = SAMPLE_BUILDING_ID;
int floor_id = SAMPLE_FLOOR_ID;
int object_cell_size = mFloor.getBle_cell_size();
int object_cell_size = bFloor.getBle_cell_size();
int ble_cell_id;
double scale_pixel = readMapScale(campus_id, building_id, floor_id); // 수집시 사용한 지도의 축척정보
mFloor.setMap_scale_pixel(scale_pixel);
bFloor.setMap_scale_pixel(scale_pixel);
double object_scale_pixel;
if((object_scale_pixel = mFloor.getMap_scale_pixel())==0) { }
if((object_scale_pixel = bFloor.getMap_scale_pixel())==0) { }
System.out.println("object_scale_pixel : "+object_scale_pixel);
System.out.println("object_cell_size : "+object_cell_size);
......@@ -189,24 +190,24 @@ public class BLEFpBuilder {
System.out.println("ble_fp_builder process started .................... ");
int[] rssi_dir_index = mFloor.loadRSSIDir();
int[] rssi_dir_index = bFloor.loadRSSIDir();
rssiDirBound rssi_dir;
for (int i =0; i < rssi_dir_index.length ; i++ ) { // 1.수집방향별로 세트를 구성
rssi_dir = normalizeRssiDir(rssi_dir_index[i]);
for (int m = 0; m < mFloor.getM(); m++) {
for (int n = 0; n < mFloor.getN(); n++) { // 2.격자별....
for (int m = 0; m < bFloor.getM(); m++) {
for (int n = 0; n < bFloor.getN(); n++) { // 2.격자별....
ble_cell_id = mFloor.getCell(m, n).get_id();
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(" ble_cell_location : ("+mFloor.getCell(m,n).get_location_x()+", "+mFloor.getCell(m,n).get_location_y()+")");
System.out.printf(" ble_cell_location : ("+bFloor.getCell(m,n).get_location_x()+", "+bFloor.getCell(m,n).get_location_y()+")");
System.out.println();
int cell_location_x = mFloor.getCell(m, n).get_location_x();
int cell_location_y = mFloor.getCell(m, n).get_location_y();
int cell_location_x = bFloor.getCell(m, n).get_location_x();
int cell_location_y = bFloor.getCell(m, n).get_location_y();
int coordinate_pixel_x1 = (cell_location_x - object_cell_size / 2) / (int)object_scale_pixel;
int coordinate_pixel_y1 = (cell_location_y - object_cell_size / 2) / (int)object_scale_pixel;
......
......@@ -29,6 +29,7 @@ class BLE_Floor {
public void showCellID() {
for(int j=0;j< bcm_N;j++) {
for(int i=0;i< bcm_M; i++) {
if(bcm[i][j] != null)
System.out.printf("%9d ", bcm[i][j].get_id());
}
System.out.println();
......
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