You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ld...@apache.org on 2014/07/07 21:27:06 UTC

git commit: CB-6127lisa7cordova-plugin-consolecordova-plugin-device-motion documentation translation: cordova-plugin-device-motion

Repository: cordova-plugin-device-motion
Updated Branches:
  refs/heads/master e4e4ac976 -> 8c85ec83e


CB-6127lisa7cordova-plugin-consolecordova-plugin-device-motion documentation translation: cordova-plugin-device-motion


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/8c85ec83
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/8c85ec83
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/8c85ec83

Branch: refs/heads/master
Commit: 8c85ec83ea1faaaa1e48733cd31674de24c73e65
Parents: e4e4ac9
Author: Lisa Seacat DeLuca <ld...@us.ibm.com>
Authored: Mon Jul 7 15:26:54 2014 -0400
Committer: Lisa Seacat DeLuca <ld...@us.ibm.com>
Committed: Mon Jul 7 15:26:54 2014 -0400

----------------------------------------------------------------------
 doc/ru/index.md | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 146 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/8c85ec83/doc/ru/index.md
----------------------------------------------------------------------
diff --git a/doc/ru/index.md b/doc/ru/index.md
new file mode 100644
index 0000000..4db2921
--- /dev/null
+++ b/doc/ru/index.md
@@ -0,0 +1,146 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# org.apache.cordova.device-motion
+
+Этот плагин обеспечивает доступ к акселерометру устройства. Акселерометр является датчиком движения, который обнаруживает изменение (*дельта*) в движении относительно текущей ориентации устройства, в трех измерениях вдоль осей *x*, *y* и *z* .
+
+## Установка
+
+    cordova plugin add org.apache.cordova.device-motion
+    
+
+## Поддерживаемые платформы
+
+*   Amazon Fire ОС
+*   Android
+*   BlackBerry 10
+*   Firefox OS
+*   iOS
+*   Tizen
+*   Windows Phone 7 и 8
+*   Windows 8
+
+## Методы
+
+*   navigator.accelerometer.getCurrentAcceleration
+*   navigator.accelerometer.watchAcceleration
+*   navigator.accelerometer.clearWatch
+
+## Объекты
+
+*   Acceleration
+
+## navigator.accelerometer.getCurrentAcceleration
+
+Возвращает текущее ускорение вдоль осей *x*, *y* и *z*.
+
+Значения ускорения передаются функции обратного вызова `accelerometerSuccess`.
+
+    navigator.accelerometer.getCurrentAcceleration(accelerometerSuccess, accelerometerError);
+    
+
+### Пример
+
+    function onSuccess(acceleration) {
+        alert('Acceleration X: ' + acceleration.x + '\n' +
+              'Acceleration Y: ' + acceleration.y + '\n' +
+              'Acceleration Z: ' + acceleration.z + '\n' +
+              'Timestamp: '      + acceleration.timestamp + '\n');
+    };
+    
+    function onError() {
+        alert('onError!');
+    };
+    
+    navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);
+    
+
+### Особенности iOS
+
+*   iOS не поддерживает автоматическое обновление значений для ускорения.
+
+*   Вы должны самостоятельно отслеживать изменение ускорения и считывать данные через определенные интервалы времени.
+
+*   Таким образом функция `getCurrentAcceleration` возвращает последнее значение, полученное при вызове `watchAccelerometer`.
+
+## navigator.accelerometer.watchAcceleration
+
+Извлекает текущая устройство `Acceleration` с постоянным интервалом, выполнение `accelerometerSuccess` функция обратного вызова каждый раз. Задайте интервал в миллисекундах, через `acceleratorOptions` объекта `frequency` параметр.
+
+Возвращаемый смотреть ссылки ID акселерометр часы интервал и может быть использован с `navigator.accelerometer.clearWatch` чтобы остановить просмотр акселерометр.
+
+    var watchID = navigator.accelerometer.watchAcceleration(accelerometerSuccess,
+                                                           accelerometerError,
+                                                           [accelerometerOptions]);
+    
+
+*   **accelerometerOptions**: Объект с следующие необязательные свойствами: 
+    *   **frequency**: частота обновленя данных получаемых из объекта `Acceleration` в миллисекундах. *(Число)* (По умолчанию: 10000)
+
+### Пример
+
+    function onSuccess(acceleration) {
+        alert('Acceleration X: ' + acceleration.x + '\n' +
+              'Acceleration Y: ' + acceleration.y + '\n' +
+              'Acceleration Z: ' + acceleration.z + '\n' +
+              'Timestamp: '      + acceleration.timestamp + '\n');
+    };
+    
+    function onError() {
+        alert('onError!');
+    };
+    
+    var options = { frequency: 3000 };  // Update every 3 seconds
+    
+    var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);
+    
+
+### Особенности iOS
+
+API вызывает функцию обратного вызова с указанным интервалом, но имеет ограничение по частоте запросов к устройству от 40 мс и до 1000 мс. Например если вы запрашиваете интервал 3 секунды, (3000 мс), API запрашивает данные от устройства каждую секунду, но функция обратного вызова будет срабатывать только каждые 3 секунды.
+
+## navigator.accelerometer.clearWatch
+
+Останавливает отслеживание изменений объекта `Acceleration`, на который ссылается параметр `watchID`.
+
+    navigator.accelerometer.clearWatch(watchID);
+    
+
+*   **watchID**: идентификатор, возвращенный`navigator.accelerometer.watchAcceleration`.
+
+### Пример
+
+    var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);
+    
+    // ... later on ...
+    
+    navigator.accelerometer.clearWatch(watchID);
+    
+
+## Acceleration
+
+Содержит данные полученные от акселерометра на определенный момент времени. Ускорение значения включают эффект гравитации (9,81 м/с ^ 2), так что когда устройство лежит плоская и вверх, *x*, *y*, и *z* значения, возвращаемые должны быть `` , `` , и`9.81`.
+
+### Свойства
+
+*   **x**: величина ускорение по оси x. (в м/с ^ 2) *(Число)*
+*   **y**: величина ускорение по оси y. (в м/с ^ 2) *(Число)*
+*   **z**: величина ускорение по оси z. (в м/с ^ 2) *(Число)*
+*   **timestamp**: временая метка в миллисекундах. *(DOMTimeStamp)*
\ No newline at end of file