2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUixSensorTiltSensorData.cpp
20 * @brief This is the implementation file for the %TiltSensorData class.
22 * This files contains implementation of the %TiltSensorData class.
26 #include <FBaseErrors.h>
27 #include <FBaseSysLog.h>
29 #include <FUixSensorTiltSensorData.h>
30 #include "FUixSensor_SensorUtil.h"
32 namespace Tizen { namespace Uix { namespace Sensor
36 static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
39 TiltSensorData::TiltSensorData(void)
47 TiltSensorData::~TiltSensorData(void)
53 TiltSensorData::GetValue(SensorDataKey dataKey, long& value) const
55 switch (static_cast<TiltDataKey>(dataKey))
57 case TILT_DATA_KEY_TIMESTAMP:
58 value = _SensorUtil::CutTimestamp(timestamp);
61 SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
69 TiltSensorData::GetValue(SensorDataKey dataKey, float& value) const
71 switch (static_cast<TiltDataKey>(dataKey))
73 case TILT_DATA_KEY_ROLL:
76 case TILT_DATA_KEY_PITCH:
79 case TILT_DATA_KEY_AZIMUTH:
83 SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
91 TiltSensorData::GetValue(SensorDataKey dataKey, bool& value) const
93 SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
96 } } }// Tizen::Uix::Sensor