Commit 9957d43d authored by jaehyu's avatar jaehyu

added couple of ideas

parent 795f8a3a
......@@ -13,11 +13,10 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.1" level="project" />
<orderEntry type="library" name="Maven: org.mariadb.jdbc:mariadb-java-client:1.5.4" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.slf4j:slf4j-log4j12:1.7.21" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.7" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j13:1.0.1" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -31,4 +31,10 @@ public class Configure {
// TODO : 파일을 로딩해야 합니다.
// TODO : 로딩한 값을 변수에 설정해 주어야 합니다.
}
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;
}
......@@ -19,13 +19,21 @@ public class RawDataTag {
private double mag_bh;
private double mag_bv;
private boolean reverse_col;
private int rssi_dir;
private int north_dir;
private int floor_id;
private int building_id;
private int campus_id;
private String c_cell_id;
public int getRssi_dir() {
return rssi_dir;
}
public void setRssi_dir(int rssi_dir) {
this.rssi_dir = rssi_dir;
}
public String getTag_id() {
return tag_id;
}
......@@ -106,13 +114,6 @@ public class RawDataTag {
this.mag_bv = mag_bv;
}
public boolean isReverse_col() {
return reverse_col;
}
public void setReverse_col(boolean reverse_col) {
this.reverse_col = reverse_col;
}
public int getNorth_dir() {
return north_dir;
......@@ -166,7 +167,7 @@ public class RawDataTag {
", position_y=" + position_y +
", mag_bh=" + mag_bh +
", mag_bv=" + mag_bv +
", reverse_col=" + reverse_col +
", north_dir=" + north_dir +
", floor_id=" + floor_id +
", building_id=" + building_id +
......
package com.skt.ehs.mbs.fpbuilder;
/**
* Created by user on 2016-11-30.
*/
public class BLECell {
int cell_id;
public int getCell_id() {
return cell_id;
}
public void setCell_id(int cell_id) {
this.cell_id = cell_id;
}
//
}
package com.skt.ehs.mbs.fpbuilder;
import com.skt.ehs.mbs.conf.Configure;
import com.skt.ehs.mbs.db.maria.DBManager;
import com.skt.ehs.mbs.db.maria.MariaConnectionManager;
import com.skt.ehs.mbs.db.maria.vo.RawDataTag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/*
......@@ -18,12 +21,52 @@ intellj 컴파일에 문제가 있으면 ,
by jaehyu 2016-11-28
*/
public class BLEFPBuilder {
static Logger logger = LoggerFactory.getLogger(BLEFPBuilder.class);
Logger logger = LoggerFactory.getLogger(BLEFPBuilder.class);
boolean build_FP_BLE_CELL() {
int mag_per_ble = (int)(Configure.CELL_SIZE_BLE / Configure.CELL_SIZE_MAG);
return false;
}
void genCell() {
int xmax = (int) (Configure.LENGTH_X / Configure.CELL_SIZE_BLE);
int ymax = (int) (Configure.LENGTH_Y / Configure.CELL_SIZE_BLE);
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++;
List<BLECell> ble_cells = new ArrayList<>();
for (int x = 1; x <= xmax; x++) {
int idx = 0;
int id = 0;
int id_x = 1000 * x;
for (int y = 1; y <= ymax; y++) {
id = id_x + y;
BLECell next = new BLECell();
next.setCell_id(id);
ble_cells.add(next);
}
}
Iterator<BLECell> iter = ble_cells.iterator();
while (iter.hasNext()) System.out.println(iter.next().getCell_id());
System.out.println(ble_cells.size());
}
static boolean processor() {
System.out.println("Hello");
if (MariaConnectionManager.getInstance().makeConnectionPool() == false) {
logger.error("Fail to connect IntegrationDB. Can't start MBSServer.");
//logger.error("Fail to connect IntegrationDB. Can't start MBSServer.");
return false;
}
// package-only-list from raw_data_tag
......@@ -42,10 +85,13 @@ public class BLEFPBuilder {
// throwable.printStackTrace();
//}
return true;
}
public static void main(String[] args) {
BLEFPBuilder b = new BLEFPBuilder();
b.genCell();
processor();
}
......
package com.skt.ehs.mbs.fpbuilder;
/**
* Created by user on 2016-11-30.
*/
final public class CellMatrix {
private final int M; // number of rows
private final int N; // number of columns
private int[][] cell_ids = null;
// create M-by-N matrix of 0's
public CellMatrix(int M, int N) {
this.M = M;
this.N = N;
cell_ids = new int[M][N];
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
......@@ -7,14 +7,16 @@
<insert id="insertRawDataTag" parameterType="RawDataTag" >
<insert id="insertRawDataTag" parameterType="RawDataTag" >
INSERT INTO raw_data_tag (tag_id, collected_time, sequence_num, sub_seq_num, package_collect_key, revision_collect, position_x, position_y,
mag_bh, mag_bv, rssi_dir, north_dir, floor_id, building_id, campus_id, c_cell_id) values (#{tag_id},#{collected_time},#{sequence_num},#{sub_seq_num},#{package_collect_key},#{revision_collect},#{position_x},#{position_y},#{mag_bh},#{mag_bv},#{rssi_dir},#{north_dir},#{floor_id},#{building_id},#{campus_id},#{c_cell_id})
</insert>
</insert>
<select id="hSelectAll" parameterType="map" resultType="RawDataTag">
<select id="hSelectAll" parameterType="map" resultType="RawDataTag">
SELECT tag_id, collected_time, sequence_num, sub_seq_num, package_collect_key, revision_collect, position_x, position_y,
mag_bh, mag_bv, rssi_dir, north_dir, floor_id, building_id, campus_id, c_cell_id FROM raw_data_tag WHERE campus_id=#{campus_id} and BUILDING_ID = #{building_id} and floor_id=#{floor_id}
</select>
</select>
</mapper>
\ No newline at end of file
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