From 0d290f4cfe95ef99f48df67dfd78838f4d4a1e00 Mon Sep 17 00:00:00 2001 From: ocogeclub Date: Wed, 22 Dec 2021 22:44:18 +0900 Subject: [PATCH] =?UTF-8?q?[update]=20=E3=83=98=E3=83=AB=E3=83=91=E3=83=BC?= =?UTF-8?q?=E3=82=A2=E3=83=97=E3=83=AA=E3=81=AE=E5=A0=B4=E6=89=80=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index_elutil.js | 3 ++- ugj_blocks.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index_elutil.js b/index_elutil.js index bdae0ed..12f0396 100644 --- a/index_elutil.js +++ b/index_elutil.js @@ -8,7 +8,7 @@ const ugj_const = { mascot_path: './img/', mascot_defname: 'tamachee.png', library_path: './lib/', - executable_path: './bin/', + // executable_path: './bin/', localStorage_fname: 'ocoge.json', error_ja_all: 'エラーが発生しました。\n『おこげ倶楽部』までお問い合わせください。', pig: 'pigpio', @@ -32,6 +32,7 @@ class elUtil { this.gpio_backend = ugj_const.pig; this.i2c_bus = ugj_const.i2c_defbus; this.doc_current = process.env["HOME"] + '/Documents'; + this.executable_path = process.env["HOME"] + '/.local/lib/ocogeclub/' } // 0で数値の桁合わせ : NUM=値 LEN=桁数 zeroPadding(NUM, LEN) { diff --git a/ugj_blocks.js b/ugj_blocks.js index 3f3a606..643b09c 100644 --- a/ugj_blocks.js +++ b/ugj_blocks.js @@ -2889,7 +2889,7 @@ Blockly.Blocks['aquestalk_pi'] = { }; Blockly.JavaScript['aquestalk_pi'] = function (block) { var value_talk = Blockly.JavaScript.valueToCode(block, 'talk', Blockly.JavaScript.ORDER_ATOMIC); - var code = `'${ugj_const.executable_path}aquestalkpi/AquesTalkPi -g 50 ' + ${value_talk} + ' | aplay', { shell: true }`; + var code = `'${elutil.executable_path}aquestalkpi/AquesTalkPi -g 50 ' + ${value_talk} + ' | aplay', { shell: true }`; return [code, Blockly.JavaScript.ORDER_NONE]; }; @@ -2929,7 +2929,7 @@ Blockly.Blocks['ugj_child_julius'] = { } }; Blockly.JavaScript['ugj_child_julius'] = function (block) { - var code = `'${ugj_const.executable_path}julius/julius-simple', ['-C', '${ugj_const.executable_path}julius/dictation-kit/am-gmm.jconf', '-gram', '${ugj_const.executable_path}julius/dic/assistant', '-nostrip']`; + var code = `'${elutil.executable_path}julius/julius-simple', ['-C', '${elutil.executable_path}julius/dictation-kit/am-gmm.jconf', '-gram', '${elutil.executable_path}julius/dic/assistant', '-nostrip']`; return [code, Blockly.JavaScript.ORDER_NONE]; }; // irrp.py - pigpioによる赤外線リモコンの学習 @@ -2997,7 +2997,7 @@ Blockly.Blocks['ugj_child_irrcvr'] = { Blockly.JavaScript['ugj_child_irrcvr'] = function (block) { var value_gpio = Blockly.JavaScript.valueToCode(block, 'gpio', Blockly.JavaScript.ORDER_ATOMIC); // var code = `'python3', ['./scripts/irrcvr.py', '-g', '${value_gpio}']`; - var code = `'${ugj_const.executable_path}ir_hash/ir_hash', ['${value_gpio}']`; + var code = `'${elutil.executable_path}ir_hash/ir_hash', ['${value_gpio}']`; return [code, Blockly.JavaScript.ORDER_NONE]; };