1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.cts.verifier.sensors.sixdof.Utils.Path.PathUtilityClasses;
17 
18 /**
19  * Contains information about a rotation.
20  */
21 public class RotationData {
22     private final float mTargetRotation;
23     private final float mCurrentRotation;
24     private final boolean mRotationTestState;
25     private final float[] mLocation;
26     private final boolean mRotationState;
27 
28     /**
29      * Constructor for this class.
30      *
31      * @param targetRotation    The rotation to aim for
32      * @param currentRotation   The current rotation on the device
33      * @param rotationTestState true of the currentRotation the same as the targetRotation, false if
34      *                          they are different
35      * @param location          The location the rotation was made
36      * @param rotationState     true if the rotation is testable, false if it is not
37      */
RotationData(float targetRotation, float currentRotation, boolean rotationTestState, float[] location, boolean rotationState)38     public RotationData(float targetRotation, float currentRotation,
39                         boolean rotationTestState, float[] location, boolean rotationState) {
40         mTargetRotation = targetRotation;
41         mCurrentRotation = currentRotation;
42         mRotationTestState = rotationTestState;
43         mLocation = location;
44         mRotationState = rotationState;
45     }
46 
47     /**
48      * Returns the rotation to aim for.
49      */
getTargetAngle()50     public float getTargetAngle() {
51         return mTargetRotation;
52     }
53 
54     /**
55      * Returns the current rotation of the device.
56      */
getCurrentAngle()57     public float getCurrentAngle() {
58         return mCurrentRotation;
59     }
60 
61     /**
62      * Returns whether the rotation passed or failed.
63      */
getRotationTestState()64     public boolean getRotationTestState() {
65         return mRotationTestState;
66     }
67 
68     /**
69      * Returns whether or not the rotation is testable.
70      */
getRotationState()71     public boolean getRotationState() {
72         return mRotationState;
73     }
74 
75 }
76