alarmui/group/alarmuisnooze.rul
branchRCL_3
changeset 23 51372538e3d3
parent 22 07e82e2b738b
parent 20 9c5b1510919f
equal deleted inserted replaced
22:07e82e2b738b 23:51372538e3d3
     1 <!-- defines a rules to snooze and stop an active alarm on a doubletap or turndown event -->
       
     2 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
       
     3 
       
     4     <!-- active sensor channels when alarm expires -->
       
     5 		<if>
       
     6         <equals>
       
     7             <contextRef source='Sensor' type='Setting.Active'/>
       
     8             <string>Off</string>
       
     9         </equals>
       
    10         <actions>
       
    11         </actions>
       
    12     </if>
       
    13     <!-- Check if we have an active alarm and we receive an event -->
       
    14     <elseIf>
       
    15         <and>
       
    16             <!-- Must have an active alarm and receive new double tap event or orientation event from sensor -->
       
    17             <!-- ...alarm is active... -->
       
    18             <notEqual>
       
    19                 <contextRef source='AlarmUI' type='State'/>
       
    20                 <string>Inactive</string>
       
    21             </notEqual>
       
    22             <or>
       
    23                 <and>
       
    24                     <!-- Check that double tap interaction is set -->
       
    25                     <equals>
       
    26                         <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceAlarm'/>
       
    27                         <string>On</string>
       
    28                     </equals>
       
    29                     <!-- ...and we receive a new doubletap event from sensors -->
       
    30                     <contextUpdated>
       
    31                         <contextRef source='Sensor' type='Event.DoubleTap'/>
       
    32         	          </contextUpdated>
       
    33                 </and>
       
    34     	          <and>
       
    35                     <!-- Check that turning interaction is set -->
       
    36                     <equals>
       
    37                         <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm'/>
       
    38                         <string>On</string>
       
    39                     </equals>
       
    40                     <!-- ...and previous orientation is not 'Undefined' ... -->
       
    41                     <notEqual>
       
    42                         <contextRef source='Sensor' type='Event.Orientation.Previous'/>
       
    43                         <string>Undefined</string>
       
    44                     </notEqual>
       
    45                     <!-- ...and we receive a new orientation event from sensors... -->
       
    46 		                <contextChanged>
       
    47 		                    <contextRef source='Sensor' type='Event.Orientation'/>
       
    48 		    	          </contextChanged>
       
    49     	        	    <equals>
       
    50                         <contextRef source='Sensor' type='Event.Orientation'/>
       
    51                       	<string>DisplayDownwards</string>
       
    52     	              </equals>
       
    53     	          </and>
       
    54             </or>
       
    55         </and>
       
    56         <actions>
       
    57            <!-- snooze the alarm -->
       
    58             <AlarmUI.Snooze dummy='dummy'/>
       
    59 
       
    60             <!-- request vibra feedback -->
       
    61             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
       
    62         </actions>
       
    63     </elseIf>
       
    64     <!-- Check if we just have an active alarm -->
       
    65     <!-- active sensor channels when alarm expires -->
       
    66     <elseIf>
       
    67     		<and>
       
    68             <!-- ...alarm is active... -->
       
    69             <contextUpdated>
       
    70                 <contextRef source='AlarmUI' type='State'/>
       
    71             </contextUpdated>
       
    72             <notEqual>
       
    73                 <contextRef source='AlarmUI' type='State'/>
       
    74                 <string>Inactive</string>
       
    75             </notEqual>
       
    76         </and>
       
    77         <actions>
       
    78             <!-- Activate double tap events from sensor -->
       
    79             <publishContext>
       
    80                 <contextRef source='Sensor' type='Event' value='DoubleTap.Activate'/>
       
    81             </publishContext>
       
    82             <!-- Activate orientation events from sensor -->
       
    83             <publishContext>
       
    84                 <contextRef source='Sensor' type='Event' value='Orientation.Activate'/>
       
    85             </publishContext>
       
    86         </actions>
       
    87     </elseIf>
       
    88     <!-- stop an active alarm on a 'Stop' command -->
       
    89     <elseIf>
       
    90         <and>
       
    91             <!-- alarm is active... -->
       
    92             <notEqual>
       
    93                 <contextRef source='AlarmUI' type='State'/>
       
    94                 <string>Inactive</string>
       
    95             </notEqual>
       
    96             <!-- ...and we got a new stop command -->
       
    97             <contextUpdated>
       
    98                 <contextRef source='AlarmUI' type='Command'/>
       
    99             </contextUpdated>
       
   100             <equals>
       
   101                 <contextRef source='AlarmUI' type='Command'/>
       
   102                 <string>Stop</string>
       
   103             </equals>
       
   104         </and>
       
   105         <actions>
       
   106             <!-- stop the alarm -->
       
   107             <AlarmUI.Stop dummy='dummy'/>
       
   108 
       
   109             <!-- request vibra feedback -->
       
   110             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
       
   111         </actions>
       
   112     </elseIf>
       
   113     <!-- snooze an active alarm on a 'Snooze' command -->
       
   114     <elseIf>
       
   115         <and>
       
   116             <!-- alarm is active... -->
       
   117             <notEqual>
       
   118                 <contextRef source='AlarmUI' type='State'/>
       
   119                 <string>Inactive</string>
       
   120             </notEqual>
       
   121             <!-- ...and we got a new stop command -->
       
   122             <contextUpdated>
       
   123                 <contextRef source='AlarmUI' type='Command'/>
       
   124             </contextUpdated>
       
   125             <equals>
       
   126                 <contextRef source='AlarmUI' type='Command'/>
       
   127                 <string>Snooze</string>
       
   128             </equals>
       
   129         </and>
       
   130         <actions>
       
   131             <!-- snooze the alarm -->
       
   132             <AlarmUI.Snooze dummy='dummy'/>
       
   133 
       
   134             <!-- request vibra feedback -->
       
   135             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
       
   136         </actions>
       
   137     </elseIf>
       
   138 </script>