Skip to content

Commit

Permalink
Renamed Screen.IsFlat to Position.IsFlat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Rongas committed Nov 9, 2010
1 parent f2eab0d commit bf7603c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
3 changes: 3 additions & 0 deletions debian/changelog
Expand Up @@ -3,6 +3,9 @@ sensord (0.6.30) unstable; urgency=low
[Antti Virtanen]
* Optimized logger streaming ops to do nothing when used loglevel wouldn't log anything.

[Timo Rongas]
* Renamed Screen.IsFlat context property to Position.IsFlat as requested.

-- Timo Rongas <ext-timo.2.rongas@nokia.com> Tue, 09 Nov 2010 13:09:12 +0300

sensord (0.6.29) unstable; urgency=low
Expand Down
2 changes: 1 addition & 1 deletion sensord.pc
Expand Up @@ -4,7 +4,7 @@ libdir=${prefix}/lib/

Name: Sensord
Description: Sensord
Version: 0.6.29
Version: 0.6.30
Requires:
Libs: -L${libdir} -lsensorclient -lsensordatatypes
Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters
2 changes: 1 addition & 1 deletion sensors/contextplugin/com.nokia.SensorService.context
Expand Up @@ -4,7 +4,7 @@
bus="system" service="com.nokia.SensorService">
<key name="Screen.IsCovered"/>
<key name="Screen.TopEdge"/>
<key name="Screen.IsFlat"/>
<key name="Position.IsFlat"/>
<key name="Environment.IsDark"/>
<key name="Environment.IsBright"/>
<key name="Position.Stable"/>
Expand Down
2 changes: 1 addition & 1 deletion sensors/contextplugin/orientationbin.cpp
Expand Up @@ -39,7 +39,7 @@
OrientationBin::OrientationBin(ContextProvider::Service& s):
topEdgeProperty(s, "Screen.TopEdge"),
isCoveredProperty(s, "Screen.IsCovered"),
isFlatProperty(s, "Screen.IsFlat"),
isFlatProperty(s, "Position.IsFlat"),
isStableProperty(s, "Position.Stable"),
isShakyProperty(s, "Position.Shaky"),
accelerometerReader(10),
Expand Down
2 changes: 1 addition & 1 deletion sensors/contextplugin/screeninterpreterfilter.h
Expand Up @@ -36,7 +36,7 @@
\class ScreenInterpreterFilter
\brief Filter for providing the Screen.TopEdge, Screen.IsFlat, and
\brief Filter for providing the Screen.TopEdge, Position.IsFlat, and
Screen.IsCovered context properties.
ScreenInterpreterFilter computes the context properties from
Expand Down
27 changes: 13 additions & 14 deletions tests/contextfw/orientation/testorientation.py
Expand Up @@ -44,9 +44,8 @@ class Orientation(unittest.TestCase):
def setUp(self):
self.fpath = "/tmp/fakedsensors/accelerometer"
self.datafaker = "/usr/bin/datafaker"
self.context_client_edge = CLTool("context-listen", "Screen.TopEdge", "Screen.IsFlat")
self.context_client_edge = CLTool("context-listen", "Screen.TopEdge", "Position.IsFlat")
self.context_client_cover = CLTool("context-listen", "Screen.IsCovered")
#~ self.context_client_flat = CLTool("context-listen", "Screen.IsFlat")

# Get angle thresholds from config
landscape_angle = int(os.popen("cat `ls /etc/sensorfw/sensord.conf.d/* /etc/sensorfw/sensord.conf` | grep orientation_threshold_landscape | head -n1 | cut -f2 -d=", "r").read())
Expand All @@ -66,46 +65,46 @@ def setUp(self):
dataSet_top.append([0, int(1000*math.cos(math.radians(90-angle))), int(1000*math.cos(math.radians(angle)))])
self.dataSet += dataSet_top

self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('')
self.expectSet.append('Screen.TopEdge = QString:"top"')
self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Screen.IsFlat = bool:false')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:false')

# TopEdge = left (U, U, L, U, L)
for angle in [0, portrait_angle-1, portrait_angle+1, portrait_angle-1, 90]:
dataSet_left.append([-int(1000*math.cos(math.radians(90-angle))), 0, int(1000*math.cos(math.radians(angle)))])
self.dataSet += dataSet_left

self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('')
self.expectSet.append('Screen.TopEdge = QString:"left"')
self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Screen.IsFlat = bool:false')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:false')

# TopEdge = bottom, (U, U, B, U, B)
for v in dataSet_top[:]:
u = v[:]
u[1] = -u[1]
self.dataSet.append(u)

self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('')
self.expectSet.append('Screen.TopEdge = QString:"bottom"')
self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Screen.IsFlat = bool:false')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:false')

# TopEdge = right (U, U, R, U, R)
for v in dataSet_left[:]:
u = v[:]
u[0] = -u[0]
self.dataSet.append(u)

self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('')
self.expectSet.append('Screen.TopEdge = QString:"right"')
self.expectSet.append('Screen.IsFlat = bool:true')
self.expectSet.append('Screen.IsFlat = bool:false')
self.expectSet.append('Position.IsFlat = bool:true')
self.expectSet.append('Position.IsFlat = bool:false')

# TopEdge: left -> top -> left (should represent bottom and right well enough)
for angle in [0, portrait_angle-1, portrait_angle+1, portrait_angle-1, 90]:
Expand Down

0 comments on commit bf7603c

Please sign in to comment.