#include <memory>
#include <Types.h>
#include "user_places.h"
-#include "places_detector.h"
+#include "../place/places_detector.h"
#include <MyPlaceTypes.h>
ctx::UserPlaces::UserPlaces(PlaceRecogMode energyMode):
__timerManager.remove(__placesDetectorTimerId);
_D("PlacesDetector timer removed");
}
-
if (__visitDetector)
delete __visitDetector;
if (__placesDetector)
#include <vector>
#include <Json.h>
#include <TimerManager.h>
-#include "visit_detector.h"
-#include "places_detector.h"
+#include "../visit-detector/visit_detector.h"
+#include "../place/places_detector.h"
#include "user_places_types.h"
namespace ctx {
#include <Types.h>
#include "user_places_types.h"
#include "user_places_params.h"
-#include "debug_utils.h"
+#include "../utils/debug_utils.h"
#define __MAC_STRING_COMPONENTS_SEPARATOR ':'
#define __MAC_SET_STRING_DELIMITER ','
#include <map>
#include <unordered_map>
#include <unordered_set>
-#include "graph.h"
-#include "../place_recognition_types.h"
#include <string>
#include <ctime>
#include <MyPlaceTypes.h>
+// Context Items
+#define PLACE_PRIV_RECOGNITION "location" // TODO: unused?
+
+// Database
+#define VISIT_TABLE "place_status_user_place_visit"
+#define VISIT_COLUMN_START_TIME "start_time"
+#define VISIT_COLUMN_END_TIME "end_time"
+#define VISIT_COLUMN_WIFI_APS "wifi_aps"
+#define VISIT_COLUMN_CATEGORY "category"
+#ifdef TIZEN_ENGINEER_MODE
+#define VISIT_COLUMN_START_TIME_HUMAN "start_time_human" // only for debug: human readable time data:
+#define VISIT_COLUMN_END_TIME_HUMAN "end_time_human" // only for debug: human readable time data:
+#endif /* TIZEN_ENGINEER_MODE */
+#define VISIT_COLUMN_LOCATION_VALID "location_valid"
+#define VISIT_COLUMN_LOCATION_LATITUDE "location_latitude"
+#define VISIT_COLUMN_LOCATION_LONGITUDE "location_longitude"
+#define VISIT_COLUMN_LOCATION_ACCURACY "location_accuracy"
+#define VISIT_COLUMN_CATEG_HOME "categ_home"
+#define VISIT_COLUMN_CATEG_WORK "categ_work"
+#define VISIT_COLUMN_CATEG_OTHER "categ_other"
+
+#define WIFI_APS_MAP_TABLE "place_status_user_place_wifi_aps_map"
+#define WIFI_APS_MAP_COLUMN_MAC "mac"
+#define WIFI_APS_MAP_COLUMN_NETWORK_NAME "network_name"
+#define WIFI_APS_MAP_COLUMN_INSERT_TIME "insert_time"
+
+#define PLACE_TABLE "place_status_user_place"
+#define PLACE_COLUMN_CATEG_ID "categ_id"
+#define PLACE_COLUMN_CATEG_CONFIDENCE "categ_confidence"
+#define PLACE_COLUMN_NAME "name"
+#define PLACE_COLUMN_LOCATION_VALID "location_valid"
+#define PLACE_COLUMN_LOCATION_LATITUDE "location_latitude"
+#define PLACE_COLUMN_LOCATION_LONGITUDE "location_longitude"
+#define PLACE_COLUMN_LOCATION_ACCURACY "location_accuracy"
+#define PLACE_COLUMN_WIFI_APS "wifi_aps"
+#define PLACE_COLUMN_CREATE_DATE "create_date"
+
+#define WIFI_TABLE_NAME "place_status_user_place_wifi"
+#define WIFI_COLUMN_TIMESTAMP "timestamp"
+#define WIFI_COLUMN_BSSID "bssid"
+#define WIFI_COLUMN_ESSID "essid"
+
+#define LOCATION_TABLE_NAME "place_status_user_place_location"
+#define LOCATION_COLUMN_LATITUDE "geo_latitude"
+#define LOCATION_COLUMN_LONGITUDE "geo_longitude"
+#define LOCATION_COLUMN_ACCURACY "accuracy"
+#define LOCATION_COLUMN_TIMESTAMP "timestamp"
+#ifdef TIZEN_ENGINEER_MODE
+#define LOCATION_COLUMN_TIMESTAMP_HUMAN "time_human" // only for debug: human readable time data:
+#define LOCATION_COLUMN_METHOD "method"
+#endif /* TIZEN_ENGINEER_MODE */
+
+enum PlaceRecogMode {
+ PLACE_RECOG_HIGH_ACCURACY_MODE = 0,
+ PLACE_RECOG_LOW_POWER_MODE = 1
+};
+
namespace ctx {
/*
*/
#include "place_categer.h"
-#include "median.h"
-#include "../place_recognition_types.h"
-#include "user_places_params.h"
-#include "user_places_types.h"
+#include "../utils/median.h"
+#include "../facade/user_places_params.h"
+#include "../facade/user_places_types.h"
#include <algorithm>
#include <Types.h>
#ifndef _CONTEXT_PLACE_RECOGNITION_PLACE_CATEGER_
#define _CONTEXT_PLACE_RECOGNITION_PLACE_CATEGER_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
#include <utility>
#include <vector>
#include <string>
#include <MyPlaceTypes.h>
-#include "../place_recognition_types.h"
namespace ctx {
#include <sstream>
#include <Types.h>
#include <Json.h>
-#include "similarity.h"
+#include "../utils/similarity.h"
#include "places_detector.h"
#include "place_categer.h"
-#include "graph.h"
-#include "median.h"
+#include "../utils/median.h"
#ifdef TIZEN_ENGINEER_MODE
-#include "gmap.h"
+#include "../utils/gmap.h"
#endif /* TIZEN_ENGINEER_MODE */
-#include "../place_recognition_types.h"
+#include "../facade/user_places_types.h"
#include <fstream>
#include <algorithm>
-#include "user_places_params.h"
-#include "debug_utils.h"
+#include "../facade/user_places_params.h"
+#include "../utils/debug_utils.h"
#define __DELETE_PLACES_QUERY "DELETE FROM " PLACE_TABLE
#include <cstdint>
#include <ITimerListener.h>
#include <DatabaseManager.h>
-#include "visit_detector.h"
-#include "user_places_types.h"
+//#include "visit_detector.h"
+#include "../facade/user_places_types.h"
#include <MyPlaceTypes.h>
+#include "graph.h"
namespace ctx {
*/
#include "place_recognition.h"
-#include "user_places/user_places.h"
void ctx::PlaceRecognitionProvider::getPrivilege(std::vector<const char*> &privilege)
{
#include <ContextProvider.h>
#include "MyPlaceTypes.h"
-#include "user_places/user_places.h"
+#include "facade/user_places.h"
+#include "ProviderTypes.h"
namespace ctx {
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _CONTEXT_PLACE_RECOGNITION_TYPES_
-#define _CONTEXT_PLACE_RECOGNITION_TYPES_
-
-#include <ProviderTypes.h>
-
-// Context Items
-#define PLACE_PRIV_RECOGNITION "location"
-
-// Database
-#define VISIT_TABLE "place_status_user_place_visit"
-#define VISIT_COLUMN_START_TIME "start_time"
-#define VISIT_COLUMN_END_TIME "end_time"
-#define VISIT_COLUMN_WIFI_APS "wifi_aps"
-#define VISIT_COLUMN_CATEGORY "category"
-#ifdef TIZEN_ENGINEER_MODE
-#define VISIT_COLUMN_START_TIME_HUMAN "start_time_human" // only for debug: human readable time data:
-#define VISIT_COLUMN_END_TIME_HUMAN "end_time_human" // only for debug: human readable time data:
-#endif /* TIZEN_ENGINEER_MODE */
-#define VISIT_COLUMN_LOCATION_VALID "location_valid"
-#define VISIT_COLUMN_LOCATION_LATITUDE "location_latitude"
-#define VISIT_COLUMN_LOCATION_LONGITUDE "location_longitude"
-#define VISIT_COLUMN_LOCATION_ACCURACY "location_accuracy"
-#define VISIT_COLUMN_CATEG_HOME "categ_home"
-#define VISIT_COLUMN_CATEG_WORK "categ_work"
-#define VISIT_COLUMN_CATEG_OTHER "categ_other"
-
-#define WIFI_APS_MAP_TABLE "place_status_user_place_wifi_aps_map"
-#define WIFI_APS_MAP_COLUMN_MAC "mac"
-#define WIFI_APS_MAP_COLUMN_NETWORK_NAME "network_name"
-#define WIFI_APS_MAP_COLUMN_INSERT_TIME "insert_time"
-
-#define PLACE_TABLE "place_status_user_place"
-#define PLACE_COLUMN_CATEG_ID "categ_id"
-#define PLACE_COLUMN_CATEG_CONFIDENCE "categ_confidence"
-#define PLACE_COLUMN_NAME "name"
-#define PLACE_COLUMN_LOCATION_VALID "location_valid"
-#define PLACE_COLUMN_LOCATION_LATITUDE "location_latitude"
-#define PLACE_COLUMN_LOCATION_LONGITUDE "location_longitude"
-#define PLACE_COLUMN_LOCATION_ACCURACY "location_accuracy"
-#define PLACE_COLUMN_WIFI_APS "wifi_aps"
-#define PLACE_COLUMN_CREATE_DATE "create_date"
-
-#define WIFI_TABLE_NAME "place_status_user_place_wifi"
-#define WIFI_COLUMN_TIMESTAMP "timestamp"
-#define WIFI_COLUMN_BSSID "bssid"
-#define WIFI_COLUMN_ESSID "essid"
-
-#define LOCATION_TABLE_NAME "place_status_user_place_location"
-#define LOCATION_COLUMN_LATITUDE "geo_latitude"
-#define LOCATION_COLUMN_LONGITUDE "geo_longitude"
-#define LOCATION_COLUMN_ACCURACY "accuracy"
-#define LOCATION_COLUMN_TIMESTAMP "timestamp"
-#ifdef TIZEN_ENGINEER_MODE
-#define LOCATION_COLUMN_TIMESTAMP_HUMAN "time_human" // only for debug: human readable time data:
-#define LOCATION_COLUMN_METHOD "method"
-#endif /* TIZEN_ENGINEER_MODE */
-
-enum PlaceRecogMode {
- PLACE_RECOG_HIGH_ACCURACY_MODE = 0,
- PLACE_RECOG_LOW_POWER_MODE = 1
-};
-
-#endif /* End of _CONTEXT_PLACE_RECOGNITION_TYPES_ */
#ifndef _CONTEXT_PLACE_RECOGNITION_GMAP_H_
#define _CONTEXT_PLACE_RECOGNITION_GMAP_H_
-#include "user_places_types.h"
-#include "../place_recognition_types.h"
+#include "../facade/user_places_types.h"
#define GMAP_FILE "/tmp/user_places_map.html"
#ifndef _CONTEXT_PLACE_RECOGNITION_MEDIAN_
#define _CONTEXT_PLACE_RECOGNITION_MEDIAN_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
#include <vector>
-#include "../place_recognition_types.h"
namespace ctx {
#ifndef _CONTEXT_PLACE_RECOGNITION_SIMILAR_H_
#define _CONTEXT_PLACE_RECOGNITION_SIMILAR_H_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
namespace ctx {
#define _CONTEXT_PLACE_RECOGNITION_MAHAL_H_
#include <vector>
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
namespace ctx {
#ifndef _CONTEXT_PLACE_RECOGNITION_PIECEWISE_LIN_
#define _CONTEXT_PLACE_RECOGNITION_PIECEWISE_LIN_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
namespace ctx {
#include "visit_categer.h"
#include "mahal.h"
#include <time.h>
-#include "../place_recognition_types.h"
#include "prob_features_model.h"
#include <Types.h>
void ctx::VisitCateger::categorize(ctx::Visit &visit)
{
+ _D("");
IntervalFeatures features = __intervalFeatures(visit.interval);
__normalize(features);
#ifndef _CONTEXT_PLACE_RECOGNITION_VISIT_CATEGER_H_
#define _CONTEXT_PLACE_RECOGNITION_VISIT_CATEGER_H_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
#include "mahal.h"
#include "piecewise_lin.h"
#include <map>
+#include <Types.h>
namespace ctx {
#ifndef _CONTEXT_PLACE_RECOGNITION_LOCATION_LISTENER_IFACE_H_
#define _CONTEXT_PLACE_RECOGNITION_LOCATION_LISTENER_IFACE_H_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
namespace ctx {
#include <Types.h>
#include <Json.h>
#include <DatabaseManager.h>
-#include "../place_recognition_types.h"
-#include "user_places_params.h"
-#include "debug_utils.h"
+#include "../facade/user_places_types.h"
+#include "../facade/user_places_params.h"
+#include "../utils/debug_utils.h"
#include "location_logger.h"
#ifdef TIZEN_ENGINEER_MODE
#include <sstream>
#include <Types.h>
#include <Json.h>
-#include "../place_recognition_types.h"
+#include "../facade/user_places_types.h"
#include "visit_detector.h"
-#include "user_places_params.h"
-#include "visit_categer.h"
-#include "similarity.h"
-#include "median.h"
-#include "debug_utils.h"
+#include "../facade/user_places_params.h"
+#include "../visit-categer/visit_categer.h"
+#include "../utils/similarity.h"
+#include "../utils/median.h"
+#include "../utils/debug_utils.h"
#ifdef TIZEN_ENGINEER_MODE
#define __VISIT_TABLE_COLUMNS \
if (__wifiLogger)
__wifiLogger->setMode(energyMode);
}
+
+
+
#include <map>
#include <unordered_map>
#include <unordered_set>
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
#include <Json.h>
#include <DatabaseManager.h>
#include "visit_listener_iface.h"
#ifndef _CONTEXT_PLACE_RECOGNITION_WIFI_LISTENER_IFACE_H_
#define _CONTEXT_PLACE_RECOGNITION_WIFI_LISTENER_IFACE_H_
-#include "user_places_types.h"
+#include "../facade/user_places_types.h"
namespace ctx {
#include <sstream>
#include <Types.h>
#include <DatabaseManager.h>
-#include "../place_recognition_types.h"
-#include "debug_utils.h"
+#include "../facade/user_places_types.h"
+#include "../utils/debug_utils.h"
#include "wifi_logger.h"
#define __WIFI_CREATE_TABLE_COLUMNS \
#include <TimerManager.h>
#include "wifi_listener_iface.h"
#include "visit_listener_iface.h"
-#include "user_places_params.h"
+#include "../facade/user_places_params.h"
/* Database usage flag */
#define WIFI_LOGGER_DATABASE false