Пример #1
0
def main():
	logger.info('Running main()')

	query = """SELECT * FROM (SELECT id, session_id, rssi, ssid, timestamp, robot_id, loc_x, loc_y,
	@id_id:=CASE WHEN @id_session_id <> session_id THEN 0 ELSE @id_id+1 END as rn,
	@id_session_id := session_id AS clset
	FROM
	(SELECT @id_session_id := -1) s,
	(SELECT @id_id := -1) c,
	(SELECT * FROM rssi_values ORDER BY session_id, id, rssi) t) x WHERE rn < 5"""

	logger.info("running query : {}".format(query))
	result = run_query(dbhost, dbuser, dbpwd, dbname, query, True, csv_name)

	logger.info('csv output generated: {}'.format(csv_name))
	file_name = csv_name

	logger.info('Print the output')
	output = parsing_file(file_name)
	centroid_weighted(output)
Пример #2
0
from parsing import parsing_file
from func import get_alpha, get_estimate, get_distance
import sys

file_name = sys.argv[1]

out = parsing_file(file_name)
alpha = get_alpha(out)
get_estimate(out, alpha)