From 283ad68560c5d080f04a8b4f727fdc863bf86f52 Mon Sep 17 00:00:00 2001 From: Wakabayashi Kenichi Date: Tue, 30 Apr 2019 17:17:05 +0900 Subject: [PATCH] Add Japanese resources --- _locales/ja/KeiganMotor-jsdoc-strings.json | 57 ++++++++++++++++++++++ _locales/ja/KeiganMotor-strings.json | 38 +++++++++++++++ main.ts | 8 ++- pxt.json | 12 +++-- 4 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 _locales/ja/KeiganMotor-jsdoc-strings.json create mode 100644 _locales/ja/KeiganMotor-strings.json diff --git a/_locales/ja/KeiganMotor-jsdoc-strings.json b/_locales/ja/KeiganMotor-jsdoc-strings.json new file mode 100644 index 0000000..47def44 --- /dev/null +++ b/_locales/ja/KeiganMotor-jsdoc-strings.json @@ -0,0 +1,57 @@ +{ + "keiganmotor": "Keigan Motor制御用パッケージ", + "keiganmotor.KeiganMotor": "KeiganMotor", + "keiganmotor.KeiganMotor.disable": "OFFにする", + "keiganmotor.KeiganMotor.enable": "ONにする", + "keiganmotor.KeiganMotor.eraseMotion": "指定番号の動作を消去する", + "keiganmotor.KeiganMotor.free": "解放する(モーターへの動力供給を止める)", + "keiganmotor.KeiganMotor.getDegree": "現在位置[度]を調べる\n@return 現在の角度", + "keiganmotor.KeiganMotor.getPosition": "KeiganMotorのパラーメーターを調べる\n@return 位置、回転速度、トルク", + "keiganmotor.KeiganMotor.getRpm": "回転速度を調べる [回転/分]", + "keiganmotor.KeiganMotor.getTorque": "トルクを調べる [Nm]", + "keiganmotor.KeiganMotor.getVelocity": "回転速度を調べる [ラジアン/秒]", + "keiganmotor.KeiganMotor.led": "LEDの状態と色を指定する", + "keiganmotor.KeiganMotor.led|param|blue": "0〜255で指定します", + "keiganmotor.KeiganMotor.led|param|green": "0〜255で指定します", + "keiganmotor.KeiganMotor.maxTorque": "最大トルクを指定 [Nm]", + "keiganmotor.KeiganMotor.moveBy": "指定角度[ラジアン]だけ回転", + "keiganmotor.KeiganMotor.moveByDeg": "指定角度[度]だけ回転", + "keiganmotor.KeiganMotor.moveByDeg|param|distance": "[度]", + "keiganmotor.KeiganMotor.moveBy|param|distance": "[度]", + "keiganmotor.KeiganMotor.moveTo": "指定位置へ回転させる[ラジアン]", + "keiganmotor.KeiganMotor.moveToDeg": "指定位置へ回転させる[度]", + "keiganmotor.KeiganMotor.moveToDeg|param|position": "[度]", + "keiganmotor.KeiganMotor.moveTo|param|position": "[ラジアン]", + "keiganmotor.KeiganMotor.preparePlaybackMotion": "指定番号の再生準備を行う", + "keiganmotor.KeiganMotor.preparePlaybackMotion|param|index": "@param repeating // times", + "keiganmotor.KeiganMotor.preparePlaybackMotion|param|option": "// playback start option ", + "keiganmotor.KeiganMotor.readMotorMeasurement": "モーターの情報を調べる(位置、回転速度、トルク)", + "keiganmotor.KeiganMotor.reboot": "再起動", + "keiganmotor.KeiganMotor.run": "指定の回転速度で回転する[ラジアン/秒]", + "keiganmotor.KeiganMotor.runForward": "正転させr", + "keiganmotor.KeiganMotor.runReverse": "逆転させる", + "keiganmotor.KeiganMotor.runRpm": "指定回転速度で回転させる[回転/分]", + "keiganmotor.KeiganMotor.runRpm|param|velocity": "[回転/分]", + "keiganmotor.KeiganMotor.run|param|velocity": "[ラジアン/秒]", + "keiganmotor.KeiganMotor.send": "無線でバッファの内容を送信", + "keiganmotor.KeiganMotor.speed": "速度を指定[ラジアン/秒]", + "keiganmotor.KeiganMotor.speedRpm": "速度を指定[回転/分]", + "keiganmotor.KeiganMotor.startPlaybackMotion": "指定したインデックスを再生する", + "keiganmotor.KeiganMotor.startTeachingMotion": "指定したインデックスで記録する", + "keiganmotor.KeiganMotor.startTeachingMotion|param|index": "@param 時間 [ミリ秒]", + "keiganmotor.KeiganMotor.stop": "停止する(スピードを0にする)", + "keiganmotor.KeiganMotor.stopPlaybackMotion": "指定したインデックスの再生を終了する", + "keiganmotor.KeiganMotor.stopTeachingMotion": "記録を終了する", + "keiganmotor.KeiganMotor.write": "Send command after prepending name = \"XXXX\" \n[ X X X X | CMD | packetId ]", + "keiganmotor.KeiganMotor.writeFloat32": "Send command and float value after prepending name = \"XXXX\"\n[ X X X X | CMD | packetId | VALUES(BYTES) ]", + "keiganmotor.KeiganMotor.writeUInt16": "Send command and UInt16 value after prepending name = \"XXXX\"\n[ X X X X | CMD | packetId | VALUE ]", + "keiganmotor.KeiganMotor.writeUInt16UInt32": "Send command, UInt16 and UInt32 values after prepending name = \"XXXX\"\n[ X X X X | CMD | packetId | VALUE1 | VALUE2 ]", + "keiganmotor.KeiganMotor.writeUInt16UInt32UInt8": "Send command, UInt16, UInt32, and UInt8 value after prepending name = \"XXXX\"\n[ X X X X | CMD | packetId | VALUE1 | VALUE2 | VALUE3 ]", + "keiganmotor.KeiganMotor.writeUInt32": "Send command and UInt32 value after prepending name = \"XXXX\"\n[ X X X X | CMD | packetId | VALUES(BYTES) ]", + "keiganmotor.KeiganMotor.writeUInt8Array": "Send command and UInt8 values after prepending name = \"XXXX\"\n[ X X X X | CMD | packetId | VALUES(BYTES) ]", + "keiganmotor.create": "新しいKeiganMotorを4桁のデバイス名で生成する", + "keiganmotor.create|param|name": "KeiganMotorのデバイス名に含まれています", + "keiganmotor.onReceivedMotorMeasurement": "KeiganMotorから情報を受け取った時のイベント", + "led_state": "This extension enables to control KeiganMotor via \"RADIO\"\n* Refer to https://ukbaz.github.io/howto/ubit_radio.html\nto know RADIO Packet data structure\n* Packet Spec:\n0 1 2 | 3 | 4 ... 7 | 8 ... 11 | 12 ... 31\n--------------------------------------------------------------------------\ndal header | packet type | system time | serial number | payload\n* --- DAL HEADER\n01 raw payload\n00 group number\n01 version 1\n* Packet from KeiganMotor also meets this packet structure.\nThe serial number is KeiganMotor's serial number.\n\nLED state", + "playback_option": "再生開始オプション" +} \ No newline at end of file diff --git a/_locales/ja/KeiganMotor-strings.json b/_locales/ja/KeiganMotor-strings.json new file mode 100644 index 0000000..8a5f140 --- /dev/null +++ b/_locales/ja/KeiganMotor-strings.json @@ -0,0 +1,38 @@ +{ + "keiganmotor.KeiganMotor.disable|block": "%KeiganMotor|OFFにする", + "keiganmotor.KeiganMotor.enable|block": "%KeiganMotor|ONにする", + "keiganmotor.KeiganMotor.eraseMotion|block": "%KeiganMotor| %index|番の動作を消去", + "keiganmotor.KeiganMotor.free|block": "%KeiganMotor|解放する", + "keiganmotor.KeiganMotor.getDegree|block": "%KeiganMotor|角度[度]", + "keiganmotor.KeiganMotor.getPosition|block": "%KeiganMotor|位置[ラジアン]", + "keiganmotor.KeiganMotor.getRpm|block": "%KeiganMotor|回転数/分", + "keiganmotor.KeiganMotor.getTorque|block": "%KeiganMotor|トルク [Nm]", + "keiganmotor.KeiganMotor.getVelocity|block": "%KeiganMotor|回転速度 [ラジアン/秒]", + "keiganmotor.KeiganMotor.led|block": "%KeiganMotor|LEDを %led_state|赤 %red| 緑 %green| 青 %blue|", + "keiganmotor.KeiganMotor.maxTorque|block": "%KeiganMotor|最大トルク[Nm]を %value|にする", + "keiganmotor.KeiganMotor.moveByDeg|block": "%KeiganMotor|[degree] %distance|度回転させる", + "keiganmotor.KeiganMotor.moveToDeg|block": "%KeiganMotor|%position|度まで回転させる", + "keiganmotor.KeiganMotor.preparePlaybackMotion|block": "%KeiganMotor| %index|番の動作の再生準備", + "keiganmotor.KeiganMotor.readMotorMeasurement|block": "%KeiganMotor|モーターの情報を調べる", + "keiganmotor.KeiganMotor.reboot|block": "%KeiganMotor|再起動", + "keiganmotor.KeiganMotor.runForward|block": "%KeiganMotor|正転させる", + "keiganmotor.KeiganMotor.runReverse|block": "%KeiganMotor|逆転させる", + "keiganmotor.KeiganMotor.runRpm|block": "%KeiganMotor|回転速度[rpm] %velocity|で回転させる", + "keiganmotor.KeiganMotor.speedRpm|block": "%KeiganMotor|回転速度[rpm]を %value|にする", + "keiganmotor.KeiganMotor.startPlaybackMotion|block": "%KeiganMotor|再生開始", + "keiganmotor.KeiganMotor.startTeachingMotion|block": "%KeiganMotor| %index|で記録開始", + "keiganmotor.KeiganMotor.stopPlaybackMotion|block": "%KeiganMotor|再生を終了", + "keiganmotor.KeiganMotor.stopTeachingMotion|block": "%KeiganMotor|記録を終了", + "keiganmotor.KeiganMotor.stop|block": "%KeiganMotor|停止する", + "keiganmotor.create|block": "KeiganMotor %name", + "keiganmotor.onReceivedMotorMeasurement|block": "モーターから情報を受け取った時", + "keiganmotor.setGroup|block": "グループIDを %id|にする", + "keiganmotor|block": "KeiganMotor", + "{id:category}Keiganmotor": "Keiganmotor", + "led_state.OFF|block": "消灯", + "led_state.ON_DIM|block": "少し点灯", + "led_state.ON_FLASH|block": "点滅", + "led_state.ON_SOLID|block": "点灯", + "playback_option.START_FROM_CURRENT|block": "現時点から", + "playback_option.START_FROM_RAW|block": "ローから" +} \ No newline at end of file diff --git a/main.ts b/main.ts index d692ee0..4aa339b 100644 --- a/main.ts +++ b/main.ts @@ -22,9 +22,13 @@ * LED state */ enum led_state { + //% block="OFF" OFF = 0, + //% block="SOLID" ON_SOLID = 1, + //% block="FLASH" ON_FLASH = 2, + //% block="DIM" ON_DIM = 3 } @@ -32,14 +36,16 @@ enum led_state { * Playback motion start option */ enum playback_option { + //% block="RAW" START_FROM_RAW = 0, // Start from the raw position. + //% block="CURRENT" START_FROM_CURRENT = 1, // Start from the current position. } /** * Functions to operate KeiganMotor */ -//% weight=5 color=#D82317 icon="\uf110" +//% weight=5 color=#D82317 icon="\uf110" block="KeiganMotor" namespace keiganmotor { const RPM_TO_RADIANPERSEC = 0.10471975511965977 diff --git a/pxt.json b/pxt.json index ad4e572..df5f1c3 100644 --- a/pxt.json +++ b/pxt.json @@ -1,18 +1,20 @@ { - "name": "pxt-keiganmotor", - "version": "1.0.0", - "description": "", + "name": "KeiganMotor", + "version": "1.0.1", + "description": "MakeCode Extension to control KeiganMotor by micro:bit", "dependencies": { "core": "*", "radio": "*" }, "files": [ "README.md", - "main.ts" + "main.ts", + "_locales/ja/KeiganMotor-strings.json", + "_locales/ja/KeiganMotor-jsdoc-strings.json" ], "testFiles": [ "test.ts" ], - "public": false, + "public": true, "installedVersion": "workspace:0e3a2b6f-88de-41a1-ad5f-8ba557bbe6cd" } \ No newline at end of file