org.symbian.tools.wrttools.previewer/preview/data/sensor_data.js
changeset 37 641b65b14318
child 210 0f7abfd6ae62
equal deleted inserted replaced
35:ec3f1313ae92 37:641b65b14318
       
     1 /**
       
     2  * SAPI Sample Data - Sensor
       
     3  */
       
     4 
       
     5 (function(){
       
     6 
       
     7 var property = {
       
     8 	"AccelerometerAxis":{
       
     9 		"Availability":{
       
    10 			"PropertyId":"Availability",
       
    11 			"PropertyDataType":0,
       
    12 			"ItemIndex":-1,
       
    13 			"ReadOnly":true,
       
    14 			"PropertyValue":1
       
    15 			},
       
    16 		"ChannelAccuracy":{
       
    17 			"PropertyId":"ChannelAccuracy",
       
    18 			"PropertyDataType":1,
       
    19 			"ItemIndex":-1,
       
    20 			"ReadOnly":true,
       
    21 			"PropertyValue":10
       
    22 			},
       
    23 		"ChannelDataFormat":
       
    24 		{
       
    25 			"PropertyId":"ChannelDataFormat",
       
    26 			"PropertyDataType":0,
       
    27 			"ItemIndex":-1,
       
    28 			"ReadOnly":true,
       
    29 			"PropertyValue":2
       
    30 		},
       
    31 		"ChannelScale":
       
    32 		{
       
    33 			"PropertyId":"ChannelScale",
       
    34 			"PropertyDataType":0,
       
    35 			"ItemIndex":-1,
       
    36 			"ReadOnly":true,
       
    37 			"PropertyValue":0
       
    38 		},
       
    39 		"ChannelUnit":
       
    40 		{
       
    41 			"PropertyId":"ChannelUnit",
       
    42 			"PropertyDataType":0,
       
    43 			"ItemIndex":-1,
       
    44 			"ReadOnly":true,
       
    45 			"PropertyValue":10
       
    46 		},
       
    47 		"ConnectionType":
       
    48 		{
       
    49 			"PropertyId":"ConnectionType",
       
    50 			"PropertyDataType":0,
       
    51 			"ItemIndex":-1,
       
    52 			"ReadOnly":true,
       
    53 			"PropertyValue":1
       
    54 		},
       
    55 		"DataRate":
       
    56 		{
       
    57 			"PropertyId":"DataRate",
       
    58 			"PropertyDataType":0,
       
    59 			"ItemIndex":-1,
       
    60 			"ReadOnly":true,
       
    61 			"PropertyValue":0
       
    62 		},
       
    63 		"Description":
       
    64 		{
       
    65 			"PropertyId":"Description",
       
    66 			"PropertyDataType":2,
       
    67 			"ItemIndex":-1,
       
    68 			"ReadOnly":true,
       
    69 			"PropertyValue":"Accelerometer"
       
    70 		},
       
    71 		"MeasureRange":
       
    72 		{
       
    73 			"PropertyId":"MeasureRange",
       
    74 			"PropertyDataType":1,
       
    75 			"ItemIndex":-1,
       
    76 			"ReadOnly":true,
       
    77 			"PropertyValue":0
       
    78 		},
       
    79 		"ScaledRange":
       
    80 		{
       
    81 			"PropertyId":"ScaledRange",
       
    82 			"PropertyDataType":0,
       
    83 			"ItemIndex":-1,
       
    84 			"ReadOnly":true,
       
    85 			"PropertyValue":8
       
    86 		}
       
    87 	},
       
    88 	"AccelerometerDoubleTapping":
       
    89 	{
       
    90 		"Availability":
       
    91 		{
       
    92 			"PropertyId":"Availability",
       
    93 			"PropertyDataType":0,
       
    94 			"ItemIndex":-1,
       
    95 			"ReadOnly":true,
       
    96 			"PropertyValue":1
       
    97 		},
       
    98 		"ChannelAccuracy":
       
    99 		{
       
   100 			"PropertyId":"ChannelAccuracy",
       
   101 			"PropertyDataType":1,
       
   102 			"ItemIndex":-1,
       
   103 			"ReadOnly":true,
       
   104 			"PropertyValue":10
       
   105 		},
       
   106 		"ChannelDataFormat":
       
   107 		{
       
   108 			"PropertyId":"ChannelDataFormat",
       
   109 			"PropertyDataType":0,
       
   110 			"ItemIndex":-1,
       
   111 			"ReadOnly":true,
       
   112 			"PropertyValue":2
       
   113 		},
       
   114 		"ChannelScale":
       
   115 		{
       
   116 			"PropertyId":"ChannelScale",
       
   117 			"PropertyDataType":0,
       
   118 			"ItemIndex":-1,
       
   119 			"ReadOnly":true,
       
   120 			"PropertyValue":0
       
   121 		},
       
   122 		"ChannelUnit":
       
   123 		{
       
   124 			"PropertyId":"ChannelUnit",
       
   125 			"PropertyDataType":0,
       
   126 			"ItemIndex":-1,
       
   127 			"ReadOnly":true,
       
   128 			"PropertyValue":10
       
   129 		},
       
   130 		"ConnectionType":
       
   131 		{
       
   132 			"PropertyId":"ConnectionType",
       
   133 			"PropertyDataType":0,
       
   134 			"ItemIndex":-1,
       
   135 			"ReadOnly":true,
       
   136 			"PropertyValue":1
       
   137 		},
       
   138 		"Description":
       
   139 		{
       
   140 			"PropertyId":"Description",
       
   141 			"PropertyDataType":2,
       
   142 			"ItemIndex":-1,
       
   143 			"ReadOnly":true,
       
   144 			"PropertyValue":"Accelerometer"
       
   145 		},
       
   146 		"MeasureRange":
       
   147 		{
       
   148 			"PropertyId":"MeasureRange",
       
   149 			"PropertyDataType":1,
       
   150 			"ItemIndex":-1,
       
   151 			"ReadOnly":true,
       
   152 			"PropertyValue":0
       
   153 		},
       
   154 		"ScaledRange":
       
   155 		{
       
   156 			"PropertyId":"ScaledRange",
       
   157 			"PropertyDataType":0,
       
   158 			"ItemIndex":-1,
       
   159 			"ReadOnly":true,
       
   160 			"PropertyValue":8
       
   161 		}
       
   162 	},
       
   163 	"Orientation":
       
   164 	{
       
   165 		"Availability":
       
   166 		{
       
   167 			"PropertyId":"Availability",
       
   168 			"PropertyDataType":0,
       
   169 			"ItemIndex":-1,
       
   170 			"ReadOnly":true,
       
   171 			"PropertyValue":1
       
   172 		},
       
   173 		"DataRate":
       
   174 		{
       
   175 			"PropertyId":"DataRate",
       
   176 			"PropertyDataType":0,
       
   177 			"ItemIndex":-1,
       
   178 			"ReadOnly":true,
       
   179 			"PropertyValue":0
       
   180 		},
       
   181 		"MeasureRange":
       
   182 		{
       
   183 			"PropertyId":"MeasureRange",
       
   184 			"PropertyDataType":0,
       
   185 			"ItemIndex":-1,
       
   186 			"ReadOnly":true,
       
   187 			"PropertyValue":0
       
   188 		}
       
   189 	},
       
   190 	"Rotation":
       
   191 	{
       
   192 		"Availability":
       
   193 		{
       
   194 			"PropertyId":"Availability",
       
   195 			"PropertyDataType":0,
       
   196 			"ItemIndex":-1,
       
   197 			"ReadOnly":true,
       
   198 			"PropertyValue":1
       
   199 		},
       
   200 		"ChannelAccuracy":
       
   201 		{
       
   202 			"PropertyId":"ChannelAccuracy",
       
   203 			"PropertyDataType":1,
       
   204 			"ItemIndex":-1,
       
   205 			"ReadOnly":true,
       
   206 			"PropertyValue":0.041666666666666664
       
   207 		},
       
   208 		"DataRate":
       
   209 		{
       
   210 			"PropertyId":"DataRate",
       
   211 			"PropertyDataType":0,
       
   212 			"ItemIndex":-1,
       
   213 			"ReadOnly":true,
       
   214 			"PropertyValue":0
       
   215 		},
       
   216 		"MeasureRange":
       
   217 		{
       
   218 			"PropertyId":"MeasureRange",
       
   219 			"PropertyDataType":1,
       
   220 			"ItemIndex":-1,
       
   221 			"ReadOnly":true,
       
   222 			"PropertyValue":359
       
   223 		}
       
   224 	}
       
   225 };
       
   226 var data_all =[{
       
   227 		"ChannelId":7,
       
   228 		"ContextType":2,
       
   229 		"Quantity":10,
       
   230 		"ChannelType":270553214,
       
   231 		"Location":"NoLoc",
       
   232 		"VendorId":"Nokia",
       
   233 		"DataItemSize":24,
       
   234 		"ChannelDataTypeId":270553214
       
   235 		},
       
   236 		{
       
   237 		"ChannelId":8,
       
   238 		"ContextType":2,
       
   239 		"Quantity":11,
       
   240 		"ChannelType":270553217,
       
   241 		"Location":"NoLoc",
       
   242 		"VendorId":"Nokia",
       
   243 		"DataItemSize":16,
       
   244 		"ChannelDataTypeId":270553215
       
   245 		},
       
   246 		{
       
   247 		"ChannelId":10,
       
   248 		"ContextType":3,
       
   249 		"Quantity":12,
       
   250 		"ChannelType":270553224,
       
   251 		"Location":"NoLoc",
       
   252 		"VendorId":"Nokia",
       
   253 		"DataItemSize":16,
       
   254 		"ChannelDataTypeId":270553224
       
   255 		},
       
   256 		{
       
   257 		"ChannelId":11,
       
   258 		"ContextType":3,
       
   259 		"Quantity":13,
       
   260 		"ChannelType":270553225,
       
   261 		"Location":"NoLoc",
       
   262 		"VendorId":"Nokia",
       
   263 		"DataItemSize":24,
       
   264 		"ChannelDataTypeId":270553225
       
   265 		}];
       
   266 		
       
   267 var data_accelerometerAxis = [{
       
   268 		"ChannelId":7,
       
   269 		"ContextType":2,
       
   270 		"Quantity":10,
       
   271 		"ChannelType":270553214,
       
   272 		"Location":"NoLoc",
       
   273 		"VendorId":"Nokia",
       
   274 		"DataItemSize":24,
       
   275 		"ChannelDataTypeId":270553214
       
   276 		}];
       
   277 		
       
   278 var data_accelerometerDoubleTapping = [{
       
   279 		"ChannelId":8,
       
   280 		"ContextType":2,
       
   281 		"Quantity":11,
       
   282 		"ChannelType":270553217,
       
   283 		"Location":"NoLoc",
       
   284 		"VendorId":"Nokia",
       
   285 		"DataItemSize":16,
       
   286 		"ChannelDataTypeId":270553215
       
   287 		}];
       
   288 		
       
   289 var data_orientation = [{
       
   290 		"ChannelId":10,
       
   291 		"ContextType":3,
       
   292 		"Quantity":12,
       
   293 		"ChannelType":270553224,
       
   294 		"Location":"NoLoc",
       
   295 		"VendorId":"Nokia",
       
   296 		"DataItemSize":16,
       
   297 		"ChannelDataTypeId":270553224
       
   298 		}];
       
   299 		
       
   300 var data_rotation = [{
       
   301 		"ChannelId":11,
       
   302 		"ContextType":3,
       
   303 		"Quantity":13,
       
   304 		"ChannelType":270553225,
       
   305 		"Location":"NoLoc",
       
   306 		"VendorId":"Nokia",
       
   307 		"DataItemSize":24,
       
   308 		"ChannelDataTypeId":270553225
       
   309 		}];
       
   310 
       
   311 
       
   312 var dataRet_accelerometerAxis = [{
       
   313 		"DataType":"AxisData",
       
   314 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   315 		"XAxisData":30,
       
   316 		"YAxisData":30,
       
   317 		"ZAxisData":30
       
   318 		},{
       
   319 		"DataType":"AxisData",
       
   320 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   321 		"XAxisData":35,
       
   322 		"YAxisData":30,
       
   323 		"ZAxisData":30
       
   324 		},{
       
   325 		"DataType":"AxisData",
       
   326 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   327 		"XAxisData":30,
       
   328 		"YAxisData":35,
       
   329 		"ZAxisData":30
       
   330 		},{
       
   331 		"DataType":"AxisData",
       
   332 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   333 		"XAxisData":30,
       
   334 		"YAxisData":30,
       
   335 		"ZAxisData":35
       
   336 		},{
       
   337 		"DataType":"AxisData",
       
   338 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   339 		"XAxisData":40,
       
   340 		"YAxisData":30,
       
   341 		"ZAxisData":30
       
   342 		},{
       
   343 		"DataType":"AxisData",
       
   344 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   345 		"XAxisData":30,
       
   346 		"YAxisData":40,
       
   347 		"ZAxisData":30
       
   348 		}];
       
   349 		
       
   350 var dataRet_accelerometerDoubleTapping = [{
       
   351 		"DataType":"DoubleTappingData",
       
   352 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   353 		"DeviceDirection":30
       
   354 		},{
       
   355 		"DataType":"DoubleTappingData",
       
   356 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   357 		"DeviceDirection":40
       
   358 		},{
       
   359 		"DataType":"DoubleTappingData",
       
   360 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   361 		"DeviceDirection":50
       
   362 		},{
       
   363 		"DataType":"DoubleTappingData",
       
   364 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   365 		"DeviceDirection":60
       
   366 		},{
       
   367 		"DataType":"DoubleTappingData",
       
   368 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   369 		"DeviceDirection":70
       
   370 		},{
       
   371 		"DataType":"DoubleTappingData",
       
   372 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   373 		"DeviceDirection":80
       
   374 		},{
       
   375 		"DataType":"DoubleTappingData",
       
   376 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",		
       
   377 		"DeviceDirection":90
       
   378 		}];
       
   379 		
       
   380 var dataRet_orientation = [{
       
   381 		"DataType":"OrientationData",
       
   382 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   383 		"DeviceOrientation":"DisplayUp"		
       
   384 		},{
       
   385 		"DataType":"OrientationData",
       
   386 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   387 		"DeviceOrientation":"DisplayDown"		
       
   388 		},{
       
   389 		"DataType":"OrientationData",
       
   390 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   391 		"DeviceOrientation":"DisplayLeftUp"		
       
   392 		},{
       
   393 		"DataType":"OrientationData",
       
   394 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   395 		"DeviceOrientation":"DisplayRightUp"		
       
   396 		},{
       
   397 		"DataType":"OrientationData",
       
   398 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   399 		"DeviceOrientation":"DisplayUpwards"		
       
   400 		},{
       
   401 		"DataType":"OrientationData",
       
   402 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   403 		"DeviceOrientation":"DisplayDownwards"		
       
   404 		},{
       
   405 		"DataType":"OrientationData",
       
   406 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   407 		"DeviceOrientation":"Undefined"		
       
   408 		}];
       
   409 		
       
   410 var dataRet_rotation = [{
       
   411 		"DataType":"RotationData",
       
   412 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   413 		"XRotation":30,
       
   414 		"YRotation":35,
       
   415 		"ZRotation":30
       
   416 		},{
       
   417 		"DataType":"RotationData",
       
   418 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   419 		"XRotation":35,
       
   420 		"YRotation":30,
       
   421 		"ZRotation":30
       
   422 		},{
       
   423 		"DataType":"RotationData",
       
   424 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   425 		"XRotation":30,
       
   426 		"YRotation":30,
       
   427 		"ZRotation":35
       
   428 		},{
       
   429 		"DataType":"RotationData",
       
   430 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   431 		"XRotation":40,
       
   432 		"YRotation":30,
       
   433 		"ZRotation":30
       
   434 		},{
       
   435 		"DataType":"RotationData",
       
   436 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   437 		"XRotation":30,
       
   438 		"YRotation":40,
       
   439 		"ZRotation":30
       
   440 		},{
       
   441 		"DataType":"RotationData",
       
   442 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   443 		"XRotation":30,
       
   444 		"YRotation":30,
       
   445 		"ZRotation":40
       
   446 		},{
       
   447 		"DataType":"RotationData",
       
   448 		"TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",
       
   449 		"XRotation":50,
       
   450 		"YRotation":50,
       
   451 		"ZRotation":50
       
   452 		}];
       
   453 
       
   454     /**
       
   455      * register data!
       
   456      */
       
   457 	device.implementation.loadData('Service.Sensor','SensorProperty',property);
       
   458     device.implementation.loadData('Service.Sensor', 'All', data_all);
       
   459     device.implementation.loadData('Service.Sensor', 'AccelerometerAxis', data_accelerometerAxis);
       
   460     device.implementation.loadData('Service.Sensor', 'AccelerometerDoubleTapping', data_accelerometerDoubleTapping);
       
   461     device.implementation.loadData('Service.Sensor', 'Orientation', data_orientation);
       
   462     device.implementation.loadData('Service.Sensor', 'Rotation', data_rotation);
       
   463 /*    device.implementation.loadData('Service.Sensor', 'AccelerometerAxisRet', dataRet_accelerometerAxis);
       
   464     device.implementation.loadData('Service.Sensor', 'AccelerometerDoubleTappingRet', dataRet_accelerometerDoubleTapping);
       
   465     device.implementation.loadData('Service.Sensor', 'OrientationRet', dataRet_orientation);
       
   466     device.implementation.loadData('Service.Sensor', 'RotationRet', dataRet_rotation);*/
       
   467 
       
   468 })()
       
   469