-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
37 lines (25 loc) · 1.11 KB
/
Copy pathapp.py
File metadata and controls
37 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import time
from funcs.clean_data import clean_data
from funcs.insert_into_db import insert_into_db
from funcs.get_data_from_db import get_data_from_db
from funcs.total_distance import total_distance
from funcs.inside_positions import inside_positions
from funcs.user_values import user_values
def record_handler():
print('Positioning analysis')
print('----------------------')
# Collect user values
values = user_values()
# Load data from txt file and clean it
cleaned_df = clean_data(values['txt_file_name'])
# Insert cleaned data into database
insert_into_db(cleaned_df['df_final'], str(values['txt_file_name']))
# Get data from a database
df = get_data_from_db(str(values['txt_file_name']))
# Calculate total distance per tag
total_distance(df, cleaned_df['no_of_anchors'])
# Count the positions inside the circle
inside_positions(values['circle_center_x'], values['circle_center_y'], values['circle_radius'], df)
start_time = cleaned_df['start_time']
print(f'--- All tasks completed in {round((time.time() - start_time), 2)} seconds ---')
record_handler()